query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Meat is: the last N elements (messages, frames) in this dicussion roll See discussion_roll_mail_setup for explanation of opts
def on_discussion_roll_reply(opts) discussion_roll_mail_setup(opts) if @last_post_video_only verb, suffix = "sent", "video" else verb, suffix = "replied to", nil end @subject = subject_for(@poster_string_name, opts[:all_participants] - [opts[:posting_participant], opts[:receiving_participant]], verb, suffix) mail :from => "\"Shelby Mail\" <#{Settings::Email.discussion_roll['from_email']}>", :reply_to => "\"No Reply\" <#{Settings::Email.discussion_roll['from_email']}>", :to => opts[:receiving_participant_email_address], :subject => @subject end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def discussion_roll_mail_setup(opts)\n @roll = opts[:discussion_roll]\n @recipient_string_id = opts[:receiving_participant].is_a?(User) ? opts[:receiving_participant].id.to_s : opts[:receiving_participant]\n @poster_string_name = nickname_for_user_or_email(opts[:posting_participant])\n @token = opts[:token]\n @permalink = \"http://shelby.tv/mail/#{@roll.id}?u=#{CGI.escape(@recipient_string_id)}&t=#{CGI.escape(CGI.escape(@token))}\"\n\n sendgrid_category Settings::Email.discussion_roll[\"category\"]\n sendgrid_ganalytics_options(:utm_source => 'discussion_roll', :utm_medium => 'notification', :utm_campaign => \"roll_#{@roll.id}\")\n \n # Displaying context for the most recent frame only\n most_recent_frame = Frame.where(:roll_id => @roll.id).order(:score.desc).first\n @conversation_elements = conversation_elements_for([most_recent_frame], Settings::Email.discussion_roll['max_element_count'])\n \n # get the latest message from the latest frame, use that to determine if last posting was video-only\n most_recent_message = most_recent_frame.conversation.messages[-1]\n @last_post_video_only = !most_recent_message or most_recent_message.text.blank?\n end", "def on_discussion_roll_creation(opts)\n discussion_roll_mail_setup(opts)\n\n # for initial roll creation, always calling out video aspect\n verb, suffix = \"sent\", \"video\"\n @subject = subject_for(@poster_string_name, opts[:all_participants] - [opts[:posting_participant], opts[:receiving_participant]], verb, suffix)\n \n mail :from => \"\\\"Shelby Mail\\\" <#{Settings::Email.discussion_roll['from_email']}>\",\n :reply_to => \"\\\"No Reply\\\" <#{Settings::Email.discussion_roll['from_email']}>\",\n :to => opts[:receiving_participant_email_address], \n :subject => @subject\n end", "def pop(**options)\n messages = Array.new\n\n isapop = false\n isapop = options[:apop] unless options.keys.include?(:apop)\n return nil if @host.nil? || @username.nil? || @password.nil?\n\n fp = nil\n unless @pop3readedpath.nil?\n unless File.exist?(@pop3readedpath)\n File.open(@pop3readedpath, \"w\"){|fp| }\n end\n fp = File.open(@pop3readedpath, \"r+\")\n end\n \n recv = Net::POP3.APOP(isapop).new(@host, 110)\n recv.start(@username, @password){|r|\n mailcnt = r.mails.count\n r.mails.each_with_index do |m, i|\n # -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n uidl = m.uidl\n isReaded = false\n unless fp.nil?\n fp.each_line do |line|\n if line.to_s.strip == uidl\n isReaded = true\n break\n end\n end\n end\n next if isReaded\n # -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n \n srcstr = m.pop\n hfrom = \"\"; hto = \"\"\n subject = \"\"; charset = \"\"; body = \"\"; datestr = \"\"; benc = \"\"\n recvd = \"\"\n selitem = \"\"; isBody = false\n srcstr.split(\"\\n\").each do |sstr|\n sstr.gsub!(\"\\r\", \"\")\n # header parse :p\n items = sstr.split(\": \")\n selitem = items[0] if items.length > 1\n if isBody\n body += sstr + \"\\n\"\n else\n case selitem\n when \"From\"\n hfrom = items[-1]\n when \"To\"\n hto = items[-1]\n when \"Date\"\n datestr = items[-1]\n selitem = \"\"\n when \"Subject\"\n subject += sstr.gsub(\"Subject: \", \"\")\n when \"Content-Type\"\n charset = items[1].scan(/charset=(.+)\\;/).flatten.first\n selitem = \"\"\n when \"Content-Transfer-Encoding\"\n benc = items[-1]\n selitem = \"\"\n when \"Content-Language\"\n selitem = \"\"\n when \"Received\"\n recvd += sstr + \"\\r\\n\"\n end\n end\n isBody = true if sstr.empty? \n end\n title = mime_decode(subject)\n dat = body_decode(body, benc)\n \n ht = Hash.new\n ht[:msgid] = (i + 1)\n ht[:recvd] = recvd\n ht[:from] = hfrom\n ht[:rcpt] = hto\n ht[:subject] = title\n ht[:date] = datestr\n ht[:body] = dat.to_s.force_encoding(\"utf-8\")\n\n messages.push(ht)\n\n # -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- \n unless fp.nil?\n fp.puts uidl # 既読済みに設定 (UIDL で識別)\n end\n # -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n \n #m.delete\n end\n }\n fp.close unless fp.nil?\n return messages\n end", "def backfill_messages(*args, reverse: false, limit: 10)\n # To be backwards-compatible\n if args.length == 2\n reverse = args.first\n limit = args.last\n end\n\n data = client.api.get_room_messages(id, @prev_batch, direction: :b, limit: limit)\n\n events = data[:chunk]\n events.reverse! unless reverse\n events.each do |ev|\n put_event(ev)\n end\n true\n end", "def next_message; end", "def next_message; end", "def deliver_rts email, documents, mail_to\n logger.info \"Sending response mail to #{mail_to}\"\n mail = Mail.new\n mail.from @cfg[:from]\n mail.to mail_to\n # CCs to the original email will get a copy of the converted files as well\n mail.cc (email.cc - email.to - (@cfg[:cc_blacklist]||[]) ) if email.cc # Prevent autoheathen infinite loop!\n # Don't prepend yet another Re:\n mail.subject \"#{'Re: ' unless email.subject.start_with? 'Re:'}#{email.subject}\"\n # Construct received path\n # TODO: is this in the right order?\n #rcv = \"by localhost(autoheathen); #{Time.now.strftime '%a, %d %b %Y %T %z'}\"\n #[email.received,rcv].flatten.each { |rec| mail.received rec.to_s }\n mail.return_path email.return_path if email.return_path\n mail.header['X-Received'] = email.header['X-Received'] if email.header['X-Received']\n documents.each do |doc|\n next if doc[:content].nil?\n mail.add_file filename: doc[:filename], content: doc[:content]\n end\n cfg = @cfg # stoopid Mail scoping\n me = self # stoopid Mail scoping\n mail.text_part do\n s = Haml::Engine.new( me.read_file cfg[:text_template] ).render(Object.new, to: mail_to, documents: documents, cfg: cfg)\n body s\n end\n mail.html_part do\n content_type 'text/html; charset=UTF-8'\n s = Haml::Engine.new( me.read_file cfg[:html_template] ).render(Object.new, to: mail_to, documents: documents, cfg: cfg)\n body s\n end\n mail.delivery_method :smtp, address: @cfg[:mail_host], port: @cfg[:mail_port]\n deliver mail\n end", "def receive_data_chunk data\n @smtps_msg_size ||= 0\n @smtps_msg_size += data.join.length\n STDERR.write \"<#{@smtps_msg_size}>\"\n end", "def receive_data_chunk data\n #@smtps_msg_size ||= 0\n #@smtps_msg_size += data.join.length\n #STDERR.write \"<#{@smtps_msg_size}>\"\n end", "def send_batch_unopened_notification_email(options = {})\n unopened_notification_index_map = notification_index_map(options.merge(filtered_by_status: :unopened))\n mailer_options = options.select { |k, _| [:send_later, :fallback, :batch_key].include?(k) }\n unopened_notification_index_map.map { |target, notifications|\n [target, Notification.send_batch_notification_email(target, notifications, mailer_options)]\n }.to_h\n end", "def make_email(opts)\n mail = Mail.new\n mail.to opts.msg_to\n mail.from opts.msg_from\n mail.cc opts.msg_cc if opts.key? \"cc\"\n mail.subject opts[\"subject\"]\n mail.html_part do\n content_type \"text/html; charset=UTF-8\"\n body opts.msg_body\n end\n opts.msg_attachments.each { |f| mail.add_file f }\n mail\n end", "def more_messages\n log \"Getting more_messages\"\n log \"Old start_index: #@start_index\"\n max = @start_index - 1\n @start_index = [(max + 1 - @limit), 1].max\n log \"New start_index: #@start_index\"\n fetch_ids = search_query? ? @ids[@start_index..max] : (@start_index..max).to_a\n log fetch_ids.inspect\n message_ids = fetch_and_cache_headers(fetch_ids)\n res = get_message_headers message_ids\n with_more_message_line(res)\n end", "def buffered_messages; end", "def flush_error_emails(args = {})\n @error_emails_pending_mutex.synchronize do\n send_time_older_than = Time.new.to_i - @error_emails_time\n \n @error_emails_pending.each do |backtrace_hash, error_email|\n if !args[:ignore_time] and send_time_older_than < error_email[:last_time].to_i and error_email[:messages].length < 1000\n next\n end\n \n @config[:error_report_emails].each do |email|\n next if !email or error_email[:messages].length <= 0\n \n if error_email[:messages].length == 1\n html = error_email[:messages].first\n else\n html = \"<b>First time:</b> #{Datet.in(error_email[:first_time]).out}<br />\"\n html << \"<b>Last time:</b> #{Datet.in(error_email[:last_time]).out}<br />\"\n html << \"<b>Number of errors:</b> #{error_email[:messages].length}<br />\"\n count = 0\n \n error_email[:messages].each do |error_msg|\n count += 1\n \n if count > 10\n html << \"<br /><br /><b><i>Limiting to showing 10 out of #{error_email[:messages].length} messages.</i></b>\"\n break\n end\n \n html << \"<br /><br />\"\n html << \"<b>Message #{count}</b><br />\"\n html << error_msg\n end\n end\n \n self.mail(\n :to => email,\n :subject => error_email[:subject],\n :html => html,\n :from => @config[:error_report_from]\n )\n end\n \n @error_emails_pending.delete(backtrace_hash)\n end\n end\n end", "def view_html\n\n $anterior = params[:id].to_i - 1\n $siguiente = params[:id].to_i - 1\n\n $buscar_texto = nil\n $buscar_por = nil\n\n ENV['folder'] = 'mailbox'\n load 'script/mailman_server.rb'\n\n adjuntos = ''\n\n @@messages.each do |message|\n @from = message[:from]\n @to = message[:to]\n @cc = message[:cc]\n @bcc = message[:bcc]\n @subject = message[:subject]\n @date = message[:date]\n @text = message[:text_body]\n @html = message[:html_body]\n end\n\n cc_list = @cc.length > 0 ? 'Cc: <span style=\"word-wrap: break-word;\">' + @cc + '</span><br>' : ''\n bcc_list = @bcc.length > 0 ? 'Cco: <span style=\"word-wrap: break-word;\">' + @bcc + '</span><br>' : ''\n\n @@the_message_attachments.each do |att|\n adjuntos += '<li> <a style=\"color:#666; text-decoration:none;\" href='+att.attached_file.url(:original, false)+' target=\"_blank\">'+att.attached_file_file_name+'</a> </li>'\n end\n\n adjuntos_list = (adjuntos.length > 0) ? 'Adjuntos: <ul>' + adjuntos + '</ul>' : ''\n\n # render file: 'messages/view_html'\n\n respond_to do |format|\n format.html {\n render text: '<div class=\"container-fluid\"> ' +\n '<br>' +\n 'De: ' + @from +\n '<br>' +\n 'A: <span style=\"word-wrap: break-word;\">' + @to + '</span>' +\n '<br>' +\n cc_list +\n bcc_list +\n adjuntos_list +\n '<hr class=\"col-lg-12\">' +\n '</div>' + @html, :layout => false\n }\n # format.html {\n # render text: '<div class=\"container-fluid\">' +\n # '<div class=\"col-md-12\" style=\"background-color: #ced8e1\">' +\n # '<h4>' + @subject + '</h4>' +\n # '<hr style=\"margin-top: 0px; border-top: 1px solid #235589\">' +\n # '<strong>' + @from + '</strong>' +\n # '<br>' +\n # '<div style=\"max-width: 90%; float: left\">' +\n # '<small>Para ' + @to[0..50] + '</small>' +\n # '</div>' +\n # '<div style=\"margin-left: 5px; max-width: 1%; float: left\">' +\n # '<div class=\"dropdown\">' +\n # '<button class=\"btn btn-default btn-xs\" type=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\">' +\n # '<span class=\"caret\"></span>' +\n # '</button>' +\n # '<div class=\"dropdown-menu\"\n # style=\"word-wrap: break-word;\n # width: 500px;\n # padding: 20px;\n # height: 300px;\n # overflow: auto\">' +\n # '<table>\n # <tr>\n # <td valign=\"top\">De:</td>\n # <th>' + @from + '</th>\n # </tr>\n # <tr>\n # <td valign=\"top\">Para:</td>\n # <td>' + @to + '</td>\n # </tr>\n # <tr>\n # <td valign=\"top\">Fecha:</td>\n # <td>' + @date + '</td>\n # </tr>\n # <tr>\n # <td valign=\"top\">Asunto:</td>\n # <td>' + @subject + '</td>\n # </tr>\n # </table>\n # </div>\n # </div>\n # </div>\n # </div>\n # </div>'\n # }\n format.json {\n render json: {\n message: @html\n }\n }\n end\n\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 messages options = {}\n LazyArray.new do |page, size|\n messages, _headers = get 'messages', options.merge(page: page, size: size)\n\n messages.map do |message|\n Types::Message.new message\n end\n end\n end", "def send_gmail_to_listing(worksheet_key)\n\n\n# first we connect to gmail with the $gmail variable (where our logs are stored)\n\t$gmail\n\t\n#we go through each email adresse \n\t\t\t\t# send we send (deliver) an email with subject + body\n\n\tgo_through_all_the_lines(worksheet_key).each do |email|\n\t\t$gmail.deliver do\n to email\n subject \"The Hacking Project\" # write your subject here\n \ttext_part do \n \t\tbody \"je suis élève à une formation de code gratuite, ouverte à tous, sans restriction géographique, ni restriction de niveau. La formation s'appelle The Hacking Project (http://thehackingproject.org/). Nous apprenons l'informatique via la méthode du peer-learning : nous faisons des projets concrets qui nous sont assignés tous les jours, sur lesquel nous planchons en petites équipes autonomes. Le projet du jour est d'envoyer des emails à nos élus locaux pour qu'ils nous aident à faire de The Hacking Project un nouveau format d'éducation gratuite.\n\nNous vous contactons pour vous parler du projet, et vous dire que vous pouvez ouvrir une cellule à {townhall_name}, où vous pouvez former gratuitement 6 personnes (ou plus), qu'elles soient débutantes, ou confirmées. Le modèle d'éducation de The Hacking Project n'a pas de limite en terme de nombre de moussaillons (c'est comme cela que l'on appelle les élèves), donc nous serions ravis de travailler avec {townhall_name} !\n\nCharles, co-fondateur de The Hacking Project pourra répondre à toutes vos questions : 06.95.46.60.80 \" #write your message here\n\t\t\tcontent_type 'text/plain; charset=UTF-8'\n \tend\n end\n\n\n end\n\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 get_next_message\n return @mailer.get_next_message\n end", "def deal_mail_messages(id:, **args)\n params = parameters(args) do\n optional_params :start, :limit\n end\n request(:get, \"deals/#{id}/mailMessages\", params)\n end", "def latest_mail(options = {})\n return only_latest(mail(options))\n end", "def build_text_mail(files, titles)\n data = \"\"\n files.each_with_index do |file, i|\n data += \"\\n\\n#{titles[i]}\\n\\n\"\n data += File.read(File.join(File.dirname(__FILE__), file))\n end\n # Add google file link with test coverage at the end of email\n data +=\"\\n\\n<a href='https://google.com'>Test Coverage</a>\\n\\n\"\n # attached screenshots\n pictures = Dir.glob(Rails.root.join('public', 'images', 'screenshots', '*.png'))\n #pictures = Dir.glob(Rails.root.join(\"/var/www/office/public/images/capybara/*.png\"))\n count = 0\n pictures.each do |p|\n count += 1\n data += \"<img src='#{ 'https://google.com' + p.split('/').last }'>\"\n break if count == 10\n end\n data\nend", "def build_chat_log\n return \"\" unless @scrollback\n out = \"\"\n displayed_buffer = @buffer.length > 30 ? @buffer[@buffer.length-30..-1] : @buffer\n displayed_buffer.each do |msg|\n out += \"#{msg[0]}: #{msg[1]}\\n\"\n end\n return out\n end", "def printmailq(mailq)\n text = \"\"\n mailq.each do |m|\n m[:frozen] ? frozen = \"*** frozen ***\" : frozen = \"\"\n \n text += \"%3s%6s %s %s %s\\n\" % [ m[:age], m[:size], m[:msgid], m[:sender], frozen ]\n \n m[:recipients].each do |r|\n text += \" #{r}\\n\"\n end\n \n text += \"\\n\"\n end\n\n text\n end", "def mails\n\n begin\n @imap = WmailImapUtils.current_imap\n \n if not @imap.blank?\n @mailbox = params['mailbox']\n @min = params['min'].to_i\n @max = params['max'].to_i\n @total = params['total'].to_i\n\n @imap.select(@mailbox)\n @mails = @imap.fetch(@total-@max..@total-@min, 'ENVELOPE')\n @unseen_flags = @imap.search(['NOT','SEEN'])\n end\n rescue\n redirect_to authenticate_wmail_accounts_path(:redirect => messages_mailbox_path(:label => selected_label)),\n :alert => 'Connection Lost. Please login to your account'\n end\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 restrict_msg_size\n if message.length > restriction\n message = message[0...restriction]\n end\n return message \n end", "def get_messages(packet_list)\n count = packet_list[:numPackets]\n first = packet_list[:packet][0]\n data = first[:data].to_a\n messages = []\n messages << data.slice!(0, first[:length])\n (count - 1).times do |i|\n length_index = find_next_length_index(data)\n message_length = data[length_index]\n unless message_length.nil?\n packet_start_index = length_index + 2\n packet_end_index = packet_start_index + message_length\n if data.length >= packet_end_index + 1\n packet = data.slice!(0..packet_end_index)\n message = packet.slice(packet_start_index, message_length)\n messages << message\n end\n end\n end\n messages\n end", "def find_emails\n options = { :conditions => ['last_send_attempt < ?', Time.now.to_i - 300] }\n options[:limit] = batch_size unless batch_size.nil?\n mail = ActionMailer::Base.email_class.find :all, options\n\n log \"found #{mail.length} emails to send\"\n mail\n end", "def send_unread_notification_to_member(options)\n workspace_unread = options['workspace_unread']\n chat_unread = options['chat_unread']\n member = Member.find(options['member_id'])\n MemberMailer.send_unread_notification_to_member(member, workspace_unread, chat_unread).deliver\n end", "def meta matrix, level\n @matrix = matrix\n @user = matrix.user\n @level = level\n headers={:to => @user.email1, :subject => \"#{CFG['domain']} - Matriz Nível #{level} Concluído\"}\n bccs=[]\n bccs << @user.email2 if @user.email2.present?\n bccs << CFG['email-contact']\n headers[:bcc] = bccs\n mail(headers)\n end", "def fetch_messages(opts = {}, &block)\n check_client_config\n\n opts[:after] = opts.delete(:since) if opts.include?(:since)\n\n mailbox = @client.label(\"INBOX\")\n mailbox.emails(:all, opts).map do |email|\n from = email.from[0]\n\n message_data = {\n :id => email.message_id,\n :source => 'email',\n :thread => email.thread_id,\n :title => email.subject,\n :body => extract_body(email),\n :sender_name => \"#{from.name || from.mailbox}\",\n :sender => \"#{from.mailbox}@#{from.host}\"\n }\n\n block.call Message.build(message_data)\n end\n end", "def send_arr label, array\n @publisher.send_string label, ZMQ::SNDMORE\n\n # Everything but the last element\n array[0..-2].each do |e|\n @publisher.send_string e.to_s, ZMQ::SNDMORE\n end\n @publisher.send_string array.last.to_s\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 remember_message_sent\n Discourse.redis.setex(sent_recently_key, @opts[:limit_once_per].try(:to_i) || 86_400, 1) unless @opts[:limit_once_per] == false\n end", "def reciveable_messages(options={})\n subject_ids = RecipientsFor::ReaderInfo.where(\n reciveable_type: options[:reciveable_type],\n reciveable_id: options[:reciveable_id],\n read: options[:read],\n internal: true\n ).pluck(:subject_id)\n RecipientsFor::Subject.order(\"updated_at asc\").includes(:contents, :reader_infos).where(id: subject_ids)\n end", "def capture_emails(&block)\n original_count = ActionMailer::Base.deliveries.size\n deliver_enqueued_emails(&block)\n new_count = ActionMailer::Base.deliveries.size\n diff = new_count - original_count\n ActionMailer::Base.deliveries.last(diff)\n end", "def batch_messages_for_page messages, filter, request_format\n logger.info \"Getting a new page of messages\"\n\n messages.each do |message|\n filter.add(api_method: $gmail_api.users.messages.get,\n parameters: {userId: 'me', id: message.id, format: request_format})\n end\n\n begin\n filtered_message_list(filter) unless messages.empty?\n rescue StandardError => error\n puts \"*** Error : #{error.message}\"\n puts \"*** #{error.backtrace.join(\"\\n\")}\"\n\n retry if retry_it?\n end\n end", "def fetch_more\n $limit += 5\n $offset_counter = ($offset_counter >= 5? $offset_counter - 5: 0)\n @room_messages = (@room.room_messages.includes(:user).order(:id).limit($limit).offset($offset_counter)).to_a.reverse()\n end", "def makePage(pyro, msgs )\n\n user_id = msgs[0][\"to\"]\n if user_id == $me\n user_id = msgs[0][\"from\"]\n end\n user_info = pyro.info_for_user(user_id)\n # Make sure the account still exists\n if user_info.body.length > 0 && user_info[\"status\"] != \"500\" then\n user_name = user_info[\"results\"][\"name\"]\n photo = user_info[\"results\"][\"photos\"][0]\n if !File.exist?($img_path+photo[\"fileName\"]) then\n File.open($img_path+photo[\"fileName\"], \"wb\") do |f| \n f.write HTTParty.get(photo[\"processedFiles\"][3][\"url\"]).parsed_response\n end\n end\n # Make header\n pagestr = \"\"\n pagestr += \"title: #{user_name} (#{msgs.length} messages)\\n\"\n pagestr += \"slug: #{user_id}\\n\"\n pagestr += \"date: #{msgs[-1][\"sent_date\"]}\\n\"\n pagestr += \"author: Mike the Turtle\\n\"\n pagestr += \"image: #{photo[\"fileName\"]}\\n\\n\\n\"\n\n # Format messages\n for msg in msgs\n pagestr += \"(#{msg[\"sent_date\"]}) \"\n if msg[\"from\"] == $me\n pagestr += \"Mike: \"\n else\n pagestr += \"#{user_name}: \"\n end\n \n pagestr += msg[\"message\"]\n pagestr += \"\\n\\n\"\n \n end\n\n File.open($page_path+user_id+\".md\", 'w') do |f|\n f.write(pagestr)\n end\n end\n \nend", "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 download_email\n\n @active_game=Game.find(params[:active_game])\n @player=Player.find(params[:active_player])\n @game=Game.find(params[:gid])\n @[email protected]\n\n @player_ids= Array.new\n @recipient =Array.new\n @recipient_ids=Array.new\n\n @players.each do |p|\n @player_ids << p.id\n end\n i=0\n @messages=Message.find(:all, :conditions => [\"author_id IN (?)\", @player_ids])\n\n @recipients =Array.new(@messages.count) { Array.new(@players.count) }\n @messages.each do |m|\n\n @recipient=Player.find(:all, :conditions => [\"id IN (?)\", m.recipients])\n @recipient.each do |r|\n @recipients[i] << Player.find(:first, :conditions=>['user_id=? and game_id=?', r.user_id, @game.id]).role.name\n @recipients[i].delete_if { |j| j==nil }\n\n end\n\n i=i+1\n\n end\n # @recipients.uniq!\n @names=Array.new\n @to=Array.new\n @messages.each do |m|\n if fromplayer=Player.find(:first, :conditions=>['user_id=? and game_id=?', m.author_id, @game.id])\n @names << fromplayer.role.name\n end\n end\n send_data(render_to_string, :filename => \"download_email.html\", :type => \"text/html\")\n\n\n end", "def send(**options)\n cnt = 0\n chkeys = [:subject, :body, :rcpt_to]\n options.keys.each do |k|\n cnt += 1 if chkeys.include?(k)\n end\n return false if cnt != chkeys.length\n \n rcpt = Array.new # send to user-mailaddress\n unless options[:rcpt_to].nil?\n rcpt.push(options[:rcpt_to])\n end\n if options[:mail_from].to_s.strip.empty?\n unless @mlname.empty?\n options[:mail_from] = \"#{@mlname} <#{@mladdr}>\"\n else\n options[:mail_from] = @mladdr\n end\n end\n\n smtpserver = @host # :p\n if smtpserver.to_s.strip.empty?\n emsg = \"unknown mail server (host is empty).\"\n raise MLMailError.new(emsg)\n end\n smtpport = @smtpport\n \n mail = RMail::Message.new\n mail.return_path = options[:return_path]\n mail.from = options[:mail_from]\n mail.to = rcpt\n mail.subject = options[:subject]\n mail.body = options[:body]\n smtpinfos = { :address => smtpserver,\n :port => smtpport,\n :enable_starttls_auto => @starttls }\n if @starttls\n smtpinfos[:authentication] = \"plain\"\n smtpinfos[:user_name] = @username\n smtpinfos[:password] = @password\n end\n mail.delivery_method(:smtp, smtpinfos)\n mail.deliver\n return true\n end", "def deliver_mh data\n mh_box = @options[:mh_box] || \"#{ENV[\"HOME\"]}/Mail\"\n spam_folder = @options[:mh_folder_spam] || \"/Junk\"\n folder = data['spam'] ? spam_folder : \"/inbox\" + (data['folder'] || \"\")\n \n dest_dir = [mh_box, folder].join(\"/\")\n \n unless File.exist?(dest_dir)\n FileUtils.mkpath(dest_dir)\n end\n \n max = Dir.children(dest_dir).max_by {|i| i.to_i }&.to_i || 0\n mail_id = max + 1\n \n File.open([dest_dir, mail_id].join(\"/\"), \"w\") do |f|\n f.write data[\"mail\"]\n end\n end", "def build_message\n @subject = self.content[:short_subject]\n curate_text\n\n\n mail = Mail.new({\n :from => @replyto,\n :to => @recipients,\n :subject => @subject,\n :body => @text\n })\n\n if @no_send\n self.print\n return\n end\n\n\n return mail\n end", "def message_buffer; end", "def setup_data\n # get a list of current year's members@ emails\n year = Time.new.year.to_s\n archive = Dir[File.join(MAIL_ROOT, \"members\", \"#{year}*\", \"*\")]\n\n # select messages that have a subject line starting with [MEMBER NOMINATION]\n emails = []\n archive.each do |email|\n next if email.end_with? '/index'\n message = IO.read(email, mode: 'rb')\n next unless message[/^Date: .*/].to_s.include? year\n subject = message[/^Subject: .*/]\n next if not subject # HACK: allow script to continue if bogus email\n next if subject =~ /board nominations$/ # not a nomination!\n subjectUC = subject.upcase\n next unless subjectUC =~ /BOARD/\n next unless subjectUC =~ /NOMI[NM]ATION/\n mail = Mail.new(message.encode(message.encoding, crlf_newline: true))\n mail.subject.sub!(/\\bDelacratez\\b/, 'Delacretaz') # typo\n emails << mail if mail.subject =~ /^\\[?BOARD NOMI[MN]ATION\\]?/i\n end\n\n # parse nominations for names and ids\n nominations = ASF::MemberFiles.board_nominees.map do |id, hash|\n {id: id, name: hash['Public Name'], nominator: hash['Nominated by']}\n end\n\n # preload names\n ASF::Person.preload('cn',\n nominations.map {|nominee| ASF::Person.find(nominee[:id])})\n\n return nominations, emails\nend", "def reply(fields)\n mail = Mail.new\n\n # fill in the from address\n mail.from = fields[:from]\n\n # fill in the reply to headers\n mail.in_reply_to = self.id\n mail.references = self.id\n\n # fill in the subject from the original email\n if self.subject =~ /^re:\\s/i\n mail.subject = self.subject\n elsif self.subject\n mail.subject = 'Re: ' + self.subject\n elsif fields[:subject]\n mail.subject = fields[:subject]\n end\n\n # fill in the subject from the original email\n mail.body = fields[:body]\n\n # gather up the to, cc, and bcc addresses\n to = []\n cc = []\n bcc = []\n\n # process 'bcc' addresses on method call\n # Do this first so can suppress such addresses in To: and Cc: fields\n if fields[:bcc]\n Array(fields[:bcc]).compact.each do |addr|\n addr = Message.liberal_email_parser(addr) if addr.is_a? String\n next if bcc.any? {|a| a.address == addr.address}\n bcc << addr\n end\n end\n\n # process 'to' addresses on method call\n if fields[:to]\n Array(fields[:to]).compact.each do |addr|\n addr = Message.liberal_email_parser(addr) if addr.is_a? String\n next if to.any? {|a| a.address = addr.address}\n to << addr\n end\n end\n\n # process 'from' addresses from original email\n self.from.addrs.each do |addr|\n next if to.any? {|a| a.address == addr.address}\n if fields[:to]\n next if cc.any? {|a| a.address == addr.address}\n next if bcc.any? {|a| a.address == addr.address} # skip if already in Bcc\n cc << addr\n else\n to << addr\n end\n end\n\n # process 'to' addresses from original email\n if self.to\n self.to.addrs.each do |addr|\n next if to.any? {|a| a.address == addr.address}\n next if cc.any? {|a| a.address == addr.address}\n next if bcc.any? {|a| a.address == addr.address} # skip if already in Bcc\n cc << addr\n end\n end\n\n # process 'cc' addresses from original email\n if self.cc\n self.cc.each do |addr|\n addr = Message.liberal_email_parser(addr) if addr.is_a? String\n next if to.any? {|a| a.address == addr.address}\n next if cc.any? {|a| a.address == addr.address}\n next if bcc.any? {|a| a.address == addr.address} # skip if already in Bcc\n cc << addr\n end\n end\n\n # process 'cc' addresses on method call\n if fields[:cc]\n Array(fields[:cc]).compact.each do |addr|\n addr = Message.liberal_email_parser(addr) if addr.is_a? String\n next if to.any? {|a| a.address == addr.address}\n next if cc.any? {|a| a.address == addr.address}\n next if bcc.any? {|a| a.address == addr.address} # skip if already in Bcc\n cc << addr\n end\n end\n\n # reformat email addresses\n mail[:to] = to.map(&:format)\n mail[:cc] = cc.map(&:format) unless cc.empty?\n mail[:bcc] = bcc.map(&:format) unless bcc.empty?\n\n # return the resulting email\n mail\n end", "def send_bulk_email(message, subject = 'Notification')\n client = IronWorkerNG::Client.new\n payload = {}\n payload['message'] = message\n payload['Subject'] = subject\nend", "def build_email(mailmsgs={}, mailtemplate=@defaultmailtemplate)\r\n\t\[email protected](\"build ncs email start...\")\r\n\t\ttemplate = Template.new(mailtemplate,@outputdir)\r\n\t\toutputfile = @properties.get(\"ncs.mail.store\")\r\n\t\t#puts @outputdir+\"/\"+outputfile\r\n\t\tif not mailmsgs.empty?\r\n\t\t\t@body = template.render(mailmsgs, @outputdir+\"/\"+outputfile)\r\n\t\telse\r\n\t\t\traise ArgumentError,\"either project_release_label need to be defined!\" if @project_release_label.empty?\r\n\t\t\t#build title\r\n\t\t\tmailsubject = @properties.get(\"ncs.mail.subject\")\r\n\t\t\t@title = \"#{mailsubject} #{@project_release_label}\" if @title.empty?\r\n\t\t\t#build sr link & report link\r\n\t\t\t@sr_link = @properties.get(\"ncs.mail.sr_link\") if @sr_link.empty?\r\n\t\t\t@report_link = @properties.get(\"ncs.mail.report_link\") if @report_link.empty?\r\n\t\t\t#build latest sr table\r\n\t\t\tsr_file = @properties.get(\"ncs.test.sr_mapping_file\")\r\n\t\t\tsr_sheet = @properties.get(\"ncs.test.sr_worksheet\", 'WMX5.0')\r\n\t\t\[email protected](\"sr mapping file: #{sr_file}\")\r\n\t\t\tsrparser = SrParser.new(sr_file)\r\n\t\t\tif @srs.empty?\r\n\t\t\t\tlatestSrlist = srparser.latestSrlist(sr_sheet)\r\n\t\t\t\tlatestSrlist.each{ |sr| \r\n\t\t\t\t\tself.addsr(sr) \r\n\t\t\t\t}\r\n\t\t\tend\r\n\t\t\t#build sr summary\r\n\t\t\tif @srsummary.empty?\r\n\t\t\t\t['Originated','Assessed','Study','Performed','Closed'].each{ |status|\r\n\t\t\t\t\tsrlistStatus = srparser.srlistBy(sr_sheet, '#Status', status)\r\n\t\t\t\t\[email protected](\"#{status} sr: \"+ srlistStatus.length.to_s)\r\n\t\t\t\t\[email protected](status, srlistStatus.length)\r\n\t\t\t\t}\r\n\t\t\tend\r\n\t\t\t#host,os,view\r\n\t\t\t@host = %x{uname -n}.chomp() if @host.empty?\r\n\t\t\t@ip = IPSocket.getaddress(@host) if @ip.empty?\r\n\t\t\t@os = %x{uname}.chomp() if @os.empty?\r\n\t\t\tcleartool = @properties.get('ncs.tool.cleartool')\r\n\t\t\t@view = %x{#{cleartool} pwv -s}.chomp() if @view.empty?\r\n\t\t\t#build log dir & test log dir\r\n\t\t\tlogdir = @properties.get('ncs.log.dir')\r\n\t\t\t@buildlogdir = logdir + '/' + project_release_label + '/buildlog' if @buildlogdir.empty?\r\n\t\t\t@testlogdir = logdir + '/' + project_release_label + '/testlog' if @testlogdir.empty?\r\n\t\t\t#build merge stat info\r\n\t\t\tif @mergestat.empty?\r\n\t\t\t\tbegin\r\n\t\t\t\t\tstoredir = @properties.get('ncs.store.dir')\r\n\t\t\t\t\tmergestat = @properties.get('ncs.tool.mergestat')\r\n\t\t\t\t\tline_sep = @properties.get('ncs.mail.line_sep','<br/>')\r\n\t\t\t\t\tbranch = %x{#{cleartool} catcs|grep '^mkbranch'|cut -f2 -d' '}.chomp\r\n\t\t\t\t\tmergestat_name = \"mergestat_#{branch}\"\r\n\t\t\t\t\tmergestat_store = storedir + '/' + project_release_label + \"/mergestat_#{branch}\"\r\n\t\t\t\t\tif not File.exists?(mergestat_store)\r\n\t\t\t\t\t\[email protected](\"mergestat file not exist, need to generated!\")\r\n\t\t\t\t\t\[email protected](\"cd /vob/wibb_bts; #{mergestat} -a -l -s -b #{branch} > #{mergestat_name}\")\r\n\t\t\t\t\t\tsystem(\"cd /vob/wibb_bts; #{mergestat} -a -l -s -b #{branch} > #{mergestat_name}\")\r\n\t\t\t\t\t\[email protected](\"cp /vob/wibb_bts/#{mergestat_name} #{mergestat_store}\")\r\n\t\t\t\t\t\tsystem(\"cp /vob/wibb_bts/#{mergestat_name} #{mergestat_store}\")\r\n\t\t\t\t\tend\r\n\t\t\t\t\tmergestat = IO.readlines(mergestat_store)\r\n\t\t\t\t\[email protected](\"mergestat is store at #{mergestat_store}\")\r\n\t\t\t\t\t#@logger.debug(\"#{mergestat}\")\r\n\t\t\t\t\t@mergestat = mergestat.join(line_sep)\r\n\t\t\t\trescue => err\r\n\t\t\t\t\[email protected](\"build mergestat failed, #{err.to_s}\")\r\n\t\t\t\t\[email protected](\"NCS ignored mergestat information!\")\r\n\t\t\t\t\t@mergestat = ''\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\t\t#build tested projects\r\n\t\t\ttested_projects = @properties.get('ncs.store.tested_projects')\r\n\t\t\tif @testedprojects.empty? and File.exists?(tested_projects)\r\n\t\t\t\tlines = IO.readlines(tested_projects)\r\n\t\t\t\tlines.each{ |line|\r\n\t\t\t\t\tnext if line =~ /^\\s*$/\r\n\t\t\t\t\tline.chomp!\r\n\t\t\t\t\t#blocked project\r\n\t\t\t\t\tif line =~ /BLOCK/i\r\n\t\t\t\t\t\t(lbl,block,modtime) = line.split(/[\\s:;,]+/, 3)\r\n\t\t\t\t\t\tself.addpassrate4prj(lbl,'','',true, modtime)\r\n\t\t\t\t\t#tested project\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t(lbl,prate,frate,modtime) = line.split(/[\\s:;,]+/, 4)\r\n\t\t\t\t\t\tself.addpassrate4prj(lbl,prate,frate,false, modtime)\r\n\t\t\t\t\tend\r\n\t\t\t\t}\r\n\t\t\tend\r\n\t\t\t\r\n\t\t\t#build bindings\r\n\t\t\tattributes = {\r\n\t\t\t\t'title' => @title,\r\n\t\t\t\t'sr_link' => @sr_link,\r\n\t\t\t\t'report_link' => @report_link,\r\n\t\t\t\t'srs' => @srs,\r\n\t\t\t\t'srsummary' => @srsummary,\r\n\t\t\t\t'host' => @host,\r\n\t\t\t\t'ip' => @ip,\r\n\t\t\t\t'os' => @os,\r\n\t\t\t\t'view' => @view,\r\n\t\t\t\t'errors' => @errors,\r\n\t\t\t\t'buildresults' => @buildresults,\r\n\t\t\t\t'testsummary' => @testsummary,\r\n\t\t\t\t'testresults' => @testresults,\r\n\t\t\t\t'buildlogdir' => @buildlogdir,\r\n\t\t\t\t'testlogdir' => @testlogdir,\r\n\t\t\t\t'mergestat' => @mergestat,\r\n\t\t\t\t'testedprojects' => @testedprojects\r\n\t\t\t}\r\n\t\t\t#render template and store the mail as a file \r\n\t\t\t@outputdir = @properties.get('ncs.store.dir') + '/' + project_release_label\r\n\t\t\t@body = template.render(attributes, @outputdir+\"/\"+outputfile)\r\n\t\tend\r\n\t\[email protected](\"build ncs email end\")\r\n\tend", "def mail_shot(subject: nil,\n to: nil,\n body: nil,\n reply_to_addr: ENV['SOCIETY_EMAIL'],\n attaches: [])\n @body = body\n @reply_to_addr = reply_to_addr\n attaches.each do |attach|\n attachments[attach.filename] = { mime_type: attach.mime_type, content: attach.data }\n end\n\n mail(subject: subject, to: to)\n end", "def m4_message\n [\n \"Tak for din interesse for at være **{{jobnavn}}** på Spejdernes Lejr 2017.\",\n \"\\n\\nVi har sendt dine kontaktoplysninger videre til {{kontaktperson}}, som er kontaktperson for denne opgave. Hvis du ikke hører fra {{kontaktperson}}, eller hvis jobbet ikke passede til dig alligevel, så er du velkommen til at kontakte os på [email protected], så hjælper vi dig med at finde et andet fantastisk lejrjob!\",\n \"\\n\\n_De fedeste Spejdernes Lejr 2017 hilsener_ \\n\",\n \"{{bruger}}, Jobcenteret SL2017\"\n ].join()\n end", "def render\n _header do\n _h1 'Agenda Backchannel'\n end\n\n # convert date into a localized string\n datefmt = proc do |timestamp|\n return Date.new(timestamp).\n toLocaleDateString({}, month: 'short', day: 'numeric', year: 'numeric')\n end\n if Chat.log.empty?\n if Chat.backlog_fetched\n _em 'No messages found.'\n else\n _em 'Loading messages'\n end\n else\n i = 0\n\n # group messages by date\n while i < Chat.log.length\n date = datefmt(Chat.log[i].timestamp)\n _h5.chatlog date unless i == 0 and date == datefmt(Date.new().valueOf())\n\n # group of messages that share the same (local) date\n _dl.chatlog do\n while i < Chat.log.length\n message = Chat.log[i]\n break if date != datefmt(message.timestamp)\n _dt message.user, key: \"t#{message.timestamp}\", class: message.type,\n title: Date.new(message.timestamp).toLocaleTimeString()\n _dd key: \"d#{message.timestamp}\", class: message.type do\n if message.link\n _Link text: message.text, href: message.link\n else\n filters = [hotlink, self.mention]\n filters << self.agenda_link if message.type == :agenda\n _Text raw: message.text, filters: filters\n end\n end\n i += 1\n end\n end\n end\n end\n end", "def patched_config\n\t\t\tzhooks=<<'EOS'\n## +compressed\n# Handler for gzip compressed mailboxes\nopen-hook '\\.gz$' \"gzip --stdout --decompress '%f' > '%t'\"\nclose-hook '\\.gz$' \"gzip --stdout '%t' > '%f'\"\nappend-hook '\\.gz$' \"gzip --stdout '%t' >> '%f'\"\n# Handler for bzip2 compressed mailboxes\nopen-hook '\\.bz2$' \"bzip2 --stdout --decompress '%f' > '%t'\"\nclose-hook '\\.bz2$' \"bzip2 --stdout '%t' > '%f'\"\nappend-hook '\\.bz2$' \"bzip2 --stdout '%t' >> '%f'\"\n# Handler for xz compressed mailboxes\nopen-hook '\\.xz$' \"xz --stdout --decompress '%f' > '%t'\"\nclose-hook '\\.xz$' \"xz --stdout '%t' > '%f'\"\nappend-hook '\\.xz$' \"xz --stdout '%t' >> '%f'\"\n# Handler for pgp encrypted mailboxes\n# Handler for gpg encrypted mailboxes\n# gpg does not support appending to an encrypted file\nopen-hook '\\.gpg$' \"gpg --decrypt < '%f' > '%t'\"\n# close-hook '\\.gpg$' \"gpg --encrypt --recipient YourGpgUserIdOrKeyId < '%t' > '%f'\"\nEOS\n\n\t\t\tsidebar=<<'EOS'\n## +sidebar\nunset sidebar_visible\nset mail_check_stats\nset sidebar_divider_char = '|'\nset sidebar_format=\"%B%* %! %?N?%N/?%S\"\n#default: set sidebar_format=\"%B%* %?F? !%F ?%?N?%N/?%S\"\n# %B name, %F flagged, %N new, %S total\n# Ctrl-Down: Move the highlight to the prev mailbox\nmacro index,pager <C-Up> \"<enter-command>set sidebar_visible<enter><sidebar-prev>\" \"Move up in the sidebar\"\n# Move the highlight to the next mailbox\nmacro index,pager <C-Down> \"<enter-command>set sidebar_visible<enter><sidebar-next>\" \"Move down in the sidebar\"\n# Open the highlighted mailbox\nbind index,pager \\Co sidebar-open\nmacro index,pager <C-Right> \"<sidebar-open><enter-command>unset sidebar_visible<enter>\" \"Open sidebar folder\"\nmacro index,pager <C-Left> \"<enter-command>toggle sidebar_visible<enter>\" \"Toggle the sidebar\"\n# Shorten mailbox names\nset sidebar_short_path\n# set sidebar_component_depth=1\nset sidebar_delim_chars='/'\nset sidebar_folder_indent\n\n#color sidebar_indicator default color17 # Dark blue background\ncolor sidebar_highlight white color238 # Grey background\ncolor sidebar_spoolfile yellow default # Yellow\ncolor sidebar_new magenta default # Magenta\ncolor sidebar_ordinary default default # Default colors\ncolor sidebar_flagged red default # Red\ncolor sidebar_divider color8 default # Dark grey\nEOS\n\t\t\tattach_headers_color=<<'EOS'\n## +attach_headers_color\n# Color GPGME signature checks\ncolor attach_headers green default \"Good signature from.*\"\ncolor attach_headers red default \"Bad signature from.*\"\nEOS\n\n\t\t\ttag_transforms=<<'EOS'\n# Default, we want to change it to have our emojis :)\n# set hidden_tags=\"unread,draft,flagged,passed,replied,attachment,signed,encrypted\"\nset hidden_tags=\"all,draft,flagged,passed,attachment,signed,encrypted\"\n# 📫 📬\ntag-transforms \\\n \"inbox\" \"🖄\" \\\n \"unread\" \"📧\" \\\n \"ml\" \"✉\" \\\n \"replied\" \"↻\" \\\n \"sent\" \"⮩\" \\\n \"received\" \"⮪\" \\\n \"unprocessed\" \"🗷\" \\\nEOS\n\n\t\t\tnotmuchdir=Pathname.new(ENV['NOTMUCH'] ? ENV['NOTMUCH'] : @maildir)\n\t\t\tnotmuch=%Q{set nm_default_uri = \"notmuch://#{notmuchdir}\"\\n}\n\t\t\tload_virtual=\"<enter-command>source '$HOME/.mutt/config.rb mailboxes virtual |'<enter>\"\n\t\t\tnotmuch << <<EOS\n## +notmuch\n#set nm_query_window_duration=2\nset nm_query_window_timebase=\"week\" # or \"hour\", \"day\", \"week\", \"month\", \"year\"\nmacro index,pager x \"#{load_virtual}<change-vfolder>\" \"Change virtual folder\"\nmacro index,pager ,x \"#{load_virtual}<vfolder-from-query>\" \"Virtual folder query\"\nmacro index,pager \\\\Cx \"#{load_virtual}<enter-command>set sidebar_visible<enter><sidebar-toggle-virtual>\" \"Toggle the sidebar into virtual folders\"\nmacro index,pager X \"#{load_virtual}<change-vfolder>?\" \"List virtual mailboxes\"\nmacro index,pager,browser ,mv \"#{load_virtual}\" \"Add virtual mailboxes\"\nmacro index,pager,browser ,mV \"<enter-command>unvirtual-mailboxes *<enter>\" \"Clear virtual mailboxes\"\nbind browser X exit\n#These change '$nm_query_window_current_position'\nmacro index ,< \"<enter-command>set nm_query_window_duration=2<enter><vfolder-window-backward>\" \"virtual window backwad\"\nmacro index ,> \"<enter-command>set nm_query_window_duration=2<enter><vfolder-window-forward>\" \"virtual window forward\"\nmacro index ,= \"<enter-command>set nm_query_window_duration=0<enter><change-folder>^<enter>\" \"Reset query window duration\"\nbind index,pager ,lT entire-thread\n# :exec change-vfolder\nEOS\n\t\t\t# For now I want to activate the virtual folders only when I need them\n\t\t\t# notmuch+=mailboxes(:virtual)\n\n\t\t\to=\"\"\n\t\t\to+=sidebar if version =~ %r{\\+sidebar|\\+USE_SIDEBAR|mutt-patched/sidebar}\n\t\t\to+=attach_headers_color if version =~ /\\+attach_headers_color/\n\t\t\to+=notmuch if version =~ /\\+notmuch/\n\t\t\to+=zhooks if version =~ %r{\\+compress|\\+USE_COMPRESSED|features/compressed-folders}\n\t\t\to+=tag_transforms if version =~/\\+index_color/\n\t\t\to\n\t\tend", "def worker_messages(count, seconds = MAX_TIMEOUT)\n messages = []\n begin\n Timeout.timeout(seconds) do\n while messages.length < count\n messages << TomQueue.test_logger.readline\n end\n end\n rescue Timeout::Error\n end\n messages\nend", "def mpim_replies(options = {})\n throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?\n throw ArgumentError.new('Required arguments :thread_ts missing') if options[:thread_ts].nil?\n options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]\n post('mpim.replies', options)\n end", "def chat_with user, limit=20\n from_to_stamp = [\"#{self.id}-#{user.id}\",\"#{user.id}-#{self.id}\"]\n Message.where(:from_to_stamp.in => from_to_stamp).order_by([:created_at,:desc]).limit(limit)\n end", "def get_mails\n if params[:action] == 'get_mails'\n Log.add_info(request, params.inspect)\n end\n\n if !params[:pop].nil? and params[:pop] == 'true'\n\n mail_account_id = params[:mail_account_id]\n SqlHelper.validate_token([mail_account_id])\n\n begin\n new_arrivals_h = {}\n\n if mail_account_id.blank?\n mail_accounts = MailAccount.find_all(\"user_id=#{@login_user.id}\")\n mail_accounts.each do |mail_account|\n emails = Email.do_pop(mail_account)\n unless emails.empty?\n new_arrivals_h[mail_account.id] ||= []\n new_arrivals_h[mail_account.id] |= emails\n end\n end\n else\n mail_account = MailAccount.find(mail_account_id)\n emails = Email.do_pop(mail_account)\n unless emails.empty?\n new_arrivals_h[mail_account.id] ||= []\n new_arrivals_h[mail_account.id] |= emails\n end\n end\n\n unless new_arrivals_h.empty?\n flash[:notice] = t('mail.received', :count => new_arrivals_h.values.flatten.length)\n\n # FEATURE_MAIL_FILTERS >>>\n new_arrivals_h.each do |mail_account_id, emails|\n mail_filters = MailFilter.get_for(mail_account_id, true, MailFilter::TRIGGER_CHECKING)\n filter_next = true\n\n emails.each do |email|\n mail_filters.each do |filter|\n filter_next = filter.execute(email)\n break unless filter_next\n end\n break unless filter_next\n end\n end\n # FEATURE_MAIL_FILTERS <<<\n end\n rescue => evar\n if evar.to_s.starts_with?('ERROR:')\n flash[:notice] = evar.to_s\n else\n flash[:notice] = 'ERROR:' + t('mail.receive_error') + '<br/>' + evar.to_s\n end\n Log.add_error(nil, evar)\n end\n end\n\n @folder_id = params[:id]\n SqlHelper.validate_token([@folder_id])\n\n if @folder_id == TreeElement::ROOT_ID.to_s\n @emails = nil\n else\n=begin\n# @emails = MailFolder.get_mails_to_show(@folder_id, @login_user)\n=end\n# FEATURE_PAGING_IN_TREE >>>\n @sort_col = (params[:sort_col] || 'sent_at')\n @sort_type = (params[:sort_type] || 'DESC')\n SqlHelper.validate_token([@sort_col, @sort_type], ['.'])\n\n sql = EmailsHelper.get_list_sql(@login_user, params[:keyword], [@folder_id], @sort_col, @sort_type, 0, nil)\n @email_pages, @emails, @total_num = paginate_by_sql(Email, sql, 10)\n# FEATURE_PAGING_IN_TREE <<<\n end\n\n session[:mailfolder_id] = @folder_id\n\n render(:partial => 'ajax_folder_mails', :layout => false)\n end", "def generate_error_email_body(email_type: :user)\n case email_type\n when :user\n error_contents = read_parse_logfile(user_error_filepath)\n message_body = \"<p>'#{study_file.upload_file_name}' has failed during parsing.</p>\"\n when :dev\n # only read first megabyte of error log to avoid email delivery failure\n error_contents = read_parse_logfile(dev_error_filepath, delete_on_read: false, range: 0..1.megabyte)\n message_body = \"<p>The file '#{study_file.upload_file_name}' uploaded by #{user.email} to #{study.accession} failed to ingest.</p>\"\n message_body += \"<p>A copy of this file can be found at #{generate_bucket_browser_tag}</p>\"\n message_body += \"<p>Detailed logs and PAPI events as follows:\"\n else\n error_contents = read_parse_logfile(user_error_filepath)\n message_body = \"<p>'#{study_file.upload_file_name}' has failed during parsing.</p>\"\n end\n\n if error_contents.present?\n message_body += \"<h3>Errors</h3>\"\n error_contents.each_line do |line|\n message_body += \"#{line}<br />\"\n end\n end\n\n if !error_contents.present? || email_type == :dev\n message_body += \"<h3>Event Messages</h3>\"\n message_body += \"<ul>\"\n event_messages.each do |e|\n message_body += \"<li><pre>#{ERB::Util.html_escape(e)}</pre></li>\"\n end\n message_body += \"</ul>\"\n end\n\n if study_file.file_type == 'Metadata'\n faq_link = \"https://singlecell.zendesk.com/hc/en-us/articles/360060610092-Metadata-Validation-Errors-FAQ\"\n message_body += \"<h3>Common Errors for Metadata Files</h3>\"\n message_body += \"<p>You can view a list of common metadata validation errors and solutions in our documentation: \"\n message_body += \"<a href='#{faq_link}'>#{faq_link}</a></p>\"\n end\n\n message_body += \"<h3>Job Details</h3>\"\n message_body += \"<p>Study Accession: <strong>#{study.accession}</strong></p>\"\n message_body += \"<p>Study File ID: <strong>#{study_file.id}</strong></p>\"\n message_body += \"<p>Ingest Run ID: <strong>#{pipeline_name}</strong></p>\"\n message_body += \"<p>Command Line: <strong>#{command_line}</strong></p>\"\n ingest_image_attributes = AdminConfiguration.get_ingest_docker_image_attributes\n message_body += \"<p>Ingest Pipeline Docker image version: <strong>#{ingest_image_attributes[:tag]}</strong></p>\"\n message_body\n end", "def default(options = {})\n options.symbolize_keys!\n options.assert_valid_keys(:mailer_class, :mailer, :using, :batch_size)\n @defaults = options\n end", "def limit_replies\n conversation = Conversation.find(params[:message][:conversation_id])\n if conversation.messages.count > 4\n spam_filter = true\n conversation.messages[-5..-1].each do |m|\n if m.sender_id != current_user.id\n spam_filter = false\n break\n end\n end\n spam_filter\n else\n false\n end\n end", "def batch_badge_creator(speakers) # because it takes array as an argument, it will go through each of the array contents\n speakers.collect { |x| badge_maker(x) } #technically, it returns an array of new messages, not really separate messages\nend", "def dispatch_message(bot, pns)\n message = bot.paginate_response(pns, takeoff=16)\n\n @config[:channel_for_announce].each do |channel|\n channels = bot.find_channel(channel)\n puts \"CHANNELS: #{channels}\"\n\n channels.each do |channel|\n if config[:announce_tags].length > 0\n channel.send_message config[:announce_tags].join(\" \")\n end\n\n message.map { |m| channel.send_message \"```Markdown\\n#{m}```\" }\n end\n end\n end", "def hasMorePayloads; end", "def test_multiple_recipients\r\n bob = User.find(1)\r\n existingbob = User.find(2)\r\n longbob = User.find(3)\r\n initial_bob_plan_count = bob.planner.plans.length\r\n initial_existingbob_plan_count = existingbob.planner.plans.length\r\n initial_longbob_plan_count = longbob.planner.plans.length\r\n \r\n Mailman.receive(@multiple_recipients_string)\r\n \r\n bob = User.find(1)\r\n existingbob = User.find(2)\r\n longbob = User.find(3)\r\n assert_equal initial_bob_plan_count + 1, bob.planner.plans.length\r\n assert_equal initial_existingbob_plan_count + 1, existingbob.planner.plans.length\r\n assert_equal initial_longbob_plan_count, longbob.planner.plans.length\r\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 mailer; end", "def scan(mhead, mbody)\n match = 0\n match += 1 if mhead['subject'] =~ /\\AUndeliverable Mail[ ]*\\z/\n match += 1 if mhead['x-mailer'].to_s.start_with?('<SMTP32 v')\n return nil unless match > 0\n\n dscontents = [Sisimai::Bite.DELIVERYSTATUS]\n hasdivided = mbody.split(\"\\n\")\n rfc822list = [] # (Array) Each line in message/rfc822 part string\n blanklines = 0 # (Integer) The number of blank lines\n readcursor = 0 # (Integer) Points the current cursor position\n recipients = 0 # (Integer) The number of 'Final-Recipient' header\n v = nil\n\n while e = hasdivided.shift do\n if readcursor == 0\n # Beginning of the bounce message or delivery status part\n if e == StartingOf[:message][0]\n readcursor |= Indicators[:deliverystatus]\n next\n end\n end\n\n if (readcursor & Indicators[:'message-rfc822']) == 0\n # Beginning of the original message part\n if e == StartingOf[:rfc822][0]\n readcursor |= Indicators[:'message-rfc822']\n next\n end\n end\n\n if readcursor & Indicators[:'message-rfc822'] > 0\n # After \"message/rfc822\"\n if e.empty?\n blanklines += 1\n break if blanklines > 1\n next\n end\n rfc822list << e\n else\n # Before \"message/rfc822\"\n break if readcursor & Indicators[:'message-rfc822'] > 0\n\n # Unknown user: [email protected]\n #\n # Original message follows.\n v = dscontents[-1]\n\n if cv = e.match(/\\A([^ ]+)[ ](.+)[:][ \\t]*([^ ]+[@][^ ]+)/)\n # Unknown user: [email protected]\n if v['recipient']\n # There are multiple recipient addresses in the message body.\n dscontents << Sisimai::Bite.DELIVERYSTATUS\n v = dscontents[-1]\n end\n v['diagnosis'] = cv[1] + ' ' + cv[2]\n v['recipient'] = cv[3]\n recipients += 1\n\n elsif cv = e.match(/\\Aundeliverable[ ]+to[ ]+(.+)\\z/)\n # undeliverable to [email protected]\n if v['recipient']\n # There are multiple recipient addresses in the message body.\n dscontents << Sisimai::Bite.DELIVERYSTATUS\n v = dscontents[-1]\n end\n v['recipient'] = cv[1]\n recipients += 1\n else\n # Other error message text\n v['alterrors'] << ' ' << e if v['alterrors']\n v['alterrors'] = e if e.include?(StartingOf[:error][0])\n end\n end\n end\n return nil unless recipients > 0\n\n dscontents.each do |e|\n e['agent'] = self.smtpagent\n\n unless e['alterrors'].to_s.empty?\n # Copy alternative error message\n e['diagnosis'] = if e['diagnosis']\n e['alterrors'] + ' ' + e['diagnosis']\n else\n e['alterrors']\n end\n e['diagnosis'] = Sisimai::String.sweep(e['diagnosis'])\n e.delete('alterrors')\n end\n e['diagnosis'] = Sisimai::String.sweep(e['diagnosis'])\n\n ReSMTP.each_key do |r|\n # Detect SMTP command from the message\n next unless e['diagnosis'] =~ ReSMTP[r]\n e['command'] = r.to_s.upcase\n break\n end\n\n ReFailures.each_key do |r|\n # Verify each regular expression of session errors\n next unless e['diagnosis'] =~ ReFailures[r]\n e['reason'] = r.to_s\n break\n end\n e.each_key { |a| e[a] ||= '' }\n end\n\n rfc822part = Sisimai::RFC5322.weedout(rfc822list)\n return { 'ds' => dscontents, 'rfc822' => rfc822part }\n end", "def messages\n @monitor.synchronize {\n if @buffer[@next_index] == nil\n @buffer[0...@next_index]\n else\n @buffer[@next_index...@limit] + @buffer[0...@next_index]\n end\n }\n end", "def index\n setup_recipients\n @footer = \"\"\n end", "def messages(limit=10)\n $redis.lrange(key('messages'), 0, 10).map{|a| b = JSON.parse(a); b['date'] = Time.at(b['timestamp'].to_i/1000); b }.reverse\n end", "def append_delivery_notes\n self.message += \"\\n----\\nFrom: #{self.user.email} #{Time.now}\\n\" + I18n.translate(:delivered_to)+\" \"\n if( all_users = (@recipients.count == User.count))\n self.message += I18n.translate(:all_users, count: @recipients.count)\n else\n self.message += @recipients.all.map { |recipient|\n recipient.name + \" (#{recipient.email})\"\n }.join(\", \")\n end\n end", "def batch_badge_creator(speaker_list)\n badge_messages = []\n speaker_list.each {|name| badge_messages << \"Hello, my name is #{name}.\"}\n badge_messages\nend", "def initialize(args={})\n args = DEFAULT_ATTRIBUTES.merge(args)\n \n @list_name = args[:list_name] || Postal.options[:list_name]\n @to = args[:to] \n \n if args[:mailing].nil?\n @additional_headers = args[:additional_headers] \n @attachments = args[:attachments] \n @bypass_moderation = args[:bypass_moderation] \n @campaign = args[:campaign] \n @char_set_id = args[:char_set_id] \n @detect_html = args[:detect_html] \n @dont_attempt_after_date = args[:dont_attempt_after_date] \n @enable_recovery = args[:enable_recovery] \n @from = args[:from] \n @html_message = args[:html_message] \n @html_section_encoding = args[:html_section_encoding] \n @is_html_section_encoded = args[:is_html_section_encoded] \n @is_text_section_encoded = args[:is_text_section_encoded]\n @recency_number_of_mailings = args[:recency_number_of_mailings]\n @recency_which = args[:recency_which]\n @reply_to = args[:reply_to]\n @resend_after_days = args[:resend_after_days]\n @sample_size = args[:sample_size]\n @scheduled_mailing_date = args[:scheduled_mailing_date]\n @subject = args[:subject]\n @text_message = args[:text_message]\n @text_section_encoding = args[:text_section_encoding]\n @title = args[:title]\n @to = args[:to]\n @track_opens = args[:track_opens]\n @rewrite_date_when_sent = args[:rewrite_date_when_sent]\n @mailing = args[:mailing]\n else\n @subject = args[:mailing].subject\n @is_html_section_encoded = args[:mailing].is_html_section_encoded\n @html_section_encoding = args[:mailing].html_section_encoding\n @html_message = args[:mailing].html_message\n @char_set_id = args[:mailing].char_set_id\n @is_text_section_encoded = args[:mailing].is_text_section_encoded\n @text_section_encoding = args[:mailing].text_section_encoding\n @title = args[:mailing].title\n @text_message = args[:mailing].text_message\n @attachments = args[:mailing].attachments\n @from = args[:mailing].from\n @additional_headers = args[:mailing].additional_headers\n @mailing = args[:mailing]\n end\n end", "def collect_messages(email, password, label, criteria, save_attachments)\n messages = []\n\n gmail = Gmail.connect(email, password)\n\n begin\n criteria.each do |c|\n messages += fetch_messages(gmail, label, c, save_attachments)\n end\n rescue Exception => e\n puts e.inspect\n ensure\n gmail.logout\n end\n messages\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 comment_added(options)\n @to, @subject, @body, @obj = options[:to], options[:subject], options[:body], options[:obj]\n @bootloader_path = default_bootloader_path(@obj)\n @conference = conference(@to)\n mail(:to => email_addresses(@to),\n :from => email_sender_address(@to),\n :subject => I18n.t('message_mailer.comment_added.subject', \n :number => @obj.presentation.number,\n :namespace => @conference.tag))\n end", "def create_inbound_email_from_mail(status: T.unsafe(nil), **mail_options, &block); end", "def new_messages\n self.messages.where(mailgun_reply_to_id: nil) \n end", "def goThroughUserEmails(user_id, username, password, server, port, tls, last_uid, virtual_device_name)\n begin\n new_uid = last_uid\n \n user = User.find_by_id(user_id)\n if user == nil\n return\n end\n \n # Connect to gmail server\n if tls\n imap = Net::IMAP.new(server,port,false)\n else\n imap = Net::IMAP.new(server,port,true)\n end\n \n # Login\n imap.login(username, password)\n \n # Select inbox\n imap.select('INBOX')\n \n # get all new mails\n tmp_last_uid = (last_uid+1).to_s+\":\"+(last_uid+101).to_s\n #puts tmp_last_uid\n imap.uid_search([\"NOT\", \"DELETED\", \"UID\", tmp_last_uid]).each do |uid|\n puts \"Checking mail with uid: #{uid}\"\n #notSeen = false\n #if imap.search([\"NOT\", \"DELETED\", \"NOT\", \"SEEN\", \"UID\", uid]) != nil\n # notSeen = true\n #end\n \n # fetches the source of the email for tmail to parse\n source = imap.uid_fetch(uid, 'RFC822')\n \n if source == nil\n puts \"Couldn't find mail with uid: #{uid}\"\n next\n end\n \n source = source.first.attr['RFC822']\n \n email = TMail::Mail.parse(source) \n \n if user == nil\n next\n end\n \n device = nil\n \n # If has attachments, save them\n if email.has_attachments?\n email.parts.each_with_index do |part, index|\n puts part.content_type\n \n # Text files are ignored. If mail has attachments, body was considerede as attachment.\n if part.content_type == \"text/plain\" or part.content_type == \"multipart/alternative\"\n next\n end\n \n # Create device if doesn't already exist\n if device == nil\n # Try to find virtual device or create it\n device = findOrCreateVirtualDevice(user.id, virtual_device_name)\n \n # If device name is already in use for other type of device, \n if device == nil\n puts \"Couldn't create virtual_container with name #{virtual_device_name}\"\n next\n end\n end \n \n filename = part_filename(part)\n content_type = part.content_type\n filename ||= \"#{index}.#{ext(part)}\"\n file = filename\n fname = file.split(\".\")\n \n # If prefix given in topic, add it to filename\n if email.subject.to_s.include?(\"[p]\") \n # Adds email topic as a prefix for the file\n filename = email.subject.to_s.gsub('[p]', '').strip.gsub(/\\r/, '_') + \"_\" + filename\n end\n \n # Use virtualContainerManager to add the file\n # Create the manager \n @virtualContainerManager = VirtualContainerManager.new(user, device.dev_name)\n \n # Add file with the manager\n @virtualContainerManager.addFile('/' + filename, part.body)\n \n # Add metadata\n @virtualContainerManager.addMetadata('/' + filename, \"mail_topic\", email.subject)\n @virtualContainerManager.addMetadata('/' + filename, \"mail_from\", email.from.to_s.strip)\n \n # Make the commit\n @virtualContainerManager.commit\n \n puts \"File #{filename} was saved to visualrest\"\n end\n end\n # If mail was not seen, mark it again as not seen\n #puts \"merkitään lukemattomaksi\"\n #if notSeen\n # imap.store(uid, \"-FLAGS\", [:seen])\n #end\n if uid > new_uid\n new_uid = uid\n end\n end\n \n \n imap.logout\n imap.disconnect\n \n rescue => e\n puts \"Problem fetching users mails\"\n puts e\n return new_uid\n end\n return new_uid\n end", "def send_email(postman, opts)\n Dir.mktmpdir do |dir|\n name = \"svn-log-#{Date.today.strftime('%d-%b-%Y')}.html\"\n begin\n postman.send opts.merge(attachments: [to_f(File.join(dir, name), opts)])\n ensure\n FileUtils.rm_rf(\"#{dir}/*\")\n end\n rescue StandardError => e\n @log.error \"ll-010: Can't send an email '#{opts['subject']}' to #{opts['to']} due to \" \\\n \"#{Backtrace.new(e)}'\"\n end\n end", "def mail(headers={}, &block)\n headers.reverse_merge! 'X-Mailer' => 'Redmine',\n 'X-Redmine-Host' => Setting.host_name,\n 'X-Redmine-Site' => Setting.app_title,\n 'X-Auto-Response-Suppress' => 'All',\n 'Auto-Submitted' => 'auto-generated',\n 'From' => Setting.mail_from,\n 'List-Id' => \"<#{Setting.mail_from.to_s.tr('@', '.')}>\"\n\n ################\n # Smile specific #782168 V4.0.0 : Plugin option to redirect all notifications to the action author\n redirect_notifications_to_author = (\n Setting.plugin_redmine_admin_enhancements['redirect_notifications_to_author'] &&\n @author.present? &&\n @author.mail.present?\n )\n if redirect_notifications_to_author\n Rails.logger.debug \" =>mail redirect mails to author #{@author.mail}\"\n end\n # END -- Smile specific\n #######################\n\n # Replaces users with their email addresses\n [:to, :cc, :bcc].each do |key|\n if headers[key].present?\n ################\n # Smile specific #782168 V4.0.0 : Plugin option to redirect all notifications to the action author\n # Smile specific : param redirect_to_author added\n # => emails with user name\n headers[key] = self.class.email_addresses(headers[key], redirect_notifications_to_author)\n end\n end\n\n # Removes the author from the recipients and cc\n # if the author does not want to receive notifications\n # about what the author do\n if @author && @author.logged? && @author.pref.no_self_notified\n addresses = @author.mails\n headers[:to] -= addresses if headers[:to].is_a?(Array)\n headers[:cc] -= addresses if headers[:cc].is_a?(Array)\n end\n\n if @author && @author.logged?\n redmine_headers 'Sender' => @author.login\n end\n\n # Blind carbon copy recipients\n if Setting.bcc_recipients?\n headers[:bcc] = [headers[:to], headers[:cc]].flatten.uniq.reject(&:blank?)\n headers[:to] = nil\n headers[:cc] = nil\n end\n\n ################\n # Smile specific #782168 V4.0.0 : Plugin option to redirect all notifications to the action author\n if redirect_notifications_to_author\n @messages_mail_transfered_to_autor = []\n\n [:to, :cc, :bcc].each do |key|\n if headers[key].present?\n headers[key].each do |h|\n @messages_mail_transfered_to_autor << [key, h]\n end\n end\n\n headers[key] = nil\n end\n\n headers[:to] = [@author.mail]\n Rails.logger.debug \" =>mail headers[:to] := #{headers[:to].inspect}\"\n end\n # END -- Smile specific\n #######################\n\n if @message_id_object\n headers[:message_id] = \"<#{self.class.message_id_for(@message_id_object)}>\"\n end\n if @references_objects\n headers[:references] = @references_objects.collect {|o| \"<#{self.class.references_for(o)}>\"}.join(' ')\n end\n\n the_super_method = method(__method__).super_method.super_method\n #Rails.logger.debug \" =>mail method =#{method(__method__).inspect}\"\n #Rails.logger.debug \" =>mail super method =#{method(__method__).super_method.inspect}\"\n #Rails.logger.debug \" =>mail super super method=#{the_super_method}\"\n\n if block_given?\n # Smile specific call super super method : the original super\n \n the_super_method.call headers, &block\n # Smile comment : UPSTREAM code\n # super headers, &block\n else\n # Smile specific call super super method : the original super\n the_super_method.call headers do |format|\n format.text\n format.html unless Setting.plain_text_mail?\n end\n # Smile comment : UPSTREAM code\n # super headers do |format|\n # ...\n end\n end", "def send_gmail_to_listing(username, password, subject_text, worksheet_key, html_path, image_path)\n # Connect to gmail and puts\n # username and password are parameters you will input as argument on command line\n gmail = Gmail.connect(username, password)\n puts \"Gmail login\"\n\n # Call the go_through_all_the_lines function wich returns all the emails in an array\n email_listing = go_through_all_the_lines(worksheet_key)\n\n # Iterate through all the emails\n email_listing.each do |email|\n # For each email send mail to email\n gmail.deliver do\n to email\n # subject_text variable is a parameter you will input as argument on command line\n subject subject_text\n # Send the content in the email as html\n html_part do\n content_type 'text/html; charset=UTF-8'\n # Call the get_email_html function to get the body content\n body get_email_html(html_path)\n end\n # Call the get_email_image function to add an image to the email\n add_file get_email_image(image_path)\n end\n # Puts a message on console when the email is successfully sent\n puts \"Email successfully sent to #{email}\"\n end\n # Call the save_to_file function to save the output in a text file\n save_to_file(email_listing)\n # Log out of gmail and puts\n gmail.logout\n puts \"Gmail logout script finished\"\n\nend", "def getMail\n# gets maximum id avoiding nil case\n id = Message.maximum(:id)\n if id.nil?\n id = 0\n else\n id += 1\n end\n allMail = Mail.all #Grab all unread mail\n if !allMail.empty? #Check to see if no new mail\n allMail.each do |mail|\n#This is a method to check to see if author is from grinnell domain\n# if mail.from[0].downcase.include? (\"@grinnell.edu\")\n# if mail.subject.downcase.include? (\"csstudent\")\n message = Message.new\n message.id = id\n #Grab subject that doesn't include csstudent and other tags\n message.subject = addTag(message, mail.subject)\n message.tag_list.sort!\n message.author = mail.from[0]\n message.content = getContent(mail)\n message.created_at = mail.date.to_s\n # Makes it so both have the same time format\n message.updated_at = Time.now.strftime(\"%Y-%m-%d %H:%M\")\n message.save\n id += 1\n# end\n end\n end\n end", "def message_me(msg)\n @msg = msg\n mail subject: \"From: #{@msg.name} : #{@msg.email} says : #{@msg.subject}\", body: \"From: #{@msg.name} @ #{@msg.email} | Subject: #{@msg.subject} | Body of email : #{@msg.content}\"\n #@msg.content << \"From : #{@msg.name} :: Subject : #{@msg.subject}\" # previous one\n end", "def fetch_messages(gmail, label, criteria, save_attachments)\n mails = []\n gmail.mailbox(label).search(criteria).each do |email|\n subject = \"#{Mail::Encodings.value_decode(email.subject)}\"\n puts \"----------\"\n puts \"[#{email.uid}] #{subject}\"\n from = sender(email.from)\n to = recipients(email.to)\n attachments = attachments(email)\n body = extract_body(email)\n\n # TODO: saving attachments should be configurable\n if save_attachments && email.message.attachments.any?\n puts \"Attachments:\"\n email.message.attachments.each do |attachment|\n save_attachment(email, attachment)\n end\n end\n\n mails << { :uid => email.uid,\n :date => Time.parse(email.date),\n :subject => subject,\n :from => from,\n :to => to,\n :body => body,\n :attachments => attachments }\n end\n mails\n end", "def display\n\t\tr_str = \"Message: \"\n\t\t(@length / 5).times { |i| r_str += \"#{@string[(i * 5)...(i * 5) + 5]} \" }\n\t\tputs r_str\n\tend", "def first_message_number\n @first_message_index < 0 ? @messages.length + @first_message_index : @first_message_index\n end", "def big_vol_mail(option_data)\n @options_data = option_data\n [\"[email protected]\",\"[email protected]\",\"[email protected]\"].each do |addr|\n mail(to: addr, subject: \"BigVolOptions\").deliver\n end\n end", "def delivered_mail(pos = 1)\n ActionMailer::Base.deliveries.last(pos).first\n end", "def receive_inbound_email_from_mail(**kwargs, &block); end", "def test_three\n print \"Test three (enqueue batch of messages): \"\n msg_ary = (1..14).map{|i| i.to_s}\n EZQ.enqueue_batch(msg_ary,[{'EZQ'=>nil}],'test_queue')\n q = EZQ.get_queue('test_queue')\n 14.times do\n q.receive_message do |msg|\n msg_ary -= [EZQ.strip_preamble(msg.body)]\n end\n end\n puts msg_ary\n if msg_ary.empty?\n puts 'pass'\n else\n puts 'fail'\n end\nend", "def queued_messages\r\n @buffer.slice(@pointer, @buffer.length - @pointer)\r\n end", "def build_and_send_pastepin(messages)\n # XXX: start a thread with a new message scope (ugly)\n threaded {\n # The message that caused all this!\n Thread.current[:ricer_message] = messages.first\n Thread.current[:ricer_user] = sender\n # Inform_user\n sender.localize!.send_message(t(:msg_autopasting, :count => messages.length))\n # Paste it!\n get_plugin('Paste/Paste').\n send_pastebin(\n autopaste_title(messages),\n autopaste_message(messages),\n messages.length,\n 'text',\n 'ricer4.plugins.paste.auto_paste.msg_autopasted',\n )\n }\n end", "def get_mails\n gmail = Gmail.connect @current_user.login, @current_user.password\n return nil unless gmail.logged_in?\n\n mails = gmail.inbox.find :unread, after: @filter_date + 1\n sent_mails = gmail.label(\"[Gmail]/Sent Mail\").find(afetr: @filter_date + 1)\n sent_mails.each { |e| mails << e }\n mails.sort_by!(&:date)\n\n end", "def create_report_if_valid!\n messages = conversation.messages.valid.where.not(step: nil).group(:step)\n\n if messages.size.size == STEPS.size + 1\n messages = conversation.messages.valid.where.not(step: nil).group_by(&:step)\n\n params = {\n user_email: remove_short_code(messages[1].first.body),\n reportee_name: remove_short_code(messages[2].first.body),\n reportee_mother_name: remove_short_code(messages[3].first.body),\n address: remove_short_code(messages[4].first.body),\n district: remove_short_code(messages[5].first.body),\n probable_cause: CATEGORIES_MAPPING[remove_short_code(messages[6].first.body).to_i]\n }\n\n # Creates the report and notifies the user\n CreateReport.new(params.with_indifferent_access).create!\n conversation.finished!\n send_sms('Recebemos seu alerta com sucesso, obrigado.')\n end\n end", "def start_message\n @all_text_width = 0\n @pop = nil\n \n @text = \"\"\n @text_line = $game_message.texts.size < $game_message.max_line ? $game_message.texts.size + 1 : MAX_LINE + 1\n for i in 0...$game_message.texts.size\n # Change \" \" to \"\" (Spacing for choice)\n @text += \"\" if i >= $game_message.choice_start\n @text += $game_message.texts[i].clone + \"\\x00\"\n end\n \n @item_max = $game_message.choice_max\n convert_special_characters\n reset_window\n update_window_size\n new_page\n end", "def email(cdn, e)\n data = JSON.load REDIS[cdn]\n link = \"http://logserver.flocasts.com/#{cdn.to_sym.object_id}\"\n\n tox = data['server_admins']\n from = '[email protected]'\n subj = '[ERROR] ' + cdn\n text = [link, \"\\n\", e.message, e.class, e.backtrace].join \"\\n\"\n\n Gmail.new from, 'flocastayo' do |gmail|\n gmail.deliver do\n to tox\n subject subj\n text_part { body text }\n end\n end\nend", "def draw_messages\n @messages.last(window_line_size).inject(0) do |line_number, message|\n setpos(line_number, 0)\n clrtoeol\n\n if message.command == \"PRIVMSG\"\n sendMsg = \"#{message.to}: <#{message.from}> #{message.msg}\"\n elsif message.command == \"Successfull Join\"\n @currentRoom = message.msg.split[0]\n @joinedRooms.merge(message.msg.split)\n sendMsg = message.text\n elsif message.command == \"Successfull Part\"\n @joinedRooms.delete(message.msg)\n if @currentRoom == message.msg then @currentRoom = @joinedRooms.to_a[0] end\n sendMsg = message.text\n else\n sendMsg = message.msg\n end\n\n if sendMsg != \"\"\n addstr(\"> #{sendMsg}\")\n line_number = line_number + 1\n end\n\n line_number\n end\n end" ]
[ "0.6880473", "0.60566413", "0.5451117", "0.5448007", "0.54281896", "0.54281896", "0.52653056", "0.520472", "0.51923686", "0.5179006", "0.51269937", "0.5115845", "0.5111747", "0.51058537", "0.5100928", "0.5091655", "0.5051228", "0.5049355", "0.5042337", "0.50351167", "0.5029367", "0.5023868", "0.49990103", "0.4998427", "0.49922404", "0.49591678", "0.4939153", "0.49344942", "0.49263427", "0.49094853", "0.489842", "0.48788568", "0.4875042", "0.48749113", "0.48632723", "0.48561686", "0.4854293", "0.4846821", "0.48427132", "0.4831129", "0.48283374", "0.4818774", "0.4815574", "0.48082945", "0.47909626", "0.4779987", "0.47784278", "0.47783226", "0.47682825", "0.47571918", "0.4754812", "0.47166678", "0.47162583", "0.47087738", "0.47082275", "0.47072986", "0.47063094", "0.46997324", "0.4695535", "0.46852037", "0.4680772", "0.4671981", "0.46599352", "0.465358", "0.46424887", "0.46327588", "0.46312985", "0.46294084", "0.46248278", "0.46228766", "0.46209782", "0.4617626", "0.46169814", "0.46094275", "0.46086538", "0.46003014", "0.45936018", "0.4587041", "0.45862746", "0.4583126", "0.45822147", "0.45764568", "0.45744002", "0.45715743", "0.45673043", "0.45648497", "0.45630896", "0.4555709", "0.45539957", "0.45516688", "0.45507643", "0.4548087", "0.45471653", "0.45429885", "0.45424035", "0.45422813", "0.45404834", "0.45376784", "0.45375818", "0.4536267" ]
0.5953292
2
Subject must be unique and identical every time an email is sent for a given discussion roll This way email clients can nicely group the emails into a conversation NB: conversation_with is an array of User's or Strings (of email addresses)
def subject_for(from_name, conversation_with, verb="sent", suffix="video") case conversation_with.count when 0 "#{from_name} #{verb} you #{suffix}" when 1 "#{from_name} #{verb} you and #{nickname_for_user_or_email(conversation_with[0])} #{suffix}" when 2 "#{from_name} #{verb} you, #{nickname_for_user_or_email(conversation_with[0])} and #{nickname_for_user_or_email(conversation_with[1])} #{suffix}" else others = conversation_with[0..1].map { |p| nickname_for_user_or_email(p) } .join(", ") "#{from_name} #{verb} you, #{others} and #{pluralize(conversation_with.count-2, 'other')} #{suffix}" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subject\n self['subject'] || msg['subject']\n end", "def subjects\r\n subjects = []\r\n range =\"#{group[:first_message]}-\"\r\n connection.query(:xhdr, \"Subject\", range) do |status, data|\r\n if status[:code] == 221\r\n data.each do |line|\r\n message = Message.new\r\n message.num, message.subject = line.split(' ', 2)\r\n subjects << message\r\n end\r\n end\r\n end\r\n subjects\r\n end", "def on_discussion_roll_creation(opts)\n discussion_roll_mail_setup(opts)\n\n # for initial roll creation, always calling out video aspect\n verb, suffix = \"sent\", \"video\"\n @subject = subject_for(@poster_string_name, opts[:all_participants] - [opts[:posting_participant], opts[:receiving_participant]], verb, suffix)\n \n mail :from => \"\\\"Shelby Mail\\\" <#{Settings::Email.discussion_roll['from_email']}>\",\n :reply_to => \"\\\"No Reply\\\" <#{Settings::Email.discussion_roll['from_email']}>\",\n :to => opts[:receiving_participant_email_address], \n :subject => @subject\n end", "def subject; @message_impl.getSubject; end", "def subject\n @subject ||= Envelope::MessageTools.normalize(message.subject || '')\n end", "def subject=(subject); @message_impl.setSubject subject; end", "def subject\n message.subject\n end", "def conversation_subject user\n if user.musician?\n \"#{user.name} desea unirse al grupo\"\n else\n \"#{user.name} desea que te unas al grupo\"\n end\n end", "def message_subject=(value)\n @message_subject = value\n end", "def subject (recipient)\n subject_variables = alert_variables[:subject].dup\n subject_variables.merge!(recipient_details(recipient))\n subject = \"#{I18n.t(\"#{recipient_type.to_s}_subject_#{alert_name.to_s}\", subject_variables)}\"\n subject\n end", "def remove_duplicate_errors\n if errors[\"mailboxer_notification.conversation.subject\"].present? and errors[\"mailboxer_notification.subject\"].present?\n errors[\"mailboxer_notification.conversation.subject\"].each do |msg|\n errors[\"mailboxer_notification.conversation.subject\"].delete(msg)\n end\n end\n end", "def subject_for(template, attributes = {})\n subject = EmailTemplate.subject_for(template)\n subject = I18n.t(\"email_templates.#{template}.default_subject\") if subject.nil?\n subject = \"No Subject\" if subject.nil?\n Florrick.convert(subject, add_default_attributes(attributes))\n end", "def on_discussion_roll_reply(opts)\n discussion_roll_mail_setup(opts)\n \n if @last_post_video_only\n verb, suffix = \"sent\", \"video\"\n else\n verb, suffix = \"replied to\", nil\n end\n @subject = subject_for(@poster_string_name, opts[:all_participants] - [opts[:posting_participant], opts[:receiving_participant]], verb, suffix)\n \n mail :from => \"\\\"Shelby Mail\\\" <#{Settings::Email.discussion_roll['from_email']}>\",\n :reply_to => \"\\\"No Reply\\\" <#{Settings::Email.discussion_roll['from_email']}>\",\n :to => opts[:receiving_participant_email_address], \n :subject => @subject\n end", "def message_subject\n return @message_subject\n end", "def emails_send_to\n (emails + [cc.presence]).compact.uniq.to_sentence\n end", "def create \n params[:subject][:title].strip! if !params[:subject][:title].nil?\n params[:subject][:content].strip! if !params[:subject][:content].nil?\n @subject = Subject.new(params.require(:subject).permit(:title, :content, :for_correctors, :important, :for_wepion))\n @subject.user = current_user.sk\n @subject.last_comment_time = DateTime.now\n @subject.last_comment_user = current_user.sk\n \n @subject.for_wepion = false if @subject.for_correctors # We don't allow Wépion if for correctors\n\n if @subject.title.size > 0\n @subject.title = @subject.title.slice(0,1).capitalize + @subject.title.slice(1..-1)\n end\n\n # Set associated object (category, section, chapter, exercise, problem)\n err = set_associated_object\n error_create([err]) and return if !err.empty?\n\n # Attached files\n @error_message = \"\"\n attach = create_files\n error_create([@error_message]) and return if !@error_message.empty?\n\n if @subject.save\n attach_files(attach, @subject)\n\n if current_user.sk.root?\n for g in [\"A\", \"B\"] do\n if params.has_key?(\"groupe\" + g)\n User.where(:group => g).each do |u|\n UserMailer.new_message_group(u.id, @subject.id, current_user.sk.id).deliver\n end\n end\n end\n end\n\n flash[:success] = \"Votre sujet a bien été posté.\"\n redirect_to subject_path(@subject, :q => @q)\n else\n destroy_files(attach)\n error_create(@subject.errors.full_messages) and return\n end\n end", "def discussion_roll_mail_setup(opts)\n @roll = opts[:discussion_roll]\n @recipient_string_id = opts[:receiving_participant].is_a?(User) ? opts[:receiving_participant].id.to_s : opts[:receiving_participant]\n @poster_string_name = nickname_for_user_or_email(opts[:posting_participant])\n @token = opts[:token]\n @permalink = \"http://shelby.tv/mail/#{@roll.id}?u=#{CGI.escape(@recipient_string_id)}&t=#{CGI.escape(CGI.escape(@token))}\"\n\n sendgrid_category Settings::Email.discussion_roll[\"category\"]\n sendgrid_ganalytics_options(:utm_source => 'discussion_roll', :utm_medium => 'notification', :utm_campaign => \"roll_#{@roll.id}\")\n \n # Displaying context for the most recent frame only\n most_recent_frame = Frame.where(:roll_id => @roll.id).order(:score.desc).first\n @conversation_elements = conversation_elements_for([most_recent_frame], Settings::Email.discussion_roll['max_element_count'])\n \n # get the latest message from the latest frame, use that to determine if last posting was video-only\n most_recent_message = most_recent_frame.conversation.messages[-1]\n @last_post_video_only = !most_recent_message or most_recent_message.text.blank?\n end", "def formatted_subject(text)\n name = PersonMailer.global_prefs.app_name\n label = name.blank? ? \"\" : \"[#{name}] \"\n \"#{label}#{text}\"\n end", "def subject() self.headers[\"Subject\"] || \"[NO SUBJECT]\" end", "def subject\n @options.fetch(:subject) { \"Invitation\" }\n end", "def message\n if subject && !subject.empty?\n subject + \"\\n\" + body\n else\n body\n end\n end", "def send!(to_array, subject)\n begin\n conversation = Conversation.new\n conversation.subject = subject\n \n conversation.messages << self\n \n self.save!\n conversation.save!\n \n senderconversation = Userconversation.new\n senderconversation.user = self.sender\n senderconversation.readed = true\n senderconversation.conversation = conversation\n senderconversation.hide = false\n senderconversation.save!\n \n to_array.each do |to|\n receiverconversation = Userconversation.new\n receiverconversation.user = to\n receiverconversation.readed = false\n receiverconversation.hide = false\n receiverconversation.conversation = conversation\n receiverconversation.save!\n end\n return true\n rescue\n return false\n end\n end", "def subject_id\n raise ArgumentError, \"#subject_id not implemented for #{self.class}\"\n end", "def subject_names\n @subject_names ||= sw_subject_names\n end", "def subject\n @mail.subject\n end", "def get_subject\n out = ''\n if aggregate_count > 1 #multiple records of any type\n if type_count > 1 #multiple types of records\n if distinct_aggregate_count > 1 #multiple profiles\n others = (distinct_aggregate_count-1)\n out << \"and #{pluralize(others, 'other')} \"\n out << subject_aggregate.sub('was ','were ')\n out << \" #{type_count} times\"\n else\n out << subject_aggregate\n out << \" #{type_count} times\"\n end\n else\n if distinct_aggregate_count > 1 #multiple profiles\n others = (distinct_aggregate_count-1)\n out << \"and #{pluralize(others, 'other')} \"\n out << subject.sub('was ','were ')\n else\n out << subject\n end\n end\n else\n out << subject\n end\n return out.html_safe\n end", "def email_subject\n sponsor_name = @config.plan.sponsor_name\n display_date = @date.to_s()\n if @config.div_id.present?\n email_subject = \"Payroll report for #{sponsor_name} for division #{@config.division_name}: #{display_date}\"\n else\n email_subject = \"Payroll report for #{sponsor_name}: #{display_date}\"\n end\n return email_subject\n end", "def message_subjects\n list = []\n active_div.divs(:class=>\"inbox_subject\").each do |div|\n list << div.text\n end\n return list\n end", "def subject\n self['subject']\n end", "def subject_titles\n @subject_titles ||= sw_subject_titles\n end", "def identifier_email(topic,identifiers,board_publication,receipients,attach_content,include_comments,message_content,message_subject=nil)\n # add attachments\n if (identifiers.length > 0 && attach_content)\n document_content = \"\"\n identifiers.each do |ec|\n unless ec.nil?\n document_content += Identifier.find(ec[:id]).content || \"\"\n end\n end\n attachments.inline['attachment.txt'] = document_content\n end\n if include_comments \n @comments = Comment.find_all_by_publication_id(identifiers[0].publication.origin.id) \n else\n @comments = [] \n end\n\n na_text = I18n.t(\"mailers.notapplicable\")\n @identifier_links = identifiers.length > 0 ? Hash[identifiers.map {|x| [x.title, preview_url(x)]}] : Hash[ na_text, dashboard_url ]\n\n # publication title and publication link should always give us the publication of origin\n @publication_links = identifiers.length > 0 ? Hash[identifiers.first.publication.origin.title, url_for(identifiers.first.publication.origin)] : Hash[ na_text, dashboard_url ]\n\n @board_publication_links = board_publication.nil? ? Hash[ na_text, dashboard_url ] : Hash[ board_publication.title , url_for(board_publication) ]\n\n if board_publication.nil?\n board_owner = na_text\n else\n board_owner = board_publication.owner.friendly_name\n end\n\n # we want to leave it to mailer view to be able to relace the IDENTIFIER_LINK and PUBLICATION_LINK placeholders with active links\n # to the identifiers and publications but first we need to do some weird string wrangling here to make sure that the user-entered \n # email message escapes any unsafe content \n # (see http://makandracards.com/makandra/2579-everything-you-know-about-html_safe-is-wrong for explaination)\n @message = \"\".html_safe \n @message << message_content.gsub(/!IDENTIFIER_TITLES/,identifiers.collect{|ei| ei.title}.join('; ')).gsub(/!PUBLICATION_TITLE/,identifiers[0].publication.origin.title).gsub(/!TOPIC/,topic) \n .gsub(/!PUBLICATION_CREATOR_NAME/,identifiers[0].publication.origin.creator.full_name).gsub(/!BOARD_OWNER/,board_owner)\n\n\n identifier_titles = identifiers.collect{|ei| ei.title}.join('; ')\n if message_subject.nil? || message_subject == ''\n message_subject = topic + ': ' + identifiers[0].publication.origin.title + \" \" + identifier_titles\n else\n message_subject = message_subject.gsub(/!TOPIC/,topic).gsub(/!PUBLICATION_TITLE/,identifiers[0].publication.origin.title).gsub(/!IDENTIFIER_TITLES/,identifier_titles)\n end\n # make sure we have a decent length for the subject\n message_subject = truncate(message_subject, length:75)\n mail(:to => receipients, :subject => message_subject)\n end", "def choose_subject(action, params = {})\n scope = [:mailers, mailer_name, action]\n key = :subject\n experiment_name = \"#{mailer_name}_mailer_#{action}_subject\".to_sym\n if experiment_active?(experiment_name)\n scope << key\n key = ab_test(experiment_name)\n end\n params.merge!(scope: scope)\n I18n.t(key, params)\n end", "def subject_name\n return @subject_name\n end", "def assign_subject!\n return if subject_code.present?\n update(slice_subject_id: nil)\n end", "def subject(options)\n case [options[:person], options[:plurality]]\n when %i[first singular]\n 'I'\n when %i[first plural]\n 'we'\n when %i[second singular], %i[second plural]\n 'you'\n when %i[third singular]\n 'he'\n when %i[third plural]\n 'they'\n end\n end", "def subject\n @subject ||= \"(sans sujet)\"\n if @no_header_subject.nil?\n \"#{header_subject}#{@subject}\"\n else\n @subject\n end\n end", "def subject_name\n subject_full_name\n end", "def get_subject\n\t\tend", "def course_duplicated_email(original_course, new_course, user)\n # Based on DuplicationService, user might default to User.system which has no email.\n return unless user.email\n\n @original_course = original_course\n @new_course = new_course\n @recipient = user\n I18n.with_locale(@recipient.locale) do\n mail(to: @recipient.email, subject: t('.subject', new_course: @new_course.title))\n end\n end", "def build_email_kase(options={})\n EmailKase.new({\n :kase => self,\n :subject => \"%{name} wants to know what you think\".t % {:name => self.person.casualize_name}\n }.merge(options))\n end", "def collaboration_notification(attributes={})\n invited_by = attributes[:invited_by]\n\t\t@sender_name = invited_by.try(:full_name)\n\t\t@invitee_name = attributes[:invitee].full_name\n\t\tcollaboration_object_type = attributes[:invitation_type].class.to_s.downcase\n\t\t@collaboration_link = \"#{ENV['DOMAIN']}/#/app/#{collaboration_object_type.pluralize}/#{attributes[:invitation_type].id}/accept_invitation\"\n\t\t@reject_link = \"#{ENV['DOMAIN']}/#/app/#{attributes[:invitation_type].class.name.downcase.pluralize}/#{attributes[:invitation_type].id}/reject_invitation\"\n\t\t@message = attributes[:invitation_message].to_s\n\t\t@subject = \"Your help has been requested for a new #{collaboration_object_type} in Grapple.\"\n\t\tp \"-----------------------------------------------------------------------------\"\n\t\tp \"Existing User - Sending CollabInvitation to #{@invitee_name} - #{attributes[:email]}\"\n\t\tp \"-----------------------------------------------------------------------------\"\n\t\tif collaboration_object_type == \"project\"\n\t\t\t@project_title = attributes[:invitation_type].title\n\t\t\tmail(\"existing_user_project_collaboration_invitation\",email: attributes[:email])\n\t\telsif collaboration_object_type == \"document\"\n\t\t\t@document_title = attributes[:invitation_type].title\n\t\t\t@project_title = attributes[:invitation_type].project.title\n\t\t\tmail(\"existing_user_document_collaboration_invitation\",email: attributes[:email])\n\t\tend\n\tend", "def compose_email\n @title = t 'conclusion_draft_review.send_by_email'\n end", "def subject\n title \n end", "def subjects_person\n get_item_data_by_name('SubjectPerson')\n end", "def subject_for(key); end", "def check_subject_and_body(email)\n winning_category = nil\n temp_points = 0 #The score for the current category\n points = 0 # The highest score achived\n\n subject_words = SeperateWords.new.seperate(email.subject)\n body_words = SeperateWords.new.seperate(email.body)\n\n @all_categories.each do |cat|\n #Checks each word in subject and body against keywords in categories\n temp_points += check_words(cat.key_words, subject_words, true)\n\n #BODY\n temp_points += check_words(cat.key_words, body_words)\n\n if temp_points > points\n\n points = temp_points\n winning_category = cat\n end\n\n temp_points = 0\n end\n #This way removes unesseccary transactions\n unless winning_category.blank?\n attach_category_to_email(email,winning_category)\n else\n #This asumes there's a category called \"Uncategorized\"\n #uncategorized = Category.find_by_name(\"Uncategorized\")\n #using scopes: not working for some reason\n #uncategorized = Category.uncategorized\n\n #attach_category_to_email(email,uncategorized)\n end\n\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def enroll(subject)\n\t\tsubjects[subject] = []\n\t\tsubjects\n\tend", "def group_welcome_email\n NotifierMailer.group_welcome_email Group.take\n end", "def duplicate_subjects\n @pp_subject_files.select{|k,v| v.size > 1}\n end", "def subject=(string)\n set('Subject', string)\n end", "def all_email(email)\n content = \"\"\n address = email\n Membership.where(email: email).each do |membership|\n Task.where(group_id: membership.group_id).each do |task|\n content << \"#{task.title}\\n\"\n end\n Subtask.where(group_id: membership.group_id).each do |subtask|\n content << \"#{subtask.task.title}: #{subtask.title}\\n\"\n end\n end\n unless content.empty?\n mail(to: address, subject: \"Your Tasks\", body: content)\n end\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def subject(options = {})\n options = { :capitalize => true, :case => Grammar::Case::SUBJECT }.merge(options)\n pronoun_or_noun(@subject, @audience, options)\n end", "def create_forum_subject(contest)\n s = Subject.create(:contest => contest,\n :user_id => 0,\n :title => \"Concours ##{contest.number}\",\n :content => helpers.get_new_contest_forum_message(contest),\n :last_comment_time => DateTime.now,\n :last_comment_user_id => 0,\n :category => Category.where(:name => \"Mathraining\").first)\n end", "def subject_clean(subject)\n return '' if subject.blank?\n\n ticket_hook = SygiopsSupport::Setting.get('ticket_hook')\n ticket_hook_divider = SygiopsSupport::Setting.get('ticket_hook_divider')\n ticket_subject_size = SygiopsSupport::Setting.get('ticket_subject_size')\n\n # remove all possible ticket hook formats with []\n subject = subject.gsub(/\\[#{ticket_hook}: #{number}\\](\\s+?|)/, '')\n subject = subject.gsub(/\\[#{ticket_hook}:#{number}\\](\\s+?|)/, '')\n subject = subject.gsub(/\\[#{ticket_hook}#{ticket_hook_divider}#{number}\\](\\s+?|)/, '')\n\n # remove all possible ticket hook formats without []\n subject = subject.gsub(/#{ticket_hook}: #{number}(\\s+?|)/, '')\n subject = subject.gsub(/#{ticket_hook}:#{number}(\\s+?|)/, '')\n subject = subject.gsub(/#{ticket_hook}#{ticket_hook_divider}#{number}(\\s+?|)/, '')\n\n # remove leading \"..:\\s\" and \"..[\\d+]:\\s\" e. g. \"Re: \" or \"Re[5]: \"\n subject = subject.gsub(/^(..(\\[\\d+\\])?:\\s)+/, '')\n\n # resize subject based on config\n if subject.length > ticket_subject_size.to_i\n subject = subject[ 0, ticket_subject_size.to_i ] + '[...]'\n end\n\n subject.strip!\n subject\n end", "def create_mail\n # Removes the current user from the recipients and cc\n # if he doesn't want to receive notifications about what he does\n @author ||= User.current\n if @author.pref[:no_self_notified]\n recipients.delete(@author.mail) if recipients\n cc.delete(@author.mail) if cc\n end\n \n notified_users = [recipients, cc].flatten.compact.uniq\n # Rails would log recipients only, not cc and bcc\n mylogger.info \"Sending email notification to: #{notified_users.join(', ')}\" if mylogger\n \n # Blind carbon copy recipients\n if Setting.bcc_recipients?\n bcc(notified_users)\n recipients []\n cc []\n end\n super\n end", "def title\r\n fail \"There are no messages yet\" if self.messages.size == 0\r\n\r\n @messages[0].subject.size == 0 ? \"No title\" : @messages[0].subject\r\n end", "def set_subject(subject)\n\t\tend", "def combine_subjects\n @sentences.each_cons(2) do |s1, s2|\n if s1.subject == s2.subject\n s2.subject = Pronoun.new(s1.subject.gender)\n end\n end\n end", "def message_subject\n active_div.div(:id=>\"inbox_show_message\").div(:class=>\"inbox_subject\").link.text\n end", "def headers\n {\n :subject => %(#{subject}),\n :to => %(\"#{cattery_name}\" <#{cattery_email}>),\n :from => %(\"Cat Linker\" <[email protected]>),\n :reply_to => %(\"#{email_to_name(email)}\" <#{email}>)\n }\n end", "def subject=(subject)\n self.subjects = [subject]\n end", "def subjects\n subjects_array = object.syncable_subjects.to_a\n\n return subjects_array unless object.is_send?\n\n subjects_array << Subject.new(subject_code: \"U3\", subject_name: \"Special Educational Needs\")\n\n subjects_array\n end", "def send_mail_to_attendees_on_create\n if self.category.eql?(\"appointment\") and !self.attendees_emails.blank?\n user = self.matter_people.assignee\n att_arr = self.attendees_emails.split(\",\")\n for i in att_arr\n send_notificaton_to_attendees(user, self, i)\n end\n\n true\n end\n end", "def send_bulk_email(message, subject = 'Notification')\n client = IronWorkerNG::Client.new\n payload = {}\n payload['message'] = message\n payload['Subject'] = subject\nend", "def group_root_set_by_subject(root)\n subject_table = {}\n \n # 5B\n # Populate the subject table with one message per each\n # base subject. For each child of the root:\n root.children.each do |container|\n\n # Find the subject of this thread, by using the base\n # subject from either the current message or its first\n # child if the current message is a dummy. This is the\n # thread subject.\n c = nil\n if container.message == nil\n c = container.children[0]\n else\n c = container\n end\n \n message = c.message\n if message.nil?\n next\n end\n \n subject = MessageParser.normalize_subject(message.subject)\n\n # If the thread subject is empty, skip this message\n if subject.length == 0 \n next\n end\n\n existing = subject_table[subject]\n \n # If there is no message in the subject table with the\n # thread subject, add the current message and the thread\n # subject to the subject table.\n if existing == nil\n subject_table[subject] = c\n \n # Otherwise, if the message in the subject table is not a\n # dummy, AND either of the following criteria are true:\n # - The current message is a dummy, OR\n # - The message in the subject table is a reply or forward\n # and the current message is not. \n elsif ( ( not existing.dummy?) && ( c.dummy? || ( \n ( MessageParser.is_reply_or_forward existing.message.subject ) && \n ( not MessageParser.is_reply_or_forward message.subject ))))\n subject_table[subject] = c\n end\n \n end\n \n # 5C\n # using reverse_each here because removing children from root\n # would lead to skipping of root's children\n root.children.reverse_each do |container|\n subject = nil\n \n # Find the subject of this thread, by using the base\n # subject from either the current message or its first\n # child if the current message is a dummy. This is the\n # thread subject.\n if container.message == nil\n subject = container.children[0].message.subject\n else\n subject = container.message.subject\n end\n \n subject = MessageParser.normalize_subject(subject)\n \n c = subject_table[subject]\n \n # If the message in the subject table is the current\n # message, skip this message.\n if c == nil || c == container\n # puts \">>>> skip\"\n next\n end\n \n \n \n # If both messages are dummies, append the current\n # message's children to the children of the message in\n # the subject table (the children of both messages\n # become siblings), and then delete the current message \n if c.dummy?() && container.dummy?()\n container.children.each {|ctr| c.add_child(ctr) }\n container.parent.remove_child(container)\n # If the message in the subject table is a dummy and the\n # current message is not, make the current message a\n # child of the message in the subject table (a sibling\n # of its children). \n elsif c.dummy?() && ( not container.dummy?() )\n c.add_child(container)\n # If the current message is a reply or forward and the\n # message in the subject table is not, make the current\n # message a child of the message in the subject table (a\n # sibling of its children). \n elsif not MessageParser.is_reply_or_forward(c.message.subject) && \n MessageParser.is_reply_or_forward(container.message.subject)\n c.add_child(container) \n # Otherwise, create a new dummy message and make both\n # the current message and the message in the subject\n # table children of the dummy. Then replace the message\n # in the subject table with the dummy message.\n else\n new_container = Container.new\n new_container.add_child(c)\n new_container.add_child(container)\n subject_table[subject] = new_container\n end \n end\n\n subject_table\n end", "def message_me(msg)\n @msg = msg\n mail subject: \"From: #{@msg.name} : #{@msg.email} says : #{@msg.subject}\", body: \"From: #{@msg.name} @ #{@msg.email} | Subject: #{@msg.subject} | Body of email : #{@msg.content}\"\n #@msg.content << \"From : #{@msg.name} :: Subject : #{@msg.subject}\" # previous one\n end", "def suppress_reminders?\n [\n SUBJECT_CSP_TEACHER_CON,\n SUBJECT_CSP_FIT,\n SUBJECT_CSD_TEACHER_CON,\n SUBJECT_CSD_FIT\n ].include? subject\n end", "def subject\n @subject\n end", "def subject; end", "def subject; end", "def subject; end", "def subject; end", "def subject; end", "def subject; end", "def subject; end", "def subject; end", "def subject; end", "def subject; end", "def subject; end", "def subject; end", "def subject; end", "def subject; end", "def subject; end", "def subject; end", "def subject; end", "def subject; end" ]
[ "0.62099266", "0.6137692", "0.60429883", "0.6023133", "0.5955242", "0.5950656", "0.58755374", "0.5761514", "0.57363385", "0.5670635", "0.5630169", "0.5601224", "0.5554262", "0.5551899", "0.5541676", "0.55005705", "0.54910916", "0.5460439", "0.54589164", "0.5450336", "0.53802174", "0.5378778", "0.5376465", "0.5354873", "0.5351924", "0.53150684", "0.5311859", "0.5307125", "0.5299091", "0.5282767", "0.52636254", "0.5257924", "0.5254534", "0.5232191", "0.52270603", "0.5222592", "0.5216753", "0.52138704", "0.52104753", "0.5203951", "0.51696783", "0.51620734", "0.515852", "0.5154237", "0.5152506", "0.51499885", "0.51452744", "0.51452744", "0.51452744", "0.51452744", "0.51452744", "0.51452744", "0.5140075", "0.5134463", "0.5121873", "0.511938", "0.5106802", "0.5081132", "0.5081132", "0.5081132", "0.5081132", "0.5081132", "0.5081132", "0.5081132", "0.5081132", "0.50682265", "0.50651985", "0.5065147", "0.5064258", "0.5054808", "0.50514185", "0.5038589", "0.503793", "0.50277174", "0.5024579", "0.5014154", "0.50100195", "0.50071734", "0.5003257", "0.49970353", "0.4991042", "0.4990922", "0.49875307", "0.49875307", "0.49875307", "0.49875307", "0.49875307", "0.49875307", "0.49875307", "0.49875307", "0.49875307", "0.49875307", "0.49875307", "0.49875307", "0.49875307", "0.49875307", "0.49875307", "0.49875307", "0.49875307", "0.49875307" ]
0.6402764
0
Sets up the variables needed by the templates (and other common setup stuff) Expected opts: discussion_roll: the roll itself posting_participant: the UserObject of the person who created this dicussion roll receiving_participant: the UserObject or email address (as a String) of the person to whom this email is being sent receiving_participant_email_address: the email address (as a String) of the person to whom this email is being sent all_participants: an array (of UserObjects and/or email addresses as Strings) of everybody participating in this conversation this array includes both posting_participant and receiving_participant token: the cryptographic token used in links to grant access
def discussion_roll_mail_setup(opts) @roll = opts[:discussion_roll] @recipient_string_id = opts[:receiving_participant].is_a?(User) ? opts[:receiving_participant].id.to_s : opts[:receiving_participant] @poster_string_name = nickname_for_user_or_email(opts[:posting_participant]) @token = opts[:token] @permalink = "http://shelby.tv/mail/#{@roll.id}?u=#{CGI.escape(@recipient_string_id)}&t=#{CGI.escape(CGI.escape(@token))}" sendgrid_category Settings::Email.discussion_roll["category"] sendgrid_ganalytics_options(:utm_source => 'discussion_roll', :utm_medium => 'notification', :utm_campaign => "roll_#{@roll.id}") # Displaying context for the most recent frame only most_recent_frame = Frame.where(:roll_id => @roll.id).order(:score.desc).first @conversation_elements = conversation_elements_for([most_recent_frame], Settings::Email.discussion_roll['max_element_count']) # get the latest message from the latest frame, use that to determine if last posting was video-only most_recent_message = most_recent_frame.conversation.messages[-1] @last_post_video_only = !most_recent_message or most_recent_message.text.blank? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_discussion_roll_creation(opts)\n discussion_roll_mail_setup(opts)\n\n # for initial roll creation, always calling out video aspect\n verb, suffix = \"sent\", \"video\"\n @subject = subject_for(@poster_string_name, opts[:all_participants] - [opts[:posting_participant], opts[:receiving_participant]], verb, suffix)\n \n mail :from => \"\\\"Shelby Mail\\\" <#{Settings::Email.discussion_roll['from_email']}>\",\n :reply_to => \"\\\"No Reply\\\" <#{Settings::Email.discussion_roll['from_email']}>\",\n :to => opts[:receiving_participant_email_address], \n :subject => @subject\n end", "def on_discussion_roll_reply(opts)\n discussion_roll_mail_setup(opts)\n \n if @last_post_video_only\n verb, suffix = \"sent\", \"video\"\n else\n verb, suffix = \"replied to\", nil\n end\n @subject = subject_for(@poster_string_name, opts[:all_participants] - [opts[:posting_participant], opts[:receiving_participant]], verb, suffix)\n \n mail :from => \"\\\"Shelby Mail\\\" <#{Settings::Email.discussion_roll['from_email']}>\",\n :reply_to => \"\\\"No Reply\\\" <#{Settings::Email.discussion_roll['from_email']}>\",\n :to => opts[:receiving_participant_email_address], \n :subject => @subject\n end", "def initialize(opts = {})\n @subject, @object, @audience, @person, @number = opts[:subject], opts[:object], opts[:audience], opts[:person], opts[:number]\n end", "def initialize\n\t\t\t\t@template_info =\n\t\t\t\t{\n\t\t\t\t\t:name => \"talking_points\",\n\t\t\t\t\t:author => \"hammackj\",\n\t\t\t\t\t:version => \"0.0.2\",\n\t\t\t\t\t:renderer => \"PDF\",\n\t\t\t\t\t:description => \"Generates a Talking Points Report\"\n\t\t\t\t}\n\t\t\tend", "def create\n hash = params.require(:quest).permit(:title, :description, :due_date, :bounty)\n hash[:assign_to] = params[:quest][:assign_to]\n hash[:remind_to] = params[:quest][:remind_to]\n # hash[:default_reminder] = params[:quest][:default_reminder]\n respond_to do |format|\n if not params[:quest][:assign_to].blank?\n if params[:quest][:assign_to] =~ /\\A[\\w+\\-.]+@[a-z\\d\\-]+(\\.[a-z\\d\\-]+)*\\.[a-z]+\\z/i\n user = User.find_by(:email => params[:quest][:assign_to])\n if user == nil\n if params[:quest][:assign_to] =~ /^\\[email protected]$/\n non_user = true\n else\n flash[:notice] = 'No assinee with this email'\n format.html {redirect_to create_quest_path and return}\n @options = {:redirect => create_quest_path}\n format.js\n return\n end\n end\n else\n user = User.find_by(:username => params[:quest][:assign_to])\n if user == nil\n flash[:notice] = 'No assinee with this username'\n # redirect_to create_quest_path and return\n format.html {redirect_to create_quest_path and return}\n @options = {:redirect => create_quest_path}\n format.js\n return\n end\n end\n end\n @quest = Quest.create_general_quest(hash, @current_user, params.require(:quest).permit(:reminder, :remind_to))\n Quest.assign_non_user @current_user, @quest, params[:quest][:assign_to] if non_user == true\n if params[:photos]\n\n params[:photos].each { |photo|\n @quest.quest_images.create(:photo => photo)\n }\n end\n @quest.quest_videos.create(:url => params[:quest][:url])\n if not hash[:assign_to].blank?\n user_quest = UsersQuest.find_by(:quest_id => @quest.id)\n notif_user = User.find_by(:id => user_quest.assignee_id)\n if notif_user == nil\n format.html {redirect_to quest_path(@quest.id)}\n @options = {:redirect => quest_path(@quest.id)}\n format.js\n return\n end\n notif = Notification.create(:user_id => user_quest.assignee_id,\n :title => \"#{@current_user.first_name} #{@current_user.last_name} has assigned you a quest: #{@quest.title}\",\n :url => quest_path(@quest.id))\n @options = {:channel => \"/notifs/#{user_quest.assignee_id}\",\n :message => notif.title,\n :count => \"#{User.unread_notifications_count notif_user}\", :redirect => quest_path(@quest.id),\n :url => quest_path(@quest.id),\n :id => notif.id}\n\n format.html {redirect_to quest_path(@quest.id)}\n format.js\n else\n @options = {:redirect => quest_path(@quest.id)}\n format.html {redirect_to quest_path(@quest.id)}\n format.js\n end\n end\n end", "def initialize(args={})\n args = DEFAULT_ATTRIBUTES.merge(args)\n \n @list_name = args[:list_name] || Postal.options[:list_name]\n @to = args[:to] \n \n if args[:mailing].nil?\n @additional_headers = args[:additional_headers] \n @attachments = args[:attachments] \n @bypass_moderation = args[:bypass_moderation] \n @campaign = args[:campaign] \n @char_set_id = args[:char_set_id] \n @detect_html = args[:detect_html] \n @dont_attempt_after_date = args[:dont_attempt_after_date] \n @enable_recovery = args[:enable_recovery] \n @from = args[:from] \n @html_message = args[:html_message] \n @html_section_encoding = args[:html_section_encoding] \n @is_html_section_encoded = args[:is_html_section_encoded] \n @is_text_section_encoded = args[:is_text_section_encoded]\n @recency_number_of_mailings = args[:recency_number_of_mailings]\n @recency_which = args[:recency_which]\n @reply_to = args[:reply_to]\n @resend_after_days = args[:resend_after_days]\n @sample_size = args[:sample_size]\n @scheduled_mailing_date = args[:scheduled_mailing_date]\n @subject = args[:subject]\n @text_message = args[:text_message]\n @text_section_encoding = args[:text_section_encoding]\n @title = args[:title]\n @to = args[:to]\n @track_opens = args[:track_opens]\n @rewrite_date_when_sent = args[:rewrite_date_when_sent]\n @mailing = args[:mailing]\n else\n @subject = args[:mailing].subject\n @is_html_section_encoded = args[:mailing].is_html_section_encoded\n @html_section_encoding = args[:mailing].html_section_encoding\n @html_message = args[:mailing].html_message\n @char_set_id = args[:mailing].char_set_id\n @is_text_section_encoded = args[:mailing].is_text_section_encoded\n @text_section_encoding = args[:mailing].text_section_encoding\n @title = args[:mailing].title\n @text_message = args[:mailing].text_message\n @attachments = args[:mailing].attachments\n @from = args[:mailing].from\n @additional_headers = args[:mailing].additional_headers\n @mailing = args[:mailing]\n end\n end", "def prepare_template(community, recipient)\n @community = community\n @current_community = community\n @recipient = recipient\n @url_params = build_url_params(community, recipient)\n set_locale(recipient.locale)\n end", "def initialize ()\n\t\t\t\t@template_info =\n\t\t\t\t{\n\t\t\t\t\t:name => \"talking_points\",\n\t\t\t\t\t:author => \"hammackj\",\n\t\t\t\t\t:version => \"0.0.2\",\n\t\t\t\t\t:renderer => \"PDF\",\n\t\t\t\t\t:description => \"Generates a Talking Points NessusReport\"\n\t\t\t\t}\n\t\t\tend", "def initialize(user, opts)\n # TODO: we should reload user in case it is tainted, should take in a user_id as opposed to user\n # If we don't do this we introduce a rather risky dependency\n @user = user\n @opts = opts || {}\n opts[:title] = pg_clean_up(opts[:title]) if opts[:title] && opts[:title].include?(\"\\u0000\")\n opts[:raw] = pg_clean_up(opts[:raw]) if opts[:raw] && opts[:raw].include?(\"\\u0000\")\n opts.delete(:reply_to_post_number) unless opts[:topic_id]\n @guardian = opts[:guardian] if opts[:guardian]\n\n @spam = false\n end", "def set_template_instance_variables(opts)\n opts.each {|k,v| self.instance_variable_set(\"@#{k}\", v) }\n end", "def setup\n @user = users(:user)\n @user2 = users(:user2)\n @user3 = users(:user3)\n @invitation = invitations(:invitation1)\n end", "def setup\n @admin = users(:admin)\n @user = users(:user)\n @user2 = users(:user2)\n @user3 = users(:user3)\n @user4 = users(:user4)\n @instance = instances(:instance_teaming)\n @invitation = invitations(:invitation1)\n end", "def build\n {\n patient: patient,\n consultation: ConsultationPresenter.new(consultation),\n definite_article: definite_article,\n current_date: current_date,\n current_time: current_time,\n start_time: options.fetch(:start_time, ''),\n end_time: options.fetch(:end_time, ''),\n rest_time: options.fetch(:rest_time, ''),\n surgical_treatment: options.fetch(:surgical_treatment, '').upcase,\n surgery_tentative_date: options.fetch(:surgery_tentative_date, '').upcase,\n surgery_cost: options.fetch(:surgery_cost, ''),\n consultations: consultations,\n doctor: consultation.doctor,\n emergency_number: emergency_number,\n website: website\n }\n end", "def review_decision\n\t\tproject = @task.project\n\t\t@data[:decision_owner] = @task.assigned_to.try(:full_name)\n\t\t@data[:decision_title] = @task.title\n\t\t@data[:project_name] = project.title\n @data[:recipient_names] = recipient_names\n\t\t@data[:decision_link] = \"#{ENV['DOMAIN']}/#/app/projects/#{project.id}/tasks\"\n\t\t@template_slug = APOSTLE_MAIL_TEMPLATE_SLUG[:review_decision]\n\t\ttrigger_mail\t\t\n\tend", "def create_proposal(title, oversight_department, admin_org, opts={})\n \n lo_cat = \"Scientific method\"\n lo_cat_text = \"LO Cat Text\"\n \n defaults = {\n :propose_person => '%%_username%%', #user the dynvar from users.csv\n :mode => 'blank',\n :nav_homepage => true,\n :submit => true,\n :append_unique_id => false, #tell tsung to append unique id on title\n :instructor => 'fred', #BUG - HARDCODED - can't use dynvar though because of ajax search\n :collaborator => @request.config.directory[\"users\"][\"collaborator\"][\"username\"],\n :first_expected_offering => @request.config.directory[\"atp\"][\"name\"],\n :subject_area => \"BSCI\",\n :oversight_dept_number => \"65\", #BUG - right now hardcoded to BSCI, search that returned this was removed\n :course_suffix => \"123\",\n :course_short_title => \"Perf Course\",\n :course_title => title,\n :course_description => \"My fake description.\",\n :course_rationale => \"My fake rationale.\",\n :lo_create => FALSE,\n :lo_category => lo_cat,\n :lo_cat_text => lo_cat_text,\n :lo_name => @request.config.directory[\"lo\"][\"name\"],\n :admin_dep_var_name => \"admin_dep_org_id\",\n :admin_dep_var_regexp => 'org.resultColumn.orgId\\\"\\,\\\"\\([^\\\"]+\\)',\n :proposal_dyn_var_name => \"proposal_id\",\n :proposal_dyn_var_regexp => '\\\"proposal\\\"\\,\\\"workflowNode\\\"\\,\\\"PreRoute\\\"\\,\\\"\\([^\\\"]+\\)',\n :proposal_doc_id_var_name => \"proposal_doc_id\",\n :proposal_doc_id_var_regexp => 'workflowId\\\"\\,\\\"\\([^\\\"]+\\)\\\"',\n :clu_ref_dyn_var_name => \"clu_ref_id\",\n :clu_ref_dyn_var_regexp => '\\\"id\\\"\\,\\\"\\([^\\\"]+\\)',\n :result_com_var_name => \"result_component_id\",\n :result_com_var_regexp => '\\\"ResultComponent 1\\\"\\,\\\"\\([^\\\"]+\\)',\n :enroll_est_var_name => \"default_enrollment_estimate_id\",\n :enroll_est_var_regexp => 'defaultEnrollmentEstimate\\\"\\,\\\"kuali.atp.duration.Week\\\"\\,\\\"Week\\\"\\,\\\"\\([^\\\"]+\\)',\n :lab_var_name => \"lab_id\",\n :lab_var_regexp => 'draft\\\"\\,\\\"unitsContentOwner\\\"\\,\\\"Lab\\\"\\,\\\"\\([^\\\"]+\\)',\n :lab_fee_id_name => 'cp_lab_fee_id',\n :lab_fee_id_regexp => 'kuali.enum.type.feeTypes.labFee\\\"\\,\\\"\\([^\\\"]+\\)',\n :revenues_id_name => 'cp_revenues_id',\n :revenues_id_regexp => 'revenues\\\"\\,\\\"\\([^\\\"]+\\)',\n :revenue_id_name => 'cp_revenue_id',\n :revenue_id_regexp => 'REVENUE\\\"\\,\\\"\\([^\\\"]+\\)',\n :joints_var_name => \"joints_num\",\n :joints_var_regexp => 'joints\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"\\([^\\\"]+\\)',\n :fee_info_id_dyn_var_name => 'fee_info_id',\n :fee_info_id_dyn_var_regexp => '\\\"fees\\\"\\,\\\"\\([^\\\"]+\\)',\n :fee_info_dyn_var_name => 'fee_info',\n :fee_info_dyn_var_regexp => 'org.kuali.student.lum.lu.dto.CluFeeInfo\\\"\\,\\\"\\([^\\\"]+\\)',\n :clu_info_dyn_var_name => 'clu_info',\n :clu_info_dyn_var_regexp => 'org.kuali.student.lum.lu.dto.CluInfo\\\"\\,\\\"\\([^\\\"]+\\)',\n :lu_dto_clu_format_dyn_var_name => \"lu_dto_clu_format\",\n :lu_dto_clu_format_dyn_var_regexp => 'org.kuali.student.lum.lu.dto.CluInfo\\\"\\,\\\"Credit Course\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"formats\\\"\\,\\\"\\([^\\\"]+\\)',\n :lu_dto_clu_activities_dyn_var_name => \"lu_dto_clu_activites\",\n :lu_dto_clu_activities_dyn_var_regexp => 'org.kuali.student.lum.lu.dto.CluInfo\\\"\\,\\\"Credit Course\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"formats\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"0\\\"\\,\\\"activities\\\"\\,\\\"\\([^\\\"]+\\)',\n :outcome_id_var_name => \"outcome_id\",\n :outcome_id_var_regexp => 'outcomeId\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_category_var_name => \"lo_category\",\n #:lo_category_var_regexp => lo_cat_text + '\\\"\\,\\\"plain\\\"\\,\\\"id\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_category_var_regexp => lo_cat_text + '\\\"\\,\\\"plain\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_category_id_var_name => \"lo_category_id\",\n :lo_category_id_var_regexp => 'lo.resultColumn.categoryId\"\\,\\\"\\([^\\\"]+\\)',\n :lo_child_id_dyn_var_name => \"lo_child_id\",\n :lo_child_id_dyn_var_regexp => 'childLo\\\"\\,\\\"\\([^\\\"]+\\)',\n :single_use_lo_dyn_var_name => \"single_use_lo\",\n :single_use_lo_dyn_var_regexp => 'includedSingleUseLo\\\"\\,\\\"\\([^\\\"]+\\)',\n :atp_duration_week_var_name => 'atp_duration_week',\n :atp_duration_week_var_regexp => 'kuali.atp.duration.Week\\\"\\,\\\"Week\\\"\\,\\\"\\([^\\\"]+\\)',\n :version_ind_id_name => 'cp_version_ind_id',\n :version_ind_id_regexp => 'versionIndId\\\"\\,\\\"\\([^\\\"]+\\)',\n :affliated_orgs_id_name => 'cp_affiliated_orgs_id',\n :affliated_orgs_id_regexp => 'affiliatedOrgs\\\"\\,\\\"\\([^\\\"]+\\)',\n :action_request_id_name => 'cp_action_request_id',\n :action_request_id_regexp => 'actionRequestId\\\"\\,\\\"\\([^\\\"]+\\)'\n }\n \n # Version for the doc at each step. We'll increment on each usage\n # So first usage should eval to 0\n version_indicator = -1\n \n opts = defaults.merge(opts)\n \n title << '_%%ts_user_server:get_unique_id%%' if(opts[:append_unique_id])\n \n if(opts[:mode] != \"blank\")\n # select template or copy course...\n end\n \n # Navigate to Curriculum Mgmt\n self.homepage() unless(!opts[:nav_homepage])\n \n puts \"creating proposal as: #{opts[:propose_person]}\"\n \n # Create a course\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SecurityRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|13BFCB3640903B473D12816447D1469D|org.kuali.student.common.ui.client.service.SecurityRpcService|checkAdminPermission|java.lang.String/2004016611|#{opts[:propose_person]}|useCurriculumReview|1|2|3|4|2|5|5|6|7|\"\n }, {'subst' => 'true'}\n )\n \n \n # Click Start blank proposal\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|15|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D60D3C6E0D395C18A0F44A2D9D2A7348|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|getMetadata|java.lang.String/2004016611|java.util.Map||java.util.HashMap/962170901|documentTypeName|kuali.proposal.type.course.create|DtoState|Draft|DtoNextState|DtoWorkflowNode|PreRoute|1|2|3|4|2|5|6|7|8|4|5|9|5|10|5|11|5|12|5|13|5|7|5|14|5|15|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|2543249A07E7952228E0E500F14F1B17|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementTypeForCourse|java.lang.String/2004016611|kuali.statement.type.course|1|2|3|4|1|5|6|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpDurationTypes|atp.resultColumn.atpDurTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.finalExam.status|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|14|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponentType.credit.degree.fixed|kuali.resultComponentType.credit.degree.range|kuali.resultComponentType.credit.degree.multiple|lrc.search.resultComponentType|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|1|7|8|6|3|9|10|9|11|9|12|0|13|14|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|14|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponentType.credit.degree.fixed|kuali.resultComponentType.credit.degree.range|kuali.resultComponentType.credit.degree.multiple|lrc.search.resultComponentType|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|1|7|8|6|3|9|10|9|11|9|12|0|13|14|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|14|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponentType.credit.degree.fixed|kuali.resultComponentType.credit.degree.range|kuali.resultComponentType.credit.degree.multiple|lrc.search.resultComponentType|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|1|7|8|6|3|9|10|9|11|9|12|0|13|14|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|atp.advancedAtpSearchParam.atpType|java.lang.String/2004016611|kuali.atp.type.Spring|kuali.atp.type.Summer|kuali.atp.type.Fall|kuali.atp.type.Session1|kuali.atp.type.Session2|kuali.atp.type.Mini-mester1A|kuali.atp.type.Mini-mester1B|atp.search.advancedAtpSearch|atp.resultColumn.atpStartDate|1|2|3|4|1|5|5|0|0|6|1|7|8|6|7|9|10|9|11|9|12|9|13|9|14|9|15|9|16|0|17|18|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.fee.rateType|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.fee.rateType|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.fee.rateType|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.fee.rateType|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CommentRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|58FCBA6F511FF769D9DF8CAE72C3C369|org.kuali.student.core.comments.ui.client.service.CommentRpcService|getUserRealName|java.lang.String/2004016611|#{opts[:propose_person]}|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|subjectCode.queryParam.code||subjectCode.search.orgsForSubjectCode|subjectCode.resultColumn.orgLongName|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|19|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|atp.advancedAtpSearchParam.atpType|java.lang.String/2004016611|kuali.atp.type.Spring|kuali.atp.type.Summer|kuali.atp.type.Fall|kuali.atp.type.Session1|kuali.atp.type.Session2|kuali.atp.type.Mini-mester1A|kuali.atp.type.Mini-mester1B|atp.advancedAtpSearchParam.atpStartDateAtpConstraintId|atp.search.advancedAtpSearch|atp.resultColumn.atpStartDate|1|2|3|4|1|5|5|0|0|6|2|7|8|6|7|9|10|9|11|9|12|9|13|9|14|9|15|9|16|0|7|17|0|0|18|19|0|0|\"\n }\n )\n \n \n #\n # Pg1 - Course Information\n #\n\n @request.add_thinktime(5)\n\n # Course Subject Area\n # AJAX popup while typing in subject area\n for i in 1..opts[:subject_area].length\n itr = i-1\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|12|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|subjectCode.queryParam.code|#{opts[:subject_area][0..itr]}|subjectCode.search.subjectCodeGeneric|subjectCode.resultColumn.code|1|2|3|4|1|5|5|0|6|0|7|1|8|9|0|10|11|12|0|0|\"\n } \n ) \n end\n\n @request.add_thinktime(3)\n\n # Instructor\n for i in 1..opts[:instructor].length\n itr = i-1\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|12|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|person.queryParam.personGivenName|#{opts[:instructor][0..itr]}|person.search.personQuickViewByGivenName|person.resultColumn.DisplayName|1|2|3|4|1|5|5|0|6|0|7|1|8|9|0|10|11|12|0|0|\"\n } \n ) \n end\n\n\n @request.add_thinktime(22)\n\n # Save & Continue\n contents1 = \"5|0|41|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D60D3C6E0D395C18A0F44A2D9D2A7348|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|proposal|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|type|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|kuali.proposal.type.course.create|workflowNode|PreRoute|name|#{opts[:course_title]}|_runtimeData|dirty|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|rationale|#{opts[:course_rationale]}|courseTitle|#{opts[:course_rationale]}|transcriptTitle|subjectArea|courseNumberSuffix|instructors|#{opts[:course_short_title]}|#{opts[:subject_area]}|#{opts[:course_suffix]}|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|personId|#{opts[:instructor]}|id-translation|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|descr|plain|#{opts[:course_description]}\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|8|8|9|10|5|6|7|0|5|8|11|12|13|8|14|12|15|8|16|12|17|8|18|10|5|6|7|0|1|8|19|10|5|6|7|0|2|-11|20|21|1|8|22|20|-22|-15|-17|-5|-13|-23|12|23|-1|-3|8|24|12|25|-13|10|5|6|7|0|1|-17|10|5|6|7|0|5|-26|20|-22|8|26|20|-22|8|27|20|-22|8|28|20|-22|8|29|20|-22|-29|-17|-1|-13|-35|12|30|-37|12|31|-39|12|32|-41|10|5|6|7|0|1|33|34|0|10|5|6|7|0|2|8|35|12|36|8|18|10|5|6|7|0|1|8|35|10|5|6|7|0|1|8|37|12|38|-58|-60|-52|-56|-47|-49|-1|8|29|8|39|10|5|6|7|0|2|8|40|12|41|-13|10|5|6|7|0|1|-17|10|5|6|7|0|1|-71|20|-22|-74|-17|-69|-13|-1|-67|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}\"\n },\n {\n :dyn_variables => [\n {\"name\" => opts[:proposal_dyn_var_name], \"regexp\" => opts[:proposal_dyn_var_regexp]},\n {\"name\" => opts[:clu_ref_dyn_var_name], \"regexp\" => opts[:clu_ref_dyn_var_regexp]},\n {\"name\" => opts[:proposal_doc_id_var_name], \"regexp\" => opts[:proposal_doc_id_var_regexp]},\n {\"name\" => opts[:version_ind_id_name], \"regexp\" => opts[:version_ind_id_regexp]}\n ]\n }\n )\n\n #@request.add(\"DEBUG/proposal_dyn_var_name/%%_#{opts[:proposal_dyn_var_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/clu_ref_dyn_var_name/%%_#{opts[:clu_ref_dyn_var_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/proposal_doc_id_var_name/%%_#{opts[:proposal_doc_id_var_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/version_ind_id_name/%%_#{opts[:version_ind_id_name]}%%\", {}, {'subst' => 'true'})\n \n \n \n #\n # Pg 2 - Governance\n # Campus Locations: All\n #\n\n @request.add_thinktime(5)\n\n # COC Org\n # Biology Dept\n\n @request.add_thinktime(3)\n\n # Admin Org\n # Botany\n for i in 1..admin_org.length\n if(i == admin_org.length)\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|16|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|org.queryParam.orgOptionalLongName|#{admin_org[0..itr]}|org.queryParam.orgOptionalType|java.lang.String/2004016611|kuali.org.Department|kuali.org.College|org.search.generic||1|2|3|4|1|5|5|0|6|0|7|2|8|9|0|10|8|11|7|2|12|13|12|14|0|15|16|0|0|\"\n },\n {\n :dyn_variables => [\n {\"name\" => opts[:admin_dep_var_name], \"regexp\" => opts[:admin_dep_var_regexp]}\n ]\n }\n )\n\n #@request.add(\"DEBUG/admin_dep_var_name/%%_#{opts[:admin_dep_var_name]}%%\", {}, {'subst' => 'true'})\n else\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|16|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|org.queryParam.orgOptionalLongName|#{admin_org[0..itr]}|org.queryParam.orgOptionalType|java.lang.String/2004016611|kuali.org.Department|kuali.org.College|org.search.generic||1|2|3|4|1|5|5|0|6|0|7|2|8|9|0|10|8|11|7|2|12|13|12|14|0|15|16|0|0|\"\n } \n )\n end \n end\n\n @request.add_thinktime(15)\n\n # Save & Continue\n contents1 = \"5|0|101|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D60D3C6E0D395C18A0F44A2D9D2A7348|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|AL|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|courseTitle|#{opts[:course_title]}|creditOptions|crossListings|descr|plain|#{opts[:course_description]}|expenditure|affiliatedOrgs|fees|formats|gradingOptions|id|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|_runtimeData|id-translation|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|metaInfo|createId|#{opts[:propose_person]}|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.util.Date/1659716317|updateId|updateTime|versionInd|#{version_indicator+=1}|pilotCourse|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|revenues|specialTopicsCourse|state|draft|subjectArea|#{opts[:subject_area]}|termsOffered|transcriptTitle|#{opts[:course_short_title]}|type|kuali.lu.type.CreditCourse|unitsContentOwner|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|%%_#{opts[:admin_dep_var_name]}%%|#{admin_org}|variations|versionInfo|currentVersionStart|sequenceNumber|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|versionIndId|%%_#{opts[:version_ind_id_name]}%%|dirty|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|2|name|#{opts[:course_title]}|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|32|8|9|10|5|6|7|0|1|11|12|0|13|14|-1|8|9|8|15|13|16|8|17|13|18|8|19|10|5|6|7|0|0|-1|-15|8|20|13|21|8|22|10|5|6|7|0|0|-1|-21|8|23|10|5|6|7|0|0|-1|-25|8|24|10|5|6|7|0|1|8|25|13|26|-1|-29|8|27|10|5|6|7|0|1|8|28|10|5|6|7|0|0|-37|-39|-1|-35|8|29|10|5|6|7|0|0|-1|-43|8|30|10|5|6|7|0|0|-1|-47|8|31|10|5|6|7|0|0|-1|-51|8|32|13|33|8|34|10|5|6|7|0|1|11|-8|10|5|6|7|0|2|8|35|13|36|8|37|10|5|6|7|0|1|8|35|10|5|6|7|0|1|8|38|13|39|-69|-71|-63|-67|-59|-61|-1|-57|8|40|10|5|6|7|0|0|-1|-77|8|41|13|42|8|43|10|5|6|7|0|5|8|44|13|45|8|46|47|48|3467218721|1309965025280|8|49|13|45|8|50|47|48|3467218721|1309965025280|8|51|13|52|-1|-83|8|53|54|55|0|8|56|10|5|6|7|0|0|-1|-102|8|57|54|-101|8|58|13|59|8|60|13|61|8|62|10|5|6|7|0|0|-1|-112|8|63|13|64|8|65|13|66|8|67|10|5|6|7|0|2|11|-8|13|68|8|37|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|38|13|69|-128|-130|-122|-126|-1|8|67|8|70|10|5|6|7|0|2|11|-8|13|71|8|37|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|38|13|72|-145|-147|-139|-143|-1|8|70|8|73|10|5|6|7|0|0|-1|-154|8|74|10|5|6|7|0|3|8|75|47|48|3467218721|1309965025280|8|76|77|78|1|0|8|79|13|80|-1|-158|8|37|10|5|6|7|0|2|8|60|10|5|6|7|0|1|8|38|13|61|-172|-174|8|81|10|5|6|7|0|3|8|9|54|55|1|8|67|54|-186|8|70|54|-186|-172|-180|-1|-170|8|82|10|5|6|7|0|12|8|83|13|84|8|32|13|85|8|43|10|5|6|7|0|5|8|44|13|45|8|46|47|48|3467218994|1309965025280|8|49|13|45|8|50|47|48|3467219879|1309965025280|8|51|13|86|-193|-199|8|87|13|88|8|89|10|5|6|7|0|1|11|-8|13|33|-193|-217|8|90|13|91|8|92|10|5|6|7|0|0|-193|-225|8|93|10|5|6|7|0|0|-193|-229|8|94|13|95|8|58|13|96|8|65|13|97|8|98|13|99|-1|-191|8|100|10|5|6|7|0|1|8|101|10|5|6|7|0|0|-243|-245|-1|-241|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lu.queryParam.luOptionalLuTypeStartsWith|kuali.lu.type.activity.|lu.search.all.lu.Types|lu.resultColumn.luTypeName|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.atptype.duration|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n \n \n #\n # Course Logistics \n # Term: Any\n # Duration Type: Semester\n # Duration Count: 2\n # Assessment Scale: Letter\n # Standard Final Exam\n # Outcome: 10 credits\n # Course Format\n # => Activity Type: Lab, Contact Hours: 5, Frequency: weekly\n # => Duration Type: Weekly\n # => Duration: 13\n # => Anticipated class size: 100\n\n @request.add_thinktime(30)\n\n # Save & Continue\n contents1 = \"5|0|126|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D60D3C6E0D395C18A0F44A2D9D2A7348|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|courseTitle|#{opts[:course_title]}|creditOptions|dirty|type|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|fixedCreditValue|created|kuali.resultComponentType.credit.degree.fixed|10|crossListings|descr|plain|#{opts[:course_description]}|expenditure|affiliatedOrgs|fees|formats|activities|activityType|defaultEnrollmentEstimate|kuali.lu.type.activity.Lab|contactHours|unitQuantity|5|unitType|kuali.atp.duration.week|duration|atpDurationTypeKey|timeQuantity|kuali.atp.duration.Week|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|gradingOptions|kuali.resultComponent.grade.letter|id|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|metaInfo|createId|#{opts[:propose_person]}|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|#{version_indicator+=1}|pilotCourse|revenues|specialTopicsCourse|state|draft|subjectArea|#{opts[:subject_area]}|termsOffered|kuali.atp.season.Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|unitsContentOwner|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|%%_#{opts[:admin_dep_var_name]}%%|#{admin_org}|variations|versionInfo|currentVersionStart|sequenceNumber|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|versionIndId|%%_#{opts[:version_ind_id_name]}%%|finalExamStatus|audit|passFail|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|3|name|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators|kuali.atp.duration.Semester|STD\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|36|8|9|10|5|6|7|0|2|11|12|0|13|14|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|17|-12|-14|-5|-10|-1|-3|8|18|13|19|8|20|13|21|8|22|10|5|6|7|0|0|-1|-24|8|23|13|24|8|25|10|5|6|7|0|1|11|-8|10|5|6|7|0|3|8|15|10|5|6|7|0|3|8|26|10|5|6|7|0|2|8|27|28|29|1|8|30|28|-48|-40|-42|8|31|28|-48|-38|10|5|6|7|0|1|-42|10|5|6|7|0|1|-51|28|-48|-54|-42|-40|-38|-36|-38|-46|13|32|-49|13|33|-32|-34|-1|-30|8|34|10|5|6|7|0|0|-1|-62|8|35|10|5|6|7|0|1|8|36|13|37|-1|-66|8|38|10|5|6|7|0|1|8|39|10|5|6|7|0|0|-74|-76|-1|-72|8|40|10|5|6|7|0|0|-1|-80|8|41|10|5|6|7|0|1|11|-8|10|5|6|7|0|2|8|42|10|5|6|7|0|1|11|-8|10|5|6|7|0|5|-38|10|5|6|7|0|3|-42|10|5|6|7|0|2|8|43|28|-48|8|44|28|-48|-101|-42|8|31|28|-48|-38|10|5|6|7|0|1|-42|10|5|6|7|0|1|-110|28|-48|-113|-42|-101|-38|-98|-38|-106|13|45|8|46|10|5|6|7|0|3|8|47|13|48|-38|10|5|6|7|0|1|-42|10|5|6|7|0|2|-124|28|-48|8|49|28|-48|-127|-42|-122|-38|-133|13|50|-98|-120|8|51|10|5|6|7|0|3|-38|10|5|6|7|0|1|-42|10|5|6|7|0|2|8|52|28|-48|8|53|28|-48|-141|-42|-138|-38|-146|13|54|-148|55|12|13|-98|-136|-108|55|12|100|-94|-96|-90|-92|8|15|10|5|6|7|0|2|8|31|28|-48|-38|10|5|6|7|0|1|-42|10|5|6|7|0|1|-159|28|-48|-162|-42|-157|-38|-90|-155|-86|-88|-1|-84|8|56|10|5|6|7|0|1|11|-8|13|57|-1|8|56|8|58|13|59|8|60|10|5|6|7|0|1|11|-8|10|5|6|7|0|2|8|61|13|62|8|15|10|5|6|7|0|1|8|61|10|5|6|7|0|1|8|16|13|63|-189|-191|-183|-187|-179|-181|-1|-177|8|64|10|5|6|7|0|0|-1|-197|8|65|13|66|8|67|10|5|6|7|0|5|8|68|13|69|8|70|71|72|3469526397|1309965025280|677000000|8|73|13|69|8|74|71|72|3469529329|1309965025280|609000000|8|75|13|76|-1|-203|8|77|28|29|0|8|78|10|5|6|7|0|0|-1|-222|8|79|28|-221|8|80|13|81|8|82|13|83|8|84|10|5|6|7|0|1|11|-8|13|85|-1|8|84|8|86|13|87|8|27|13|88|8|89|10|5|6|7|0|2|11|-8|13|90|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|91|-251|-253|-245|-249|-1|-243|8|92|10|5|6|7|0|2|11|-8|13|93|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|94|-267|-269|-261|-265|-1|-259|8|95|10|5|6|7|0|0|-1|-275|8|96|10|5|6|7|0|3|8|97|71|72|3469526397|1309965025280|677000000|8|98|99|100|1|0|8|101|13|102|-1|-279|8|15|10|5|6|7|0|2|8|82|10|5|6|7|0|1|8|16|13|83|-293|-295|-42|10|5|6|7|0|5|8|84|28|-48|8|56|28|-48|8|103|28|-48|8|104|28|-48|8|105|28|-48|-293|-42|-1|-291|8|106|10|5|6|7|0|12|8|107|13|108|8|58|13|109|8|67|10|5|6|7|0|5|8|68|13|69|8|70|71|72|3469526678|1309965025280|958000000|8|73|13|69|8|74|71|72|3469530172|1309965025280|452000000|8|75|13|110|-316|-322|8|111|13|24|8|112|10|5|6|7|0|1|11|-8|13|59|-316|-340|8|113|13|114|8|115|10|5|6|7|0|0|-316|-348|8|116|10|5|6|7|0|0|-316|-352|8|117|13|118|8|80|13|119|8|27|13|120|8|121|13|122|-1|-314|8|123|10|5|6|7|0|1|8|124|10|5|6|7|0|0|-366|-368|-1|-364|8|51|10|5|6|7|0|3|-38|10|5|6|7|0|1|-42|10|5|6|7|0|2|8|52|28|-48|8|53|28|-48|-377|-42|-374|-38|-382|13|125|-384|55|12|2|-1|-372|-308|13|126|-310|28|-221|-312|28|-221|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}\"\n },\n {\n 'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:enroll_est_var_name], \"regexp\" => opts[:enroll_est_var_regexp]},\n {\"name\" => opts[:lab_var_name], \"regexp\" => opts[:lab_var_regexp]},\n {\"name\" => opts[:atp_duration_week_var_name], \"regexp\" => opts[:atp_duration_week_var_regexp]}\n ]\n }\n )\n\n #@request.add(\"DEBUG/enroll_est_var_name/%%_#{opts[:enroll_est_var_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/lab_var_name/%%_#{opts[:lab_var_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/atp_duration_week_var_name/%%_#{opts[:atp_duration_week_var_name]}%%\", {}, {'subst' => 'true'})\n\n @request.add_thinktime(2)\n \n \n \n #\n # Learning Objectives\n #\n\n @request.add_thinktime(5)\n\n # Category\n for i in 1..opts[:lo_category].length\n if(i == opts[:lo_category].length)\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lo.queryParam.loOptionalCategoryName|#{opts[:lo_category][0..itr]}|lo.search.loCategories|1|2|3|4|1|5|5|0|6|0|7|1|8|9|0|10|11|0|0|0|\"\n },\n {\n :dyn_variables => [\n {\"name\" => opts[:lo_category_id_var_name], \"regexp\" => opts[:lo_category_id_var_regexp]}\n ]\n }\n )\n\n #@request.add(\"DEBUG/lo_category_id_var_name/%%_#{opts[:lo_category_id_var_name]}%%\", {}, {'subst' => 'true'})\n\n else\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lo.queryParam.loOptionalCategoryName|#{opts[:lo_category][0..itr]}|lo.search.loCategories|1|2|3|4|1|5|5|0|6|0|7|1|8|9|0|10|11|0|0|0|\"\n } \n )\n end \n end\n\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/LoCategoryRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|EDE1DECBD54F5894284944CD8AC3661C|org.kuali.student.lum.common.client.lo.rpc.LoCategoryRpcService|getData|java.lang.String/2004016611|%%_#{opts[:lo_category_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/LoCategoryRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|EDE1DECBD54F5894284944CD8AC3661C|org.kuali.student.lum.common.client.lo.rpc.LoCategoryRpcService|getLoCategoryType|java.lang.String/2004016611|loCategoryType.subject|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add_thinktime(25)\n\n # Save & Continue\n contents1 = \"5|0|154|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D60D3C6E0D395C18A0F44A2D9D2A7348|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loInfo|id|desc|formatted|#{opts[:lo_cat_text]}|plain|name|SINGLE USE LO|sequence|0|metaInfo|loCategoryInfoList|%%_#{opts[:lo_category_id_var_name]}%%|#{opts[:lo_category]}|loRepository|kuali.loRepository.key.singleUse|effectiveDate|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|expirationDate|state|active|type|loCategoryType.subject|createId|admin|createTime|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|#{opts[:propose_person]}|resultValues|draft|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|expenditure|affiliatedOrgs|fees|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|5|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|2|pilotCourse|revenues|specialTopicsCourse|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|%%_#{opts[:admin_dep_var_name]}%%|#{admin_org}|variations|versionInfo|currentVersionStart|sequenceNumber|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Standard final Exam|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|4|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|36|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|29|17|5|6|7|0|5|8|30|14|0|8|31|17|5|6|7|0|2|8|32|14|33|8|34|14|33|-41|-45|8|35|14|36|8|37|14|38|8|39|17|0|-37|-39|8|40|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|30|14|41|8|35|14|42|8|31|17|5|6|7|0|2|8|32|14|0|8|34|14|0|-65|-71|8|43|14|44|8|45|46|0|8|47|46|0|8|48|14|49|8|50|14|51|8|39|17|5|6|7|0|5|8|52|14|53|8|54|46|55|3759152200|1288490188800|0|8|56|14|53|8|57|46|55|3759152200|1288490188800|0|8|58|14|38|-65|-89|-61|-63|-37|-59|-33|-35|-1|8|28|8|59|14|60|8|61|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|62|14|63|8|30|14|64|8|39|17|5|6|7|0|5|8|52|14|65|8|54|46|55|3479039543|1309965025280|823000000|8|56|14|65|8|57|46|55|3479039543|1309965025280|823000000|8|58|14|38|-114|-120|8|66|17|5|6|7|0|1|18|-15|14|63|-114|-136|8|48|14|67|8|50|14|68|8|21|17|5|6|7|0|1|8|50|17|5|6|7|0|1|8|22|14|69|-148|-150|-114|-146|-110|-112|-1|-108|8|70|17|5|6|7|0|0|-1|-156|8|71|17|5|6|7|0|1|8|34|14|72|-1|-160|8|73|17|5|6|7|0|3|8|74|14|75|8|76|77|19|2|8|21|17|5|6|7|0|1|8|74|17|5|6|7|0|1|8|22|14|78|-177|-179|-168|-175|-1|-166|8|79|17|5|6|7|0|1|8|80|17|5|6|7|0|0|-187|-189|-1|-185|8|81|17|5|6|7|0|0|-1|-193|8|82|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|83|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|84|14|85|8|86|17|5|6|7|0|3|8|87|14|88|8|89|14|90|8|21|17|5|6|7|0|1|8|89|17|5|6|7|0|1|8|22|14|91|-225|-227|-217|-223|-211|-215|8|92|77|19|100|8|73|17|5|6|7|0|3|8|74|14|93|8|76|77|19|13|8|21|17|5|6|7|0|1|8|74|17|5|6|7|0|1|8|22|14|94|-247|-249|-238|-245|-211|-236|8|30|14|95|8|39|17|5|6|7|0|5|8|52|14|65|8|54|46|55|3479549402|1309965025280|682000000|8|56|14|65|8|57|46|55|3479549402|1309965025280|682000000|8|58|14|38|-211|-257|8|48|14|67|8|96|17|5|6|7|0|0|-211|-275|8|21|17|5|6|7|0|1|8|84|17|5|6|7|0|1|8|22|14|97|-281|-283|-211|-279|-207|-209|-203|-205|8|30|14|98|8|39|17|5|6|7|0|5|8|52|14|65|8|54|46|55|3479549392|1309965025280|672000000|8|56|14|65|8|57|46|55|3479549392|1309965025280|672000000|8|58|14|38|-203|-291|8|48|14|67|8|99|17|5|6|7|0|0|-203|-309|8|50|14|100|-199|-201|-1|-197|8|101|17|5|6|7|0|2|18|-15|14|102|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|103|-323|-325|-317|-321|-1|-315|8|30|14|104|8|105|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|106|14|107|8|21|17|5|6|7|0|1|8|106|17|5|6|7|0|1|8|22|14|108|-345|-347|-339|-343|-335|-337|-1|-333|8|109|17|5|6|7|0|0|-1|-353|8|110|14|111|8|39|17|5|6|7|0|5|8|52|14|65|8|54|46|55|3479545033|1309965025280|313000000|8|56|14|65|8|57|46|55|3479549354|1309965025280|634000000|8|58|14|112|-1|-359|8|113|10|-5|8|114|17|5|6|7|0|0|-1|-377|8|115|10|-5|8|48|14|67|8|116|14|117|8|99|17|5|6|7|0|2|18|-15|14|118|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|119|-395|-397|-389|-393|-1|-387|8|120|14|121|8|50|14|122|8|96|17|5|6|7|0|2|18|-15|14|123|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|124|-415|-417|-409|-413|-1|-407|8|125|17|5|6|7|0|2|18|-15|14|126|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|127|-431|-433|-425|-429|-1|-423|8|128|17|5|6|7|0|0|-1|-439|8|129|17|5|6|7|0|3|8|130|46|55|3479545033|1309965025280|313000000|8|131|132|133|1|0|8|134|14|135|-1|-443|8|21|17|5|6|7|0|2|8|116|17|5|6|7|0|1|8|22|14|117|-457|-459|8|13|17|5|6|7|0|1|8|22|14|136|-457|-465|-1|-455|8|137|17|5|6|7|0|12|8|138|14|139|8|30|14|140|8|39|17|5|6|7|0|5|8|52|14|65|8|54|46|55|3479545302|1309965025280|582000000|8|56|14|65|8|57|46|55|3479550248|1309965025280|528000000|8|58|14|141|-473|-479|8|35|14|60|8|142|17|5|6|7|0|1|18|-15|14|104|-473|-497|8|143|14|144|8|145|17|5|6|7|0|0|-473|-505|8|146|17|5|6|7|0|0|-473|-509|8|147|14|148|8|48|14|149|8|50|14|150|8|151|14|152|-1|-471|8|153|17|5|6|7|0|1|8|154|17|5|6|7|0|0|-523|-525|-1|-521|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}\"\n },\n {\n 'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:lo_category_var_name], \"regexp\" => opts[:lo_category_var_regexp]}\n ]\n }\n )\n\n #@request.add(\"DEBUG/lo_category_var_name/%%_#{opts[:lo_category_var_name]}%%\", {}, {'subst' => 'true'})\n\n @request.add_thinktime(2)\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/LoCategoryRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|4|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|EDE1DECBD54F5894284944CD8AC3661C|org.kuali.student.lum.common.client.lo.rpc.LoCategoryRpcService|getLoCategoryTypes|1|2|3|4|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|2543249A07E7952228E0E500F14F1B17|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementTypeForCourse|java.lang.String/2004016611|kuali.statement.type.course|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|1ED48DA6F48F82765FE7B58378EA94E0|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|getCourseStatements|java.lang.String/2004016611|%%_#{opts[:clu_ref_dyn_var_name]}%%|KUALI.RULE|en|1|2|3|4|3|5|5|5|6|7|8|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n \n #\n # Course Requisites\n # Save without editing anything\n\n @request.add_thinktime(5)\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|10|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|1ED48DA6F48F82765FE7B58378EA94E0|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|storeCourseStatements|java.lang.String/2004016611|java.util.Map|%%_#{opts[:clu_ref_dyn_var_name]}%%|draft|java.util.HashMap/962170901|java.util.LinkedHashMap/1551059846|1|2|3|4|4|5|5|6|6|7|8|9|0|10|0|0|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|2543249A07E7952228E0E500F14F1B17|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementTypeForCourse|java.lang.String/2004016611|kuali.statement.type.course|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|1ED48DA6F48F82765FE7B58378EA94E0|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|getCourseStatements|java.lang.String/2004016611|%%_#{opts[:clu_ref_dyn_var_name]}%%|KUALI.RULE|en|1|2|3|4|3|5|5|5|6|7|8|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n \n #\n # Active Dates\n # Start = Fall Sem 2008\n #\n\n @request.add_thinktime(10)\n\n # Save & Continue\n contents1 = \"5|0|160|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D60D3C6E0D395C18A0F44A2D9D2A7348|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loCategoryInfoList|id|%%_#{opts[:lo_category_id_var_name]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|createId|admin|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|0|name|#{opts[:lo_category]}|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|desc|formatted|#{opts[:lo_cat_text]}|plain|%%_#{opts[:lo_category_var_name]}%%|loRepositoryKey|#{opts[:propose_person]}|SINGLE USE LO|draft|kuali.lo.type.singleUse|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|expenditure|affiliatedOrgs|fees|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|5|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|1|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|3|pilotCourse|revenues|specialTopicsCourse|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|%%_#{opts[:admin_dep_var_name]}%%|#{admin_org}|variations|versionInfo|currentVersionStart|sequenceNumber|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Standard final Exam|dirty|startTerm|endTerm|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators|kuali.atp.FA2008-2009\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|29|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|30|14|31|8|32|14|33|8|34|17|5|6|7|0|5|8|35|14|36|8|37|38|39|3759152200|1288490188800|0|8|40|14|36|8|41|38|39|3759152200|1288490188800|0|8|42|14|43|-45|-51|8|44|14|45|8|46|14|47|8|48|14|49|-41|-43|-37|-39|8|50|17|5|6|7|0|0|-37|-73|8|51|17|5|6|7|0|8|8|52|14|43|8|53|17|5|6|7|0|2|8|54|14|55|8|56|14|55|-79|-83|8|30|14|57|8|58|14|33|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3487349987|1309965025280|267000000|8|40|14|59|8|41|38|39|3487349987|1309965025280|267000000|8|42|14|43|-79|-95|8|44|14|60|8|46|14|61|8|48|14|62|-37|-77|-33|-35|-1|-31|8|63|14|64|8|65|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|66|14|67|8|30|14|68|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3479039543|1309965025280|823000000|8|40|14|59|8|41|38|39|3479039543|1309965025280|823000000|8|42|14|43|-125|-131|8|69|17|5|6|7|0|1|18|-15|14|67|-125|-147|8|46|14|61|8|48|14|70|8|21|17|5|6|7|0|1|8|48|17|5|6|7|0|1|8|22|14|71|-159|-161|-125|-157|-121|-123|-1|-119|8|72|17|5|6|7|0|0|-1|-167|8|73|17|5|6|7|0|1|8|56|14|74|-1|-171|8|75|17|5|6|7|0|3|8|76|14|77|8|78|79|19|2|8|21|17|5|6|7|0|1|8|76|17|5|6|7|0|1|8|22|14|80|-188|-190|-179|-186|-1|-177|8|81|17|5|6|7|0|1|8|82|17|5|6|7|0|0|-198|-200|-1|-196|8|83|17|5|6|7|0|0|-1|-204|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|85|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|86|14|87|8|88|17|5|6|7|0|3|8|89|14|90|8|91|14|92|8|21|17|5|6|7|0|1|8|91|17|5|6|7|0|1|8|22|14|93|-236|-238|-228|-234|-222|-226|8|94|79|19|100|8|75|17|5|6|7|0|3|8|76|14|95|8|78|79|19|13|8|21|17|5|6|7|0|1|8|76|17|5|6|7|0|1|8|22|14|96|-258|-260|-249|-256|-222|-247|8|30|14|97|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3487345884|1309965025280|164000000|8|40|14|59|8|41|38|39|3487349962|1309965025280|242000000|8|42|14|98|-222|-268|8|46|14|61|8|99|17|5|6|7|0|0|-222|-286|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|100|-292|-294|-222|-290|-218|-220|-214|-216|8|30|14|101|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3487345875|1309965025280|155000000|8|40|14|59|8|41|38|39|3487349936|1309965025280|216000000|8|42|14|98|-214|-302|8|46|14|61|8|102|17|5|6|7|0|0|-214|-320|8|48|14|103|-210|-212|-1|-208|8|104|17|5|6|7|0|2|18|-15|14|105|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|106|-334|-336|-328|-332|-1|-326|8|30|14|107|8|108|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|109|14|110|8|21|17|5|6|7|0|1|8|109|17|5|6|7|0|1|8|22|14|111|-356|-358|-350|-354|-346|-348|-1|-344|8|112|17|5|6|7|0|0|-1|-364|8|113|14|114|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3487341491|1309965025280|771000000|8|40|14|59|8|41|38|39|3487349901|1309965025280|181000000|8|42|14|115|-1|-370|8|116|10|-5|8|117|17|5|6|7|0|0|-1|-388|8|118|10|-5|8|46|14|61|8|119|14|120|8|102|17|5|6|7|0|2|18|-15|14|121|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|122|-406|-408|-400|-404|-1|-398|8|123|14|124|8|48|14|125|8|99|17|5|6|7|0|2|18|-15|14|126|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|127|-426|-428|-420|-424|-1|-418|8|128|17|5|6|7|0|2|18|-15|14|129|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|130|-442|-444|-436|-440|-1|-434|8|131|17|5|6|7|0|0|-1|-450|8|132|17|5|6|7|0|3|8|133|38|39|3487341491|1309965025280|771000000|8|134|135|136|1|0|8|137|14|138|-1|-454|8|21|17|5|6|7|0|3|8|119|17|5|6|7|0|1|8|22|14|120|-468|-470|8|13|17|5|6|7|0|1|8|22|14|139|-468|-476|8|140|17|5|6|7|0|2|8|141|10|11|1|8|142|10|-488|-468|-482|-1|-466|8|143|17|5|6|7|0|12|8|144|14|145|8|30|14|146|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3487341710|1309965025280|990000000|8|40|14|59|8|41|38|39|3487350824|1309965025280|104000000|8|42|14|90|-493|-499|8|44|14|64|8|147|17|5|6|7|0|1|18|-15|14|107|-493|-517|8|148|14|149|8|150|17|5|6|7|0|0|-493|-525|8|151|17|5|6|7|0|0|-493|-529|8|152|14|153|8|46|14|154|8|48|14|155|8|156|14|157|-1|-491|8|158|17|5|6|7|0|1|8|159|17|5|6|7|0|0|-543|-545|-1|-541|-486|14|160|-489|14|0|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n \n #\n # Financials\n # $100 lab fee\n # Admin org 100% rev and exp\n #\n\n @request.add_thinktime(5)\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.fee.feeType|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n # Revenue - Admin Org\n for i in 1..admin_org.length\n itr = i-1\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|16|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|org.queryParam.orgOptionalLongName|#{admin_org[0..itr]}|org.queryParam.orgOptionalType|java.lang.String/2004016611|kuali.org.Department|kuali.org.College|org.search.generic||1|2|3|4|1|5|5|0|6|0|7|2|8|9|0|10|8|11|7|2|12|13|12|14|0|15|16|0|0|\"\n } \n ) \n end\n\n @request.add_thinktime(5)\n\n # Expense - Admin Org\n for i in 1..admin_org.length\n if(i == admin_org.length)\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|16|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|org.queryParam.orgOptionalLongName|#{admin_org[0..itr]}|org.queryParam.orgOptionalType|java.lang.String/2004016611|kuali.org.Department|kuali.org.College|org.search.generic||1|2|3|4|1|5|5|0|6|0|7|2|8|9|0|10|8|11|7|2|12|13|12|14|0|15|16|0|0|\"\n },\n {\n :dyn_variables => [\n {\"name\" => opts[:admin_dep_var_name], \"regexp\" => opts[:admin_dep_var_regexp]}\n ]\n } \n )\n else\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|16|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|org.queryParam.orgOptionalLongName|#{admin_org[0..itr]}|org.queryParam.orgOptionalType|java.lang.String/2004016611|kuali.org.Department|kuali.org.College|org.search.generic||1|2|3|4|1|5|5|0|6|0|7|2|8|9|0|10|8|11|7|2|12|13|12|14|0|15|16|0|0|\"\n } \n )\n end \n end\n\n #@request.add(\"DEBUG/admin_dep_var_name/%%_#{opts[:admin_dep_var_name]}%%\", {}, {'subst' => 'true'})\n\n @request.add_thinktime(20)\n\n # Save & Continue\n contents1 = \"5|0|172|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D60D3C6E0D395C18A0F44A2D9D2A7348|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loCategoryInfoList|id|%%_#{opts[:lo_category_id_var_name]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|createId|admin|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|0|name|#{opts[:lo_category]}|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|desc|formatted|#{opts[:lo_cat_text]}|plain|%%_#{opts[:lo_category_var_name]}%%|loRepositoryKey|#{opts[:propose_person]}|1|SINGLE USE LO|draft|kuali.lo.type.singleUse|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|effectiveDate|expenditure|affiliatedOrgs|dirty|orgId|percentage|created|%%_#{opts[:admin_dep_var_name]}%%|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|fees|feeType|rateType|kuali.enum.type.feeTypes.labFee|fixedRateFee|feeAmounts|currencyQuantity|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|5|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|2|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|4|pilotCourse|revenues|specialTopicsCourse|startTerm|kuali.atp.FA2008-2009|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|#{admin_org}|variations|versionInfo|currentVersionStart|sequenceNumber|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Fall Semester of 2008|Standard final Exam|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|6|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|29|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|30|14|31|8|32|14|33|8|34|17|5|6|7|0|5|8|35|14|36|8|37|38|39|3759152200|1288490188800|0|8|40|14|36|8|41|38|39|3759152200|1288490188800|0|8|42|14|43|-45|-51|8|44|14|45|8|46|14|47|8|48|14|49|-41|-43|-37|-39|8|50|17|5|6|7|0|0|-37|-73|8|51|17|5|6|7|0|8|8|52|14|43|8|53|17|5|6|7|0|2|8|54|14|55|8|56|14|55|-79|-83|8|30|14|57|8|58|14|33|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3488193507|1309965025280|787000000|8|40|14|59|8|41|38|39|3488196257|1309965025280|537000000|8|42|14|60|-79|-95|8|44|14|61|8|46|14|62|8|48|14|63|-37|-77|-33|-35|-1|-31|8|64|14|65|8|66|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|67|14|68|8|30|14|69|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3479039543|1309965025280|823000000|8|40|14|59|8|41|38|39|3479039543|1309965025280|823000000|8|42|14|43|-125|-131|8|70|17|5|6|7|0|1|18|-15|14|68|-125|-147|8|46|14|62|8|48|14|71|8|21|17|5|6|7|0|1|8|48|17|5|6|7|0|1|8|22|14|72|-159|-161|-125|-157|-121|-123|-1|-119|8|73|17|5|6|7|0|0|-1|-167|8|74|17|5|6|7|0|1|8|56|14|75|-1|-171|8|76|17|5|6|7|0|3|8|77|14|78|8|79|80|19|2|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|81|-188|-190|-179|-186|-1|-177|8|82|38|39|470887936|1219770712064|0|8|83|17|5|6|7|0|1|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|21|17|5|6|7|0|3|8|85|17|5|6|7|0|2|8|86|10|11|1|8|87|10|-221|-213|-215|8|88|10|-221|-211|17|5|6|7|0|1|-215|17|5|6|7|0|1|-224|10|-221|-227|-215|-213|-211|-209|-211|-219|14|89|-222|90|91|100|0|-205|-207|-201|-203|-1|-199|8|92|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|-211|17|5|6|7|0|3|-215|17|5|6|7|0|2|8|93|10|-221|8|94|10|-221|-245|-215|8|88|10|-221|-211|17|5|6|7|0|1|-215|17|5|6|7|0|1|-254|10|-221|-257|-215|-245|-211|-242|-211|-250|14|95|-252|14|96|8|97|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|98|80|19|100|-211|17|5|6|7|0|1|-215|17|5|6|7|0|1|-273|10|-221|-277|-215|-271|-211|-267|-269|-242|-265|-238|-240|-1|-236|8|99|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|100|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|101|14|102|8|103|17|5|6|7|0|3|8|104|14|105|8|106|14|107|8|21|17|5|6|7|0|1|8|106|17|5|6|7|0|1|8|22|14|108|-311|-313|-303|-309|-297|-301|8|109|80|-275|8|76|17|5|6|7|0|3|8|77|14|110|8|79|80|19|13|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0\"\n contents3 = \"|1|8|22|14|111|-332|-334|-323|-330|-297|-321|8|30|14|112|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3488189822|1309965025280|102000000|8|40|14|59|8|41|38|39|3488196198|1309965025280|478000000|8|42|14|113|-297|-342|8|46|14|62|8|114|17|5|6|7|0|0|-297|-360|8|21|17|5|6|7|0|1|8|101|17|5|6|7|0|1|8|22|14|115|-366|-368|-297|-364|-293|-295|-289|-291|8|30|14|116|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3488189788|1309965025280|68000000|8|40|14|59|8|41|38|39|3488196188|1309965025280|468000000|8|42|14|113|-289|-376|8|46|14|62|8|117|17|5|6|7|0|0|-289|-394|8|48|14|118|-285|-287|-1|-283|8|119|17|5|6|7|0|2|18|-15|14|120|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|121|-408|-410|-402|-406|-1|-400|8|30|14|122|8|123|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|124|14|125|8|21|17|5|6|7|0|1|8|124|17|5|6|7|0|1|8|22|14|126|-430|-432|-424|-428|-420|-422|-1|-418|8|127|17|5|6|7|0|0|-1|-438|8|128|14|129|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3488185173|1309965025280|453000000|8|40|14|59|8|41|38|39|3488196156|1309965025280|436000000|8|42|14|130|-1|-444|8|131|10|-5|8|132|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|-211|17|5|6|7|0|1|-215|17|5|6|7|0|2|8|86|10|-221|8|87|10|-221|-479|-215|-476|-211|-484|14|89|-486|90|-235|-472|-474|-468|-470|8|21|17|5|6|7|0|2|8|88|10|-221|-211|17|5|6|7|0|1|-215|17|5|6|7|0|1|-494|10|-221|-497|-215|-492|-211|-468|-490|-464|-466|-1|-462|8|133|10|-5|8|134|14|135|8|46|14|62|8|136|14|137|8|117|17|5|6|7|0|2|18|-15|14|138|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|139|-519|-521|-513|-517|-1|-511|8|140|14|141|8|48|14|142|8|114|17|5|6|7|0|2|18|-15|14|143|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|144|-539|-541|-533|-537|-1|-531|8|145|17|5|6|7|0|2|18|-15|14|89|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|146|-555|-557|-549|-553|-1|-547|8|147|17|5|6|7|0|0|-1|-563|8|148|17|5|6|7|0|3|8|149|38|39|3488185173|1309965025280|453000000|8|150|90|91|1|0|8|151|14|152|-1|-567|8|21|17|5|6|7|0|3|8|134|17|5|6|7|0|1|8|22|14|153|-581|-583|8|136|17|5|6|7|0|1|8|22|14|137|-581|-589|8|13|17|5|6|7|0|1|8|22|14|154|-581|-595|-1|-579|8|155|17|5|6|7|0|12|8|156|14|157|8|30|14|158|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3488185428|1309965025280|708000000|8|40|14|59|8|41|38|39|3488197141|1309965025280|421000000|8|42|14|159|-603|-609|8|44|14|65|8|160|17|5|6|7|0|1|18|-15|14|122|-603|-627|8|161|14|162|8|163|17|5|6|7|0|0|-603|-635|8|164|17|5|6|7|0|0|-603|-639|8|165|14|166|8|46|14|167|8|48|14|168|8|169|14|170|-1|-601|8|171|17|5|6|7|0|1|8|172|17|5|6|7|0|0|-653|-655|-1|-651|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}#{contents3}\"\n },\n {\n 'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:affliated_orgs_id_name], \"regexp\" => opts[:affliated_orgs_id_regexp]},\n {\"name\" => opts[:lab_fee_id_name], \"regexp\" => opts[:lab_fee_id_regexp]},\n {\"name\" => opts[:revenues_id_name], \"regexp\" => opts[:revenues_id_regexp]},\n {\"name\" => opts[:revenue_id_name], \"regexp\" => opts[:revenue_id_regexp]}\n ]\n }\n )\n\n #@request.add(\"DEBUG/affliated_orgs_id_name/%%_#{opts[:affliated_orgs_id_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/lab_fee_id_name/%%_#{opts[:lab_fee_id_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/revenues_id_name/%%_#{opts[:revenues_id_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/revenue_id_name/%%_#{opts[:revenue_id_name]}%%\", {}, {'subst' => 'true'})\n\n @request.add_thinktime(2)\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|isAuthorizedAddReviewer|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|isAuthorizedRemoveReviewers|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n \n \n #\n # Authors and Collaborators\n #\n\n @request.add_thinktime(5)\n\n if(!opts[:collaborator].nil?)\n # Collaborator seach\n for i in 1..opts[:collaborator].length\n itr = i-1\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|14|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|person.queryParam.personGivenName|#{opts[:collaborator][0..itr]}|person.queryParam.excludedUserId|psycho1|person.search.personQuickViewByGivenName|person.resultColumn.DisplayName|1|2|3|4|1|5|5|0|6|0|7|2|8|9|0|10|8|11|0|12|13|14|0|0|\"\n } \n ) \n end\n\n @request.add_thinktime(5)\n\n\n contents1 = \"5|0|190|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D60D3C6E0D395C18A0F44A2D9D2A7348|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loCategoryInfoList|id|%%_#{opts[:lo_category_id_var_name]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|createId|admin|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|0|name|#{opts[:lo_category]}|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|desc|formatted|#{opts[:lo_cat_text]}|plain|%%_#{opts[:lo_category_var_name]}%%|loRepositoryKey|#{opts[:propose_person]}|2|SINGLE USE LO|draft|kuali.lo.type.singleUse|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|effectiveDate|expenditure|affiliatedOrgs|%%_#{opts[:affliated_orgs_id_name]}%%|orgId|%%_#{opts[:admin_dep_var_name]}%%|percentage|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|#{admin_org}|fees|feeAmounts|currencyQuantity|currencyTypeKey|kuali.currency.type.usdollars.cents|feeType|kuali.enum.type.feeTypes.labFee|%%_#{opts[:lab_fee_id_name]}%%|1|rateType|fixedRateFee|Fixed Rate Fee|Laboratory Fee|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|5|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|3|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|pilotCourse|revenues|%%_#{opts[:revenues_id_name]}%%|REVENUE|%%_#{opts[:revenue_id_name]}%%|specialTopicsCourse|startTerm|kuali.atp.FA2008-2009|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|variations|versionInfo|currentVersionStart|sequenceNumber|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Fall Semester of 2008|Standard final Exam|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|7|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators|principalId|#{opts[:collaborator]}|permission|KS-SYS~Edit Document|action|F|firstName|lastName|actionRequestStatus|New|author\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|29|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|30|14|31|8|32|14|33|8|34|17|5|6|7|0|5|8|35|14|36|8|37|38|39|3759152200|1288490188800|0|8|40|14|36|8|41|38|39|3759152200|1288490188800|0|8|42|14|43|-45|-51|8|44|14|45|8|46|14|47|8|48|14|49|-41|-43|-37|-39|8|50|17|5|6|7|0|0|-37|-73|8|51|17|5|6|7|0|8|8|52|14|43|8|53|17|5|6|7|0|2|8|54|14|55|8|56|14|55|-79|-83|8|30|14|57|8|58|14|33|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3489516951|1309965025280|231000000|8|40|14|59|8|41|38|39|3489523415|1309965025280|695000000|8|42|14|60|-79|-95|8|44|14|61|8|46|14|62|8|48|14|63|-37|-77|-33|-35|-1|-31|8|64|14|65|8|66|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|67|14|68|8|30|14|69|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3479039543|1309965025280|823000000|8|40|14|59|8|41|38|39|3479039543|1309965025280|823000000|8|42|14|43|-125|-131|8|70|17|5|6|7|0|1|18|-15|14|68|-125|-147|8|46|14|62|8|48|14|71|8|21|17|5|6|7|0|1|8|48|17|5|6|7|0|1|8|22|14|72|-159|-161|-125|-157|-121|-123|-1|-119|8|73|17|5|6|7|0|0|-1|-167|8|74|17|5|6|7|0|1|8|56|14|75|-1|-171|8|76|17|5|6|7|0|3|8|77|14|78|8|79|80|19|2|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|81|-188|-190|-179|-186|-1|-177|8|82|38|39|470887936|1219770712064|0|8|83|17|5|6|7|0|1|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|85|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-220|-222|-209|-218|-205|-207|-201|-203|-1|-199|8|92|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|93|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|94|80|19|100|8|95|14|96|-238|-240|-234|-236|8|97|14|98|8|30|14|99|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3489523331|1309965025280|611000000|8|40|14|59|8|41|38|39|3489523333|1309965025280|613000000|8|42|14|100|-234|-253|8|101|14|102|8|21|17|5|6|7|0|2|8|101|17|5|6|7|0|1|8|22|14|103|-273|-275|8|97|17|5|6|7|0|1|8|22|14|104|-273|-281|-234|-271|-230|-232|-1|-228|8|105|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|106|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|107|14|108|8|109|17|5|6|7|0|3|8|110|14|111|8|112|14|113|8|21|17|5|6|7|0|1|8|112|17|5|6|7|0|1|8|22|14|114|-315|-317|-307|-313|-301|-305|8|115|80|-246|8|76|17|5|6|7|0|3|8|77|14|116|8|79|80|19|13|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|117|-336|-338|-327|-334|-301|-325\"\n contents3 = \"|8|30|14|118|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3489513388|1309965025280|668000000|8|40|14|59|8|41|38|39|3489523378|1309965025280|658000000|8|42|14|119|-301|-346|8|46|14|62|8|120|17|5|6|7|0|0|-301|-364|8|21|17|5|6|7|0|1|8|107|17|5|6|7|0|1|8|22|14|121|-370|-372|-301|-368|-297|-299|-293|-295|8|30|14|122|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3489513379|1309965025280|659000000|8|40|14|59|8|41|38|39|3489523370|1309965025280|650000000|8|42|14|119|-293|-380|8|46|14|62|8|123|17|5|6|7|0|0|-293|-398|8|48|14|124|-289|-291|-1|-287|8|125|17|5|6|7|0|2|18|-15|14|126|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|127|-412|-414|-406|-410|-1|-404|8|30|14|128|8|129|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|130|14|131|8|21|17|5|6|7|0|1|8|130|17|5|6|7|0|1|8|22|14|132|-434|-436|-428|-432|-424|-426|-1|-422|8|133|17|5|6|7|0|0|-1|-442|8|134|14|135|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3489508904|1309965025280|184000000|8|40|14|59|8|41|38|39|3489523333|1309965025280|613000000|8|42|14|111|-1|-448|8|136|10|-5|8|137|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|138|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-491|-493|-480|-489|-476|-478|-472|-474|8|97|14|139|8|30|14|140|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3489523331|1309965025280|611000000|8|40|14|59|8|41|38|39|3489523333|1309965025280|613000000|8|42|14|100|-472|-503|-468|-470|-1|-466|8|141|10|-5|8|142|14|143|8|46|14|62|8|144|14|145|8|123|17|5|6|7|0|2|18|-15|14|146|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|147|-535|-537|-529|-533|-1|-527|8|148|14|149|8|48|14|150|8|120|17|5|6|7|0|2|18|-15|14|151|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|152|-555|-557|-549|-553|-1|-547|8|153|17|5|6|7|0|2|18|-15|14|87|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|91|-571|-573|-565|-569|-1|-563|8|154|17|5|6|7|0|0|-1|-579|8|155|17|5|6|7|0|3|8|156|38|39|3489508904|1309965025280|184000000|8|157|89|90|1|0|8|158|14|159|-1|-583|8|21|17|5|6|7|0|3|8|142|17|5|6|7|0|1|8|22|14|160|-597|-599|8|144|17|5|6|7|0|1|8|22|14|145|-597|-605|8|13|17|5|6|7|0|1|8|22|14|161|-597|-611|-1|-595|8|162|17|5|6|7|0|12|8|163|14|164|8|30|14|165|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3489509135|1309965025280|415000000|8|40|14|59|8|41|38|39|3489524194|1309965025280|474000000|8|42|14|166|-619|-625|8|44|14|65|8|167|17|5|6|7|0|1|18|-15|14|128|-619|-643|8|168|14|169|8|170|17|5|6|7|0|0|-619|-651|8|171|17|5|6|7|0|0|-619|-655|8|172|14|173|8|46|14|174|8|48|14|175|8|176|14|177|-1|-617|8|178|17|5|6|7|0|1|8|179|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|180|14|181|8|182|14|183|8|184|14|185|8|186|14|181|8|187|14|181|8|188|14|189|8|190|10|-5|-673|-675|-669|-671|-1|-667|0|0|\"\n else\n contents1 = \"5|0|179|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D60D3C6E0D395C18A0F44A2D9D2A7348|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loCategoryInfoList|id|%%_#{opts[:lo_category_id_var_name]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|createId|admin|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|0|name|#{opts[:lo_category]}|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|desc|formatted|#{opts[:lo_cat_text]}|plain|%%_#{opts[:lo_category_var_name]}%%|loRepositoryKey|#{opts[:propose_person]}|2|SINGLE USE LO|draft|kuali.lo.type.singleUse|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|effectiveDate|expenditure|affiliatedOrgs|%%_#{opts[:affliated_orgs_id_name]}%%|orgId|%%_#{opts[:admin_dep_var_name]}%%|percentage|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|#{admin_org}|fees|feeAmounts|currencyQuantity|currencyTypeKey|kuali.currency.type.usdollars.cents|feeType|kuali.enum.type.feeTypes.labFee|%%_#{opts[:lab_fee_id_name]}%%|1|rateType|fixedRateFee|Fixed Rate Fee|Laboratory Fee|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|5|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|3|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|pilotCourse|revenues|%%_#{opts[:revenues_id_name]}%%|REVENUE|%%_#{opts[:revenue_id_name]}%%|specialTopicsCourse|startTerm|kuali.atp.FA2008-2009|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|variations|versionInfo|currentVersionStart|sequenceNumber|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Fall Semester of 2008|Standard final Exam|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|7|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|29|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|30|14|31|8|32|14|33|8|34|17|5|6|7|0|5|8|35|14|36|8|37|38|39|3759152200|1288490188800|0|8|40|14|36|8|41|38|39|3759152200|1288490188800|0|8|42|14|43|-45|-51|8|44|14|45|8|46|14|47|8|48|14|49|-41|-43|-37|-39|8|50|17|5|6|7|0|0|-37|-73|8|51|17|5|6|7|0|8|8|52|14|43|8|53|17|5|6|7|0|2|8|54|14|55|8|56|14|55|-79|-83|8|30|14|57|8|58|14|33|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491266071|1309965025280|351000000|8|40|14|59|8|41|38|39|3491272352|1309965025280|632000000|8|42|14|60|-79|-95|8|44|14|61|8|46|14|62|8|48|14|63|-37|-77|-33|-35|-1|-31|8|64|14|65|8|66|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|67|14|68|8|30|14|69|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3479039543|1309965025280|823000000|8|40|14|59|8|41|38|39|3479039543|1309965025280|823000000|8|42|14|43|-125|-131|8|70|17|5|6|7|0|1|18|-15|14|68|-125|-147|8|46|14|62|8|48|14|71|8|21|17|5|6|7|0|1|8|48|17|5|6|7|0|1|8|22|14|72|-159|-161|-125|-157|-121|-123|-1|-119|8|73|17|5|6|7|0|0|-1|-167|8|74|17|5|6|7|0|1|8|56|14|75|-1|-171|8|76|17|5|6|7|0|3|8|77|14|78|8|79|80|19|2|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|81|-188|-190|-179|-186|-1|-177|8|82|38|39|470887936|1219770712064|0|8|83|17|5|6|7|0|1|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|85|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-220|-222|-209|-218|-205|-207|-201|-203|-1|-199|8|92|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|93|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|94|80|19|100|8|95|14|96|-238|-240|-234|-236|8|97|14|98|8|30|14|99|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491272235|1309965025280|515000000|8|40|14|59|8|41|38|39|3491272236|1309965025280|516000000|8|42|14|100|-234|-253|8|101|14|102|8|21|17|5|6|7|0|2|8|101|17|5|6|7|0|1|8|22|14|103|-273|-275|8|97|17|5|6|7|0|1|8|22|14|104|-273|-281|-234|-271|-230|-232|-1|-228|8|105|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|106|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|107|14|108|8|109|17|5|6|7|0|3|8|110|14|111|8|112|14|113|8|21|17|5|6|7|0|1|8|112|17|5|6|7|0|1|8|22|14|114|-315|-317|-307|-313|-301|-305|8|115|80|-246|8|76|17|5|6|7|0|3|8|77|14|116|8|79|80|19|13|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|117|-336|-338|-327|-334|-301|-325|8|30|14|118|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491262219|1309965025280|499000000|8|40|14|59|8|41|38|39|3491272295|1309965025280|575000000|8|42|14|119|-301|-346|8|46|14|62|8|120|17|5|6|7|0|0|-301|-364|8|21|17|5|6|7|0|1|8|107|17|5|6|7|0|1|8|22|14|121|-370|-372|-301|-368|-297|-299|-293|-295|8|30|14|122|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491262210|1309965025280|490000000|8|40|14|59|8|41|38|39|3491272289|1309965025280|569000000|8|42|14|119|-293|-380|8|46|14|62|8|123|17|5|6|7|0|0|-293|-398|8|48|14|124|-289|-291|-1|-287|8|125|17|5|6|7|0|2|18|-15|14|126|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|127|-412|-414|-406|-410|-1|-404|8|30|14|128|8|129|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|130|14|131|8|21|17|5|6|7|0|1|8|130|17|5|6|7|0|1|8|22|14|132|-434|-436|-428\"\n contents3 = \"|-432|-424|-426|-1|-422|8|133|17|5|6|7|0|0|-1|-442|8|134|14|135|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491257291|1309965025280|571000000|8|40|14|59|8|41|38|39|3491272236|1309965025280|516000000|8|42|14|111|-1|-448|8|136|10|-5|8|137|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|138|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-491|-493|-480|-489|-476|-478|-472|-474|8|97|14|139|8|30|14|140|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491272233|1309965025280|513000000|8|40|14|59|8|41|38|39|3491272236|1309965025280|516000000|8|42|14|100|-472|-503|-468|-470|-1|-466|8|141|10|-5|8|142|14|143|8|46|14|62|8|144|14|145|8|123|17|5|6|7|0|2|18|-15|14|146|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|147|-535|-537|-529|-533|-1|-527|8|148|14|149|8|48|14|150|8|120|17|5|6|7|0|2|18|-15|14|151|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|152|-555|-557|-549|-553|-1|-547|8|153|17|5|6|7|0|2|18|-15|14|87|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|91|-571|-573|-565|-569|-1|-563|8|154|17|5|6|7|0|0|-1|-579|8|155|17|5|6|7|0|3|8|156|38|39|3491257291|1309965025280|571000000|8|157|89|90|1|0|8|158|14|159|-1|-583|8|21|17|5|6|7|0|3|8|142|17|5|6|7|0|1|8|22|14|160|-597|-599|8|144|17|5|6|7|0|1|8|22|14|145|-597|-605|8|13|17|5|6|7|0|1|8|22|14|161|-597|-611|-1|-595|8|162|17|5|6|7|0|12|8|163|14|164|8|30|14|165|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491257553|1309965025280|833000000|8|40|14|59|8|41|38|39|3491273130|1309965025280|410000000|8|42|14|166|-619|-625|8|44|14|65|8|167|17|5|6|7|0|1|18|-15|14|128|-619|-643|8|168|14|169|8|170|17|5|6|7|0|0|-619|-651|8|171|17|5|6|7|0|0|-619|-655|8|172|14|173|8|46|14|174|8|48|14|175|8|176|14|177|-1|-617|8|178|17|5|6|7|0|1|8|179|17|5|6|7|0|0|-669|-671|-1|-667|0|0|\"\n end\n\n # Save & Continue\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}#{contents3}\"\n },\n {\n 'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:action_request_id_name], \"regexp\" => opts[:action_request_id_regexp]}\n ]\n }\n )\n \n #@request.add(\"DEBUG/affliated_orgs_id_name/%%_#{opts[:action_request_id_name]}%%\", {}, {'subst' => 'true'})\n\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/DocumentRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|F189A2C8AED6D8071F8F9362674CF016|org.kuali.student.core.document.ui.client.service.DocumentRpcService|isAuthorizedUploadDocuments|java.lang.String/2004016611|%%_#{opts[:proposal_dyn_var_name]}%%|referenceType.clu.proposal|1|2|3|4|2|5|5|6|7|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/DocumentRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|F189A2C8AED6D8071F8F9362674CF016|org.kuali.student.core.document.ui.client.service.DocumentRpcService|getRefDocIdsForRef|java.lang.String/2004016611|kuali.org.RefObjectType.ProposalInfo|%%_#{opts[:proposal_dyn_var_name]}%%|1|2|3|4|2|5|5|6|7|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n \n #\n # Support Documents\n # Nothing uploaded\n #\n\n @request.add_thinktime(5)\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/DocumentRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|F189A2C8AED6D8071F8F9362674CF016|org.kuali.student.core.document.ui.client.service.DocumentRpcService|getRefDocIdsForRef|java.lang.String/2004016611|kuali.org.RefObjectType.ProposalInfo|%%_#{opts[:proposal_dyn_var_name]}%%|1|2|3|4|2|5|5|6|7|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n\n if(!opts[:collaborator].nil?)\n contents1 = \"5|0|194|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|1ED48DA6F48F82765FE7B58378EA94E0|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|validate|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loCategoryInfoList|id|%%_#{opts[:lo_category_id_var_name]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|createId|admin|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|0|name|#{opts[:lo_category]}|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|desc|formatted|#{opts[:lo_cat_text]}|plain|%%_#{opts[:lo_category_var_name]}%%|loRepositoryKey|#{opts[:propose_person]}|3|SINGLE USE LO|draft|kuali.lo.type.singleUse|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|effectiveDate|expenditure|affiliatedOrgs|%%_#{opts[:affliated_orgs_id_name]}%%|orgId|%%_#{opts[:admin_dep_var_name]}%%|percentage|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|#{admin_org}|fees|feeAmounts|currencyQuantity|currencyTypeKey|kuali.currency.type.usdollars.cents|feeType|kuali.enum.type.feeTypes.labFee|%%_#{opts[:lab_fee_id_name]}%%|2|rateType|fixedRateFee|Fixed Rate Fee|Laboratory Fee|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|5|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|4|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|6|pilotCourse|revenues|%%_#{opts[:revenues_id_name]}%%|REVENUE|%%_#{opts[:revenue_id_name]}%%|specialTopicsCourse|startTerm|kuali.atp.FA2008-2009|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|variations|versionInfo|currentVersionStart|sequenceNumber|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Fall Semester of 2008|Standard final Exam|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|8|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators|action|F|actionRequestId|%%_#{opts[:action_request_id_name]}%%|actionRequestStatus|Active|author|canRevokeRequest|firstName|#{opts[:collaborator]}|lastName|permission|KS-SYS~Edit Document|principalId\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|29|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|30|14|31|8|32|14|33|8|34|17|5|6|7|0|5|8|35|14|36|8|37|38|39|3759152200|1288490188800|0|8|40|14|36|8|41|38|39|3759152200|1288490188800|0|8|42|14|43|-45|-51|8|44|14|45|8|46|14|47|8|48|14|49|-41|-43|-37|-39|8|50|17|5|6|7|0|0|-37|-73|8|51|17|5|6|7|0|8|8|52|14|43|8|53|17|5|6|7|0|2|8|54|14|55|8|56|14|55|-79|-83|8|30|14|57|8|58|14|33|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491070679|1309965025280|959000000|8|40|14|59|8|41|38|39|3491081941|1309965025280|221000000|8|42|14|60|-79|-95|8|44|14|61|8|46|14|62|8|48|14|63|-37|-77|-33|-35|-1|-31|8|64|14|65|8|66|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|67|14|68|8|30|14|69|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3479039543|1309965025280|823000000|8|40|14|59|8|41|38|39|3479039543|1309965025280|823000000|8|42|14|43|-125|-131|8|70|17|5|6|7|0|1|18|-15|14|68|-125|-147|8|46|14|62|8|48|14|71|8|21|17|5|6|7|0|1|8|48|17|5|6|7|0|1|8|22|14|72|-159|-161|-125|-157|-121|-123|-1|-119|8|73|17|5|6|7|0|0|-1|-167|8|74|17|5|6|7|0|1|8|56|14|75|-1|-171|8|76|17|5|6|7|0|3|8|77|14|78|8|79|80|19|2|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|81|-188|-190|-179|-186|-1|-177|8|82|38|39|470887936|1219770712064|0|8|83|17|5|6|7|0|1|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|85|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-220|-222|-209|-218|-205|-207|-201|-203|-1|-199|8|92|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|93|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|94|80|19|100|8|95|14|96|-238|-240|-234|-236|8|97|14|98|8|30|14|99|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491076835|1309965025280|115000000|8|40|14|59|8|41|38|39|3491081856|1309965025280|136000000|8|42|14|100|-234|-253|8|101|14|102|8|21|17|5|6|7|0|2|8|101|17|5|6|7|0|1|8|22|14|103|-273|-275|8|97|17|5|6|7|0|1|8|22|14|104|-273|-281|-234|-271|-230|-232|-1|-228|8|105|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|106|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|107|14|108|8|109|17|5|6|7|0|3|8|110|14|111|8|112|14|113|8|21|17|5|6|7|0|1|8|112|17|5|6|7|0|1|8|22|14|114|-315|-317|-307|-313|-301|-305|8|115|80|-246|8|76|17|5|6|7|0|3|8|77|14|116|8|79|80|19|13|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|117|-336|-338|-327|-334|-301|-325|8|30|14|118|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491067152|1309965025280|432000000|8|40|14|59|8|41|38|39|3491081913|1309965025280|193000000|8|42|14|119|-301|-346|8|46|14|62|8|120|17|5|6|7|0|0|-301|-364|8|21|17|5|6|7|0|1|8|107|17|5|6|7|0|1|8|22|14|121|-370|-372|-301|-368|-297|-299|-293|-295|8|30|14|122|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491067143|1309965025280|423000000|8|40|14|59|8|41|38|39|3491081907|1309965025280|187000000|8\"\n contents3 = \"|42|14|119|-293|-380|8|46|14|62|8|123|17|5|6|7|0|0|-293|-398|8|48|14|124|-289|-291|-1|-287|8|125|17|5|6|7|0|2|18|-15|14|126|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|127|-412|-414|-406|-410|-1|-404|8|30|14|128|8|129|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|130|14|131|8|21|17|5|6|7|0|1|8|130|17|5|6|7|0|1|8|22|14|132|-434|-436|-428|-432|-424|-426|-1|-422|8|133|17|5|6|7|0|0|-1|-442|8|134|14|135|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491062523|1309965025280|803000000|8|40|14|59|8|41|38|39|3491081856|1309965025280|136000000|8|42|14|136|-1|-448|8|137|10|-5|8|138|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|139|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-491|-493|-480|-489|-476|-478|-472|-474|8|97|14|140|8|30|14|141|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491076834|1309965025280|114000000|8|40|14|59|8|41|38|39|3491081856|1309965025280|136000000|8|42|14|100|-472|-503|-468|-470|-1|-466|8|142|10|-5|8|143|14|144|8|46|14|62|8|145|14|146|8|123|17|5|6|7|0|2|18|-15|14|147|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|148|-535|-537|-529|-533|-1|-527|8|149|14|150|8|48|14|151|8|120|17|5|6|7|0|2|18|-15|14|152|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|153|-555|-557|-549|-553|-1|-547|8|154|17|5|6|7|0|2|18|-15|14|87|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|91|-571|-573|-565|-569|-1|-563|8|155|17|5|6|7|0|0|-1|-579|8|156|17|5|6|7|0|3|8|157|38|39|3491062523|1309965025280|803000000|8|158|89|90|1|0|8|159|14|160|-1|-583|8|21|17|5|6|7|0|3|8|143|17|5|6|7|0|1|8|22|14|161|-597|-599|8|145|17|5|6|7|0|1|8|22|14|146|-597|-605|8|13|17|5|6|7|0|1|8|22|14|162|-597|-611|-1|-595|8|163|17|5|6|7|0|12|8|164|14|165|8|30|14|166|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491062758|1309965025280|38000000|8|40|14|59|8|41|38|39|3491082765|1309965025280|45000000|8|42|14|167|-619|-625|8|44|14|65|8|168|17|5|6|7|0|1|18|-15|14|128|-619|-643|8|169|14|170|8|171|17|5|6|7|0|0|-619|-651|8|172|17|5|6|7|0|0|-619|-655|8|173|14|174|8|46|14|175|8|48|14|176|8|177|14|178|-1|-617|8|179|17|5|6|7|0|1|8|180|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|181|14|182|8|183|14|184|8|185|14|186|8|187|10|-5|8|188|10|11|1|8|189|14|190|8|191|14|190|8|192|14|193|8|194|14|190|-673|-675|-669|-671|-1|-667|0|0|\"\n else\n contents1 = \"5|0|180|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|1ED48DA6F48F82765FE7B58378EA94E0|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|validate|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loCategoryInfoList|id|%%_#{opts[:lo_category_id_var_name]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|createId|admin|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|0|name|#{opts[:lo_category]}|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|desc|formatted|#{opts[:lo_cat_text]}|plain|%%_#{opts[:lo_category_var_name]}%%|loRepositoryKey|#{opts[:propose_person]}|3|SINGLE USE LO|draft|kuali.lo.type.singleUse|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|effectiveDate|expenditure|affiliatedOrgs|%%_#{opts[:affliated_orgs_id_name]}%%|orgId|%%_#{opts[:admin_dep_var_name]}%%|percentage|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|#{admin_org}|fees|feeAmounts|currencyQuantity|currencyTypeKey|kuali.currency.type.usdollars.cents|feeType|kuali.enum.type.feeTypes.labFee|%%_#{opts[:lab_fee_id_name]}%%|2|rateType|fixedRateFee|Fixed Rate Fee|Laboratory Fee|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|5|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|4|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|6|pilotCourse|revenues|%%_#{opts[:revenues_id_name]}%%|REVENUE|%%_#{opts[:revenue_id_name]}%%|specialTopicsCourse|startTerm|kuali.atp.FA2008-2009|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|variations|versionInfo|currentVersionStart|sequenceNumber|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Fall Semester of 2008|Standard final Exam|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|8|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|29|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|30|14|31|8|32|14|33|8|34|17|5|6|7|0|5|8|35|14|36|8|37|38|39|3759152200|1288490188800|0|8|40|14|36|8|41|38|39|3759152200|1288490188800|0|8|42|14|43|-45|-51|8|44|14|45|8|46|14|47|8|48|14|49|-41|-43|-37|-39|8|50|17|5|6|7|0|0|-37|-73|8|51|17|5|6|7|0|8|8|52|14|43|8|53|17|5|6|7|0|2|8|54|14|55|8|56|14|55|-79|-83|8|30|14|57|8|58|14|33|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498783321|1309965025280|601000000|8|40|14|59|8|41|38|39|3498791687|1309965025280|967000000|8|42|14|60|-79|-95|8|44|14|61|8|46|14|62|8|48|14|63|-37|-77|-33|-35|-1|-31|8|64|14|65|8|66|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|67|14|68|8|30|14|69|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3479039543|1309965025280|823000000|8|40|14|59|8|41|38|39|3479039543|1309965025280|823000000|8|42|14|43|-125|-131|8|70|17|5|6|7|0|1|18|-15|14|68|-125|-147|8|46|14|62|8|48|14|71|8|21|17|5|6|7|0|1|8|48|17|5|6|7|0|1|8|22|14|72|-159|-161|-125|-157|-121|-123|-1|-119|8|73|17|5|6|7|0|0|-1|-167|8|74|17|5|6|7|0|1|8|56|14|75|-1|-171|8|76|17|5|6|7|0|3|8|77|14|78|8|79|80|19|2|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|81|-188|-190|-179|-186|-1|-177|8|82|38|39|470887936|1219770712064|0|8|83|17|5|6|7|0|1|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|85|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-220|-222|-209|-218|-205|-207|-201|-203|-1|-199|8|92|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|93|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|94|80|19|100|8|95|14|96|-238|-240|-234|-236|8|97|14|98|8|30|14|99|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498789104|1309965025280|384000000|8|40|14|59|8|41|38|39|3498791612|1309965025280|892000000|8|42|14|100|-234|-253|8|101|14|102|8|21|17|5|6|7|0|2|8|101|17|5|6|7|0|1|8|22|14|103|-273|-275|8|97|17|5|6|7|0|1|8|22|14|104|-273|-281|-234|-271|-230|-232|-1|-228|8|105|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|106|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|107|14|108|8|109|17|5|6|7|0|3|8|110|14|111|8|112|14|113|8|21|17|5|6|7|0|1|8|112|17|5|6|7|0|1|8|22|14|114|-315|-317|-307|-313|-301|-305|8|115|80|-246|8|76|17|5|6|7|0|3|8|77|14|116|8|79|80|19|13|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|117|-336|-338|-327|-334|-301|-325|8|30|14|118|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498779786|1309965025280|66000000|8|40|14|59|8|41|38|39|3498791652|1309965025280|932000000|8|42|14|119|-301|-346|8|46|14|62|8|120|17|5|6|7|0|0|-301|-364|8|21|17|5|6|7|0|1|8|107|17|5|6|7|0|1|8|22|14|121|-370|-372|-301|-368|-297|-299|-293|-295|8|30|14|122|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498779778|1309965025280|58000000|8|40|14|59|8|41|38|39|3498791646|1309965025280|926000000|8|42|14|119|-293|-380|8|46|14|62|8|123|17|5|6|7|0|0|-293|-398|8|48|14|124|-289|-291|-1|-287|8|125|17|5|6|7|0|2|18|-15|14|126|8|21|17|5|6\"\n contents3 = \"|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|127|-412|-414|-406|-410|-1|-404|8|30|14|128|8|129|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|130|14|131|8|21|17|5|6|7|0|1|8|130|17|5|6|7|0|1|8|22|14|132|-434|-436|-428|-432|-424|-426|-1|-422|8|133|17|5|6|7|0|0|-1|-442|8|134|14|135|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498775348|1309965025280|628000000|8|40|14|59|8|41|38|39|3498791612|1309965025280|892000000|8|42|14|136|-1|-448|8|137|10|-5|8|138|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|139|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-491|-493|-480|-489|-476|-478|-472|-474|8|97|14|140|8|30|14|141|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498789104|1309965025280|384000000|8|40|14|59|8|41|38|39|3498791612|1309965025280|892000000|8|42|14|100|-472|-503|-468|-470|-1|-466|8|142|10|-5|8|143|14|144|8|46|14|62|8|145|14|146|8|123|17|5|6|7|0|2|18|-15|14|147|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|148|-535|-537|-529|-533|-1|-527|8|149|14|150|8|48|14|151|8|120|17|5|6|7|0|2|18|-15|14|152|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|153|-555|-557|-549|-553|-1|-547|8|154|17|5|6|7|0|2|18|-15|14|87|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|91|-571|-573|-565|-569|-1|-563|8|155|17|5|6|7|0|0|-1|-579|8|156|17|5|6|7|0|3|8|157|38|39|3498775348|1309965025280|628000000|8|158|89|90|1|0|8|159|14|160|-1|-583|8|21|17|5|6|7|0|3|8|143|17|5|6|7|0|1|8|22|14|161|-597|-599|8|145|17|5|6|7|0|1|8|22|14|146|-597|-605|8|13|17|5|6|7|0|1|8|22|14|162|-597|-611|-1|-595|8|163|17|5|6|7|0|12|8|164|14|165|8|30|14|166|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498775596|1309965025280|876000000|8|40|14|59|8|41|38|39|3498792455|1309965025280|735000000|8|42|14|167|-619|-625|8|44|14|65|8|168|17|5|6|7|0|1|18|-15|14|128|-619|-643|8|169|14|170|8|171|17|5|6|7|0|0|-619|-651|8|172|17|5|6|7|0|0|-619|-655|8|173|14|174|8|46|14|175|8|48|14|176|8|177|14|178|-1|-617|8|179|17|5|6|7|0|1|8|180|17|5|6|7|0|0|-669|-671|-1|-667|0|0|\"\n end\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}#{contents3}\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add_thinktime(5)\n\n\n # Submit to worflow\n if(opts[:submit])\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|submitDocumentWithId|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n end\n \n \n end", "def set_user_template(opts)\n opts = check_params(opts,[:templates])\n super(opts)\n end", "def create_proposal(title, oversight_department, admin_org, opts={})\n \n lo_cat = \"Scientific method\"\n lo_cat_text = \"LO Cat Text\"\n \n defaults = {\n :propose_person => '%%_username%%', #user is the dynvar from users.csv\n :mode => 'blank',\n :nav_homepage => true,\n :submit => true,\n :append_unique_id => false, #tell tsung to append unique id on title\n :instructor => 'fred', #BUG - HARDCODED - can't use dynvar though because of ajax search\n :collaborator => @request.config.directory[\"users\"][\"collaborator\"][\"username\"],\n :first_expected_offering => @request.config.directory[\"atp\"][\"name\"],\n :subject_area => \"BSCI\",\n :oversight_dept_number => \"65\", #BUG - right now hardcoded to BSCI, search that returned this was removed\n :course_suffix => \"123\",\n :course_short_title => \"Perf Course\",\n :course_title => title,\n :proposal_title => title,\n :course_description => \"My fake description.\",\n :course_rationale => \"My fake rationale.\",\n :lo_create => FALSE,\n :lo_category => lo_cat,\n :lo_cat_text => lo_cat_text,\n :lo_name => @request.config.directory[\"lo\"][\"name\"],\n :admin_dep_var_name => \"admin_dep_org_id\",\n :admin_dep_var_regexp => 'org.resultColumn.orgId\\\"\\,\\\"\\([^\\\"]+\\)',\n :proposal_dyn_var_name => \"proposal_id\",\n :proposal_dyn_var_regexp => '\\\"proposal\\\"\\,\\\"workflowNode\\\"\\,\\\"PreRoute\\\"\\,\\\"\\([^\\\"]+\\)',\n :proposal_doc_id_var_name => \"proposal_doc_id\",\n :proposal_doc_id_var_regexp => 'workflowId\\\"\\,\\\"\\([^\\\"]+\\)\\\"',\n :clu_ref_dyn_var_name => \"clu_ref_id\",\n :clu_ref_dyn_var_regexp => '\\\"id\\\"\\,\\\"\\([^\\\"]+\\)',\n :result_com_var_name => \"result_component_id\",\n :result_com_var_regexp => '\\\"ResultComponent 1\\\"\\,\\\"\\([^\\\"]+\\)',\n :enroll_est_var_name => \"default_enrollment_estimate_id\",\n :enroll_est_var_regexp => 'defaultEnrollmentEstimate\\\"\\,\\\"kuali.atp.duration.Week\\\"\\,\\\"Week\\\"\\,\\\"\\([^\\\"]+\\)',\n :lab_var_name => \"lab_id\",\n :lab_var_regexp => 'draft\\\"\\,\\\"unitsContentOwner\\\"\\,\\\"Lab\\\"\\,\\\"\\([^\\\"]+\\)',\n :lab_fee_id_name => 'cp_lab_fee_id',\n :lab_fee_id_regexp => 'kuali.enum.type.feeTypes.labFee\\\"\\,\\\"\\([^\\\"]+\\)',\n :revenues_id_name => 'cp_revenues_id',\n :revenues_id_regexp => 'revenues\\\"\\,\\\"\\([^\\\"]+\\)',\n :revenue_id_name => 'cp_revenue_id',\n :revenue_id_regexp => 'REVENUE\\\"\\,\\\"\\([^\\\"]+\\)',\n :joints_var_name => \"joints_num\",\n :joints_var_regexp => 'joints\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"\\([^\\\"]+\\)',\n :fee_info_id_dyn_var_name => 'fee_info_id',\n :fee_info_id_dyn_var_regexp => '\\\"fees\\\"\\,\\\"\\([^\\\"]+\\)',\n :fee_info_dyn_var_name => 'fee_info',\n :fee_info_dyn_var_regexp => 'org.kuali.student.lum.lu.dto.CluFeeInfo\\\"\\,\\\"\\([^\\\"]+\\)',\n :clu_info_dyn_var_name => 'clu_info',\n :clu_info_dyn_var_regexp => 'org.kuali.student.lum.lu.dto.CluInfo\\\"\\,\\\"\\([^\\\"]+\\)',\n :lu_dto_clu_format_dyn_var_name => \"lu_dto_clu_format\",\n :lu_dto_clu_format_dyn_var_regexp => 'org.kuali.student.lum.lu.dto.CluInfo\\\"\\,\\\"Credit Course\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"formats\\\"\\,\\\"\\([^\\\"]+\\)',\n :lu_dto_clu_activities_dyn_var_name => \"lu_dto_clu_activites\",\n :lu_dto_clu_activities_dyn_var_regexp => 'org.kuali.student.lum.lu.dto.CluInfo\\\"\\,\\\"Credit Course\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"formats\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"0\\\"\\,\\\"activities\\\"\\,\\\"\\([^\\\"]+\\)',\n :outcome_id_var_name => \"outcome_id\",\n :outcome_id_var_regexp => 'outcomeId\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_category_var_name => \"lo_category\",\n #:lo_category_var_regexp => lo_cat_text + '\\\"\\,\\\"plain\\\"\\,\\\"id\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_category_var_regexp => lo_cat_text + '\\\"\\,\\\"plain\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_category_id_var_name => \"lo_category_id\",\n :lo_category_id_var_regexp => 'lo.resultColumn.categoryId\"\\,\\\"\\([^\\\"]+\\)',\n :lo_child_id_dyn_var_name => \"lo_child_id\",\n :lo_child_id_dyn_var_regexp => 'childLo\\\"\\,\\\"\\([^\\\"]+\\)',\n :single_use_lo_dyn_var_name => \"single_use_lo\",\n :single_use_lo_dyn_var_regexp => 'includedSingleUseLo\\\"\\,\\\"\\([^\\\"]+\\)',\n :atp_duration_week_var_name => 'atp_duration_week',\n :atp_duration_week_var_regexp => 'kuali.atp.duration.Week\\\"\\,\\\"Week\\\"\\,\\\"\\([^\\\"]+\\)',\n :version_ind_id_name => 'cp_version_ind_id',\n :version_ind_id_regexp => 'versionIndId\\\"\\,\\\"\\([^\\\"]+\\)',\n :affliated_orgs_id_name => 'cp_affiliated_orgs_id',\n :affliated_orgs_id_regexp => 'affiliatedOrgs\\\"\\,\\\"\\([^\\\"]+\\)',\n :action_request_id_name => 'cp_action_request_id',\n :action_request_id_regexp => 'actionRequestId\\\"\\,\\\"\\([^\\\"]+\\)'\n }\n \n # Version for the doc at each step. We'll increment on each usage\n # So first usage should eval to 0\n version_indicator = -1\n \n opts = defaults.merge(opts)\n \n title << '_%%ts_user_server:get_unique_id%%' if(opts[:append_unique_id])\n \n if(opts[:mode] != \"blank\")\n # select template or copy course...\n end\n \n # Navigate to Curriculum Mgmt\n self.homepage() unless(!opts[:nav_homepage])\n \n puts \"creating proposal as: #{opts[:propose_person]}\"\n \n # Create a course\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SecurityRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|13BFCB3640903B473D12816447D1469D|org.kuali.student.common.ui.client.service.SecurityRpcService|checkAdminPermission|java.lang.String/2004016611|#{opts[:propose_person]}|useCurriculumReview|1|2|3|4|2|5|5|6|7|\"\n }, {'subst' => 'true'}\n )\n \n \n # Click Start blank proposal\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|15|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|A239E8C5A2EDCD8BCE6061BF191A8095|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|getMetadata|java.lang.String/2004016611|java.util.Map||java.util.HashMap/962170901|documentTypeName|kuali.proposal.type.course.create|DtoState|Draft|DtoNextState|DtoWorkflowNode|PreRoute|1|2|3|4|2|5|6|7|8|4|5|9|5|10|5|11|5|12|5|13|5|7|5|14|5|15|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|335FF062A700107AB2A642B325C6C5C5|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementTypeForCourse|java.lang.String/2004016611|kuali.statement.type.course|1|2|3|4|1|5|6|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpDurationTypes|atp.resultColumn.atpDurTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.finalExam.status|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|14|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponentType.credit.degree.fixed|kuali.resultComponentType.credit.degree.range|kuali.resultComponentType.credit.degree.multiple|lrc.search.resultComponentType|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|1|7|8|6|3|9|10|9|11|9|12|0|13|14|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|14|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponentType.credit.degree.fixed|kuali.resultComponentType.credit.degree.range|kuali.resultComponentType.credit.degree.multiple|lrc.search.resultComponentType|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|1|7|8|6|3|9|10|9|11|9|12|0|13|14|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|14|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponentType.credit.degree.fixed|kuali.resultComponentType.credit.degree.range|kuali.resultComponentType.credit.degree.multiple|lrc.search.resultComponentType|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|1|7|8|6|3|9|10|9|11|9|12|0|13|14|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.fee.rateType|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.fee.rateType|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.fee.rateType|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.fee.rateType|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n \n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CommentRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|62D53D0C5087061126A72510E98E7E9A|org.kuali.student.core.comments.ui.client.service.CommentRpcService|getUserRealName|java.lang.String/2004016611|#{opts[:propose_person]}|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|subjectCode.queryParam.code||subjectCode.search.orgsForSubjectCode|subjectCode.resultColumn.orgLongName|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|20|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|atp.advancedAtpSearchParam.atpType|java.lang.String/2004016611|kuali.atp.type.Spring|kuali.atp.type.Summer|kuali.atp.type.Fall|kuali.atp.type.Session1|kuali.atp.type.Session2|kuali.atp.type.Mini-mester1A|kuali.atp.type.Mini-mester1B|atp.advancedAtpSearchParam.atpStartDateAtpConstraintIdExclusive||atp.search.advancedAtpSearch|atp.resultColumn.atpStartDate|1|2|3|4|1|5|5|0|0|6|2|7|8|6|7|9|10|9|11|9|12|9|13|9|14|9|15|9|16|0|7|17|0|18|19|20|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|19|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|atp.advancedAtpSearchParam.atpType|java.lang.String/2004016611|kuali.atp.type.Spring|kuali.atp.type.Summer|kuali.atp.type.Fall|kuali.atp.type.Session1|kuali.atp.type.Session2|kuali.atp.type.Mini-mester1A|kuali.atp.type.Mini-mester1B|atp.advancedAtpSearchParam.atpStartDateAtpConstraintId|atp.search.advancedAtpSearch|atp.resultColumn.atpStartDate|1|2|3|4|1|5|5|0|0|6|2|7|8|6|7|9|10|9|11|9|12|9|13|9|14|9|15|9|16|0|7|17|0|0|18|19|0|0|\"\n }\n )\n \n \n \n #\n # Pg1 - Course Information\n #\n\n @request.add_thinktime(5)\n\n # Course Subject Code\n # AJAX popup while typing in subject area\n for i in 1..opts[:subject_area].length\n itr = i-1\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|12|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|subjectCode.queryParam.code|#{opts[:subject_area][0..itr]}|subjectCode.search.subjectCodeGeneric|subjectCode.resultColumn.code|1|2|3|4|1|5|5|0|6|0|7|1|8|9|0|10|11|12|0|0|\"\n } \n ) \n end\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|subjectCode.queryParam.code|#{opts[:subject_area]}|subjectCode.search.orgsForSubjectCode|subjectCode.resultColumn.orgLongName|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n } \n )\n\n @request.add_thinktime(3)\n\n # Instructor\n for i in 1..opts[:instructor].length\n itr = i-1\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|12|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|person.queryParam.personGivenName|#{opts[:instructor][0..itr]}|person.search.personQuickViewByGivenName|person.resultColumn.DisplayName|1|2|3|4|1|5|5|0|6|0|7|1|8|9|0|10|11|12|0|0|\"\n } \n ) \n end\n\n\n @request.add_thinktime(22)\n\n # Save & Continue\n contents1 = \"5|0|41|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|A239E8C5A2EDCD8BCE6061BF191A8095|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|proposal|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|type|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|kuali.proposal.type.course.create|workflowNode|PreRoute|name|#{opts[:proposal_title]}|_runtimeData|dirty|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|rationale|#{opts[:course_rationale]}|courseTitle|#{opts[:course_title]}|transcriptTitle|subjectArea|courseNumberSuffix|instructors|#{opts[:course_short_title]}|#{opts[:subject_area]}|#{opts[:course_suffix]}|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|personId|#{opts[:instructor]}|id-translation|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|descr|plain|#{opts[:course_description]}\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|8|8|9|10|5|6|7|0|5|8|11|12|13|8|14|12|15|8|16|12|17|8|18|10|5|6|7|0|1|8|19|10|5|6|7|0|2|-11|20|21|1|8|22|20|-22|-15|-17|-5|-13|-23|12|23|-1|-3|8|24|12|25|-13|10|5|6|7|0|1|-17|10|5|6|7|0|5|-26|20|-22|8|26|20|-22|8|27|20|-22|8|28|20|-22|8|29|20|-22|-29|-17|-1|-13|-35|12|30|-37|12|31|-39|12|32|-41|10|5|6|7|0|1|33|34|0|10|5|6|7|0|2|8|35|12|36|8|18|10|5|6|7|0|1|8|35|10|5|6|7|0|1|8|37|12|38|-58|-60|-52|-56|-47|-49|-1|8|29|8|39|10|5|6|7|0|2|8|40|12|41|-13|10|5|6|7|0|1|-17|10|5|6|7|0|1|-71|20|-22|-74|-17|-69|-13|-1|-67|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}\"\n },\n {\n :dyn_variables => [\n {\"name\" => opts[:proposal_dyn_var_name], \"re\" => opts[:proposal_dyn_var_regexp]},\n {\"name\" => opts[:clu_ref_dyn_var_name], \"re\" => opts[:clu_ref_dyn_var_regexp]},\n {\"name\" => opts[:proposal_doc_id_var_name], \"re\" => opts[:proposal_doc_id_var_regexp]},\n {\"name\" => opts[:version_ind_id_name], \"re\" => opts[:version_ind_id_regexp]}\n ]\n }\n )\n\n #@request.add(\"DEBUG/proposal_dyn_var_name/%%_#{opts[:proposal_dyn_var_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/clu_ref_dyn_var_name/%%_#{opts[:clu_ref_dyn_var_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/proposal_doc_id_var_name/%%_#{opts[:proposal_doc_id_var_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/version_ind_id_name/%%_#{opts[:version_ind_id_name]}%%\", {}, {'subst' => 'true'})\n \n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n \n \n #\n # Pg 2 - Governance\n # Campus Locations: All\n #\n\n # COC Org\n # Biology Dept\n\n @request.add_thinktime(8)\n\n # Admin Org\n # Botany\n for i in 1..admin_org.length\n itr = i-1\n if(i == admin_org.length)\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|16|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|org.queryParam.orgOptionalLongName|#{admin_org[0..itr]}|org.queryParam.orgOptionalType|java.lang.String/2004016611|kuali.org.Department|kuali.org.College|org.search.generic||1|2|3|4|1|5|5|0|6|0|7|2|8|9|0|10|8|11|7|2|12|13|12|14|0|15|16|0|0|\"\n },\n {\n :dyn_variables => [\n {\"name\" => opts[:admin_dep_var_name], \"re\" => opts[:admin_dep_var_regexp]}\n ]\n }\n )\n\n #@request.add(\"DEBUG/admin_dep_var_name/%%_#{opts[:admin_dep_var_name]}%%\", {}, {'subst' => 'true'})\n else\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|16|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|org.queryParam.orgOptionalLongName|#{admin_org[0..itr]}|org.queryParam.orgOptionalType|java.lang.String/2004016611|kuali.org.Department|kuali.org.College|org.search.generic||1|2|3|4|1|5|5|0|6|0|7|2|8|9|0|10|8|11|7|2|12|13|12|14|0|15|16|0|0|\"\n } \n )\n end \n end\n\n @request.add_thinktime(15)\n\n # Save & Continue\n contents1 = \"5|0|101|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|A239E8C5A2EDCD8BCE6061BF191A8095|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|AL|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|courseTitle|#{opts[:course_title]}|creditOptions|crossListings|descr|plain|#{opts[:course_description]}|expenditure|affiliatedOrgs|fees|formats|gradingOptions|id|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|_runtimeData|id-translation|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|metaInfo|createId|#{opts[:propose_person]}|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|#{version_indicator+=1}|pilotCourse|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|revenues|specialTopicsCourse|state|draft|subjectArea|#{opts[:subject_area]}|termsOffered|transcriptTitle|#{opts[:course_short_title]}|type|kuali.lu.type.CreditCourse|unitsContentOwner|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|%%_#{opts[:admin_dep_var_name]}%%|#{admin_org}|variations|versionInfo|currentVersionStart|sequenceNumber|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|versionIndId|%%_#{opts[:version_ind_id_name]}%%|dirty|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|2|name|#{opts[:proposal_title]}|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|32|8|9|10|5|6|7|0|1|11|12|0|13|14|-1|8|9|8|15|13|16|8|17|13|18|8|19|10|5|6|7|0|0|-1|-15|8|20|13|21|8|22|10|5|6|7|0|0|-1|-21|8|23|10|5|6|7|0|0|-1|-25|8|24|10|5|6|7|0|1|8|25|13|26|-1|-29|8|27|10|5|6|7|0|1|8|28|10|5|6|7|0|0|-37|-39|-1|-35|8|29|10|5|6|7|0|0|-1|-43|8|30|10|5|6|7|0|0|-1|-47|8|31|10|5|6|7|0|0|-1|-51|8|32|13|33|8|34|10|5|6|7|0|1|11|-8|10|5|6|7|0|2|8|35|13|36|8|37|10|5|6|7|0|1|8|35|10|5|6|7|0|1|8|38|13|39|-69|-71|-63|-67|-59|-61|-1|-57|8|40|10|5|6|7|0|0|-1|-77|8|41|13|42|8|43|10|5|6|7|0|5|8|44|13|45|8|46|47|48|1854995943|1314259992576|519000000|8|49|13|45|8|50|47|48|1854995943|1314259992576|519000000|8|51|13|52|-1|-83|8|53|54|55|0|8|56|10|5|6|7|0|0|-1|-102|8|57|54|-101|8|58|13|59|8|60|13|61|8|62|10|5|6|7|0|0|-1|-112|8|63|13|64|8|65|13|66|8|67|10|5|6|7|0|2|11|-8|13|68|8|37|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|38|13|69|-128|-130|-122|-126|-1|8|67|8|70|10|5|6|7|0|2|11|-8|13|71|8|37|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|38|13|72|-145|-147|-139|-143|-1|8|70|8|73|10|5|6|7|0|0|-1|-154|8|74|10|5|6|7|0|3|8|75|47|48|1854995943|1314259992576|519000000|8|76|77|78|1|0|8|79|13|80|-1|-158|8|37|10|5|6|7|0|2|8|60|10|5|6|7|0|1|8|38|13|61|-172|-174|8|81|10|5|6|7|0|3|8|9|54|55|1|8|67|54|-186|8|70|54|-186|-172|-180|-1|-170|8|82|10|5|6|7|0|12|8|83|13|84|8|32|13|85|8|43|10|5|6|7|0|5|8|44|13|45|8|46|47|48|1854996146|1314259992576|722000000|8|49|13|45|8|50|47|48|1854997119|1314259992576|695000000|8|51|13|86|-193|-199|8|87|13|88|8|89|10|5|6|7|0|1|11|-8|13|33|-193|-217|8|90|13|91|8|92|10|5|6|7|0|0|-193|-225|8|93|10|5|6|7|0|0|-193|-229|8|94|13|95|8|58|13|96|8|65|13|97|8|98|13|99|-1|-191|8|100|10|5|6|7|0|1|8|101|10|5|6|7|0|0|-243|-245|-1|-241|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lu.queryParam.luOptionalLuTypeStartsWith|kuali.lu.type.activity.|lu.search.all.lu.Types|lu.resultColumn.luTypeName|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.atptype.duration|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n \n \n #\n # Course Logistics \n # Term: Any\n # Duration Type: Semester\n # Duration Count: 2\n # Assessment Scale: Letter\n # Standard Final Exam\n # Outcome: 10 credits\n # Course Format\n # => Activity Type: Lab, Contact Hours: 5, Frequency: weekly\n # => Duration Type: Weekly\n # => Duration: 13\n # => Anticipated class size: 100\n\n @request.add_thinktime(30)\n\n # Save & Continue\n contents1 = \"5|0|126|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|A239E8C5A2EDCD8BCE6061BF191A8095|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|courseTitle|#{opts[:course_title]}|creditOptions|dirty|type|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|fixedCreditValue|created|kuali.resultComponentType.credit.degree.fixed|10|crossListings|descr|plain|#{opts[:course_description]}|expenditure|affiliatedOrgs|fees|formats|activities|activityType|defaultEnrollmentEstimate|kuali.lu.type.activity.Lab|contactHours|unitQuantity|unitType|kuali.atp.duration.week|duration|atpDurationTypeKey|timeQuantity|kuali.atp.duration.Week|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|gradingOptions|kuali.resultComponent.grade.letter|id|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|metaInfo|createId|#{opts[:propose_person]}|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|#{version_indicator+=1}|pilotCourse|revenues|specialTopicsCourse|state|draft|subjectArea|#{opts[:subject_area]}|termsOffered|kuali.atp.season.Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|unitsContentOwner|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|%%_#{opts[:admin_dep_var_name]}%%|#{admin_org}|variations|versionInfo|currentVersionStart|sequenceNumber|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|versionIndId|%%_#{opts[:version_ind_id_name]}%%|finalExamStatus|audit|passFail|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|3|name|#{opts[:proposal_title]}|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators|kuali.atp.duration.Semester|STD\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|36|8|9|10|5|6|7|0|2|11|12|0|13|14|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|17|-12|-14|-5|-10|-1|-3|8|18|13|19|8|20|13|21|8|22|10|5|6|7|0|0|-1|-24|8|23|13|24|8|25|10|5|6|7|0|1|11|-8|10|5|6|7|0|3|8|15|10|5|6|7|0|3|8|26|10|5|6|7|0|2|8|27|28|29|1|8|30|28|-48|-40|-42|8|31|28|-48|-38|10|5|6|7|0|1|-42|10|5|6|7|0|1|-51|28|-48|-54|-42|-40|-38|-36|-38|-46|13|32|-49|13|33|-32|-34|-1|-30|8|34|10|5|6|7|0|0|-1|-62|8|35|10|5|6|7|0|1|8|36|13|37|-1|-66|8|38|10|5|6|7|0|1|8|39|10|5|6|7|0|0|-74|-76|-1|-72|8|40|10|5|6|7|0|0|-1|-80|8|41|10|5|6|7|0|1|11|-8|10|5|6|7|0|2|8|42|10|5|6|7|0|1|11|-8|10|5|6|7|0|5|-38|10|5|6|7|0|3|-42|10|5|6|7|0|2|8|43|28|-48|8|44|28|-48|-101|-42|8|31|28|-48|-38|10|5|6|7|0|1|-42|10|5|6|7|0|1|-110|28|-48|-113|-42|-101|-38|-98|-38|-106|13|45|8|46|10|5|6|7|0|3|8|47|13|33|-38|10|5|6|7|0|1|-42|10|5|6|7|0|2|-124|28|-48|8|48|28|-48|-127|-42|-122|-38|-133|13|49|-98|-120|8|50|10|5|6|7|0|3|-38|10|5|6|7|0|1|-42|10|5|6|7|0|2|8|51|28|-48|8|52|28|-48|-141|-42|-138|-38|-146|13|53|-148|54|12|13|-98|-136|-108|54|12|100|-94|-96|-90|-92|8|15|10|5|6|7|0|2|8|31|28|-48|-38|10|5|6|7|0|1|-42|10|5|6|7|0|1|-159|28|-48|-162|-42|-157|-38|-90|-155|-86|-88|-1|-84|8|55|10|5|6|7|0|1|11|-8|13|56|-1|8|55|8|57|13|58|8|59|10|5|6|7|0|1|11|-8|10|5|6|7|0|2|8|60|13|61|8|15|10|5|6|7|0|1|8|60|10|5|6|7|0|1|8|16|13|62|-189|-191|-183|-187|-179|-181|-1|-177|8|63|10|5|6|7|0|0|-1|-197|8|64|13|65|8|66|10|5|6|7|0|5|8|67|13|68|8|69|70|71|1854995943|1314259992576|519000000|8|72|13|68|8|73|70|71|1856244060|1314259992576|636000000|8|74|13|75|-1|-203|8|76|28|29|0|8|77|10|5|6|7|0|0|-1|-222|8|78|28|-221|8|79|13|80|8|81|13|82|8|83|10|5|6|7|0|1|11|-8|13|84|-1|8|83|8|85|13|86|8|27|13|87|8|88|10|5|6|7|0|2|11|-8|13|89|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|90|-251|-253|-245|-249|-1|-243|8|91|10|5|6|7|0|2|11|-8|13|92|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|93|-267|-269|-261|-265|-1|-259|8|94|10|5|6|7|0|0|-1|-275|8|95|10|5|6|7|0|3|8|96|70|71|1854995943|1314259992576|519000000|8|97|98|99|1|0|8|100|13|101|-1|-279|8|15|10|5|6|7|0|2|8|81|10|5|6|7|0|1|8|16|13|82|-293|-295|-42|10|5|6|7|0|5|8|83|28|-48|8|55|28|-48|8|102|28|-48|8|103|28|-48|8|104|28|-48|-293|-42|-1|-291|8|105|10|5|6|7|0|12|8|106|13|107|8|57|13|108|8|66|10|5|6|7|0|5|8|67|13|68|8|69|70|71|1854996146|1314259992576|722000000|8|72|13|68|8|73|70|71|1856244989|1314259992576|565000000|8|74|13|109|-316|-322|8|110|13|111|8|112|10|5|6|7|0|1|11|-8|13|58|-316|-340|8|113|13|114|8|115|10|5|6|7|0|0|-316|-348|8|116|10|5|6|7|0|0|-316|-352|8|117|13|118|8|79|13|119|8|27|13|120|8|121|13|122|-1|-314|8|123|10|5|6|7|0|1|8|124|10|5|6|7|0|0|-366|-368|-1|-364|8|50|10|5|6|7|0|3|-38|10|5|6|7|0|1|-42|10|5|6|7|0|2|8|51|28|-48|8|52|28|-48|-377|-42|-374|-38|-382|13|125|-384|54|12|2|-1|-372|-308|13|126|-310|28|-221|-312|28|-221|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}\"\n },\n {\n 'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:enroll_est_var_name], \"re\" => opts[:enroll_est_var_regexp]},\n {\"name\" => opts[:lab_var_name], \"re\" => opts[:lab_var_regexp]},\n {\"name\" => opts[:atp_duration_week_var_name], \"re\" => opts[:atp_duration_week_var_regexp]}\n ]\n }\n )\n\n #@request.add(\"DEBUG/enroll_est_var_name/%%_#{opts[:enroll_est_var_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/lab_var_name/%%_#{opts[:lab_var_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/atp_duration_week_var_name/%%_#{opts[:atp_duration_week_var_name]}%%\", {}, {'subst' => 'true'})\n\n @request.add_thinktime(2)\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n \n #\n # Learning Objectives\n #\n\n @request.add_thinktime(5)\n\n # Category\n for i in 1..opts[:lo_category].length\n itr = i-1\n if(i == opts[:lo_category].length)\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lo.queryParam.loOptionalCategoryName|#{opts[:lo_category][0..itr]}|lo.search.loCategories|1|2|3|4|1|5|5|0|6|0|7|1|8|9|0|10|11|0|0|0|\"\n },\n {\n :dyn_variables => [\n {\"name\" => opts[:lo_category_id_var_name], \"re\" => opts[:lo_category_id_var_regexp]}\n ]\n }\n )\n\n #@request.add(\"DEBUG/lo_category_id_var_name/%%_#{opts[:lo_category_id_var_name]}%%\", {}, {'subst' => 'true'})\n\n else\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lo.queryParam.loOptionalCategoryName|#{opts[:lo_category][0..itr]}|lo.search.loCategories|1|2|3|4|1|5|5|0|6|0|7|1|8|9|0|10|11|0|0|0|\"\n } \n )\n end \n end\n\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/LoCategoryRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|AC3B9DCF992DD862E331BCB0704203E2|org.kuali.student.lum.common.client.lo.rpc.LoCategoryRpcService|getData|java.lang.String/2004016611|%%_#{opts[:lo_category_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/LoCategoryRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|AC3B9DCF992DD862E331BCB0704203E2|org.kuali.student.lum.common.client.lo.rpc.LoCategoryRpcService|getLoCategoryType|java.lang.String/2004016611|loCategoryType.subject|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add_thinktime(25)\n\n # Save & Continue\n contents1 = \"5|0|155|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|A239E8C5A2EDCD8BCE6061BF191A8095|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loInfo|id|desc|formatted|#{opts[:lo_cat_text]}|plain|name|SINGLE USE LO|sequence|0|metaInfo|loCategoryInfoList|%%_#{opts[:lo_category_id_var_name]}%%|#{opts[:lo_category]}|loRepository|kuali.loRepository.key.singleUse|effectiveDate|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|expirationDate|state|active|type|loCategoryType.subject|createId|admin|createTime|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|#{opts[:propose_person]}|resultValues|draft|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|expenditure|affiliatedOrgs|fees|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|10|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|2|pilotCourse|revenues|specialTopicsCourse|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|%%_#{opts[:admin_dep_var_name]}%%|#{admin_org}|variations|versionInfo|currentVersionStart|sequenceNumber|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Standard final Exam|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|4|#{opts[:proposal_title]}|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|36|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|29|17|5|6|7|0|5|8|30|14|0|8|31|17|5|6|7|0|2|8|32|14|33|8|34|14|33|-41|-45|8|35|14|36|8|37|14|38|8|39|17|0|-37|-39|8|40|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|30|14|41|8|35|14|42|8|31|17|5|6|7|0|2|8|32|14|0|8|34|14|0|-65|-71|8|43|14|44|8|45|46|0|8|47|46|0|8|48|14|49|8|50|14|51|8|39|17|5|6|7|0|5|8|52|14|53|8|54|46|55|3759152200|1288490188800|0|8|56|14|53|8|57|46|55|3759152200|1288490188800|0|8|58|14|38|-65|-89|-61|-63|-37|-59|-33|-35|-1|8|28|8|59|14|60|8|61|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|62|14|63|8|30|14|64|8|39|17|5|6|7|0|5|8|52|14|65|8|54|46|55|1861297882|1314259992576|458000000|8|56|14|65|8|57|46|55|1861297882|1314259992576|458000000|8|58|14|38|-114|-120|8|66|17|5|6|7|0|1|18|-15|14|63|-114|-136|8|48|14|67|8|50|14|68|8|21|17|5|6|7|0|1|8|50|17|5|6|7|0|1|8|22|14|69|-148|-150|-114|-146|-110|-112|-1|-108|8|70|17|5|6|7|0|0|-1|-156|8|71|17|5|6|7|0|1|8|34|14|72|-1|-160|8|73|17|5|6|7|0|3|8|74|14|75|8|76|77|19|2|8|21|17|5|6|7|0|1|8|74|17|5|6|7|0|1|8|22|14|78|-177|-179|-168|-175|-1|-166|8|79|17|5|6|7|0|1|8|80|17|5|6|7|0|0|-187|-189|-1|-185|8|81|17|5|6|7|0|0|-1|-193|8|82|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|83|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|84|14|85|8|86|17|5|6|7|0|3|8|87|14|88|8|89|14|90|8|21|17|5|6|7|0|1|8|89|17|5|6|7|0|1|8|22|14|91|-225|-227|-217|-223|-211|-215|8|92|77|19|100|8|73|17|5|6|7|0|3|8|74|14|93|8|76|77|19|13|8|21|17|5|6|7|0|1|8|74|17|5|6|7|0|1|8|22|14|94|-247|-249|-238|-245|-211|-236|8|30|14|95|8|39|17|5|6|7|0|5|8|52|14|65|8|54|46|55|1861297868|1314259992576|444000000|8|56|14|65|8|57|46|55|1861297868|1314259992576|444000000|8|58|14|38|-211|-257|8|48|14|67|8|96|17|5|6|7|0|0|-211|-275|8|21|17|5|6|7|0|1|8|84|17|5|6|7|0|1|8|22|14|97|-281|-283|-211|-279|-207|-209|-203|-205|8|30|14|98|8|39|17|5|6|7|0|5|8|52|14|65|8|54|46|55|1861297859|1314259992576|435000000|8|56|14|65|8|57|46|55|1861297859|1314259992576|435000000|8|58|14|38|-203|-291|8|48|14|67|8|99|17|5|6|7|0|0|-203|-309|8|50|14|100|-199|-201|-1|-197|8|101|17|5|6|7|0|2|18|-15|14|102|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|103|-323|-325|-317|-321|-1|-315|8|30|14|104|8|105|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|106|14|107|8|21|17|5|6|7|0|1|8|106|17|5|6|7|0|1|8|22|14|108|-345|-347|-339|-343|-335|-337|-1|-333|8|109|17|5|6|7|0|0|-1|-353|8|110|14|111|8|39|17|5|6|7|0|5|8|52|14|65|8|54|46|55|1854995943|1314259992576|519000000|8|56|14|65|8|57|46|55|1861297799|1314259992576|375000000|8|58|14|112|-1|-359|8|113|10|-5|8|114|17|5|6|7|0|0|-1|-377|8|115|10|-5|8|48|14|67|8|116|14|117|8|99|17|5|6|7|0|2|18|-15|14|118|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|119|-395|-397|-389|-393|-1|-387|8|120|14|121|8|50|14|122|8|96|17|5|6|7|0|2|18|-15|14|123|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|124|-415|-417|-409|-413|-1|-407|8|125|17|5|6|7|0|2|18|-15|14|126|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|127|-431|-433|-425|-429|-1|-423|8|128|17|5|6|7|0|0|-1|-439|8|129|17|5|6|7|0|3|8|130|46|55|1854995943|1314259992576|519000000|8|131|132|133|1|0|8|134|14|135|-1|-443|8|21|17|5|6|7|0|2|8|116|17|5|6|7|0|1|8|22|14|117|-457|-459|8|13|17|5|6|7|0|1|8|22|14|136|-457|-465|-1|-455|8|137|17|5|6|7|0|12|8|138|14|139|8|30|14|140|8|39|17|5|6|7|0|5|8|52|14|65|8|54|46|55|1854996146|1314259992576|722000000|8|56|14|65|8|57|46|55|1861299120|1314259992576|696000000|8|58|14|141|-473|-479|8|35|14|142|8|143|17|5|6|7|0|1|18|-15|14|104|-473|-497|8|144|14|145|8|146|17|5|6|7|0|0|-473|-505|8|147|17|5|6|7|0|0|-473|-509|8|148|14|149|8|48|14|150|8|50|14|151|8|152|14|153|-1|-471|8|154|17|5|6|7|0|1|8|155|17|5|6|7|0|0|-523|-525|-1|-521|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}\"\n },\n {\n 'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:lo_category_var_name], \"re\" => opts[:lo_category_var_regexp]}\n ]\n }\n )\n\n #@request.add(\"DEBUG/lo_category_var_name/%%_#{opts[:lo_category_var_name]}%%\", {}, {'subst' => 'true'})\n\n @request.add_thinktime(2)\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/LoCategoryRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|4|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|AC3B9DCF992DD862E331BCB0704203E2|org.kuali.student.lum.common.client.lo.rpc.LoCategoryRpcService|getLoCategoryTypes|1|2|3|4|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|335FF062A700107AB2A642B325C6C5C5|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementTypeForCourse|java.lang.String/2004016611|kuali.statement.type.course|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|getCourseStatements|java.lang.String/2004016611|%%_#{opts[:clu_ref_dyn_var_name]}%%|KUALI.RULE|en|1|2|3|4|3|5|5|5|6|7|8|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n #\n # Course Requisites\n # Save without editing anything\n\n @request.add_thinktime(5)\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|10|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|storeCourseStatements|java.lang.String/2004016611|java.util.Map|%%_#{opts[:clu_ref_dyn_var_name]}%%|draft|java.util.HashMap/962170901|java.util.LinkedHashMap/1551059846|1|2|3|4|4|5|5|6|6|7|8|9|0|10|0|0|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|335FF062A700107AB2A642B325C6C5C5|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementTypeForCourse|java.lang.String/2004016611|kuali.statement.type.course|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|getCourseStatements|java.lang.String/2004016611|%%_#{opts[:clu_ref_dyn_var_name]}%%|KUALI.RULE|en|1|2|3|4|3|5|5|5|6|7|8|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n #\n # Active Dates\n # Start = Fall Sem 2008\n #\n\n @request.add_thinktime(10)\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|20|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|atp.advancedAtpSearchParam.atpType|java.lang.String/2004016611|kuali.atp.type.Spring|kuali.atp.type.Summer|kuali.atp.type.Fall|kuali.atp.type.Session1|kuali.atp.type.Session2|kuali.atp.type.Mini-mester1A|kuali.atp.type.Mini-mester1B|atp.advancedAtpSearchParam.atpStartDateAtpConstraintId|kuali.atp.FA2008-2009|atp.search.advancedAtpSearch|atp.resultColumn.atpStartDate|1|2|3|4|1|5|5|0|0|6|2|7|8|6|7|9|10|9|11|9|12|9|13|9|14|9|15|9|16|0|7|17|0|18|19|20|0|0|\"\n }\n )\n\n # Save & Continue\n contents1 = \"5|0|162|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|A239E8C5A2EDCD8BCE6061BF191A8095|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loCategoryInfoList|id|%%_#{opts[:lo_category_id_var_name]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|createId|admin|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|0|name|#{opts[:lo_category]}|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|desc|formatted|#{opts[:lo_cat_text]}|plain|%%_#{opts[:lo_category_var_name]}%%|loRepositoryKey|#{opts[:propose_person]}|SINGLE USE LO|draft|kuali.lo.type.singleUse|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|expenditure|affiliatedOrgs|fees|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|10|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|1|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|3|pilotCourse|revenues|specialTopicsCourse|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|%%_#{opts[:admin_dep_var_name]}%%|#{admin_org}|variations|versionInfo|currentVersionStart|sequenceNumber|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Standard final Exam|dirty|startTerm|endTerm|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|5|#{opts[:proposal_title]}|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators|kuali.atp.FA2008-2009\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|29|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|30|14|31|8|32|14|33|8|34|17|5|6|7|0|5|8|35|14|36|8|37|38|39|3759152200|1288490188800|0|8|40|14|36|8|41|38|39|3759152200|1288490188800|0|8|42|14|43|-45|-51|8|44|14|45|8|46|14|47|8|48|14|49|-41|-43|-37|-39|8|50|17|5|6|7|0|0|-37|-73|8|51|17|5|6|7|0|8|8|52|14|43|8|53|17|5|6|7|0|2|8|54|14|55|8|56|14|55|-79|-83|8|30|14|57|8|58|14|33|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1864356667|1314259992576|243000000|8|40|14|59|8|41|38|39|1864356667|1314259992576|243000000|8|42|14|43|-79|-95|8|44|14|60|8|46|14|61|8|48|14|62|-37|-77|-33|-35|-1|-31|8|63|14|64|8|65|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|66|14|67|8|30|14|68|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1861297882|1314259992576|458000000|8|40|14|59|8|41|38|39|1861297882|1314259992576|458000000|8|42|14|43|-125|-131|8|69|17|5|6|7|0|1|18|-15|14|67|-125|-147|8|46|14|61|8|48|14|70|8|21|17|5|6|7|0|1|8|48|17|5|6|7|0|1|8|22|14|71|-159|-161|-125|-157|-121|-123|-1|-119|8|72|17|5|6|7|0|0|-1|-167|8|73|17|5|6|7|0|1|8|56|14|74|-1|-171|8|75|17|5|6|7|0|3|8|76|14|77|8|78|79|19|2|8|21|17|5|6|7|0|1|8|76|17|5|6|7|0|1|8|22|14|80|-188|-190|-179|-186|-1|-177|8|81|17|5|6|7|0|1|8|82|17|5|6|7|0|0|-198|-200|-1|-196|8|83|17|5|6|7|0|0|-1|-204|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|85|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|86|14|87|8|88|17|5|6|7|0|3|8|89|14|90|8|91|14|92|8|21|17|5|6|7|0|1|8|91|17|5|6|7|0|1|8|22|14|93|-236|-238|-228|-234|-222|-226|8|94|79|19|100|8|75|17|5|6|7|0|3|8|76|14|95|8|78|79|19|13|8|21|17|5|6|7|0|1|8|76|17|5|6|7|0|1|8|22|14|96|-258|-260|-249|-256|-222|-247|8|30|14|97|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1861297868|1314259992576|444000000|8|40|14|59|8|41|38|39|1864356631|1314259992576|207000000|8|42|14|98|-222|-268|8|46|14|61|8|99|17|5|6|7|0|0|-222|-286|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|100|-292|-294|-222|-290|-218|-220|-214|-216|8|30|14|101|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1861297859|1314259992576|435000000|8|40|14|59|8|41|38|39|1864356620|1314259992576|196000000|8|42|14|98|-214|-302|8|46|14|61|8|102|17|5|6|7|0|0|-214|-320|8|48|14|103|-210|-212|-1|-208|8|104|17|5|6|7|0|2|18|-15|14|105|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|106|-334|-336|-328|-332|-1|-326|8|30|14|107|8|108|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|109|14|110|8|21|17|5|6|7|0|1|8|109|17|5|6|7|0|1|8|22|14|111|-356|-358|-350|-354|-346|-348|-1|-344|8|112|17|5|6|7|0|0|-1|-364|8|113|14|114|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1854995943|1314259992576|519000000|8|40|14|59|8|41|38|39|1864356597|1314259992576|173000000|8|42|14|115|-1|-370|8|116|10|-5|8|117|17|5|6|7|0|0|-1|-388|8|118|10|-5|8|46|14|61|8|119|14|120|8|102|17|5|6|7|0|2|18|-15|14|121|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|122|-406|-408|-400|-404|-1|-398|8|123|14|124|8|48|14|125|8|99|17|5|6|7|0|2|18|-15|14|126|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|127|-426|-428|-420|-424|-1|-418|8|128|17|5|6|7|0|2|18|-15|14|129|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|130|-442|-444|-436|-440|-1|-434|8|131|17|5|6|7|0|0|-1|-450|8|132|17|5|6|7|0|3|8|133|38|39|1854995943|1314259992576|519000000|8|134|135|136|1|0|8|137|14|138|-1|-454|8|21|17|5|6|7|0|3|8|119|17|5|6|7|0|1|8|22|14|120|-468|-470|8|13|17|5|6|7|0|1|8|22|14|139|-468|-476|8|140|17|5|6|7|0|2|8|141|10|11|1|8|142|10|-488|-468|-482|-1|-466|8|143|17|5|6|7|0|12|8|144|14|145|8|30|14|146|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1854996146|1314259992576|722000000|8|40|14|59|8|41|38|39|1864357928|1314259992576|504000000|8|42|14|147|-493|-499|8|44|14|148|8|149|17|5|6|7|0|1|18|-15|14|107|-493|-517|8|150|14|151|8|152|17|5|6|7|0|0|-493|-525|8|153|17|5|6|7|0|0|-493|-529|8|154|14|155|8|46|14|156|8|48|14|157|8|158|14|159|-1|-491|8|160|17|5|6|7|0|1|8|161|17|5|6|7|0|0|-543|-545|-1|-541|-486|14|162|-489|14|0|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n \n #\n # Financials\n # $100 lab fee\n # Admin org 100% rev and exp\n #\n\n @request.add_thinktime(5)\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.fee.feeType|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n # Revenue - Admin Org\n for i in 1..admin_org.length\n itr = i-1\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|16|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|org.queryParam.orgOptionalLongName|#{admin_org[0..itr]}|org.queryParam.orgOptionalType|java.lang.String/2004016611|kuali.org.Department|kuali.org.College|org.search.generic||1|2|3|4|1|5|5|0|6|0|7|2|8|9|0|10|8|11|7|2|12|13|12|14|0|15|16|0|0|\"\n } \n ) \n end\n\n @request.add_thinktime(5)\n\n # Expense - Admin Org\n for i in 1..admin_org.length\n itr = i-1\n if(i == admin_org.length)\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|16|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|org.queryParam.orgOptionalLongName|#{admin_org[0..itr]}|org.queryParam.orgOptionalType|java.lang.String/2004016611|kuali.org.Department|kuali.org.College|org.search.generic||1|2|3|4|1|5|5|0|6|0|7|2|8|9|0|10|8|11|7|2|12|13|12|14|0|15|16|0|0|\"\n },\n {\n :dyn_variables => [\n {\"name\" => opts[:admin_dep_var_name], \"re\" => opts[:admin_dep_var_regexp]}\n ]\n } \n )\n else\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|16|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|org.queryParam.orgOptionalLongName|#{admin_org[0..itr]}|org.queryParam.orgOptionalType|java.lang.String/2004016611|kuali.org.Department|kuali.org.College|org.search.generic||1|2|3|4|1|5|5|0|6|0|7|2|8|9|0|10|8|11|7|2|12|13|12|14|0|15|16|0|0|\"\n } \n )\n end \n end\n\n #@request.add(\"DEBUG/admin_dep_var_name/%%_#{opts[:admin_dep_var_name]}%%\", {}, {'subst' => 'true'})\n\n @request.add_thinktime(20)\n\n # Save & Continue\n contents1 = \"5|0|173|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|A239E8C5A2EDCD8BCE6061BF191A8095|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loCategoryInfoList|id|%%_#{opts[:lo_category_id_var_name]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|createId|admin|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|0|name|#{opts[:lo_category]}|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|desc|formatted|#{opts[:lo_cat_text]}|plain|%%_#{opts[:lo_category_var_name]}%%|loRepositoryKey|#{opts[:propose_person]}|1|SINGLE USE LO|draft|kuali.lo.type.singleUse|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|effectiveDate|expenditure|affiliatedOrgs|dirty|orgId|percentage|created|%%_#{opts[:admin_dep_var_name]}%%|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|fees|feeType|rateType|kuali.enum.type.feeTypes.labFee|fixedRateFee|feeAmounts|currencyQuantity|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|10|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|2|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|4|pilotCourse|revenues|specialTopicsCourse|startTerm|kuali.atp.FA2008-2009|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|#{admin_org}|variations|versionInfo|currentVersionStart|sequenceNumber|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Fall Semester of 2008|Standard final Exam|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|6|#{opts[:proposal_title]}|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|29|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|30|14|31|8|32|14|33|8|34|17|5|6|7|0|5|8|35|14|36|8|37|38|39|3759152200|1288490188800|0|8|40|14|36|8|41|38|39|3759152200|1288490188800|0|8|42|14|43|-45|-51|8|44|14|45|8|46|14|47|8|48|14|49|-41|-43|-37|-39|8|50|17|5|6|7|0|0|-37|-73|8|51|17|5|6|7|0|8|8|52|14|43|8|53|17|5|6|7|0|2|8|54|14|55|8|56|14|55|-79|-83|8|30|14|57|8|58|14|33|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1864356667|1314259992576|243000000|8|40|14|59|8|41|38|39|1866434943|1314259992576|519000000|8|42|14|60|-79|-95|8|44|14|61|8|46|14|62|8|48|14|63|-37|-77|-33|-35|-1|-31|8|64|14|65|8|66|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|67|14|68|8|30|14|69|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1861297882|1314259992576|458000000|8|40|14|59|8|41|38|39|1861297882|1314259992576|458000000|8|42|14|43|-125|-131|8|70|17|5|6|7|0|1|18|-15|14|68|-125|-147|8|46|14|62|8|48|14|71|8|21|17|5|6|7|0|1|8|48|17|5|6|7|0|1|8|22|14|72|-159|-161|-125|-157|-121|-123|-1|-119|8|73|17|5|6|7|0|0|-1|-167|8|74|17|5|6|7|0|1|8|56|14|75|-1|-171|8|76|17|5|6|7|0|3|8|77|14|78|8|79|80|19|2|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|81|-188|-190|-179|-186|-1|-177|8|82|38|39|470887936|1219770712064|0|8|83|17|5|6|7|0|1|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|21|17|5|6|7|0|3|8|85|17|5|6|7|0|2|8|86|10|11|1|8|87|10|-221|-213|-215|8|88|10|-221|-211|17|5|6|7|0|1|-215|17|5|6|7|0|1|-224|10|-221|-227|-215|-213|-211|-209|-211|-219|14|89|-222|90|91|100|0|-205|-207|-201|-203|-1|-199|8|92|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|-211|17|5|6|7|0|3|-215|17|5|6|7|0|2|8|93|10|-221|8|94|10|-221|-245|-215|8|88|10|-221|-211|17|5|6|7|0|1|-215|17|5|6|7|0|1|-254|10|-221|-257|-215|-245|-211|-242|-211|-250|14|95|-252|14|96|8|97|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|98|80|19|100|-211|17|5|6|7|0|1|-215|17|5|6|7|0|1|-273|10|-221|-277|-215|-271|-211|-267|-269|-242|-265|-238|-240|-1|-236|8|99|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|100|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|101|14|102|8|103|17|5|6|7|0|3|8|104|14|105|8|106|14|107|8|21|17|5|6|7|0|1|8|106|17|5|6|7|0|1|8|22|14|108|-311|-313|-303|-309|-297|-301|8|109|80|-275|8|76|17|5|6|7|0|3|8|77|14|110|8|79|80|19|13|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|111|-332|-334|-323|-330|-297|-321|8|30|14|112|8\"\n contents3 = \"|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1861297868|1314259992576|444000000|8|40|14|59|8|41|38|39|1866434894|1314259992576|470000000|8|42|14|113|-297|-342|8|46|14|62|8|114|17|5|6|7|0|0|-297|-360|8|21|17|5|6|7|0|1|8|101|17|5|6|7|0|1|8|22|14|115|-366|-368|-297|-364|-293|-295|-289|-291|8|30|14|116|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1861297859|1314259992576|435000000|8|40|14|59|8|41|38|39|1866434884|1314259992576|460000000|8|42|14|113|-289|-376|8|46|14|62|8|117|17|5|6|7|0|0|-289|-394|8|48|14|118|-285|-287|-1|-283|8|119|17|5|6|7|0|2|18|-15|14|120|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|121|-408|-410|-402|-406|-1|-400|8|30|14|122|8|123|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|124|14|125|8|21|17|5|6|7|0|1|8|124|17|5|6|7|0|1|8|22|14|126|-430|-432|-424|-428|-420|-422|-1|-418|8|127|17|5|6|7|0|0|-1|-438|8|128|14|129|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1854995943|1314259992576|519000000|8|40|14|59|8|41|38|39|1866434860|1314259992576|436000000|8|42|14|130|-1|-444|8|131|10|-5|8|132|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|-211|17|5|6|7|0|1|-215|17|5|6|7|0|2|8|86|10|-221|8|87|10|-221|-479|-215|-476|-211|-484|14|89|-486|90|-235|-472|-474|-468|-470|8|21|17|5|6|7|0|2|8|88|10|-221|-211|17|5|6|7|0|1|-215|17|5|6|7|0|1|-494|10|-221|-497|-215|-492|-211|-468|-490|-464|-466|-1|-462|8|133|10|-5|8|134|14|135|8|46|14|62|8|136|14|137|8|117|17|5|6|7|0|2|18|-15|14|138|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|139|-519|-521|-513|-517|-1|-511|8|140|14|141|8|48|14|142|8|114|17|5|6|7|0|2|18|-15|14|143|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|144|-539|-541|-533|-537|-1|-531|8|145|17|5|6|7|0|2|18|-15|14|89|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|146|-555|-557|-549|-553|-1|-547|8|147|17|5|6|7|0|0|-1|-563|8|148|17|5|6|7|0|3|8|149|38|39|1854995943|1314259992576|519000000|8|150|90|91|1|0|8|151|14|152|-1|-567|8|21|17|5|6|7|0|3|8|134|17|5|6|7|0|1|8|22|14|153|-581|-583|8|136|17|5|6|7|0|1|8|22|14|137|-581|-589|8|13|17|5|6|7|0|1|8|22|14|154|-581|-595|-1|-579|8|155|17|5|6|7|0|12|8|156|14|157|8|30|14|158|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1854996146|1314259992576|722000000|8|40|14|59|8|41|38|39|1866435719|1314259992576|295000000|8|42|14|159|-603|-609|8|44|14|160|8|161|17|5|6|7|0|1|18|-15|14|122|-603|-627|8|162|14|163|8|164|17|5|6|7|0|0|-603|-635|8|165|17|5|6|7|0|0|-603|-639|8|166|14|167|8|46|14|168|8|48|14|169|8|170|14|171|-1|-601|8|172|17|5|6|7|0|1|8|173|17|5|6|7|0|0|-653|-655|-1|-651|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}#{contents3}\"\n },\n {\n 'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:affliated_orgs_id_name], \"re\" => opts[:affliated_orgs_id_regexp]},\n {\"name\" => opts[:lab_fee_id_name], \"re\" => opts[:lab_fee_id_regexp]},\n {\"name\" => opts[:revenues_id_name], \"re\" => opts[:revenues_id_regexp]},\n {\"name\" => opts[:revenue_id_name], \"re\" => opts[:revenue_id_regexp]}\n ]\n }\n )\n\n #@request.add(\"DEBUG/affliated_orgs_id_name/%%_#{opts[:affliated_orgs_id_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/lab_fee_id_name/%%_#{opts[:lab_fee_id_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/revenues_id_name/%%_#{opts[:revenues_id_name]}%%\", {}, {'subst' => 'true'})\n #@request.add(\"DEBUG/revenue_id_name/%%_#{opts[:revenue_id_name]}%%\", {}, {'subst' => 'true'})\n\n @request.add_thinktime(2)\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|isAuthorizedAddReviewer|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|isAuthorizedRemoveReviewers|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n \n #\n # Authors and Collaborators\n #\n\n @request.add_thinktime(5)\n\n if(!opts[:collaborator].nil?)\n # Collaborator seach\n for i in 1..opts[:collaborator].length\n itr = i-1\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|14|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|person.queryParam.personGivenName|#{opts[:collaborator][0..itr]}|person.queryParam.excludedUserId|psycho1|person.search.personQuickViewByGivenName|person.resultColumn.DisplayName|1|2|3|4|1|5|5|0|6|0|7|2|8|9|0|10|8|11|0|12|13|14|0|0|\"\n } \n ) \n end\n\n @request.add_thinktime(5)\n\n\n contents1 = \"5|0|192|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|A239E8C5A2EDCD8BCE6061BF191A8095|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loCategoryInfoList|id|%%_#{opts[:lo_category_id_var_name]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|createId|admin|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|0|name|#{opts[:lo_category]}|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|desc|formatted|#{opts[:lo_cat_text]}|plain|%%_#{opts[:lo_category_var_name]}%%|loRepositoryKey|#{opts[:propose_person]}|2|SINGLE USE LO|draft|kuali.lo.type.singleUse|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|effectiveDate|expenditure|affiliatedOrgs|%%_#{opts[:affliated_orgs_id_name]}%%|orgId|%%_#{opts[:admin_dep_var_name]}%%|percentage|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|#{admin_org}|fees|feeAmounts|currencyQuantity|currencyTypeKey|kuali.currency.type.usdollars.cents|feeType|kuali.enum.type.feeTypes.labFee|%%_#{opts[:lab_fee_id_name]}%%|1|rateType|fixedRateFee|Fixed Rate Fee|Laboratory Fee|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|10|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|3|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|5|pilotCourse|revenues|%%_#{opts[:revenues_id_name]}%%|REVENUE|%%_#{opts[:revenue_id_name]}%%|specialTopicsCourse|startTerm|kuali.atp.FA2008-2009|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|variations|versionInfo|currentVersionStart|sequenceNumber|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Fall Semester of 2008|Standard final Exam|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|7|#{opts[:proposal_title]}|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators|principalId|#{opts[:collaborator]}|permission|KS-SYS~Edit Document|action|F|firstName|lastName|actionRequestStatus|New|author\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|29|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|30|14|31|8|32|14|33|8|34|17|5|6|7|0|5|8|35|14|36|8|37|38|39|3759152200|1288490188800|0|8|40|14|36|8|41|38|39|3759152200|1288490188800|0|8|42|14|43|-45|-51|8|44|14|45|8|46|14|47|8|48|14|49|-41|-43|-37|-39|8|50|17|5|6|7|0|0|-37|-73|8|51|17|5|6|7|0|8|8|52|14|43|8|53|17|5|6|7|0|2|8|54|14|55|8|56|14|55|-79|-83|8|30|14|57|8|58|14|33|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1864356667|1314259992576|243000000|8|40|14|59|8|41|38|39|1867163616|1314259992576|192000000|8|42|14|60|-79|-95|8|44|14|61|8|46|14|62|8|48|14|63|-37|-77|-33|-35|-1|-31|8|64|14|65|8|66|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|67|14|68|8|30|14|69|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1861297882|1314259992576|458000000|8|40|14|59|8|41|38|39|1861297882|1314259992576|458000000|8|42|14|43|-125|-131|8|70|17|5|6|7|0|1|18|-15|14|68|-125|-147|8|46|14|62|8|48|14|71|8|21|17|5|6|7|0|1|8|48|17|5|6|7|0|1|8|22|14|72|-159|-161|-125|-157|-121|-123|-1|-119|8|73|17|5|6|7|0|0|-1|-167|8|74|17|5|6|7|0|1|8|56|14|75|-1|-171|8|76|17|5|6|7|0|3|8|77|14|78|8|79|80|19|2|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|81|-188|-190|-179|-186|-1|-177|8|82|38|39|470887936|1219770712064|0|8|83|17|5|6|7|0|1|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|85|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-220|-222|-209|-218|-205|-207|-201|-203|-1|-199|8|92|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|93|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|94|80|19|100|8|95|14|96|-238|-240|-234|-236|8|97|14|98|8|30|14|99|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1867163501|1314259992576|77000000|8|40|14|59|8|41|38|39|1867163502|1314259992576|78000000|8|42|14|100|-234|-253|8|101|14|102|8|21|17|5|6|7|0|2|8|101|17|5|6|7|0|1|8|22|14|103|-273|-275|8|97|17|5|6|7|0|1|8|22|14|104|-273|-281|-234|-271|-230|-232|-1|-228|8|105|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|106|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|107|14|108|8|109|17|5|6|7|0|3|8|110|14|111|8|112|14|113|8|21|17|5|6|7|0|1|8|112|17|5|6|7|0|1|8|22|14|114|-315|-317|-307|-313|-301|-305|8|115|80|-246|8|76|17|5|6|7|0|3|8|77|14|116|8|79|80|19|13|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|117|-336|-338|-327|-334|-301|-325|8|30|14|118|8|34|17|5|6|7|0|5|8|35|14|59|8|37\"\n contents3 = \"|38|39|1861297868|1314259992576|444000000|8|40|14|59|8|41|38|39|1867163581|1314259992576|157000000|8|42|14|119|-301|-346|8|46|14|62|8|120|17|5|6|7|0|0|-301|-364|8|21|17|5|6|7|0|1|8|107|17|5|6|7|0|1|8|22|14|121|-370|-372|-301|-368|-297|-299|-293|-295|8|30|14|122|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1861297859|1314259992576|435000000|8|40|14|59|8|41|38|39|1867163562|1314259992576|138000000|8|42|14|119|-293|-380|8|46|14|62|8|123|17|5|6|7|0|0|-293|-398|8|48|14|124|-289|-291|-1|-287|8|125|17|5|6|7|0|2|18|-15|14|126|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|127|-412|-414|-406|-410|-1|-404|8|30|14|128|8|129|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|130|14|131|8|21|17|5|6|7|0|1|8|130|17|5|6|7|0|1|8|22|14|132|-434|-436|-428|-432|-424|-426|-1|-422|8|133|17|5|6|7|0|0|-1|-442|8|134|14|135|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1854995943|1314259992576|519000000|8|40|14|59|8|41|38|39|1867163502|1314259992576|78000000|8|42|14|136|-1|-448|8|137|10|-5|8|138|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|139|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-491|-493|-480|-489|-476|-478|-472|-474|8|97|14|140|8|30|14|141|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1867163501|1314259992576|77000000|8|40|14|59|8|41|38|39|1867163502|1314259992576|78000000|8|42|14|100|-472|-503|-468|-470|-1|-466|8|142|10|-5|8|143|14|144|8|46|14|62|8|145|14|146|8|123|17|5|6|7|0|2|18|-15|14|147|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|148|-535|-537|-529|-533|-1|-527|8|149|14|150|8|48|14|151|8|120|17|5|6|7|0|2|18|-15|14|152|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|153|-555|-557|-549|-553|-1|-547|8|154|17|5|6|7|0|2|18|-15|14|87|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|91|-571|-573|-565|-569|-1|-563|8|155|17|5|6|7|0|0|-1|-579|8|156|17|5|6|7|0|3|8|157|38|39|1854995943|1314259992576|519000000|8|158|89|90|1|0|8|159|14|160|-1|-583|8|21|17|5|6|7|0|3|8|143|17|5|6|7|0|1|8|22|14|161|-597|-599|8|145|17|5|6|7|0|1|8|22|14|146|-597|-605|8|13|17|5|6|7|0|1|8|22|14|162|-597|-611|-1|-595|8|163|17|5|6|7|0|12|8|164|14|165|8|30|14|166|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1854996146|1314259992576|722000000|8|40|14|59|8|41|38|39|1867164349|1314259992576|925000000|8|42|14|167|-619|-625|8|44|14|168|8|169|17|5|6|7|0|1|18|-15|14|128|-619|-643|8|170|14|171|8|172|17|5|6|7|0|0|-619|-651|8|173|17|5|6|7|0|0|-619|-655|8|174|14|175|8|46|14|176|8|48|14|177|8|178|14|179|-1|-617|8|180|17|5|6|7|0|1|8|181|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|182|14|183|8|184|14|185|8|186|14|187|8|188|14|183|8|189|14|183|8|190|14|191|8|192|10|-5|-673|-675|-669|-671|-1|-667|0|0|\"\n else\n # UPDATE\n contents1 = \"5|0|179|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D60D3C6E0D395C18A0F44A2D9D2A7348|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loCategoryInfoList|id|%%_#{opts[:lo_category_id_var_name]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|createId|admin|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|0|name|#{opts[:lo_category]}|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|desc|formatted|#{opts[:lo_cat_text]}|plain|%%_#{opts[:lo_category_var_name]}%%|loRepositoryKey|#{opts[:propose_person]}|2|SINGLE USE LO|draft|kuali.lo.type.singleUse|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|effectiveDate|expenditure|affiliatedOrgs|%%_#{opts[:affliated_orgs_id_name]}%%|orgId|%%_#{opts[:admin_dep_var_name]}%%|percentage|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|#{admin_org}|fees|feeAmounts|currencyQuantity|currencyTypeKey|kuali.currency.type.usdollars.cents|feeType|kuali.enum.type.feeTypes.labFee|%%_#{opts[:lab_fee_id_name]}%%|1|rateType|fixedRateFee|Fixed Rate Fee|Laboratory Fee|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|5|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|3|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|pilotCourse|revenues|%%_#{opts[:revenues_id_name]}%%|REVENUE|%%_#{opts[:revenue_id_name]}%%|specialTopicsCourse|startTerm|kuali.atp.FA2008-2009|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|variations|versionInfo|currentVersionStart|sequenceNumber|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Fall Semester of 2008|Standard final Exam|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|7|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|29|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|30|14|31|8|32|14|33|8|34|17|5|6|7|0|5|8|35|14|36|8|37|38|39|3759152200|1288490188800|0|8|40|14|36|8|41|38|39|3759152200|1288490188800|0|8|42|14|43|-45|-51|8|44|14|45|8|46|14|47|8|48|14|49|-41|-43|-37|-39|8|50|17|5|6|7|0|0|-37|-73|8|51|17|5|6|7|0|8|8|52|14|43|8|53|17|5|6|7|0|2|8|54|14|55|8|56|14|55|-79|-83|8|30|14|57|8|58|14|33|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491266071|1309965025280|351000000|8|40|14|59|8|41|38|39|3491272352|1309965025280|632000000|8|42|14|60|-79|-95|8|44|14|61|8|46|14|62|8|48|14|63|-37|-77|-33|-35|-1|-31|8|64|14|65|8|66|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|67|14|68|8|30|14|69|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3479039543|1309965025280|823000000|8|40|14|59|8|41|38|39|3479039543|1309965025280|823000000|8|42|14|43|-125|-131|8|70|17|5|6|7|0|1|18|-15|14|68|-125|-147|8|46|14|62|8|48|14|71|8|21|17|5|6|7|0|1|8|48|17|5|6|7|0|1|8|22|14|72|-159|-161|-125|-157|-121|-123|-1|-119|8|73|17|5|6|7|0|0|-1|-167|8|74|17|5|6|7|0|1|8|56|14|75|-1|-171|8|76|17|5|6|7|0|3|8|77|14|78|8|79|80|19|2|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|81|-188|-190|-179|-186|-1|-177|8|82|38|39|470887936|1219770712064|0|8|83|17|5|6|7|0|1|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|85|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-220|-222|-209|-218|-205|-207|-201|-203|-1|-199|8|92|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|93|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|94|80|19|100|8|95|14|96|-238|-240|-234|-236|8|97|14|98|8|30|14|99|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491272235|1309965025280|515000000|8|40|14|59|8|41|38|39|3491272236|1309965025280|516000000|8|42|14|100|-234|-253|8|101|14|102|8|21|17|5|6|7|0|2|8|101|17|5|6|7|0|1|8|22|14|103|-273|-275|8|97|17|5|6|7|0|1|8|22|14|104|-273|-281|-234|-271|-230|-232|-1|-228|8|105|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|106|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|107|14|108|8|109|17|5|6|7|0|3|8|110|14|111|8|112|14|113|8|21|17|5|6|7|0|1|8|112|17|5|6|7|0|1|8|22|14|114|-315|-317|-307|-313|-301|-305|8|115|80|-246|8|76|17|5|6|7|0|3|8|77|14|116|8|79|80|19|13|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|117|-336|-338|-327|-334|-301|-325|8|30|14|118|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491262219|1309965025280|499000000|8|40|14|59|8|41|38|39|3491272295|1309965025280|575000000|8|42|14|119|-301|-346|8|46|14|62|8|120|17|5|6|7|0|0|-301|-364|8|21|17|5|6|7|0|1|8|107|17|5|6|7|0|1|8|22|14|121|-370|-372|-301|-368|-297|-299|-293|-295|8|30|14|122|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491262210|1309965025280|490000000|8|40|14|59|8|41|38|39|3491272289|1309965025280|569000000|8|42|14|119|-293|-380|8|46|14|62|8|123|17|5|6|7|0|0|-293|-398|8|48|14|124|-289|-291|-1|-287|8|125|17|5|6|7|0|2|18|-15|14|126|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|127|-412|-414|-406|-410|-1|-404|8|30|14|128|8|129|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|130|14|131|8|21|17|5|6|7|0|1|8|130|17|5|6|7|0|1|8|22|14|132|-434|-436|-428\"\n contents3 = \"|-432|-424|-426|-1|-422|8|133|17|5|6|7|0|0|-1|-442|8|134|14|135|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491257291|1309965025280|571000000|8|40|14|59|8|41|38|39|3491272236|1309965025280|516000000|8|42|14|111|-1|-448|8|136|10|-5|8|137|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|138|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-491|-493|-480|-489|-476|-478|-472|-474|8|97|14|139|8|30|14|140|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491272233|1309965025280|513000000|8|40|14|59|8|41|38|39|3491272236|1309965025280|516000000|8|42|14|100|-472|-503|-468|-470|-1|-466|8|141|10|-5|8|142|14|143|8|46|14|62|8|144|14|145|8|123|17|5|6|7|0|2|18|-15|14|146|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|147|-535|-537|-529|-533|-1|-527|8|148|14|149|8|48|14|150|8|120|17|5|6|7|0|2|18|-15|14|151|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|152|-555|-557|-549|-553|-1|-547|8|153|17|5|6|7|0|2|18|-15|14|87|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|91|-571|-573|-565|-569|-1|-563|8|154|17|5|6|7|0|0|-1|-579|8|155|17|5|6|7|0|3|8|156|38|39|3491257291|1309965025280|571000000|8|157|89|90|1|0|8|158|14|159|-1|-583|8|21|17|5|6|7|0|3|8|142|17|5|6|7|0|1|8|22|14|160|-597|-599|8|144|17|5|6|7|0|1|8|22|14|145|-597|-605|8|13|17|5|6|7|0|1|8|22|14|161|-597|-611|-1|-595|8|162|17|5|6|7|0|12|8|163|14|164|8|30|14|165|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3491257553|1309965025280|833000000|8|40|14|59|8|41|38|39|3491273130|1309965025280|410000000|8|42|14|166|-619|-625|8|44|14|65|8|167|17|5|6|7|0|1|18|-15|14|128|-619|-643|8|168|14|169|8|170|17|5|6|7|0|0|-619|-651|8|171|17|5|6|7|0|0|-619|-655|8|172|14|173|8|46|14|174|8|48|14|175|8|176|14|177|-1|-617|8|178|17|5|6|7|0|1|8|179|17|5|6|7|0|0|-669|-671|-1|-667|0|0|\"\n end\n\n # Save & Continue\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}#{contents3}\"\n },\n {\n 'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:action_request_id_name], \"re\" => opts[:action_request_id_regexp]}\n ]\n }\n )\n \n #@request.add(\"DEBUG/affliated_orgs_id_name/%%_#{opts[:action_request_id_name]}%%\", {}, {'subst' => 'true'})\n \n \n @request.add_thinktime(2)\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/DocumentRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5771428875B68D3E8EC7527EC8D18D40|org.kuali.student.core.document.ui.client.service.DocumentRpcService|isAuthorizedUploadDocuments|java.lang.String/2004016611|%%_#{opts[:proposal_dyn_var_name]}%%|referenceType.clu.proposal|1|2|3|4|2|5|5|6|7|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/DocumentRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5771428875B68D3E8EC7527EC8D18D40|org.kuali.student.core.document.ui.client.service.DocumentRpcService|getRefDocIdsForRef|java.lang.String/2004016611|kuali.org.RefObjectType.ProposalInfo|%%_#{opts[:proposal_dyn_var_name]}%%|1|2|3|4|2|5|5|6|7|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n \n \n #\n # Support Documents\n # Nothing uploaded\n #\n\n @request.add_thinktime(5)\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/DocumentRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5771428875B68D3E8EC7527EC8D18D40|org.kuali.student.core.document.ui.client.service.DocumentRpcService|getRefDocIdsForRef|java.lang.String/2004016611|kuali.org.RefObjectType.ProposalInfo|%%_#{opts[:proposal_dyn_var_name]}%%|1|2|3|4|2|5|5|6|7|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n\n if(!opts[:collaborator].nil?)\n contents1 = \"5|0|195|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|validate|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loCategoryInfoList|id|%%_#{opts[:lo_category_id_var_name]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|createId|admin|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|0|name|#{opts[:lo_category]}|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|desc|formatted|#{opts[:lo_cat_text]}|plain|%%_#{opts[:lo_category_var_name]}%%|loRepositoryKey|#{opts[:propose_person]}|3|SINGLE USE LO|draft|kuali.lo.type.singleUse|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|effectiveDate|expenditure|affiliatedOrgs|%%_#{opts[:affliated_orgs_id_name]}%%|orgId|%%_#{opts[:admin_dep_var_name]}%%|percentage|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|#{admin_org}|fees|feeAmounts|currencyQuantity|currencyTypeKey|kuali.currency.type.usdollars.cents|feeType|kuali.enum.type.feeTypes.labFee|%%_#{opts[:lab_fee_id_name]}%%|2|rateType|fixedRateFee|Fixed Rate Fee|Laboratory Fee|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|10|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|4|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|6|pilotCourse|revenues|%%_#{opts[:revenues_id_name]}%%|REVENUE|%%_#{opts[:revenue_id_name]}%%|specialTopicsCourse|startTerm|kuali.atp.FA2008-2009|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|variations|versionInfo|currentVersionStart|sequenceNumber|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Fall Semester of 2008|Standard final Exam|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|8|#{opts[:proposal_title]}|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators|action|F|actionRequestId|%%_#{opts[:action_request_id_name]}%%|actionRequestStatus|Active|author|canRevokeRequest|firstName|#{opts[:collaborator]}|lastName|permission|KS-SYS~Edit Document|principalId\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|29|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|30|14|31|8|32|14|33|8|34|17|5|6|7|0|5|8|35|14|36|8|37|38|39|3759152200|1288490188800|0|8|40|14|36|8|41|38|39|3759152200|1288490188800|0|8|42|14|43|-45|-51|8|44|14|45|8|46|14|47|8|48|14|49|-41|-43|-37|-39|8|50|17|5|6|7|0|0|-37|-73|8|51|17|5|6|7|0|8|8|52|14|43|8|53|17|5|6|7|0|2|8|54|14|55|8|56|14|55|-79|-83|8|30|14|57|8|58|14|33|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1864356667|1314259992576|243000000|8|40|14|59|8|41|38|39|1868678977|1314259992576|553000000|8|42|14|60|-79|-95|8|44|14|61|8|46|14|62|8|48|14|63|-37|-77|-33|-35|-1|-31|8|64|14|65|8|66|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|67|14|68|8|30|14|69|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1861297882|1314259992576|458000000|8|40|14|59|8|41|38|39|1861297882|1314259992576|458000000|8|42|14|43|-125|-131|8|70|17|5|6|7|0|1|18|-15|14|68|-125|-147|8|46|14|62|8|48|14|71|8|21|17|5|6|7|0|1|8|48|17|5|6|7|0|1|8|22|14|72|-159|-161|-125|-157|-121|-123|-1|-119|8|73|17|5|6|7|0|0|-1|-167|8|74|17|5|6|7|0|1|8|56|14|75|-1|-171|8|76|17|5|6|7|0|3|8|77|14|78|8|79|80|19|2|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|81|-188|-190|-179|-186|-1|-177|8|82|38|39|470887936|1219770712064|0|8|83|17|5|6|7|0|1|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|85|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-220|-222|-209|-218|-205|-207|-201|-203|-1|-199|8|92|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|93|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|94|80|19|100|8|95|14|96|-238|-240|-234|-236|8|97|14|98|8|30|14|99|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1867163501|1314259992576|77000000|8|40|14|59|8|41|38|39|1868678891|1314259992576|467000000|8|42|14|100|-234|-253|8|101|14|102|8|21|17|5|6|7|0|2|8|101|17|5|6|7|0|1|8|22|14|103|-273|-275|8|97|17|5|6|7|0|1|8|22|14|104|-273|-281|-234|-271|-230|-232|-1|-228|8|105|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|106|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|107|14|108|8|109|17|5|6|7|0|3|8|110|14|111|8|112|14|113|8|21|17|5|6|7|0|1|8|112|17|5|6|7|0|1|8|22|14|114|-315|-317|-307|-313|-301|-305|8|115|80|-246|8|76|17|5|6|7|0|3|8|77|14|116|8|79|80|19|13|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|117|-336|-338|-327|-334|-301|-325|8|30|14|118|8|34|17|5|6|7|0|5|8|35|14|59|8\"\n contents3 = \"|37|38|39|1861297868|1314259992576|444000000|8|40|14|59|8|41|38|39|1868678938|1314259992576|514000000|8|42|14|119|-301|-346|8|46|14|62|8|120|17|5|6|7|0|0|-301|-364|8|21|17|5|6|7|0|1|8|107|17|5|6|7|0|1|8|22|14|121|-370|-372|-301|-368|-297|-299|-293|-295|8|30|14|122|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1861297859|1314259992576|435000000|8|40|14|59|8|41|38|39|1868678932|1314259992576|508000000|8|42|14|119|-293|-380|8|46|14|62|8|123|17|5|6|7|0|0|-293|-398|8|48|14|124|-289|-291|-1|-287|8|125|17|5|6|7|0|2|18|-15|14|126|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|127|-412|-414|-406|-410|-1|-404|8|30|14|128|8|129|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|130|14|131|8|21|17|5|6|7|0|1|8|130|17|5|6|7|0|1|8|22|14|132|-434|-436|-428|-432|-424|-426|-1|-422|8|133|17|5|6|7|0|0|-1|-442|8|134|14|135|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1854995943|1314259992576|519000000|8|40|14|59|8|41|38|39|1868678891|1314259992576|467000000|8|42|14|136|-1|-448|8|137|10|-5|8|138|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|139|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-491|-493|-480|-489|-476|-478|-472|-474|8|97|14|140|8|30|14|141|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1867163501|1314259992576|77000000|8|40|14|59|8|41|38|39|1868678891|1314259992576|467000000|8|42|14|100|-472|-503|-468|-470|-1|-466|8|142|10|-5|8|143|14|144|8|46|14|62|8|145|14|146|8|123|17|5|6|7|0|2|18|-15|14|147|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|148|-535|-537|-529|-533|-1|-527|8|149|14|150|8|48|14|151|8|120|17|5|6|7|0|2|18|-15|14|152|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|153|-555|-557|-549|-553|-1|-547|8|154|17|5|6|7|0|2|18|-15|14|87|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|91|-571|-573|-565|-569|-1|-563|8|155|17|5|6|7|0|0|-1|-579|8|156|17|5|6|7|0|3|8|157|38|39|1854995943|1314259992576|519000000|8|158|89|90|1|0|8|159|14|160|-1|-583|8|21|17|5|6|7|0|3|8|143|17|5|6|7|0|1|8|22|14|161|-597|-599|8|145|17|5|6|7|0|1|8|22|14|146|-597|-605|8|13|17|5|6|7|0|1|8|22|14|162|-597|-611|-1|-595|8|163|17|5|6|7|0|12|8|164|14|165|8|30|14|166|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|1854996146|1314259992576|722000000|8|40|14|59|8|41|38|39|1868679626|1314259992576|202000000|8|42|14|167|-619|-625|8|44|14|168|8|169|17|5|6|7|0|1|18|-15|14|128|-619|-643|8|170|14|171|8|172|17|5|6|7|0|0|-619|-651|8|173|17|5|6|7|0|0|-619|-655|8|174|14|175|8|46|14|176|8|48|14|177|8|178|14|179|-1|-617|8|180|17|5|6|7|0|1|8|181|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|182|14|183|8|184|14|185|8|186|14|187|8|188|10|-5|8|189|10|11|1|8|190|14|191|8|192|14|191|8|193|14|194|8|195|14|191|-673|-675|-669|-671|-1|-667|0|0|\"\n else\n #UPDATE\n contents1 = \"5|0|180|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|1ED48DA6F48F82765FE7B58378EA94E0|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|validate|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|AL|_runtimeData|id-translation|All|code|#{opts[:subject_area]}#{opts[:course_suffix]}|courseNumberSuffix|#{opts[:course_suffix]}|courseSpecificLOs|loCategoryInfoList|id|%%_#{opts[:lo_category_id_var_name]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|createId|admin|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateId|updateTime|versionInd|0|name|#{opts[:lo_category]}|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|desc|formatted|#{opts[:lo_cat_text]}|plain|%%_#{opts[:lo_category_var_name]}%%|loRepositoryKey|#{opts[:propose_person]}|3|SINGLE USE LO|draft|kuali.lo.type.singleUse|courseTitle|#{opts[:course_title]}|creditOptions|fixedCreditValue|10.0|kuali.creditType.credit.degree.10.0|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|#{opts[:course_description]}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|effectiveDate|expenditure|affiliatedOrgs|%%_#{opts[:affliated_orgs_id_name]}%%|orgId|%%_#{opts[:admin_dep_var_name]}%%|percentage|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|#{admin_org}|fees|feeAmounts|currencyQuantity|currencyTypeKey|kuali.currency.type.usdollars.cents|feeType|kuali.enum.type.feeTypes.labFee|%%_#{opts[:lab_fee_id_name]}%%|2|rateType|fixedRateFee|Fixed Rate Fee|Laboratory Fee|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|5|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_duration_week_var_name]}%%|4|unitsContentOwner|Lab|%%_#{opts[:lab_var_name]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:clu_ref_dyn_var_name]}%%|instructors|personId|#{opts[:instructor]}|#{opts[:instructor]}, #{opts[:instructor]}(#{opts[:instructor]})|joints|level|100|6|pilotCourse|revenues|%%_#{opts[:revenues_id_name]}%%|REVENUE|%%_#{opts[:revenue_id_name]}%%|specialTopicsCourse|startTerm|kuali.atp.FA2008-2009|subjectArea|#{opts[:subject_area]}|kuali.atp.season.Any|Any|transcriptTitle|#{opts[:course_short_title]}|kuali.lu.type.CreditCourse|#{opts[:oversight_dept_number]}|#{oversight_department}|unitsDeployment|variations|versionInfo|currentVersionStart|sequenceNumber|versionIndId|%%_#{opts[:version_ind_id_name]}%%|Fall Semester of 2008|Standard final Exam|proposal|workflowNode|PreRoute|%%_#{opts[:proposal_dyn_var_name]}%%|8|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{opts[:course_rationale]}|Saved|kuali.proposal.type.course.create|workflowId|%%_#{opts[:proposal_doc_id_var_name]}%%|collaboratorInfo|collaborators\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|0|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|1|18|-15|17|5|6|7|0|3|8|29|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|30|14|31|8|32|14|33|8|34|17|5|6|7|0|5|8|35|14|36|8|37|38|39|3759152200|1288490188800|0|8|40|14|36|8|41|38|39|3759152200|1288490188800|0|8|42|14|43|-45|-51|8|44|14|45|8|46|14|47|8|48|14|49|-41|-43|-37|-39|8|50|17|5|6|7|0|0|-37|-73|8|51|17|5|6|7|0|8|8|52|14|43|8|53|17|5|6|7|0|2|8|54|14|55|8|56|14|55|-79|-83|8|30|14|57|8|58|14|33|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498783321|1309965025280|601000000|8|40|14|59|8|41|38|39|3498791687|1309965025280|967000000|8|42|14|60|-79|-95|8|44|14|61|8|46|14|62|8|48|14|63|-37|-77|-33|-35|-1|-31|8|64|14|65|8|66|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|67|14|68|8|30|14|69|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3479039543|1309965025280|823000000|8|40|14|59|8|41|38|39|3479039543|1309965025280|823000000|8|42|14|43|-125|-131|8|70|17|5|6|7|0|1|18|-15|14|68|-125|-147|8|46|14|62|8|48|14|71|8|21|17|5|6|7|0|1|8|48|17|5|6|7|0|1|8|22|14|72|-159|-161|-125|-157|-121|-123|-1|-119|8|73|17|5|6|7|0|0|-1|-167|8|74|17|5|6|7|0|1|8|56|14|75|-1|-171|8|76|17|5|6|7|0|3|8|77|14|78|8|79|80|19|2|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|81|-188|-190|-179|-186|-1|-177|8|82|38|39|470887936|1219770712064|0|8|83|17|5|6|7|0|1|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|85|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-220|-222|-209|-218|-205|-207|-201|-203|-1|-199|8|92|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|93|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|94|80|19|100|8|95|14|96|-238|-240|-234|-236|8|97|14|98|8|30|14|99|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498789104|1309965025280|384000000|8|40|14|59|8|41|38|39|3498791612|1309965025280|892000000|8|42|14|100|-234|-253|8|101|14|102|8|21|17|5|6|7|0|2|8|101|17|5|6|7|0|1|8|22|14|103|-273|-275|8|97|17|5|6|7|0|1|8|22|14|104|-273|-281|-234|-271|-230|-232|-1|-228|8|105|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|106|17|5|6|7|0|1|18|-15|17|5|6|7|0|9|8|107|14|108|8|109|17|5|6|7|0|3|8|110|14|111|8|112|14|113|8|21|17|5|6|7|0|1|8|112|17|5|6|7|0|1|8|22|14|114|-315|-317|-307|-313|-301|-305|8|115|80|-246|8|76|17|5|6|7|0|3|8|77|14|116|8|79|80|19|13|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|117|-336|-338|-327|-334|-301|-325|8|30|14|118|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498779786|1309965025280|66000000|8|40|14|59|8|41|38|39|3498791652|1309965025280|932000000|8|42|14|119|-301|-346|8|46|14|62|8|120|17|5|6|7|0|0|-301|-364|8|21|17|5|6|7|0|1|8|107|17|5|6|7|0|1|8|22|14|121|-370|-372|-301|-368|-297|-299|-293|-295|8|30|14|122|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498779778|1309965025280|58000000|8|40|14|59|8|41|38|39|3498791646|1309965025280|926000000|8|42|14|119|-293|-380|8|46|14|62|8|123|17|5|6|7|0|0|-293|-398|8|48|14|124|-289|-291|-1|-287|8|125|17|5|6|7|0|2|18|-15|14|126|8|21|17|5|6\"\n contents3 = \"|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|127|-412|-414|-406|-410|-1|-404|8|30|14|128|8|129|17|5|6|7|0|1|18|-15|17|5|6|7|0|2|8|130|14|131|8|21|17|5|6|7|0|1|8|130|17|5|6|7|0|1|8|22|14|132|-434|-436|-428|-432|-424|-426|-1|-422|8|133|17|5|6|7|0|0|-1|-442|8|134|14|135|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498775348|1309965025280|628000000|8|40|14|59|8|41|38|39|3498791612|1309965025280|892000000|8|42|14|136|-1|-448|8|137|10|-5|8|138|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|84|17|5|6|7|0|1|18|-15|17|5|6|7|0|4|8|30|14|139|8|86|14|87|8|88|89|90|100|0|8|21|17|5|6|7|0|1|8|86|17|5|6|7|0|1|8|22|14|91|-491|-493|-480|-489|-476|-478|-472|-474|8|97|14|140|8|30|14|141|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498789104|1309965025280|384000000|8|40|14|59|8|41|38|39|3498791612|1309965025280|892000000|8|42|14|100|-472|-503|-468|-470|-1|-466|8|142|10|-5|8|143|14|144|8|46|14|62|8|145|14|146|8|123|17|5|6|7|0|2|18|-15|14|147|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|148|-535|-537|-529|-533|-1|-527|8|149|14|150|8|48|14|151|8|120|17|5|6|7|0|2|18|-15|14|152|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|153|-555|-557|-549|-553|-1|-547|8|154|17|5|6|7|0|2|18|-15|14|87|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|91|-571|-573|-565|-569|-1|-563|8|155|17|5|6|7|0|0|-1|-579|8|156|17|5|6|7|0|3|8|157|38|39|3498775348|1309965025280|628000000|8|158|89|90|1|0|8|159|14|160|-1|-583|8|21|17|5|6|7|0|3|8|143|17|5|6|7|0|1|8|22|14|161|-597|-599|8|145|17|5|6|7|0|1|8|22|14|146|-597|-605|8|13|17|5|6|7|0|1|8|22|14|162|-597|-611|-1|-595|8|163|17|5|6|7|0|12|8|164|14|165|8|30|14|166|8|34|17|5|6|7|0|5|8|35|14|59|8|37|38|39|3498775596|1309965025280|876000000|8|40|14|59|8|41|38|39|3498792455|1309965025280|735000000|8|42|14|167|-619|-625|8|44|14|65|8|168|17|5|6|7|0|1|18|-15|14|128|-619|-643|8|169|14|170|8|171|17|5|6|7|0|0|-619|-651|8|172|17|5|6|7|0|0|-619|-655|8|173|14|174|8|46|14|175|8|48|14|176|8|177|14|178|-1|-617|8|179|17|5|6|7|0|1|8|180|17|5|6|7|0|0|-669|-671|-1|-667|0|0|\"\n end\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}#{contents3}\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add_thinktime(5)\n\n\n # Submit to worflow\n if(opts[:submit])\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|submitDocumentWithId|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:proposal_doc_id_var_name]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n end\n \n \n end", "def talk_params\n params.require(:talk).permit(:content, :user_id, :task_id)\n end", "def setup\n @user = users(:alice)\n @vote_type = vote_types(:positive)\n @post = posts(:problem1)\n @comment = comments(:comment1)\n @vote = Vote.new\n end", "def set_participant\n @participant = Participant.find(params[:id])\n @decision = Decision.find(@participant.decision_id)\n @user = User.find(@participant.user_id)\n @comment = Comment.new\n end", "def initialize(options)\n @id = options['id']\n @user_id = options['user_id']\n @parent_reply_id = options['parent_reply_id']\n @body = options['body']\n @question_id = options['question_id']\n end", "def setup\n @model = Participant\n @controller = ParticipantsController.new\n @request = ActionController::TestRequest.new\n @response = ActionController::TestResponse.new\n\n @request.session[:user] = User.find(users(:superadmin).id )\n roleid = User.find(users(:superadmin).id).role_id\n Role.rebuild_cache\n\n Role.find(roleid).cache[:credentials]\n @request.session[:credentials] = Role.find(roleid).cache[:credentials]\n # Work around a bug that causes session[:credentials] to become a YAML Object\n @request.session[:credentials] = nil if @request.session[:credentials].is_a? YAML::Object\n @settings = SystemSettings.find(:first)\n AuthController.set_current_role(roleid,@request.session)\n\n @User = participants(:par15)\n end", "def start_session(room, options = {})\n create_options = {\n record: options[:record].to_s,\n logoutURL: options[:meeting_logout_url] || '',\n moderatorPW: room.moderator_pw,\n attendeePW: room.attendee_pw,\n moderatorOnlyMessage: options[:moderator_message],\n muteOnStart: options[:mute_on_start].to_s || \"false\",\n breakoutRoomsEnabled: options[:breakoutRoomsEnabled],\n \"logo\": options[:customLogoUrl] || '',\n \"meta_#{META_LISTED}\": options[:recording_default_visibility].to_s || \"false\",\n \"meta_whistle-origin-version\": \"1.0\",\n \"meta_whistle-origin\": \"WhistleRoom\",\n \"meta_whistle-origin-server-name\": options[:host],\n \"meta_roomPassword\": room.attendee_pw,\n \"meta_inviteMsgPassword\": \"#{options[:moderator_message]}\",\n \"meta_meetingUrl\": options[:meeting_url],\n \"meta_auth-mandatory\": options[:auth_mandatory].to_s || \"false\",\n \"meta_auth-multi-factor\": options[:auth_multi_factor].to_s || \"false\",\n \"meta_auth-room-key\": room.access_code.present?,\n \"meta_room-key\": room.access_code.to_s,\n \"meta_auth-lobby\": options[:auth_lobby].to_s || \"false\",\n \"meta_auth-onetime\": options[:auth_one_time_invite_link].to_s || \"false\",\n \"meta_encrypt-transit\": \"true\",\n \"meta_encrypt-recording\": \"true\",\n \"meta_encrypt-content\": \"true\",\n \"meta_privacy-record-consent\": \"true\",\n \"meta_privacy-data-deletion\": \"true\",\n \"meta_owner\": options[:owner].to_s || \"false\",\n \"meta_email\": options[:owner_email].to_s || \"\",\n \"meta_webinar\": options[:listen_only].to_s || \"false\",\n \"meta_google-calendar-url\": options[:google_calendar_url] || '',\n \"meta_banner-message\": options[:banner_message] || ''\n }\n\n create_options[:guestPolicy] = \"ASK_MODERATOR\" if options[:require_moderator_approval]\n create_options[:maxParticipants] = options[:maxParticipants] if options[:maxParticipants]\n create_options[:lockSettingsDisableMic] = options[:listen_only]\n create_options[:listenOnlyMode] = options[:listen_only]\n create_options[:forceListenOnly] = options[:listen_only]\n create_options[:enableListenOnly] = options[:listen_only]\n create_options[:lockSettingsLockOnJoin] = true\n create_options[:record] = options[:record]\n\n # Send the create request.\n begin\n meeting = if room.presentation.attached?\n modules = BigBlueButton::BigBlueButtonModules.new\n url = rails_blob_url(room.presentation).gsub(\"&\", \"%26\")\n logger.info(\"Support: Room #{room.uid} starting using presentation: #{url}\")\n modules.add_presentation(:url, url)\n bbb_server.create_meeting(room.name, room.bbb_id, create_options, modules)\n else\n bbb_server.create_meeting(room.name, room.bbb_id, create_options)\n end\n\n unless meeting[:messageKey] == 'duplicateWarning'\n room.update_attributes(sessions: room.sessions + 1, last_session: DateTime.now)\n end\n rescue BigBlueButton::BigBlueButtonException => e\n puts \"BigBlueButton failed on create: #{e.key}: #{e.message}\"\n raise e\n end\n end", "def initialize(from_email = nil, subj = nil, to_email = nil, cont = nil) # rubocop:disable Metrics/ParameterLists\n @from = nil\n @subject = nil\n @personalizations = []\n @contents = []\n @attachments = []\n @template_id = nil\n @sections = {}\n @headers = {}\n @categories = []\n @custom_args = {}\n @send_at = nil\n @batch_id = nil\n @asm = nil\n @ip_pool_name = nil\n @mail_settings = nil\n @tracking_settings = nil\n @reply_to = nil\n\n return if from_email.nil? && subj.nil? && to_email.nil? && cont.nil?\n\n self.from = from_email\n self.subject = subj\n personalization = Personalization.new\n personalization.add_to(to_email)\n add_personalization(personalization)\n add_content(cont)\n end", "def initialize(opts={})\n self.template_name = opts.delete(:template_name) || \"simple\"\n set_template_instance_variables(opts)\n super(glass_template_path)\n end", "def initialize( opts = {} )\n opts = { \n 'bio' => 'bio',\n 'website' => 'website', \n 'mobile' => 'mobile', \n 'email' => 'email', \n 'address' => 'address', \n 'name' => 'name'\n }.merge( opts )\n \n @data = {\n 'me' => opts['address'],\n 'plans' => {\n opts['address'] => {\n 'name' => opts['name'],\n 'bio' => opts['bio'],\n 'properties' => {\n 'email' => opts['email'],\n 'mobile' => opts['mobile'],\n 'website' => opts['website']\n },\n 'following' => [],\n 'messages' => [],\n 'replies' => {}\n }\n }\n }\n end", "def setup\n @admin = users(:admin)\n @user = users(:user)\n @mission = missions(:mission1)\n end", "def initialize(params={})\n # there has GOT to be some better way to clean this up ...\n params['categories'] = params.delete('challenge_categories__r') if params['challenge_categories__r']\n params['participants'] = params.delete('challenge_participants__r') if params['challenge_participants__r']\n params['community'] = params.delete('community__r') if params['community__r']\n params['terms_of_service'] = params.delete('terms_of_service__r') if params['terms_of_service__r']\n params['challenge_comments'] = params.delete('challenge_comments__r') if params['challenge_comments__r']\n params['challenge_reviewers'] = params.delete('challenge_reviewers__r') if params['challenge_reviewers__r']\n params['challenge_comment_notifiers'] = params.delete('challenge_comment_notifiers__r') if params['challenge_comment_notifiers__r']\n params['challenge_prizes'] = params.delete('challenge_prizes__r') if params['challenge_prizes__r']\n params['assets'] = params.delete('assets__r') if params['assets__r']\n params['platforms'] = params.delete('challenge_platforms__r') if params['challenge_platforms__r']\n params['technologies'] = params.delete('challenge_technologies__r') if params['challenge_technologies__r']\n\n # these fields need extra cleaning as they should only output arrays of strings\n # they also have an awful lot of duplication that can benefit with a bit of refactoring\n params['challenge_reviewers'] = params['challenge_reviewers'].map do |entry|\n entry['member__r']['name']\n end if params['challenge_reviewers']\n\n params['challenge_comment_notifiers'] = params['challenge_comment_notifiers'].map do |entry|\n entry['member__r']['name']\n end if params['challenge_comment_notifiers']\n\n params['challenge_prizes'] = params['challenge_prizes'].records.map do |entry|\n prize = \"$#{Integer(entry['prize'])}\" rescue entry['prize'].to_s\n { place: entry['place'].to_i.ordinalize, prize: prize, points: entry['points'] || '', value: entry['value'] || '' }\n end if params['challenge_prizes']\n\n # params['assets'] = params['assets'].map do |entry|\n # entry['filename']\n # end if params['assets']\n\n super(params)\n end", "def prepare_message\n case self.option_types\n when \"quick replies\"\n self.to_message_with_quick_replies\n when \"buttons\"\n self.to_message_with_buttons\n when \"templates\"\n self.to_message_with_templates\n when \"none\"\n self.to_simple_message\n end\n end", "def initialize(options = {}) # :nodoc:\n @participant_ids = options[:participants] || []\n\n if options[:id].nil? and options[:context]\n # Generate the wavelet from scratch.\n super(:id => \"#{GENERATED_PREFIX}_wavelet_#{unique_id}_#{ROOT_ID_SUFFIX}\", :context => options[:context])\n\n # Create a wave to live in.\n wave = Wave.new(:wavelet_ids => [@id], :context => @context)\n @wave_id = wave.id\n @context.add_wave(wave)\n \n # Ensure the newly created wavelet has a root blip.\n blip = Blip.new(:wave_id => wave.id, :wavelet_id => @id,\n :creator => @context.robot.id, :contributors => [@context.robot.id])\n @context.add_blip(blip)\n @root_blip_id = blip.id\n\n @participant_ids.each do |id|\n @context.add_user(:id => id) unless @context.users[id]\n end\n\n @creator_id = GENERATED_CREATOR\n @context.add_user(:id => @creator_id) unless @context.users[@creator_id]\n else\n super(options)\n @root_blip_id = options[:root_blip_id]\n @creator_id = options[:creator] || User::NOBODY_ID\n @wave_id = options[:wave_id]\n end\n\n @creation_time = time_from_json(options[:creation_time]) || Time.now\n @data_documents = options[:data_documents] || {}\n @last_modified_time = time_from_json(options[:last_modified_time]) || Time.now\n @title = options[:title] || ''\n @version = options[:version] || 0\n end", "def pick(gifter: nil, recipient: nil)\n #This instance variable is used to carry over to the template\n @recipient = recipient\n mail subject: \"Your Secret Santa results are in!\",\n to: gifter,\n from_name: \"Secret Santa\",\n from: \"[email protected]\"\n end", "def initialize(parms)\n @candidate = parms[:candidate]\n @subject = parms[:subject]\n @body_text = parms[:body_text]\n\n return unless @body_text.is_a? Hash\n\n @pre_late_input = @body_text[:pre_late_input]\n @pre_coming_due_input = @body_text[:pre_coming_due_input]\n @completed_awaiting_input = @body_text[:completed_awaiting_input]\n @completed_input = @body_text[:completed_input]\n @closing_input = @body_text[:closing_input]\n @salutation_input = @body_text[:salutation_input]\n @from_input = @body_text[:from_input]\n end", "def confirmation_instructions(record, token, opts={})\n\t set_record_locale(record)\n @head_image = \"https://diem25.org/wp-content/uploads/2017/08/demo_for_mail.jpg\"\n\t\t\n\t\t# Use different e-mail templates for normal signup e-mail confirmation \n # and for newsletter subscriptions.\n if record.member?\n opts[:template_name] = 'confirmation_instructions'\n\t\t\t@preview = I18n.t(\"general.welcome\", name: record.name)\n elsif record.just_signed_petition?\n @petition = Petition.find(record.refer[8..-1].to_i)\n @head_image = @petition.picture_url if @petition and @petition.picture_url\n opts[:template_name] = 'petition_newsletter_instructions'\n\t\t\topts[:subject] = I18n.t(\"newsletter.confirm_subject\")\n else\n opts[:template_name] = 'newsletter_instructions'\n\t\t\topts[:subject] = I18n.t(\"newsletter.confirm_subject\")\n end\n\t\t\n super\n end", "def show\n @template_strategies = @message_config.template_strategies\n @message_templates = @message_config.message_templates\n end", "def built_in_variables\n {\n template_id: self.template.try(:to_param),\n recipient: {\n full_name: self.recipient.full_name,\n first_name: self.recipient.first_name,\n last_name: self.recipient.last_name,\n email: self.recipient.email\n },\n sender: {\n full_name: self.sender.full_name,\n first_name: self.sender.first_name,\n last_name: self.sender.last_name,\n email: self.sender.email\n }\n }\n end", "def process!(email, subject, body)\n if user.email == email\n story = stories.build :title=>subject, :body=>body\n story.save\n else\n writer = User.find_by_email email\n if writer\n ask = writer.asks.find_by_question_id question.id\n if ask\n story = ask.stories.build :title=>subject, :body=>body\n story.save\n else\n ask = writer.asks.build :question=>question\n if ask.save\n story = ask.stories.build :title=>subject, :body=>body\n story.save\n end\n end\n else\n writer = User.new :name=>email.split('@').first, :email=>email\n password = writer.reset_password\n if writer.save\n UserMailer.welcome(writer, password).deliver\n ask = writer.asks.build :question=>question\n if ask.save\n story = ask.stories.build :title=>subject, :body=>body\n story.save\n end\n end\n end\n end\n \n if writer\n user.reads writer\n writer.reads user\n end\n \n story\n end", "def get_conversations_email_participant_wrapup_with_http_info(conversation_id, participant_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.get_conversations_email_participant_wrapup ...\"\n end\n \n \n # verify the required parameter 'conversation_id' is set\n fail ArgumentError, \"Missing the required parameter 'conversation_id' when calling ConversationsApi.get_conversations_email_participant_wrapup\" if conversation_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'participant_id' is set\n fail ArgumentError, \"Missing the required parameter 'participant_id' when calling ConversationsApi.get_conversations_email_participant_wrapup\" if participant_id.nil?\n \n \n \n \n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/conversations/emails/{conversationId}/participants/{participantId}/wrapup\".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'provisional'] = opts[:'provisional'] if opts[:'provisional']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'AssignedWrapupCode')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#get_conversations_email_participant_wrapup\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def new_user_setup\n self.create_timer\n self.groups.create( {name: self.username})\n g=self.groups.first\n self.wrapper_group=g\n self.promote_in_group g\n cam=Campaign.create({ name: \"My Journey\", description: \"A collection of to-dos and notes that don't fit anywhere else\", group_id: g.id, status: \"Open\"})\n Quest.create({name: \"To Do's\", description: \"Odds and ends that still need to get done\", parent_id: cam.id, campaign_id: cam.id, group_id: g.id, status: \"Open\"})\n Quest.create({name: \"Regular Rituals\", description: \"Frequent chores, repeated tasks, or any other habitual activity\", parent_id: cam.id, campaign_id: cam.id, group_id: g.id, status: \"Open\"})\n q=Quest.create({name: \"Unsorted Musings\", description: \"A place to store those notes that doen't fit elsewhere\", parent_id: cam.id, campaign_id: cam.id, group_id: g.id, status: \"Open\"})\n enc = Encounter.create({ user: self})\n Round.create_event(cam, \"create\", cam, self)\n Round.create_event(q, \"Create\", cam, self)\n self.active_quest=q\n self.save\n self.reload\n Round.create_event(q, \"Create\", cam, self)\n enc.end_time = Time.now.utc\n enc.save\n\n UserConfig.create({\n user_id: self.id,\n auto_timer: true,\n encounter_duration: 25*60,\n short_break_duration: 5*60,\n extended_break_duration: 15*60,\n encounter_extend_duration: 5*60,\n timezone_name: \"US/Eastern\",\n utc_time_offset: -14400\n })\n end", "def create\n @petition = Petition.new(petition_params)\n\n @petition.status = 'concept'\n\n @petition.locale_list << I18n.locale\n\n set_petition_vars\n\n set_office\n\n set_organisation_helper\n\n if params[:images].present?\n params[:images].each do |image|\n @petition.images << Image.new(upload: image)\n end\n end\n\n @exclude_list = []\n\n @password = 'you already have'\n\n if user_signed_in?\n owner = current_user\n # send welcome mail anyways..\n else\n user_params = params[:user]\n\n if user_params[:email].present?\n owner = User.where(email: user_params[:email]).first\n\n unless owner\n password = user_params[:password]\n password = Devise.friendly_token.first(8) if password.blank?\n\n owner = User.new(\n email: user_params[:email],\n username: user_params[:email],\n name: user_params[:name],\n password: password\n )\n owner.send(:generate_confirmation_token)\n owner.skip_confirmation!\n owner.skip_confirmation_notification!\n owner.confirmed_at = nil\n owner.save\n @password = password\n # send welcome / password if needed\n end\n else\n @missing_email = t('petition.missing_email')\n\n respond_to do |format|\n format.html { render :new, flash: { success: t('petition.missing_email') } }\n format.json { render json: @petition.errors, status: :unprocessable_entity }\n end\n\n return\n end\n end\n\n respond_to do |format|\n # petition is save. status change causes email(s)\n # to be send\n if @petition.save\n # make user owner of the petition\n owner.add_role(:admin, @petition) if owner\n PetitionMailer.welcome_petitioner_mail(@petition, owner, password).deliver_later\n\n format.html { redirect_to @petition, flash: { success: t('petition.created') } }\n format.json { render :show, status: :created, location: @petition }\n else\n format.html { render :new }\n format.json { render json: @petition.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @meeting = Meeting.new(params[:meeting])\n @user = User.find_by_watiam(session[:cas_user])\n @meeting.user_id = @user.id\n @all = User.all\n\n respond_to do |format|\n if @meeting.save\n \n AgendaReminder.reminder_email(@user, @meeting).deliver\n \n if params[:all?] == true\n @all.each do |id|\n @a = Attendee.new\n @d = Discussion.new\n @a.meeting_id = @meeting.id\n @a.user_id = id\n @d.meeting_id = @meeting.id\n @d.user_id = id\n @a.weight = @a.user_id\n @a.save\n @d.save\n end\n else \n params[:user_ids].each do |id|\n @a = Attendee.new\n @d = Discussion.new\n @a.meeting_id = @meeting.id\n @a.user_id = id\n @d.meeting_id = @meeting.id\n @d.user_id = id\n @a.weight = @a.user_id\n @a.save\n @d.save\n end\n end\n \n format.html { redirect_to @meeting, notice: 'Meeting was successfully created.' }\n format.json { render json: @meeting, status: :created, location: @meeting }\n \n else\n format.html { render action: \"new\" }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end", "def meet\n # Envia pedido de que quer conhecer o animal. \n # Isto mandaria uma proposta para o dono do shelter.\n\n # TODO: É preciso criar uma tabela associativa para saber quem já mandou proposta para o animal.\n # Assim evitaria mandar proposta múltiplas vezes.\n if params[:user_id]\n # friendly_user = User.find(params[:user_id])\n friendly_user = current_user\n AnimalMailer.meet_up_proposal(@animal, friendly_user).deliver\n end\n end", "def initialize(object)\n @createdAt = DateTime.iso8601(object[\"createdAt\"]) if object[\"createdAt\"]\n\n # helpscout is inconsistent in their modifiedAt key. Conversations list action uses 'userModifiedAt'\n if object.has_key?(\"userModifiedAt\")\n @modifiedAt = DateTime.iso8601(object[\"userModifiedAt\"])\n elsif object.has_key?(\"modifiedAt\")\n @modifiedAt = DateTime.iso8601(object[\"modifiedAt\"])\n end\n\n @closedAt = DateTime.iso8601(object[\"closedAt\"]) if object[\"closedAt\"]\n\n @id = object[\"id\"]\n @type = object[\"type\"]\n @folderId = object[\"folderId\"]\n @isDraft = object[\"isDraft\"]\n @number = object[\"number\"]\n @owner = Person.new(object[\"owner\"]) if object[\"owner\"]\n @mailbox = Mailbox.new(object[\"mailbox\"]) if object[\"mailbox\"]\n @customer = Person.new(object[\"customer\"]) if object[\"customer\"]\n @threadCount = object[\"threadCount\"]\n @status = object[\"status\"]\n @subject = object[\"subject\"]\n @preview = object[\"preview\"]\n @closedBy = Person.new(object[\"closedBy\"]) if object[\"closedBy\"]\n @createdBy = Person.new(object[\"person\"]) if object[\"person\"]\n @source = Source.new(object[\"source\"]) if object[\"source\"]\n @cc = object[\"cc\"]\n @bcc = object[\"bcc\"]\n @tags = object[\"tags\"]\n\n @threads = []\n if object[\"threads\"]\n object[\"threads\"].each do |thread|\n @threads << Thread.new(thread)\n end\n end\n\n @customFields = []\n if object[\"customFields\"]\n object[\"customFields\"].each do |thread|\n @customFields << Field.new(thread)\n end\n end\n\n @url = \"https://secure.helpscout.net/conversation/#{@id}/#{@number}/\"\n end", "def add_participant\n user = self.load_user(params)\n meeting = self.load_meeting(params)\n participant_ids = params[\"participant_ids\"]\n comment = params[\"comment\"].nil? ? \"\" : params[\"comment\"]\n\n if user != nil and meeting != nil and participant_ids.length > 0\n participant_ids.each do |participant_id|\n unless meeting.participants.exists?(participant_id)\n new_participant = User.find(participant_id)\n meeting.participants << new_participant\n # add default vote for the new added participant to each suggestion\n meeting.suggestions.each do |suggestion|\n suggestion.votes << Vote.new(:voter => new_participant, :decision => \"?\")\n end\n\n NotificationService.send_meeting_invitation(user, new_participant, meeting, comment)\n end\n end\n self.send_ok\n else\n self.send_error 401\n end\n end", "def generate_dummy_data_for_presentation(pt1,user)\n\n#generate the exercises:\n# For the legs session type\n legs1 = Exercise.new(\"Full Squat\", \"Legs\", true, 10, 5, 1.2,4,3) \n legs2 = Exercise.new(\"Barbell Lunge\", \"Legs\", false, 15, 5, 1.1,4,2) \n legs3 = Exercise.new(\"Deadlift\", \"Legs\", true, 15, 5, 1.3,2,4) \n legs4 = Exercise.new(\"Leg Press\", \"Legs\", false, 20, 5, 1.25,6,5) \n legs5 = Exercise.new(\"Ham String Curl\", \"Legs\", true, 12, 5, 1.15,4,4) \n # For the Biceps, Triceps, Forearms and Abs (aka BTFA) session type \n btfa1 = Exercise.new(\"Bicep Curls\", \"BTFA\",true, 10, 5, 1.2,4,3) \n btfa2 = Exercise.new(\"Shoulder Press\", \"BTFA\", false, 10, 5, 1.2,4,3) \n btfa3 = Exercise.new(\"Bench Press\", \"BTFA\", true, 10, 5, 1.2,4,3) \n btfa4 = Exercise.new(\"Triceps Extension\", \"BTFA\", false, 10, 5, 1.2,4,3) \n btfa5 = Exercise.new(\"Sit Up\", \"BTFA\", true, 10, 5, 1.2,4,3) \n # For the Shoulders and Traps session type\n shoulders_traps1 = Exercise.new(\"Dumbell Shoulder Press\", \"Shoulders and Traps\",true, 10, 5, 1.2,4,3) \n shoulders_traps2 = Exercise.new(\"Upright Barbell Row\", \"Shoulders and Traps\", false, 10, 5, 1.2,4,3) \n shoulders_traps3 = Exercise.new(\"Seated Bent-over Rear Delt Raise\", \"Shoulders and Traps\", true, 10, 5, 1.2,4,3) \n shoulders_traps4 = Exercise.new(\"Side Lateral Raise\", \"Shoulders and Traps\", false, 10, 5, 1.2,4,3) \n shoulders_traps5 = Exercise.new(\"Barbell Shrug\", \"Shoulders and Traps\", true, 10, 5, 1.2,4,3) \n # For the Back session type\n back1 = Exercise.new(\"Barbell Deadlift\", \"Back\", true, 10, 5, 1.2,4,3) \n back2 = Exercise.new(\"Wide-Grip Pull Up\", \"Back\", false, 10, 5, 1.2,4,3) \n back3 = Exercise.new(\"Bent-Over Barbell Deadlift\", \"Back\", true, 10, 5, 1.2,4,3) \n back4 = Exercise.new(\"Standing T-Bar Row\", \"Back\", false, 10, 5, 1.2,4,3) \n # For the Chest session type\n chest1 = Exercise.new(\"Barbell Bench Press\", \"Chest\", true, 10, 5, 1.2,4,3) \n chest2 = Exercise.new(\"Flat Bench Dumbbell Press\", \"Chest\", false, 10, 5, 1.2,4,3) \n chest3 = Exercise.new(\"Seated Machine Chest Press\", \"Chest\", true, 10, 5, 1.2,4,3) \n chest4 = Exercise.new(\"Incline Dumbbell Press\", \"Chest\", false, 10, 5, 1.2,4,3) \n chest5 = Exercise.new(\"Machine Decline Press\", \"Chest\", true, 10, 5, 1.2,4,3) \n\n# add exercises to the PT object so that it's aware of them\n pt1.add_exercises(legs1)\n pt1.add_exercises(legs2)\n pt1.add_exercises(legs3)\n pt1.add_exercises(legs4)\n pt1.add_exercises(legs5)\n pt1.add_exercises(btfa1)\n pt1.add_exercises(btfa2)\n pt1.add_exercises(btfa3)\n pt1.add_exercises(btfa4)\n pt1.add_exercises(btfa5)\n pt1.add_exercises(shoulders_traps1)\n pt1.add_exercises(shoulders_traps2)\n pt1.add_exercises(shoulders_traps3)\n pt1.add_exercises(shoulders_traps4)\n pt1.add_exercises(shoulders_traps5)\n pt1.add_exercises(back1)\n pt1.add_exercises(back2)\n pt1.add_exercises(back3)\n pt1.add_exercises(back4)\n pt1.add_exercises(chest1)\n pt1.add_exercises(chest2)\n pt1.add_exercises(chest3)\n pt1.add_exercises(chest4)\n pt1.add_exercises(chest5)\n\n\n # establish id for user\n user.username = \"jim\"\n user.password = \"password\"\n user.first_name = \"Jimmy\"\n user.last_name = \"Coder\"\n user.gender = \"Male\"\n user.body_type = \"Mesomorph\"\n user.goal = \"musclebuild\"\n user.disclaimer = \"accept\"\n user.date_of_birth = Date.new(1990,9,9)\n # binding.pry\n user.weight = 56\n user.goal_weight = 75\n\n#establish some dummy workout history for our user:\n # (weight, completed_reps, exercise_performed, duration, date, session_number, session_type)\n workout_history_for_user = ExerciseInput.new(10, 8, chest1.name, 10, Date.new(2017,8,1), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(10, 9, chest1.name, 10, Date.new(2017,8,1), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(10, 10, chest1.name, 10, Date.new(2017,8,1), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(10, 11, chest1.name, 10, Date.new(2017,8,2), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 8, chest1.name, 10, Date.new(2017,8,2), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 9, chest1.name, 10, Date.new(2017,8,2), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 9, chest1.name, 10, Date.new(2017,8,2), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 8, chest1.name, 10, Date.new(2017,8,3), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 8, chest1.name, 10, Date.new(2017,8,3), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 8, chest1.name, 10, Date.new(2017,8,3), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 8, chest1.name, 10, Date.new(2017,8,3), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 8, chest1.name, 10, Date.new(2017,8,4), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 8, chest1.name, 10, Date.new(2017,8,4), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 8, chest1.name, 10, Date.new(2017,8,4), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 8, chest1.name, 10, Date.new(2017,8,4), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 5, chest1.name, 10, Date.new(2017,8,5), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 8, chest1.name, 10, Date.new(2017,8,6), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(20, 8, chest1.name, 10, Date.new(2017,8,7), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(20, 10, chest1.name, 10, Date.new(2017,8,8), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(25, 7, chest1.name, 10, Date.new(2017,8,9), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(25, 8, chest1.name, 10, Date.new(2017,8,10), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(25, 9, chest1.name, 10, Date.new(2017,8,11), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(25, 10, chest1.name, 10, Date.new(2017,8,12), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n\n\nend", "def initialize(params={})\n params['member'] = params.delete('member__r') if params['member__r']\n params['replies'] = params.delete('challenge_comments__r') if params['challenge_comments__r']\n\n super(params)\n end", "def call(_obj, args, ctx)\n\t\tif ctx[:current_user].blank?\n raise GraphQL::ExecutionError.new(\"Authentication required.\")\n else\n user = User.find_by(id: ctx[:current_user][:id])\n end\n\n\t\tif args[:name].blank?\n error = GraphQL::ExecutionError.new(\"This field is required.\", options: { field: \"name_field\" } )\n ctx.add_error(error)\n end\n\n\t\tif args[:email].blank?\n error = GraphQL::ExecutionError.new(\"This field is required.\", options: { field: \"email_field\" } )\n ctx.add_error(error)\n end\n\n\t\tif args[:message].blank?\n error = GraphQL::ExecutionError.new(\"This field is required.\", options: { field: \"message_field\" } )\n ctx.add_error(error)\n end\n\n\t\tif args[:category].blank?\n error = GraphQL::ExecutionError.new(\"This field is required.\", options: { field: \"category_field\" } )\n ctx.add_error(error)\n end\n\n\t\taccepted_categories = ['Employment Opportunities', 'General Questions', 'Suggestion', 'Something Else']\n\n if error.present?\n raise GraphQL::ExecutionError.new(ctx.errors)\n end\n\n\t mail = Mail.new\n\t mail.from = Email.new(email: '[email protected]')\n\t mail.subject = 'Inquiry - James Gallagher'\n\t personalization = Personalization.new\n\t personalization.add_to(Email.new(email: args[:email]))\n\t personalization.add_substitution(Substitution.new(key: '-name-', value: args[:name]))\n\t mail.add_personalization(personalization)\n\t mail.template_id = '13b8f94f-bcae-4ec6-b752-70d6cb59f932'\n\n\t sg = SendGrid::API.new(api_key: \"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\")\n\t begin\n\t response = sg.client.mail._(\"send\").post(request_body: mail.to_json)\n\t rescue Exception => e\n\t puts e.message\n\t end\n\n\t\tInquiry.create!(\n\t name: args[:name],\n\t email: args[:email],\n\t message: args[:message],\n\t category: args[:category]\n\t )\n end", "def set_shared_vars\n @user = current_user\n @plant \n @symptoms \n @question \n @symptom_assessor\n @symptom_causes\n @user_plants = UserPlant.where(user_id: current_user.id)\n @possible_treatments = []\n end", "def testimonial_reminder(conversation, recipient, community)\n @email_type = \"email_about_testimonial_reminders\"\n set_up_layout_variables(recipient, community, @email_type)\n with_locale(recipient.locale, community.locales.map(&:to_sym), community.id) do\n @conversation = conversation\n @other_party = @conversation.other_party(recipient)\n premailer_mail(:to => recipient.confirmed_notification_emails_to,\n :from => community_specific_sender(community),\n :subject => t(\"emails.testimonial_reminder.remember_to_give_feedback_to\", :name => @other_party.name(community)))\n end\n end", "def question_answered(data, user, answer, _options_string)\n @user = user\n @username = @user.name\n @answer = answer\n @question_title = @answer.question.text.to_s\n @plan_title = @answer.plan.title.to_s\n @template_title = @answer.plan.template.title.to_s\n @data = data\n @recipient_name = @data['name'].to_s\n @message = @data['message'].to_s\n @answer_text = @options_string.to_s\n @helpdesk_email = helpdesk_email(org: @user.org)\n\n I18n.with_locale I18n.default_locale do\n mail(to: data['email'],\n subject: data['subject'])\n end\n end", "def get_conversations_chat_participant_wrapup_with_http_info(conversation_id, participant_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.get_conversations_chat_participant_wrapup ...\"\n end\n \n \n # verify the required parameter 'conversation_id' is set\n fail ArgumentError, \"Missing the required parameter 'conversation_id' when calling ConversationsApi.get_conversations_chat_participant_wrapup\" if conversation_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'participant_id' is set\n fail ArgumentError, \"Missing the required parameter 'participant_id' when calling ConversationsApi.get_conversations_chat_participant_wrapup\" if participant_id.nil?\n \n \n \n \n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/conversations/chats/{conversationId}/participants/{participantId}/wrapup\".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'provisional'] = opts[:'provisional'] if opts[:'provisional']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'AssignedWrapupCode')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#get_conversations_chat_participant_wrapup\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def welcome_user(opts)\n extract_vars(opts)\n @is_welcome_user = true\n\n I18n.with_locale(@newsletter_user.lang) do\n @newsletter = Newsletter.new(\n title: @newsletter_setting.title_subscriber,\n content: @newsletter_setting.content_subscriber\n )\n end\n\n process_email\n end", "def create\n session[:user_params].deep_merge!(params[:user]) if params[:user]\n @user = User.new(session[:user_params])\n @user.current_step = session[:user_step]\n @coaches = Coach.all.where(approved: true)\n if @user.valid?\n if params[:previous_button]\n @user.previous_step\n elsif @user.last_step?\n @user.save if @user.all_coaches_choosen?\n session[:user_step] = nil\n session[:user_params] = nil\n session[:user_id] = @user.id\n coach1 = Coach.find(@user.coach_1)\n coach2 = Coach.find(@user.coach_2)\n notify_user(@user)\n notify_coach(@user.coach)\n notify_coach(@user.coach_1)\n notify_coach(@user.coach_2)\n notify_admin(@user)\n conversation = Conversation.create(user_id: @user.id, coach_id: @user.coach.id)\n Message.create(conversation_id: conversation.id, body: @user.coach.greeting, coach_id: @user.coach)\n conversation2 = Conversation.create(user_id: @user.id, coach_id: coach1.id)\n Message.create(conversation_id: conversation2.id, body: coach1.greeting, coach_id: coach1.id)\n conversation3 = Conversation.create(user_id: @user.id, coach_id: coach2.id)\n Message.create(conversation_id: conversation3.id, body: coach2.greeting, coach_id: coach2.id)\n redirect_to charges_new_path\n ReportMailer.send_confirmation(@user).deliver_now\n else\n @user.next_step\n end\n session[:user_step] = @user.current_step\n end\n if @user.new_record?\n render 'new'\n end\n end", "def initialize_group_meeting_times(creator)\n self.discussion_section_1 = creator.discussion_section_1\n self.discussion_section_2 = creator.discussion_section_2\n self.discussion_section_3 = creator.discussion_section_3\n self.save\n end", "def create\n @show_sales_overlay = false\n\n\n if current_user and params[:first_name]\n\t current_user.first_name = params[:first_name]\n \n ### having periods in the first name kills the attempts to email that person, so remove periods\n current_user.first_name = current_user.first_name.gsub(\".\", \"\")\n current_user.save\n end \n\n @goal = Goal.new(params[:goal])\n\n if @goal.template_owner_is_a_template\n @goal.status = \"hold\"\n end\n\n\n\n ### remove question marks because:\n ### people keep incorrectly adding their own question marks to the end of their question\n ### which messes up phrasings in the rest of the program and never is needed\n @goal.response_question = @goal.response_question.gsub(\"?\", \"\")\n\n @goal.title = @goal.response_question\n\n if [email protected]_allowed_per_day\n @goal.pushes_allowed_per_day = 1\n end \n\n\n\n\n ################################\n #Status Creation Business Rules\n ################################\n #start (create the goal starting today stopping after goal.days_to_form_a_habit days)\n #monitor (create the goal starting today stopping after goal.days_to_form_a_habit days)\n #hold (just create the goal and a default dummy date of 1/1/1900 for start and stop)\n \n respond_to do |format|\n\n tracker_data_missing_error = false\n if @goal.tracker\n\n\n\n missing = false\n if [email protected]_question or @goal.tracker_question == \"\"\n missing = true\n logger.debug(\"sgj:goals_controller:1\")\n end\n if [email protected]_units or @goal.tracker_units == \"\"\n missing = true\n logger.debug(\"sgj:goals_controller:2\")\n end\n\n\n ### these will never be null b/c they're in forced pulldowns\n ### plus these checks were not working right\n # if [email protected]_type_starts_at_zero_daily\n # missing = true\n # logger.debug(\"sgj:goals_controller:3\")\n # end\n # if [email protected]_target_higher_value_is_better\n # missing = true\n # logger.debug(\"sgj:goals_controller:4\")\n # end\n\n # if [email protected]_standard_deviation_from_last_measurement\n # missing = true\n # logger.debug(\"sgj:goals_controller:5\")\n # end\n # if [email protected]_target_threshold_bad1\n # missing = true\n # logger.debug(\"sgj:goals_controller:6\")\n # end\n # if [email protected]_target_threshold_bad2\n # missing = true\n # logger.debug(\"sgj:goals_controller:7\")\n # end\n # if [email protected]_target_threshold_bad3\n # missing = true\n # logger.debug(\"sgj:goals_controller:8\")\n # end\n # if [email protected]_target_threshold_good1\n # missing = true\n # logger.debug(\"sgj:goals_controller:9\")\n # end\n # if [email protected]_target_threshold_good2\n # missing = true\n # logger.debug(\"sgj:goals_controller:10\")\n # end\n # if [email protected]_target_threshold_good3\n # missing = true\n # logger.debug(\"sgj:goals_controller:11\")\n # end\n\n if missing\n tracker_data_missing_error = true\n @goal.errors.add(:base, \"All 'Tracker' fields are required if the 'Tracker' is enabled.\")\n end ### end if missing\n\n end ### end if @goal.tracker\n\n\n\n if !tracker_data_missing_error and @goal.save\n\n\n pmo = false\n\n if @goal.title.include? \"fapping\"\n pmo = true\n end\n\n if @goal.title.include? \"porn\"\n pmo = true\n end\n\n if @goal.title.include? \"masturb\"\n pmo = true\n end\n if @goal.title.include? \"pmo\"\n pmo = true\n end\n if @goal.title.include? \"jerking off\"\n pmo = true\n end\n if @goal.title.include? \"jerk off\"\n pmo = true\n end\n if @goal.title.include? \"touching myself\"\n pmo = true\n end\n if @goal.title.include? \"touching yourself\"\n pmo = true\n end\n if @goal.title.include? \"XXX\"\n pmo = true\n end\n if @goal.title.include? \"xxx\"\n pmo = true\n end\n\n\n if pmo\n @goal.category = \"PMO\"\n end\n\n if @goal.template_owner_is_a_template\n flash[:notice] = 'Template was successfully created.'\n\n ### if this new template was created to be part of an existing program\n if params[:program_id]\n program = Program.find(params[:program_id])\n\n program_template = ProgramTemplate.new()\n program_template.program_id = program.id\n program_template.template_goal_id = @goal.id\n\n ### you can't do this anymore now that 'next_listing_position' depends on the track\n ### because right now we don't know which track this will be in\n #program_template.listing_position = program.get_next_listing_position\n\n program_template.save\n end\n\n else\n flash[:notice] = 'Goal was successfully created.'\n\n ### show my PMO homies\n if @goal.category == \"PMO\"\n @goal.user.feed_filter_hide_pmo = false\n end\n\n ### if this is my first ever goal, record it in user for marketing\n if [email protected]_first\n @goal.user.category_first = @goal.category\n @goal.user.goal_first = @goal.title\n end\n if [email protected]_goals\n @goal.user.categories_goals = \"\"\n end\n\n if [email protected]\n @goal.category = \"Other\"\n end\n\n if [email protected]\n @goal.title = \"none\"\n end\n @goal.user.categories_goals += @goal.category + \"_:_\" + @goal.title + \"::\"\n\n\n if params[:sign_up_for_lyphted] and params[:sign_up_for_lyphted] == \"1\"\n @goal.user.lyphted_subscribe = @goal.user.dtoday\n\n\n # ####https://labs.aweber.com/snippets/subscribers\n # oauth = AWeber::OAuth.new('Ak1WLosRSScHQL6Z3X3WfV3F', 'utsxWW2PuCrWWGdUpGy1nLlFkXr1Hr2pRL7TomdR')\n\n # auth_url = oauth.request_token.authorize_url\n # logger.info(\"sgj:aweber: \" + auth_url)\n\n ### got all of the accesstoken info by following the account verifications instructions\n ### while using irb (require 'rubygems' and require 'aweber')\n ### based on: https://github.com/aweber/AWeber-API-Ruby-Library\n\n #<OAuth::AccessToken:0xb76fea70 @params={}, @consumer=#<OAuth::Consumer:0xb72e00d8 @http_method=:post, @secret=\"utsxWW2PuCrWWGdUpGy1nLlFkXr1Hr2pRL7TomdR\", @options={:access_token_path=>\"/1.0/oauth/access_token\", :oauth_version=>\"1.0\", :scheme=>:query_string, :signature_method=>\"HMAC-SHA1\", :proxy=>nil, :http_method=>:post, :request_token_path=>\"/1.0/oauth/request_token\", :authorize_path=>\"/1.0/oauth/authorize\", :site=>\"https://auth.aweber.com\"}, @key=\"Ak1WLosRSScHQL6Z3X3WfV3F\", @http=#<Net::HTTP auth.aweber.com:443 open=false>>, @secret=\"DmCMwlQWL4a2NHCrCTGaAu5u5EwaH06P5e4MLcYp\", @token=\"AgeEEz2LxKSd8zNpr602Bfyd\"> \n \n # App Name; HabitForge\n # App ID: 8765b416 \n # Consumer Key: Ak1WLosRSScHQL6Z3X3WfV3F\n # Consumer Secret: utsxWW2PuCrWWGdUpGy1nLlFkXr1Hr2pRL7TomdR\n\n ####https://labs.aweber.com/snippets/subscribers\n oauth = AWeber::OAuth.new('Ak1WLosRSScHQL6Z3X3WfV3F', 'utsxWW2PuCrWWGdUpGy1nLlFkXr1Hr2pRL7TomdR')\n oauth.authorize_with_access('AgeEEz2LxKSd8zNpr602Bfyd', 'DmCMwlQWL4a2NHCrCTGaAu5u5EwaH06P5e4MLcYp')\n aweber = AWeber::Base.new(oauth)\n new_subscriber = {}\n new_subscriber[\"email\"] = @goal.user.email\n new_subscriber[\"name\"] = @goal.user.name\n\n #### again, this one is custom and was not able to figure out how to update it\n # new_subscriber[\"YOB\"] = \"1976\"\n\n\n ##### was not able to get the updating of these custom fields to work after several different method tries\n ##### but that's OK we're now just using the built-in \"misc_notes\" \n # new_subscriber[\"custom_fields\"][\"first_category\"] = \"exercise\"\n # new_subscriber[\"custom_fields\"][\"first_goal\"] = \"run for 20 minutes\"\n # new_subscriber[\"custom_fields\"][\"categories_goals\"] = \"exercise:.:run for 20 minutes;\"\n\n begin\n new_subscriber[\"misc_notes\"] = \"first_category=\" + @goal.user.category_first\n rescue\n logger.error(\"sgj:could not add subscriber misc_note to aweber\")\n end\n\n # new_subscriber[\"misc_notes\"] = \"first_category=\" + @goal.user.category_first + \";first_goal='\" + @goal.user.goal_first + \"'\"\n\n ## The Lyphted list_id is = 3702705\n ## The Lyphted list_name is = awlist3702705\n list = aweber.account.lists.find_by_id(3702705)\n\n begin\n list.subscribers.create(new_subscriber)\n rescue\n logger.error(\"sgj:could not add subscriber to aweber (perhaps they have a role-based email address like admin@something\")\n ###https://help.aweber.com/entries/97662366\n end\n\n # aweber.account.lists.each do |list|\n # logger.info(\"sgj:aweber:\" + list.name)\n # end\n # logger.info(\"sgj:aweber:\" + aweber.account.lists.to_s)\n # logger.info(\"sgj:aweber:\" + aweber.account.lists[0].name.to_s)\n #aweber.account.lists.find_by_id(3702705).subscribers.create(new_subscriber)\n\n\n end\n\n\n\n ### update last activity date\n @goal.user.last_activity_date = @goal.user.dtoday\n @goal.user.deletion_warning = nil\n @goal.user.save\n \n ###############################################\n ###### START IF SFM_VIRGIN\n if session[:sfm_virgin] and session[:sfm_virgin] == true\n session[:sfm_virgin] = false\n @show_sales_overlay = true\n\n @user = current_user\n\n ### existing_user will be true if coming from an infusionsoft email invite\n ### in that case, do not send them another welcome email\n if !session[:existing_user]\n #### now that we have their first name, we can send the email \n the_subject = \"Confirm your HabitForge Subscription\"\n begin\n #if Rails.env.production?\n logger.error(\"sgj:goals_controller:about to send user confirmation to user \" + @user.email)\n Notifier.deliver_user_confirm(@user, the_subject) # sends the email\n #end\n rescue\n logger.error(\"sgj:email confirmation for user creation did not send\")\n end\n end\n\n\n # begin\n # #####################################################\n # #####################################################\n # #### UPDATE THE CONTACT FOR THEM IN INFUSIONSOFT ######\n # ### SANDBOX GROUP/TAG IDS\n # #112: hf new signup funnel v2 free no goal yet\n # #120: hf new signup funnel v2 free created goal\n # #\n # ### PRODUCTION GROUP/TAG IDS\n # #400: hf new signup funnel v2 free no goal yet\n # #398: hf new signup funnel v2 free created goal\n # if Rails.env.production?\n # Infusionsoft.contact_update(session[:infusionsoft_contact_id].to_i, {:FirstName => current_user.first_name, :LastName => current_user.last_name})\n # Infusionsoft.contact_add_to_group(session[:infusionsoft_contact_id].to_i, 398)\n # Infusionsoft.contact_remove_from_group(session[:infusionsoft_contact_id].to_i, 400)\n # end\n # #### END INFUSIONSOFT CONTACT ####\n # #####################################################\n # #####################################################\n # rescue\n # logger.error(\"sgj:error updating contact in infusionsoft\")\n # end\n end ### END IF SFM_VIRGIN\n ###### END IF SFM_VIRGIN\n ###############################################\n\n\n current_user.goal_temp = \"\"\n current_user.save\n end ### end if goal != a template\n\n \n if @goal.usersendhour == nil\n\t @goal.usersendhour = 20 ### 8pm\n end\n\n Time.zone = @goal.user.time_zone\n utcoffset = Time.zone.formatted_offset(false)\n offset_seconds = Time.zone.now.gmt_offset \n send_time = Time.utc(2000, \"jan\", 1, @goal.usersendhour, 0, 0) #2000-01-01 01:00:00 UTC\n central_time_offset = 21600 #add this in since we're doing UTC\n server_time = send_time - offset_seconds - central_time_offset\n puts \"User lives in #{@goal.user.time_zone} timezone, UTC offset of #{utcoffset} (#{offset_seconds} seconds).\" #Save this value in each goal, and use that to do checkpoint searches w/ cronjob\n puts \"For them to get an email at #{send_time.strftime('%k')} their time, the server would have to send it at #{server_time.strftime('%k')} Central time\"\n @goal.serversendhour = server_time.strftime('%k')\n @goal.gmtoffset = utcoffset \n #############\n \n \n\n if @goal.daym == nil \n @goal.daym = true\n end\n if @goal.dayt == nil \n @goal.dayt = true\n end\n if @goal.dayw == nil \n @goal.dayw = true\n end\n if @goal.dayr == nil \n @goal.dayr = true\n end\n if @goal.dayf == nil \n @goal.dayf = true\n end\n if @goal.days == nil \n @goal.days = true\n end\n if @goal.dayn == nil \n @goal.dayn = true\n end\n\n if [email protected]_owner_is_a_template\n if @goal.status != \"hold\" and @goal.daym and @goal.dayt and @goal.dayw and @goal.dayr and @goal.dayf and @goal.days and @goal.dayn and (@goal.goal_days_per_week == nil or @goal.goal_days_per_week == 7)\n @goal.status = \"start\"\n else\n @goal.status = \"monitor\"\n end\n end\n\n\n #########\n ### Once the goal is saved, set the start and stop dates\n\n \n dnow = get_dnow\n\n if @goal.status == \"hold\"\n @goal.start = Date.new(1900, 1, 1)\n @goal.stop = @goal.start \n end\n @goal.established_on = Date.new(1900, 1, 1)\n if (@goal.status == \"start\" or @goal.status == \"monitor\")\n start_day_offset = 1\n if params[:delay_start_for_this_many_days] \n start_day_offset = params[:delay_start_for_this_many_days].to_i\n end\n ### Set the standard dates\n @goal.start = dnow + start_day_offset\n @goal.stop = @goal.start + @goal.days_to_form_a_habit\n \t @goal.first_start_date = @goal.start \n @goal.save\n end\n\n ### save date changes\n @goal.save\n\n\n ####################################################################\n ####################################################################\n ##### ACCEPT AN INVITE\n ####################################################################\n ### if we are responding to an invitation to join a team\n if params[:invitation_id]\n begin\n attempt_to_join_team = false\n\n invite = Invite.find(params[:invitation_id].to_i)\n if invite and invite.purpose_join_team_id\n\n team = Team.find(invite.purpose_join_team_id)\n if team\n\n ### what kind of team?\n if team.goal_template_parent_id\n\n ### template based team\n if @goal.template_user_parent_goal_id and (@goal.template_user_parent_goal_id == team.goal_template_parent_id)\n attempt_to_join_team = true\n end\n\n else\n\n ### category-based team\n if team.category_name and @goal.category and (team.category_name == @goal.category)\n attempt_to_join_team = true\n end\n\n end\n\n if attempt_to_join_team\n if @goal.join_goal_to_a_team(team.id)\n logger.info(\"sgj:goals_controller.rb:success adding goal to team when responding to invitation\")\n\n\n ### we actually want to delete the invite, not save it\n ### that way if the new team member removes their goal and then\n ### changes their mind later, we can send them another invite\n #invite.accepted_on = current_user.dtoday\n #invite.save\n invite.destroy\n\n\n #### SEND INVITE ACCEPTANCE TO OWNER\n begin\n if Notifier.deliver_to_team_owner_invite_accepted(@goal, team.owner) # sends the email \n logger.info(\"sgj:goals_controller.rb:create:SUCCESS SENDING INVITE ACCEPTANCE EMAIL\") \n else\n logger.error(\"sgj:goals_controller.rb:create:FAILURE SENDING INVITE ACCEPTANCE EMAIL:goal_id = \" + @goal.id.to_s)\n end\n rescue\n logger.error(\"sgj:goals_controller.rb:create:(rescue)FAILURE SENDING INVITE ACCEPTANCE EMAIL:goal_id = \" + @goal.id.to_s)\n end\n #### END SEND INVITE ACCEPTANCE TO OWNER\n\n\n else\n logger.error(\"sgj:goals_controller.rb:failed to add goal to team when responding to invitation\")\n end\n else\n logger.error(\"sgj:goals_controller.rb:the team invite was a mis-match for either this goal category or this goal parent template .. not trying to join team\") \n end\n\n end ### if team\n\n end ### if invite and invite.purpose_join_team_id\n\n rescue\n logger.error(\"sgj:goals_controller.rb:error trying to add goal to team when responding to invitation\")\n end\n\n end ### if session[:accepting_invitation_id]\n ####################################################################\n ##### END ACCEPT AN INVITE\n ####################################################################\n ####################################################################\n\n\n\n ####################################################################\n ####################################################################\n ##### PROGRAM ENROLLMENT\n ####################################################################\n\n ### create a program enrollment record if a program is involved\n ### goal and program are linked via goal.goal_added_through_template_from_program_id\n if @goal.program\n\n ### check to see if an enrollment exists... if not, create one\n enrollment = ProgramEnrollment.find(:first, :conditions => \"program_id = '#{@goal.program.id}' and user_id = '#{@goal.user.id}'\")\n if !enrollment\n enrollment = ProgramEnrollment.new()\n # t.integer \"program_id\"\n # t.integer \"user_id\"\n # t.boolean \"active\"\n # t.boolean \"ongoing\"\n # t.integer \"program_session_id\"\n # t.date \"personal_start_date\"\n # t.date \"personal_end_date\"\n enrollment.program_id = @goal.program.id\n enrollment.user_id = @goal.user.id\n enrollment.active = true\n enrollment.ongoing = true\n\n enrollment.save\n\n end ### end if !enrollment\n end ### end if @goal.program\n\n ####################################################################\n ##### END PROGRAM ENROLLMENT\n ####################################################################\n ####################################################################\n\n\n\n ### we don't need/want these anymore\n ### destroy them so that they don't mess up a future new goal\n session[:goal_added_through_template_from_program_id] = nil\n session[:template_user_parent_goal_id] = nil\n session[:goal_template_text] = nil\n session[:category] = nil\n session[:accepting_invitation_id] = nil\n\n \n if @goal.status == \"hold\"\n ### don't send an email if it's on hold\n else\n begin \n if session[:sponsor] == \"clearworth\"\n #Notifier.deliver_goal_creation_notification_clearworth(@goal) # sends the email\n elsif session[:sponsor] == \"forittobe\"\n #Notifier.deliver_goal_creation_notification_forittobe(@goal) # sends the email\n elsif session[:sponsor] == \"marriagereminders\"\n #Notifier.deliver_goal_creation_notification_marriagereminders(@goal) # sends the email\n else\n #Notifier.deliver_goal_creation_notification(@goal) # sends the email\n end\n rescue\n puts \"Error while sending goal notification email from Goal.create action.\"\n end\n end\n\n\n\n ### if this new template was created to be part of an existing program\n if params[:program_id] or params[:return_to_program_view]\n if params[:return_to_program_view]\n format.html {redirect_to(\"/programs/#{params[:return_to_program_view]}/view\")}\n else\n\n ### if the program is a \"structured program\" you're going to want to go directly to edit mode\n p = Program.find(params[:program_id].to_i)\n if p and p.structured\n\n pt = ProgramTemplate.find(:first, :conditions => \"program_id = '#{p.id}' and template_goal_id = '#{@goal.id}'\")\n format.html {redirect_to(\"/program_templates/#{pt.id.to_s}/edit\")}\n\n else\n format.html {redirect_to(\"/programs/#{params[:program_id]}#action_items\")}\n end\n\n\n end\n\n else\n\n begin \n ### attempt to add to encourage_items\n\n\n # when a goal is created,\n # if username != unknown,\n # if the goal is public,\n # then enter it into encourage_items\n\n # --- encourage_item ---\n # encourage_type_new_checkpoint_bool (index)\n # encourage_type_new_goal_bool (index)\n # checkpoint_id\n # checkpoint_status\n # checkpoint_date (index)\n # checkpoint_updated_at_datetime\n # goal_id (index)\n # goal_name\n # goal_category\n # goal_created_at_datetime\n # goal_publish\n # goal_first_start_date (index)\n # goal_daysstraight\n # goal_days_into_it\n # goal_success_rate_percentage\n # user_id (index)\n # user_name\n # user_email\n\n logger.debug \"sgj:goals_controller.rb:consider adding to encourage_items\"\n if @goal.user.first_name != \"unknown\"\n if @goal.is_public\n logger.debug \"sgj:goals_controller.rb:candidate for encourage_items\"\n\n encourage_item = EncourageItem.new\n logger.debug \"sgj:goals_controller.rb:new encourage_items instantiated\"\n\n encourage_item.encourage_type_new_checkpoint_bool = false\n encourage_item.encourage_type_new_goal_bool = true\n\n #encourage_item.checkpoint_id = nil\n encourage_item.checkpoint_id = @goal.id ### a workaround to the validation that checkpoint_id is unique\n\n encourage_item.checkpoint_status = nil\n encourage_item.checkpoint_date = nil\n encourage_item.checkpoint_updated_at_datetime = nil\n encourage_item.goal_id = @goal.id\n encourage_item.goal_name = @goal.title\n encourage_item.goal_category = @goal.category\n encourage_item.goal_created_at_datetime = @goal.created_at\n encourage_item.goal_publish = @goal.publish\n encourage_item.goal_first_start_date = @goal.first_start_date\n encourage_item.goal_daysstraight = @goal.daysstraight\n encourage_item.goal_days_into_it = @goal.days_into_it\n encourage_item.goal_success_rate_percentage = @goal.success_rate_percentage\n encourage_item.user_id = @goal.user.id\n encourage_item.user_name = @goal.user.first_name\n encourage_item.user_email = @goal.user.email\n\n logger.debug \"sgj:goals_controller.rb:about to save encourage_items\"\n\n if encourage_item.save\n logger.info(\"sgj:goals_controller.rb:success saving encourage_item\")\n else\n logger.error(\"sgj:goals_controller.rb:error saving encourage_item\")\n end\n logger.debug \"sgj:goals_controller.rb:new encourage_item.id = \" + encourage_item.id.to_s\n\n end\n end\n\n rescue\n logger.error \"sgj:error adding to encourage_items\"\n end\n\n\n if @show_sales_overlay\n ### format.html { render :action => \"edit\" }\n\n if Rails.env.production?\n\n ### show the sales page and eventually kick back to optimize when they cancel\n #format.html {redirect_to(\"https://www.securepublications.com/habit-gse3.php?ref=#{current_user.id.to_s}&email=#{current_user.email}\")}\n\n ### do not show the sales page first, just kick to optimize\n format.html {redirect_to(\"/goals?optimize_my_first_goal=1&email=#{current_user.email}&single_login=1\")}\n\n else\n session[:dev_mode_just_returned_from_sales_page] = true\n format.html {redirect_to(\"/goals?optimize_my_first_goal=1&email=#{current_user.email}&single_login=1\")}\n end\n\n format.xml { render :xml => @goals }\n else\n\n\n ##### SUCCESSFULLY SAVED A NEW GOAL ... REDIRECT TO ???\n\n # if session[:sfm_virgin]\n # format.html { redirect_to(\"/goals/#{@goal.id}/edit?just_created_new_habit=1&just_created_first_habit=1\")}\n # else \n # format.html { redirect_to(\"/goals/#{@goal.id}/edit?just_created_new_habit=1\")}\n # end\n\n\n # if !current_user.is_habitforge_supporting_member\n # format.html {redirect_to(\"/goals?too_many_active_habits=1&just_created_new_habit=1\")} \n # else\n # format.html { render :action => \"index\" } # index.html.erb\n # end\n \n # if !current_user.is_habitforge_supporting_member\n # format.html { redirect_to(\"https://habitforge.com/widget/upgrade\")}\n # else\n format.html { redirect_to(\"/goals/#{@goal.id}/edit?just_created_new_habit=1\")}\n # end\n\n\n\n format.xml { render :xml => @goals }\n end\n\n end \n\n\n\n \n\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @goal.errors, :status => :unprocessable_entity }\n end\n end\n end", "def make_email(opts)\n mail = Mail.new\n mail.to opts.msg_to\n mail.from opts.msg_from\n mail.cc opts.msg_cc if opts.key? \"cc\"\n mail.subject opts[\"subject\"]\n mail.html_part do\n content_type \"text/html; charset=UTF-8\"\n body opts.msg_body\n end\n opts.msg_attachments.each { |f| mail.add_file f }\n mail\n end", "def create\n if params[:create_button]\n redirect_to new_decision_path(:title => params[:decision][:title])\n\n elsif params[:copy_button]\n redirect_to duplicate_decision_path(:id => params[:decision][:clone_id],\n :clone_id => params[:decision][:clone_id],\n :title => params[:decision][:title],\n :author => params[:decision][:author],\n :email => params[:decision][:email])\n else\n @decision = Decision.new(decision_params)\n @decision.state = \"options\"\n @decision.ratio = 0\n @decision.save\n\n # Create primary user (the admin)\n user = User.new\n user.email = @decision.email\n user.name = @decision.author\n user.save\n\n @decision.user_id = user.id\n @decision.save\n\n # Create participant entry for the user\n @participant = Participant.new\n @participant.decision_id = @decision.id\n @participant.user_id = user.id\n @participant.invited = false\n @participant.admin = true\n @participant.save\n\n\n if @participant.invited == false\n UserMailer.participate_email(@participant).deliver\n @participant.invited = true\n @participant.save\n end\n\n redirect_to dashboard_participant_path(@participant)\n end\n\n end", "def setup\n @mike = users(:mike)\n @admin = users(:frank)\n @issue = issues(:one)\n @update = updates(:one)\n end", "def create\n @interview = Interview.new(interview_params)\n params[:interview][:participant_ids].each do |participant_id|\n unless participant_id.empty?\n participant = Participant.find(participant_id)\n @interview.participants << participant\n end\n end\n respond_to do |format|\n if @interview.save\n d = @interview.interviewDate\n t = @interview.startTime\n start = DateTime.new(d.year,d.month,d.day,t.hour,t.min,t.sec,t.zone).utc.to_i\n current = Time.now.utc.to_i\n participants = @interview.participants\n # ReminderMailer.sample_email(\"[email protected]\").deliver_now\n # HardWorker.perform_in((start-current-1800).seconds,participants)\n # puts participants[0].email, participants[1].email\n emails = []\n participants.each do |p|\n emails += [p.email]\n ReminderMailer.created_email(p.email).deliver_now\n end\n puts emails\n # HardWorker.perform_at(2.seconds,emails)\n HardWorker.perform_at((start-current-1800).seconds,emails)\n format.html { redirect_to @interview, notice: 'Interview was successfully created.' }\n format.json { render :show, status: :created, location: @interview }\n else\n format.html { render :new }\n format.json { render json: @interview.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_multiple_discussion\n host_port = request.host_with_port\n session[:current_images] = (0...8).map{65.+(rand(25)).chr}.join unless session[:current_images]\n @disc_error = @login_user.add_multiple_discussion?(params[:discussion],session[:current_images])\n if @disc_error.class.to_s == \"Discussion\" || @disc_error.class.to_s == \"UserDiscussion\"\n @discussion = @disc_error.class.to_s == \"Discussion\" ? @disc_error : @disc_error.discussion\n @message = \"Discussion posted sucessfully.\"\n else\n @message = @disc_error\n end\n if [email protected]?\n @message = \"Discussion posted sucessfully.\"\n\n if @discussion.share_type == \"groups\"\n @dgd = DiscussionGroupDiscussion.new(:discussion_group_id=>params[:posted_to].to_i,:discussion_id=>@discussion.id)\n @message = @dgd.save ? \"Discussion posted sucessfully.\" : \"Discussion already exists.\"\n group_members = @dgd.discussion_group.discussion_group_users.where(\"user_id!=#{@login_user.id}\")\n group_members.each do |group_member|\n Notifier.delay.mail_to_group_member(group_member.user.email, @login_user.username, host_port, group_member.discussion_group.name, @discussion) unless @login_user.is_follower?(group_member.user_id)\n end if @dgd.save && @dgd.discussion_group.is_public == false\n\n @dgd.discussion_group.non_site_users.where(:invitation_type=>\"Added\").each do |group_member|\n NonSiteUser.create(:invitable_id=>@discussion.id, :invitable_type=>\"Discussion\", :invitation_type=>\"Invited\", :email=>group_member.email)\n Notifier.delay.mail_to_nsu_on_disc(group_member.email, @login_user.username, host_port, @discussion,group_member.id) if @dgd.discussion_group.is_public != true\n #Notifier.mail_to_private_group_user(group_member.email, @login_user.username, host_port, @dgd.discussion_group.name).deliver if @dgd.discussion_group.is_public != true\n end if @dgd.save && @dgd.discussion_group.is_public == false\n end\n end\n # @discuss = Discussion.new(:title => \"title\", :discussion => \"discussion\", :discussion_type => \"Picture\", :share_type => \"#{session[:current_images]}\")\n user_discussion = @disc_error.user_discussions.build\n user_discussion.user_id = @login_user.id\n @picture = @disc_error.images.build(:photo => params[:picture][:path], :details => \"Discussion Picture\", :user_id => @login_user.id)\n if @disc_error.save\n respond_to do |format|\n format.html { #(html response is for browsers using iframe sollution)\n render :json => [@picture.to_jq_upload].to_json,\n :content_type => 'text/html',\n :layout => false\n }\n format.json {\n render :json => [@picture.to_jq_upload].to_json\n }\n end\n else\n render :json => [{:error => \"custom_failure\"}], :status => 304\n end\n end", "def initialize(options = {})\n @options = options\n @username = options['username']\n @name = options['name']\n @markdown_name = options['markdown_name']\n @role = options['role']\n @projects = options['projects']\n @available = options['available']\n @hungry = options['hungry']\n @reduced_capacity = options['reduced_capacity']\n @tz_offset_hours = options['tz_offset_hours']\n end", "def publish_opts\n options = {}\n options[:in_reply_to_status_id] = in_reply_to_status_id if reply?\n options\n end", "def set_talk\n @talk = Talk.find_by(user_one_id: [params[:id], current_user.id], user_two_id: [params[:id], current_user.id], team: params[:team_id])\n # If talk not yet created\n unless @talk\n @team = Team.find(params[:team_id])\n @user = User.find(params[:id])\n # Check if current_user and user are team members\n if @team.my_users.include? current_user and @team.my_users.include? @user\n @talk = Talk.create(user_one: current_user, user_two: @user, team: @team)\n end\n end\n end", "def setup_template_variables(rid)\n @rid = rid\n @request_data = JSON.parse @rid.request_data\n @response_data = JSON.parse @rid.response_data\n end", "def setup_email(options)\n @recipients = options[:recipients]\n @from = options[:from] || SocialNewsConfig[\"email_addrs\"][\"support\"] \n @cc = options[:cc] || ''\n @bcc = options[:bcc] || ''\n @subject = SUBJECT_PREFIX + (options[:subject] || 'No Subject')\n @body = options[:body] || {}\n @headers = options[:headers] || {}\n @charset = options[:charset] || 'utf-8'\n end", "def create\n @talk = Talk.new(talk_params)\n @talk.sender = current_user\n\n respond_to do |format|\n if @talk.save\n format.html { redirect_to talks_user_path(@talk.recepient) }\n format.json { render :show, status: :created, location: @talk }\n else\n format.html { render :new }\n format.json { render json: @talk.errors, status: :unprocessable_entity }\n end\n end\n end", "def configure_information\n @config[\"config\"][\"contact\"] = {}\n if @args.empty?\n @config[\"config\"][\"organization_name\"] = @prompt.ask(prompt_box(\"What is your organization\\'s name?\"), required: true)\n @config[\"config\"][\"organization_description\"] = @prompt.ask(prompt_box(\"What is your organization\\'s description?\"))\n @config[\"config\"][\"organization_domain\"] = @prompt.ask(prompt_box(\"What is your organization\\'s custom URL that you would like to host the app at? (ex. demo.perlmutterapp.com) Leave blank to use the default instead.\"))\n prefs = @prompt.multi_select(prompt_box(\"Please select contact preferences to configure for your users to view:\"), %W[email phone facebook twitter instagram website])\n if prefs.count != 0\n @config[\"config\"][\"contact\"][\"description\"] = @prompt.ask(prompt_box(\"Enter a description for your contact page:\"), default: \"Fill out the form to send us a message!\", required: true)\n end\n if prefs.include? \"email\"\n @config[\"config\"][\"contact\"][\"email\"] = @prompt.ask(prompt_box(\"What is your contact email?\"), default: @config[\"config\"][\"contact\"][\"email\"], required: true) { |q| q.validate :email, \"Invalid email\" }\n end\n if prefs.include? \"phone\"\n @config[\"config\"][\"contact\"][\"phone\"] = @prompt.ask(prompt_box(\"What is your contact phone?\"), default: @config[\"config\"][\"contact\"][\"phone\"], required: true)\n end\n if prefs.include? \"facebook\"\n @config[\"config\"][\"contact\"][\"facebook\"] = @prompt.ask(prompt_box(\"What is your Facebook account?\"), default: @config[\"config\"][\"contact\"][\"facebook\"], required: true)\n end\n if prefs.include? \"twitter\"\n @config[\"config\"][\"contact\"][\"twitter\"] = @prompt.ask(prompt_box(\"What is your Twitter account?\"), default: @config[\"config\"][\"contact\"][\"twitter\"], required: true)\n end\n if prefs.include? \"instagram\"\n @config[\"config\"][\"contact\"][\"instagram\"] = @prompt.ask(prompt_box(\"What is your Instagram account?\"), default: @config[\"config\"][\"contact\"][\"instagram\"], required: true)\n end\n if prefs.include? \"website\"\n @config[\"config\"][\"contact\"][\"website\"] = @prompt.ask(prompt_box(\"What is your external website?\"), default: @config[\"config\"][\"contact\"][\"website\"], required: true)\n end\n else\n @config[\"config\"][\"organization_name\"] = get_argument_value(\"org_name\", true, nil)\n description = get_argument_value(\"org_desc\", false, nil)\n unless description.nil?\n @config[\"config\"][\"organization_description\"] = description\n end\n domain = get_argument_value(\"org_domain\", false, nil)\n unless domain.nil?\n @config[\"config\"][\"organization_domain\"] = domain\n end\n contact_description = get_argument_value(\"contact_desc\", false, nil)\n unless contact_description.nil?\n @config[\"config\"][\"contact\"][\"description\"] = contact_description\n end\n email = get_argument_value(\"org_email\", false, nil)\n unless email.nil?\n @config[\"config\"][\"contact\"][\"email\"] = email\n end\n phone = get_argument_value(\"org_phone\", false, nil)\n unless phone.nil?\n @config[\"config\"][\"contact\"][\"phone\"] = phone\n end\n facebook = get_argument_value(\"org_facebook\", false, nil)\n unless facebook.nil?\n @config[\"config\"][\"contact\"][\"facebook\"] = facebook\n end\n twitter = get_argument_value(\"org_twitter\", false, nil)\n unless twitter.nil?\n @config[\"config\"][\"contact\"][\"twitter\"] = twitter\n end\n instagram = get_argument_value(\"org_instagram\", false, nil)\n unless instagram.nil?\n @config[\"config\"][\"contact\"][\"instagram\"] = instagram\n end\n website = get_argument_value(\"org_website\", false, nil)\n unless website.nil?\n @config[\"config\"][\"contact\"][\"website\"] = website\n end\n end\n success_prompt(\"Organization details configured.\")\nend", "def og_create\n\t\tputs params\n \t\t@topic = Topic.new(account_id: current_account.id, topic_sentence: params[:topic_sentence], description: params[:description], left_side_topic: params[:left_side_topic], right_side_topic: \"\")\n \t\t\n\n \t\tstory = @topic.build_story\n \t\tog = OpenGraph.new(params[:og_url])\n\n \t\tstory.og_topic = og.title\n \t\tstory.og_type = og.type\n \t\tstory.og_description = og.description\n \t\tstory.og_image_url = og.images.first\n \t\tstory.og_url = params[:og_url]\n\n\n\t\tdebate = @topic.debates.build\n\t\tif @topic.save\n \t\t\tif story.save!\n \t\t\t \tdebate.register_participant current_account.id, \"left\"\n\n \t\t\t \tif params[:opponent_email] != \"\"\n \t\t\t \t\tChallenge.create!(:topic_id => @topic.id, :challenger_id => current_account.id, challengee_email: params[:opponent_email])\n \t\t\t\t\tUserMailer.invitation_by_email(current_account, params[:opponent_email], Topic.find(@topic.id)).deliver\n\t\t \t\telsif params[:selected_opponent_id] != \"-1\"\n\t\t \t\t\tChallenge.create!(:topic_id => @topic.id, :challenger_id => current_account.id, challengee_id: params[:selected_opponent_id])\n \t\t\t\t\tUserMailer.invitation_by_email(current_account, Account.find(params[:selected_opponent_id]).email, Topic.find(@topic.id)).deliver\n\t\t \t\telse\n\t\t \t\t\tChallenge.create!(:topic_id => @topic.id, :challenger_id => current_account.id, status: \"open\")\n \t\t\t\t\t\n\t\t \t\tend\n\t\t \t\t\t \t\t\t\n\t\t\t respond_to do |format|\n\t\t\t \t\t\t@debate = debate\n\t\t\t \t\t\t@account = \"\"\n\t\t\t \t\t\tif params[:selected_opponent_id] == \"-1\"\n\t\t\t \t\t\t\t@account = \"--no_account--\"\n\t\t\t \t\t\telse\n\t\t\t\t\t\t\t@account = Account.find(params[:selected_opponent_id])\t\t\t\t\n\t\t\t\t\t\tend\n\t\t\t\t\t\tformat.js {render \"topics/og_create.js.erb\", status: :ok}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tend\n\t\t \t\t\n \t\t\t\t#j render(:partial => \"topics/partials/rich_topic_index\", :locals => {topic: @topic, debate: debate})\n \t\t\tend \t\t\t\n \t\telse \n \t\t\t#flash[:notice] = topic_params\n \t\t\tredirect_to(:action => 'index')\n \t\tend\n\tend", "def setup_data\n (@users = ['kozaki', 'tanaka', 'yamada', 'suzuki', 'fukaya']).each do |name|\n eval(\"@#{name} = FactoryGirl.create(:user, :name => '#{name}')\")\n end\n\n (@friendships = [\n [ '@kozaki' , '@yamada'], [ '@kozaki' , '@tanaka'],\n [ '@yamada' , '@suzuki'],\n [ '@tanaka' , '@suzuki'],\n [ '@suzuki' , '@kozaki'], [ '@suzuki' , '@fukaya'],\n [ '@fukaya' , '@yamada']\n ]).each do |user, friend|\n eval(\"FactoryGirl.create(:friendship, \n :user => #{user}, :friend => #{friend})\")\n end\n\n @received_message = \n FactoryGirl.create(:message,\n :to_user => @fukaya, :from_user => @kozaki)\n @received_feedbacks = []\n [ ['@yamada', true], ['@tanaka', false], ['@suzuki', true], ['@fukaya', true] ].\n each do |user, value|\n eval(\"@received_feedbacks << \n FactoryGirl.create(:feedback, :message => @received_message,\n :user => #{user}, :good => #{value})\")\n end\n\n @rejected_message =\n FactoryGirl.create(:message,\n :to_user => @fukaya, :from_user => @kozaki)\n @rejected_feedbacks = []\n [ ['@yamada', true], ['@tanaka', false], ['@suzuki', false] ].\n each do |user, value|\n eval(\"@rejected_feedbacks << \n FactoryGirl.create(:feedback, :message => @rejected_message,\n :user => #{user}, :good => #{value})\")\n end\n\n @just_send_message = \n FactoryGirl.create(:message,\n :to_user => @fukaya, :from_user => @kozaki,\n :joke => 'joke000')\n @midflow_message =\n FactoryGirl.create(:message,\n :to_user => @fukaya, :from_user => @kozaki)\n @midflow_feedbacks = []\n @midflow_feedbacks << \n FactoryGirl.create(:feedback, :message => @midflow_message,\n :user => @yamada, :good => false)\nend", "def get_conversation_participant_wrapup_with_http_info(conversation_id, participant_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.get_conversation_participant_wrapup ...\"\n end\n \n \n # verify the required parameter 'conversation_id' is set\n fail ArgumentError, \"Missing the required parameter 'conversation_id' when calling ConversationsApi.get_conversation_participant_wrapup\" if conversation_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'participant_id' is set\n fail ArgumentError, \"Missing the required parameter 'participant_id' when calling ConversationsApi.get_conversation_participant_wrapup\" if participant_id.nil?\n \n \n \n \n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/conversations/{conversationId}/participants/{participantId}/wrapup\".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'provisional'] = opts[:'provisional'] if opts[:'provisional']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'AssignedWrapupCode')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#get_conversation_participant_wrapup\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def initialize(opts={})\n self.from = opts[:from]\n self.to = opts[:to]\n self.message = opts[:message]\n self.subject = opts[:subject]\n end", "def create\n @meeting = Meeting.new(params[:meeting])\n @iteration = Iteration.find(params[:meeting][:iteration_id])\n respond_to do |format|\n if developer?\n if @meeting.save\n flash[:notice] = 'Meeting was successfully created.'\n format.html do \n \n params[:users].each do |uid|\n user = User.find(uid)\n MeetingParticipant.create(:user => user, :meeting => @meeting)\n end if params.key? :users\n \n redirect_to(iteration_stories_url(@iteration))\n end\n format.xml { render :xml => @meeting, :status => :created, :location => @meeting }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @meeting.errors, :status => :unprocessable_entity }\n end\n else\n format.xml { render :xml => XML_ERRORS[:not_authorized] }\n end\n end\n end", "def create\n initiator = self.load_user(params)\n\n if initiator != nil\n new_meeting = Meeting.create\n new_meeting.initiator_id = initiator.id\n new_meeting.location = params[\"meeting\"][\"location\"]\n new_meeting.title = params[\"meeting\"][\"title\"]\n new_meeting.participants << initiator\n new_meeting.save!\n self.send_json(build_custom_meeting_json(meeting: new_meeting))\n else\n self.send_error 401\n end\n end", "def initialize(run, opts={ send_all_answers: false} )\n @send_all_answers = opts[:send_all_answers]\n url = \"#{Sender::self_url}#{Rails.application.routes.url_helpers.run_path(run)}\"\n @payload = {\n id: run.key,\n url: url,\n run_count: run.run_count,\n created_at: run.created_at,\n updated_at: run.updated_at,\n activity_id: run.activity_id,\n remote_id: run.remote_id,\n page_id: run.page_id,\n sequence_id: run.sequence_id,\n sequence_run_id: run.sequence_run_id,\n collaboration_run_id: run.collaboration_run_id,\n answers: serlialized_answers(run)\n }\n add_meta_data(run, @payload)\n end", "def participant_params\n params.require(:participant).permit(:main_language, :years_programming, :language_choice, :client_w, :client_h)\n end", "def show\n \n is_user_signed_in(\"part/show\")\n \n if params[:name] \n if params[:id] ## item_id\n @participant = Participant.joins(:items).where(\"items.item_id = :iid\", {iid: params[:id]}) \n render :partial => 'participants/nae_readonly', participant: @participant, item_type: 'borrow' \n end \n end \n \n \n if params[:id] \n @lookup = params[:id] \n else \n @lookup = id \n end \n @editable = 1 \n logger.debug \"IN PART/SHOW\"\n logger.debug @lookup\n if @lookup \n \n case @lookup.to_s \n when 'user_nae' \n render 'user_nae'\n when 'community_members' \n @participant = Participant.where(\"participant_id = :pid\", {pid: getParticipantID})\n @members = Participant.where(\"community_id = :cid\", {cid: getCommunityID})\n render 'participants/community_members', \n :locals => {participant: @participant, members: @members, editable: 0, num_rows: 0}\n when 'user_agreement' \n @participant = Participant.find_by_participant_id( getParticipantID) \n render :template => 'participants/user_agreement', participant: @participant, editable: @editable \n when 'main_user_detail' \n logger.debug \"FINISHED ACTIVATION S?B HERE\"\n session[:current_div] = \"nae\" \n is_user_signed_in(\"main user detail\")\n @user = User.find(getUserID)\n @participant = Participant.find_by(user_id: getUserID)\n logger.debug \n @contact_preference = ContactPreference.where(\"participant_id = :pid\", {pid: getParticipantID}).first\n if @contact_preference.nil?\n @contact_preference = ContactPreference.new\n end\n if getCommunityID\n @community = Community.find_by(user_id: getUserID)\n end\n \n if getUserType == 'lend' || getUserType == 'both'\n @lender_transfer = LenderTransfer.where(\"participant_id = :pid\", {pid: getParticipantID}).first\n \n if @lender_transfer.nil? \n @lender_transfer = LenderTransfer.new\n end\n \n @lender_item_condition = LenderItemCondition.where(\"participant_id = :pid\", {pid: getParticipantID}).first\n \n if @lender_item_condition.nil?\n @lender_item_condition = LenderItemCondition.new\n end\n end\n render 'participants/main_user_detail',\n :locals => {lender_transfer: @lender_transfer, lender_item_condition: @lender_item_condition, \n participant: @participant, community: @community, contact_preference: @contact_preference, user: @user, editable: @editable}\n end \n \n else \n\n unless getParticipantID.nil? \n \t\t @participant = Participant.find_by_participant_id( getParticipantID) \n else \n \t\t @participant = Participant.new \n end \n \t\n \t render 'participants/user_nae', participant: @participant, editable: @editable \n\t\n end \n raise Forbidden, \"You are not allowed to access participant information.\"\n end", "def initialize(opts={})\n assert_valid_opts(opts)\n setup_pages\n end", "def get_conversations_message_participant_wrapup_with_http_info(conversation_id, participant_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.get_conversations_message_participant_wrapup ...\"\n end\n \n \n # verify the required parameter 'conversation_id' is set\n fail ArgumentError, \"Missing the required parameter 'conversation_id' when calling ConversationsApi.get_conversations_message_participant_wrapup\" if conversation_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'participant_id' is set\n fail ArgumentError, \"Missing the required parameter 'participant_id' when calling ConversationsApi.get_conversations_message_participant_wrapup\" if participant_id.nil?\n \n \n \n \n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/conversations/messages/{conversationId}/participants/{participantId}/wrapup\".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'provisional'] = opts[:'provisional'] if opts[:'provisional']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'AssignedWrapupCode')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#get_conversations_message_participant_wrapup\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def setup_defaults\n @program_title = 'PROGRAM TITLE'\n @program_site = 'PROGRAM SITE'\n @request_availability = false\n @meeting_times = ''\n @sourcing_options = ''\n @course_options = ''\n @student_id_required = false\n @student_id_format = ''\n @student_id_format_help = ''\n @student_id_excluded_chars = ''\n @contact_email = '[email protected]'\n @is_preaccelerator_student = false\n end", "def send_email_to_participants(request)\n unless RAILS_ENV == \"test\"\n recipients(last_message.sender).each do |recipient|\n if recipient.settings.email_when_new_comment == 1\n UserMailer.deliver_notification_of_new_message(recipient, last_message, request)\n end \n end\n end\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 talk_params\n params.require(:talk).permit(:body, :sender_id, :recepient_id)\n end", "def create \n params[:subject][:title].strip! if !params[:subject][:title].nil?\n params[:subject][:content].strip! if !params[:subject][:content].nil?\n @subject = Subject.new(params.require(:subject).permit(:title, :content, :for_correctors, :important, :for_wepion))\n @subject.user = current_user.sk\n @subject.last_comment_time = DateTime.now\n @subject.last_comment_user = current_user.sk\n \n @subject.for_wepion = false if @subject.for_correctors # We don't allow Wépion if for correctors\n\n if @subject.title.size > 0\n @subject.title = @subject.title.slice(0,1).capitalize + @subject.title.slice(1..-1)\n end\n\n # Set associated object (category, section, chapter, exercise, problem)\n err = set_associated_object\n error_create([err]) and return if !err.empty?\n\n # Attached files\n @error_message = \"\"\n attach = create_files\n error_create([@error_message]) and return if !@error_message.empty?\n\n if @subject.save\n attach_files(attach, @subject)\n\n if current_user.sk.root?\n for g in [\"A\", \"B\"] do\n if params.has_key?(\"groupe\" + g)\n User.where(:group => g).each do |u|\n UserMailer.new_message_group(u.id, @subject.id, current_user.sk.id).deliver\n end\n end\n end\n end\n\n flash[:success] = \"Votre sujet a bien été posté.\"\n redirect_to subject_path(@subject, :q => @q)\n else\n destroy_files(attach)\n error_create(@subject.errors.full_messages) and return\n end\n end", "def interview_request(interview, employer, candidate)\n @interview = interview\n @employer = employer\n @candidate = candidate\n \n subject = \"Takeoff - Interview Request\"\n \n mail to: \"[email protected]\", subject: subject\n \n \n end", "def initialize(offering = nil, poster_session_type_id = 1, oral_session_type_id = 2)\n @offering = offering\n @content = \"\"\n @skipped_applications = []\n @skipped_group_members = []\n @poster_session_type_id = poster_session_type_id\n @oral_session_type_id = oral_session_type_id\n end", "def conflict_notification\n if session[:user].role_id !=6\n @instructor = session[:user]\n else\n @instructor = Ta.get_my_instructor(session[:user].id)\n end\n @participant = AssignmentParticipant.find(params[:id])\n @assignment = Assignment.find(@participant.parent_id)\n\n\n @questions = Hash.new\n questionnaires = @assignment.questionnaires\n questionnaires.each {\n |questionnaire|\n @questions[questionnaire.symbol] = questionnaire.questions\n }\n\n @reviewers_email_hash = Hash.new\n\n @caction = \"view\"\n @submission = params[:submission]\n if @submission == \"review\"\n @caction = \"view_review\"\n @symbol = \"review\"\n process_response(\"Review\", \"Reviewer\", @participant.get_reviews, \"ReviewQuestionnaire\")\n elsif @submission == \"review_of_review\"\n @symbol = \"metareview\"\n process_response(\"Metareview\", \"Metareviewer\", @participant.get_metareviews, \"MetareviewQuestionnaire\")\n elsif @submission == \"review_feedback\"\n @symbol = \"feedback\"\n process_response(\"Feedback\", \"Author\", @participant.get_feedback, \"AuthorFeedbackQuestionnaire\")\n elsif @submission == \"teammate_review\"\n @symbol = \"teammate\"\n process_response(\"Teammate Review\", \"Reviewer\", @participant.get_teammate_reviews, \"TeammateReviewQuestionnaire\")\n end\n\n @subject = \" Your \"[email protected]+\" score for \" + @assignment.name + \" conflicts with another \"[email protected]+\"'s score.\"\n @body = get_body_text(params[:submission])\n\n end", "def initialize\n options = parse_options\n CONFIG[:user] = options[:user]\n $config = CONFIG.merge(YAML.load_file(\"#{options[:prefix]}/#{options[:'config-dir']}/config.yml\").rekey) rescue CONFIG.clone\n $config.merge!(options)\n [:'config-dir', :'pid-file', :'log-file', :'spool-dir'].each {|item| $config[item] = \"#{$config[:prefix]}/#{$config[item]}\".sub(/\\/\\//, '/') }\n $messages = MESSAGES.merge(YAML.load_file(\"#{$config[:'config-dir']}/messages.yml\").rekey) rescue MESSAGES.clone\n $recipients = YAML.load_file(\"#{$config[:'config-dir']}/recipients.yml\") rescue {}\n end", "def emit_meeting(cur_mtg_dir, svn_mtg_dir, dt, num_members, quorum_need, num_proxies, attend_irc)\n _div id: \"meeting-#{dt.year}\"\n _whimsy_panel(\"All Meeting Details for #{dt.strftime(DTFORMAT)}\", style: 'panel-info') do\n if Time.now > dt\n _p do\n _ 'At the time of this past meeting, we had:'\n _ul do\n _li \"#{num_members} eligible voting Members,\"\n _li \"#{quorum_need} needed for quorum (one third),\"\n _li \"#{num_proxies} proxy assignments available for the meeting,\"\n _li \"And hoped that at least #{attend_irc} would attend the start of meeting.\"\n end\n attendees_file = File.join(cur_mtg_dir, 'attend')\n if File.exist?(attendees_file)\n attendees = File.readlines(attendees_file)\n _ \"By the end of the meeting, we had a total of #{attendees.count} Members participating (either via attending IRC, sending a proxy, or voting via email)\"\n else\n _p.alert.alert_danger do\n _span \"Unable to calculate participating members (\"\n _code \"attend\"\n _span \"file does not yet exist for meeting)\"\n end\n end\n end\n _p \"These are historical links to the past meeting's record.\"\n else\n _p \"Live links to the upcoming meeting records/ballots/how-tos are below.\"\n end\n _ul do\n ASF::MeetingUtil::MEETING_FILES.each do |f, desc|\n _li do\n emit_link(svn_mtg_dir, f, desc)\n end\n end\n end\n end\nend", "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 meeting_params\n votes_attributes = [\n :id,\n :person_id,\n :vote,\n :_destroy\n ]\n questions_attributes = [\n :type,\n :notes,\n :id,\n :passed,\n :_destroy,\n votes_attributes: votes_attributes\n ]\n motions_attributes = [\n :notes,\n :bill_id,\n :meeting_id,\n :id,\n :_destroy,\n sponsor_ids: [],\n questions_attributes: questions_attributes\n ]\n params.require(:meeting)\n .permit(:organization_id, :date_and_time, :location,\n bill_ids: [],\n person_ids: [],\n meeting_items_attributes: [:title,\n :text,\n :id,\n :_destroy],\n motions_attributes: motions_attributes)\n end", "def question_options\n app_options = {}\n\n level_options = app_options[:level] ||= Hash.new\n\n level_options[:lastAttempt] = @last_attempt\n level_options.merge! @level.properties.camelize_keys\n\n unless current_user && (current_user.teachers.any? ||\n (@level.try(:peer_reviewable?) && current_user.teacher? && Plc::UserCourseEnrollment.exists?(user: current_user)))\n # only students with teachers or teachers enrolled in PLC submitting for a peer reviewable level\n level_options['submittable'] = false\n end\n\n app_options.merge! view_options.camelize_keys\n\n app_options[:submitted] = level_view_options(@level.id)[:submitted]\n app_options[:unsubmitUrl] = level_view_options(@level.id)[:unsubmit_url]\n\n app_options\n end", "def initialize(user,pw, opts = nil)\n @user = user\n @pw = pw\n @blog = nil\n \n @max_blog_entries = nil #as specified in scrape\n @curr_blog_entries = 1 #local loop variable\n \n @completed = false #stop scraping if @completed\n @options = opts #options which get filled in by templates \n \n @doc = nil #Hpricot document representing the xml file\n \n @comment_id = 1 #represents fixed comment id, increased for each comment\n @comment_hash = Hash.new #how we store hierarchical comments\n # [key in xanga] => @comment_id\n\n #for now, just set options to default\n set_default_options if @options == nil \n \n @agent = WWW::Mechanize.new{ |agent|\n # refreshes after login\n agent.follow_meta_refresh = true\n }\n end", "def setup(opts={})\n if meets_restrictions?(opts)\n if require_user_pass(opts)\n @username = opts[:username]\n @password = opts[:password]\n @id = opts[:id] || SecureRandom.uuid\n @email = opts[:email] || false\n @real_name = opts[:real_name] || false\n end\n end\n true\n end", "def create_personalization(candidate, sg_mail, admin, *subs)\n personalization = SendGrid::Personalization.new\n if admin.nil? # unless test email\n sheet = candidate.candidate_sheet\n used = ['[email protected]']\n converted_emails = convert_emails([sheet.to_email, sheet.cc_email, sheet.cc_email_2], used)\n personalization.add_to(SendGrid::Email.new(email: converted_emails[0], name: \"#{sheet.first_name} #{sheet.last_name}\"))\n personalization.add_cc(SendGrid::Email.new(email: converted_emails[1])) unless converted_emails[1].nil?\n personalization.add_cc(SendGrid::Email.new(email: converted_emails[2])) unless converted_emails[2].nil?\n bcc_sg = SendGrid::Email.new(email: @admin.email, name: \"#{Visitor.home_parish} Confirmation\")\n personalization.add_bcc(bcc_sg) unless duplicate?(personalization, bcc_sg)\n else\n personalization.add_to(SendGrid::Email.new(email: admin.email, name: \"#{Visitor.home_parish} Confirmation\"))\n end\n subs.each { |sub| personalization.add_substitution(sub) }\n sg_mail.add_personalization(personalization)\n personalization\n end", "def conversation_params\n params.require(:conversation).permit(:participant_id).merge(user_id: current_user.id)\n end", "def new\n @meetup = Meetup.new\n @recipient = User.find_by_id(params[:recipient_id])\n \n @recipient_meetups = []\n @recipient.upcoming_meetups.each do |m|\n @recipient_meetups.push({:title=> @recipient.name, :start=> m.date.strftime('%m-%d-%Y %H:%M:%S'), :end=> (m.date + 1.hour).strftime('%m-%d-%Y %H:%M:%S'), :allDay=> false})\n end\n \n @my_meetups = []\n current_user.upcoming_meetups.each do |m|\n @my_meetups.push({:title=> current_user.name, :start=> m.date.strftime('%m-%d-%Y %H:%M:%S'), :end=> (m.date + 1.hour).strftime('%m-%d-%Y %H:%M:%S'), :allDay=> false})\n end\n\n gon.recipient = @recipient\n gon.me = current_user\n gon.recipient_meetups = @recipient_meetups\n gon.my_meetups = @my_meetups\n \n @current_user = current_user\n @prev_meetup_id = params[:prev_meetup_id]\n \n respond_to do |format|\n format.html # new.html.erb\n end\n end", "def review_task \n\t\t@data[:task_approver] = @task.approver.try(:full_name)\n\t\t@data[:task_name] = @task.title\n @data[:task_type] = @task.class.to_s.downcase\n\t\t@data[:task_owner] = @task.assigned_to.try(:full_name)\n\t\t@data[:recipient_names] = recipient_names\n @template_slug = APOSTLE_MAIL_TEMPLATE_SLUG[:review_task]\n\t\ttrigger_mail\n\tend", "def get_email_settings(rec)\r\n subject = rec.subject || \"\" \r\n greeting = rec.greeting || \"\"\r\n preamble = rec.preamble || \"\"\r\n body = rec.body || \"\"\r\n preregions = rec.preregions || \"\"\r\n postamble = rec.postamble || \"\"\r\n signoff = rec.signoff || \"\"\r\n signature = rec.signature || \"\"\r\n \r\n @em_sets = {\r\n :subject => make_substs(subject),\r\n :greeting => make_substs(greeting),\r\n :preamble => make_substs(preamble),\r\n :body => make_substs(body),\r\n :preregions => make_substs(preregions),\r\n :postamble => make_substs(postamble),\r\n :signoff => make_substs(signoff),\r\n :signature => make_substs(signature)\r\n }\r\n end", "def participant_params\n params.require(:participant).permit(:email, :dynamic_id,:avatar,:name,:vote)\n end", "def initialize(participant_profile:, induction_programme:, start_date: nil, preferred_email: nil, mentor_profile: nil, school_transfer: false, appropriate_body_id: nil)\n @participant_profile = participant_profile\n @induction_programme = induction_programme\n @start_date = start_date || schedule_start_date\n @preferred_email = preferred_email\n @mentor_profile = mentor_profile\n @school_transfer = school_transfer\n @appropriate_body_id = appropriate_body_id || school_appropriate_body_id\n end", "def setup_for_posting(extra = {})\n @params = { \n :destination => :tumblr, \n :post_url => 'http://www.domain.com/example/post/',\n :site_url => 'http://www.domain.com/',\n :email => '[email protected]',\n :password => 's3kr17'\n }\n @params = @params.merge(extra)\n @sender = BotSender.new(@params)\nend" ]
[ "0.65610695", "0.5546389", "0.52903676", "0.5288021", "0.5283603", "0.52437615", "0.52013147", "0.51456064", "0.51084447", "0.50973094", "0.5045929", "0.5034437", "0.5026867", "0.5018252", "0.4999274", "0.49959782", "0.49862295", "0.49790576", "0.4969466", "0.49646065", "0.49608415", "0.49226546", "0.48924702", "0.4889942", "0.48669732", "0.48663795", "0.48645416", "0.48539725", "0.48507038", "0.4848489", "0.4847198", "0.48407146", "0.48354486", "0.4827166", "0.48235005", "0.480805", "0.4790922", "0.47748435", "0.47737452", "0.47724238", "0.47599056", "0.47524658", "0.47521812", "0.47464263", "0.47423047", "0.4739093", "0.47378922", "0.47378728", "0.4737035", "0.47339442", "0.473319", "0.47278866", "0.472447", "0.47244623", "0.47224686", "0.47218636", "0.47165552", "0.4714731", "0.47054535", "0.4703982", "0.47029498", "0.4699382", "0.4698192", "0.4696316", "0.46933934", "0.46861893", "0.46788117", "0.46740466", "0.46698982", "0.46686706", "0.46686253", "0.46659136", "0.46525088", "0.4647219", "0.46436617", "0.46427068", "0.46409637", "0.4639602", "0.46293965", "0.46283475", "0.46264446", "0.46212977", "0.46201873", "0.46196103", "0.46187204", "0.46090102", "0.4608386", "0.4607623", "0.46059734", "0.46053445", "0.45961696", "0.45948932", "0.4588073", "0.4577943", "0.457744", "0.457583", "0.45738003", "0.45720488", "0.45708296", "0.45699576" ]
0.7382127
0
Use callbacks to share common setup or constraints between actions.
def set_entrega @entrega = Entrega.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 set_actions\n actions :all\n end", "def define_action_helpers?; 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 revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def workflow\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def setup\n # override and do something appropriate\n end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def 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 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 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\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def setup(&block)\n define_method(:setup, &block)\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 init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\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 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 setup(easy)\n super\n easy.customrequest = @verb\n end", "def save_action; end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def 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 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", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def duas1(action)\n action.call\n action.call\nend", "def _handle_action_missing(*args); end" ]
[ "0.6164095", "0.6046031", "0.5945298", "0.59179014", "0.58890367", "0.58341795", "0.5776118", "0.5700777", "0.5700777", "0.5656277", "0.56218207", "0.5423995", "0.5411516", "0.5411516", "0.5411516", "0.5395004", "0.53783494", "0.53593004", "0.53412604", "0.534078", "0.5332865", "0.53135896", "0.52999926", "0.5297309", "0.5296569", "0.5261449", "0.5247048", "0.52376497", "0.52376497", "0.52376497", "0.52376497", "0.52376497", "0.52323204", "0.52310973", "0.523081", "0.5225785", "0.5219039", "0.52136266", "0.5208033", "0.520763", "0.5177365", "0.5175224", "0.5173357", "0.5166104", "0.5162502", "0.51573396", "0.5154547", "0.5153531", "0.51502854", "0.51436496", "0.5142863", "0.51330835", "0.5115634", "0.5115634", "0.511527", "0.5109693", "0.51076853", "0.5093146", "0.5090683", "0.50829846", "0.50819314", "0.50670373", "0.5055505", "0.5053398", "0.50504035", "0.50504035", "0.5037765", "0.5027292", "0.5024484", "0.50150335", "0.5014069", "0.50022113", "0.5001542", "0.49981874", "0.49915564", "0.49915564", "0.49880967", "0.4982312", "0.49787375", "0.49786067", "0.49687737", "0.49676532", "0.49602765", "0.49565676", "0.49550772", "0.495342", "0.49522525", "0.49463704", "0.49447197", "0.49362713", "0.49328062", "0.49280638", "0.49272856", "0.4927058", "0.49221697", "0.4919526", "0.49185994", "0.49184805", "0.49170163", "0.49168405", "0.49167764" ]
0.0
-1
Only allow a trusted parameter "white list" through.
def entrega_params params.require(:entrega).permit(:user_id, :solicitud_id, :user_id, :peso, :estadoresiduo, :oferta_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", "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 filtered_parameters; end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\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 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 param_whitelist\n [:rating, :review]\n end", "def valid_params?; end", "def permitted_params\n declared(params, include_missing: false)\n end", "def permitted_params\n declared(params, include_missing: false)\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 filter_parameters; end", "def filter_parameters; end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def check_params; true; end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def list_params\n params.permit(:name)\n end", "def check_params\n true\n end", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\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 additional_permitted_params\n []\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def resource_params\n params[resource_singular_name].try(:permit, self.class.param_whitelist)\n end", "def allow_params_authentication!; 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 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 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 paramunold_params\n params.require(:paramunold).permit!\n end", "def param_params\n params.require(:param).permit(:param_category_id, :param_table_id, :name, :english_name, :weighting, :description)\n end", "def quote_params\n params.permit!\n end", "def list_params\n params.permit(:list_name)\n end", "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end", "def all_params; end", "def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end", "def source_params\n params.require(:source).permit(all_allowed_params)\n end", "def user_params\n end", "def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def permitted_params\n @wfd_edit_parameters\n end", "def user_params\r\n end", "def param_whitelist\n whitelist = [\n :comment,\n :old_progress, :new_progress,\n :metric_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:metric_id)\n end\n \n whitelist\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "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 params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def get_params\n\t\t\n\t\treturn ActionController::Parameters.new(self.attributes).permit(:first_name, :last_name, :email, :provider)\n\n\tend", "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 valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end", "def params_permit\n params.permit(:id)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\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 filter_params\n params.permit(*resource_filter_permitted_params)\n end", "def specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend", "def community_params\n params.permit(:profile_image, :name, :description, :privacy_type, :viewed_by, {tags: []}, {features: []}, {admins: []}, :members, :location, :beacon, :creator, :ambassadors, :current_events, :past_events, :feed, :category, :address, :allow_member_post_to_feed, :allow_member_post_to_events)\n end", "def authorize_params\n super.tap do |params|\n %w[display scope auth_type].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "def feature_params_filter\n params.require(:feature).permit(:name, :cat, :lower, :upper, :opts, :category, :description, :company, :active, :unit, :icon)\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 argument_params\n params.require(:argument).permit(:name)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def property_params\n params.permit(:name, :is_available, :is_approved, :owner_id)\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 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 sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end", "def parameters\n nil\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def sequence_param_whitelist\n default_param_whitelist << \"show_index\"\n end", "def resource_filter_permitted_params\n raise(NotImplementedError, 'resource_filter_permitted_params method not implemented')\n end", "def normal_params\n reject{|param, val| param_definitions[param][:internal] }\n end", "def special_device_list_params\n params.require(:special_device_list).permit(:name)\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 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" ]
[ "0.71213365", "0.70527846", "0.6947171", "0.6901663", "0.67342883", "0.6717481", "0.668679", "0.667654", "0.6660948", "0.655484", "0.6525947", "0.64567953", "0.64502525", "0.6450165", "0.6446098", "0.6433068", "0.64118934", "0.64118934", "0.63903046", "0.6379847", "0.6379847", "0.63736796", "0.63605297", "0.6353668", "0.6283826", "0.6277936", "0.62436706", "0.6226217", "0.62238735", "0.6222201", "0.6208754", "0.62079734", "0.61760926", "0.6171337", "0.6166829", "0.61594605", "0.61429733", "0.6134288", "0.61210173", "0.6106998", "0.6097591", "0.6074265", "0.6053252", "0.6039525", "0.60342395", "0.6030413", "0.6017866", "0.60174304", "0.60172004", "0.60172004", "0.60172004", "0.60172004", "0.60172004", "0.60172004", "0.60172004", "0.60172004", "0.60172004", "0.60172004", "0.60172004", "0.60172004", "0.60172004", "0.60172004", "0.60172004", "0.60172004", "0.60172004", "0.60154676", "0.60037804", "0.6003128", "0.5999996", "0.5994808", "0.59938943", "0.5992965", "0.59828913", "0.5982352", "0.59762347", "0.5973914", "0.5968744", "0.5964729", "0.5963057", "0.5963057", "0.5956878", "0.5950747", "0.5950746", "0.5946173", "0.59427863", "0.59293395", "0.5928864", "0.5925602", "0.5923773", "0.5918309", "0.5915812", "0.59130466", "0.59129673", "0.5907004", "0.59047765", "0.590452", "0.59017384", "0.5899288", "0.58962125", "0.58959764", "0.5893933" ]
0.0
-1
se valida que el usuario actual sea recolector
def es_recolector if current_user.rol != 2 render json: {entrega: ["Operación no permitida para este rol de usuario"]}, status:401 end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_usuario\n if current_usuario.tipo!='Administrador' || !current_usuario.activo\n redirect_to root_path\n end\n end", "def valida_usuario(correo, clave)\n data = Usuario.find_by(correo: correo, estado: ACTIVO, validado: VALIDADO)\n if data.blank?\n data1 = Usuario.find_by(correo: correo, estado: ACTIVO)\n if data1.blank? != true\n return [false, 'El usuario no ha sido validado, hágalo desde el mensaje que llego a su correo electrónico']\n else\n return [false, 'No existe usuario con ese correo electrónico']\n end\n else\n psw = data[:psw]\n clave_ing = crypttext(clave)\n res = psw <=> clave_ing\n if res == 0\n return [true, data]\n else\n return [false, 'contraseña incorrecta']\n end\n end\n end", "def usuario_actual?(usuario)\n\t\tusuario == usuario_actual\n\tend", "def validate_username?\n @user = User.find_by username: self.usuario\n unless self.usuario == \"\"\n unless @user.nil? \n #Luego de que se verifica que el usuario si es usado, se pregunta si ese username pertenece al mismo\n #empleado que actualizara sus datos\n if self.usuario == self.user.username \n #si es el mismo username retorna true \n return true\n else\n #si es el mismo username retorna false \n errors.add(:usuario, :invalid)\n return false\n end\n else\n #no existe ningún usuario con este username que se intenta registrar\n return true\n end\n else\n errors.add(:usuario, \"Debe ingresar un usuario.\")\n return false\n end \n end", "def validar_usuario(usuario_ingresado,clave_ingresada)\n usuario = buscar_usuario(usuario_ingresado)\n if @encriptador.validar_claves(usuario.clave_de_usuario,clave_ingresada)\n usuario\n else\n raise ClaveIncorrecta\n end\n end", "def usuario_correcto\n @user = User.find(params[:id])\n redirect_to(root_url) unless usuario_actual?(@user)\n end", "def is_validated\n\tif $user_name.size <= 1 #string have \\n \n\t\tre_enter_name\n\telse\n\t\treturn true;\t\n\tend\t\nend", "def usuario_actual\n \t#se guarda al usuario actual que esta loggeado por cuestion de eficiencia\n \t#para no accesar a la base de datos todo el tiempo\n \t@usuario_actual ||= Alumno.find(session[:alumno_id]) if session[:alumno_id]\n end", "def verify_id!\n authenticate_user!\n unless (@empresa.user == current_user)\n redirect_to root_path, alert: \"No eres el propietario de esta empresa y no puedes editarla.\"\n end\n end", "def before_validation()\n logger.debug \"Vediamo di mettere mittente a riclife se non c'e'..\"\n self.from = User.default_system_user unless attribute_present?(\"from_id\") # unless User.find_by_login('riclife') unless \n end", "def revisar_usuario\n if session[:usuario].empty?\n flash[:notice] = \"Debe loguearsar para poder seguir\"\n redirect_to \"/login\"\n end\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(users_path,:notice =>'Accés non autorisé') unless( current_user?(@user)|| current_user.is_admin?)\n end", "def RepeticionUsuarioCreate(lista_usuarios, nombre_usuario, apellidos_usuarios)\n val = true\n lista_usuarios.each do |usuario|\n if usuario.nombre_usuario == nombre_usuario.upcase\n if usuario.apellidos_usuario == apellidos_usuarios.upcase\n val = false\n break\n end\n end\n end\n return val\n end", "def validate_user\n if @user.nil? or @user.reset_digest.nil? or \n not @user.authenticated?(:reset, params[:id])\n if @user.nil? \n Rails.logger.info(\"validate_user failed: @user nil.\")\n elsif @user.reset_digest.nil?\n Rails.logger.info(\"validate_user failed: reset_digest is nil.\")\n else\n Rails.logger.info(\"validate_user failed: authentication failed.\")\n end\n\n flash[:danger] = \"Your request could not be completed.\"\n redirect_to root_url\n end\n end", "def same_user_required\n unless @current_user == User.find(params[:id])\n flash[:error] = \"Non puoi modificare un utente diverso dal tuo\"\n redirect_to timetables_url\n end\n end", "def correct_user\n @usuario = Usuario.find(params[:id])\n redirect_to(root_url) unless current_user?(@usuario)\n end", "def reenviar_usuario\n @bandera = false\n if user_signed_in?\n unless current_user.employee.nil?\n @permiso_reenviar_usuario = false\n @security_role_type = Security::RoleType.find_by(name: \"Reenviar Usuario\").name\n current_user.employee.security_profile.security_role.security_role_menus.each do |security_role_menu| \n if security_role_menu.security_menu.controller == params[:controller] \n security_role_menu.security_role_type_menus.each do |role_type|\n if @security_role_type == role_type.security_role_type.name\n @permiso_reenviar_usuario = true\n break\n elsif role_type.security_role_type.name == \"Consultar\"\n @bandera = true\n end\n end\n end\n end\n if current_user.username == \"aadmin\"\n @permiso_reenviar_usuario = true\n end\n if @bandera == true\n elsif params[:action] == \"forget_username_list\" && @permiso_reenviar_usuario == false\n redirect_to root_path\n end\n return @permiso_reenviar_usuario\n end\n end\n end", "def validate_user_not_same\n return if user != travel.user\n\n errors.add(:user_id, :authorize_himself)\n end", "def set_username_validation\n\t if @do_username_validation != false\n\t\t @do_username_validation = true\n\t end\n end", "def appctrl_ensure_user_is_valid\n edit_user = if @current_user.try( :invalid? )\n view_context.apphelp_flash( :error, :provide_account_details, ApplicationController )\n true\n elsif @current_user.try( :must_reset_password? )\n view_context.apphelp_flash( :warning, :must_reset_password, ApplicationController )\n true\n end\n\n redirect_to( edit_user_path( @current_user ) ) if ( edit_user )\n end", "def correct_user\n @user = User.find(params[:id])\n unless current_user?(@user) || current_user.admin\n flash[:danger] = \"Некорректный пользователь\"\n redirect_to(root_url) \n end\n end", "def validate_user\n if self.banned and !self.authentication_token.include?('_banned')\n banned_auth_token = self.authentication_token[0..self.authentication_token.length-7] << '_banned'\n self.update_attribute(:authentication_token, banned_auth_token)\n # also ban his devices\n self.devices.each { |device|\n device.update_attribute(:banned,true)\n }\n elsif !self.banned and self.authentication_token.include?('_banned')\n # unban user\n unbanned_auth_token = self.authentication_token[0..self.authentication_token.length-7] << rand(36**7).to_s(36)\n self.update_attribute(:authentication_token, unbanned_auth_token)\n # also unban his devices\n self.devices.each { |device|\n device.update_attribute(:banned,false)\n }\n end\n end", "def correct_user\n @user = User.find(params[:id])\n unless current_user?(@user)\n flash[:danger] = \"僅能修改自己的資料\"\n redirect_to root_url\n end\n end", "def actualizar_usuario(usuario, ldapus, grupos, prob, clave=nil)\n usuario.nombres = valor_campo_ldap(ldapus, :givenname)\n usuario.apellidos = valor_campo_ldap(ldapus, :sn)\n usuario.email = valor_campo_ldap(ldapus, :mail)\n usuario.uidNumber = valor_campo_ldap(ldapus, :uidNumber)\n if !ldapus.respond_to?(:userPassword)\n # deshabilitado en LDAP\n # Si falta deshabilitar en base\n if usuario.fechadeshabilitacion.nil?\n usuario.fechadeshabilitacion = Date.today\n end\n else \n # habilitado en LDAP, habilitar y guardar clave si hay\n usuario.fechadeshabilitacion = nil\n unless clave.nil?\n usuario.encrypted_password = BCrypt::Password.create(\n clave, \n {:cost => Rails.application.config.devise.stretches}\n )\n end\n end\n usuario.ultimasincldap = Date.today\n usuario.save\n if (usuario.errors.messages.length > 0)\n prob << usuario.errors.messages.to_s\n return nil\n end\n\n if grupos\n # Los grupos debieron sincronizarse antes, ahora solo \n # asegurar que están los de grupos y solo esos.\n grupobd = []\n Msip::GrupoUsuario.where(usuario_id: usuario.id).map do |gu|\n grupobd << gu.grupo_id\n end\n pore = grupobd-grupos\n pora = grupos-grupobd\n pore.each do |g|\n mg = Msip::GrupoUsuario.find(usuario_id: usuario.id, grupo_id: g)\n mg.delete\n end\n pora.each.each do |g|\n n = Msip::GrupoUsuario.new(usuario_id: usuario.id, grupo_id: g)\n n.save\n end\n end\n\n return usuario\n end", "def logear_usuario(nombre_de_usuario,clave_de_usuario)\n @usuario_actual = validar_usuario(nombre_de_usuario,clave_de_usuario)\n @usuario_actual.logear\n end", "def create_and_update_event\n user = User.find_by(\"id = ?\", self.user_id)\n puts user.rol\n if user.rol != \"ORGANIZADOR\" || user.rol != \"ADMINISTRADOR\"\n errors.add(:message, 'No es permitido')\n end\n end", "def loguear\n\t\tif !(verificaUsuario)\n\t\t\tif verificaPass\n\t\t\t\treturn \"correcto\" #Si puede loguearse\n\t\t\telse\n\t\t\t\treturn \"passincorrecto\" #no puede loguearse por que la contrasena no es correcta\n\t\t\tend\n\t\telse\n\t\t\treturn \"usuarioincorrecto\" #no puede loguearse por que el usuario no existe\n\t\tend\n\tend", "def valid_user\n unless (@user && @user.activated? &&\n @user.authenticated?(:email_change, params[:id]))\n flash[:danger] = \"Invalid credentials\"\n redirect_to root_path\n end\n end", "def reactivacion_guardar\r\n\t\tif session[:usuario_id]\t\r\n\t\t\tif params[:Instructor].to_s != \"0\"\r\n\t\t\t\tusuari = Usuario.where(id: params[:Instructor]).take\r\n\t\t\t\tif !usuari.blank?\r\n\t\t\t\t\tusuari.activo = 1\r\n\t\t\t\t\tusuari.save\r\n\t\t\t\t\tpers = Persona.where(usuario_id: usuari.id).take\r\n\t\t\t\t\tnombres = pers.nombres.to_s.split.map(&:capitalize).join(' ') + \" \" + pers.apellidos.to_s.split.map(&:capitalize).join(' ')\r\n\t\t\t\t\tflash[:success]= \"Se ha habilitado a \" + nombres + \" de manera exitosa\"\r\n\t\t\t\telse\r\n\t\t\t\t\tflash[:danger]= \"Error al seleccionar usuario, puede no existir en la Base de Datos\"\r\n\t\t\t\tend\r\n\t\t\telse\r\n\t\t\t\tflash[:info]= \"Debe seleccionar un instructor primero\"\r\n\t\t\tend\r\n\t\t\tredirect_to :back\r\n\t\telse\r\n\t\t\tredirect_to controller:\"forminst\", action: \"index\"\r\n\t\tend\r\n\tend", "def valid_user\n\t\t\tunless (@user && @user.activated? && \n\t\t\t\t\t\t\[email protected]?(:reset, params[:id]))\n\t\t\t\tredirect_to root_url\n\t\t\tend\t\n\t\tend", "def check_create_user_name_is_valid\n return self.name != \"\" ? true : false\n end", "def ensure_different_creator_and_user\n errors.add(:user_id, \"can't be same as creator\") if user == creator\n end", "def user_id_not_changed\n if user_id_changed? && self.persisted?\n errors.add(:user_id, \"Change of user_id not allowed!\")\n end\n end", "def validate_before_update!(user)\n # Calling valid? will reset the error list :( so it has to be done first.\n user.valid?\n\n # NB: These uniqueness constraints have to be enforced by the database\n # also, or else there is a race condition. However, checking for them\n # separately allows us to give a better experience in the common\n # non-race failure conditions.\n unless (user.username.nil? || user.username.empty?) # these are covered by other validations\n existing_users_ids = execute_sql(:validate, :user) do\n table.select(:id).filter(:username => user.username).map {|u| u[:id]}\n end\n if existing_users_ids.any? {|id| id != user.id }\n user.username_not_unique!\n end\n end\n\n unless (user.email.nil? || user.email.empty?) # validated elsewhere\n existing_users_ids = execute_sql(:validate, :user) do\n table.select(:id).filter(:email => user.email).map {|u| u[:id]}\n end\n if existing_users_ids.any? {|id| id != user.id }\n user.email_not_unique!\n end\n end\n\n unless user.errors.empty?\n self.class.invalid_object!(user.errors.full_messages.join(\", \"))\n end\n\n true\n end", "def with_valid_user\n if(current_user && current_user.id.to_s == params[:user_id].to_s)\n @user = current_user\n else\n flash[:error] = \"Debes estar autenticado para acceder a este &aacute;rea\"\n redirect_to :controller => :home, :action => :index\n end\n end", "def valid_user\n \tunless(@user && @user.activated? && @user.authenticated?(:reset, params[:id]))\n \t\tredirect_to root_url\n \tend\n end", "def registrar_usuario\n business_user = User.new\n business_user.email = self.email\n business_user.password = business_user.generar_password\n business_user.client_type = 'empresa'\n business_user.save\n update(user_id: business_user.id, user_created_id: business_user.id)\n #luego de registrar al usuario se almacena la contraseña en la tabla Historypassword\n #donde se almacenaran las 3 ultimas usadas\n password_business = HistoryPassword.new\n password_business.password = business_user.password\n password_business.user_id = business_user.id\n password_business.save\n end", "def user_valid\n @user_id.length >= 7 && (@user_id.include?(\"!\") || @user_id.include?(\"$\"))\n end", "def remitente\n user = User.find(self.envia_id) if self.envia_id\n remitente ||= user.persona.nombre_completo if user && user.persona.nombre_completo\n return remitente\n end", "def validate_user\n\n cache_data = CacheManagement::User.new([@user_id]).fetch\n @user = cache_data[@user_id]\n\n return validation_error(\n 'e_sam_2',\n 'invalid_api_params',\n ['invalid_user_id'],\n GlobalConstant::ErrorAction.default\n ) if @user.blank?\n\n return error_with_data(\n 'e_sam_3',\n 'user_not_verified',\n GlobalConstant::ErrorAction.default,\n {}\n ) if @user[:properties].exclude?(GlobalConstant::User.is_user_verified_property)\n\n success\n\n end", "def usuario_actual\n\t\tif (id_usuario = session[:id_usuario])\n\t\t\t@usuario_actual ||= Usuario.find_by(id: id_usuario)\n\t\telsif (id_usuario = cookies.signed[:id_usuario])\n\t\t\t#raise # Error provocado para la prueba de test/helpers/sesiones_helper_test.rb\n\t\t\tusuario = Usuario.find_by(id: id_usuario)\n\t\t\tif usuario && usuario.autentificado?(:recuerda, cookies[:token_recuerda])\n\t\t\t\tdar_acceso_a usuario\n\t\t\t\t@usuario_actual = usuario\n\t\t\tend\n\t\tend\n\tend", "def before_update\n r = Role.find(self.id)\n if r.role_name == 'Administrator' then\n if r.role_name != self.role_name then\n errors.add(:role_name, \"Administrator darf nicht umbenannt werden\")\n self.role_name = r.role_name\n end\n end\n if r.role_name == 'Gast' then\n if r.role_name != self.role_name then\n errors.add(:role_name, \"Gast darf nicht umbenannt werden\")\n self.role_name = r.role_name\n end\n end \n end", "def create\n @recruiter = Recruiter.new(params[:recruiter])\n @user = User.new(params[:user]) do |u|\n u.rolable = @recruiter\n u.skip_password_validation = true\n u.is_admin = params[:user][:is_admin] if current_user.is_admin # is_admin is non accessible\n end\n \n valid = @user.valid? \n valid = @recruiter.valid? && valid\n \n if valid\n create_and_send_invitation(@user, @recruiter, \"Recruiter\")\n else\n respond_to do |format|\n format.html { render action: \"new\" }\n format.json { render json: @recruiter.errors, status: :unprocessable_entity }\n end\n end\n end", "def validate\n\t\t#puts \"--- ENTRANDO A VALIDATE----- password, password_confirmation: #{password} - #{password_confirmation}\"\n\t\terrors.add('contrase&ntilde;a', 'y confirmaci&oacute;n no coinciden') unless password_confirmation == password\n\tend", "def nuevo_usuario\n @user = User.new(params[:user])\n @user.cantidad_bots = 1\n\n # Según tipo de registro\n if params[:tipo] == \"plus\"\n @user.registro = true\n end\n\n # Se agrega perfil de usuario (0)\n @user.perfil = 0\n if @user.valid?\n @user.save\n # Login automatico al registrar\n session[:login] = @user\n session[:last_seen] = Time.now\n UserMailer.welcome_email(@user).deliver\n redirect_to bot_path, :notice => \"Registro OK, Bienvenido\"\n else\n flash[:error] = \"Error en los datos ingresados\"\n render 'bots/registrar'\n end\n end", "def checkIdEscuelaForDirector\n if !self[:id_permission].nil? && self.user_permission.name == \"Director\"\n if !self[:escuela_id].nil?\n if !Escuela.exists?(id: self[:escuela_id])\n self.errors[:carrera_id] = \"La escuela seleccionada no se encuentra en el sistema.\"\n end\n else\n # El director creado no tiene una carrera asignada.\n self.errors[:escuela_id] = \"Debe seleccionar una escuela para el usuario director.\"\n end\n end\n end", "def correct_user\n #to define the correct user and omit it when edit and update\n @user=User.find(params[:id])\n redirect_to(root_path) unless current_user?(@user)\n end", "def correct_user\n \n redirect_to(login_path) unless current_user?(@user)\n end", "def check_new_nick\n if (params[:user][:nick] != @user.nick)\n if (User.where(:nick => User.clean_nick(params[:user][:nick])).count > 0)\n false\n else\n true\n end\n else\n true\n end\n end", "def validate_username\n if User.where(email: username).exists? || User.where(username: username).exists? \n errors.add(:username, :invalid)\n end\n end", "def valid_user\n #puts \"VALID USER - USER DEVICE TOKENS #{@device_tokens} #{@first_name} #{@phone_number} #{@last_name} \"\n return (!@phone_number.nil? && !@phone_number.empty? && !@first_name.nil? && !@first_name.empty? && !@last_name.nil? && !@last_name.empty? && !@device_tokens.nil? && !@device_tokens.empty?)\n\n end", "def correct_user\n @user = User.find(params[:id])\n unless current_user?(@user)\n redirect_to root_url, flash: {:warning => '此操作需要管理员身份'}\n end\n end", "def validate\n if User.find_by_email(new_email)\n errors.add(:new_email, \"has already been taken\")\n end\n end", "def userlogin_valid?\n if User.find_by(name: userlogin_input) != nil\n if User.find_by(name: userlogin_input).name == self.userlogin_input #########put in custom error catch\n self.active_user = User.find_by(name: userlogin_input) ### if you use this method.name it dies if there isn't a match\n self.welcome_user\n end\n else\n puts Rainbow (\"\\n\\nI'm sorry that's not a valid username.\\n\").bright.red\n puts \"I'll let you try again.\\n\"\n self.userquery_prompt\n end\nend", "def correct_user(id)\n @user = User.find(id)\n unless current_user? @user\n flash[:danger] = \"Azione non autorizzata\"\n redirect_to groups_path\n end\n end", "def valid_user\n unless ( @user && @user.activated? &&\n @user.authenticated?( :reset, params[ :id]))\n redirect_to root_url\n end\n end", "def valid_user\n unless (@user && @user.activated? &&\n @user.authenticated?(:reset, params[:id]))\n redirect_to root_url\n end\n end", "def registrar_usuario\n employee_user = User.new\n employee_user.email = self.email\n employee_user.password = employee_user.generar_password\n employee_user.username = asignar_username_con_opciones\n if asignar_username_con_opciones.present?\n employee_user.username = asignar_username_con_opciones\n else\n employee_user.username = self.usuario.downcase\n end\n employee_user.client_type = 'empleado'\n employee_user.save\n update(user_id: employee_user.id, user_created_id: employee_user.id) \n #luego de registrar al usuario se almacena la contraseña en la tabla Historypassword\n #donde se almacenaran las 3 ultimas usadas\n password_employee = HistoryPassword.new\n password_employee.password = employee_user.password\n password_employee.user_id = employee_user.id\n password_employee.save\n end", "def user_have\n unless current_user\n redirect_to root_path, :alert => \"Зарегистрируйтесь или войдите\"\n end\n end", "def create\n @user = User.find_by(email:params[:user][:login])\n unless params[:user][:login].empty?\n unless @user.nil?\n if session[:layout] == \"admin\"\n if @user.client_type == 'empleado'\n if @user.reset_password_token.nil?\n ResendPasswordMailer.resend_password(@user).deliver_now\n @user.update(:reset_password_token => params[:authenticity_token], :reset_password_sent_at=> Date.today)\n\n redirect_to admin_path, notice: \"La solicitud ha sido enviada\"\n else\n flash[:errors] = \"Ya #{@user.email} ha enviado una solicitud de recuperación de contraseña.\"\n redirect_to new_user_password_path\n end \n else\n flash[:errors] = \"Su correo no ha sido registrado como empleado.\"\n redirect_to new_user_password_path \n end\n elsif session[:layout] == \"application\"\n if @user.client_type == 'persona' || @user.client_type == 'empresa'\n super\n else\n flash[:errors] = \"Su correo no ha sido registrado como cliente.\"\n redirect_to new_user_password_path \n end\n end \n else\n flash[:errors] = \"El correo electrónico #{params[:user][:login]} no esta registrado.\"\n redirect_to new_user_password_path \n end\n else\n flash[:errors] = \"Debe ingresar un correo electrónico.\"\n redirect_to new_user_password_path \n end \n end", "def valid_user\n redirect_to root_url unless @user && @user.activated? && @user.authenticated?(:reset, params[:id])\n end", "def valida_plantilla(current_usuario, idplant)\n true\n end", "def validate_user\n \tauthorized_user = nil\n @user = User.new(user_sign_in_params)\n\n if @user.status == \"Active\"\n puts \"user : #{@user.inspect}\"\n\n u = User.where(:email => @user.email).first\n # puts \"user_extracted : #{u.inspect}\"\n\n if u.blank?\n flash[:notice] = \"user with email #{@user.email} doesnot exist\"\n else\n d_pass = decrypt(u.password)\n # puts \"#{d_pass}\"\n if d_pass == @user.password\n if u.is_first_logged_in\n if u.is_super_user\n @user = User.find(u.id)\n @user.last_logged_in = DateTime.now.utc\n if @user.is_first_logged_in == false\n @user.is_first_logged_in = true\n end\n @user.save\n authorized_user = @user\n elsif u.is_owner\n @user = User.find(u.id)\n @user.last_logged_in = DateTime.now.utc\n if @user.is_first_logged_in == false\n @user.is_first_logged_in = true\n end\n @user.save\n authorized_user = @user\n else\n flash[:notice] = \"User cannot log in !! only admin/owner can\"\n end\n else\n \tu.is_first_logged_in = true\n flash[:notice] = \"confirm email\"\n end\n else\n flash[:notice] = \"Incorrect password\"\n \n end\n end\n else\n flash[:notice] = \"User has been deleted\"\n end\n if authorized_user\n \t# TODO: mark user as logged in\n \tsession[:user_id] = authorized_user.id\n \tsession[:email] = authorized_user.email\n \t\n\t flash[:notice] = \"You are now logged in.\"\n\t redirect_to(:controller => 'home',:action => 'index')\n else\n \[email protected]_attempts += 1\n @user.save\n render('login')\n end\n end", "def relogin\n\n reset_session\n\n reentrada = Reentrada.find_by_id(params[:id])\n\n session[:ObjLogon] = Usuario.find_by_cadastro_id(reentrada.cadastro_2.id)\n\n\n if usuario_logado == true\n redirect_to root_path, notice: 'Usuario logado com sucesso.'\n else\n flash[:error] = \"Usuario ou senha incorretos.\"\n end \n end", "def update?\n if user.role == \"Recepção\" || user.admin?\n true\n elsif (user.role == \"Envio\" || user.role == \"Cadastro\") && user.institution == record.sender.institution\n true\n else\n false\n end\n end", "def create\n existing_user = User.find_by(email_id: params[:user][:email_id])\n if existing_user != nil\n if existing_user.is_realtor == true\n redirect_to login_path, notice: 'You are already registered as an Realtor'\n else\n existing_user.is_realtor = true\n existing_user.password = params[:user][:password]\n if existing_user.save\n add_realtor = Realtor.new(realtor_params)\n add_realtor.users_id = existing_user.id\n if add_realtor.save\n redirect_to login_path, notice: 'Realtor was successfully created.'\n else\n redirect_to login_path, notice: 'Error saving realtor.'\n end\n else\n redirect_to login_path, notice: 'Error saving user.'\n end\n end\n else\n @realtor = Realtor.new(realtor_params)\n @user = User.new(user_params)\n @user.is_realtor = true\n respond_to do |format|\n if @user.save\n @realtor.users_id = @user.id\n if @realtor.save\n format.html {redirect_to login_path, notice: 'Realtor was successfully created.'}\n format.json {render :show, status: :created, location: @realtor}\n else\n format.html {redirect_to login_path, notice: 'Error creating realtor'}\n format.json {render json: @realtor.errors, status: :unprocessable_entity}\n end\n else\n format.html {redirect_to login_path, notice: 'Error creating user. Please check input.'}\n format.json {render json: @user.errors, status: :unprocessable_entity}\n end\n end\n end\n end", "def valid_user\n # unless @user\n # redirect_to root_url\n # end\n end", "def validate_username\n if User.where(email: username).exist?\n errors.add(:username, :invalid)\n end\n end", "def correct_user\n user_id = params[:user_id] || params[:id] || session[:user_id]\n @user = User.find_by(id: user_id)\n unless @user.nil?\n unless current_user?(@user) || current_user.administrator?\n flash[:danger] = \"Only the account owner or an adminstrator to do that.\"\n redirect_to(root_path)\n end\n else\n nonexistent_user_error\n end\n end", "def redirecionar_usuario_logado\n if current_account != nil \n redirect_to accounts_url\n end\n end", "def set_usuario\n \n end", "def valid_user(user)\n user.authenticated?(:reset, params[:id]) #digest was encoded in hidden field of form\nend", "def valid_user\n return if @user && @user.activated? && @user.authenticated?('reset', params[:id])\n redirect_to root_url\n end", "def validate_user \n errors.add(:user_id, 'user not presence') if User.find_by_id( self[:user_id] ) == nil\n end", "def reset_passwd\n @user = User.find_by(uin: params[:session][:uin])\n if [email protected]? && @user.first_name.downcase == params[:session][:first_name].to_s.downcase\n UserNotifier.send_login_password(@user, SecureRandom.hex(10)).deliver_now\n flash[:success] = \"Password has been sent to your email address!\"\n redirect_to login_path\n else\n flash[:danger]=\"Invalid User: Wrong UIN Name Match!\"\n redirect_to login_path\n end\n end", "def username_taken?\n @user and user.errors.added?(:username, :taken)\n end", "def validate_user\n errors.add(:user_id, 'not presence') if User.find_by_id( self[:user_id] ) == nil\n end", "def crear_actualizar_usuario(nusuario, ldapus, grupos, prob, \n clave = nil)\n usuario = Usuario.where(nusuario: nusuario).take\n if usuario.nil?\n usuario = crear_usuario_min(nusuario, ldapus, prob, clave)\n if usuario.nil?\n prob << 'No pudo crear usuario: ' + prob\n return nil\n end\n end\n return actualizar_usuario(usuario, ldapus, grupos, prob, clave)\n end", "def registrar_entrada(rango)\n reg = self.class.last(:conditions => {:usuario_id => self.usuario_id})\n reg = self.class.new if reg.nil?\n unless rango.include?(reg.created_at)\n self.tipo = \"E\"\n else\n errors.add_to_base(\"Usted ya ha registrado su Entrada\")\n return false\n end\n end", "def validate_impossible_changes\n errors.add(:user_id, :cant_be_changed) if @document && @document.user_id != self.user_id\n end", "def verificar_autenticado_admin\n unless session[:usuario_admin] #else if,tiene quer ser falso\n bitacora \"Intento de accceso sin autenticacion a la zona del admin\"\n flash[:error]=\"Debe autenticarse como Administrador\"\n redirect_to :action => \"index\" , :controller => \"externo\"\n return false\n end\n end", "def valid_user\n unless (@user && @user.approved? &&\n @user.authenticated?(:reset, params[:id]))\n redirect_to root_url\n end\n end", "def validate_user\n return unauthorized_access_response('um_gbd_vu_1') if @user.blank? || (@user.client_id != @client_id)\n success\n end", "def valid_user!\n redirect_to administration_users_path if @user.admin?\n end", "def check_username\n @user=User.where('username=?',params[:username])\n @user=[] if user_signed_in? && @user && @user.first==current_user # this means they are editing their username and its themselves, that is ok\n end", "def ha_accedido?\n\t\t!usuario_actual.nil?\n\tend", "def first_login\n if !current_user.adm? && (!current_user.last_name.present? || !current_user.email.present? || \n !current_user.job.present? || !current_user.cpf.present? || current_user.email == (0...6).map { ('a'..'z').to_a[rand(26)] }.join+\"@facebook.com\") \n redirect_to edit_user_path(current_user)\n flash[:info] = \"Complete seu cadastro!\"\n \n if !current_user.last_name.present?\n flash[:info] = \"Sobrenome não registrado.\"\n end\n \n if !current_user.email.present?\n flash[:info] = \"Email não registrado.\"\n end\n \n if !current_user.job.present?\n flash[:info] = \"Trabalho não registrado.\"\n end\n \n if !current_user.cpf.present?\n flash[:info] = \"CPF não registrado.\"\n end\n \n if current_user.email == (0...6).map { ('a'..'z').to_a[rand(26)] }.join+\"@facebook.com\"\n flash[:info] = \"Registre o seu email.\"\n end\n end\n end", "def validate_username\n if User.where(email: username).exists?\n errors.add(:username, :invalid)\n end\n end", "def validate_username\n if User.where(email: username).exists?\n errors.add(:username, :invalid)\n end\n end", "def valid_user\n # unless (@user && @user.activated? && @user.authenticated?(:reset, params[:id])) \n unless(@user && @user.activated?)\n redirect_to root_url\n end\n end", "def correct_user\n @user = User.find(params[:id]) if User.exists?(params[:id])\n redirect_to(edit_user_path(current_user)) unless current_user == @user\n end", "def login\n valid = true\n \n if username.blank?\n self.errors.add_to_base(\"Please enter a user name\")\n valid = false\n end\t\n \n if password.blank?\n self.errors.add_to_base(\"Please enter a password\")\n valid = false\n end\n \t\t\n if valid\n user = User.find(:first, :conditions => [\"username = ? AND password = ?\", username, password])\n \n if user\n self.id = user.id\n self.reload\n else\n self.errors.add_to_base(\"The user name/password was incorrect.\")\n valid = false\n end\n end\n \n valid\n end", "def validar(orden_abono_excedente_arrime, fecha_registro_cheque, numero_cheque)\n logger.debug \"ENTRE A LA VALIDACION EN MI MODELOS ---- \" << orden_abono_excedente_arrime.inspect.to_s\n logger.debug \"ENTRE A LA VALIDACION EN MI MODELOS ---- \" << orden_abono_excedente_arrime_id.inspect.to_s\n \n logger.debug \"Parametros ---- \" << fecha_registro_cheque.to_s << \" - \" << numero_cheque.to_s\n \n msj = \"\"\n\n orden_abono_excedente_arrime = OrdenAbonoExcedenteArrime.find(orden_abono_excedente_arrime_id)\n solicitud = Solicitud.find(orden_abono_excedente_arrime.solicitud_id)\n\n logger.debug \"cheque ---- \" << numero_cheque.to_s\n logger.debug \"fecha ---- \" << fecha_registro_cheque.to_s\n if numero_cheque.to_s==''\n msj << I18n.t('Sistema.Body.Modelos.ViewExcedenteArrime.Errores.numero_cheque_obligatorio',:numero=>solicitud.numero) \n end\n\n if fecha_registro_cheque.to_s==''\n msj << I18n.t('Sistema.Body.Modelos.ViewExcedenteArrime.Errores.fecha_registro_invalida',:numero=>solicitud.numero)\n end\n\n if msj.length > 0\n return msj\n else\n return ''\n end\n end", "def is_valid?\n self.current_user && (self.user == self.current_user || self.current_user.admin?)\n end", "def check_ownership_requestor_user(requestor,user)\n if requestor.nickname != user.nickname\n raise Error, \"Requestor #{requestor.nickname} and user requested #{user.nickname} do not match\"\n end\n end", "def validate_on_create\n\t\t#puts \"--- ENTRANDO A VALIDATE ON CREATE ----- password, password_confirmation : #{self.password}, #{password_confirmation}\" \n\t\terrors.add('contrase&ntilde;a','no puede estar en blanco') unless !self.password.blank?\n\t\terrors.add('confirmaci&oacute;n','no puede estar en blanco') unless !self.password_confirmation.blank?\t\t\t\t\t\n\tend", "def password_unique?\n users = User.where(login: login)\n if users.any?\n users.each do |u|\n errors.add(:password,'Login i hasło jest już w systemie') if u.authenticate(password)\n end\n end\n end", "def conf_universidad\n reset_session\n @valin = params['in']\n @alert = params['alert']\n valor = @valin.split(\"_\")\n cod = desencriptar(valor[0].to_i)\n id = desencriptar(valor[1].to_i)\n data = Usuario.find_by(cod_recovery: cod, id: id)\n if data.blank?\n redirect_to({:action=>\"index\", :controller=>\"perfil\"})\n else\n if data['validado'] == SIN_VALIDAR\n @nombre = data['nombre']\n session[:id] = id\n session[:email] = data['correo']\n render layout: \"login\"\n else\n redirect_to({:action => 'index', :controller=>\"login\"})\n end\n end\n end", "def inicio_sesion?\n usuario_id.blank?\n end", "def update\n @persona = Persona.find(params[:id])\n if @persona.usuario.nil?\n if @persona.build_usuario(:email=>\"[email protected]\",:password => '123456789', :password_confirmation=>'123456789').save\n redirect_to @persona, notice: 'La Persona fue actualizada correctamente'\n else\n redirect_to crear_usuario_persona_path(@persona), notice: 'Error intente nuevamente.'\n end\n\n else\n if @persona.update_attributes(params[:persona])\n redirect_to @persona, notice: 'La Persona fue actualizada correctamente'\n else\n render action: \"edit\"\n end\n end\n\n end" ]
[ "0.6663286", "0.6659733", "0.66234523", "0.6526606", "0.62778205", "0.6246215", "0.6141433", "0.61207277", "0.61178446", "0.6086974", "0.6054923", "0.60480297", "0.60229635", "0.6002066", "0.59916514", "0.5989791", "0.5957678", "0.59379476", "0.5937551", "0.59356844", "0.593115", "0.59155947", "0.59139323", "0.59119433", "0.5894191", "0.58851665", "0.5852401", "0.5847923", "0.58365613", "0.58159804", "0.5815965", "0.5815868", "0.5800587", "0.57939875", "0.5793102", "0.5777526", "0.5772808", "0.5767654", "0.5749109", "0.5726576", "0.57251465", "0.5719186", "0.57149297", "0.57051545", "0.5695779", "0.56819874", "0.5680371", "0.56762975", "0.5671167", "0.56660545", "0.56605905", "0.56594265", "0.56571007", "0.56566095", "0.5656524", "0.5653853", "0.56522274", "0.56479746", "0.56474954", "0.56429654", "0.5640465", "0.56302166", "0.5624151", "0.56229466", "0.5622884", "0.5621523", "0.56210524", "0.5616027", "0.56158453", "0.56056446", "0.5602786", "0.56025225", "0.559644", "0.55928516", "0.55827653", "0.5577736", "0.5570136", "0.5567169", "0.5566729", "0.5563063", "0.55608344", "0.5554294", "0.55517703", "0.5539515", "0.5538306", "0.55372703", "0.5534235", "0.5534062", "0.5534062", "0.5533194", "0.55289805", "0.55248374", "0.5523353", "0.5520226", "0.5517252", "0.55134076", "0.5504325", "0.5501337", "0.5490691", "0.5489068" ]
0.5732455
39
se valida que el usuario sea propietario la entrega
def es_propietario set_entrega if @entrega.recolector != current_user render json: {entrega: ["No permitido para este usuario"]}, status:401 end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_usuario\n if current_usuario.tipo!='Administrador' || !current_usuario.activo\n redirect_to root_path\n end\n end", "def validate_user \n errors.add(:user_id, 'user not presence') if User.find_by_id( self[:user_id] ) == nil\n end", "def validate_user\n errors.add(:user_id, 'not presence') if User.find_by_id( self[:user_id] ) == nil\n end", "def validate_before_create!(user)\n # Calling valid? will reset the error list :( so it has to be done first.\n user.valid?\n\n # NB: These uniqueness constraints have to be enforced by the database\n # also, or else there is a race condition. However, checking for them\n # separately allows us to give a better experience in the common\n # non-race failure conditions.\n unless (user.username.nil? || user.username.empty?)\n if execute_sql(:validate, :user) { table.select(:username).filter(:username => user.username).any? }\n user.username_not_unique!\n end\n end\n\n unless (user.email.nil? || user.email.empty?)\n if execute_sql(:validate, :user) { table.select(:email).filter(:email => user.email).any? }\n user.email_not_unique!\n end\n end\n\n unless user.errors.empty?\n self.class.invalid_object!(user.errors.full_messages.join(\", \"))\n end\n\n true\n end", "def validate_user\n\n cache_data = CacheManagement::User.new([@user_id]).fetch\n @user = cache_data[@user_id]\n\n return validation_error(\n 'e_sam_2',\n 'invalid_api_params',\n ['invalid_user_id'],\n GlobalConstant::ErrorAction.default\n ) if @user.blank?\n\n return error_with_data(\n 'e_sam_3',\n 'user_not_verified',\n GlobalConstant::ErrorAction.default,\n {}\n ) if @user[:properties].exclude?(GlobalConstant::User.is_user_verified_property)\n\n success\n\n end", "def validar_usuario(usuario_ingresado,clave_ingresada)\n usuario = buscar_usuario(usuario_ingresado)\n if @encriptador.validar_claves(usuario.clave_de_usuario,clave_ingresada)\n usuario\n else\n raise ClaveIncorrecta\n end\n end", "def validate_username?\n @user = User.find_by username: self.usuario\n unless self.usuario == \"\"\n unless @user.nil? \n #Luego de que se verifica que el usuario si es usado, se pregunta si ese username pertenece al mismo\n #empleado que actualizara sus datos\n if self.usuario == self.user.username \n #si es el mismo username retorna true \n return true\n else\n #si es el mismo username retorna false \n errors.add(:usuario, :invalid)\n return false\n end\n else\n #no existe ningún usuario con este username que se intenta registrar\n return true\n end\n else\n errors.add(:usuario, \"Debe ingresar un usuario.\")\n return false\n end \n end", "def validate_on_create\n\t\t#puts \"--- ENTRANDO A VALIDATE ON CREATE ----- password, password_confirmation : #{self.password}, #{password_confirmation}\" \n\t\terrors.add('contrase&ntilde;a','no puede estar en blanco') unless !self.password.blank?\n\t\terrors.add('confirmaci&oacute;n','no puede estar en blanco') unless !self.password_confirmation.blank?\t\t\t\t\t\n\tend", "def valida_usuario(correo, clave)\n data = Usuario.find_by(correo: correo, estado: ACTIVO, validado: VALIDADO)\n if data.blank?\n data1 = Usuario.find_by(correo: correo, estado: ACTIVO)\n if data1.blank? != true\n return [false, 'El usuario no ha sido validado, hágalo desde el mensaje que llego a su correo electrónico']\n else\n return [false, 'No existe usuario con ese correo electrónico']\n end\n else\n psw = data[:psw]\n clave_ing = crypttext(clave)\n res = psw <=> clave_ing\n if res == 0\n return [true, data]\n else\n return [false, 'contraseña incorrecta']\n end\n end\n end", "def verify_id!\n authenticate_user!\n unless (@empresa.user == current_user)\n redirect_to root_path, alert: \"No eres el propietario de esta empresa y no puedes editarla.\"\n end\n end", "def registrar_usuario\n business_user = User.new\n business_user.email = self.email\n business_user.password = business_user.generar_password\n business_user.client_type = 'empresa'\n business_user.save\n update(user_id: business_user.id, user_created_id: business_user.id)\n #luego de registrar al usuario se almacena la contraseña en la tabla Historypassword\n #donde se almacenaran las 3 ultimas usadas\n password_business = HistoryPassword.new\n password_business.password = business_user.password\n password_business.user_id = business_user.id\n password_business.save\n end", "def before_validation()\n logger.debug \"Vediamo di mettere mittente a riclife se non c'e'..\"\n self.from = User.default_system_user unless attribute_present?(\"from_id\") # unless User.find_by_login('riclife') unless \n end", "def create\n @usuario = User.new(user_params)\n @usuario.ativo = true\n @usuario.mudar_senha = true\n\n respond_to do |format|\n if @usuario.save\n flash[:notice] = @@msgs\n format.html { redirect_to usuarios_url }\n format.json { render json: @usuario, status: :created, location: @usuario }\n else\n flash[:alert] = @@msge\n format.html { render action: \"new\" }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n \n end\n end\n end", "def usuario_params\n params.require(:usuario).permit(:nome, :email, :senha, :senha_confirmation)\n end", "def create\n @user = User.new(params[:user])\n \n puts \"#{@user.name} - #{@user.email}\"\n \n if !@@invite.nil? && self.encrypt_word(@user.email).eql?(encrypt_word(@@invite.email))\n @user.active = true\n if @user.save\n @@invite.update_attributes(:active => true)\n flash[:notice] = \"Usuario cadastrado com sucesso.\"\n render :action => :show\n end\n else\n flash[:notice] = \"Email invalido.\"\n render :action => :new\n end\n end", "def registrar_usuario\n employee_user = User.new\n employee_user.email = self.email\n employee_user.password = employee_user.generar_password\n employee_user.username = asignar_username_con_opciones\n if asignar_username_con_opciones.present?\n employee_user.username = asignar_username_con_opciones\n else\n employee_user.username = self.usuario.downcase\n end\n employee_user.client_type = 'empleado'\n employee_user.save\n update(user_id: employee_user.id, user_created_id: employee_user.id) \n #luego de registrar al usuario se almacena la contraseña en la tabla Historypassword\n #donde se almacenaran las 3 ultimas usadas\n password_employee = HistoryPassword.new\n password_employee.password = employee_user.password\n password_employee.user_id = employee_user.id\n password_employee.save\n end", "def create\n userEmail = User.where(email: params[:email]).count\n userPassword = User.where(password: params[:password]).count\n if userEmail != 0 && userPassword != 0\n user = User.find_by email: params[:email]\n session[:user_id] = user.id\n redirect_to '/cool'\n else\n @user = Olduser.new\n if @user.valid? == false \n @user.errors.messages\n flash[:error] = \"Please enter valid information\"\n redirect_to :back\n end\n end\n end", "def inicio_sesion?\n usuario_id.blank?\n end", "def nuevo_usuario\n @user = User.new(params[:user])\n @user.cantidad_bots = 1\n\n # Según tipo de registro\n if params[:tipo] == \"plus\"\n @user.registro = true\n end\n\n # Se agrega perfil de usuario (0)\n @user.perfil = 0\n if @user.valid?\n @user.save\n # Login automatico al registrar\n session[:login] = @user\n session[:last_seen] = Time.now\n UserMailer.welcome_email(@user).deliver\n redirect_to bot_path, :notice => \"Registro OK, Bienvenido\"\n else\n flash[:error] = \"Error en los datos ingresados\"\n render 'bots/registrar'\n end\n end", "def create\n #Creamos el objeto con los valores a ingresar.\n @usuario = Usuario.new({\n :nombre => params[:usuario][:nombre],\n :apellido => params[:usuario][:apellido],\n :user=> params[:usuario][:user],\n :pass => params[:usuario][:pass],\n });\n #Verificamos si el usuario ha sido creado.\n if @usuario.save()\n redirect_to :controller => \"usuarios\", :action => \"exito\", :notice => \"El usuario ha sido creado\";\n else\n render \"registrar\";\n end\n end", "def validate_before_update!(user)\n # Calling valid? will reset the error list :( so it has to be done first.\n user.valid?\n\n # NB: These uniqueness constraints have to be enforced by the database\n # also, or else there is a race condition. However, checking for them\n # separately allows us to give a better experience in the common\n # non-race failure conditions.\n unless (user.username.nil? || user.username.empty?) # these are covered by other validations\n existing_users_ids = execute_sql(:validate, :user) do\n table.select(:id).filter(:username => user.username).map {|u| u[:id]}\n end\n if existing_users_ids.any? {|id| id != user.id }\n user.username_not_unique!\n end\n end\n\n unless (user.email.nil? || user.email.empty?) # validated elsewhere\n existing_users_ids = execute_sql(:validate, :user) do\n table.select(:id).filter(:email => user.email).map {|u| u[:id]}\n end\n if existing_users_ids.any? {|id| id != user.id }\n user.email_not_unique!\n end\n end\n\n unless user.errors.empty?\n self.class.invalid_object!(user.errors.full_messages.join(\", \"))\n end\n\n true\n end", "def create\n @usuario = Usuario.new(params[:usuario])\n if not @usuario.bloqueado or @usuario.admin == 2\n #Usuario esta habilitado\n @usuario.bloqueado = 0\n end\n usuario.transcriptor = true unless usuario.transcriptor or usuario.responsable\n\n respond_to do |format|\n if not @usuario.transcriptor and not @usuario.responsable\n flash.keep\n format.html { render action: \"new\", alert: 'El administrador debe ser transcriptor y/o responsable' }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end \n\n if @usuario.save\n CorreosUsuario.enviar_contrasena(@usuario, flash[:contrasena], 1).deliver\n format.html { redirect_to @usuario, notice: 'Usuario creado exitosamente.'}\n format.json { render json: @usuario, status: :created, location: @usuario }\n else\n flash.keep\n format.html { render action: \"new\", alert: 'Usuario no pudo ser creado.' }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "def valid_user\n unless (@user && @user.activated? &&\n @user.authenticated?(:email_change, params[:id]))\n flash[:danger] = \"Invalid credentials\"\n redirect_to root_path\n end\n end", "def usuario_params\n params.require(:usuario).permit(:login, :nome, :email, :perfil, :status)\n end", "def create_user_if_valid(user_fields)\n ActiveRecord::Base.transaction do\n begin\n @user = User.create!(user_fields)\n if @user\n UserMailer.notify_admin(@user).deliver\n flash[:notice] = \"Thank you for registering, a confirmation will be sent to you shortly\"\n return true\n end\n return false\n rescue Exception => e\n @user = nil\n @user_error = e\n return false\n end\n end\n end", "def create\n\n # busco el usuario con el mail en la base de datos (es nil si no esta)\n user = User.find_by_email(params[:session][:email])\n\n # si el usuario esta en la base y el password es correcto\n # lo redirijo a la pagina de show de usuario /user/numero\n if user && user.authenticate(params[:session][:password])\n sign_in user\n redirect_to user\n\n # si no se pudo autenticar muestro mensaje de error y vuelve a la misma pagina de sign in\n else\n flash.now[:error] = 'Combinacion Email/Password invalida'\n render 'new'\n end \n \n end", "def usuario_params\n params.require(:usuario).permit(:user, :password, :nombre, :email, :fecha_nacimiento)\n end", "def user_params\n params.permit(:email, :nombre, :password)\n end", "def valid_user_or_email!\n return unless @user.blank? && @extra['email'].blank?\n\n @success = false\n @error = 'Error: user name or extra email must be present'\n end", "def usuario_params\n params.require(:usuario).permit(:nombre, :apellido, :user, :pass)\n end", "def validacion_sucursal\n if @certificado.pertence_a_otra_sucursal?(current_user)\n redirect_to root_url, alert: 'No posees permisos para realizar esta operación porque el certificado no pertenece a tu sucursal'\n return\n end\n end", "def create\n\n if params[:cliente_id] == \"\"\n @pessoa = Pessoa.new(pessoa_params)\n if params[:senha] == \"\"\n @password = SecureRandom.random_number(99999999)\n else\n @password = params[:senha]\n end\n\n @user = User.new\n @user.email = @pessoa.email\n @user.password = @password\n @user.password_confirmation = @password\n if current_user.id == 1\n @user.empresa_id = current_user.empresa_id\n #@user.role = \"ADMIN\"\n else\n @user.empresa_id = 1\n #@user.role = \"USER\"\n end\n\n @user.role = \"USER\"\n\n respond_to do |format|\n if @pessoa.save\n #criando usuário\n @user.pessoa_id = @pessoa.id\n if @user.save\n Userinfo.send_email(@user,current_user.empresa.nome_empresa).deliver\n end\n #relacionando usuário com empresa\n Clienteempresa.create(:empresa_id => current_user.empresa_id, :pessoa_id => @pessoa.id)\n format.html { redirect_to @pessoa, notice: 'Cadastro realizado com sucesso!.' }\n format.json { render :show, status: :created, location: @pessoa }\n else\n format.html { render :new }\n format.json { render json: @pessoa.errors, status: :unprocessable_entity }\n end\n end\n else\n Clienteempresa.create(:empresa_id => current_user.empresa_id, :pessoa_id => params[:cliente_id])\n respond_to do |format|\n format.html { redirect_to pessoas_url, notice: 'Cadastro realizado com sucesso!' }\n format.json { head :no_content }\n end\n end\n\n end", "def create\n aux = user_params\n @aux_user = User.where('email = ?',aux[:email]).take\n if @aux_user\n render json: {error: 'usuario ja existe'}, status: :unprocessable_entity\n else\n @user = User.new(user_params)\n # @user.password_hash = params[:password_hash]\n @user.password = params[:password]\n if @user.save\n render json: @user, status: 200\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end\n end", "def require_valid_user!\n return true\n end", "def validate_user\n return unauthorized_access_response('um_gbd_vu_1') if @user.blank? || (@user.client_id != @client_id)\n success\n end", "def cria_user\n return if user.present?\n User.create(email: self.end_email, password: '123123', password_confirmation: '123123',\n tb_empregado_id: self.id, e_admin: self.e_admin || false).encrypted_password\n end", "def valida_plantilla(current_usuario, idplant)\n true\n end", "def user_params\n params.require(:user).permit(:nome, :registro, :cargo, :email, :pin)\n end", "def user_have\n unless current_user\n redirect_to root_path, :alert => \"Зарегистрируйтесь или войдите\"\n end\n end", "def user_params\n params.require(:user).permit(:email, :username, :password, :password_confirmation, :Nombre, :Supervisor, :cover)\n end", "def validade_params\n params.require(:validade).permit(:user_id, :produto_id, :validade)\n end", "def create\n @valoration_user = ValorationUser.new(valoration_user_params)\n @valoration_user.reservation.valorar_user = true\n respond_to do |format|\n if @valoration_user.save\n format.html { redirect_to @valoration_user, notice: 'Valoration de usuario creada satisfactoriamente.' }\n format.json { render :show, status: :created, location: @valoration_user }\n else\n format.html { render :new }\n format.json { render json: @valoration_user.errors, status: :unprocessable_entity }\n end\n end\n @valoration_user.save\n end", "def usuario_params\n params.require(:usuario).permit(:email, :name, :password, :password_confirmation)\n end", "def create\n\t params[:user][:login] = params[:user][:email_work] if params[:user][:login].blank?\n user = params[:user]\n @user = User.create(user)\n @user.valid? ? after_save(user) : error_responds(@user)\n end", "def with_valid_user\n if(current_user && current_user.id.to_s == params[:user_id].to_s)\n @user = current_user\n else\n flash[:error] = \"Debes estar autenticado para acceder a este &aacute;rea\"\n redirect_to :controller => :home, :action => :index\n end\n end", "def create\n @user = User.new(users_params)\n @users = User.all\n #Verificacion de que los campos estén llenos\n if params[:user][:nombre_usuario] == \"\" || params[:user][:apellidos_usuario] == \"\" || params[:user][:email] == \"\" || params[:user][:rol] == \"\" || params[:user][:estado] == \"\"\n @titulo = \"Creacion de usuario\"\n @mensaje = \"Debe llenar todos los campos\"\n @tipo = \"warning\"\n @icono = \"icon fa fa-warning\"\n else\n #Verificacion de la password\n if params[:user][:password] != params[:user][:password_confirmation]\n @titulo = \"Creacion de usuario\"\n @mensaje = \"Las contraseñas son distintas\"\n @tipo = \"warning\"\n @icono = \"icon fa fa-warning\"\n else\n #Verificacion de la repeticion del nombre\n if !RepeticionUsuarioCreate(@users, params[:user][:nombre_usuario], params[:user][:apellidos_usuario])\n @titulo = \"Creacion de usuario\"\n @mensaje = \"Ya existe un usuario con ese nombre y apellido\"\n @tipo = \"warning\"\n @icono = \"icon fa fa-warning\"\n else\n if !RepeticionEmailCreate(@users, params[:user][:email])\n @titulo = \"Creacion de usuario\"\n @mensaje = \"Ya existe un usuario con correo electrónico registrado\"\n @tipo = \"warning\"\n @icono = \"icon fa fa-warning\"\n else\n if !RepeticionLoginCrete(@users, params[:user][:login])\n @titulo = \"Creacion de usuario\"\n @mensaje = \"Ya existe un usuario con ese login\"\n @tipo = \"warning\"\n @icono = \"icon fa fa-warning\"\n else\n respond_to do |format|\n if @user.save\n format.js\n format.html {redirect_to @user, notice: \"Usuario creado correctamente\"}\n format.json {render :show, status: :created, location: @user}\n @titulo = \"Creacion de usuario\"\n @mensaje = \"Se a creado el usuario correctamente\"\n @tipo = \"success\"\n @icono = \"icon fa fa-check\"\n else\n format.js\n format.html {render :new}\n format.json {render json: @user.errors, status: :unprocessable_entity}\n @titulo = \"Creacion de usuario\"\n @mensaje = \"Ha ocurrido un error\"\n @tipo = \"danger\"\n @icono = \"icon fa fa-ban\"\n end\n end\n end\n end\n end\n end\n end\n end", "def user_params(params)\n params.require(:user).permit(:nome, :idade, :endereco)\n end", "def usuario_params\n params.require(:usuario).permit(:nombre, :password, :password_confirmation)\n end", "def fetch_and_validate_user\n @user = User.using_client_shard(client: @client).where(client_id: @client_id, email: @email).is_active.first\n return error_with_identifier('invalid_api_params',\n 'um_u_c_ve_2',\n ['user_already_present']\n ) if @user.present?\n\n success\n end", "def create\n @user = User.new(user_params)\n\n if @user.save\n # if super user create something, do not send confirmation, activate tis account & login as this user \n if current_user and current_user.super_user?\n @user.confirm_email!\n UserSession.create(@user)\n flash[:success] = \"Votre compte a été créé avec succès.\"\n else\n @user.maybe_deliver_email_confirmation! self\n flash[:success] = \"Votre compte a été créé avec succès, un email de confirmation vous a été envoyé.\"\n end\n\n redirect_to @user\n else\n flash[:danger] = \"Une erreur est survenue.\"\n render :new\n end\n end", "def usuario_params\n params.require(:usuario).permit(:nombre_completo, :dni, :telefono, :direccion, :email,:entidad_id,:password)\n end", "def user_params\n params.require(:user).permit(:nome, :email, :username, :password, :telefone, :password_confirmation, :ad_user, :uo_id, :role_id)\n end", "def user_params\n params.require(:user).permit(:nom, :prenom, :email, :code, :password, :password_confirmation, :date_de_naissance, :poste_id)\n end", "def usuario_params\n params.require(:usuario).permit(:username, :email, :password, :password_confirmation)\n end", "def create\n @recruiter = Recruiter.new(params[:recruiter])\n @user = User.new(params[:user]) do |u|\n u.rolable = @recruiter\n u.skip_password_validation = true\n u.is_admin = params[:user][:is_admin] if current_user.is_admin # is_admin is non accessible\n end\n \n valid = @user.valid? \n valid = @recruiter.valid? && valid\n \n if valid\n create_and_send_invitation(@user, @recruiter, \"Recruiter\")\n else\n respond_to do |format|\n format.html { render action: \"new\" }\n format.json { render json: @recruiter.errors, status: :unprocessable_entity }\n end\n end\n end", "def user_params \n params.require(:user).permit(:email, :password, :password_confirmation, :nombre, :documento, :rol) \nend", "def valid_user\n User.new(name: \"John Smith\",\n email: \"[email protected]\",\n password: \"password\",\n password_confirmation: \"password\")\nend", "def validate_user\n \tauthorized_user = nil\n @user = User.new(user_sign_in_params)\n\n if @user.status == \"Active\"\n puts \"user : #{@user.inspect}\"\n\n u = User.where(:email => @user.email).first\n # puts \"user_extracted : #{u.inspect}\"\n\n if u.blank?\n flash[:notice] = \"user with email #{@user.email} doesnot exist\"\n else\n d_pass = decrypt(u.password)\n # puts \"#{d_pass}\"\n if d_pass == @user.password\n if u.is_first_logged_in\n if u.is_super_user\n @user = User.find(u.id)\n @user.last_logged_in = DateTime.now.utc\n if @user.is_first_logged_in == false\n @user.is_first_logged_in = true\n end\n @user.save\n authorized_user = @user\n elsif u.is_owner\n @user = User.find(u.id)\n @user.last_logged_in = DateTime.now.utc\n if @user.is_first_logged_in == false\n @user.is_first_logged_in = true\n end\n @user.save\n authorized_user = @user\n else\n flash[:notice] = \"User cannot log in !! only admin/owner can\"\n end\n else\n \tu.is_first_logged_in = true\n flash[:notice] = \"confirm email\"\n end\n else\n flash[:notice] = \"Incorrect password\"\n \n end\n end\n else\n flash[:notice] = \"User has been deleted\"\n end\n if authorized_user\n \t# TODO: mark user as logged in\n \tsession[:user_id] = authorized_user.id\n \tsession[:email] = authorized_user.email\n \t\n\t flash[:notice] = \"You are now logged in.\"\n\t redirect_to(:controller => 'home',:action => 'index')\n else\n \[email protected]_attempts += 1\n @user.save\n render('login')\n end\n end", "def confirm\n @user = User.new(sign_up_params)\n if @user.invalid?\n flash.now[:danger] = '入力内容にエラーがあります。'\n render :new\n return\n end\n end", "def create_and_update_event\n user = User.find_by(\"id = ?\", self.user_id)\n puts user.rol\n if user.rol != \"ORGANIZADOR\" || user.rol != \"ADMINISTRADOR\"\n errors.add(:message, 'No es permitido')\n end\n end", "def usuario_params\n params.require(:usuario).permit(:nome, :password, :email, :matricula, :mac)\n end", "def create_user\n authorize! :update, @user, :message => t('errors.messages.not_authorized_as_manager')\n #@marina = Marina.find(params[:id])\n @marina = current_user.marina # try this\n anemail = params[:user_email]\n\n if User.exists?(email: anemail)\n redirect_to @marina, :alert => t('errors.messages.User_already_registered')\n else\n if anemail =~ /@/\n @marina.create_user(anemail)\n redirect_to @marina, notice: t('errors.messages.User_created_and_notified')\n else\n redirect_to @marina, :alert => t('errors.messages.User_created_and_notified')\n end\n end \n end", "def validate\n return HESResponder(\"Field and value required.\", \"ERROR\") unless params[:field] && params[:value]\n fs = ['email','username', 'altid']\n f = params[:field]\n if !fs.include?(f)\n return HESResponder(\"Can't check this field.\", \"ERROR\")\n end\n f = f.to_sym\n v = params[:value]\n if @promotion.users.where(\"LOWER(#{f}) = ?\", v.downcase).count > 0\n return HESResponder(f.to_s.titleize + \" is not unique within promotion.\", \"ERROR\")\n else\n return HESResponder()\n end\n end", "def usuario_params\n params.require(:user).permit(:name, :apellidos, :email, :encrypted_password, :activo, :tipo, :foto)\n end", "def create\n @user = User.new(user_to_be_created)\n\n error = @user.validate_user?\n\n if error.nil? && @user.save\n handler_notice('Usuário cadastrado com sucesso!', login_path)\n else\n handler_notice_error(error, new_user_path)\n end\n end", "def create\n @user = User.new(params[:user])\n\n valido = false\n if [email protected]? and @user.password.length < 5\n @user.errors.add(\"password\", \": Debe ser mayor a 5.\")\n valido = false\n else\n\n if @user.password == params[:confirmacion]\n valido = true\n @user.password = Digest::MD5.hexdigest(@user.password)\n else\n @user.errors.add(\"password\", \": Los passwords no coinciden.\")\n end\n end\n \n respond_to do |format|\n if valido and @user.save\n flash[:notice] = 'Usuario guardado.'\n format.html { redirect_to(@user) }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n\n if User.exists? email: params[:user][:email]\n user = User.find_by_email params[:user][:email]\n if user.invited_to_sign_up?\n Rails.logger.warn \"User #{user.email} was invited but instead of accepting the invitation is signing up normally. Destroying old user record before signup.\"\n user.destroy\n end\n end\n\n super\n end", "def create\n @usuario = Usuario.new(params[:usuario])\n @usuario.perfil = Perfil.where(\"nome=?\",\"Usuário\").first if @usuario.perfil.nil?\n #if @usuario.senha_flag.blank?\n @usuario.senha_segura = encrypt(@usuario.senha_flag,nil)\n #end\n if params[:peso_novo]\n if @usuario.peso.nil? || params[:peso_novo].to_f != @usuario.peso.peso\n @usuario.pesos << Peso.new(:data=>@usuario.peso.data,:peso=>@usuario.peso.peso) unless (@usuario.peso.nil? || params[:peso_novo].to_f == @usuario.peso.peso)\n # @usuario.peso.create(:peso=>params[:peso_novo],:data=>Date.current,:usuario=>@usuario)\n @usuario.peso = Peso.new(:peso=>params[:peso_novo],:data=>Date.current)\n end\n end\n \n respond_to do |format|\n if @usuario.save\n flash[:success] = \"Cadastro efetuado com sucesso, bem-vindo à Aliments\"\n flash[:subtitle] = \"Para iniciar efetue o login\"\n format.html { redirect_to(@usuario, :notice => 'Usuario was successfully created.') }\n format.xml { render :xml => @usuario, :status => :created, :location => @usuario }\n else\n flash[:error] = \"Não foi possível efetuar seu cadastro.\"\n flash[:subtitle] = \"Verifique os erros e tente novamente\"\n format.html { render :action => \"new\" }\n format.xml { render :xml => @usuario.errors, :status => :unprocessable_entity }\n end\n end\n end", "def valid_user\n # unless @user\n # redirect_to root_url\n # end\n end", "def create\n @empresa = Empresa.new(empresa_params)\n user_id = params[:user_id].to_i\n if user_id > 0 #Given n0 is admin and \"\" could be interpreted as 0, we avoid the risk\n @empresa.user_id = user_id\n end\n respond_to do |format|\n if @empresa.save\n helpers.set_current_empresa(@empresa.user, @empresa.id)\n format.html { redirect_to @empresa, notice: 'Empresa creada con éxito.' }\n format.json { render :show, status: :created, location: @empresa }\n else\n format.html { render :new }\n format.json { render json: @empresa.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n super\n\n if new_usuario_params[:password].blank?\n new_usuario_params.delete(:password)\n new_usuario_params.delete(:password_confirmation)\n end\n\n @usuario = Usuario.invite!(new_usuario_params,current_usuario)\n\n #current_taller.add_usuario(@usuario)\n\n\n respond_to do |format|\n if @usuario.valid?\n format.html { usuarios_path }\n format.json { render :show, status: :created, location: @usuario }\n else\n format.html { render :new }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "def validate()\n errors.add(:nombre, \"debe ser positivo\") if nombre.nil?\n end", "def usuario_params\r\n params.require(:user).permit(:username,\r\n :email, \r\n :password, \r\n :password_confirmation, \r\n :apellido, \r\n :numero_ci, \r\n :direccion, \r\n :telefono, \r\n :celular,\r\n :rol_id)\r\n end", "def validarSesion\n if session[:email].nil?\n flash[:error] = t('debesesion')\n redirect_to root_url\n end\n end", "def check_fields\n params[:user] ||= {}\n \n if !params[:user][:email]\n errors = {email: [\"не может быть пустым\"]}\n render json: {msg: \"Укажите адрес эл. почты\", errors: errors}, status: 401\n elsif !params[:user][:password]\n errors = {password: [\"не может быть пустым\"]}\n render json: {msg: \"Укажите пароль\", errors: errors}, status: 401\n end\n end", "def create\n @usuario = Usuario.create(ad_params)\n @usuario.save\n\n if @usuario.save\n flash[:success] = \"Bienvenido, gracias por registrarse a Bestnid.!\"\n flash[:success] = \"Sus datos personales son:!\"\n redirect_to @usuario\n else \n render 'new'\n end \nend", "def processable?\n return true if self.user && !self.user.new_record?\n \n # clean errors on email\n self.errors.delete(:email)\n \n # check if email is given and if so if email is valid\n if self.email\n self.errors.add(:email, :invalid) unless self.email =~ Identity::Email::EMAIL_ADDRESS_REGEX\n else\n self.errors.add(:email, :blank)\n end\n \n super\n end", "def create\n @usuario = Usuario.new(params[:usuario])\n\n respond_to do |format|\n if !params[:senha2].nil?\n if @usuario.senha == params[:senha2]\n @usuario.senha = Digest::SHA1.hexdigest(session[:salt] + params[:senha2])\n if @usuario.save\n format.html { redirect_to(consultar_usuario_path(@usuario), :notice => 'O usuário foi criado com sucesso.') }\n format.xml { render :xml => @usuario, :status => :created, :location => @usuario }\n else\n format.html { render :action => \"novo\" }\n format.xml { render :xml => @usuario.errors, :status => :unprocessable_entity }\n end\n else\n flash[:notice] = \"A senha e a confirmação devem ser iguais\"\n redirect_to novo_usuario_path\n end\n end\n end\n end", "def user_params\n params.require(:user).permit(:email,:username,:curso_id,:tipoperfil_id,:bloqueio, :administrador)\n end", "def usuario_params\n params.require(:usuario).permit(:title, :name, :lastName, :email, :groupId, :userId,:folio,:conteo)\n end", "def user_params #este metodo SE PUEDE LLAMAR COMO QUIERAS, pero es necesario para que al crear un objeto se autorice su creacion (porque si no nos podrían meter codigo malicioso)\n\t\tparams.require(:user).permit(:name, :email, :password)\n\tend", "def create\n @usuario = Usuario.new(usuario_params)\n @usuario.nombres = @usuario.nombres.upcase\n @usuario.apellidos = @usuario.apellidos.upcase\n @usuario.salario = 0\n respond_to do |format|\n if @usuario.save\n format.html { redirect_to @usuario, notice: 'El Usuario se ha creado correctamente.' }\n format.json { render :show, status: :created, location: @usuario }\n else\n @div_edit_admin = true\n format.html { render :new }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n \n end", "def user_params\n params.require(:user).permit(:nom, :prenom, :sexe, :adresse, :password, :password_confirmation)\n end", "def create\n @user = User.new(first_name: params[:first_name], \n last_name: params[:last_name],\n description: params[:description],\n email: params[:mail])\n \n if params[:password] != params[:confirmpassword]\n flash.now[:danger] = \"Ton mot de passe doit faire 6 carractères !\"\n render :action => 'new' \n end\n if @user.save \n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: @user }\n flash[:success] = \"You successfuly created your account\"\n redirect_to :controller => 'users', :action => 'index'\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n flash.now[:danger] = \"Error with the account creation\"\n render :action => 'new'\n end\n end", "def validate_username\n if User.where(email: username).exist?\n errors.add(:username, :invalid)\n end\n end", "def user_params\n params.require(:user).permit(:correo, :contraseña)\n end", "def usuario_params\n params.require(:usuario).permit(:nome, :cpf, :email, :password, :password_confirmation, :isAdmin, :isBlocked, :updating_password)\n end", "def verify_register_conclusion\n if [email protected]_confirmed?\n flash[:notice] = \"Insira um e-mail pessoal para receber nossos avisos.\"\n redirect_to email_completar_path\n return false\n end\n if [email protected]_completed?\n flash[:notice] = \"Conclua sua inscrição para acessar todas as funções do sistema\"\n #flash[:notice] = \"Não é possível finalizar seu cadastro. Aguarde até o dia 20 para se inscrever novamente!\"\n redirect_to cadastro_completar_path\n return false\n end\n end", "def create_user\n\n security_code = SecureRandom.hex(4)\n user = User.new(name: params[:name], email: params[:email], password: security_code, password_confirmation: security_code)\n if user.valid?\n if user.save\n # Aplica lo logica necesaria\n #ApplicationMailer.registration_candidate(user, security_code).deliver# notifica el registro por correo\n @log.current_user = user\n @log.registration_auditory(controller_name + '/' + __method__.to_s, Constant::CONST_REGISTER_CANDIDATE, request.remote_ip)\n render json: {status: 200, payload: {message: Constant::CONST_CANDIDATE_REGISTRED, type: Constant::CONST_TYPE_FLASH_MESSAGE_SUCESS}}\n else\n # almacena el error y notifica al administrador del sistema\n #ApplicationMailer.registration_error(@log.registration_error(user.errors.full_messages, controller_name + '/' + __method__.to_s, Constant::CONST_INITIAL_PASSWORD, request.remote_ip)).deliver\n render json: {status: 500, payload: {message: Constant::CONST_INTERNAL_SERVER_ERROR, type: Constant::CONST_TYPE_FLASH_MESSAGE_ERROR}}\n end\n else\n render json: {status: 400, payload: {message: user.errors.full_messages.first.gsub(user.errors.full_messages.first.split[0]+' ','') , type: Constant::CONST_TYPE_FLASH_MESSAGE_ERROR}}\n end\n end", "def usuario_params\n params.require(:usuario).permit(:nombre, :apellido, :usuario, :twitter)\n end", "def registroapi\n @usuario = User.new(:email => params[:email], :password => params[:password], :password_confirmation => params[:password], :nombre => params[:nombre], :username => params[:username], :nacimiento => params[:nacimiento], :genero => params[:genero])\n if @usuario.save\n respond_to do |format|\n format.html { redirect_to '/users/sign_in', notice: 'Registro exitoso, puedes iniciar sesión.', :status => 200 }\n format.json { render json: { :error => 'false', :desc => 'Registro exitoso' } }\n end\n\n else\n respond_to do |format|\n format.html { redirect_to '/registro_api', alert: @usuario.errors.full_messages.to_sentence }\n format.json { render json: { :error => 'true', :desc => @usuario.errors.full_messages} }\n end\n end\n end", "def exibe_para_usuario?\n \t\tif usuario_signed_in?\n \t\t\tif current_usuario.admin?\n \t\t\t\treturn true\n \t\t\telse\n \t\t\t\treturn false\n \t\t\tend\n \t\telse\n \t\t\treturn false\n \t\tend\n \tend", "def create\n @persona = Persona.find(params[:persona_id])\n @persona_nota_seguimiento = PersonaNotaSeguimiento.new(persona_nota_seguimiento_params)\n @persona_nota_seguimiento.persona = @persona\n @persona_nota_seguimiento.usuario = current_usuario\n if @persona_nota_seguimiento.save\n redirect_to @persona, notice: 'Guardado Correctamente.'\n else\n render :new\n end\n end", "def create\n u = User.only_deleted.where(\"email = ?\", params[:user][:email])\n\n if u.present?\n flash[:danger] = 'User Deleted. Please Contact Admin.'\n redirect_to new_user_session_path\n else\n # if valid_email(params[:user][:email]) == true\n super\n # end\n end\n end", "def user_params\n params.require(:user).permit(:email, :roepnaam, :tussenvoegsel, :achternaam, :adres, :woonplaats, :telefoon, :password, :password_confirmation)\n end", "def create\n\t\t@user = User.new(user_params)\n\t\tif @user.email.blank? or @user.password.blank? or @user.phone.blank?\n\t\t\trender_error(ERROR_EMPTY_EMAIL_OR_PASSWORD,ERROR_EMPTY_EMAIL_OR_PASSWORD_MESSAGE)\n\t\t\treturn\n\t\tend\n\t\t\n\t\tif User.exists?(email: @user.email) or User.exists?(phone: @user.phone)\n\t\t\trender_error(ERROR_USER_EXIST,ERROR_USER_EXIST_MESSAGE)\n\t\t\treturn\n\t\tend\n\t\t\n\t\[email protected]_open_id\n\t\t\n\t\tif @user.save\n\t\t\[email protected]_email_verification\n\t\t\trender_success(@user)\n\t\telse\n\t\t\trender_detail_error(@user.errors)\n\t\tend\n\tend", "def verify\n params[:username] ||= ''\n User.with_master do\n @user = User.find_by_username(params[:username])\n end\n if @user && @user.active\n flash[:notice] = I18n.t(:user_already_active_notice)\n redirect_to login_path\n elsif @user && @user.validation_code == params[:validation_code] && ! params[:validation_code].blank?\n @user.activate\n Notifier.deliver_account_activated(@user)\n redirect_to activated_user_path(@user)\n elsif @user\n @user.validation_code = User.generate_key if @user.validation_code.blank?\n send_verification_email\n flash[:error] = I18n.t(:user_activation_failed_resent_validation_email_error)\n redirect_to pending_user_path(@user)\n else\n flash[:error] = I18n.t(:user_activation_failed_user_not_found_error)\n redirect_to new_user_path\n end\n end", "def validate\n super\n validates_presence :account\n validates_unique :account\n end", "def validate\n\t\t#puts \"--- ENTRANDO A VALIDATE----- password, password_confirmation: #{password} - #{password_confirmation}\"\n\t\terrors.add('contrase&ntilde;a', 'y confirmaci&oacute;n no coinciden') unless password_confirmation == password\n\tend", "def make_facebook_model_valid!\n # These database fields are required if authenticable is used\n write_attribute(:password_salt, '') if self.respond_to?(:password_salt)\n write_attribute(:encrypted_password, '') if self.respond_to?(:encrypted_password)\n \n skip_confirmation! if self.class.skip_confimation_for_facebook_users && respond_to?(:skip_confirmation!)\n end" ]
[ "0.6931838", "0.66709185", "0.6650675", "0.65705127", "0.6567209", "0.65503603", "0.6534783", "0.64886314", "0.64223063", "0.6413416", "0.6395836", "0.63747686", "0.63519466", "0.6345063", "0.6313635", "0.6307421", "0.62899977", "0.6287115", "0.6274331", "0.62426823", "0.6235913", "0.6234895", "0.6233887", "0.6218864", "0.621311", "0.6203308", "0.6202423", "0.61895955", "0.61889625", "0.618125", "0.6179273", "0.6175815", "0.6169498", "0.616246", "0.6154403", "0.6146035", "0.61458343", "0.61229855", "0.61136717", "0.61125684", "0.61069393", "0.6098832", "0.60970086", "0.60936624", "0.6090408", "0.6089336", "0.60856056", "0.6082018", "0.608023", "0.60758734", "0.6060659", "0.60558254", "0.60532326", "0.6051434", "0.6049659", "0.60382825", "0.60278916", "0.6020271", "0.6019687", "0.60185176", "0.60109735", "0.6008416", "0.6004814", "0.6001204", "0.60011524", "0.59944445", "0.59845936", "0.59825", "0.5981581", "0.5979596", "0.5974917", "0.5973158", "0.59691095", "0.59602076", "0.59551686", "0.595096", "0.59460145", "0.59442073", "0.5943576", "0.5941102", "0.5939392", "0.59373075", "0.5935466", "0.59247255", "0.5923448", "0.59181714", "0.5914406", "0.59129554", "0.59111464", "0.59021133", "0.5901489", "0.58962977", "0.5889111", "0.5888966", "0.58797556", "0.5879626", "0.5872287", "0.5868003", "0.5866532", "0.5864985" ]
0.6411987
10
Return Jonathans Twitter handle (i.e. the string "jonnyt") return users["Jonathan"][:twitter] Return Eriks hometown return users["Erik"][:home_town] Return the array of Eriks favorite numbers return users["Erik"][:favourite_numbers] Return the type of Avrils pet Colin users["Avril"][:pets]["colin"] Return the smallest of Erik's favorite numbers users["Erik"][:favourite_numbers].min Return an array of Avril's favorite numbers that are even
def evil_even_numbers(array_of_numbers) result = [] for number in array_of_numbers result.push(number) if(number % 2 == 0) end return result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user\n t = []\n ville = nom_ville\n\t\tville.each do |i|\n\t\t\tCLIENT.search(i).take(1).collect do |tweet|\n\t\t\t\tt.push(\"#{tweet.user.screen_name}\") \n\n\t\t\tend\n\t\t end\n\treturn t\nend", "def search_user(q)\n uri = \"https://api.twitter.com/1/users/search.json\"\n req = Typhoeus::Request.new(uri,\n :method =>\"get\",\n :params =>{:q=>q, :include_entities=>\"true\"})\n oauth_helper = OAuth::Client::Helper.new(req, oauth_params.merge(:request_uri => uri))\n sign_request(req,uri)\n hydra = Typhoeus::Hydra.new\n hydra.queue(req)\n hydra.run \n \n profile_list = Array.new\n\n JSON.parse(req.response.body).each do |raw|\n profile_list.push([\n raw[\"id\"].to_s,\n raw[\"profile_image_url\"].to_s,\n raw[\"name\"].to_s,\n raw[\"screen_name\"].to_s]\n )# prepare to cash into database, not sure\n end\n profile_list.sort!{|x,y| x[0]<=>y[0]} \n end", "def tweets\n # cannot write this yet because I can't even test it\n # 1. they keep track of their tweets => []\n # 2. they figure it out\n Tweet.all.select do |tweet| # Tweet instance\n # I am the user asking for my tweets\n # I want to know which tweets are ME (I, my, myself, self)\n tweet.user == self\n # comapre it to the information being held in the tweet\n # specifically, the reference they are holding\n end\n\n # so efficiency => don't think about it\n # refactor, indexes\n end", "def parse_tweets\n @tweets.each do |tweet|\n @user[:handle] << tweet[\"user\"][\"screen_name\"]\n unless tweet[\"place\"].nil?\n place = tweet[\"place\"][\"full_name\"]\n else\n place = nil\n end\n\n @user[:features]<<{:type =>\"Feature\",\n :geometry =>{:type=>\"Point\",\n :coordinates =>tweet[\"coordinates\"][\"coordinates\"]},\n :properties =>{:created_at=>tweet[\"created_at\"],\n :text=>tweet[\"text\"],\n :place=>place}}\n end\n end", "def get_profile( twitter_id ) \n if twitter_id.class == Fixnum\n data = Net::HTTP.get_response('twitter.com', \"/users/show.json?user_id=#{twitter_id}\").body\n else\n data = Net::HTTP.get_response('twitter.com', \"/users/show/#{twitter_id}.json\").body\n end\n \n # we convert the returned JSON data to native Ruby\n # data structure - a hash\n result = JSON.parse(data)\n \n # if the hash has 'Error' as a key, we raise an error\n if result.has_key? \"error\"\n raise TwitterError.new result[\"error\"]\n end\n result\n end", "def user(username_or_id)\n puts \"Getting Info about User %s\" % username_or_id.to_s\n begin\n u = @MT.user(username_or_id)\n string_data = {\n :name => u.name,\n :screen_name => u.screen_name,\n :location => u.location,\n :description => u.description,\n :url => u.url \n }\n user_data = {\n :id => u.id,\n :followers_count => u.followers_count,\n :friends_count => u.friends_count,\n :protected => u.protected,\n :listed_count => u.listed_count,\n :created_at => u.created_at,\n :favourites_count => u.favourites_count,\n :utc_offset => u.utc_offset,\n :time_zone => u.time_zone,\n :geo_enabled => u.geo_enabled,\n :verified => u.verified,\n :statuses_count => u.statuses_count,\n :lang => u.lang,\n :is_translator => u.is_translator\n }\n string_data.each { |k,v| v.nil? ? (user_data[k] = nil) : (user_data[k] = v) }\n user_data\n rescue Twitter::Error::Unauthorized, Twitter::Error::Forbidden, Twitter::Error::NotFound\n puts \"Suspended?\"\n nil\n end\n end", "def twitter_user_data\n\t\t# IT WOULD BE NICE TO RE-FACTOR THIS SO IT IS THE SAME current_user as for other stats display...\n\t\t@twitter_graph = Authorization.where(\"user_id = ?\", current_user).where(\"provider = ?\", \"twitter\")\n\t\t@twitter_graph_user = TwitterUser.where(\"uid = ?\", @twitter_graph.first['uid'])\n\t\tdata_by_day = @twitter_graph_user.total_grouped_by_date(2.weeks.ago)\n\t\t#twitter_index_by_day = IvolveIndex.twitter_grouped_by_day(2.weeks.ago)\n\t\t(2.weeks.ago.to_date..Time.zone.today).map do |date|\n\t\t\tif !data_by_day[date].nil?\n\t\t\t\tcreated_at = date\n\t\t\t\tfriends_count = data_by_day[date].first.try(:friends_int_count)\n\t\t\t\tfollowers_count = data_by_day[date].first.try(:followers_int_count)\n\t\t\t\ttweets_count = data_by_day[date].first.try(:tweet_int_count)\n\t\t\t\tfavd_count = data_by_day[date].first.try(:favorite_int_count)\n\t\t\t\tlist_count = data_by_day[date].first.try(:listed_int_count)\n\t\t\telse\n\t\t\t\tcreated_at = date\n\t\t\t\tfriends_count = 0\n\t\t\t\tfollowers_count = 0\n\t\t\t\ttweets_count = 0\n\t\t\t\tfavd_count = 0\n\t\t\t\tlist_count = 0\n\t\t\tend\n\n\t\t\t{\n\t\t\t\tcreated_at: date,\n\t\t\t\tnum_friends: friends_count,\n\t\t\t\t#index_friends: twitter_index_friends,\n\t\t\t\tnum_followers: followers_count,\n\t\t\t\t#index_followers: twitter_index_followers,\n\t\t\t\ttweets_sent: tweets_count,\n\t\t\t\t#index_sent: twitter_index_sent,\n\t\t\t\ttweets_favd: favd_count,\n\t\t\t\t#index_favd: twitter_index_favd,\n\t\t\t\tnum_lists: list_count,\n\t\t\t\t#index_lists: twitter_index_lists,\n\t\t\t}\n\t\tend\n\tend", "def twitter\n @data['social']['twitter']\n end", "def user_tweets(user, count=10, since_id=nil, max_id=nil)\n print \"Getting Last %d Statuses for User %s\" % [count, user.to_s]\n print \" since %s\" % since_id if since_id\n print \" until %s\" % max_id if max_id\n print \"\\n\"\n options = {:count => count, :trim_user => true, :include_rts => true, :include_entities => true}\n options[:since_id] = since_id if since_id\n options[:max_id] = max_id if max_id\n begin\n statuses = @MT.user_timeline(user, options)\n if statuses.size > 0\n status_data = statuses.map do |s|\n {\n :user_id => s.user.id,\n :created_at => s.created_at,\n :id => s.id,\n :text => s.text,\n :source => s.source,\n :truncated => s[\"truncated\"],\n :in_reply_to_user_id => s[\"in_reply_to_user_id\"],\n :in_reply_to_screen_name => s[\"in_reply_to_screen_name\"],\n :geo => s[\"geo\"],\n :coordinates => s[\"coordinates\"],\n :place => parse_place(s[\"place\"]),\n :contributors => s[\"contributors\"],\n :retweet_count => s[\"retweet_count\"],\n :entities => parse_entities(s.attrs[\"entities\"]),\n :retweeted_status => parse_retweeted_status(s[\"retweeted_status\"])\n }\n end\n status_data\n else\n []\n end\n rescue Twitter::Error::Unauthorized, Twitter::Error::Forbidden\n puts \"Failed for %s (Protected)\" % user.to_s\n []\n end\n end", "def select_user\n # @users = ['ichthala', 'wescarr17', 'seraphicmanta', 'tcclevela', 'antonwheel', 'horse_ebooks', 'catlandbooks']\n # @users.each_with_index do |user, index|\n # @users[index] = Twitter.user(user)\n # end\n\n @users = []\n\n while @users.count < 9\n offset = rand(Twitteruser.count)\n rand_sn = Twitteruser.first(:offset => offset).screen_name\n unless @users.find_index(rand_sn)\n @users << rand_sn\n end\n end\n\n @users << 'horse_ebooks'\n\n @users.each_with_index do |user, index|\n @users[index] = Twitter.user(user)\n end\n\n respond_to do |format|\n format.html\n format.json {render json: @users}\n end\n\n end", "def get_name_and_location\n @top_ten.each do |user|\n user_details = self.class.get(\"/users/#{user[0]}\").parsed_response\n user << user_details[\"name\"]\n user << user_details[\"location\"]\n end\n end", "def getUserInfo(doc, tweet)\n\t@username = doc.at_css(\".js-action-profile-name b\").text\n\tputs \"Username: #{@username}\"\n\n\t@name = doc.at_css(\".show-popup-with-id\").text\n\tputs \"Name: #{@name}\"\n\n\t@user_location = tweet[/\\([\\s]*@([^\\)]+)\\)/i]\n\tif @user_location != nil\n\t\t@user_location = @user_location[3..(@user_location.length - 2)]\n\t\tputs \"User Location: #{@user_location}\"\n\tend\nend", "def user_names_who_liked(id)\n\t\t(HTTP.get(\"https://twitter.com/i/activity/favorited_popup?id=#{id}\").body.to_s.scan(/data-screen-name=\\\\\"(.*?)\\\\\"/).flatten.uniq - [@config[\"Username\"]]).map { |s| \"@#{s}\" }.join(\", \")\n\tend", "def score(username)\n begin\n @data = self.class.get(\"?twitter_screen_name=#{username}&api_key=#{@api_key}\", verify: false)\n result = @data ? JSON.parse(@data.body) : nil\n result['peerindex'] if result\n rescue Timeout::Error\n nil\n end\n\t\tend", "def who_likes(url)\n track = resolve_url(url)\n if track && track.kind == \"track\"\n @users.map {|username|\n if get_liked(username, track.id)\n username\n end\n }.compact\n else # TODO: handle if track isn't found\n []\n end\nend", "def tweet_owners(tweet, options)\n posterID = tweet.user.id \n originalPosterID =\n tweet.retweeted_status.user.id if not tweet.retweeted_status.nil?\n mentionIDs = \n tweet.user_mentions.map {|mention| mention.id} if not tweet.user_mentions.nil?\n if options.include?(posterID)\n return [posterID]\n elsif options.include?(originalPosterID)\n return [originalPosterID]\n elsif not (options & mentionIDs).empty?\n return options & mentionIDs\n else\n raise \"Error getting tweet's owner\"\n end\nend", "def userid_from_username(username)\n data = JSON(open(\"http://api.twitter.com/1/users/show/#{username}.json\").read)\n data[\"id\"]\n end", "def getSongInfo(tweet)\n\tthe_artist_name = tweet[/by[\\w\\W]+(((http\\:\\/\\/){1}))/i]\n\tif the_artist_name != nil\n\t\t@artist_name = the_artist_name[/(?<=^|(?<=[^a-zA-Z0-9\\_\\.]))@([A-Za-z0-9\\_]+)/i]\n\t\tif @artist_name != nil\n\t\t\t@artist_name = @artist_name[1..@artist_name.length]\n\n\t\t\t# Catch the exception thrown by trying to get information\n\t\t\t# from the artist tweet page info. The most common exception\n\t\t\t# is the Timeout/execution expired.\n\t\t\tbegin\n\t\t\t\tuserTweet = Twitter.user(\"#{@artist_name}\").verified\n\t\t\trescue \t\n\t\t\t\tputs \"Exception caught and ignored\"\n\t\t\t\tsleep 15\n\t\t\t\treturn\n\t\t\tend\n\t\t\tif (userTweet != nil) && (userTweet == true)\n\n\t\t\t\t# Catch the exception thrown by trying to get information\n\t\t\t\t# from the artist tweet page info. The most common exception\n\t\t\t\t# is the Timeout/execution expired.\n\t\t\t\tbegin\n\t\t\t\t\t@artist_name = Twitter.user(\"#{@artist_name}\").name\n\t\t\t\trescue\n\t\t\t\t\tputs \"Exception caught and ignored\"\n\t\t\t\t\tsleep 15\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\tend\t\n\t\telse\n\t\t\t@user_location = tweet[/\\([\\s]*@([^\\)]+)\\)/i]\n\t\t\tif @user_location == nil\n\t\t\t\t@artist_name = the_artist_name[3..(the_artist_name.length - 9)]\n\t\t\telse\n\t\t\t\t@artist_name = tweet[/by[\\w\\W]+[(@]/i]\n\t\t\t\tif @artist_name != nil\t\n\t\t\t\t\t@artist_name = @artist_name[3..(@artist_name.length - 3)]\n\t\t\t\tend\n\t\t\tend\n\t\tend\t\n\t\tthe_name = @artist_name[/[\\w\\W]+[|]/i]\n\t\tif the_name != nil\n\t\t\t@artist_name = the_name[0..(the_name.length - 2)]\n\t\tend\n\t\tputs \"Artist name: #{@artist_name}\"\n\n\t\t@song_name = tweet[/\\\"[\\s\\S\\d\\D\\w\\W]+\\\"/i]\n\t\tif @song_name != nil\n\t\t\tthe_song = @song_name[/[\\w\\W\\d\\D\\s\\S\"] +\"[\\w\\W\\d\\D\\s\\S]+\\w/i]\n\t\t\tif the_song != nil\n\t\t\t\t@song_name = the_song[3..(the_song.length)]\n\t\t\telse\n\t\t\t\t@song_name = @song_name[1..(@song_name.length - 2)]\n\t\t\tend\n\t\t\tputs \"Song name: #{@song_name}\"\n\t\tend\n\tend\nend", "def get_twitter_friend_names(username)\n client = get_twitter_client\n\n # Fetch friend IDS\n friend_ids = handle_rate_limit do\n client.friend_ids(username).to_a\n end\n\n # Fetch friend data\n friends = handle_rate_limit do\n client.users(friend_ids).to_a\n end\n\n # Extract the friend names\n friendnames = []\n friends.each do |f|\n friendnames << f.screen_name\n end\n return friendnames\n end", "def find_friends\n puts 'Enter the other user\\'s twitter handle'\n @other_user = gets\n @friends = Twitter.friend_ids(@other_user).ids\nend", "def nodes(tweets)\n tweets.inject({}) do |nodes, tweet|\n node = nodes[tweet.user_name]\n nodes[tweet.user_name] = User.new(tweet.user_name) unless node\n nodes\n end\n end", "def get_twitter(npo)\n\t\trequire 'net/http'\n\t\trequire 'rexml/document'\n\n begin\n\n res = Net::HTTP.get(URI.parse(\"http://api.twitter.com/1/users/show.xml?screen_name=#{npo.twitter}\"))\n document = REXML::Document.new(res)\n\n if document.root.elements[2]\n document.root.elements[2].expanded_name == 'error' ? nil : npo.twitter\n end\n rescue\n nil\n end\n\tend", "def recommend_users(bilateral = false)\n if auth = auths.select { |a| a.provider == 'weibo' }.first\n auth.friends_on_site(bilateral).desc(:followers_count)\n end\n end", "def calling_user_and_twitter_only(name,twitter)\n\n\[email protected] {|name,_,_,twitter|} #...whatever\n\n\tend", "def tweet_user(tweet) \n if ! tweet.is_a?(String)\n base = tweet.has_key?(:from_user) ? tweet[:from_user] : tweet[:user][:screen_name]\n else\n base = tweet\n end\n base =~ /^@/ ? base : \"@#{base}\"\n end", "def get_user_from_twitter_as_hash(screen_name_or_twitter_id)\n Rails.cache.fetch(\"/users/show/#{screen_name_or_twitter_id}\", :expires_in => 2.hours) { twitter.get(\"/users/show/#{screen_name_or_twitter_id}\") }\n end", "def get_nickname(user_info)\n return user_info[\"screen_name\"]\n end", "def tweet_users\n if authors.size > 1\n \"#{submitting_author.nice_name} et al.\"\n else\n submitting_author.nice_name\n end\n end", "def find_followers\n puts 'Enter the other user\\'s twitter handle'\n @other_user = gets\n @followers = Twitter.follower_ids(@other_user).ids\nend", "def getTweet(tweet,rt)\n\tflds=[]\n\n\trt_original_tweetID=nil\n\tif tweet[\"retweeted_status\"]\n\t\trt_original_tweetID=tweet[\"retweeted_status\"][\"id\"]\n\tend\n\n\ttweetID=tweet[\"id\"]\n\tflds << tweetID\n\tflds << tweet[\"user\"][\"id\"]\n\tif tweet[\"created_at\"]\n\t\tflds << tweet[\"created_at\"]\n\t\tdt=DateTime.parse(tweet[\"created_at\"])\n\t\tflds << dt.strftime(\"%Y%m%d\")\n\t\tflds << dt.strftime(\"%H%M%S\")\n\telse\n\t\tflds << nil\n\t\tflds << nil\n\t\tflds << nil\n\tend\n\tflds << rt\n\tflds << rt_original_tweetID\n\tif $orgText\n\t\tflds << tweet[\"text\"]\n\telse\n\t\tif tweet[\"text\"]\n\t\t\tflds << tweet[\"text\"].gsub(\"\\r\",\"\").gsub(\"\\n\",\"\")\n\t\telse\n\t\t\tflds << nil\n\t\tend\n\tend\n\tif tweet[\"source\"]\n\t\tflds << tweet[\"source\"].gsub(/<a.*?>/,\"\").gsub(/<\\/a.*?>/,\"\")\n\telse\n\t\tflds << nil\n\tend\n\tflds << tweet[\"truncated\"]\n\tflds << tweet[\"in_reply_to_status_id\"]\n\tflds << tweet[\"in_reply_to_user_id\"]\n\tflds << tweet[\"in_reply_to_screen_name\"]\n\tdat=tweet[\"coordinates\"]\n\tif dat\n\t\tflds << dat[0]\n\t\tflds << dat[1]\n\telse\n\t\tflds << nil\n\t\tflds << nil\n\tend\n\tflds << tweet[\"contributors\"]\n\n\t#dat=tweet[\"current_user_retweet\"]\n\t#if dat\n\t#\tflds << dat[\"id\"]\n\t#else\n\t#\tflds << nil\n\t#end\n\n\tflds << tweet[\"avorite_count\"]\n\tflds << tweet[\"favorited\"]\n\tflds << tweet[\"filter_level\"]\n\tflds << tweet[\"lang\"]\n#place\tPlaces\n\tflds << tweet[\"possibly_sensitive\"]\n#scopes\tObject\n\tflds << tweet[\"retweet_count\"]\n\tflds << tweet[\"retweeted\"]\n#\tflds << tweet[\"withheld_copyright\"]\n#withheld_in_countries\tArray of String\n#\tflds << tweet[\"withheld_scope\"]\n\n\n\treturn tweetID,flds\nend", "def get_detail_info(fids)\n uri = \"https://api.twitter.com/1/users/lookup.json\"\n req = Typhoeus::Request.new(uri,\n :method =>\"post\",\n :params =>{:user_id=>fids, :include_entities=>\"true\"})\n \n sign_request(req,uri)\n hydra = Typhoeus::Hydra.new\n hydra.queue(req)\n hydra.run\n JSON.parse(req.response.body)\n \n end", "def score(username)\n user = get(\"/v2/identity.json/twitter\", :screenName => username)\n puts user.inspect\n get(\"/v2/user.json/#{user[\"id\"]}/score\")\n end", "def get_user(username, users)\n puts \"Searching for user '#{username}'\"\n users.each do |user|\n return user if user[:username] == username\n end\n puts \"User #{username} not found!\"\n return nil\n end", "def print_timeline(tweets)\n \n puts tweets [0][\"user\"][\"screen_name\"]\n puts tweets [0][\"text\"]\n\n \n\nend", "def get_tweets(screen_name, num_tweets)\n\t\n\tresult = \"\"\n #Query num_tweets tweets from screen_name and create the HTML\n Twitter.user_timeline(screen_name, {\"count\" => num_tweets}).each do |tweet|\n \tlinkified = linkifyTweet(tweet.text)\n \tresult = result + \"<li class=\\\"tweet\\\">\n <span class=\\\"gentle\\\">#{linkified}</span>\n </li>\"\n end\n return result\nend", "def twitter_user_id\n raw['id']\n end", "def get_tweets(list)\n if list.authorized?(@user)\n list.tweets\n else\n [] # \"magic\" return value\n end\nend", "def parse_user search\n Hash[*search.split(',').map{|pair| pair.split('=').values_at(0..1)}.flatten]['uid']\n end", "def top_10_followers\n users_array = UserLeague.all.collect{|user| user.user_id}\n most_common_value = users_array.uniq.sort_by{ |i| users_array.count( i ) }.reverse\n biggest_followers = most_common_value.map {|user| User.find(user).name}[0..9]\n users_league_count = most_common_value.map {|user| User.find(user).leagues.count}[0..9]\n counter = 0\n return_hash = {}\n until counter == biggest_followers.length do\n return_hash[biggest_followers[counter].to_s] = users_league_count[counter].to_s\n counter += 1\n end\n return_hash\nend", "def get_user_info user\n unless user.known_user.nil?\n known_user = user.known_user\n is_me = known_user.is_current_user || false\n return is_me ? \"people/me\" : known_user.person_name\n end\n get_one_of user\nend", "def get_user_tweets\n @tweets = COLL.find(\n selector = {\"user.id\" => @user[:id]},\n opts={ :sort=>[\"created_at\", Mongo::ASCENDING],\n :fields=>[\"coordinates\",\"user\",\"text\",\"created_at\", \"entities\", \"place\"]\n })\n\n @user[:tweet_count] = @tweets.count\n @tweets.count > 1\n end", "def liked_tweets\n Like.all.select { |l| l.user == self }.map { |l| l.tweet }\n end", "def user_data_from_results(res, username, key)\n users = res['users']\n users.each do |user|\n return user[key] if user['name'] == username\n end\n nil\n end", "def favorite_user_tweets\n puts \"Are you sure you want to favorite the most recent tweet of ALL of the unique users of #{@other_user.strip}? Y/N\"\n @decision = gets\n\n case @decision.strip\n when \"Y\"\n @unique_user_ids.each do |followerId|\n begin\n @favorite_user = Twitter.user(followerId)\n if @favorite_user.status.nil?\n puts \"Blank status for #{@favorite_user.screen_name}\"\n next\n else\n Twitter.favorite(@favorite_user.status.id)\n end\n rescue Twitter::Error::TooManyRequests => error\n puts \"Oops, we are rate limited. We will try again at: #{Time.now + error.rate_limit.reset_in + 5}\"\n sleep error.rate_limit.reset_in + 5\n retry\n rescue Twitter::Error::ServiceUnavailable => error\n sleep(10)\n retry\n rescue Twitter::Error::Forbidden => error\n puts \"You already favorited tweet from #{@favorite_user.screen_name}\"\n next\n rescue Twitter::Error::NotFound => error\n puts \"Sorry something went wrong. #{error}\"\n next\n else\n puts \">>> Favorited last tweet of #{@favorite_user.screen_name}.\"\n end\n sleep(1)\n end\n when \"N\"\n puts \"Ok, well that was a waste of time.\"\n else\n puts \"Something went wrong here. Start over.\"\n end\n\nend", "def get_mentions(tweet)\n list = []\n tweet.user_mentions.each { |mention| list << mention.screen_name.downcase } if tweet.user_mentions?\n list\n end", "def find_twitter_handle\n self.match(/(\\@\\w+)/i)\n return $1\n end", "def ego_net_retweets\n retweets = []\n self.retweet_ids.each do |retweet| \n begin\n if Person.find_by_username(retweet[:person]).friends_ids.include?(self.person.twitter_id) \n retweets << retweet\n end\n rescue\n end \n end\n return retweets\n end", "def user_tweets screen_name\n\t\tTwitter.user_timeline(screen_name.to_s)\n\tend", "def users\n result_hash['usr']\n end", "def calculate_favorite_tweeter\n # Count each fav as 1 point\n scores = Hash[most_faved]\n scores.default = 0\n\n # Count each RT as 1.5 points\n most_retweeted.each { |screen_name, rts| scores[screen_name] += (rts * 1.5) }\n\n winning_screen_name, winning_score = scores.max_by { |_, score| score }\n\n {\n :screen_name => winning_screen_name,\n :favs_count => Hash[most_faved][winning_screen_name],\n :retweets_count => Hash[most_retweeted][winning_screen_name],\n :score => winning_score\n }\n end", "def default_tweets\n tweets = [\n { name: \"@xero\", body: sanitize(\"Coffee + Code = Beautiful Accounting #xero #coffee\"), avatar: \"https://pbs.twimg.com/profile_images/490207413933309952/_LiT6IcT_bigger.png\" },\n { name: \"@patnz\", body: sanitize(\"RT @Xero - Coffee + Code = Beautiful Accounting #xero #coffee\"), avatar: \"https://pbs.twimg.com/profile_images/124955173/avatar_bigger.jpg\" }\n ]\nend", "def get_users input\n\t\t@users[input]\n\tend", "def get_user_data(users, username)\n user_array = []\n users.each do |user|\n if user['username'] == username\n user_array << user['name']\n user_array << user['username']\n user_array << user['password']\n user_array << user['admin']\n end\n end\n return user_array\nend", "def get_favourite_tv_show(person)\n return person[:favourites][:tv_show]\nend", "def checkTwitterID(name)\n\t#url = \"https://twitter.com/search?q=Taylor%20Swift&src=typd\"\n\taccount=\"None\"\n\tc_name=name.gsub(\" \",\"%20\")\n name = name.downcase\n\turl = \"https://twitter.com/search?q=\"+c_name+\"&src=typd\"\n\tencoded_url = URI.encode(url)\n\turi=URI(encoded_url)\n\tresponse = Net::HTTP.get(uri)\n\n\tpeoplepage = Nokogiri::HTML(response)\n\taccounts = peoplepage.css(\"span.account-group-inner\")\n\tif !accounts.nil? \n\t\t(0..accounts.length-1).each do |n|\n\t\t\tverify = accounts[n].css(\"span.icon\")\n\t\t\t#1. check if the account is verified\n\t\t\t#2. check if user name is full name is the same as celebrity's name\n\t\t\tif !verify.nil? and verify.text == \"Verified account\" and accounts[n].css(\"strong\").text.downcase == name\n\t\t\t\tid = accounts[n].css(\"small\").text\n\t\t\t\taccount=\"https://twitter.com/\"+id[1..id.length]\n\t\t\tend\n\t\tend\n\tend\n\treturn account\nend", "def get_politician_tweet(client, twitter_handle)\n client.user_timeline(twitter_handle).sample.text\nend", "def get_best_users(n,factor = 1)\n\t return recommand(:get_best_users,:get_best_tags,n,factor){\n\t\t self.friends.collect{|f|\t\t\n\t\t\t# See comments about frienships relations to more information about f structure\n\t\t\t [f[:friend],f[:friend].screen_name,f[:weight]*factor]\n\t\t }\n\t\t}\t\n\tend", "def user_info\n {\n 'uid' => user_hash['feed']['author'][0]['email']['$t'],\n 'nickname' => user_hash['feed']['author'][0]['name']['$t']\n }\n end", "def winner_usernames\n return winners.map {|p| p.username}\n end", "def get_tweets_from_redis\n\tbegin \n\t\tredis = Redis.new(:host => \"barreleye.redistogo.com\", :port => 9283, :password => \"c67e5bd9e2ce6eda9348ddc07d1859bf\")\n\trescue\n\t\tputs \"Couldnt connect to redis\"\n\tend\n\tall_keys = redis.keys \"*\"\n\t[\"earthquake\",\"harvest1\",\"harvest-packers-falcons\",\"lavsmohan\",\"shishirmk\",\"krishashok\",\"SaketSrivastav\",\"bobsaget\",\"SrBachchan\",\"irteen\",\"warunsl\",\"dens\",\"gartenberg\",\"bhogleharsha\"].each do |uname|\n\t\tall_keys.delete(uname+\"_tweets\")\n\tend\n\n\t#Creating an array of tweet objects\n\ttweets = Array.new\n\tfor key in all_keys\n\t\tkey = \"CNNLive_tweets\"\n\t\tnext if !all_keys.index(\"chosen_\"+key)\n\t\tchosen_key = \"chosen_\"+key\n\t\tlen = redis.llen chosen_key\n\t\tchosen_list = redis.lrange chosen_key,0, len-1\n\n\t\tlen = redis.llen key\n\t\ttweet_list = redis.lrange key,0, len-1\n\t\tputs \"#{key} => #{tweet_list.length}\"\n\t\ttweet_list.each do |t|\n\t\t\ttemp = Tweet.new\n\t \ttemp.username = JSON.parse(t)['user']['screen_name']\n\t \ttemp.language = JSON.parse(t)['user']['lang']\n\t \ttemp.original_tweet = JSON.parse(t)['text']\n\t \ttemp.time = JSON.parse(t)['created_at']\n\t \ttemp.retweet = true if JSON.parse(t)['retweet_count'] != 0\n\t \ttemp.reply = true if JSON.parse(t)['in_reply_to_status_id'] != \"null\"\n\t \ttemp.chosen = true if chosen_list[0].index(temp.original_tweet)\n\t \ttweets << temp\n\t end\n\t break #To do run the code on just one user first\n\tend\nend", "def user_info\n {\n 'uid' => user_hash['feed']['author'][0]['email']['$t'],\n 'nickname' => user_hash['feed']['author'][0]['name']['$t'],\n }\n end", "def get_friends_list\n # Append user string \n data_string = twitter\n\n # Append friend strings\n Invite.find( :all, :conditions => { :host_user => id } ).each do |invite|\n \n if( invite.accepted && invite.active )\n #friend = invite.users[0]\n friend = User.find( invite.target_user )\n data_string = data_string + \"|\" + friend.twitter\n end\n \n end \n \n return data_string\nend", "def my_followers_motto\n my_followers.collect {|bloodoath| bloodoath.follower.life_motto}\n end", "def closest_neighbours(person, number_of_users)\n\n\tfile = File.read('./json/user_data.json')\n\tdata_hash = JSON.parse(file)\n\n\tscores = Array.new\n\tperson_collection = Array.new\n\n\t# Returns the number of similar uses to a specific person\n\tdata_hash.each do |key,value|\n\t\tif key != person\n\t\t\tperson_collection.push(key)\n\t\t\tscores.push(pearson_correlation(person, key))\n\t\tend\n\tend\n\n\tfinal_score = scores.zip(person_collection)\n\n\t# Sort the highest similar person to lowest\n\tfinal_score.sort!{|x,y| y <=> x}\n\tfinal_score[0 .. number_of_users - 1]\nend", "def extract_names(profile)\n full_name_kanji = profile[:full_name_kanji] || ''\n last_name_kanji = profile[:last_name_kanji] || ''\n first_name_kanji = profile[:first_name_kanji] || ''\n\n full_name_kana = profile[:full_name_kana] || ''\n last_name_kana = profile[:last_name_kana] || ''\n first_name_kana = profile[:first_name_kana] || ''\n\n full_name = profile[:full_name] || ''\n last_name = profile[:last_name] || ''\n first_name = profile[:first_name] || ''\n user_name = profile[:user_name] || ''\n\n # NOTE: \"\".present? #=> false\n\n # *: set\n # -: not set\n # : no care\n # full(K) | last(K) | first(K) | full | last | first | user |\n # #1 ******* | ******* | ******** | | | | |\n # #1 ******* | ******* | -------- | | | | |\n # #1 ******* | ------- | ******** | | | | |\n # #1' | | | **** | **** | ***** | |\n # #1' | | | **** | **** | ----- | |\n # #1' | | | **** | ---- | ***** | |\n # #2 ------- | ******* | ******** | | | | |\n # #2 ------- | ******* | -------- | | | | |\n # #2 ------- | ------- | ******** | | | | |\n # #2' | | | ---- | **** | ***** | |\n # #2' | | | ---- | **** | ----- | |\n # #2' | | | ---- | ---- | ***** | |\n # #3 ******* | ------- | -------- | | | | |\n # #3' | | | **** | ---- | ----- | |\n # #4 ------- | ------- | -------- | ---- | ---- | ----- | **** |\n # #5 ------- | ------- | -------- | ---- | ---- | ----- | ---- |\n\n # #1\n if full_name_kanji.present? && (last_name_kanji.present? || first_name_kanji.present?)\n names = [ full_name_kanji, first_name_kanji, last_name_kanji ]\n # #1'\n elsif full_name.present? && (last_name.present? || first_name.present?)\n names = [ full_name, first_name, last_name ]\n # #2\n elsif last_name_kanji.present? || first_name_kanji.present?\n names = [ [last_name_kanji, first_name_kanji].join(' ').strip, first_name_kanji, last_name_kanji ]\n # #2'\n elsif last_name.present? || first_name.present?\n names = [ [last_name, first_name].join(' ').strip, first_name, last_name ]\n # #3\n elsif full_name_kanji.present?\n names = [ full_name_kanji, '', full_name_kanji ]\n # #3'\n elsif full_name.present?\n names = [ full_name, '', full_name ]\n # #4\n elsif user_name.present?\n names = [ user_name, '', '' ]\n # #5\n else\n names = [ '', '', '' ]\n end\n\n if full_name_kana.present? && (last_name_kana.present? || first_name_kana.present?)\n kana = [ full_name_kana, first_name_kana, last_name_kana ]\n elsif last_name_kana.present? || first_name_kana.present?\n kana = [ [last_name_kana, first_name_kana].join(' ').strip, first_name_kana, last_name_kana ]\n elsif full_name_kana.present?\n kana = [ full_name_kana, '', full_name_kana ]\n else\n kana = [ '', '', '' ]\n end\n\n names + kana\n end", "def repr_tweet(tweet)\n data = {\n :id => tweet.id,\n :created_at => tweet.created_at,\n :text => tweet.text,\n :user => {\n :id => tweet.user.id,\n :name => tweet.user.name,\n :screen_name => tweet.user.screen_name,\n :utc_offset => tweet.user.utc_offset,\n :created_at => tweet.user.created_at,\n :followers_count => tweet.user.followers_count,\n :friends_count => tweet.user.friends_count\n }\n }\n data[:coordinates] = {\n :coordinates => tweet.geo.coordinates\n } if not tweet.geo.nil?\n data[:place] = {\n :id => tweet.place.id,\n :country_code => tweet.place.country_code\n } if not tweet.place.nil?\n data[:place][:bounding_box] = {\n :coordinates => tweet.place.bounding_box.coordinates\n } if not tweet.place.nil? and not tweet.place.bounding_box.nil?\n data[:retweeted_status] = {\n :id => tweet.retweeted_status.id,\n :created_at => tweet.retweeted_status.created_at,\n :text => tweet.retweeted_status.text,\n :user => {\n :id => tweet.retweeted_status.user.id\n }\n } if not tweet.retweeted_status.nil?\n data[:mentions] = tweet.user_mentions.map do |el|\n {\n :screen_name => el.screen_name,\n :id => el.id\n }\n end if not tweet.user_mentions.nil?\n data[:hashtags] = tweet.hashtags.map {|el| el.text} if not tweet.hashtags.nil?\n return data\nend", "def get_tweets(list)\n if list.authorized?(@user)\n list.tweets\n else\n []\n end\nend", "def index\n number_tweets = if params[\"count\"] then params[\"count\"].to_i else 10 end\n tweet_ids = []\n if @user.interests\n for i in 1..number_tweets\n interest = @user.interests.sample\n tweet = Rails.application.config.twitter_client.search(\"#{interest[:hashtag]}\", count: 1).take(1)\n tweet_ids.push(tweet.first.id.to_s)\n end\n end\n\n render json: tweet_ids, status: :ok\n end", "def sorted_top_users\n add_github_user('redline6561')\n followers = github.get_followers('redline6561',1,100)\n followers.map { |x| x['login'] }.sample(20).each do |username|\n add_github_user(username)\n end\n\n Cheepcreep::GithubUser.order(:followers => :desc).each do |u|\n puts \"User: #{u.login}, Name: #{u.name}, Followers: #{u.followers}\"\n end\nend", "def likers\n likes.map do |like|\n like.user\n end\n end", "def top_artists(spot_user)\n @top_artists_hash = {}\n spot_user.top_artists[0..19].each do |fav|\n @top_artists_hash[fav.name] = {}\n\n @user_artist_related[fav.name].each do |fav_rel_art|\n @top_artists_hash[fav.name][fav_rel_art] = {}\n \n @rel_artist_rec[fav_rel_art].each do |user_also_rec|\n if fav.name != user_also_rec\n @top_artists_hash[fav.name][fav_rel_art][user_also_rec] = \"1\"\n end\n end\n if @top_artists_hash[fav.name][fav_rel_art] == {}\n @top_artists_hash[fav.name][fav_rel_art][\"none\"] = \"0\" \n end\n end\n end\n @top = @top_artists_hash.to_json\n\n end", "def grab_info(name)\n\n\n\n\n result = HTTParty.get(\"https://graph.facebook.com/#{name}\")\n\n user_fb = JSON.parse(result)\n\n# id = result[\"id\"]\n# name = result[\"name\"]\n# gender = result[\"gender\"]\n# locale = result[\"locale\"]\n# un = result[\"username\"]\n\nend", "def user_names_who_retweeted(status)\n\t\treturn nil unless status.retweet_count.positive?\n\t\turl = \"https://twitter.com/i/activity/retweeted_popup?id=#{status.id}\"\n\t\toriginal_tweeter = status&.retweeted_status&.user&.screen_name\n\t\tnames_to_reject = [original_tweeter, @config[\"Username\"]].freeze\n\t\tnames = HTTP.get(url).body.to_s.scan(/data-screen-name=\\\\\"(.*?)\\\\\"/).flatten.uniq.compact - names_to_reject\n\t\treturn nil if names.none?\n\t\t\"Retweeted: #{names.map { |s| \"@#{s}\" }.join(', ')}\"\n\tend", "def find_user (map)\n user = []\n for i in 0..map.length-1\n for j in 0..map.length-1\n if map[i][j] == \" U \"\n user = [i,j]\n end\n end\n end\n user\n end", "def get_twitter_keys_for_eid (eid)\n twitter = {}\n\n results = Source.tire.search(:per_page => 10000) do\n filter :term, :apk_eid => eid\n filter :terms, :lines => ['twitter','consumer','key','secret','access','token','oauth']\n filter :not, { :term => { :lib => 'twitter4j' } }\n fields :apk_eid, :path, :lines\n end\n\n results.each do |source|\n source[:lines].each do |line|\n if line =~ /(twitter|consumer|key|secret|access|token|oath).*\\\"[0-9a-zA-Z]{15,50}\\\"/i\n #twitter[source[:apk_eid]] ||= {}\n #twitter[source[:apk_eid]][source[:path]] ||= []\n #twitter[source[:apk_eid]][source[:path]] << line\n line = line.gsub(/ /,\"\")\n\n # look for ConfigurationBuilder calls\n if line =~ /setOAuthConsumer\\((.*?),(.*?)\\)/\n consumer_key = $1\n consumer_secret = $2\n\n twitter[:consumer_key] = $1 if consumer_key =~ /^\\\"(.*)\\\"$/\n twitter[:consumer_secret] = $1 if consumer_secret =~ /^\\\"(.*)\\\"$/\n end\n if line =~ /setOAuthConsumerKey\\(\\\"(.*?)\\\"\\)/\n twitter[:consumer_key] = $1\n end\n if line =~ /setOAuthConsumerSecret\\(\\\"(.*?)\\\"\\)/\n twitter[:consumer_secret] = $1\n end\n if line =~ /setOAuthAccessToken\\(\\\"(.*?)\\\"\\)/\n twitter[:access_token] = $1\n end\n if line =~ /setOAuthAccessTokenSecret\\(\\\"(.*?)\\\"\\)/\n twitter[:access_token_secret] = $1\n end\n\n # look for assignment of promising sounding variables\n if line =~ /consumer.*?secret=\\\"([0-9a-zA-Z]{35,})\\\"/i\n twitter[:consumer_secret] = $1 unless twitter[:consumer_secret]\n end\n if line =~ /consumer.*?key=\\\"([0-9a-zA-Z]{18,25})\\\"/i\n twitter[:consumer_key] = $1 unless twitter[:consumer_key]\n end\n\n # weak ... look for function calls that might have the tokens\n if line =~ /\\\"([0-9a-zA-Z]{18,25})\\\",\\\"([0-9a-zA-Z]{35,})\\\"/\n twitter[:consumer_key] = $1 unless twitter[:consumer_key]\n twitter[:consumer_secret] = $2 unless twitter[:consumer_secret]\n end\n end\n end\n end\n\n twitter\nend", "def get_user(name, user_list = users)\n return name if name.instance_of?(GoodData::Membership)\n name.downcase!\n user_list.each do |user|\n return user if user.uri.downcase == name ||\n user.login.downcase == name ||\n user.email.downcase == name\n end\n nil\n end", "def twitter_data(time=Time.now)\n h = {}\n h['1'] = Hashie::Mash.new :id => '1', :in_reply_to_status_id => nil, :user => { :screen_name => 'aaa', :id => '1'}, :text => 'Initial tweet', :created_at => time\n h['2'] = Hashie::Mash.new :id => '2', :in_reply_to_status_id => '1', :user => { :screen_name => 'bbb', :id => '2'}, :text => '@aaa i disagree', :created_at => time += 60\n h['3'] = Hashie::Mash.new :id => '3', :in_reply_to_status_id => '1', :user => { :screen_name => 'ccc', :id => '3'}, :text => '@aaa i agree', :created_at => time += 60\n h['4'] = Hashie::Mash.new :id => '4', :in_reply_to_status_id => '3', :user => { :screen_name => 'ddd', :id => '4'}, :text => '@ccc how can you agree?', :created_at => time += 60\n h['5'] = Hashie::Mash.new :id => '5', :in_reply_to_status_id => '1', :user => { :screen_name => 'eee', :id => '5'}, :text => '@aaa who r u', :created_at => time += 60\n h['6'] = Hashie::Mash.new :id => '6', :in_reply_to_status_id => '4', :user => { :screen_name => 'aaa', :id => '1'}, :text => '@ddd because i can', :created_at => time += 60\n h['7'] = Hashie::Mash.new :id => '7', :in_reply_to_status_id => '5', :user => { :screen_name => 'aaa', :id => '1'}, :text => '@eee i am who i am', :created_at => time += 60\n h['8'] = Hashie::Mash.new :id => '8', :in_reply_to_status_id => '7', :user => { :screen_name => 'eee', :id => '5'}, :text => '@aaa nice one popeye', :created_at => time += 60\n h['9'] = Hashie::Mash.new :id => '9', :in_reply_to_status_id => '6', :user => { :screen_name => 'ddd', :id => '4'}, :text => '@eee you have that right', :created_at => time += 60\n h['10'] = Hashie::Mash.new :id => '10', :in_reply_to_status_id => '9', :user => { :screen_name => 'fff', :id => '6'}, :text => '@ddd wtf is all this?', :created_at => time += 60\n h\n end", "def parse_users_mentions users, date_tweet\n\t\tusers_mentions = []\n\t\tusers.each do |item|\n\t\t\tu = User.find_or_create_by_user_id item[\"id\"]\n\t\t\tu.name = item[\"name\"]\n\n\t\t\tu.save\n\n\t\t\tusers_mentions << u\n\t\tend\n\t\t\tm = Momentum.new\n\t\t\tm.calculate_influences users_mentions, date_tweet\n\tend", "def twitter_stats\n # would be nice to use the twitter gem here, but twitter\n # doesn't expose list counts on user info.\n doc = Nokogiri::HTML(open(\"http://twitter.com/#@twitter\"))\n followers = doc.css(\"#follower_count\").first.content.to_i\n lists = doc.css(\"#lists_count\").first.content.to_i\n \"followers: #{followers}; lists #{lists}\"\n end", "def favorite_tweets\n logger.debug { \"#{__method__} is called twitter_user_id=#{id}\" }\n tweets = []\n tweets = InMemory::FavoriteTweet.find_by(uid) if InMemory.enabled? && InMemory.cache_alive?(created_at)\n tweets = Efs::FavoriteTweet.where(uid: uid) if tweets.blank? && Efs::Tweet.cache_alive?(created_at)\n tweets = ::S3::FavoriteTweet.where(uid: uid) if tweets.blank?\n tweets.map { |tweet| ::TwitterDB::Favorite.new(uid: uid, screen_name: screen_name, raw_attrs_text: tweet.raw_attrs_text) }\n end", "def fav_tv_show(person)\n return person[:favourites][:tv_show]\nend", "def twitter_profile\n @network = current_user.network ||= Network.new\n (@network.twitter.nil?) ? \"\" : @network.twitter\n end", "def get_user_data(email)\n user_id = $db.execute(\"SELECT user_id FROM users WHERE email = ?\", email)[0][\"user_id\"]\n username = $db.execute(\"SELECT username FROM users WHERE email = ?\", email)[0][\"username\"]\n rank = $db.execute(\"SELECT rank FROM users WHERE email = ?\", email)[0][\"rank\"].to_i\n\n return {user_id: user_id, username: username, rank: rank}\nend", "def followers_usernames\n url = [PUBLIC_BASE_URL, 'user/show', self.login, 'followers'].join('/')\n JSON.parse(open(url).read)['users']\n end", "def user_tweets(user_id)\n twitter.user_timeline(user_id)\n end", "def most_similar(u)\n sim_list=Array.new\n #for each user in the data we calculate the similarity of it with the user \"u\"\n #and create a list of similarity\n @users.each_key do |user|\n if user!=u\n sim_list.push([user,similarity(u,user)])\n end\n end\n #sorts the similarity list in decreasing order and returns the top 100\n sim_list.sort_by!{|itm| -itm[1]}\n return sim_list\n end", "def get_micropostid_to_mentionusers(microposts)\n micropostid_to_mentionusers = {}\n mentions = Mention.includes(:mention_user).where(micropost_id: microposts)\n micropostids_to_mentions = mentions.group_by(&:micropost_id).each do |micropost_id, mention_list|\n micropostid_to_mentionusers[micropost_id] = mention_list.map(&:mention_user)\n end\n return micropostid_to_mentionusers\n end", "def user\n if is_partial?\n TwitterUserPartial.from_hash raw_user\n else\n TwitterUser.from_hash raw_user\n end\n end", "def profile(usernames)\n get(\"/1/users/show.json\", :users => [usernames].flatten).users\n end", "def lookup_user (user_id)\n tweets = IBM_DB.exec(@conn, \"SELECT * from tweets t WHERE user_id = #{user_id}\")\n #TODO: Verify manually, cannot count results in DB2\n #debug 'user: ' + user_id.to_s + \" had \" + resp.count.to_s + \" tweets\"\n debug \"fetched tweets for user: \" + user_id.to_s\n end", "def get_friend_count\n response = twitter_user.request(:get, configatron.api_call_url + \"account/totals.json\")\n \n if response.is_a?(Net::HTTPSuccess)\n body = JSON.parse(response.body)\n body[\"friends\"]\n end\n end", "def user_ids_who_liked_status(id)\n\t\tHTTP.get(\"https://twitter.com/i/activity/favorited_popup?id=#{id}\").body.to_s.scan(/data-user-id=\\\\\"(\\d+)/).flatten.uniq\n\tend", "def user_info\n {\n 'nickname' => user_hash['Nickname'],\n 'first_name' => user_hash['FirstName'],\n 'last_name' => user_hash['LastName'],\n 'name' => [user_hash['FirstName'], user_hash['LastName']].reject{|n| n.nil? || n.empty?}.join(' '),\n }\n end", "def friends_and_followers(username_or_id)\n puts \"Getting Friends and Followers for %s...\" % username_or_id.to_s\n begin\n friend_ids = @MT.friend_ids(username_or_id).ids\n follower_ids = @MT.follower_ids(username_or_id).ids\n { :friends => friend_ids, :followers => follower_ids }\n rescue Twitter::Error::Unauthorized, Twitter::Error::Forbidden\n puts \"Failed for %s (Protected)\" % username_or_id.to_s\n { :friends => [], :followers => [] }\n end\n end", "def get_friend_id \n uri = \"https://api.twitter.com/1/friends/ids.json\" \n \n #http request for friend search start\n req = Typhoeus::Request.new(uri,\n :method =>\"get\",\n :params =>{:cursor=>\"-1\", :screen_name=>crt_user.handler}) \n #sign_request(req,uri)\n hydra = Typhoeus::Hydra.new\n hydra.queue(req)\n hydra.run\n JSON.parse(req.response.body)[\"ids\"]\n end", "def top_tagged(user_id)\n from_instagram = retrieve_last_10_photos(user_id)\n\n number_of_photos = from_instagram[\"data\"].size\n\n all_people_you_tag = []\n users_per_photo = []\n i = 0\n while i < number_of_photos\n x = 0\n people_per_photo = from_instagram[\"data\"][i][\"users_in_photo\"].size\n people_you_tag = from_instagram[\"data\"][i][\"users_in_photo\"]\n while x < people_per_photo\n username = from_instagram[\"data\"][i][\"users_in_photo\"][x][\"user\"][\"username\"]\n array = users_per_photo.push(username)\n x = x + 1\n end\n i = i + 1\n end\n\n if array\n\n b = Hash.new(0)\n array.each do |v|\n b[v] += 1\n end\n\n sorted_b = b.sort_by {|k, v| v}\n sorted_b = sorted_b.reverse\n\n sorted_b.map do |k, v|\n puts \"#{k}: #{v} tags\"\n end\n\n return sorted_b\n\n else \n return \"No users tagged\"\n end\n\n end", "def search(query)\n response = twitter_user.request(:get, configatron.api_call_url + \"users/search.json?q=#{URI.escape(query)}\")\n \n #\"#{configatron.api_call_url}users/search.json?q=#{URI.escape(query)}&page=#{page}&per_page=#{configatron.page_size}\"\n if response.is_a?(Net::HTTPSuccess)\n get_nicknames_and_names(JSON.parse(response.body))\n end\n end", "def display_twitter_presenters\n out = \"\"\n out = self.presenters.each do |p|\n out += (p.twitter_name.nil? ? p.display_name : p.twitter_name) + \", \"\n end\n out = out[0,out.length-2]\n end", "def find_user(username, discrim = nil)\n users = @users.values.find_all { |e| e.username == username }\n return users.find { |u| u.discrim == discrim } if discrim\n\n users\n end", "def top_10_fans\n users_array = UserTeam.all.collect{|user| user.user_id}\n most_common_value = users_array.uniq.sort_by{ |i| users_array.count( i ) }.reverse\n biggest_fans = most_common_value.map {|user| User.find(user).name}[0..9]\n users_teams_count = most_common_value.map {|user| User.find(user).teams.count}[0..9]\n counter = 0\n return_hash = {}\n until counter == biggest_fans.length do\n return_hash[biggest_fans[counter].to_s] = users_teams_count[counter].to_s\n counter += 1\n end\n return_hash\nend", "def checkURL(twitter_user)\n\tchecker = twitter_user.to_s\n\tif checker.start_with?(\"http://\") or checker.start_with?(\"https://\") or checker.start_with?(\"twitter.\")\n\t\treturn checker[checker.rindex('/')+1..checker.length]\n\telse \n\t\treturn checker\n\tend\nend" ]
[ "0.6199478", "0.59936893", "0.5949688", "0.5946414", "0.5847193", "0.5830048", "0.58209336", "0.5804246", "0.5681631", "0.5629093", "0.56256247", "0.562277", "0.56133693", "0.5611967", "0.56002957", "0.55331665", "0.55157465", "0.5496238", "0.5491353", "0.5489689", "0.54857016", "0.5465731", "0.5461031", "0.54383534", "0.5399242", "0.5365435", "0.53478444", "0.5343756", "0.534334", "0.5333089", "0.53297365", "0.5327445", "0.5326064", "0.5320849", "0.53083086", "0.5306477", "0.5300434", "0.5300327", "0.52921325", "0.52818364", "0.5281585", "0.52694994", "0.5268359", "0.5266045", "0.52640027", "0.5258875", "0.5248496", "0.5240324", "0.5239488", "0.523907", "0.52383405", "0.5234286", "0.5231895", "0.52210724", "0.5212784", "0.52112734", "0.5198722", "0.51935405", "0.51934505", "0.5192144", "0.5175652", "0.51644856", "0.5160414", "0.51565397", "0.51526594", "0.51515025", "0.51499736", "0.5143509", "0.51355046", "0.51340926", "0.5133763", "0.5126048", "0.5117609", "0.5108664", "0.50950074", "0.5085209", "0.5078229", "0.50767916", "0.5076424", "0.5076271", "0.507439", "0.50694144", "0.50655", "0.50613284", "0.5055082", "0.5050265", "0.5048704", "0.504809", "0.5039766", "0.5028531", "0.5025361", "0.50251955", "0.50227374", "0.50155246", "0.50125027", "0.5010339", "0.50075495", "0.50073034", "0.50066435", "0.5002322", "0.49916038" ]
0.0
-1
GET /bergains/1 GET /bergains/1.json
def show @bergain = Bergain.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @bergain } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_brandings\n request :get, \"/v3/brandings.json\"\n end", "def index\n @brags = Brag.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brags }\n end\n end", "def show\n @baggage = Baggage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @baggage }\n end\n end", "def index\n @bergains = Post.find_by_sql(\n <<-SQL\n SELECT * FROM `posts`\n INNER JOIN users ON posts.user_id = users.id\n INNER JOIN orders ON orders.post_id = posts.id\n INNER JOIN bergains ON bergains.order_id = orders.id\n WHERE users.id = #{current_user.id}\n SQL\n )\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bergains }\n end\n end", "def getbatteries\n puts params\n buildid = params[\"buildingid\"]\n\n batteries = Battery.where(:building_id => buildid)\n\n puts batteries.inspect\n puts \"#################################################\"\n \n respond_to do |format|\n format.json { render json: batteries }\n end\n end", "def show\n @bb = Bb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bb }\n end\n end", "def index\n base_url = 'https://www.googleapis.com/books/v1/volumes?q=fiction&maxResults=20'\n and_key = '&key='\n key = ENV['GOOGLE_BOOKS_API_KEY'] \n googleurl = base_url + and_key + key\n\n response = RestClient.get(googleurl)\n @books = JSON.parse(response)\n\n respond_to do |format|\n format.html\n format.json { render json: @books }\n end\n\nend", "def init_brands\n response = @conn.get do |req|\n req.url \"/api/v1/brands\"\n req.headers = rest_headers\n end\n\n @brands = json(response.body)[:brands]\n end", "def show\n @beer = BreweryDB.beer(params[:id]) \n render json: @beer\n end", "def show\n @broad = Broad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @broad }\n end\n end", "def new\n @basin = Basin.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @basin }\n end\n end", "def index\n if params[:name].present?\n @json = Punk::API.beers_name!(params[:name])\n elsif params[:abv_gt].present?\n @json = Punk::API.beers_abv_gt!(params[:abv_gt])\n elsif params[:abv_lt].present?\n @json = Punk::API.beers_abv_lt!(params[:abv_lt])\n else\n @json = Punk::API.all_beers!(params)\n end\n\n render json: {\n beers: @json\n }\n create(@json)\n end", "def get_batterie_by_building\n @battery = Battery.where(building_id: params[:building_id])\n respond_to do |format| \n format.json { render :json => @battery }\n end\n \n end", "def show\n @blast = Blast.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @blast }\n end\n end", "def show\n @basin = Basin.find(params[:id])\n\n @client = YahooWeather::Client.new \n @response = @client.fetch_by_location('Massingir, Gaza, Mz','c')\n @reponse2 = @client.fetch_by_location('Louis Trichardt, Limpopo, South Africa','c')\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @basin }\n\n end\n end", "def index\n @biddings = Bidding.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @biddings }\n end\n end", "def index\n @buisnesses = Buisness.all\n\n render json: @buisnesses \n end", "def index\n @shop_section = ShopSection.find_by_short_url(\"brands\")\n @brands = Brand.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brands }\n end\n end", "def get_banks\n HTTParty.get(BASE_URI + 'bank?country=ghana',\n headers: HEADERS).parsed_response\n end", "def show\n @begivenhed = Begivenhed.find(params[:id])\n @bruger = Bruger.find_by_id(current_user.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @begivenhed }\n end\n end", "def banks_get(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: BanksApi#banks_get ...\"\n end\n \n # resource path\n path = \"/banks\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/x-www-form-urlencoded']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = ['khipu']\n result = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'BanksResponse')\n if Configuration.debugging\n Configuration.logger.debug \"API called: BanksApi#banks_get. Result: #{result.inspect}\"\n end\n return result\n end", "def show\n @bloom = Bloom.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bloom }\n end\n end", "def get_bike(bikeID, userID)\n user = User.find_by(id: userID)\n authorize_time_check(user)\n response = RestClient.get('https://www.strava.com/api/v3/gear/'+bikeID, {Authorization: 'Bearer ' + user.access_token})\n bike = JSON.parse(response)\n end", "def new\n @bergain = Bergain.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bergain }\n end\n end", "def new\n @bergain = Bergain.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bergain }\n end\n end", "def get_book(search)\n\trequest_string = \"https://www.googleapis.com/books/v1/volumes?q=#{search.gsub(\" \",\"+\")}\"\n\t\n\tsample_uri = URI(request_string) #opens a portal to the data at that link\n\tsample_response = Net::HTTP.get(sample_uri) #go grab the data in the portal\n\tsample_parsedResponse = JSON.parse(sample_response) #makes data easy to read\n\tsample_parsedResponse[\"items\"]\nend", "def show\n @borad = Borad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @borad }\n end\n end", "def all_booking_of_client\n\t\t@bookings = Booking.where(client_id: params[:client_id])\n\t\trender json: @bookings, status: 200\n\tend", "def index\n @brochures = Brochure.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brochures }\n end\n end", "def postal_beers\n render json: BreweryDb::ShowBeers.new('postal', params[:postal]).results\n end", "def show\n render json: @bike #serializer: Web::V1::BikeSerializer\n end", "def show_beer\n render json: BreweryDb::ShowBeer.new(params[:beerId]).results\n end", "def show\n render \"api/v1/bounties/show\"\n end", "def fetch_books(term)\n response = RestClient.get(\"https://www.googleapis.com/books/v1/volumes?q=#{term}\")\n\n JSON.parse(response.body)\nend", "def show\n @banda = Banda.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @banda }\n end\n end", "def show\n @bike = Bike.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bike }\n end\n end", "def new\n @baggage = Baggage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @baggage }\n end\n end", "def index\n @brave_bursts = BraveBurst.all\n end", "def show\n @crate = Crate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @crate }\n end\n end", "def index\n @client_releases = ClientRelease.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @client_releases }\n end\n end", "def show\n @bruschettum = Bruschettum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bruschettum }\n end\n end", "def index\n @bids = Bid.where(\"auction_id = ?\", params[:auction_id])\n\n render json: @bids\n end", "def show\n @betraege = Betraege.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @betraege }\n end\n end", "def show\n @band = Band.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @band }\n end\n end", "def index\n\t\tboats = Boat.all\n \trender json: boats, status: 200\n\tend", "def show\n @boat = Boat.find(params[:id])\n\n render json: @boat\n end", "def show\n render json: @bike_type\n end", "def show\n @brag = Brag.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @brag }\n end\n end", "def index\n @banks = Bank.all\n render json: @banks\n end", "def new\n @bokin = Bokin.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @bokin }\n end\n end", "def index\n url = \"https://data.cityofchicago.org/resource/x2n5-8w5q.json\"\n options = { :body => {:status => text}, :basic_auth => @auth }\n @response = HTTParty.get(url, options)\n\n @crime = Hash.new\n\n #@crime['block'] = @response[0]['block']\n @crime = @response\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gittos }\n end\n end", "def show\n @borrower = Borrower.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @borrower }\n end\n end", "def index\n @bagels = Bagel.all\n end", "def get\n return nil unless created?\n request :get_creative_on_bidstalk do\n client = Bidstalk::Creative::Client.new\n client.get_by_id platform_id\n end\n end", "def get_battery\n if params[:building].present?\n @batteries = Building.find(params[:building]).batteries\n else\n @batteries = Building.all\n end\n if request.xhr?\n respond_to do |format|\n format.json {\n render json: {batteries: @batteries}\n }\n end\n end\n end", "def get_beer\n beer_id = params['id'];\n response = HTTP.get('http://api.brewerydb.com/v2/beer/' + beer_id,\n :params=> {\n :key => ENV[\"BREWERYDB_BEERRATER_KEY\"],\n :withBreweries => \"y\"\n }\n )\n\n body = response.parse\n\n # check for success\n if body[\"status\"] == \"success\"\n data = body[\"data\"]\n unless data.nil?\n render json: {\n status: 200,\n message: \"#{params['id']} found\",\n data: data}\n else\n render json: {\n status: 200,\n message: \"#{params['id']} not found\",\n data: []\n }\n end\n else\n render json: { status: 401, message: body[\"errorMessage\"]}\n end\n end", "def show\n if @bird\n respond_to do |format|\n format.json { render json: {required: @bird, properties: @bird.properties, families: @bird.families, title: \"POST /birds [request]\", description: \"Get bird by id\",:status => OK }}\n end\n else\n respond_to do |format|\n format.json { render json: {:status => NOT_FOUND} }\n end\n end\n end", "def index\n @bounties = Bounty.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @bounties }\n end\n end", "def show\n @bp = Bp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bp }\n end\n end", "def index\n @banners = Banner.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @banners }\n end\n end", "def index\n @kbs = Kb.search(params[:q]).page(params[:page]).order(\"id desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @kbs }\n end\n end", "def battery_select\n p params[\"building_id\"]\n @batteries = Battery.where(building_id: params[\"building_id\"])\n respond_to do |format |\n format.json {\n render json: {\n batteries: @batteries\n }\n }\n end\n end", "def show\n @gopy = Gopy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gopy }\n end\n end", "def show\n @bundlesticker = Bundlesticker.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bundlesticker }\n end\n end", "def show\n render json: @bid\n end", "def show\n @bidding = Bidding.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bidding }\n end\n end", "def index\n @boks = Bok.all\n end", "def index # returns all bikes within a certain radius\n ## TODO: use coordinates later, when more campuses and bikes.\n # # defaults radius to half mile, and coordinate to requesting ip address\n # radius = params[:radius] ? params[:radius] : 0.5\n # coordinates = params[:coordinates] ? params[:coordinates] : request.location\n # puts coordinates\n # @bikes = Coordinate.near(coordinates, radius).joins(:bikes)\n @bikes = Bike.available\n render json: @bikes\n end", "def new\n @banda = Banda.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @banda }\n end\n end", "def bannerAll\n @links = Link.order(\"link asc\")\n respond_to do |format|\n format.html # bannerAll.html.erb\n format.json { render json: @link }\n end\n end", "def index\n @bemaps = Bemap.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bemaps }\n end\n end", "def get_branding(branding_id)\n request :get, \"/v3/brandings/#{branding_id}.json\"\n end", "def show\n @borrow_request = BorrowRequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @borrow_request }\n end\n end", "def show\n @beacon = Beacon.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @beacon }\n end\n end", "def show\n @bet = Bet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bet }\n end\n end", "def show\n @bid = Bid.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_bid }\n end\n end", "def show\n @bruger = Bruger.find_by_id(current_user.id)\n @onske = Onske.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @onske }\n end\n end", "def search_breed\n name = params[:name]\n render :json => Breed.find_breed_by_substr(name)\n end", "def show\n @baton = Baton.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @baton }\n end\n end", "def show\n @boat = Boat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json {render json: @boat}\n end\n end", "def index\n @cabines = Cabine.all\n render json: @cabines\n end", "def show\n @climb = Climb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @climb }\n end\n end", "def show\n @lbc = Lbc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lbc }\n end\n end", "def index\n @birds = Bird.all.to_a\n begin\n respond_to do |format|\n format.json { render json: {items: @birds, description: \"List all visible birds in the registry\", additionalProperties: false, title: \"POST /birds [request]\",:status => OK } }\n end\n rescue => e\n render json: ({:status => INTERNAL_SERVER_ERROR})\n end\n end", "def show\n @benthic_cover = BenthicCover.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @benthic_cover }\n end\n end", "def show\n @sugar_bag = SugarBag.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sugar_bag }\n end\n end", "def get_aos_version_box_by_name(args = {}) \n get(\"/aosversions.json/aosversionbox/name/#{args[:aosVersionBoxName]}\", args)\nend", "def show\n @bagtype = Bagtype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bagtype }\n end\n end", "def show\n @bowl = Bowl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @bowl }\n end\n end", "def show\n @blocking_client = BlockingClient.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @blocking_client }\n end\n end", "def show\n @bl = Bl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bl }\n end\n end", "def getMerchants\n\tbegin\n\t\tresponse = RestClient.get('http://api.reimaginebanking.com/merchants?key=e0486a76005721ee6d86b140eaea2a40')\n\trescue\n\t\tputs \"error retrieving response...\"\n\tend\n\n\tmerchants = JSON.parse(response)\n\treturn merchants\nend", "def show\n @kb = Kb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @kb }\n end\n end", "def allergies\n raise UserNotAuthenticated unless access_token\n\n get('records/allergies')\n end", "def show\n @bdatabase = Bdatabase.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bdatabase }\n end\n end", "def getbalance(args={})\n {\n :method=> \"GetBalances\"\n }.to_json\n end", "def index\n @cannings = Canning.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cannings }\n end\n end", "def index\n @bikestands = Bikestand.all\n end", "def index\n @breeds = Breed.all\n\n render json: @breeds\n end" ]
[ "0.72172624", "0.6625857", "0.6453416", "0.6446549", "0.6427885", "0.62696743", "0.6237457", "0.62229455", "0.6160867", "0.6137986", "0.6111228", "0.6093415", "0.60214454", "0.60139537", "0.6012164", "0.6005217", "0.59974134", "0.59900033", "0.59863573", "0.5977173", "0.5968694", "0.59500223", "0.59396297", "0.5939625", "0.5939625", "0.5939289", "0.59298223", "0.592818", "0.59274286", "0.59252167", "0.59194183", "0.58915174", "0.58877623", "0.5886952", "0.58836055", "0.5881226", "0.58730644", "0.5866124", "0.58651733", "0.5864201", "0.58624846", "0.58535963", "0.5850153", "0.5835289", "0.58316386", "0.5830225", "0.57963294", "0.5795938", "0.5794684", "0.5791834", "0.5787058", "0.57864374", "0.5773858", "0.5770461", "0.57697314", "0.5760697", "0.5760407", "0.5749894", "0.5747635", "0.57447594", "0.5740098", "0.573425", "0.57338774", "0.57298154", "0.5727865", "0.57240343", "0.5723908", "0.5723738", "0.57199657", "0.57191163", "0.5717352", "0.5715461", "0.5712312", "0.57122684", "0.57054627", "0.56990695", "0.56987095", "0.56981015", "0.5693745", "0.5690107", "0.568886", "0.56884885", "0.56812793", "0.5681194", "0.5672935", "0.56698173", "0.56671417", "0.56588346", "0.56571203", "0.56559277", "0.5654516", "0.56541276", "0.5652811", "0.5651175", "0.56509906", "0.5644127", "0.5643876", "0.56407917", "0.56396675" ]
0.6414556
6
GET /bergains/new GET /bergains/new.json
def new @bergain = Bergain.new respond_to do |format| format.html # new.html.erb format.json { render json: @bergain } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @basin = Basin.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @basin }\n end\n end", "def new\n @bb = Bb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bb }\n end\n end", "def new\n @broad = Broad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @broad }\n end\n end", "def new\n @baggage = Baggage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @baggage }\n end\n end", "def new\n @borrow = Borrow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @borrow }\n end\n end", "def new\n @borrow_request = BorrowRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @borrow_request }\n end\n end", "def new\n @bid = Bid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bid }\n end\n end", "def new\n @bid = Bid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bid }\n end\n end", "def new\n @stalking = Stalking.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stalking }\n end\n end", "def new\n @bokin = Bokin.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @bokin }\n end\n end", "def new\n @breadcrumb = 'create'\n @bank = Bank.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bank }\n end\n end", "def new\n @baton = Baton.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @baton }\n end\n end", "def new\n @borrower = Borrower.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @borrower }\n end\n end", "def new\n @borrower = Borrower.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @borrower }\n end\n end", "def new\n @title = t('view.banks.new_title')\n @bank = Bank.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bank }\n end\n end", "def new\n @bid = Bid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_bid }\n end\n end", "def new\n @bounty = Bounty.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @bounty }\n end\n end", "def new\n @auction = Auction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @auction }\n end\n end", "def new\n @betraege = Betraege.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @betraege }\n end\n end", "def new\n @banda = Banda.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @banda }\n end\n end", "def new\n @bloom = Bloom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bloom }\n end\n end", "def new\n @bagtype = Bagtype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bagtype }\n end\n end", "def new\n #admin only\n return redirect_to static_pages_adminonlyerror_path if !current_user.is_admin\n @blessing = Blessing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @blessing }\n end\n end", "def new\n @holding = Holding.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @holding }\n end\n end", "def new\n @holding = Holding.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @holding }\n end\n end", "def new\n @boat = Boat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json {render json: @boat}\n end\n end", "def new\n @brag = Brag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @brag }\n end\n end", "def new\n @brend = Brend.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @brend }\n end\n end", "def new\n @ca = Ca.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ca }\n end\n end", "def new\n @gopy = Gopy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gopy }\n end\n end", "def new\n @bet = Bet.new(:odd_inflation => 10, :bid_amount => 1)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bet }\n end\n end", "def new\n @lbaa = Lbaa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lbaa }\n end\n end", "def new\n @lease = Lease.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @lease }\n end\n end", "def new\n @brain = Brain.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @brain }\n end\n end", "def new\n @bl = Bl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bl }\n end\n end", "def new\n @borad = Borad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @borad }\n end\n end", "def new\n @borc = Borc.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @borc }\n end\n end", "def new\n @budget = Budget.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @budget }\n end\n end", "def new\n @breadcrumb = 'create'\n @insurance = Insurance.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @insurance }\n end\n end", "def new\n @client_release = ClientRelease.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client_release }\n end\n end", "def new\n @basis = Base.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @basis }\n end\n end", "def new\n authenticate_user!\n @auction = Auction.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @auction }\n end\n end", "def new\n @b = B.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @b }\n end\n end", "def new\n @construction = Construction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @construction }\n end\n end", "def new\n @kb = Kb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @kb }\n end\n end", "def new\n @release_loan = ReleaseLoan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @release_loan }\n end\n end", "def new\n @bank = Bank.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bank }\n end\n end", "def new\n @ba_spec = BaSpec.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ba_spec }\n end\n end", "def new\n @sugar_bag = SugarBag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sugar_bag }\n end\n end", "def new\n @budget = Budget.new\n\n respond_to do |format|\n format.html # new.html.erb\n # format.json { render json: @budget }\n end\n end", "def new\n @bruger_id = current_user.id\n @bruger = Bruger.find_by_id(@bruger_id)\n @onske = Onske.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @onske }\n end\n end", "def new\n @beacon = Beacon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @beacon }\n end\n end", "def new \n @buchung = Buchung.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @buchung }\n end\n end", "def new\n @lbc = Lbc.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lbc }\n end\n end", "def new\n @crate = Crate.new\n @payers = get_cratepayers()\n @types = get_crate_types()\n @priorities = get_crate_priorities()\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @crate }\n end\n end", "def new\n @bg_setup = BgSetup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bg_setup }\n end\n end", "def new\n @publisher = Publisher.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @publisher }\n end\n end", "def new\n @acquirement = Acquirement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @acquirement }\n end\n end", "def new\n @supplies_loan = SuppliesLoan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @supplies_loan }\n end\n end", "def new\n @bike = Bike.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bike }\n end\n end", "def new\n @bruschettum = Bruschettum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bruschettum }\n end\n end", "def new\n @publisher = Publisher.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @publisher }\n end\n end", "def new\n @climb = Climb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @climb }\n end\n end", "def new\n @pickup = Pickup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pickup }\n end\n end", "def new\n @strain = Strain.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @strain }\n end\n end", "def new\n @crate_type = CrateType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @crate_type }\n end\n end", "def new\n @brand = Brand.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @brand }\n end\n end", "def new\n @charge = Charge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @charge }\n end\n end", "def new\n @clue = Clue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clue }\n end\n end", "def new\n @clue = Clue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clue }\n end\n end", "def new\n @loan = Loan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @loan }\n end\n end", "def new\n @brother = Brother.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @brother }\n end\n end", "def new\n @badge = Badge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @badge }\n end\n end", "def new\n @bcard = Bcard.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bcard }\n end\n end", "def new\n @pledge = Pledge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pledge }\n end\n end", "def new\n @pledge = Pledge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pledge }\n end\n end", "def new\n @bundlesticker = Bundlesticker.new\n @headline = \"Auftragsware\".prepend(\"Etik. \")\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bundlesticker }\n end\n end", "def new\n @banner = Banner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @banner }\n end\n end", "def new\n @banner = Banner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @banner }\n end\n end", "def new\n @bg = Bg.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bg }\n end\n end", "def new\n @reference = Reference.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reference }\n end\n end", "def new\n @final_packing_pallet = FinalPackingPallet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @final_packing_pallet }\n end\n end", "def new\n @law = Law.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @law }\n end\n end", "def new\r\n @brand = Brand.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @brand }\r\n end\r\n end", "def new\n @bruger_id = current_user.id\n @bruger = Bruger.find_by_id(@bruger_id)\n @begivenhed = Begivenhed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @begivenhed }\n end\n end", "def new\n @budgeting_type = BudgetingType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @budgeting_type }\n end\n end", "def new\n @barn = Barn.new\n set_page_title\n if current_user.is_admin?\n @farms = Farm.all\n @locations = []\n @barns = []\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @barn }\n end\n end", "def new\n @gastracker = Gastracker.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gastracker }\n end\n end", "def new\n @stock = Stock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stock }\n end\n end", "def new\n @stock = Stock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stock }\n end\n end", "def new\n @stock = Stock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stock }\n end\n end", "def new\n @stock = Stock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stock }\n end\n end", "def new\n @stock = Stock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stock }\n end\n end", "def new\n @stock = Stock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stock }\n end\n end", "def new\n @publink = Publink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @publink }\n end\n end", "def new\n @businessbook = Businessbook.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @businessbook }\n end\n end", "def new\n @fridge = Fridge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fridge }\n end\n end", "def new\n @badge = Badge.new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @badge }\n end\n end", "def new\n @bid = Bid.new\n @item = Item.find(params[:id])\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bid }\n end\n end" ]
[ "0.729829", "0.7133235", "0.7116263", "0.7106272", "0.7104648", "0.70694786", "0.7067647", "0.7067647", "0.70175403", "0.69936925", "0.69935673", "0.6982095", "0.6941733", "0.6941733", "0.69229543", "0.691325", "0.69090563", "0.69029844", "0.68808866", "0.6870423", "0.68483096", "0.68414754", "0.68356127", "0.6835171", "0.6835171", "0.6830161", "0.68027425", "0.67882204", "0.67870593", "0.6778148", "0.67749405", "0.67563367", "0.6754692", "0.6753223", "0.67523247", "0.67377806", "0.6736683", "0.6728267", "0.67270136", "0.672493", "0.67235595", "0.6723362", "0.6722354", "0.67141634", "0.6703516", "0.66891295", "0.6686628", "0.6685161", "0.66847086", "0.6675113", "0.6674995", "0.66655564", "0.66644263", "0.6658596", "0.6657038", "0.66562223", "0.6655526", "0.66349244", "0.66293263", "0.66234547", "0.6623075", "0.66220856", "0.66157156", "0.66067535", "0.660344", "0.6602158", "0.6601848", "0.65950906", "0.65937096", "0.65937096", "0.65921867", "0.6587989", "0.65780294", "0.65723234", "0.6568302", "0.6568302", "0.6564965", "0.6564651", "0.6564651", "0.6557051", "0.65533113", "0.65520877", "0.6551328", "0.65500075", "0.6548843", "0.65469354", "0.65354496", "0.653307", "0.65316486", "0.65316486", "0.65316486", "0.65316486", "0.65316486", "0.65316486", "0.6528446", "0.6524095", "0.6521854", "0.6514692", "0.65125406" ]
0.69288456
15
POST /bergains POST /bergains.json
def create @bergain = Bergain.new(params[:bergain]) respond_to do |format| if @bergain.save format.html { redirect_to @bergain, notice: 'Bergain was successfully created.' } format.json { render json: @bergain, status: :created, location: @bergain } else format.html { render action: "new" } format.json { render json: @bergain.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @bergain = Bergain.new(params[:bergain])\n\n respond_to do |format|\n if @bergain.save\n format.html { redirect_to seller_bergains_url, notice: 'Bergain was successfully created.' }\n format.json { render json: @bergain, status: :created, location: @bergain }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bergain.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @basin = Basin.new(params[:basin])\n\n respond_to do |format|\n if @basin.save\n format.html { redirect_to @basin, notice: 'Basin was successfully created.' }\n format.json { render json: @basin, status: :created, location: @basin }\n else\n format.html { render action: \"new\" }\n format.json { render json: @basin.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @boc = Boc.new(boc_params)\n\n respond_to do |format|\n if @boc.save\n format.html { redirect_to new_boc_path, notice: 'Boc was successfully created.' }\n format.json { render :show, status: :created, location: @boc }\n else\n format.html { render :new }\n format.json { render json: @boc.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @baggage = Baggage.new(params[:baggage])\n\n respond_to do |format|\n if @baggage.save\n format.html { redirect_to @baggage, notice: 'Baggage was successfully created.' }\n format.json { render json: @baggage, status: :created, location: @baggage }\n else\n format.html { render action: \"new\" }\n format.json { render json: @baggage.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @brave_burst = BraveBurst.new(brave_burst_params)\n\n respond_to do |format|\n if @brave_burst.save\n format.html { redirect_to @brave_burst, notice: 'Brave burst was successfully created.' }\n format.json { render action: 'show', status: :created, location: @brave_burst }\n else\n format.html { render action: 'new' }\n format.json { render json: @brave_burst.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @betraege = Betraege.new(params[:betraege])\n\n respond_to do |format|\n if @betraege.save\n format.html { redirect_to @betraege, :notice => 'Betraege was successfully created.' }\n format.json { render :json => @betraege, :status => :created, :location => @betraege }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @betraege.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @borad = Borad.new(params[:borad])\n\n respond_to do |format|\n if @borad.save\n format.html { redirect_to @borad, :notice => 'Borad was successfully created.' }\n format.json { render :json => @borad, :status => :created, :location => @borad }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @borad.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @bikestand = Bikestand.new(bikestand_params)\n\n respond_to do |format|\n if @bikestand.save\n format.html { redirect_to @bikestand, notice: 'Bikestand was successfully created.' }\n format.json { render :show, status: :created, location: @bikestand }\n else\n format.html { render :new }\n format.json { render json: @bikestand.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bbhk = Bbhk.new(bbhk_params)\n\n respond_to do |format|\n if @bbhk.save\n format.html { redirect_to @bbhk, notice: 'Bbhk was successfully created.' }\n format.json { render action: 'show', status: :created, location: @bbhk }\n else\n format.html { render action: 'new' }\n format.json { render json: @bbhk.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_branding(params)\n request :post, \"/v3/brandings.json\", params\n end", "def create\n @bb = Bb.new(params[:bb])\n\n respond_to do |format|\n if @bb.save\n format.html { redirect_to @bb, notice: 'Bb was successfully created.' }\n format.json { render json: @bb, status: :created, location: @bb }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bb.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @budget = Budget.new(budget_params)\n @client = Client.new\n @clients = Client.all\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'El presupuesto se creó correctamente' }\n format.json { render :show, status: :created, location: @budget }\n else\n format.html { render :new }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @brend = Brend.new(params[:brend])\n\n respond_to do |format|\n if @brend.save\n format.html { redirect_to @brend, notice: 'Brend was successfully created.' }\n format.json { render json: @brend, status: :created, location: @brend }\n else\n format.html { render action: \"new\" }\n format.json { render json: @brend.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bb = Bb.new(bb_params)\n\n respond_to do |format|\n if @bb.save\n format.html { redirect_to @bb, notice: 'Bb was successfully created.' }\n format.json { render :show, status: :created, location: @bb }\n else\n format.html { render :new }\n format.json { render json: @bb.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @brainfart = Brainfart.new(brainfart_params)\n\n respond_to do |format|\n if @brainfart.save\n format.html { redirect_to @brainfart, notice: 'Brainfart was successfully created.' }\n format.json { render :show, status: :created, location: @brainfart }\n else\n format.html { render :new }\n format.json { render json: @brainfart.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_bank_link_using_post_with_http_info(brokerage_bank_link_co, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BrokerageApi.create_bank_link_using_post ...'\n end\n # verify the required parameter 'brokerage_bank_link_co' is set\n if @api_client.config.client_side_validation && brokerage_bank_link_co.nil?\n fail ArgumentError, \"Missing the required parameter 'brokerage_bank_link_co' when calling BrokerageApi.create_bank_link_using_post\"\n end\n # resource path\n local_var_path = '/brokerage/bank_link'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n # 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(brokerage_bank_link_co)\n auth_names = ['oauth2']\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 => 'BrokerageBankLinkVO')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BrokerageApi#create_bank_link_using_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @bacon = Bacon.new(bacon_params)\n\n respond_to do |format|\n if @bacon.save\n format.html { redirect_to @bacon, notice: 'Bacon was successfully created.' }\n format.json { render json: { bacon: @bacon }}\n else\n format.html { render action: 'new' }\n format.json { render json: @bacon.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bien = Bien.new(bien_params)\n\n respond_to do |format|\n if @bien.save\n format.html { redirect_to @bien, notice: 'Bien was successfully created.' }\n format.json { render :show, status: :created, location: @bien }\n else\n format.html { render :new }\n format.json { render json: @bien.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @kingsizeb = Kingsizeb.new(kingsizeb_params)\n\n respond_to do |format|\n if @kingsizeb.save\n format.html { redirect_to @kingsizeb, notice: 'Kingsizeb was successfully created.' }\n format.json { render :show, status: :created, location: @kingsizeb }\n else\n format.html { render :new }\n format.json { render json: @kingsizeb.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @broad = Broad.new(params[:broad])\n\n respond_to do |format|\n if @broad.save\n format.html { redirect_to @broad, notice: 'Broad was successfully created.' }\n format.json { render json: @broad, status: :created, location: @broad }\n else\n format.html { render action: \"new\" }\n format.json { render json: @broad.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @banda = Banda.new(params[:banda])\n\n respond_to do |format|\n if @banda.save\n format.html { redirect_to @banda, notice: 'Banda was successfully created.' }\n format.json { render json: @banda, status: :created, location: @banda }\n else\n format.html { render action: \"new\" }\n format.json { render json: @banda.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bounty = Bounty.new(bounty_params)\n\n respond_to do |format|\n if @bounty.save\n format.html { redirect_to @bounty, notice: 'Bounty was successfully created.' }\n format.json { render action: 'show', status: :created, location: @bounty }\n else\n format.html { render action: 'new' }\n format.json { render json: @bounty.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\tboat = Boat.new(boat_params)\n \tif boat.save\n \t\trender json: boat, status: 201\n \tend\n\tend", "def new\n @basin = Basin.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @basin }\n end\n end", "def create\n @bok = Bok.new(bok_params)\n\n respond_to do |format|\n if @bok.save\n format.html { redirect_to @bok, notice: 'Bok was successfully created.' }\n format.json { render :show, status: :created, location: @bok }\n else\n format.html { render :new }\n format.json { render json: @bok.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @boat = Boat.new(boat_params)\n\n if @boat.save\n render json: @boat, status: :created, location: @boat\n else\n render json: @boat.errors, status: :unprocessable_entity\n end\n end", "def create\n @bnpb = Bnpb.new(bnpb_params)\n\n respond_to do |format|\n if @bnpb.save\n format.html { redirect_to @bnpb, notice: 'Bnpb was successfully created.' }\n format.json { render :show, status: :created, location: @bnpb }\n else\n format.html { render :new }\n format.json { render json: @bnpb.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @brag = Brag.new(params[:brag])\n\n respond_to do |format|\n if @brag.save\n format.html { redirect_to @brag, notice: 'Brag was successfully created.' }\n format.json { render json: @brag, status: :created, location: @brag }\n else\n format.html { render action: \"new\" }\n format.json { render json: @brag.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bay =Bay.new(bay_params)\n\n respond_to do |format|\n if @bay.save\n format.html { redirect_to ['control',@bay], notice: 'La bahía fue creada exitosamente.' }\n format.json { render :show, status: :created, location: @bay }\n else\n format.html { render :new }\n format.json { render json: @bay.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @rb = Rb.new(rb_params)\n respond_to do |format|\n if @rb.save\n format.html { redirect_to rbs_path, notice: 'Erfolgreich erstellt.' }\n format.json { render :show, status: :created, location: @rb }\n else\n format.html { render :new }\n format.json { render json: @rb.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @balada = Balada.new(balada_params)\n\n respond_to do |format|\n if @balada.save\n format.html { redirect_to @balada, notice: 'Balada was successfully created.' }\n format.json { render :show, status: :created, location: @balada }\n else\n format.html { render :new }\n format.json { render json: @balada.errors, status: :unprocessable_entity }\n end\n end\n end", "def brass_params\n params.require(:brass).permit(:name, :caliber_id)\n end", "def create\n @bike_rack = BikeRack.new(bike_rack_params)\n\n respond_to do |format|\n if @bike_rack.save\n flash[:success] = 'Bike rack was successfully created.'\n format.html { redirect_to @bike_rack }\n format.json { render :show, status: :created, location: @bike_rack }\n else\n flash[:danger] = 'There was a problem with creating Bike rack.'\n format.html { render :new }\n format.json { render json: @bike_rack.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_brokerage_bank_link_using_post_with_http_info(brokerage_bank_link_co, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BrokerageApi.create_brokerage_bank_link_using_post ...'\n end\n # verify the required parameter 'brokerage_bank_link_co' is set\n if @api_client.config.client_side_validation && brokerage_bank_link_co.nil?\n fail ArgumentError, \"Missing the required parameter 'brokerage_bank_link_co' when calling BrokerageApi.create_brokerage_bank_link_using_post\"\n end\n # resource path\n local_var_path = '/brokerage/bank_link'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n # 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(brokerage_bank_link_co)\n auth_names = ['oauth2']\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 => 'BrokerageBankLinkVO')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BrokerageApi#create_brokerage_bank_link_using_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @bollywood = Bollywood.new(bollywood_params)\n\n respond_to do |format|\n if @bollywood.save\n format.html { redirect_to @bollywood, notice: 'Bollywood was successfully created.' }\n format.json { render :show, status: :created, location: @bollywood }\n else\n format.html { render :new }\n format.json { render json: @bollywood.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bank_agence = BankAgence.new(bank_agence_params)\n\n respond_to do |format|\n if @bank_agence.save\n format.html { redirect_to @bank_agence, notice: 'Bank agence was successfully created.' }\n format.json { render :show, status: :created, location: @bank_agence }\n else\n format.html { render :new }\n format.json { render json: @bank_agence.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @blast = Blast.new(params[:blast])\n @blast.start_at = Time.now\n @blast.owner_id = current_user.id\n @blast.status = \"pending\"\n\n respond_to do |format|\n if @blast.save\n format.html { redirect_to blasts_path, notice: 'Blast was successfully created.' }\n format.json { render json: @blast, status: :created, location: @blast }\n else\n format.html { render action: \"new\" }\n format.json { render json: @blast.errors.full_messages, status: :unprocessable_entity }\n end\n end\n end", "def create\n @buisness = Buisness.new(buisness_params)\n\n respond_to do |format|\n if @buisness.save\n format.html { redirect_to @buisness, notice: 'Buisness was successfully created.' }\n format.json { render :show, status: :created, location: @buisness }\n else\n format.html { render :new }\n format.json { render json: @buisness.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if current_user.is_not_staff?\n flash[:error] = \"You do not have permissions to access that feature.\"\n redirect_to root_path and return\n end\n \n @bike_assesment = BikeAssesment.new(params[:bike_assesment])\n\n respond_to do |format|\n if @bike_assesment.save\n format.html { redirect_to @bike_assesment, notice: 'Bike assesment was successfully created.' }\n format.json { render json: @bike_assesment, status: :created, location: @bike_assesment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bike_assesment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bollywood = Bollywood.new(bollywood_params)\n\n respond_to do |format|\n if @bollywood.save\n format.html { redirect_to @bollywood, notice: 'Bollywood was successfully created.' }\n format.json { render :show, status: :created, location: @bollywood }\n else\n format.html { render :new }\n format.json { render json: @bollywood.errors, status: :unprocessabl2e_entity }\n end\n end\n end", "def index\n if params[:name].present?\n @json = Punk::API.beers_name!(params[:name])\n elsif params[:abv_gt].present?\n @json = Punk::API.beers_abv_gt!(params[:abv_gt])\n elsif params[:abv_lt].present?\n @json = Punk::API.beers_abv_lt!(params[:abv_lt])\n else\n @json = Punk::API.all_beers!(params)\n end\n\n render json: {\n beers: @json\n }\n create(@json)\n end", "def create\n @budget = Budget.new(params[:budget])\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to budgets_path }\n format.json { render json: @budget, status: :created, location: @budget }\n else\n format.html { render action: \"new\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @borc = Borc.new(params[:borc])\n\n respond_to do |format|\n if @borc.save\n format.html { redirect_to @borc, notice: 'Borc was successfully created.' }\n format.json { render json: @borc, status: :created, location: @borc }\n else\n format.html { render action: \"new\" }\n format.json { render json: @borc.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @boook = Boook.new(boook_params)\n\n respond_to do |format|\n if @boook.save\n format.html { redirect_to @boook, notice: 'Boook was successfully created.' }\n format.json { render :show, status: :created, location: @boook }\n else\n format.html { render :new }\n format.json { render json: @boook.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n #bird name must be present\n if params[:name].blank?\n render json: {\n status: 400,\n message: \"Fågelns namn måste anges.\" \n }\n end\n \n #latin name must be present\n if params[:latin].blank?\n render json: {\n status: 400,\n message: \"Fågelns latinska namn måste anges.\" \n }\n end\n \n #regularity must be present\n if params[:regularity].blank?\n render json: {\n status: 400,\n message: \"Fågelns regularitet måste anges.\" \n }\n end\n \n #check if bird already exists\n if Api::V1::Bird.exists?(:bird_name => params[:name])\n render json: {\n status: 400,\n message: \"Fågeln finns redan\" \n }\n else\n @bird = Api::V1::Bird.create(:bird_name => params[:name], :latin_name => params[:latin], :regularity => params[:regularity])\n render json: {\n status: 201,\n message: \"Fågeln är registrerad och finns nu i listan.\", \n bird: Api::V1::BirdSerializer.new(@bird) \n }\n end\n end", "def create\n render json: Beverage.create!(beverage_post_params), status: :created\n end", "def create\n @braider = Braider.new(braider_params)\n\n respond_to do |format|\n if @braider.save\n format.html { redirect_to @braider, notice: 'Braider was successfully created.' }\n format.json { render action: 'show', status: :created, location: @braider }\n else\n format.html { render action: 'new' }\n format.json { render json: @braider.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bead_pack = BeadPack.new(bead_pack_params)\n respond_to do |format|\n if @bead_pack.save\n format.html { redirect_to @bead_pack, notice: 'Bead pack was successfully created.' }\n format.json { render :show, status: :created, location: @bead_pack }\n else\n format.html { render :new }\n format.json { render json: @bead_pack.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bustour = Bustour.new(bustour_params)\n\n respond_to do |format|\n if @bustour.save\n format.html { redirect_to @bustour, notice: 'Bustour was successfully created.' }\n format.json { render action: 'show', status: :created, location: @bustour }\n else\n format.html { render action: 'new' }\n format.json { render json: @bustour.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bahan = Bahan.new(params[:bahan])\n\n respond_to do |format|\n if @bahan.save\n format.html { redirect_to @bahan, notice: 'Bahan was successfully created.' }\n format.json { render json: @bahan, status: :created, location: @bahan }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bahan.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @brasseries = Brasserie.new(brasseries_params)\n\n respond_to do |format|\n if @brasseries.save\n format.html { redirect_to @brasseries, notice: 'Brasserie was successfully created.' }\n format.json { render :show, status: :created, location: @brasseries }\n else\n format.html { render :new }\n format.json { render json: @brasseries.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @berth_order = BerthOrder.new\n @berth_order.status = Status.find_by(status: \"Under behandling\")\n if berth_order_params[\"boat_id\"].blank?\n @boat = Boat.new\n @boat.name = params[:boat][:name]\n @boat.width = params[:boat][:width].gsub(',', '.')\n @boat.user = current_user\n @boat.save\n @berth_order.boat = @boat\n else\n @berth_order.boat_id = berth_order_params[:boat_id]\n end\n\n @berth_order.season_id = berth_order_params[:season_id]\n\n #.. And finally:\n respond_to do |format|\n if @berth_order.save\n format.html { redirect_to @berth_order, notice: 'Berth order was successfully created.' }\n format.json { render :show, status: :created, location: @berth_order }\n else\n format.html { render :new }\n format.json { render json: @berth_order.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @current_bijou = current_rockhound;\n # @bijou = Bijou.new(bijou_params)\n\n @new_bijou = @current_bijou.bijous.build(bijou_params)\n\n respond_to do |format|\n if @new_bijou.save\n format.html { redirect_to @bijou, notice: 'Bijou was successfully created.' }\n format.json { render :show, status: :created, location: @bijou }\n else\n format.html { render :new }\n format.json { render json: @bijou.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @band = Band.new(band_params)\n\n respond_to do |format|\n if @band.save\n format.html { redirect_to @band, notice: 'Band was successfully created.' }\n format.json { render :show, status: :created, location: @band }\n else\n format.html { render :new }\n format.json { render json: @band.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @stag_bcode = StagBcode.new(stag_bcode_params)\n\n respond_to do |format|\n if @stag_bcode.save\n format.html { redirect_to @stag_bcode, notice: 'Stag bcode was successfully created.' }\n format.json { render :show, status: :created, location: @stag_bcode }\n else\n format.html { render :new }\n format.json { render json: @stag_bcode.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @borrower_request = BorrowerRequest.new(borrower_request_params)\n\n respond_to do |format|\n if @borrower_request.save\n @borrower_request.update_attributes(place: JSON.parse(params[:borrower_request][:place]))\n format.html { redirect_to borrower_requests_url, notice: 'Borrower request was successfully created.' }\n format.json { render :show, status: :created, location: @borrower_request }\n else\n format.html { render :new }\n format.json { render json: @borrower_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def create(bin_params)\n @rest.post('save', bin_params)\n end", "def new\n @bergain = Bergain.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bergain }\n end\n end", "def new\n @bergain = Bergain.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bergain }\n end\n end", "def create\n @bannar = @current_site.bannars.build(bannar_params)\n\n respond_to do |format|\n if @bannar.save\n format.html { redirect_to bannars_path, notice: 'Bannar was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end", "def create\n @bac = Bac.new(bac_params)\n\n respond_to do |format|\n if @bac.save\n format.html { redirect_to @bac, notice: 'Bac was successfully created.' }\n format.json { render :show, status: :created, location: @bac }\n else\n format.html { render :new }\n format.json { render json: @bac.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @baggage = Baggage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @baggage }\n end\n end", "def create\n @sugar_bag = SugarBag.new(params[:sugar_bag])\n\n respond_to do |format|\n if @sugar_bag.save\n format.html { redirect_to @sugar_bag, notice: 'Sugar bag was successfully created.' }\n format.json { render json: @sugar_bag, status: :created, location: @sugar_bag }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sugar_bag.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bonificacion = Bonificacion.new(bonificacion_params)\n\n respond_to do |format|\n if @bonificacion.save\n format.html { redirect_to @bonificacion, notice: 'Bonificacion was successfully created.' }\n format.json { render :show, status: :created, location: @bonificacion }\n else\n format.html { render :new }\n format.json { render json: @bonificacion.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bonificacion = Bonificacion.new(bonificacion_params)\n\n respond_to do |format|\n if @bonificacion.save\n format.html { redirect_to @bonificacion, notice: 'Bonificacion was successfully created.' }\n format.json { render :show, status: :created, location: @bonificacion }\n else\n format.html { render :new }\n format.json { render json: @bonificacion.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @admin_bait = Bait.new(params[:admin_bait])\n\n respond_to do |format|\n if @admin_bait.save\n format.html { redirect_to @admin_bait, notice: 'Bait was successfully created.' }\n format.json { render json: @admin_bait, status: :created, location: @admin_bait }\n else\n format.html { render action: \"new\" }\n format.json { render json: @admin_bait.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @brake_type = BrakeType.new(brake_type_params)\n\n respond_to do |format|\n if @brake_type.save\n format.html { redirect_to brake_types_path, notice: 'Brake type was successfully created.' }\n format.json { render :show, status: :created, location: @brake_type }\n else\n format.html { render :new }\n format.json { render json: @brake_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @burpy = Burpy.new(burpy_params)\n\n respond_to do |format|\n if @burpy.save\n format.html { redirect_to @burpy, notice: 'Burpy was successfully created.' }\n format.json { render :show, status: :created, location: @burpy }\n else\n format.html { render :new }\n format.json { render json: @burpy.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_bounce\n begin\n RestClient.post $cnf['mailgun']['apikey'] + $cnf['mailgun']['bounnces'],\n :address => '[email protected]'\n rescue Exception => e\n puts \"Exception raised add_bounce:\" + e.class.to_s\n puts e.message\n end\n end", "def create\n @baton = Baton.new(params[:baton])\n\n respond_to do |format|\n if @baton.save\n format.html { redirect_to @baton, notice: 'Baton was successfully created.' }\n format.json { render json: @baton, status: :created, location: @baton }\n else\n format.html { render action: \"new\" }\n format.json { render json: @baton.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @budget = Budget.new(params[:budget])\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render json: @budget, status: :created, location: @budget }\n else\n format.html { render action: \"new\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bs_type = BsType.new(bs_type_params)\n\n respond_to do |format|\n if @bs_type.save\n format.html { redirect_to @bs_type, notice: 'Bs type was successfully created.' }\n format.json { render :show, status: :created, location: @bs_type }\n else\n format.html { render :new }\n format.json { render json: @bs_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def test_create_transaction\n params = {\n bank_transaction: {\n bank_account_id: 1,\n date: Time.local(2012, 4, 16),\n amount: 55\n }\n }\n\n post '/api/banks/1/transactions', params\n data = ActiveSupport::JSON.decode last_response.body\n\n assert last_response.successful?\n assert_match('application/json', last_response.content_type)\n assert BankTransaction.find(data['id'])\n end", "def post(cnpj, branch, contractId, body)\n self.class.post(\"/aldebaran-carriers/carriers/#{cnpj}/contracts/#{branch}/#{contractId}/regions\", :basic_auth => @auth, :body => body.to_json)\n end", "def create\n @gastos_balanceado = GastosBalanceado.new(gastos_balanceado_params)\n\n respond_to do |format|\n if @gastos_balanceado.save\n format.html { redirect_to @gastos_balanceado, notice: 'Gastos balanceado was successfully created.' }\n format.json { render :show, status: :created, location: @gastos_balanceado }\n else\n format.html { render :new }\n format.json { render json: @gastos_balanceado.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @apertura_billete = AperturaBillete.new(apertura_billete_params)\n\n respond_to do |format|\n if @apertura_billete.save\n format.html { redirect_to @apertura_billete, notice: 'Apertura billete was successfully created.' }\n format.json { render :show, status: :created, location: @apertura_billete }\n else\n format.html { render :new }\n format.json { render json: @apertura_billete.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bark = current_user.barks.build(bark_params)\n\n respond_to do |format|\n if @bark.save\n format.html { redirect_to root_path, notice: \"Bark was successfully created.\" }\n format.json { render :show, status: :created, location: @bark }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @bark.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @pregnancy = Pregnancy.new(pregnancy_params)\n @rabbit = @pregnancy.rabbit\n @cage = @rabbit.cage\n\n respond_to do |format|\n if @pregnancy.save\n format.html { redirect_to rabbit_pregnancies_path(@rabbit), notice: 'Inizio gravidanza registrato' }\n format.json { render :show, status: :created, location: @pregnancy }\n else\n format.html { render :new }\n format.json { render json: @pregnancy.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @battery_bank = BatteryBank.new(battery_bank_params)\n\n respond_to do |format|\n if @battery_bank.save\n format.html { redirect_to @battery_bank, notice: 'Battery bank was successfully created.' }\n format.json { render :show, status: :created, location: @battery_bank }\n else\n format.html { render :new }\n format.json { render json: @battery_bank.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @galletum = Galletum.new(galletum_params)\n\n respond_to do |format|\n if @galletum.save\n format.html { redirect_to @galletum, notice: 'Galletum was successfully created.' }\n format.json { render :show, status: :created, location: @galletum }\n else\n format.html { render :new }\n format.json { render json: @galletum.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @baker = Baker.new(baker_params)\n\n respond_to do |format|\n if @baker.save\n format.html { redirect_to @baker, notice: 'Baker was successfully created.' }\n format.json { render :show, status: :created, location: @baker }\n else\n format.html { render :new }\n format.json { render json: @baker.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @budget = Budget.new(budget_params)\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render :show, status: :created, location: @budget }\n else\n format.html { render :new }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @budget = Budget.new(budget_params)\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render :show, status: :created, location: @budget }\n else\n format.html { render :new }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @budget = Budget.new(params[:budget])\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render json: @budget, status: :created, budget: @budget }\n else\n format.html { render action: \"new\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @acquirement = Acquirement.new(params[:acquirement])\n\n respond_to do |format|\n if @acquirement.save\n format.html { redirect_to @acquirement, notice: 'Acquirement was successfully created.' }\n format.json { render json: @acquirement, status: :created, location: @acquirement }\n else\n format.html { render action: \"new\" }\n format.json { render json: @acquirement.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bid = Bid.new(params[:bid])\n\n respond_to do |format|\n if @bid.save\n format.html { redirect_to @admin_bid, notice: 'Bid was successfully created.' }\n format.json { render json: @admin_bid, status: :created, location: @admin_bid }\n else\n format.html { render action: \"new\" }\n format.json { render json: @admin_bid.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @auction = Auction.find(params[:auction_id])\n params[:bid].reverse_merge!({owner_id: current_user.id})\n @bid = @auction.bids.build(params[:bid])\n \n respond_to do |format|\n if @bid.save\n format.html { redirect_to @auction, notice: 'You submitted a bid!'}\n format.json { render json: @bid, status: :created, location: @bid }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bid.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bike = Bike.new(bike_params)\n @bike.compare_vehicles = params[:bike][:compare_vehicles]\n\n if @bike.save\n audit(@bike, current_user)\n render json: @bike, status: :created #serializer: Web::V1::BikeSerializer\n else\n render json: @bike.errors, status: :unprocessable_entity\n end\n end", "def create\n @cabinet_balancer = Balancer.new(create_params)\n\n respond_to do |format|\n if @cabinet_balancer.save\n format.html { redirect_to cabinet_balancers_path, notice: I18n.t('created') }\n format.json { render :show, status: :created, location: @cabinet_balancer }\n else\n format.html { render :new }\n format.json { render json: @cabinet_balancer.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @borrow = Borrow.new(params[:borrow])\n\n respond_to do |format|\n if @borrow.save\n format.html { redirect_to @borrow, notice: 'Borrow was successfully created.' }\n format.json { render json: @borrow, status: :created, location: @borrow }\n else\n format.html { render action: \"new\" }\n format.json { render json: @borrow.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @brigade = Brigade.new(params[:brigade])\n\n respond_to do |format|\n if verify_recaptcha(@brigade) && @brigade.save\n flash[:notice] = 'Brigade was successfully created.'\n format.html { redirect_to(@brigade) }\n format.xml { render :xml => @brigade, :status => :created, :location => @brigade }\n else\n format.html { render :action => \"new\", :layout => \"alternative\" }\n format.xml { render :xml => @brigade.errors }\n end\n end\n end", "def new\n @bb = Bb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bb }\n end\n end", "def create\n @c_bell = CBell.new(c_bell_params)\n\n respond_to do |format|\n if @c_bell.save\n format.html { redirect_to @c_bell, notice: 'C bell was successfully created.' }\n format.json { render :show, status: :created, location: @c_bell }\n else\n format.html { render :new }\n format.json { render json: @c_bell.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @bokin = Bokin.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @bokin }\n end\n end", "def bridges_create(params = {})\n post \"bridges\", params\n end", "def create\n @bagtype = Bagtype.new(params[:bagtype])\n\n respond_to do |format|\n if @bagtype.save\n format.html { redirect_to @bagtype, notice: 'Bagtype was successfully created.' }\n format.json { render json: @bagtype, status: :created, location: @bagtype }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bagtype.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bp = Bp.new(params[:bp])\n\n respond_to do |format|\n if @bp.save\n format.html { redirect_to @bp, notice: 'Bp was successfully created.' }\n format.json { render json: @bp, status: :created, location: @bp }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bp.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bourbon = Bourbon.new(bourbon_params)\n\n respond_to do |format|\n if @bourbon.save\n format.html { redirect_to @bourbon, notice: 'Bourbon was successfully created.' }\n format.json { render action: 'show', status: :created, location: @bourbon }\n else\n format.html { render action: 'new' }\n format.json { render json: @bourbon.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @climb_datum = ClimbDatum.new(params[:climb_datum])\n\n respond_to do |format|\n if @climb_datum.save\n format.html { redirect_to @climb_datum, notice: 'Climb datum was successfully created.' }\n format.json { render json: @climb_datum, status: :created, location: @climb_datum }\n else\n format.html { render action: \"new\" }\n format.json { render json: @climb_datum.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @award = Award.new(award_params)\n respond_to do |format|\n if @award.save\n a_data = JSON.parse params[:json_string]\n a_data.each do |a|\n @item = get_new_award_item(@award, a) unless a.nil?\n end\n AwardMailer.approval_request(@award)\n if current_user.admin\n format.html { redirect_to patient_path(@award.patient), notice: 'Award was successfully created.' }\n else\n format.html { redirect_to new_patient_path, notice: 'Award was successfully created.' }\n end\n format.json { render :show, status: :created, location: @award }\n else\n format.html { render :new }\n format.json { render json: @award.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.64310306", "0.62091416", "0.6161791", "0.61363834", "0.6091899", "0.60626626", "0.5945299", "0.58681184", "0.58609897", "0.58495086", "0.58217216", "0.5803162", "0.57946414", "0.5791383", "0.5776417", "0.57703596", "0.5770161", "0.57658577", "0.5750607", "0.57414186", "0.5739323", "0.5730374", "0.5714832", "0.57119995", "0.57118976", "0.569927", "0.5683539", "0.56808907", "0.5678083", "0.5665752", "0.566573", "0.5663993", "0.5661372", "0.56610537", "0.56607896", "0.56605285", "0.56587505", "0.56583035", "0.565469", "0.5649831", "0.5645951", "0.5640196", "0.56191325", "0.56143546", "0.5612541", "0.5611559", "0.5605727", "0.5601135", "0.5598978", "0.5580449", "0.557658", "0.5572119", "0.5571693", "0.5564594", "0.5558725", "0.5554434", "0.55536443", "0.5548039", "0.5548039", "0.55408263", "0.5538994", "0.5535815", "0.5531194", "0.5530875", "0.5530875", "0.5526502", "0.55241597", "0.55185115", "0.5513927", "0.5511755", "0.55100113", "0.55093694", "0.5508982", "0.55032235", "0.5498251", "0.5491913", "0.548156", "0.54773456", "0.54772514", "0.54735243", "0.5470474", "0.5469674", "0.54686755", "0.54674965", "0.5467226", "0.5458622", "0.5457984", "0.5455423", "0.5453564", "0.54520625", "0.5447129", "0.54470474", "0.5445176", "0.54432815", "0.54311395", "0.54303163", "0.5428554", "0.54273796", "0.542468", "0.5423888" ]
0.60661095
5
PUT /bergains/1 PUT /bergains/1.json
def update @bergain = Bergain.find(params[:id]) respond_to do |format| if @bergain.update_attributes(params[:bergain]) format.html { redirect_to @bergain, notice: 'Bergain was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @bergain.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @boc.update(boc_params)\n format.html { redirect_to @boc, notice: 'Boc was successfully updated.' }\n format.json { render :show, status: :ok, location: @boc }\n else\n format.html { render :edit }\n format.json { render json: @boc.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @basin = Basin.find(params[:id])\n\n respond_to do |format|\n if @basin.update_attributes(params[:basin])\n format.html { redirect_to @basin, notice: 'Basin was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @basin.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def update\n @bergain = Bergain.find(params[:id])\n\n respond_to do |format|\n if @bergain.update_attributes(params[:bergain])\n format.html { redirect_to seller_bergains_url, notice: 'Bergain was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bergain.errors, status: :unprocessable_entity }\n end\n end\n end", "def restobooking\n @buchung = Buchung.find(params[:id])\n @buchung.status='B' \n \n respond_to do |format|\n if @buchung.update_attributes(params[:buchung])\n format.html { redirect_to @buchung, notice: 'Buchung wurde erfolgreich geaendert.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @buchung.errors, status: :unprocessable_entity }\n end\n end \n end", "def update\n @broad = Broad.find(params[:id])\n\n respond_to do |format|\n if @broad.update_attributes(params[:broad])\n format.html { redirect_to @broad, notice: 'Broad was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @broad.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @baggage = Baggage.find(params[:id])\n\n respond_to do |format|\n if @baggage.update_attributes(params[:baggage])\n format.html { redirect_to @baggage, notice: 'Baggage was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @baggage.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_api_v1_booking\n @api_v1_booking = Booking.find(params[:id])\n end", "def update\n @agency = Agency.find(params[:id])\n\n if @agency.update(agency_params)\n #head :no_content\n render json: @agency, status: :accepted, location: @agency #sera? status accepted? \n else\n render json: @agency.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @abucket.update_attributes(params[:abucket])\n flash[:notice] = 'Bucket was successfully updated.'\n format.html { redirect_to(account_abuckets_path(@account)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @abucket.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n budgets = update_budgets(params[:budgets])\n\n render json: budgets, status: :ok\n end", "def update\n @spkj_bsb=SpkjBsb.find(params[:id])\n @spkj_bsb.update_attributes(params[:spkj_bsb])\n\n respond_to do |format|\n format.html { redirect_to(\"/spkj_bsbs\") }\n format.json { render json: @spkj_bsb }\n end\n end", "def update\n # { clinic: {id: references, \"license_id\"=>nil, \"name\"=>string } }\n \n if @clinic.update_attributes(params[:clinic].except(:api_license_id))\n head :no_content\n else\n render json: clinic.errors.full_messages, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @bacon.update(bacon_params)\n format.html { redirect_to @bacon, notice: 'Bacon was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bacon.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @boat.update(boat_params)\n head :no_content\n else\n render json: @boat.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @brave_burst.update(brave_burst_params)\n format.html { redirect_to @brave_burst, notice: 'Brave burst was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @brave_burst.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n render json: Alien.update(params[\"id\"], params[\"alien\"])\n end", "def update\n puts \"update #{@need.as_json} #{updated_params.as_json}\"\n respond_to do |format|\n if @need.update(updated_params)\n puts \"brucep update success\"\n format.html { redirect_to new_need_path }\n format.json { render :show, status: :ok, location: @need }\n else\n format.html { render :edit }\n format.json { render json: @need.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bowler.update(bowler_params)\n respond_with(@bowler)\n end", "def update\n respond_to do |format|\n if @brasseries.update(brasseries_params)\n format.html { redirect_to @brasseries, notice: 'Brasserie was successfully updated.' }\n format.json { render :show, status: :ok, location: @brasseries }\n else\n format.html { render :edit }\n format.json { render json: @brasseries.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @band = Band.find(params[:id])\n @client = @band.client\n\n respond_to do |format|\n if @band.update_attributes(params[:band])\n flash.now[:notice] = 'Band information saved'\n format.html { redirect_to client_path(@client) }\n format.json { head :no_content }\n format.js\n else\n format.html { render action: \"edit\" }\n format.json { render json: @band.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "def update\n authorize @brass\n respond_to do |format|\n if @brass.update(brass_params)\n format.html { redirect_to @brass, notice: \"Brass was successfully updated.\" }\n format.json { render :show, status: :ok, location: @brass }\n else\n format.html { render :edit }\n format.json { render json: @brass.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_bank_link_using_put_with_http_info(nucleus_bank_link_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BrokerageApi.update_bank_link_using_put ...'\n end\n # verify the required parameter 'nucleus_bank_link_id' is set\n if @api_client.config.client_side_validation && nucleus_bank_link_id.nil?\n fail ArgumentError, \"Missing the required parameter 'nucleus_bank_link_id' when calling BrokerageApi.update_bank_link_using_put\"\n end\n # resource path\n local_var_path = '/brokerage/bank_link/{nucleus_bank_link_id}'.sub('{' + 'nucleus_bank_link_id' + '}', nucleus_bank_link_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2']\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 => 'BrokerageBankLinkVO')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BrokerageApi#update_bank_link_using_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n @bb = Bb.find(params[:id])\n\n respond_to do |format|\n if @bb.update_attributes(params[:bb])\n format.html { redirect_to @bb, notice: 'Bb was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bb.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bucket_bloc.update(bucket_bloc_params)\n format.html { redirect_to @bucket_bloc, notice: 'Bucket bloc was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bucket_bloc.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n url = 'https://casa-core.herokuapp.com/api/units/' + params[:id]\n query = {\n 'name' => params[:name]\n }\n response = HTTParty.put(url, :query => query, :headers => { \"Authorization\" => AUTH, \"Host\" => HOST})\n\n if response.code == 200\n redirect_to unit_path(params[:id]), notice: 'Unit was successfully updated.'\n else\n redirect_to unit_path(params[:id]), notice: 'Sheesh! Minor hiccup...run that again!'\n end\n end", "def set_boc\n @boc = Boc.find(params[:id])\n end", "def update\n if @bid.update(bid_params)\n head :no_content\n else\n render json: @bid.errors, status: :unprocessable_entity\n end\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 respond_to do |format|\n if @bucket.update(bucket_params)\n format.html { redirect_to buckets_path, notice: 'Bucket was successfully updated.' }\n format.json { render :show, status: :ok, location: @pin }\n else\n format.html { render :edit, status: :unprocessable_entity}\n format.json { render json: @bucket.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bath.update(bath_params)\n format.html { redirect_to @bath, notice: 'Bath was successfully updated.' }\n format.json { render :show, status: :ok, location: @bath }\n else\n format.html { render :edit }\n format.json { render json: @bath.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @band = Band.find(params[:id])\n\[email protected]_attributes(params[:band])\n respond_with @band\n end", "def update\n @agency = Agency.find(params[:id])\n\n if @agency.update(agency_params)\n #head :no_content\n render json: @agency, status: :accepted, location: @agency #sera? status accepted? \n else\n render json: @agency.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @boook.update(boook_params)\n format.html { redirect_to @boook, notice: 'Boook was successfully updated.' }\n format.json { render :show, status: :ok, location: @boook }\n else\n format.html { render :edit }\n format.json { render json: @boook.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @betraege = Betraege.find(params[:id])\n\n respond_to do |format|\n if @betraege.update_attributes(params[:betraege])\n format.html { redirect_to @betraege, :notice => 'Betraege was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @betraege.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @brag = Brag.find(params[:id])\n\n respond_to do |format|\n if @brag.update_attributes(params[:brag])\n format.html { redirect_to @brag, notice: 'Brag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @brag.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bank_agence.update(bank_agence_params)\n format.html { redirect_to @bank_agence, notice: 'Bank agence was successfully updated.' }\n format.json { render :show, status: :ok, location: @bank_agence }\n else\n format.html { render :edit }\n format.json { render json: @bank_agence.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_brokerage_bank_link_using_put_with_http_info(nucleus_bank_link_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BrokerageApi.update_brokerage_bank_link_using_put ...'\n end\n # verify the required parameter 'nucleus_bank_link_id' is set\n if @api_client.config.client_side_validation && nucleus_bank_link_id.nil?\n fail ArgumentError, \"Missing the required parameter 'nucleus_bank_link_id' when calling BrokerageApi.update_brokerage_bank_link_using_put\"\n end\n # resource path\n local_var_path = '/brokerage/bank_link/{nucleus_bank_link_id}'.sub('{' + 'nucleus_bank_link_id' + '}', nucleus_bank_link_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2']\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 => 'BrokerageBankLinkVO')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BrokerageApi#update_brokerage_bank_link_using_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n if @bird.update(bird_params)\n render json: @bird, status: :ok, location: @bird\n else\n render json: @bird.errors, status: :unprocessable_entity\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 @bb.update(bb_params)\n format.html { redirect_to @bb, notice: 'Bb was successfully updated.' }\n format.json { render :show, status: :ok, location: @bb }\n else\n format.html { render :edit }\n format.json { render json: @bb.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bucket.update(bucket_params)\n format.html { redirect_to @bucket, notice: 'Bucket was successfully updated.' }\n format.json { render :show, status: :ok, location: @bucket }\n else\n format.html { render :edit }\n format.json { render json: @bucket.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @sugar_bag = SugarBag.find(params[:id])\n\n respond_to do |format|\n if @sugar_bag.update_attributes(params[:sugar_bag])\n format.html { redirect_to @sugar_bag, notice: 'Sugar bag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sugar_bag.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @blast = Blast.find(params[:id])\n\n respond_to do |format|\n if @blast.update_attributes(params[:blast])\n format.html { redirect_to blasts_path, notice: 'Blast was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @blast.errors.full_messages, 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 @borrower_request.update(borrower_request_params)\n @borrower_request.update_attributes(place: JSON.parse(params[:borrower_request][:place].gsub('=>', ':')))\n format.html { redirect_to @borrower_request, notice: 'Borrower request was successfully updated.' }\n format.json { render :show, status: :ok, location: @borrower_request }\n else\n format.html { render :edit }\n format.json { render json: @borrower_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @braider.update(braider_params)\n format.html { redirect_to @braider, notice: 'Braider was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @braider.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @api_book = Api::Book.find(params[:id])\n\n if @api_book.update(api_book_params)\n head :no_content\n else\n render json: @api_book.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @bbhk.update(bbhk_params)\n format.html { redirect_to @bbhk, notice: 'Bbhk was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bbhk.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(params)\n # TODO: API expects both priority and branchcode to update branch, bug in Koha module C4::Reserves::ModReserve\n raise ArgumentError, \"need both priority and branchcode params!\" unless params[:priority] && params[:branchcode]\n headers = {\n 'Cookie' => @context[:koha_rest_api_cookie],\n 'Content-Type' => 'application/json'\n }\n http = Net::HTTP.new(\"xkoha\", 8081)\n uri = URI(\"#{intranet(:koha_rest_api)}holds/#{params[:reserve_id]}\")\n res = http.put(uri, params.to_json, headers)\n expect(res.code).to eq(\"200\"), \"got unexpected #{res.code} when updating reserve.\\nResponse body: #{res.body}\"\n res.body\n end", "def update\n respond_to do |format|\n if @bien.update(bien_params)\n format.html { redirect_to @bien, notice: 'Bien was successfully updated.' }\n format.json { render :show, status: :ok, location: @bien }\n else\n format.html { render :edit }\n format.json { render json: @bien.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bike_rack.update(bike_rack_params)\n flash[:success] = 'Bike rack was successfully updated.'\n format.html { redirect_to @bike_rack }\n format.json { render :show, status: :ok, location: @bike_rack }\n else\n flash[:danger] = 'There was a problem editing Bike rack.'\n format.html { render :edit }\n format.json { render json: @bike_rack.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize @sims_biga_license\n respond_to do |format|\n if @sims_biga_license.update(sims_biga_license_params)\n format.html { redirect_to @sims_biga_license, notice: t('flash.notice.updated.') }\n format.json { render :show, status: :ok, location: @sims_biga_license }\n else\n format.html { render :edit }\n format.json { render json: @sims_biga_license.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @banda.update(banda_params)\n format.html { redirect_to @banda, notice: 'Banda was successfully updated.' }\n format.json { render :show, status: :ok, location: @banda }\n else\n format.html { render :edit }\n format.json { render json: @banda.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bread.update(bread_params)\n format.html { redirect_to @bread, notice: 'パン情報を編集した.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bread.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @banda = Banda.find(params[:id])\n\n respond_to do |format|\n if @banda.update_attributes(params[:banda])\n format.html { redirect_to @banda, notice: 'Banda was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @banda.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @control_bay.update(control_bay_params)\n format.html { redirect_to ['control',@bay], notice: 'La bahía fue actualizada exitosamente.' }\n format.json { render :show, status: :ok, location: @bay }\n else\n format.html { render :edit }\n format.json { render json: @bay.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n logger.info('PUT Update:')\n logger.info(request_body)\n new_pub = hashed_request\n old_pub = Publication.find_by(id: params[:id])\n if old_pub.blank?\n head :not_found\n return\n elsif old_pub.deleted?\n head :gone\n return\n end\n if old_pub.harvested_pub? # only manually entered (i.e. non-harvested) publications may be updated with this method\n render json: {\n error: \"This record SulPubID #{old_pub.id} may not be modified. If you had originally entered details for the record, \" \\\n 'it has been superceded by a central record.'\n },\n status: :forbidden, format: 'json'\n return\n elsif !validate_or_create_authors(new_pub[:authorship])\n render json: { error: 'You have not supplied a valid authorship record.' }, status: :not_acceptable,\n format: 'json'\n return\n end\n logger.info(\"Update manual publication #{old_pub.inspect} with BibJSON:\")\n logger.info(request_body)\n old_pub.update_manual_pub_from_pub_hash(new_pub, request_body)\n old_pub.save!\n old_pub.reload\n logger.debug(\"resulting pub hash: #{old_pub.pub_hash}\")\n render json: old_pub.pub_hash, status: :accepted\n end", "def update\n respond_to do |format|\n if @bag.update(bag_params)\n format.html { redirect_to @bag, notice: \"Bag was successfully updated.\" }\n format.json { render :show, status: :ok, location: @bag }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @bag.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bow.update(bow_params)\n format.html { redirect_to @bow, notice: 'Bow was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bow.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bagel.update(bagel_params)\n format.html { redirect_to @bagel, notice: 'Bagel was successfully updated.' }\n format.json { render :show, status: :ok, location: @bagel }\n else\n format.html { render :edit }\n format.json { render json: @bagel.errors, status: :unprocessable_entity }\n end\n end\n end", "def brass_params\n params.require(:brass).permit(:name, :caliber_id)\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 @bruger = Bruger.find_by_id(current_user.id)\n @begivenhed = Begivenhed.find(params[:id])\n\n respond_to do |format|\n if @begivenhed.update_attributes(params[:begivenhed])\n format.html { redirect_to @begivenhed, notice: 'Begivenhed was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @begivenhed.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bikestand.update(bikestand_params)\n format.html { redirect_to @bikestand, notice: 'Bikestand was successfully updated.' }\n format.json { render :show, status: :ok, location: @bikestand }\n else\n format.html { render :edit }\n format.json { render json: @bikestand.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @brainfart.update(brainfart_params)\n format.html { redirect_to @brainfart, notice: 'Brainfart was successfully updated.' }\n format.json { render :show, status: :ok, location: @brainfart }\n else\n format.html { render :edit }\n format.json { render json: @brainfart.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @acquirement = Acquirement.find(params[:id])\n\n respond_to do |format|\n if @acquirement.update_attributes(params[:acquirement])\n format.html { redirect_to @acquirement, notice: 'Acquirement was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @acquirement.errors, status: :unprocessable_entity }\n end\n end\n end", "def putBusiness( name, building_number, branch_name, address1, address2, address3, district, town, county, province, postcode, country, latitude, longitude, timezone, telephone_number, additional_telephone_number, email, website, category_id, category_type, do_not_display, referrer_url, referrer_name, destructive, delete_mode, master_entity_id)\n params = Hash.new\n params['name'] = name\n params['building_number'] = building_number\n params['branch_name'] = branch_name\n params['address1'] = address1\n params['address2'] = address2\n params['address3'] = address3\n params['district'] = district\n params['town'] = town\n params['county'] = county\n params['province'] = province\n params['postcode'] = postcode\n params['country'] = country\n params['latitude'] = latitude\n params['longitude'] = longitude\n params['timezone'] = timezone\n params['telephone_number'] = telephone_number\n params['additional_telephone_number'] = additional_telephone_number\n params['email'] = email\n params['website'] = website\n params['category_id'] = category_id\n params['category_type'] = category_type\n params['do_not_display'] = do_not_display\n params['referrer_url'] = referrer_url\n params['referrer_name'] = referrer_name\n params['destructive'] = destructive\n params['delete_mode'] = delete_mode\n params['master_entity_id'] = master_entity_id\n return doCurl(\"put\",\"/business\",params)\n end", "def update\n respond_to do |format|\n if @bowling.update(bowling_params)\n format.html { redirect_to @bowling, notice: 'Bowling was successfully updated.' }\n format.json { render :show, status: :ok, location: @bowling }\n else\n format.html { render :edit }\n format.json { render json: @bowling.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\t\trespond_to do |format|\n\t\t\tclient = Goodreads::Client.new(api_key: \"rSkvvZY8Wx27zcj4AfHA\", api_secret: \"S5WOpmY8pVtaEu1IwNn51DBafjoEIbjuxZdE6sNM\")\n\t\t\tbook = client.book_by_isbn(book_params[:isbn])\n\t\t\[email protected] = book.title\n\t\t\[email protected] = strip_tags(book.description)\n\t\t\[email protected] = book.work.original_title\n\t\t\[email protected] = book.num_pages\n\t\t\[email protected] = book.average_rating\n\t\t\[email protected] = book.authors.author.name\n\t\t\[email protected] = book.publisher\n\t\t\[email protected]\n\t\t\tformat.html { redirect_to @book, notice: 'Book was successfully updated.' }\n\t\t\tformat.json { render :show, status: :ok, location: @book }\n\t\tend\n end", "def update options={}\n client.put(\"/#{id}\", options)\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 @booth.update(booth_params)\n format.html { redirect_to event_booth_path(@booth), notice: 'Booth was successfully updated.' }\n format.json { render :show, status: :ok, location: @booth }\n else\n format.html { render :edit }\n format.json { render json: @booth.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if current_user.is_not_staff?\n flash[:error] = \"You do not have permissions to access that feature.\"\n redirect_to root_path and return\n end\n \n @bike_assesment = BikeAssesment.find(params[:id])\n\n respond_to do |format|\n if @bike_assesment.update_attributes(params[:bike_assesment])\n format.html { redirect_to @bike_assesment, notice: 'Bike assesment was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bike_assesment.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @auction.update(auction_params)\n head :no_content\n else\n render json: @auction.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @bingo.update(bingo_params)\n format.html { redirect_to @bingo, notice: \"Bingo was successfully updated.\" }\n format.json { render :show, status: :ok, location: @bingo }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @bingo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bollywood.update(bollywood_params)\n format.html { redirect_to @bollywood, notice: 'Bollywood was successfully updated.' }\n format.json { render :show, status: :ok, location: @bollywood }\n else\n format.html { render :edit }\n format.json { render json: @bollywood.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bollywood.update(bollywood_params)\n format.html { redirect_to @bollywood, notice: 'Bollywood was successfully updated.' }\n format.json { render :show, status: :ok, location: @bollywood }\n else\n format.html { render :edit }\n format.json { render json: @bollywood.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bustour.update(bustour_params)\n format.html { redirect_to @bustour, notice: 'Bustour was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bustour.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bac.update(bac_params)\n format.html { redirect_to @bac, notice: 'Bac was successfully updated.' }\n format.json { render :show, status: :ok, location: @bac }\n else\n format.html { render :edit }\n format.json { render json: @bac.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @band.update(band_params)\n format.html { redirect_to @band, notice: 'Band was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @band.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bap = Bap.find(params[:id])\n\n respond_to do |format|\n if @bap.update_attributes(params[:bap])\n format.html { redirect_to(@bap, :notice => 'Bap was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bap.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bounty.update(bounty_params)\n format.html { redirect_to @bounty, notice: 'Bounty was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bounty.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bouncer = Bouncer.find(params[:id])\n\n respond_to do |format|\n if @bouncer.update_attributes(params[:bouncer])\n format.html { redirect_to(@bouncer, :notice => 'URL was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bouncer.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @boat = Boat.find(params[:id])\n @boat.update({\n name: params[:boat][:name],\n maxcontainers: params[:boat][:maxcontainers],\n company_id: params[:boat][:company_id],\n location: params[:boat][:location],\n image: params[:boat][:image]\n })\n\n if (@boat)\n redirect_to url_for(:controller => :boats, :action => :index)\n else\n redirect_to url_for(:controller => :boats, :action => :edit)\n end\n end", "def update\n @admin_bait = Bait.find(params[:id])\n\n respond_to do |format|\n if @admin_bait.update_attributes(params[:admin_bait])\n format.html { redirect_to @admin_bait, notice: 'Bait was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_bait.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @singleb.update(singleb_params)\n format.html { redirect_to @singleb, notice: 'Singleb was successfully updated.' }\n format.json { render :show, status: :ok, location: @singleb }\n else\n format.html { render :edit }\n format.json { render json: @singleb.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bucket = current_user.buckets.find(params[:id])\n respond_to do |format|\n if @bucket.update_attributes(params[:bucket])\n flash[:notice] = 'Bucket was successfully updated.'\n format.html { redirect_to(@bucket) }\n format.xml { head :ok }\n format.iphone { redirect_to(@bucket) }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bucket.errors, :status => :unprocessable_entity }\n format.iphone { render :action => \"edit\", :layout => false}\n end\n end\n end", "def update\n @announcement = Announcement.find(params[:id])\n @announcement.title = params[:title]\n @announcement.description = params[:description]\n @announcement.price = params[:price]\n @announcement.photo = params[:photo]\n @announcement.latitude = params[:latitude]\n @announcement.longitude = params[:longitude]\n @announcement.subcategory_id = params[:subcategory_id]\n @announcement.place = params[:place]\n @announcement.save\n render json:@announcement\n end", "def assign_tenant_circles_to_an_aos_version_box(args = {}) \n body_put(\"/aosversions.json/aosversionbox/circles/#{args[:aosVersionBoxId]}\", args[:array_of_ids])\nend", "def update\n @bike = Bike.find(params[:id])\n\n respond_to do |format|\n if @bike.update_attributes(params[:bike])\n format.html { redirect_to @bike, notice: 'Bike was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bike.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @brace.update(brace_params)\n format.html { redirect_to @brace, notice: 'Brace was successfully updated.' }\n format.json { render :show, status: :ok, location: @brace }\n format.js { render :nothing => true }\n else\n format.html { render :edit }\n format.json { render json: @brace.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bid = Bid.find(params[:id])\n\n respond_to do |format|\n if @bid.update_attributes(params[:bid])\n format.html { redirect_to @bid, notice: 'Bid was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bid.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_api_v1_initiative_update\n @api_v1_initiative_update = Api::V1::InitiativeUpdate.find(params[:id])\n end", "def update\n respond_to do |format|\n if @kingsizeb.update(kingsizeb_params)\n format.html { redirect_to @kingsizeb, notice: 'Kingsizeb was successfully updated.' }\n format.json { render :show, status: :ok, location: @kingsizeb }\n else\n format.html { render :edit }\n format.json { render json: @kingsizeb.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bark.update(bark_params)\n format.html { redirect_to @bark, notice: \"Bark was successfully updated.\" }\n format.json { render :show, status: :ok, location: @bark }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @bark.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @c_bell.update(c_bell_params)\n format.html { redirect_to @c_bell, notice: 'C bell was successfully updated.' }\n format.json { render :show, status: :ok, location: @c_bell }\n else\n format.html { render :edit }\n format.json { render json: @c_bell.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @borad = Borad.find(params[:id])\n\n respond_to do |format|\n if @borad.update_attributes(params[:borad])\n format.html { redirect_to @borad, :notice => 'Borad was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @borad.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @businesstype = Businesstype.find(params[:id])\n\n respond_to do |format|\n if @businesstype.update_attributes(params[:businesstype])\n format.html { redirect_to @businesstype, notice: 'Businesstype was successfully updated.' }\n format.json { render :show, status: :ok, location: @businesstype }\n else\n format.html { render :edit }\n format.json { render json: @businesstype.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bid = Bid.find(params[:id])\n\n respond_to do |format|\n if @bid.update_attributes(params[:bid])\n format.html { redirect_to @admin_bid, notice: 'Bid was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_bid.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.6157716", "0.6148664", "0.59884095", "0.5978622", "0.59205586", "0.59054434", "0.5889828", "0.58284706", "0.5823825", "0.58017004", "0.5775168", "0.5769116", "0.57621264", "0.57563853", "0.5749602", "0.57227343", "0.57035214", "0.5693564", "0.56874055", "0.56814146", "0.5671128", "0.56490916", "0.56395614", "0.56385434", "0.56368625", "0.5634104", "0.56257355", "0.56238097", "0.56219304", "0.5615886", "0.5614925", "0.5614741", "0.56126106", "0.5603076", "0.56014854", "0.5599143", "0.559418", "0.5588304", "0.55785304", "0.5567124", "0.5561951", "0.5559116", "0.5546673", "0.5546434", "0.55392766", "0.5536895", "0.55249035", "0.551393", "0.5512595", "0.55125695", "0.5510166", "0.5508519", "0.5507909", "0.5507476", "0.55051965", "0.5499831", "0.5498336", "0.5497432", "0.5494187", "0.5492228", "0.5486175", "0.5486091", "0.5482043", "0.54786706", "0.54776055", "0.54773635", "0.54714495", "0.5468261", "0.54623616", "0.54576755", "0.5456356", "0.544924", "0.5444455", "0.5439303", "0.54385537", "0.54382545", "0.54376143", "0.54376143", "0.54367954", "0.54358524", "0.54355043", "0.5434133", "0.5433517", "0.5427346", "0.54264224", "0.5425422", "0.5424155", "0.54222125", "0.542038", "0.54128146", "0.54119873", "0.5411418", "0.5409756", "0.5407271", "0.54064715", "0.540412", "0.5402909", "0.53998375", "0.5396877", "0.53933704" ]
0.5630421
26
DELETE /bergains/1 DELETE /bergains/1.json
def destroy @bergain = Bergain.find(params[:id]) @bergain.destroy respond_to do |format| format.html { redirect_to bergains_url } 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 @basin = Basin.find(params[:id])\n @basin.destroy\n\n respond_to do |format|\n format.html { redirect_to basins_url }\n format.json { head :no_content }\n end\n end", "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def destroy\n @brag = Brag.find(params[:id])\n @brag.destroy\n\n respond_to do |format|\n format.html { redirect_to brags_url }\n format.json { head :no_content }\n end\n end", "def delete(id:)\n id_check(:id, id)\n\n cf_delete(path: \"/organizations/#{org_id}/railguns/#{id}\")\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n @broad = Broad.find(params[:id])\n @broad.destroy\n\n respond_to do |format|\n format.html { redirect_to broads_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bread.destroy\n respond_to do |format|\n format.html { redirect_to breads_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @banda = Banda.find(params[:id])\n @banda.destroy\n\n respond_to do |format|\n format.html { redirect_to bandas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bergain = Bergain.find(params[:id])\n @bergain.destroy\n\n respond_to do |format|\n format.html { redirect_to seller_bergains_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bbhk.destroy\n respond_to do |format|\n format.html { redirect_to bbhks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @baton = Baton.find(params[:id])\n @baton.destroy\n\n respond_to do |format|\n format.html { redirect_to batons_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @boc.destroy\n respond_to do |format|\n format.html { redirect_to bocs_url, notice: 'Boc was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @bath.destroy\n respond_to do |format|\n format.html { redirect_to baths_url, notice: 'Bath was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @bustour.destroy\n respond_to do |format|\n format.html { redirect_to bustours_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Alien.delete(params[\"id\"])\n end", "def destroy\n @brave_burst.destroy\n respond_to do |format|\n format.html { redirect_to brave_bursts_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 @bacon.destroy\n respond_to do |format|\n format.html { redirect_to bacons_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bow.destroy\n respond_to do |format|\n format.html { redirect_to bows_url }\n format.json { head :no_content }\n end\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def destroy\n @bb = Bb.find(params[:id])\n @bb.destroy\n\n respond_to do |format|\n format.html { redirect_to bbs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @basis = Base.find(params[:id])\n @basis.destroy\n\n respond_to do |format|\n format.html { redirect_to bases_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bicicletum.destroy\n respond_to do |format|\n format.html { redirect_to bicicleta_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @baggage = Baggage.find(params[:id])\n @baggage.destroy\n\n respond_to do |format|\n format.html { redirect_to baggages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @b = B.find(params[:id])\n @b.destroy\n\n respond_to do |format|\n format.html { redirect_to bs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @betraege = Betraege.find(params[:id])\n @betraege.destroy\n\n respond_to do |format|\n format.html { redirect_to betraeges_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @borad = Borad.find(params[:id])\n @borad.destroy\n\n respond_to do |format|\n format.html { redirect_to borads_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bodega.destroy\n respond_to do |format|\n format.html { redirect_to bodegas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @borc = Borc.find(params[:id])\n @borc.destroy\n\n respond_to do |format|\n format.html { redirect_to borcs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @rb.destroy\n respond_to do |format|\n format.html { redirect_to rbs_url, notice: 'Erfolgreich gelöscht.' }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Company.delete(params[\"id\"])\n end", "def destroy\n @banda.destroy\n respond_to do |format|\n format.html { redirect_to bandas_url, notice: 'Banda was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @bla = Bla.find(params[:id])\n @bla.destroy\n\n respond_to do |format|\n format.html { redirect_to blas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bac.destroy\n respond_to do |format|\n format.html { redirect_to bacs_url, notice: 'Bac was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @bb.destroy\n respond_to do |format|\n format.html { redirect_to bbs_url, notice: 'Bb was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @lob.destroy\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end", "def destroy\n return if new_record?\n \n @api.delete \"/items/#{shortcode_url}.json\"\n end", "def destroy\n @bikestand.destroy\n respond_to do |format|\n format.html { redirect_to bikestands_url, notice: 'Bikestand was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @boat = Boat.find(params[:id])\n remove_reknro_from_berth\n @boat.destroy\n\n respond_to do |format|\n format.html { redirect_to boats_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bounty.destroy\n respond_to do |format|\n format.html { redirect_to bounties_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @catebg = Catebg.find(params[:id])\n @catebg.destroy\n\n respond_to do |format|\n format.html { redirect_to catebgs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @blast = Blast.find(params[:id])\n @blast.destroy\n\n respond_to do |format|\n format.html { redirect_to blasts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bl = Bl.find(params[:id])\n @bl.destroy\n\n respond_to do |format|\n format.html { redirect_to bls_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @banner = Banner.find(params[:id])\n @banner.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_banners_url }\n format.json { head :no_content }\n end\n end", "def delete\n api_client.delete(url)\n end", "def destroy\n @admin_bait = Bait.find(params[:id])\n @admin_bait.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_baits_url }\n format.json { head :ok }\n end\n end", "def delete\n client.delete(url)\n @deleted = true\nend", "def destroy\n @bruschettum = Bruschettum.find(params[:id])\n @bruschettum.destroy\n\n respond_to do |format|\n format.html { redirect_to bruschetta_url }\n format.json { head :ok }\n end\n end", "def destroy\n @braider.destroy\n respond_to do |format|\n format.html { redirect_to braiders_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @blar.destroy\n respond_to do |format|\n format.html { redirect_to blars_url }\n format.json { head :no_content }\n end\n end", "def destroy\n client=Client.find_by_id(params[:id])\n if client != nil\n if client.destroy\n head 204\n end\n else\n head 404\n end\n end", "def destroy\n @Bouquets = Bouquet.find(params[:id])\n @Bouquets.destroy\n\n respond_to do |format|\n format.html { redirect_to bouquets_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @roadblock.destroy\n respond_to do |format|\n format.html { redirect_to \"/roadblocks-dash\" }\n format.json { head :no_content }\n end\n end", "def delete\n request(:delete)\n end", "def destroy\n @singleb.destroy\n respond_to do |format|\n format.html { redirect_to singlebs_url, notice: 'Singleb was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @bdatabase = Bdatabase.find(params[:id])\n @bdatabase.destroy\n\n respond_to do |format|\n format.html { redirect_to bdatabases_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bloom = Bloom.find(params[:id])\n @bloom.destroy\n\n respond_to do |format|\n format.html { redirect_to blooms_url }\n format.json { head :no_content }\n end\n end", "def delete path\n make_request(path, \"delete\", {})\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 @bouncer = Bouncer.find(params[:id])\n @bouncer.destroy\n\n respond_to do |format|\n format.html { redirect_to(bouncers_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @banner = Banner.find(params[:id])\n @banner.destroy\n\n respond_to do |format|\n format.html { redirect_to admins_banners_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @kb = Kb.find(params[:id])\n @kb.destroy\n\n respond_to do |format|\n format.html { redirect_to kbs_url }\n format.json { head :ok }\n end\n end", "def destroy\n @climb_datum = ClimbDatum.find(params[:id])\n @climb_datum.destroy\n\n respond_to do |format|\n format.html { redirect_to climb_data_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @gaz_assay = GazAssay.find(params[:id])\n @gaz_assay.destroy\n\n respond_to do |format|\n format.html { redirect_to gaz_assays_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @brew.destroy\n respond_to do |format|\n format.html { redirect_to brews_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bike = Bike.find(params[:id])\n @bike.destroy\n\n respond_to do |format|\n format.html { redirect_to bikes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @cage.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @bdig = Bdig.find(params[:id])\n @bdig.destroy\n\n respond_to do |format|\n format.html { redirect_to(bdigs_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @band.destroy\n respond_to do |format|\n format.html { redirect_to bands_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bay.destroy\n respond_to do |format|\n format.html { redirect_to bays_url, notice: 'La bahía fue eliminada exitosamente.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @bahan = Bahan.find(params[:id])\n @bahan.destroy\n\n respond_to do |format|\n format.html { redirect_to bahans_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @sugar_bag = SugarBag.find(params[:id])\n @sugar_bag.destroy\n\n respond_to do |format|\n format.html { redirect_to sugar_bags_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bagel.destroy\n respond_to do |format|\n format.html { redirect_to bagels_url, notice: 'Bagel was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @gatha.destroy\n respond_to do |format|\n format.html { redirect_to gathas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bok.destroy\n respond_to do |format|\n format.html { redirect_to boks_url, notice: 'Bok was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @blocking_client = BlockingClient.find(params[:id])\n @blocking_client.destroy\n\n respond_to do |format|\n format.html { redirect_to blocking_clients_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 delete(object)\n full_name = extract_full_name object\n post 'api/del', :id => full_name\n end", "def destroy\n @bogey = Bogey.find(params[:id])\n @bogey.destroy\n\n respond_to do |format|\n format.html { redirect_to(bogeys_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @crate.destroy\n respond_to do |format|\n format.html { redirect_to tenant_crates_url, notice: 'Crate was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @bacground.destroy\n respond_to do |format|\n format.html { redirect_to bacgrounds_url, notice: 'Bacground was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n api(\"Delete\")\n end", "def destroy\n @spkj_bsb = SpkjBsb.find(params[:id])\n @spkj_bsb.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/spkj_bsbs\" }\n format.json { head :no_content }\n end\n end", "def delete(options={})\n connection.delete(\"/\", @name)\n end", "def destroy\n @ba.destroy\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end", "def destroy\n @beacon = Beacon.find(params[:id])\n @beacon.destroy\n\n respond_to do |format|\n format.html { redirect_to beacons_url }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @sivic_banco.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_bancos_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @bussiness.destroy\n respond_to do |format|\n format.html { redirect_to bussinesses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @borrow_request = BorrowRequest.find(params[:id])\n @borrow_request.destroy\n\n respond_to do |format|\n format.html { redirect_to borrow_requests_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bap = Bap.find(params[:id])\n @bap.destroy\n\n respond_to do |format|\n format.html { redirect_to(baps_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @borrow = Borrow.find(params[:id])\n @borrow.destroy\n\n respond_to do |format|\n format.html { redirect_to borrows_url }\n format.json { head :ok }\n end\n end", "def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end", "def destroy\n @c_bell.destroy\n respond_to do |format|\n format.html { redirect_to c_bells_url, notice: 'C bell was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @bid = Bid.find(params[:id])\n @bid.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/admin/transaction\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @loadbalancer = Loadbalancer.find(params[:id])\n checkaccountobject(\"loadbalancers\",@loadbalancer)\n @loadbalancer.send_delete\n\n respond_to do |format|\n format.html { redirect_to loadbalancers_url }\n format.json { head :ok }\n end\n end", "def destroy\n @brain = Brain.find(params[:id])\n @brain.destroy\n\n respond_to do |format|\n format.html { redirect_to brains_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.7010904", "0.6948655", "0.6948579", "0.6903388", "0.6857917", "0.68468", "0.68303293", "0.6809724", "0.67643577", "0.6750448", "0.6746637", "0.67357963", "0.67311996", "0.6713396", "0.6712906", "0.6710447", "0.6694126", "0.66836226", "0.66836226", "0.66836226", "0.66836226", "0.6659782", "0.665135", "0.6639663", "0.6621965", "0.66177577", "0.6600588", "0.6594457", "0.65868056", "0.6586755", "0.6574035", "0.6572406", "0.65701836", "0.6544184", "0.65404", "0.65379375", "0.65361166", "0.65338", "0.65286046", "0.65142107", "0.65140885", "0.6512148", "0.651028", "0.6507922", "0.6507221", "0.6504102", "0.64923733", "0.64866316", "0.6472759", "0.6471341", "0.64632183", "0.64606375", "0.64575464", "0.64559174", "0.6450197", "0.6444766", "0.64434546", "0.6440102", "0.6436458", "0.64342993", "0.64280605", "0.64274687", "0.6425994", "0.6413339", "0.6412108", "0.6410182", "0.6408914", "0.6408386", "0.6397281", "0.63969785", "0.6391612", "0.639043", "0.6388838", "0.63888085", "0.63776195", "0.6375873", "0.637252", "0.63661563", "0.63647807", "0.63555545", "0.6354987", "0.6353591", "0.63525224", "0.63491493", "0.63488024", "0.6348623", "0.6347536", "0.63457495", "0.63435006", "0.6342262", "0.6340815", "0.6339292", "0.633812", "0.63379335", "0.63378775", "0.6337529", "0.63368815", "0.6334132", "0.633295", "0.632472" ]
0.6936367
3
called by from_mongo and to_mongo
def mongo_encode(doc, pattern, replacement, date_conv) if doc.is_a? Hash doc.keys.each do |key, value| new_key = key if key.is_a?(String) && key =~ pattern new_key = key.sub(pattern, replacement) doc[new_key] = value doc.delete key end mongo_encode(value, pattern, replacement, date_conv) ensure_date_encoding(value, doc, new_key, date_conv) doc[new_key] = value.to_s if value.is_a? Symbol end elsif doc.is_a? Array doc.each_with_index do |entry, i| mongo_encode(entry, pattern, replacement, date_conv) ensure_date_encoding(entry, doc, i, date_conv) doc[i] = entry.to_s if entry.is_a? Symbol end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mongoize(object)\n object.mongoize\n end", "def to_bson\n end", "def mongoize\n self\n end", "def mongoize(object)\n case\n when object.is_a?(Mongoid::Snappy) then object.mongoize\n when object.is_a?(String) then Mongoid::Snappy.new(object).mongoize\n else object\n end\n end", "def mongoize\n ::Hash.mongoize(self)\n end", "def mongoize(object)\n case object\n when Point\n object.mongoize\n when Array, Hash\n new(object).mongoize\n else\n object\n end\n end", "def mongoize(object)\n case object\n when Interval then object.mongoize\n when Hash then Interval.new(object).mongoize\n else object\n end\n end", "def mongoize(object)\n return nil if object.nil?\n case object\n when self\n object.mongoize\n else\n object\n end\n end", "def to_bson\n #----------\n self\n end", "def to_bson\n #----------\n self\n end", "def to_bson\n #----------\n self\n end", "def mongoize(object)\n return if object.blank?\n if Mongoid.map_big_decimal_to_decimal128\n if object.is_a?(BSON::Decimal128)\n object\n elsif object.is_a?(BigDecimal)\n BSON::Decimal128.new(object)\n elsif object.numeric?\n BSON::Decimal128.new(object.to_s)\n elsif !object.is_a?(String)\n object.try(:to_d)\n end\n else\n if object.is_a?(BSON::Decimal128) || object.numeric?\n object.to_s\n elsif !object.is_a?(String)\n object.try(:to_d)&.to_s\n end\n end\n end", "def mongoize(object)\n return nil if object.nil?\n case object\n when self\n object.mongoize\n else\n object\n end\n end", "def mongoize(object)\n return nil if object.nil?\n case object\n when self\n object.mongoize\n else\n object\n end\n end", "def to_bson\n to_h.to_bson\n end", "def mongoize(object)\n return nil if object.nil?\n case object\n when self\n object.mongoize\n when Hash\n demongoize(object).mongoize\n else\n object\n end\n end", "def to_mongo(doc)\n\n # vertical tilde and ogonek to the rescue\n\n rekey(doc) { |k| k.to_s.gsub(/^\\$/, 'ⸯ$').gsub(/\\./, '˛') }\n end", "def mongoize(object)\n case object\n when Money then object.mongoize\n when Hash then Money.new(object[:cents].to_i, object[:currency]).mongoize\n else object\n end\n end", "def mongoize(object)\n case object\n when Point then object.mongoize\n when Hash then Point.new(object[:x], object[:y]).mongoize\n else object\n end\n end", "def mongoize(object)\n case object\n when Array then MongoizedLine.new(object).mongoize\n else object\n end\n end", "def mongoize(object)\n return nil if object.nil?\n case object\n when self\n object.mongoize\n when Array\n demongoize(object).mongoize\n else\n object\n end\n end", "def mongo_load_all search_results=search_all(), json_class_mapper=JSON_CLASS_MAPPER\n search_results.each_with_index do |data_set,i|\n puts \"#{i}: #{data_set}\"\n puts data_set[\"type\"]\n mm_class=( json_class_mapper[data_set[\"type\"]].to_sym or json_class_mapper[data_set[:type]])\n puts \"mm_class=#{mm_class}\"\n #puts \"data set type=#{data_set[:type]}\"\n puts \"class =#{mm_class}\"\n query=make_query data_set\n puts \"query= #{query}\"\n #query= {:case_n=>\"RS-SV-05-16335\", :cd_type=>\"CD8\", :tile=>\"CT4\"}\n if mm_class.where(query).all.empty?\n mm_object=mm_class.create data_set\n puts \"mm created #{mm_object}\"\n else\n # upserts if entry pre-existing\n mm_class.set(query, data_set, :upsert => true )\n puts \"uspsert created #{mm_object}\"\n mm_object=mm_class.where(data_set).find_one\n end\n #binding.pry\n mm_object.get_cd\n mm_object.save\n \n end\n puts \"\\n\\n\\n\"\n puts \"finished uploading to databes\"\nend", "def from_mongo(docs)\n\n rekey(docs) { |k| k.gsub(/^ⸯ\\$/, '$').gsub(/˛/, '.') }\n end", "def mongoize(object)\n #EncryptedFields.logger.debug \"#{name}##{__method__.to_s}: #{object.inspect}\"\n case\n when object.is_a?(self.class)\n object.mongoize\n when object.blank? || is_encrypted?(object)\n object\n else\n convert(object).mongoize\n end\n end", "def merge_mongo_and_solr(collection, resp)\n\t\t\tsolr_objects = resp['response']['docs']\n\t\t\tmkey,skey = @mongo_match_by.split(\"::\")\n collection.each_with_index do |document,index|\n\t\t\t\tmid = document.fetch(\"#{mkey}\")\n sdoc = solr_objects.find {|sd| sd[\"#{skey}\"] == \"#{mid}\"}\n for pkey in @mongo_projection_keys.split(\",\")\n if document.has_key?(\"#{pkey}\")\n sdoc[\"#{pkey}\"] = document.fetch(\"#{pkey}\")\n end\n end\n end\n\t\t\tresp['response']['docs'] = solr_objects\n\t\t\treturn resp\n\t\tend", "def mongoize\n {:name=>@name, :place=>@place}\n end", "def mongoize\n {:city=>@city, :state=>@state, :loc=>@location.mongoize}\n end", "def mongoize\n {:city=>@city, :state=>@state, :loc=>@location.mongoize}\n end", "def mongoize(object)\n case object\n when self\n object.mongoize\n when Hash\n h = object.deep_stringify_keys\n return self.new.mongoize if h[\"loc\"].blank?\n\n h[\"loc\"] = Map::Extensions::Loc.mongoize(h[\"loc\"])\n if h[\"zoom_level\"].present?\n h[\"zoom_level\"] = Integer(h[\"zoom_level\"]) rescue nil\n end\n ret = self.new\n ret.merge!(h)\n ret.mongoize\n else object\n end\n end", "def mongoize(object)\n case object\n when Expert then object.mongoize\n when Hash then Expert.new(object[:name], object[:quote], object[:image_url]).mongoize\n else object\n end\n end", "def mongoize\n return if values.blank?\n values.map { |value| value.mongoize }\n end", "def mongoize\n {:city=>@city, :state=>@state, :loc=>Point.mongoize(@location)}\n end", "def mongoize\n \t{\n \t\t:city => @city,\n \t\t:state => @state,\n :loc => @location.mongoize\n \t}\n end", "def mongoize(object)\n case object\n when self then object.mongoize\n when Symbol then new(object).mongoize\n else object\n end\n end", "def evolve(object)\n case object\n when Mongoid::Snappy then object.mongoize\n when String then Mongoid::Snappy.new(object).mongoize\n else object\n end\n end", "def mongoize(object)\n return if object.nil?\n case object\n when ::Array, ::Set\n object.map(&:mongoize)\n end\n end", "def mongoize\n [x, y]\n end", "def merge_mongo_and_solr(collection, resp)\n solr_objects = resp['response']['docs']\n mkey,skey = @mongo_match_by.split(\"::\")\n collection.each_with_index do |document,index|\n mid = document.fetch(\"#{mkey}\")\n sdoc = solr_objects.find {|sd| sd[\"#{skey}\"] == \"#{mid}\"}\n if sdoc.nil?\n log.warn \"Solr document with #{skey}: #{mid} not found\"\n else\n for pkey in @mongo_projection_keys.split(\",\")\n if document.has_key?(\"#{pkey}\")\n sdoc[\"#{pkey}\"] = document.fetch(\"#{pkey}\")\n end\n end\n end\n end\n resp['response']['docs'] = solr_objects\n return resp\n end", "def update_without_callbacks\n self.class.collection.save(to_mongo_value)\n end", "def mongoize(object)\n case object\n when Quantity\n object.mongoize\n when Numeric\n self.new(object).mongoize\n else\n object\n end\n end", "def mongoize\n\t{:type => 'Point', :coordinates => [@longitude, @latitude]}\nend", "def mongoize(object_id)\n object_id\n end", "def mongoize(object_id)\n object_id\n end", "def mongoize\n { name: name, quote: quote, image_url: image_url }\n end", "def mongoize\n ::Array.mongoize(self)\n end", "def mongoize\n \t\treturn {:city=>@city,:state=>@state,:loc=>Point.mongoize(@location)}\n \tend", "def to_bson\n NO_VALUE\n end", "def serialize_default(object)\n mongoize(object)\n end", "def mongoize(object)\n case object\n when nil then nil\n when QDM::Code then object.mongoize\n when Hash\n object = object.symbolize_keys\n QDM::Code.new(object[:code], object[:system], object[:display], object[:version]).mongoize\n else object\n end\n end", "def evolve(object)\n mongoize(object)\n end", "def mongoize(object)\n case object\n when RussianPhone::Number then object.mongoize\n when String then RussianPhone::Number.new(object, @options).mongoize\n else object\n end\n end", "def mongoize\n\t\treturn {:city=>@city,:state=>@state,:loc=>Point.mongoize(@location)}\n\tend", "def cast_value\n value.mongoize\n end", "def mongoize(object)\n case\n when object.is_a?(Money) then object.mongoize(object)\n when object.is_a?(Hash) then\n object.symbolize_keys! if object.respond_to?(:symbolize_keys!)\n value = ::Money.new(object[:cents], object[:currency_iso] || Money.default_currency.iso_code)\n value.mongoize(object)\n when object.respond_to?(:to_money) then\n return if object.is_a?(String) && object.blank?\n object.to_money.mongoize(object)\n else object\n end\n end", "def __mongoize_object_id__\n map!(&:__mongoize_object_id__).compact!\n self\n end", "def to_bson\n #----------\n self.map { | element | element.to_bson }\n end", "def mongoize(object)\n case object\n when TimeOfDay then object.mongoize\n else object\n end\n end", "def evolve(object)\n case object\n when self then object.mongoize\n when Symbol then mongoize(object)\n else object\n end\n end", "def mongoize\n ::Date.mongoize(self)\n end", "def demongoize(object)\n object\n end", "def get_extra_from_mongo\n ids = @require_merge.join(\",\").split(\",\")\n\t\t\tcollection = @mongo_client[:\"#{mongo_collection_type}\"].find(:\"#{mongo_query_key}\" => {:$in => ids})\n\t\t\tif !@mongo_projection_keys.empty?\n\t\t\t\tpkeys = {}\n\t\t\t\tfor key in @mongo_projection_keys.split(\",\")\n\t\t\t\t\tpkeys[key] = 1\n\t\t\t\tend\n\t\t\t\tcollection = collection.projection(pkeys)\n\t\t\tend\n @require_merge.clear\n\t\t\treturn collection\n\t\tend", "def evolve(object)\n object.respond_to?(:x) ? object.mongoize : object\n end", "def __bson_load__(io); self; end", "def mongoize\n @@value_map[value]\n end", "def mongoize_queries(queries)\n # delete any information not needed by/compatible with Mongoid execution\n mongoized_queries = queries.dup\n mongoized_queries.each_pair do |name, details|\n # have to dup the query details to avoid changing the original hashes\n mongoized_queries[name] = details.dup.tap {|t| t.delete(:klass) }\n end\n end", "def populatemongonetwork\n \n db = Mongo::Connection.new(\"localhost\", 27017).db(\"networks\")\n \n #coll = db.collection(\"masterNetwork\")\n \n Network.where(\"degree=1\").find_each(:batch_size => 5000) do |network| \n coll = db.collection(network['facebook_id'])\n #doc = {\"_id\"=> User.find_by_facebook_id(network['friend_id']).id, \"d\"=>network['degree']}\n doc = {\"_id\"=> network['friend_id'], \"d\"=>network['degree']}\n coll.insert(doc) \n end\n \nend", "def to_bson\n data.bytesize.to_bson + SUBTYPES.fetch(type) + data\n end", "def mongoize\n ::BigDecimal.mongoize(self)\n end", "def evolve(object)\n case object\n when RussianPhone::Number then object.mongoize\n else object\n end\n end", "def mongoize\n loc = self.loc\n return {} if loc.nil?\n\n ret = { \"loc\" => loc.mongoize }\n ret[\"zoom_level\"] = zoom_level if zoom_level.present?\n ret\n end", "def encode(data); ::BSON.serialize(data).to_s; end", "def to_bson_normalized_value\n map(&:to_bson_normalized_value)\n end", "def export_mongo\n # defined in immunoscore_results_loader\n JSON_CLASS_MAPPER.values.each do |mm_class|\n mm_class.all.each do |mm_object|\n puts \"#{mm_object}: #{mm_object[:case_n]}\"\n next unless mm_object[:case_n] != nil\n case_dir=(EXPORT_DIR+\"/\"+ mm_object[:case_n]) \n Dir.mkdir case_dir unless Dir.exist?(case_dir)\n fh=export_file case_dir, mm_object[:path]\n fh.write(mm_object[:data_load])\n fh.close\n \n end\n end\nend", "def json2mongo(db = \"citeulike\", col = \"articles\", user = \"neils\")\n require \"mongo\"\n require \"json/pure\"\n require \"open-uri\"\n\n puts \"Fetching JSON...\"\n db = Mongo::Connection.new.db(db)\n col = db.collection(col)\n url = \"http://www.citeulike.org/json/user/\" + user\n j = JSON.parse(open(url).read)\n j.each do |article|\n article[:_id] = article['article_id']\n col.save(article)\n end\n puts \"Done. Collection contains: #{col.count} articles.\"\nend", "def mongoize(object)\n { ::I18n.locale.to_s => type.mongoize(object) }\n end", "def queryAndConvert() \n\t\tres = self.query()\n\t\treturn res.convert()\n end", "def bson_type\n BSON_TYPE\n end", "def bson_type\n BSON_TYPE\n end", "def bson_type\n BSON_TYPE\n end", "def bson_type\n BSON_TYPE\n end", "def bson_type\n BSON_TYPE\n end", "def evolve(object)\n case object\n when QDM::Date then object.mongoize\n else object\n end\n end", "def to_mongo_value\n h = {}\n self.class.column_names.each {|iv|\n val = read_attribute(iv)\n h[iv] = val == nil ? nil : val.to_mongo_value\n }\n h\n end", "def wiki_page_scrap_and_save_to_mongo\n page_infos = wiki_page_scrap\n\n #PUT THE COLLECTED TEXT INTO A MONGO_DB\n mongo = get_mongo\n collection = mongo[$mongo_wiki_scrap_collection_name]\n\n #REMOVE OLD CACHE DATA\n collection.remove\n #PUT NEW SCRAP DATA TO MONGO\n collection.insert page_infos\nend", "def mongo_value\n value\n end", "def mongoize(raw = nil)\n result = {\n :cents => cents,\n :currency_iso => currency.iso_code\n }\n result[:raw] = raw unless raw.nil?\n result\n end", "def bson_to_hash(bson_hash)\n new_hash = {}\n bson_hash.each_key do\n |k|\n if bson_hash[k].class == BSON::OrderedHash\n new_hash[k] = bson_to_hash(bson_hash[k])\n else\n new_hash[k] = bson_hash[k]\n end\n end\n new_hash\n end", "def to_bson(buffer = ByteBuffer.new)\n as_json.to_bson(buffer)\n end", "def mongoize(object)\n unless object.blank?\n time = object.__mongoize_time__\n ::Time.utc(time.year, time.month, time.day)\n end\n end", "def converters; end", "def converters; end", "def converters; end", "def index\n @products = Product.all\n # @product = Product.where(:created_at.lte => Date.today).group_by {|d| d.created_at.strftime(\"%d-%m-%y\")}\n respond_to do |format|\n @products_bson1 = []\n @products_bson2 = []\n @products.each do |pro|\n @products_bson = BSON::Document.new(pro.attributes)\n @products_bson1.push(@products_bson)\n @products_bson2 = @products_bson1.to_bson\n format.html # index.html.erb\n format.bson { render json: @products_bson2 }\n format.json { render json: @products }\n format.xml { render xml: @products }\n end\n end\nend", "def __evolve_time__\n __mongoize_time__.utc\n end", "def to_bson\n [ self ].pack(bson_pack_directive)\n end", "def convert_filter_to_mongo_query(filter) \n filter\n end", "def cast_with_mongo_mapper(object, type)\n cast = cast_without_mongo_mapper(object, type)\n if defined?(::MongoMapper::Document)\n if object.is_a?(Class) && (object.ancestors & [ ::MongoMapper::Document, ::MongoMapper::EmbeddedDocument ]).size > 0\n cast = :mongo_mapper_class\n elsif (object.class.ancestors & [ ::MongoMapper::Document, ::MongoMapper::EmbeddedDocument ]).size > 0\n cast = :mongo_mapper_instance\n elsif object.is_a?(::BSON::ObjectId)\n cast = :mongo_mapper_bson_id\n end\n end\n cast\n end", "def export_to_collection(matched_crime)\n doc_to_export = []\n matched_crime.each do |document|\n doc_to_export = document\n end\n result = export.insert_one(doc_to_export)\n puts \"Zapisano w kolekcji crime_export\"\nend", "def convert(object); end", "def move_data_from_redis_to_mongo(at_once=true)\n if at_once\n # multiple records will be inserted to mongodb at once\n # this is to minimize the index creation time\n values = []\n redis_keys = []\n redis_record.freezed_keys.each do |redis_key|\n values << redis_record.formatted_parsed_get_for_mongo(redis_key)\n redis_keys << redis_key\n end\n mongoid_doc_model.create(values)\n redis_record.del(*redis_keys) if redis_keys.size > 0\n\n redis_keys.size\n else\n # records will be inserted to mongo one at a time\n # corresponding key from redis will be deleted only after successful creation of mongodb record\n moved_keys = redis_record.freezed_keys.select do |redis_key|\n value = redis_record.formatted_parsed_get_for_mongo(redis_key)\n mongo_doc = mongoid_doc_model.create(value)\n redis_record.del redis_key if mongo_doc\n mongo_doc\n end\n\n moved_keys.size\n end\n end" ]
[ "0.7504447", "0.7148762", "0.71047854", "0.69025415", "0.689388", "0.6807194", "0.676496", "0.67459154", "0.6657754", "0.6657754", "0.6657754", "0.6623584", "0.6592588", "0.6592588", "0.65590405", "0.65503675", "0.65356696", "0.65197194", "0.65102273", "0.64719474", "0.6440073", "0.6435766", "0.6418084", "0.6409242", "0.6391045", "0.63908297", "0.63786817", "0.63786817", "0.63743234", "0.6371137", "0.6369528", "0.6367318", "0.6367283", "0.6359297", "0.6335795", "0.62698984", "0.62521535", "0.6239314", "0.62258667", "0.6222566", "0.6211392", "0.61995226", "0.61995226", "0.6199288", "0.6188517", "0.61751425", "0.6174967", "0.6149643", "0.6149189", "0.6129812", "0.61156374", "0.60983753", "0.6091928", "0.60314775", "0.60305685", "0.6030047", "0.6019046", "0.6006537", "0.5980376", "0.59780794", "0.5958618", "0.59249103", "0.59184563", "0.5908244", "0.58571714", "0.5842705", "0.5832173", "0.5793799", "0.57821774", "0.5758102", "0.57490593", "0.5745075", "0.5734671", "0.5729643", "0.57291275", "0.56863445", "0.5669164", "0.5667387", "0.5667387", "0.5667387", "0.5667387", "0.5667205", "0.5661813", "0.56435406", "0.5641911", "0.5635392", "0.56195205", "0.56186455", "0.5614211", "0.5593261", "0.5593261", "0.5593261", "0.5592644", "0.5581554", "0.55788016", "0.5570995", "0.55625767", "0.5551234", "0.5539743", "0.55257535" ]
0.5941079
61
Metodo toString para mostrar por pantalla los atributos de la clase
def to_s resp = "\nNombre: #{name} \tNivel: #{combat_level}" if(level_change_against_cultist_player != 0) resp += "\nNivel contra sectarios: " + get_level_change_against_cultist_player.to_s end resp += "\nNiveles que ganas: #{get_levels_gained}" + "\tTesoros que ganas: #{get_treasures_gained}" + "\nMal rollo: " + bad_consequence.to_s end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 attrs = self.class.attributes.map do |attr|\n \"#{attr.name}=#{self.send(attr.name)}\"\n end.join(', ')\n\n \"[#{self.class.name.split('::').last}] #{attrs}\"\n end", "def inspect\n \"#<#{self.class.name}: #{to_s}>\"\n end", "def to_s\n \"#{self.class} #{self.name}\"\n end", "def to_s\n \"#{self.class.name} #{name}\"\n end", "def to_s()\n\t\t\t\"#{self.class} (#{self.__id__}):\"\n\t\tend", "def inspect\n %{<#{self.class.name} #{self.class.props.reduce([]) do |s, d| \n s << [d.first, send(d.first).inspect].join(\"=\")\n end.join(\" \")}>}\n end", "def inspect\n \"#<#{self.class.name}: #{to_s}>\"\n end", "def to_s\n\t\tsuper().to_s +\n\t\t\" -- Talla: #{@talla} -- Circunferencia Cintura: #{@circun_cintu} -- Circunferencia Cadera: #{@circun_cadera}\"\n\tend", "def toString\n\t\tputs Persona.get_info\n\tend", "def to_s\n super\n end", "def to_s\n super\n end", "def inspect\n \"#<#{self.class.inspect}(#{@name})>\"\n end", "def to_s\n\t\t\"#{self.name}\"\n\tend", "def inspect\n return \"#<#{self.class.name}: #{self.name}>\"\n end", "def to_s\n\t\tsuper\n\tend", "def to_s\r\n \"#{self.name}, #{self.credits}\"\r\n end", "def inspect\n self.to_s\n end", "def inspect\n self.to_s\n end", "def to_s\n # Start with the name\n string = sprintf \"%-9s\", \"#{self.name}:\"\n # Print the attr mods\n self.raceattrs.each do |a|\n string += sprintf \" %s %+i,\", a.short, a.value if a.value != 0\n end\n return string.chomp(\",\")\n end", "def to_s; description end", "def to_s\n \"#{self.artist.name} - #{self.name} - #{self.genre.name}\"\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 inspect\n vals = ATTRS.map { |field| \"#{field}: #{public_send(field).inspect}\" }\n \"#<#{self.class.name} #{vals.join(', ')}>\"\n end", "def to_s\n self.name || super\n end", "def to_s\n self.name || super\n end", "def inspect\n result = \"#{self.class}[\"\n each_with_index { |obj, i| result << ', ' if i > 0; result << obj.inspect }\n result << \"]\"\n end", "def inspect\n to_s.inspect\n end", "def to_s\n \"#{self.name}, #{self.credits}\"\n end", "def inspect\n \"#<#{self.class.name || 'AnonymousClass'} \" + self.class.attribute_names.map do |name|\n val = self.send(name)\n val_display = if val.is_a?(String)\n %Q(\"#{val}\")\n elsif val.nil?\n 'nil'\n elsif val.is_a?(DateTime)\n val.utc.iso8601(3)\n elsif val.is_a?(Enumerable) && val.empty?\n '[]'\n else\n val.to_s\n end\n \"#{name}: #{val_display}\"\n end.join(', ') + '>'\n end", "def to_s\n return '#<' + self.class.to_s + \":\" + self.name + '>'\n end", "def to_s\n raise 'To be implemented in child classes'\n end", "def inspect\n to_s\n end", "def inspect\n to_s\n end", "def inspect\n return \"#<#{self.class.name}: #{self}>\"\n end", "def inspect\n att_info = []\n inspect_attributes.each do |att|\n next unless respond_to? att\n\n att_info << \"#{att}=#{send(att).inspect}\"\n end\n att_info << '..'\n \"\\#<#{self.class}:#{object_id} #{att_info.join(', ')}>\"\n end", "def to_s\n self.name.to_s || super\n end", "def to_s\n \"#{self.class.name} (#{id})#{candy.inspect}\"\n end", "def inspect\n \"#<#{self.class.name.split('::').last} - #{@properties}>\"\n end", "def to_s\n self.methods.each { |m| puts self.m }\n end", "def to_s()\n desc = \"person(\" + @id.to_s() + \",\" + @name\n if (@style != \"\")\n desc += \",\" + @style\n end\n desc += \",\" + @allegiance.to_s()\n desc += \",\" + @faction.to_s()\n desc += \",\" + @faction_for_chapter.to_s()\n if (@note != \"\")\n desc += \",\" + @note\n end\n desc += \")\"\n return desc\n end", "def to_s\n %(<#{ @name }#{attributes}>)\n end", "def inspect\n to_s\n end", "def to_s\n \"#<#{self.class.name}:#{object_id}> @names=#{names}>\"\n end", "def inspect\n return self.to_s\n end", "def to_s\n self.inspect\n end", "def inspect\n \"#{self.class}<#{@description.inspect}>\"\n end", "def toString\n\t\tself.instance_variables.each do |i|\n\t\t\tputs \"#{i[1..-1]}: #{self.instance_variable_get(i)}\\n\"\n\t\tend\n\tend", "def toString\n\t\tself.instance_variables.each do |i|\n\t\t\tputs \"#{i[1..-1]}: #{self.instance_variable_get(i)}\\n\"\n\t\tend\n\tend", "def inspect\n \"#{self.class}(#{to_s.inspect})\"\n end", "def to_s\n\t\t\"Nombre:#{@nombre}\\nEdad:#{@edad}\\nGenero:#{@genero}\\nImc:#{@imc}\\n%Grasa:#{@grasa}\\nRcc:#{@rcc}\"\n\tend", "def to_s\n \"#{self.class.to_s}::<#{object_id}> Args: #{args}\"\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 return \"#{self.name}\"\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 inspect\n attributes_as_nice_string = ([\"id\"] + self.class.attributes).collect { |name|\n \"#{name}: #{send(name).inspect}\"\n }.compact.join(\", \")\n \"#<#{self.class} #{attributes_as_nice_string}>\"\n end", "def to_s\n \"#{DbAgile::RubyTools::unqualified_class_name(self.class)}: #{name} #{definition.inspect}\"\n end", "def to_s\n \"#{@name}, \" \\\n \"#{model.upcase}: \" \\\n \"#{data.values.join(\"/\")}, \" \\\n \":#{@type}\"\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 to_s\n\t\tself.class.name\n\tend", "def to_s\n return super\n end", "def inspect\n\t\treturn \"#<%s:0x%0x %s(%s) %p -> %p >\" % [\n\t\t\tself.class.name,\n\t\t\tself.object_id / 2,\n\t\t\tself.name,\n\t\t\tself.oid,\n\t\t\tself.desc,\n\t\t\tself.attr_oids,\n\t\t]\n\tend", "def inspect\n to_s\n end", "def inspect\n to_s\n end", "def inspect\n to_s\n end", "def inspect\n to_s\n end", "def inspect\n to_s\n end", "def inspect\n to_s\n end", "def inspect\n to_s\n end", "def to_s\n\t\treturn school #it will be automatically call when we print the instance of a class\n\tend", "def to_s\n inspect\n end", "def inspect\n attribute_string = self.class.attributes.map do |key|\n \"#{key}: #{read_attribute(key).inspect}\"\n end.join(', ')\n \"#<#{self.class} #{attribute_string}>\"\n end", "def inspect\n end", "def inspect\n end", "def inspect\n end", "def inspect\n end", "def inspect\n end", "def inspect\n end", "def inspect\n end", "def inspect\n end", "def inspect\n end", "def inspect\n end", "def inspect\n end", "def inspect\n end", "def inspect\n end", "def inspect\n end", "def inspect\n end", "def inspect\n klass = self.class\n attrs = klass\n .attribute_names\n .reject { |key| key == :data }\n .map { |key| \" #{key}=#{@attributes[key].inspect}\" }\n .join\n \"#<#{klass.name || klass.inspect}#{attrs}>\"\n end", "def to_s\n \"#{self.class}: #{first_name} #{last_name}\"\n end", "def formatted_info\n \"#{self.name} - #{self.description}\"\n end", "def to_s\n self.inspect\n end", "def to_s; name; end", "def to_s\n \"#{self.title} - #{self.author} - #{self.date}\"\n end", "def inspect\n\t\t\treturn %Q{#<%s:0x%0x \"%s\">} % [\n\t\t\t\tself.class.name,\n\t\t\t\tself.object_id * 2,\n\t\t\t\tself.to_s,\n\t\t\t]\n\t\tend", "def inspect\n attributes_for_inspect = self.attributes.collect do |attr|\n \"#{attr}: \" + self.instance_variable_get(\"@#{attr}\").to_s\n end.join(\", \")\n return \"#<#{self.class} #{attributes_for_inspect}>\"\n end", "def inspect\n inspection = self.info.keys.map { |name|\n \"#{name}: #{attribute_for_inspect(name)}\"\n }.compact.join(\", \")\n \"#<#{self.class}:0x#{self.object_id.to_s(16)} #{inspection}>\"\n end", "def inspect\n \"#<#{self.class} #{self}>\"\n end" ]
[ "0.7785011", "0.73436695", "0.7208078", "0.7178978", "0.71743774", "0.71575946", "0.71259165", "0.71105665", "0.71084696", "0.7095903", "0.70790386", "0.7041087", "0.7033364", "0.7011339", "0.7009532", "0.69794756", "0.69698477", "0.69430345", "0.69430345", "0.6900666", "0.68842924", "0.68545765", "0.68406224", "0.6839522", "0.6838725", "0.6838725", "0.68325114", "0.68267643", "0.68205196", "0.68084043", "0.6801661", "0.6796949", "0.6795582", "0.6795582", "0.6793205", "0.67920506", "0.679023", "0.67761374", "0.67636186", "0.67568904", "0.6755228", "0.6747547", "0.67473596", "0.6743581", "0.6742453", "0.6741332", "0.6741295", "0.6739648", "0.6739648", "0.6738932", "0.67277306", "0.6727612", "0.6724567", "0.6724272", "0.67208266", "0.67208266", "0.67208266", "0.67208266", "0.67208266", "0.6714492", "0.67141885", "0.6701246", "0.66969055", "0.6689865", "0.6687065", "0.6684264", "0.66749066", "0.66749066", "0.66749066", "0.66749066", "0.66749066", "0.66749066", "0.66749066", "0.6673851", "0.6672926", "0.66716635", "0.66696507", "0.66696507", "0.66696507", "0.66696507", "0.66696507", "0.66696507", "0.66696507", "0.66696507", "0.66696507", "0.66696507", "0.66696507", "0.66696507", "0.66696507", "0.6667526", "0.6667526", "0.6664581", "0.6663772", "0.66519755", "0.66508836", "0.6639934", "0.6635469", "0.6632615", "0.6625871", "0.66255677", "0.6625287" ]
0.0
-1
return a string in 20110131 format
def get_report_date(folder) last_day = Time.parse('2011-01-01') Dir["#{folder}/*.pdf"].each do |pdf| #puts pdf filename = File.basename(pdf).gsub('.pdf', '') fs = filename.split(' ') store_name = fs[0] dt = fs[-1] dt.gsub!('W', '') dt.gsub!('M', '') #puts dt dt = Time.parse(dt) last_day = dt if last_day < dt end date = last_day.strftime('%Y-%m-%d') return date end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_s\n \"#{year}-#{month.to_s.rjust(2, '0')}\"\n end", "def to_s\n # TODO this breaks the minus spec: strftime\n format \"#{year}-%02d-%02d\", month, day\n end", "def to_s\n \"#{'%04i' % year}-W#{'%02i' % index}\"\n end", "def to_s; \"%d-%02d\" % [@years, @months.abs] end", "def date_str\n date.strftime(\"%Y%m%d\")\n end", "def to_string\n return @year.to_s + \" \" + @month.to_s + \" \" + @day.to_s\n end", "def to_s\n \"#{@month}/#{@day}/#{@year}\"\n end", "def to_name\n \"#{MAJOR}_#{MINOR}_#{REVISION}\"\n end", "def to_name\n \"#{MAJOR}_#{MINOR}_#{REVISION}\"\n end", "def to_s\n\t\tMonth.month_names[@month-1][0..2] + \" \" + @year.to_s\n\tend", "def to_s\n txt = name\n txt += \" (#{self.year})\" if self.year && self.year > 0\n return txt\n end", "def to_s\n fy = first.year.to_s\n end_year = last.year\n fy += \"-\" + end_year.to_s unless first.year == end_year\n fy\n end", "def short_number\n self.new_record? ? self.number : \"#{self.id.to_s.rjust(6, \"0\")}#{I18n.l(self.created_at, :format => \"%m%Y\")}\"\n end", "def to_s\n return \"#{\"%04d\" % @t_year}-#{\"%02d\" % @t_month}-#{\"%02d\" % @t_day} #{\"%02d\" % @t_hour}:#{\"%02d\" % @t_min}:#{\"%02d\" % @t_sec}\"\n end", "def to_s()\n str = \"\" + @date.month.to_s() + \"/\" + @date.mday.to_s() + \"/\" + @date.year.to_s()\n return str\n end", "def get_create_date\n String str = String.new\n unless self.created_at.blank?\n str << date_ordinal_format(self.created_at)\n end\n end", "def monthstamp(year, month)\n \"#{year}#{month.to_s.rjust(2, \"0\")}\".to_i\nend", "def to_s(format = :short)\n case format\n when :elasticsearch\n sprintf(\"%04d-%02dw%02d\", year, month, week)\n when :long\n \"#{year}:#{year_week} #{self.to_s(:short)}\"\n else\n \"#{MONTHS[month - 1]} W#{week}\"\n end\n end", "def to_s\n [@year,@month,@day].join(\"/\")\n end", "def number_to_short_month_name(n)\n short_month_string = number_to_full_month_name(n)[0..2]\nend", "def next_migration_string(padding = 3)\n\t\t\t@s = ([email protected]?)? @s.to_i + 1 : if ActiveRecord::Base.timestamped_migrations\n\t\t\t\tTime.now.utc.strftime(\"%Y%m%d%H%M%S\")\n\t\t\telse\n\t\t\t\t\"%.#{padding}d\" % next_migration_number\n\t\t\tend\n\t\tend", "def next_migration_string(padding = 3)\n\t\t\t@s = ([email protected]?)? @s.to_i + 1 : if ActiveRecord::Base.timestamped_migrations\n\t\t\t\tTime.now.utc.strftime(\"%Y%m%d%H%M%S\")\n\t\t\telse\n\t\t\t\t\"%.#{padding}d\" % next_migration_number\n\t\t\tend\n\t\tend", "def generate_prefix(date1, date2)\n prefix = date1.strftime('%Y%m%d')\n return prefix += \"-\"+date2.strftime('%Y%m%d') if date1.year != date2.year\n return prefix += \"-\"+date2.strftime('%m%d') if date1.mon != date2.mon\n return prefix += \"-\"+date2.strftime('%d') if date1.mday != date2.mday\n return prefix\n end", "def pretty_date\n from_index[:modified].sub(/(\\d{4})(\\d{2})(\\d{2})\\d{6}/,'\\1-\\2-\\3')\n end", "def date_str\n Util::Date.token_bill_date(created_at)\n end", "def year_month_int_to_str(year_month)\n \"#{year_month / 12} #{MONTHS[year_month % 12]}\"\n end", "def full_id9\n self.id.blank? ? '000000000' : self.id.to_s.rjust(9,'0')\n end", "def to_s\n \"<Version #{number}>\"\n end", "def full_no\n # Debt claim no (Office & year & sequential number) => OOOO-YYYY-NNNNN\n if claim_no == \"$err\"\n \"0000-0000-00000\"\n else\n claim_no.blank? ? \"\" : claim_no[0..3] + '-' + claim_no[4..7] + '-' + claim_no[8..12]\n end\n end", "def get_year_with_number\n date_receipt.strftime(\"%Y\") + \"-\" + sprintf( \"%03i\", receipt_num )\n end", "def mongoize\n \"#{format('%04d', year)}-#{format('%02d', month)}-#{format('%02d', day)}\"\n end", "def git_date2txt( datestring)\n # Date: Mon Aug 2 14:39:56 2021 +0100\n # assume we dont care about seconds, tz or year most of time.\n wd,month,day,time,year = datestring.split\n return sprintf \"%02d-%3s %s\", day, month, time[0,5]\nend", "def good_date(dd)\n dd = dd.to_s\n dd = \"0\" + dd if dd.length<2\n dd\n end", "def good_date(dd)\n dd = dd.to_s\n dd = \"0\" + dd if dd.length<2\n dd\n end", "def good_date(dd)\n dd = dd.to_s\n dd = \"0\" + dd if dd.length<2\n dd\n end", "def formated_release_date_for(game)\n return \"\" if game.nil?\n formated_date(game.date)\n end", "def build_version\n @semver.to_s '%M.%m.%p'\n end", "def projectName\n dateTime = Time.new\n \"DS Demo DSv6_Automation zZz #{dateTime.strftime(\"%d-%b-%Y\")}\"\n # \"DS Demo DSv6_AutomationUS11 zZz 20-Jul-2017\"\nend", "def number_to_short_month_name(number)\n sliced_month_name = number_to_full_month_name(number).slice(0,3)\n return sliced_month_name\nend", "def to_s\n version = get_version_string\n version << \"-#{get_pre_string}\" unless @pre == nil\n version << \"+#{get_build_string}\" unless @build == nil\n version\n end", "def format_id_to_s(id)\n id.to_s.rjust(3, '0')\n end", "def generate_reference\n \"#{Time.now.strftime('%y%m')}-#{SecureRandom.hex(3).upcase}\"\n end", "def formal_publication_date\n publication_date.to_s(:formal_wo_ordinal)\n end", "def to_s\r\n \"#{@major}.#{@minor}\"\r\n end", "def format_year(year)\n \"#{year}-#{year+1}\"\n end", "def got_enrolled_on\n\n begin\n # Get full month name, non-zero-padded date, and full year\n formatted_date = Date.strptime(enrollment_date, \"%m-%d-%Y\").strftime(\"%B %-d %Y\")\n enrollment_string = name + \" - \" + formatted_date\n rescue ArgumentError\n enrollment_string = \"Invalid Date\"\n end\n\n return enrollment_string\n\n end", "def publication_date\n pubdate=@pubmed['DP'].strip.split(\" \")\n if pubdate.length > 2\n pubdate[2].to_s + '-' + pubdate[1].to_s + '-' + pubdate[0].to_s\n elsif pubdate.length == 2\n '01-'+ pubdate[1]+'-'+ pubdate[0]\n elsif pubdate.length == 1\n '01-JAN-'+ pubdate[0]\n else\n nil\n end\n end", "def to_s\n report_date.strftime(\"%B %Y\")\n end", "def month_result_string(day)\n start = day.beginning_of_month.yday - 1\n finish = day.end_of_month.yday - 1\n result_string(day.year).slice(start..finish)\n end", "def formatted_date( date )\n date.strftime( \"%Y-%b-%d\" ) + \" \" + date.strftime( \"%A\" ).slice( 0..2 ) unless date == nil\n end", "def full_academic_year\n unless academic_year.blank?\n academic_year.to_s + '-' + (academic_year + 1).to_s\n end\n end", "def to_s\n \"%014d\" % to_i\n end", "def gen_name\n\t\tlast_id = Bill.last ? Bill.last.id + 1 : 1\n\t\t\"#{last_id}-1-1\"\n\tend", "def make_string(number, length=3)\n valid_day_number?(number) or raise ArgumentError\n name = @day_names[number - 1]\n name[0 ... [name.length, length].min]\n end", "def number_to_full_month_name(month)\n case month\n when 1\n month = \"January\"\n when 2\n month = \"February\"\n when 3\n month = \"March\"\n when 4\n month = \"April\"\n when 5\n month = \"May\"\n when 6\n month = \"June\"\n when 7\n month = \"July\"\n when 8\n month = \"August\"\n when 9\n month = \"September\"\n when 10\n month = \"October\"\n when 11\n month = \"November\"\n when 12\n month = \"December\"\n end\nreturn month\nend", "def number_to_short_month_name(month)\n full_month = number_to_full_month_name(month)\n short_month_name = full_month.slice(0, 3)\n #short_month_name = full_month[0..2] *ARRAY VERSION\n return short_month_name\nend", "def to_s(format = 'v%M.%m.%p%s%d')\n result = format.gsub '%M', @major.to_s\n result.gsub! '%m', @minor.to_s\n result.gsub! '%p', @patch.to_s\n result.gsub!('%s', prerelease? ? \"-#{@special}\" : '')\n result.gsub!('%d', metadata? ? \"+#{@metadata}\" : '')\n result\n end", "def number_to_short_month_name(month)\n return number_to_full_month_name(month)[0..2]\nend", "def version\n build_string\n end", "def month_name(number); end", "def to_s\n \"%04d-%02d-%02d %02d:%02d:%02d.%05d\" % parts\n end", "def to_s\n @file.to_s.scan(%r{(\\d{4})(\\d{2})(\\d{2})(.*?)-(.*?)\\..*}) do |year,month,day,time,name|\n return \"#{year}/#{month}/#{day}/#{name}\"\n end\n end", "def view_date(str)\r\n\t\t(wday,day,mon,year,hhmmss,etc) = str.to_s.split(/ /)\r\n\t\tmonth = @months[mon]\r\n\t\tstr = \"#{year}\\/#{month}\\/#{day} #{hhmmss}\"\r\n\t\treturn str\r\n\tend", "def to_s(format = nil)\n return '' if to_str.empty?\n return to_str if to_str.length == 5\n \"#{to_str[0..4]}-#{to_str[5..8]}\"\n end", "def number_to_short_month_name(num)\n month = number_to_full_month_name(num)\n return month [0..2]\nend", "def post_year\n chars = @date.split('')\n chars.pop(4).join('').to_i\n end", "def to_s\n v = [major, minor, patch].compact.join('.')\n v += \"-#{pre}\" if pre\n v\n end", "def number_to_short_month_name(a)\n return number_to_full_month_name(a).slice(0,3)\nend", "def generate_slug\n date = DateTime.current\n seed = sprintf '%03d', rand(0..999)\n major, minor = VERSION.split('.')[0..1]\n minor = sprintf '%02d', minor\n self.slug = date.strftime(\"%m%d-%y-#{major}#{minor}#{seed}\")\n end", "def to_s\n minor ? \"#{@major}-#{Patch.pad_minor(@minor)}\" : \"#{@major}\"\n end", "def year_name(number); end", "def to_s\n return last_day if start_date == end_date\n \n format = ELEMENTS\n format = format.chomp(' %Y') if start_date.year == end_date.year\n format = format.chomp(' %b') if start_date.month == end_date.month\n first_day = start_date.strftime(format)\n first_day + ' - ' + last_day\n end", "def result_string(year)\n send(\"results_#{year}\").rjust(366, '0')\n rescue NoMethodError\n raise ArgumentError, \"#{year} out of range\"\n end", "def serialnumber\r\n\r\n @@serial +=1 ;\r\n \r\n id = request.object_id.to_i;\r\n if(id < 0 )\r\n \r\n id *= -1;\r\n end\r\n \r\n id %= 103; # mod by prime to keep the digits down.\r\n \r\n return(\"o\"+id.to_s+\"s\"+@@serial.to_s)\r\n \r\n end", "def dbstr(args = nil)\n str = \"#{\"%04d\" % @t_year}-#{\"%02d\" % @t_month}-#{\"%02d\" % @t_day}\"\n \n if !args or (!args.key?(:time) or args[:time])\n str << \" #{\"%02d\" % @t_hour}:#{\"%02d\" % @t_min}:#{\"%02d\" % @t_sec}\"\n end\n \n return str\n end", "def date_to_string(date, type = T.unsafe(nil), style = T.unsafe(nil)); end", "def get_month(month)\n month = month.to_s\n month.length == 2 ? month : \"0#{month}\"\n end", "def inspect\n \"#{year}-W#{week}-#{day}\"\n end", "def literal_date(v)\n v.strftime(\"{d '%Y-%m-%d'}\")\n end", "def full_id\n self.id.blank? ? '0000000000' : self.id.to_s.rjust(10,'0')\n end", "def to_s ; format ; end", "def to_s\n \"#{@timestamp}/#{@repo_name}/#{@sha}\"\n end", "def format_date(month, year)\n \"#{format(month,:two_digits)}/#{format(year, :two_digits)}\"\n end", "def format_date(month, year)\n \"#{format(month,:two_digits)}/#{format(year, :two_digits)}\"\n end", "def to_s\n names = [\"Vendémiaire\", \"Brumaire\", \"Frimaire\", \"Nivôse\", \"Pluviôse\",\n \"Ventôse\", \"Germinal\", \"Floréal\", \"Prairial\", \"Messidor\",\n \"Thermidor\", \"Fructidor\", \"Sansculottides\"]\n s = \"\"\n s += @day.to_s + \" \" + names[@month - 1] + \" \" + @year.to_s\n end", "def to_s\n return \"#{namespace}:#{project}:#{component}:#{version}\"\n end", "def get_app_date()\n date_object = Date.strptime(@app_date, '%Y-%m-%d')\n format = date_object.strftime('%d/%m/%Y')\n return format.to_s\n end", "def get_number_with_year\n receipt_num.to_s + \" / \" + get_date_receipt().strftime(\"%Y\")\n end", "def to_s() designation_number; end", "def to_s\n \"#{@major}.#{@minor}.#{@update} Build #{@build}\"\n end", "def versionString()\n\t\t\t\treturn \"#{major}.#{minor}.#{build}\"\n\t\t\tend", "def version\n \"Version: #{VERSION.split[1]} Created on: \" +\n \"#{REVISION_DATE.split[1]} by #{AUTHOR}\"\n end", "def version\n \"Version: #{VERSION.split[1]} Created on: \" +\n \"#{REVISION_DATE.split[1]} by #{AUTHOR}\"\n end", "def version\n \"Version: #{VERSION.split[1]} Created on: \" +\n \"#{REVISION_DATE.split[1]} by #{AUTHOR}\"\n end", "def number_to_short_month_name(month_number)\n short_month = number_to_full_month_name(month_number)\n return short_month[0..2]\nend", "def dob_string\n unless self[:feed_birth_time].blank?\n year = self[:feed_birth_time].year\n return case self[:feed_birth_time_pref]\n when 'y':\n year.to_s\n when 'md':\n self[:feed_birth_time].to_time.strftime(\"%d-%b\")\n when 'ymd':\n self['feed_birth_time'].to_time.strftime(\"%d-%b-%Y\")\n end\n end\n return ''\n end", "def number_to_short_month_name(month)\n short_name = number_to_full_month_name(month)\n return short_name.slice(0,3)\nend", "def order_number\n if (not self.id)\n return \"save to allocate number\"\n end\n base = Time.new().strftime(\"%Y\")\n return base + \"_\" + self.id.to_s\n end", "def date\n \"#{day} #{month.capitalize} #{year}\"\n end", "def to_s\n date.strftime(DATE_FORMAT)\n end", "def packed_update_date\n all_characters[(content_offset + 2)*characters_per_word, 8].join\n end" ]
[ "0.7127143", "0.6813594", "0.65019214", "0.64365053", "0.6415714", "0.6340493", "0.6331461", "0.6281235", "0.6281235", "0.6270653", "0.6183252", "0.61451316", "0.6118995", "0.6087823", "0.6057231", "0.6049389", "0.60398704", "0.60333294", "0.6009941", "0.60094005", "0.59094703", "0.59094703", "0.590275", "0.58974427", "0.5876256", "0.58758175", "0.5845754", "0.58436155", "0.58387434", "0.58165765", "0.58122593", "0.5809907", "0.5789273", "0.5789273", "0.5789273", "0.5783096", "0.57761514", "0.5759496", "0.5754006", "0.573232", "0.57312334", "0.572596", "0.5683337", "0.56787455", "0.5660718", "0.56580764", "0.56523204", "0.56514853", "0.5641509", "0.5639342", "0.5634896", "0.5629244", "0.56253666", "0.5623409", "0.5610628", "0.5599182", "0.5583988", "0.55815005", "0.5579542", "0.5576997", "0.55744183", "0.557029", "0.55489236", "0.55438167", "0.55436003", "0.5540789", "0.5535632", "0.5524127", "0.55230945", "0.55172974", "0.5508848", "0.5502514", "0.54957074", "0.5492022", "0.54906344", "0.5486916", "0.5486634", "0.54806143", "0.54775316", "0.54696447", "0.5465331", "0.54652655", "0.54593676", "0.54593676", "0.5454706", "0.5453715", "0.54505306", "0.54452616", "0.54427856", "0.5439819", "0.5435001", "0.5434903", "0.5433731", "0.5433731", "0.54331154", "0.54321915", "0.54312116", "0.54308444", "0.54223824", "0.54214245", "0.5419254" ]
0.0
-1
missing_credentials? This is written a little strangely because we can't modify the object inplace due to frozen strings used in rspec stubs. Thus, the Hash and Array cases reassign their contents, while the String case returns a new String.
def fix_encoding!(thing) case thing when Net::LDAP::Entry thing.each_attribute do |k| fix_encoding!(thing[k]) end when Hash thing.each_pair do |k, v| thing[k] = fix_encoding!(v) end when Array thing.collect! do |v| fix_encoding!(v) end when String sanitize_utf8(thing) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_no_credentials?\n self.crypted_password.blank?\n end", "def has_no_credentials?\n self.crypted_password.blank?\n end", "def has_no_credentials?\n self.crypted_password.blank?\n end", "def has_no_credentials?\n self.crypted_password.blank?\n end", "def has_no_credentials?\n self.crypted_password.blank?\n end", "def determine_credentials(credentials = {})\n return credentials if credentials.is_a?(Hash) && !credentials.empty?\n\n rails_credentials\n end", "def valid_credentials?(credentials)\n !credentials[:username].to_s.empty? && !credentials[:password].to_s.empty?\n end", "def legacy?\n @password.is_a? SaltedSHA1\n end", "def credentials_parse(credentials)\n credentials.each do |key, value|\n credentials[key] = false if value == 'false'\n credentials[key] = true if value == 'true'\n end\n credentials[:hardware_variant] ||= 'C7000'\n credentials\nend", "def application_credentials?\n !!application_credentials\n end", "def missing?(obj)\n obj.to_s.strip.empty?\n end", "def valid_credentials?(credentials)\n credentials_error if !credentials.is_a?(Hash) || credentials.empty?\n required_credentials?(credentials)\n end", "def missing(obj)\n obj.to_s.strip.empty?\n end", "def credentials?\n credentials.values.all?\n end", "def valid_format_for_credentials(possible_credentials)\n required_fields = [\"table\", \"hostname\", \"ips\", \"keyname\"]\n required_fields.each { |field|\n if !possible_credentials[field]\n return false\n end\n }\n\n return true\n end", "def credentials?\n oauth.values.all? || basic_auth.values.all?\n end", "def correct_credentials?\n correct_username = 'admin'\n correct_password = 'admin'\n input_username = @request.params['username']\n input_password = @request.params['password']\n correct_username == input_username && correct_password == input_password\n end", "def authorized?(encrypted_string)\n\n \tend", "def string?\n data_type == String\n end", "def credentials_parse(credentials)\n credentials.each do |key, value|\n credentials[key] = false if value == 'false'\n credentials[key] = true if value == 'true'\n end\nend", "def empty?\n prepended_creds.empty? && !has_privates?\n end", "def is_string()\n res = super(context,self)\n return res\n end", "def challenge_password?\n !read_attributes_by_oid('challengePassword').nil?\n end", "def required_credentials?(credentials = {})\n credentials_error unless REQUIRED_KEYS.all? { |k| credentials[k] }\n end", "def frozen_string_literal_specified?; end", "def healthy?() raw && raw.is_a?(Hash) end", "def expected_response(http_method, uri, credentials, password, password_is_ha1 = T.unsafe(nil)); end", "def credentials?\n if credentials[:access_token]\n true\n elsif credentials[:client_id] && credentials[:client_secret]\n true\n else\n false\n end\n end", "def test_pair_is_not_equal_w_string\n pair = PairType.new(key: 'xxx', value: 9)\n assert_false pair == 'string'\n end", "def encode_secrets(data)\n data[:credentials] = Base64.encode64(data[:credentials]) if data[:credentials]\n data['credentials'] = Base64.encode64(data['credentials']) if data['credentials']\n data\n end", "def encode_credentials(username, password)\n \"\"\n end", "def is_string\n return @is_string\n end", "def plain_old_ruby_object\n\t\treturn false\n\tend", "def coercible?(env_return, ref_obj)\n converter = converter_method(ref_obj)\n return true if converter == :to_s\n Coercible::Coercer.new[String].send(converter, env_return)\n return true\n rescue Coercible::UnsupportedCoercion\n false\n end", "def frozen_string_literal?; end", "def is_stub?\n htpasswd.blank?\n end", "def has_user_credential?(username)\n self.credentials.map { |credential| credential.username }.include?(username)\n end", "def key_based?\n @username && [email protected]? && @api_key && !@api_key.empty?\n end", "def decode_credentials; end", "def valid_credentials?(session)\n if session.login[:Credentials][:Username].length >= 1 && RuneRb::GLOBAL[:GAME_BANNED_NAMES].none? { |row| row[:name].include?(session.login[:Credentials][:Username]) }\n true\n else\n @responses[session].write(RuneRb::Network::LOGIN_RESPONSES[:BAD_CREDENTIALS], type: :byte, signed: false)\n raise RuneRb::System::Errors::SessionReceptionError.new(:username, nil, session.login[:Credentials][:Username])\n end\n\n if RuneRb::Database::PlayerProfile.fetch_profile(session.login[:Credentials])[:password] == session.login[:Credentials][:Password]\n true\n else\n @responses[session].write(RuneRb::Network::LOGIN_RESPONSES[:BAD_CREDENTIALS], type: :byte, signed: false)\n raise RuneRb::System::Errors::SessionReceptionError.new(:password, nil, nil)\n end\n true\n end", "def valid_credentials?\n return false if Sailpoint.config.username.blank? && Sailpoint.config.password.blank?\n\n !Sailpoint.config.hashed_credentials.blank?\n end", "def verify_credentials!\n raise AuthenticationError.new(\"missing client code\") if Applitrack.client_code.nil? || Applitrack.client_code.empty?\n raise AuthenticationError.new(\"missing username\") if Applitrack.username.nil? || Applitrack.username.empty?\n raise AuthenticationError.new(\"missing password\") if Applitrack.password.nil? || Applitrack.password.empty?\n end", "def test_string_as_optional()\n # Parameters for the API call\n body = StringAsOptional.from_hash(APIHelper.json_deserialize(\n '{\"string\":\"test\"}'\n ))\n\n # Perform the API call through the SDK function\n result = @controller.string_as_optional(body)\n\n # Test response code\n assert_equal(200, @response_catcher.response.status_code)\n\n # Test whether the captured response is as we expected\n refute_nil(result)\n expected_body = JSON.parse(\n '{\"passed\":true}'\n )\n received_body = JSON.parse(@response_catcher.response.raw_body)\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\n end", "def test_string_as_optional()\n # Parameters for the API call\n body = StringAsOptional.from_hash(APIHelper.json_deserialize(\n '{\"string\":\"test\"}'\n ))\n\n # Perform the API call through the SDK function\n result = @controller.string_as_optional(body)\n\n # Test response code\n assert_equal(200, @response_catcher.response.status_code)\n\n # Test whether the captured response is as we expected\n refute_nil(result)\n expected_body = JSON.parse(\n '{\"passed\":true}'\n )\n received_body = JSON.parse(@response_catcher.response.raw_body)\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\n end", "def nullify_password_digest\n self.password_digest ||= \"N/A, not used by the #{self.provider} strategy.\"\n end", "def filter_auth_credentials(credentials)\n auth_keys = %i[host port encryption].freeze\n credentials.select { |key, _v| auth_keys.include?(key) }.freeze\n end", "def credentials=(credentials)\n if credentials.kind_of?(ApplicationCredentials) || credentials.kind_of?(AccountCredentials)\n @credentials = credentials\n else\n raise 'Invalid credentials object'\n end\n end", "def credentials(opts = T.unsafe(nil)); end", "def credentials=(value)\n super\n values = value.is_a?(Array) ? value : [value]\n self.unauthorized_record = values.first if values.first.class < ::ActiveRecord::Base\n end", "def set_credentials(credentials: nil)\n raise StandardError, 'credentials must be a hash' unless credentials.is_a?(Hash)\n\n password = ENV['CARRIER_PRODUCTS_ENCRYPTION_PASSWORD']\n encrypted_credentials = credentials.inject({}) do |hash, (key, value)|\n raise StandardError, \"#{key.to_s.capitalize} must be specified\" if value.blank? && !key.to_s.include?('test')\n\n hash[key] = AESCrypt.encrypt(value, password) if value.present?\n hash\n end\n\n self.credentials = encrypted_credentials\n self.save!\n end", "def credentials= (new_credentials)\n @credentials = new_credentials\n refresh_config_for_api_objects!\n @credentials\n end", "def string?\n !@arg[:textValue].nil?\n end", "def credentials\n return nil if username.nil? || password.nil?\n \"#{username}:#{password}\"\n end", "def credentials=(value)\n super\n values = value.is_a?(Array) ? value : [value]\n if values.first.is_a?(Hash)\n hash = values.first.with_indifferent_access\n self.facebook_name = hash[:facebook_name]\n self.facebook_username = hash[:facebook_username]\n\n hash\n end\n end", "def supports_standard_conforming_strings?\n standard_conforming_strings?\n @standard_conforming_strings != :unsupported\n end", "def empty?\n prepended_creds.empty? && !has_users? || (has_users? && !has_privates?)\n end", "def ==(other)\n if other.class == String\n self.decoded == other\n else\n super\n end\n end", "def authentication_set?\n [email protected]? && [email protected]?\n end", "def populated_hash?(obj)\n obj.is_a?(Hash) && !obj.empty?\n end", "def secrets_exists?\n len = PrivateChef.credentials.length\n len -= 1 if PrivateChef.credentials.exist?('chef-server', 'webui_key')\n len -= 1 if PrivateChef.credentials.exist?('chef-server', 'superuser_key')\n len > 0\n end", "def require_string(value)\n if value.nil? == true || value.to_s.empty?\n log_error_and_raise(\"expected string value, got nil or empty string\")\n end\n\n if value.is_a?(String) != true\n log_error_and_raise(\"expected string value, got #{value.class}, #{value.inspect}\")\n end\n\n end", "def sanitize_string(string)\n return string unless string\n\n # HACK the #to_s is in here because RSpec has an Array of Arrays of\n # Strings for authors. Need a way to disallow bad values on gemspec\n # generation. (Probably won't happen.)\n string.to_s\n end", "def insync?(context, name, property_name, _is_hash, should_hash)\n context.debug(\"Checking whether #{property_name} is out of sync\")\n case property_name\n when :password\n if should_hash[property_name].respond_to?(:unwrap)\n context.debug(\"Unwrapping #{property_name}\")\n password_unwrapped = should_hash[property_name].unwrap\n else\n password_unwrapped = should_hash[property_name]\n end\n\n res = Puppet.runtime[:http].get(\n context.transport.build_uri('status'),\n options: {\n basic_auth: {\n user: name,\n password: password_unwrapped\n }\n },\n )\n\n unless res.success?\n res = context.transport.put_request_text(context, \"security/users/#{name}/change-password\", password_unwrapped)\n end\n\n res.success?\n end\n end", "def buffer_valid?\r\n @buffer.is_a?(String)\r\n end", "def credentials\n @credentials ||= {}\n end", "def credentials=(_arg0); end", "def credentials=(_arg0); end", "def credentials=(_arg0); end", "def credentials=(_arg0); end", "def credentials=(_arg0); end", "def has_no_password?\n #super\n self.encrypted_password.blank? || (self.uid && self.provider)\n end", "def noexist_or_update_password\n !self.respond_to?(:encrypted_password) || self.encrypted_password.nil?\n end", "def is_string?\n @name.is_a?(String) && @stack.empty?\n end", "def should_be_string(data)\n if data.class != String\n raise \"Data needs to be a string; you passed in a #{data.class}: #{data}\"\n end\n end", "def credential_data_valid? data\n data.each do |hash|\n hash.each do |k,v|\n abort <<-MSG unless KEYS.include? k\nProbably have a typo in #{CREDENTIAL_FILE}: #{k}\nValid yaml keys: #{KEYS.join(\", \")}.\n MSG\n abort \"Please fill in #{k} in #{CREDENTIAL_FILE}\" unless v\n end\n end\n\n return true\n end", "def provided?\n [email protected]?\n end", "def invalid_identity_credentials?\n params[:provider] == \"identity\" && params.has_key?(:auth_key)\n end", "def token_safe?( str )\n not TOKEN_UNSAFE === str\n end", "def has_no_password?\n encrypted_password.blank?\n end", "def has_no_password?\n encrypted_password.blank?\n end", "def has_no_password?\n encrypted_password.blank?\n end", "def has_no_password?\n #super\n self.encrypted_password.blank? || self.identity.present?\n end", "def string?\n type == \"STRING\"\n end", "def inconsistent_password?(last_password = nil)\n last_password.nil? || (encrypted_password != last_password.encrypted_password)\n end", "def username_password?\n @options[:username] &&\n @options[:password] &&\n @options[:client_id] &&\n @options[:client_secret]\n end", "def supports_standard_conforming_strings?\n true\n end", "def authorized(authorization)\n if (ENV['SECRET_NAME'])\n creds = get_secret(ENV['SECRET_NAME'])\n calculated = \"Basic \" + Base64.encode64(\"#{creds['a2user'] || creds['A2USER']}:#{creds['a2pass'] || creds['A2PASS']}\")\n return (authorization || \"\").strip == (calculated || \"\").strip\n end\n if (ENV['A2USER'] && ENV['A2PASS'])\n calculated = \"Basic \" + Base64.encode64(\"#{ENV['A2USER']}:#{ENV['A2PASS']}\")\n return (authorization || \"\").strip == (calculated || \"\").strip\n end\n return false\nend", "def no_password?\n encrypted_password.blank?\n end", "def unencrypted? \n return (@unencrypted.nil?)? self.password.nil?: @unencrypted\n end", "def credentials_valid?\n zone_load_multi['result'] == 'success' rescue false\n end", "def credentials_valid?\n zone_load_multi['result'] == 'success' rescue false\n end", "def credential=cr\n if File.exist?(cr) && File.file?(cr)\n cr = File.read cr\n end\n\n @credential = case cr\n when Hash, ActiveSupport::HashWithIndifferentAccess\n cr\n when String\n JSON.parse cr\n else\n raise \"Invalid data type\"\n end\n end", "def has_oauth_credentials?\n return false if @configuration.nil?\n RightSignature2013::Connection.oauth_keys.each do |key| \n return false if @configuration[key].nil? || @configuration[key].match(/^\\s*$/)\n end\n\n return true\n end", "def test_hash_empty_string\n knot = KnotHash.new\n assert_equal \"a2582a3a0e66e6e86e3812dcb672a272\", knot.hash('')\n end", "def store_credentials(user_id, credentials)\n\t raise NotImplementedError, 'store_credentials is not implemented.'\n\tend", "def test_Hash_InstanceMethods_try_convert\n\t\tconfig = ConfigFile.new(\"./tfile/filename\")\n\t\tassert_equal(nil, Hash.try_convert(config)[\"user_name\"])\n\t\tassert_equal(nil, Hash.try_convert(config)[\"password\"])\n\tend", "def __prim_equal_failed(other)\n # invoked from Smalltalk code in _rubyEqual<env>:\n if other.respond_to? :to_str\n other == self # per specs\n else\n false\n end\n end", "def global_credential?(credential_k)\n %w(PSA/DNA N/A).exclude?(key_value(credential_k))\n end", "def exists?\n if self.legacy?\n password_on_disk = SaltedSHA1.create_from_shadowhash_file self.generateduid[0]\n return false unless password_on_disk\n return false unless password_on_disk.password.eql? @password.password\n end\n super\n end", "def authenticated?(cleartext_secret)\n Password.new(crypted_secret) == cleartext_secret\n end", "def auth_provided?\n !username.nil? && !password.nil?\n end" ]
[ "0.53770965", "0.53770965", "0.53770965", "0.53770965", "0.53732276", "0.526923", "0.52112097", "0.5132489", "0.5093035", "0.50769085", "0.5061003", "0.5009931", "0.49911276", "0.49191004", "0.48835012", "0.48788288", "0.4862283", "0.48146164", "0.48101696", "0.47783664", "0.4773283", "0.47716272", "0.47644994", "0.47475007", "0.47421464", "0.4740637", "0.47314915", "0.4722031", "0.47161102", "0.46906334", "0.46734866", "0.46613926", "0.46537596", "0.464902", "0.46404353", "0.46247312", "0.46170303", "0.46169144", "0.46165422", "0.4616235", "0.4612301", "0.46074262", "0.45897317", "0.45897317", "0.45854816", "0.45776507", "0.45681745", "0.4566956", "0.45641437", "0.45487598", "0.45418215", "0.4526223", "0.4515804", "0.4509878", "0.4509152", "0.4508582", "0.4504468", "0.4496297", "0.4485095", "0.44748962", "0.4473574", "0.44719383", "0.44709563", "0.44663504", "0.44663283", "0.44627255", "0.44627255", "0.44627255", "0.44627255", "0.44627255", "0.4457496", "0.44552904", "0.44522205", "0.44520584", "0.44461837", "0.4437269", "0.4433853", "0.442987", "0.4421968", "0.4421968", "0.4421968", "0.4415076", "0.44065514", "0.43999636", "0.43979222", "0.43956858", "0.4394211", "0.43908426", "0.43884996", "0.43880555", "0.43880555", "0.43850306", "0.43743354", "0.43729317", "0.43693697", "0.43609607", "0.43592447", "0.43577397", "0.4355366", "0.43499464", "0.43479264" ]
0.0
-1
Push a value onto the stack
def push(asset) # IMPLEMENT ME! @data = LinkedListNode.new(asset, @data) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def push(value)\n return \"Stack is full\" if is_full\n\n @stack.push(value)\n @current_size += 1\n end", "def add(value)\n @stack.push(value)\n end", "def push(x)\n @stack << x \n end", "def push(x)\n @stack << x\n end", "def push(x)\n @stack.push(x)\n end", "def push(value); end", "def push(x)\n stack.push(x)\n end", "def push(x)\n @stack << x\n end", "def push(x)\n @stack1 << x\n end", "def push(num)\n stack << num\n end", "def push(num)\n @stack << num\n\n return num\n end", "def push(x)\n @stack.push(x)\n end", "def push(x)\n @stack.push(x)\n end", "def push(val)\n if @stacks.empty?\n @stacks[0] = [val]\n if @capacity > 1\n @left[0] = 0\n else\n @right[0] = 0\n end\n else\n @left << @stacks.size if @left.empty?\n index = @left[0]\n @stacks[index] ||= []\n @stacks[index] << val\n if @stacks[index].size == @capacity\n @left.shift\n i = @right.bsearch_index { |j| j >= index } || @right.size\n @right.insert(i, index)\n end\n end\n end", "def push(x)\n @stack1.push(x)\n end", "def push(operation, value)\n @stack.push [operation, value]\n end", "def push val, name:, type: :unknown\n loc = @temp_stack.push name, type: type\n\n val = cast_to_fisk val\n\n if val.memory? || val.immediate?\n write loc, val\n else\n write loc, val.to_register\n end\n end", "def push(value)\n @sp -= 1\n @emulator.memory.set(@sp, value)\n end", "def push(value)\n @handle.puts \" $PUSH #{value & 0x7f}\"\n end", "def push(value)\r\n stacked = LinkedListNode.new(value, data)\r\n @data = stacked\r\n end", "def push(val)\n \n end", "def push(*a) # utility\n @stack.push(*a); self\n end", "def push(x)\n @stack.unshift(x)\n end", "def push_value(definition)\n value_stack.push(definition) if definition && !value_stack.empty?\n end", "def push(value)\n push_at(size, value)\n end", "def op_push(arg)\n push arg\n end", "def push (value)\n @top = Node.new(value, @top)\n end", "def push(o)\n @stack.push o\n @pc += 1\n end", "def push(value)\n return \"Stack is full\" if is_full\n\n new_node = Node.new(value)\n\n if is_empty\n @head = new_node\n else\n new_node.next = @head\n @head = new_node\n end\n\n @current_size += 1\n end", "def push(value)\n @parent, @top = @top, value\n end", "def push(value)\n @data = LLNode.new(value, @data)\n end", "def push(el)\n self.stack_var << el \n end", "def push (num)\n prePushListener\n @stackList.append num\n postPushListener\n end", "def push(x)\n \n end", "def push(x)\n \n end", "def push(value)\n # IMPLEMENT ME!\n @data = Node.new(value, @data)\n end", "def push value\n self.set( self.get_length + 1 , value)\n end", "def push(value)\n insert(value)\n self\n end", "def push(value)\n # IMPLEMENT ME!\n @top = LinkedListNode.new(value, @top)\n end", "def push(value)\r\n @data << value\r\n end", "def push(x)\n end", "def pushm(datum)\r\n @data_stack += datum\r\n end", "def push(item)\n @mini_stack.push(item)\n @maxx_stack.push(item)\n @stak.push(item)\n end", "def push(value)\n case value[0]\n when :CONTENT, :STRING_LITERAL\n value[1].gsub!(/\\n\\s*/, ' ') if strip_line_breaks?\n\n if [email protected]? && value[0] == @stack[-1][0]\n @stack[-1][1] << value[1]\n else\n @stack.push(value)\n end\n when :ERROR\n @stack.push(value) if @include_errors\n leave_object\n when :META_CONTENT\n @stack.push(value) if @include_meta_content\n else\n @stack.push(value)\n end\n\n self\n end", "def push(ele)\n \n if(@stk.size == nil)\n\t p \"Stack full\"\n\telse\n @count = @count + 1\n\t @stk[@count] = ele\t \n\tend\n end", "def push(datum)\r\n @data_stack << datum\r\n end", "def push(x)\n p = @stack.unshift(x)\n @q.insert(p)\n self\n end", "def push(value, *args)\n @adapter.push(value, args)\n end", "def push(value)\r\n @top_node = LinkedListNode.new(value, @top_node)\r\n end", "def push(element)\n #if the stack is already full or the element is nil, do nothing\n if full? or element.nil?\n nil\n else\n #Add 1 to the value of @top\n @top = @top.succ\n #sets the value at the top of the stack to element\n @store[@top] = element\n #returns it self\n self\n end\n end", "def push(value)\n node = Node.new(value)\n node.previous = top\n self.top = node\n\n return node\n end", "def push_stack\n bb = {:black => get_black,:white => get_white}\n @stack.push(Marshal.load(Marshal.dump(bb)))\n @stack.shift if @stack.size > @options[:stack_limit]\n end", "def push(item)\n @stack.unshift(item)\n self.top = @stack[0]\n end", "def push(value)\r\n # IMPLEMENT ME!\r\n # data = NIL\r\n # push(10) => data = LinkedListNode.new(10, data)\r\n # push(5) => data = LinkedListNode.new(5, data)\r\n # push(1) => data = LinkedListNode.new(1, data)\r\n\r\n @data = LinkedListNode.new(value, @data)\r\n\r\n end", "def push(value)\n @tape.push(value)\n end", "def push(element)\n @store << element #putting the element into the array, thereby putting it into the stack\n end", "def push(value)\r\n \t@data = LinkedListNode.new(value, @data)\r\n end", "def push(value)\r\n @data = LinkedListNode.new(value, @data)\r\n \r\n end", "def push(value)\r\n @head = Node.new(value, @head)\r\n end", "def push(value)\r\n @data = LinkedListNode.new(value, @data)\r\n end", "def push(value)\r\n @data = LinkedListNode.new(value, @data)\r\n end", "def push(value)\n last.next_node = Node.new(value, nil)\n end", "def push(value)\n\t\t\t\tif @length == 0\n\t\t\t\t\t@head = @tail = newNode(nil, value, nil)\n\t\t\t\telse\n\t\t\t\t\[email protected] = newNode(@tail, value, nil)\n\t\t\t\t\t@tail = @tail.next\n\n\t\t\t\t\tif @length == 1\n\t\t\t\t\t\[email protected] = @tail\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\t@length += 1\n\t\t\tend", "def push(value)\n new_node = Node.new(value)\n if length > 0\n new_node.prev_value = @tail\n @tail.next_value = new_node\n @tail = new_node\n if length == 1\n @head.next_value = new_node\n new_node.prev_value = head\n end\n else\n @head = new_node\n @tail = new_node\n end\n @length += 1\n return new_node.value\n end", "def push(value)\n\t\tnode = Node.new(value)\n\t\tif @length==0\n\t\t\t@last = node\n\t\t\t@first = node\n\t\telse\n\t\t\[email protected] = node\n\t\t\tnode.back = @last\n\t\t\t@last = node\n\t\tend\n\t\t@length+=1\n\tend", "def add_to_stack(obj)\n stack.push(obj)\n end", "def push(value)\r\n if @data == nil\r\n @data = LinkedListNode.new(value)\r\n else\r\n @data = LinkedListNode.new(value, @data)\r\n end\r\n end", "def push(value)\n @count += 1\n new_element = RubyDS::StackQueue::Element.new(value)\n if @head.nil?\n @head = new_element\n else\n new_element.next = @head\n @head = new_element\n end\n end", "def push(value)\n @head = Node.new(value, @head)\n end", "def push(value)\n @data = LinkedListNode.new(value, @data)\n end", "def push(value)\n @data = LinkedListNode.new(value, @data)\n end", "def push(value)\n @data = LinkedListNode.new(value, data)\n end", "def push(value)\n # IMPLEMENT ME!\n if @data == nil\n @data = LinkedListNode.new(value)\n else\n @data = LinkedListNode.new(value, @data)\n end\n end", "def push(element)\n #if the stack is full or the element is nil don't add it to the stack\n if full? or element.nil?\n nil\n else\n #increment top by one\n @top = @top.succ\n #store the element in the new top's position\n @store[@top] = element\n #return the instance of the stack\n self\n end\n end", "def push(element)\n #if the stack is full or the element is nil don't add it to the stack\n if full? or element.nil?\n nil\n else\n #increment top by one\n @top = @top.succ\n #store the element in the new top's position\n @store[@top] = element\n #return the instance of the stack\n self\n end\n end", "def push(val)\n resize! if @length >= @store.length\n @store[@length] = val\n @length += 1\n val\n end", "def push(value)\n @data = LinkedListNode.new(value, @data) \n end", "def push(value)\n @data = LinkedListNode.new(value, @data)\n end", "def push_int(i)\n stack << Script.encode_number(i)\n end", "def push(value)\n @data = LinkedListNode.new(value, @data)\n end", "def push(value)\n @data = LinkedListNode.new(value, @data)\n end", "def push(d)\r\n @data_stack << d\r\n end", "def push(value)\n @data = LinkedListNode.new value, @data\n end", "def add(element)\n @push_stack.push(element)\n end", "def push(el)\n @stack.push(el)\n end", "def append_tail(value)\n @stack0.push(value)\n end", "def push(value)\r\n\t\tif @data.nil? \r\n\t\t\t@data = LinkedListNode.new(value) \r\n\t\telse\r\n\t\t\t@data = LinkedListNode.new(value, @data)\r\n\t\tend\r\n\tend", "def push(x)\n max = @max_stack.empty? ? x : [x, @max_stack[-1]].max\n @max_stack.push(max)\n @stack.push(x)\n end", "def push(value)\n new_head = Node.new(value, @head)\n @head = new_head\n if tail.nil?\n @tail = @head\n end\n end", "def push(x)\n raise(OverflowError, \"Stack is already full\") if store.length == max\n store.push(x)\n return \"Stack is full\" if store.length == max\n # Don't expose the array\n # we're using for internal storage.\n return self\n end", "def push(value)\r\n if @data != nil\r\n node = LinkedListNode.new(value, @data)\r\n else\r\n node = LinkedListNode.new(value)\r\n end\r\n @data = node\r\n end", "def push(c)\n @push = c\n end", "def push(x)\n if @stack.length == 0 or x <= @min\n @stack.push @min\n @min = x\n end\n @stack.push x\n \n end", "def push(val)\n @store << val\n idx = count - 1\n @store = BinaryMinHeap.heapify_up(@store, idx, &prc)\n end", "def push(card)\n error_unless_param_is_a_card card, \"push\"\n @stack.push(card)\n end", "def push(value, args)\n if !defined?(value.queue)\n value.class_eval do \n @queue = :default\n end\n end\n Resque.enqueue value, args\n end", "def push\n CGContextSaveGState(@ctx)\n @stacksize = @stacksize + 1\n end", "def push(value)\n new_head = Node.new value, @head\n @head = new_head\n end", "def push(x)\n @stack.push(x)\n max_val = peek_max\n if max_val\n max_val = [max_val, x].max\n else\n max_val = x\n end\n @max_stack.push(max_val)\n x\n end", "def push(element)\n # if Stack is full or the element you're trying to add = nil, cannot add anything\n if full? or element.nil?\n nil\n else\n # +1 added to @top because there is one more item in the Stack\n @top = @top.succ\n # new item actually added to @store array\n @store[@top] = element\n # returns Stack\n self\n end\n end", "def push(value)\r\n @data = LinkedListNode.new(value, self.data)\r\n end" ]
[ "0.8563555", "0.8531257", "0.8298897", "0.82781947", "0.8205244", "0.81969625", "0.8174969", "0.8150769", "0.81474", "0.81396604", "0.80902964", "0.80648404", "0.795523", "0.79373324", "0.79243076", "0.79227865", "0.79042894", "0.78440315", "0.78257644", "0.7730317", "0.77155495", "0.7673377", "0.76662916", "0.7662389", "0.76555234", "0.7619361", "0.7569708", "0.755848", "0.7539669", "0.7463177", "0.7440642", "0.73879945", "0.7360027", "0.7358081", "0.7358081", "0.7355806", "0.7341728", "0.7340912", "0.733289", "0.73118883", "0.7305375", "0.72842014", "0.7269977", "0.72632384", "0.7262722", "0.72537345", "0.7246465", "0.72284645", "0.72103864", "0.7165176", "0.7146711", "0.71344817", "0.7127046", "0.7125858", "0.70920753", "0.7067504", "0.7059417", "0.70535374", "0.70514786", "0.7047238", "0.7047238", "0.7041376", "0.7039306", "0.70360017", "0.7035276", "0.7028563", "0.70174825", "0.7013754", "0.69918096", "0.6977924", "0.6977924", "0.6977431", "0.6976538", "0.6973059", "0.6973059", "0.69698876", "0.69615155", "0.69532037", "0.6950907", "0.69499284", "0.69499284", "0.6910792", "0.6904318", "0.69021857", "0.6892848", "0.68870294", "0.6886217", "0.6879897", "0.68737", "0.6869453", "0.68664193", "0.686587", "0.68563634", "0.6855945", "0.6852702", "0.68502295", "0.6849201", "0.6847103", "0.68410814", "0.6839024", "0.68389577" ]
0.0
-1
Pop an item off the stack. Remove the last item that was pushed onto the stack and return the value to the user
def pop # I RETURN A VALUE case object when condition @data nil then return print "nil\n" else print "{@data.asset}\n" @data = @data.next_node end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pop()\n return \"Stack is empty\" if is_empty\n\n temp = @stack[-1]\n @stack.delete_at(-1)\n @current_size -= 1\n\n return temp\n end", "def pop()\n @stack.pop\n end", "def pop()\n\t\[email protected]\n\tend", "def pop()\n # if the stack is empty, return nil\n # (it would also be reasonable to throw an exception)\n if @items.empty?\n return nil\n end\n return @items.pop()\n end", "def pop()\n @stack.shift\n end", "def pop()\n @stack.pop \n end", "def pop()\n @stack.pop\n end", "def pop\n @stack.shift\n end", "def pop\n #if the stack is already empty do nothing\n if empty?\n nil\n else\n #set popped equal to the element at index @top, which isthe top of the stack\n popped = @store[@top]\n #set the value at the top of the stack to nil\n @store[@top] = nil\n # subtract 1 from the value of @top\n @top = @top.pred #@top--\n #returns the value that was popped\n popped\n end\n end", "def pop()\n # if the stack is empty, return nil\n # (it would also be reasonable to throw an exception)\n if @items.empty?\n return nil\n end\n return @items.pop()\n end", "def pop\n @stack.pop\n end", "def pop\n @stack.pop\n end", "def pop\n if @items.nil?\n\t raise \"Empty Stack -- nothing can be poped\"\n end\n\tpt = @items\n\t@items = @items.next\n\tpt.next = nil\n\treturn pt.value\n end", "def pop\n # if there's nothing on the stack, you can't take anything off\n if empty?\n nil\n else\n # popped is going to take the thing at the index that is the top of our stack\n popped = @store[@top]\n # now we make that index nil\n @store[@top] = nil\n # now we move the @top marker to the index below, because that is our new top\n @top = @top.pred #@top--\n # explicit return of the item from the top of the stack\n popped\n end\n end", "def pop()\n\n\n # if the stack is empty, return nil\n # (it would also be reasonable to throw an exception)\n return nil if @items.empty?\n @max_stack.pop() if @max_stack.last == @items.last\n return @items.pop()\n end", "def pop\n stack.pop\n end", "def pop\n stack.pop\n end", "def pop # utility\n @stack.pop\n end", "def pop()\n @stack.pop\n end", "def pop\n self.top = @stack[1]\n @stack.shift\n end", "def pop\n return @stack.pop\n end", "def pop()\n stack.stack.pop if !empty?\n end", "def pop\n last_el = self.stack_var[-1] # not sure if method should return last el\n self.stack_var = self.stack_var[0...-1]\n last_el\n end", "def pop\n raise \"Stack Underflow - The stack is empty\" if self.is_empty?\n top_element = @store.pop\n @top -= 1\n top_element\n end", "def pop\n\t\t\t@last = @stack.pop||\"\"\n\t\t\t@last\n\t\tend", "def pop\n stack.pop\n end", "def pop!\n r = @stack.pop\n raise ArgumentError if r.nil?\n r\n end", "def pop() end", "def pop\n return @stack.pop\n end", "def pop\n raise(UnderflowError, \"There is no element to remove from the stack\") if empty?\n store.pop\n end", "def pop\n @stack.pop\n end", "def pop\n\t\[email protected]\n\tend", "def pop\n @stack.pop\n end", "def pop\n if @count > 0\n last_item_index = @count - 1\n\n # stores last element\n last_item = @items[last_item_index]\n\n # remove last item from array\n @items[last_item_index] = nil\n\n # reduces size by 1\n @count -= 1\n\n last_item\n else\n raise \"There are no items in the stack\"\n end\n end", "def pop()\n item = @stack.pop()\n if item == @maxs_stack.peek()\n @maxs_stack.pop()\n end\n return item\n end", "def pop()\n # if the stack is empty, return nil\n # (it would also be reasonable to throw an exception)\n if @items.empty?\n return nil\n end\n popped = @items.pop\n @max.pop if popped = @max.last\n return popped\n end", "def pop\n # if Stack is empty, cannot remove anything\n if empty?\n nil\n else\n # popped set equal to last element in @store array\n popped = @store[@top]\n # sets last element in @store array to nil\n @store[@top] = nil\n # sets @top equal to @top - 1 (so -2 the first time through, then -3, etc.) - there is still an empty slot in @store at index -1, but no actual element there\n @top = @top.pred #@top--\n # returns the element that was removed from @store/popped from Stack\n popped\n end\n end", "def pop()\n return @VAR_STACK.pop()\n end", "def pop()\n return @VAR_STACK.pop()\n end", "def pop\n raise EMPTY_STACK_ERROR if @data.empty?\n\n @data.pop\n end", "def stack_pop\n\n r = stack_fetch\n stack_unstack if r.class != Rufus::Lua::Table\n\n r\n end", "def pop\n @stackList.delete_at (@stackList.length - 1)\n postPopListener\n end", "def pop; end", "def pop; end", "def pop; end", "def pop; end", "def pop; end", "def pop()\n @VAR_STACK.pop()\n end", "def pop\n # assume head of @store is top of stack\n return @store.remove_first()\n end", "def pop\n raise StackUnderflow if empty?\n item = @start.info\n @start = @start.nxt\n item\n end", "def pop()\n self.min_stack.pop\n return self.stack.pop\n end", "def pop()\n return nil if @stack.empty?\n\n @max_stack.pop\n @stack.pop\n end", "def pop\n # check if stack is empty\n if @data.nil?\n return \"nil\"\n elsif @data.next_node != nil\n value = @data.value\n @data = @data.next_node\n return value\n else\n value = @data.value\n @data = @data.next_node\n return value\n end\n end", "def pop\n raise StackUnderflow if empty?\n @index -= 1\n @info[@index]\n end", "def pop()\n return \"Stack is empty\" if is_empty\n\n if @head.next == nil\n temp = @head.value\n @head = nil\n return temp\n end\n\n temp = @head.value\n @head = @head.next\n @current_size -= 1\n\n return temp\n end", "def pop\r\n top_item = data.value\r\n @data = data.next_node\r\n return top_item\r\n end", "def pop()\n \n end", "def pop()\n \n end", "def pop()\n \n end", "def pop\n value2Return = nil\n if @data == nil\n puts \"Stack is empty\" \n else\n value2Return = @data.value\n @data = @data.next_node\n end\n value2Return\n end", "def pop\n @stack.shift\n self\n end", "def pop()\n if @stacks.empty?\n -1\n else\n reset_left_right(@stacks.size-1, true)\n end\n end", "def pop\r\n # IMPLEMENT ME\r\n end", "def pop\n if empty?\n nil\n else\n popped = @store[@top]\n @store[@top] = nil\n #decrement top\n @top = @top.pred\n popped\n end\n end", "def pop\n if empty?\n nil\n else\n popped = @store[@top]\n @store[@top] = nil\n #decrement top\n @top = @top.pred\n popped\n end\n end", "def pop()\n @min_stack.pop if @min_stack[-1] == @stack[-1]\n @stack.pop; nil \n end", "def remove\n @stack.pop\n end", "def remove\n @stack.pop\n end", "def remove\n if @pop_stack.is_empty?\n transfer(@push_stack, @pop_stack)\n end\n\n @pop_stack.pop\n end", "def pop\n end", "def pop()\n @min_stack.pop() if @min_stack[-1] == @stack[-1]\n @stack.pop()\n end", "def pop\n # store top value in variable\n node_value = @data.value\n # replace top node with next node in stack\n @data = @data.next_node\n # return top node value\n return node_value\n end", "def pop\n if @top == nil\n return \"nil\"\n else\n value = @top.value\n @top = @top.next_node\n return value\n end\n end", "def pop\n raise \"stack underflow\" if empty?\n super\n end", "def pop()\n head = @head\n if head == nil then\n return nil\n end\n @head = head.prev\n return head.val\n end", "def pop\n if self.empty?\n raise UnderflowError, \"The stack is empty!\"\n else\n @mini_stack.pop\n @maxx_stack.pop\n @stak.pop\n end\n end", "def take_from_stack\n stack.pop\n end", "def pop\n # I RETURN A VALUE\n return nil if @top.nil?\n original_top = @top.value\n @top = @top.next_node\n original_top\n end", "def pop\n if(@stk.empty?)\n\t p \"Stack empty\"\n\telse\n\t @stk[@count] = nil\n\t @count = @count - 1\n\tend\n end", "def pop\n\t\t\traise EmptyStackError, \"Empty stack\" if STACK.empty?\n\t\t\treturn STACK.pop unless @frozen\n\t\t\tif @pushed > 0 then\n\t\t\t\t@pushed -= 1\n\t\t\t\tSTACK.pop\n\t\t\telse\n\t\t\t\traise EmptyStackError, \"Empty stack\" if @frozen <= 0\n\t\t\t\t@popped += 1\n\t\t\t\tSTACK[@frozen-@popped]\n\t\t\tend\t\n\t\tend", "def pop_at_stack(index)\n \n end", "def pop\n # IMPLEMENT ME\n end", "def pop\n raise IndexError.new if @data.size == 0\n ret = @data[0]\n @data[0] = @data[@data.size - 1]\n @data = @data.take(@data.size - 1)\n percolate_down\n return ret\n end", "def pop_stack\n raise ArgumentError if @array_list.empty?\n\n @array_list.pop\n end", "def pop\n if empty?\n nil\n else\n @q.remove\n @stack.shift\n end\n end", "def pop\n # begining of if statement\n # if the method empty? returns true\n if empty?\n #return nil\n nil\n # if the method empty? returns false\n else\n # assign to the the local var popped the value in the array @store\n # that is is the array position of the value of @top\n popped = @store[@top]\n # assign the value nil to the positon of the value of @top in the array @store\n @store[@top] = nil\n # subtract one from the value of the instance var @top\n # and assign the value back to the instance var @top\n @top = @top.pred\n # return the value of the local var popped\n popped\n # end if/else statement\n end\n # end pop method\n end", "def pop\n pull_top = @data.value\n @data = @data.next_node\n return pull_top\n end", "def pop\n if @data\n top = @data.value\n @data = @data.next_node\n return top\n else\n return 'nil'\n end\n end", "def pop\r\n return nil if @top_node.nil?\r\n temp_node = @top_node\r\n @top_node = temp_node.next_node\r\n return temp_node.value\r\n end", "def last_popped_stack_elem\n @stack[@sp]\n end", "def pop_tree\n @tree_stack.pop\n end", "def pop()\n @data.pop\n end", "def pop\n return nil if @count == 0\n\n # get the index of the las titem\n @store.store.reverse.each_with_index do |ele, i|\n if ele != nil \n @last_ele = capacity() - (i+1) \n break\n end\n end\n #val = @store.store.delete_at(@last_ele)\n val = @store.store[@last_ele]\n @store.store[@last_ele] = nil\n @count -= 1\n return val\n end", "def pop\n return false if empty?\n @len -= 1\n @stack[@len]\n end", "def pop\n curr = items\n ret = curr.pop\n\n serialize(curr)\n\n ret.nil? ? nil : ret\n end", "def pop\n\t\tif (!@head) then return nil end\n\t\ttemp = @head\n\t\t@head = @head.get_next()\n\t\tif (@head) then @head.set_prev(nil)\n\t\telse @tail = nil\n\t\tend\n\t\t@size -= 1\n\t\treturn temp.get_item()\n\tend", "def pop(tape)\n\ta = Array.new\n\t# Move back to the stack seperator\n\ta.push Action.new(:left, tape)\n\n\t# Erase the stack seperator and the value\n\t(BitWidth + 1).times{\n\t\ta.push Action.new(BlankSymbol, tape)\n\t\ta.push Action.new(:right, tape)\n\t}\n\n\tm = SubMachine.empty \"pop-#{tape}\"\n\tm.states[m.first].transitions = [Transition.new( Hash.new, a, m.last)]\n\n\t# Now we're on top of the last bit of the prev. value on stack\n\tm2 = moveDistance(tape, (2*BitWidth) + 1, :left)\n\tm.simpleMerge(m2)\n\n\tm\nend", "def pop\n list.pop\n end", "def pop\n CGContextRestoreGState(@ctx)\n @stacksize = @stacksize - 1\n end", "def pop\n delete_at(0)\n end", "def pop\n\t item = @items.pop()\n\t # if the popped item is the highest, remove it from the max\n\t @max.pop() if item == @max.last\n\t item\n\tend" ]
[ "0.8281595", "0.8271597", "0.82563424", "0.8236934", "0.82280934", "0.82206804", "0.8207868", "0.81872433", "0.8170618", "0.81693214", "0.8160252", "0.8160252", "0.81491375", "0.8129435", "0.8104122", "0.81022996", "0.81022996", "0.8091357", "0.80838317", "0.80675715", "0.805975", "0.8052753", "0.80172235", "0.80117977", "0.8010862", "0.8010384", "0.79834765", "0.7945814", "0.79415524", "0.79362804", "0.7926302", "0.789537", "0.7870778", "0.7869498", "0.7869093", "0.78511375", "0.7796711", "0.77867514", "0.77867514", "0.7759189", "0.77540076", "0.77524", "0.77300763", "0.77300763", "0.77300763", "0.77300763", "0.77300763", "0.77050465", "0.766311", "0.76542723", "0.7643534", "0.7643436", "0.7630901", "0.76234394", "0.75962174", "0.75934714", "0.7559857", "0.7559857", "0.7559857", "0.7545243", "0.7534955", "0.749899", "0.7486749", "0.74782133", "0.74782133", "0.74779767", "0.7462335", "0.7462335", "0.7460094", "0.7456902", "0.7443485", "0.7399099", "0.7376461", "0.7332984", "0.7302213", "0.73000884", "0.7294529", "0.72873485", "0.72841144", "0.7280319", "0.7276197", "0.7272551", "0.72706676", "0.7255389", "0.72534835", "0.72361267", "0.7220157", "0.7200733", "0.71918344", "0.71645236", "0.7150445", "0.7146887", "0.71317554", "0.7113293", "0.71113807", "0.7105907", "0.71054196", "0.7077469", "0.70722425", "0.70681053", "0.7062937" ]
0.0
-1
Play Hangman from initial options
def play display_welcome while true choice = get_menu_choice choice_result = handle_menu_choice choice break if choice_result == :quit end puts "Thanks for playing Hangman :-) Play again soon." end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run\n puts \"Welcome to the Hangman game. You will need 2 players.\"\n\n h = Hangman.new # this creates a new instance of the game\n h.getWord\n h.welcomePlayer2\n\n h.startGuess\n\n #h.displayHangman\n\nend", "def introduce_the_game\n @irc_server.puts \"Welcome to hangman!\"\n @irc_server.puts \"To get started, enter a word to be guessed\"\n end", "def initialize\n\t\tsystem \"clear\"\n\t\tputs \"Lets play hangman!\"\n \t\t@guess_count = 0\n \t\t@game_status = false\n \t\t@guessed_letters=[]\n \t\t@guessing_word=[]\n \tend", "def start_screen()\n puts \"Welcome to Hangman.\"\n puts \"'N' to start a new game, 'L' to load!\"\n choice = gets.chomp.upcase\n if choice == 'N'\n self.play\n elsif choice == 'L'\n load_game\n else\n puts \"Please choose 'N' or 'L' next time.\"\n puts \"For now the culprit's fate is spared. Take care!\"\n end\n end", "def welcome\n\t\tputs \"Welcome to Hangman!\\n\\n\"\n\t\tputs \"The computer has selected a random secret word for you to guess.\\n\"\n\t\tputs \"Be careful - you have 6 incorrect guesses before you hang the man!\"\n\tend", "def display_welcome\n\t\tputs \"\\t**************************\"\n\t\tputs \"\\t*** Welcome To Hangman ***\"\n\t\tputs \"\\t**************************\"\n\tend", "def round_start\n puts 'Welcome to Hangman!'\n puts \"The word is #{@secret_word.length} characters long.\"\n print_teaser\n player_guess\n end", "def start_game\r\n\t puts \"Welcome to Hangman! A secret word has been chosen. You have #{turn_count} guesses to get the word correct. Good luck!\"\r\n\t (@secret_word.size).times { @correct_letters += \"_ \" }\r\n\t puts @correct_letters\r\n\t begin_guessing\r\n\tend", "def test_hangman_logic()\r\n\thangman = Hangman.new('programming')\r\n\t\r\n\tputs hangman\r\n\t\r\n\t['a', 'b', 'i', 'e', 'o'].each() do |letter|\r\n\t\thangman.guess(letter)\r\n\tend\r\n\t\r\n\tputs hangman.status()\r\n\r\n\t# test win\r\n\t'programming'.split('').each() do |letter|\r\n\t\thangman.guess(letter)\r\n\tend\r\n\t\r\n\tputs hangman.status()\r\n\t\r\n\t# test loss\r\n\tputs\r\n\thangman = Hangman.new('ruby')\r\n\t\r\n\tputs hangman\r\n\t\r\n\t['a', 'u', 'i', 'e', 'o'].each() do |letter|\r\n\t\thangman.guess(letter)\r\n\tend\r\n\t\r\n\tputs hangman.status()\r\n\t\r\n\thangman.guess('s')\r\n\thangman.guess('t')\r\n\t\r\n\tputs hangman.status()\r\nend", "def welcome\n clear\n output \"Welcome to Hangman\"\n output \"==================\"\n blank_line\n end", "def play_options(prompt)\n choices = [\n {name: \"Hit\", value: 1},\n {name: \"Stand\", value: 2},\n {name: \"Exit\", value: 3}\n ]\n chosen_option = prompt.select(\"What would you like to do?\", choices, help_color: :yellow, help: \"(Use Keybvoard keys)\", show_help: :start, filter: true)\nend", "def interface\r\n# \ti. Welcome message\r\nputs \"Welcome the world of hangman\"\r\n# \tii. Ask first user for the hangman word\r\nputs \"Enter a word for the other player to guess:\"\r\n# \tiii. Create a variable w/ a database for that word.\r\nword = gets.chomp.downcase\r\nhangman = Hangman.new(word)\r\n# \tiv. Loop that so that they can keep inputting until all of their guesses are used up.\r\nputs \"Enter a letter to guess: \"\r\nuntil hangman.end_game == true\r\n\tp hangman.guessed\r\n#\tputs \"Input your guess (input a single letter): \"\r\n\t\tletter_guessed = gets.chomp.downcase\r\n\t\tuntil hangman.guess_check(letter_guessed) == true\r\n\t\t\tletter_guessed = gets.chomp.downcase\r\n\t\tend#until\r\n\t\t#v. call it and check to see if end game\r\n\t\thangman.guess(letter_guessed)\r\n\t\thangman.check_end_game\r\nend# until\r\nputs \"Endgame - Restart Program to Play Again.\"\r\nend", "def print_welcome\n puts \"Welcome to Hangman!\"\n puts \"Guess the word: or be hung!\"\n puts \"Remember that you after 10 letter guesses you lose.\"\n end", "def help(m)\n m.reply \"See: !help karma\"\n end", "def help(m)\n m.reply \"See: !help learning\"\n end", "def hangman\n game = Game.new\n game.new_or_load\n hangman if game.play_again\nend", "def program_start\n\t\tputs \"Let's play a round of Hangman!\"\n\t\tputs \"Would you like to start a new game or do want to load an old saved game lying around? Choose from:\"\n\t\tputs \"- New\"\n\t\tputs \"- Load\"\n\t\tstart_choice = gets.chomp.downcase\n\t\tputs \"\"\n\t\tif (start_choice == \"new\")\n\t\t\tstart_game(new_word)\n\t\telsif (start_choice == \"load\")\n\t\t\tload_game\n\t\telse\n\t\t\tputs \"Your input was invalid, program starting again...\\n\\n\"\n\t\t\tprogram_start\n\t\tend\n\tend", "def play_options(prompt)\r\n choices = [\r\n {name: \"Hit\", value: 1},\r\n {name: \"Stand\", value: 2},\r\n {name: \"Exit\", value: 3}\r\n ]\r\n chosen_option = prompt.select(\"What would you like to do?\", choices, help_color: :yellow, help: \"(Use Keyboard Arrow Keys)\", show_help: :start, filter: true)\r\nend", "def initialize\n @guesses = 0\n @hangman = [\n \"\n\n\n\n\n \",\n \"\n\n\n\n\n --------\",\n \"\n |\n |\n |\n |\n --------\",\n \" _____\n |\n |\n |\n |\n --------\",\n \" _____\n | |\n o |\n |\n |\n --------\",\n \" _____\n | |\n o |\n | |\n |\n --------\",\n \" _____\n | |\n o |\n /| |\n |\n --------\",\n \" _____\n | |\n o |\n /|\\\\ |\n |\n --------\",\n \" _____\n | |\n o |\n /|\\\\ |\n / |\n --------\",\n \" _____\n | |\n o |\n /|\\\\ |\n / \\\\ |\n --------\"\n ]\n end", "def print_hangman(mistakes)\n puts @status_image[mistakes]\n end", "def make_wild_guesses!(bool = true)\n if bool\n @options.delete('-P')\n @options.unshift('-m')\n else\n @options.delete('-m')\n @options.unshift('-P')\n end\n restart!\n end", "def start_new_game\n puts \"Welcome to Hangman! Try to guess my secret word!\"\n puts\n game_id = get_num_saved_games\n return HangmanGameState.new(game_id)\n end", "def hammer\n\t\tputs \"A nice gentle bangabang\"\n\tend", "def learning_help(m)\n m.reply \"Learning module\"\n m.reply \"===========\"\n m.reply \"Description: Teach the bot about things, and have it repeat that info back later.\"\n m.reply \"Usage: [botname] [thing] is [information] (to store additional [information] under the keyword [thing].)\"\n m.reply \"[botname] [thing] (to get whatever the bot knows about [thing].)\"\n end", "def print_hangman\n puts \"------------------------------------------------\"\n puts \"\"\n hangman_partial = @incorrect_letters.size - 1\n puts \"#{@hangman[hangman_partial]}\" if hangman_partial >= 0\n puts \"\"\n print \"Incorrect letters: \"\n @incorrect_letters.each { |letter| print \"#{letter} \" }\n print \"\\n\\n\"\n puts \"#{@progress}\"\n puts \"\"\n end", "def command_help(m)\n m.user.send [\n \"!next - When's the next live show?\",\n \"!schedule - What shows are being recorded live in the next seven days?\",\n \"!suggest - Be heard. Suggest a title for the live show.\",\n \"!link - Know the link for that? Suggest it and make the show better.\",\n \"!current - What's playing on #{shared[:Live_Url]}? I've got you covered.\",\n \"!last_status - The last tweet by @#{shared[:Twitter_User].join(\", @\")} delievered to you in IRC. Sweet.\",\n \"!about - Was #{shared[:Bot_Nick]} coded or did it spontaniously come into existence?\",\n \"!help - Uh, this.\",\n ].join(\"\\n\")\n end", "def help(m)\n p = self.class.prefix.call(m)\n m.reply(\"See: #{p}help karma\")\n end", "def display_hangman(step)\n out = mask_string \" ____ \\n\" +\n \" |/ | \\n\" +\n \" | O \\n\" +\n \" | /|\\\\ \\n\" +\n \" | / \\\\ \\n\" +\n \"/|\\\\ \",\n \" 4444 \\n\" +\n \" 15 6 \\n\" +\n \" 1 7 \\n\" +\n \" 1 98a \\n\" +\n \" 1 b c \\n\" +\n \"213 \", step\n puts out\n out\nend", "def game_start_human_codebreaker\n reset_instance_variables_values\n start_game_welcome_human(@human.name)\n choices\n print_colorized_array(COLORS)\n end", "def start\n begin\n Ui.print_formatted WELCOME_MESSAGE\n loop do\n choice = UserInputHandler.request_input @options_msg.join(\"\\n\")\n execute_choice(choice)\n end\n rescue StandardError => e\n handle_error(e)\n end\n end", "def hike_options\n system 'clear'\n puts \"-----MY HIKES-----\"\n menu = [\"Start New Hike\",\n \"End Hike\",\n \"Edit Hike\",\n \"List All My Hikes\",\n \"Exit\"]\n\n choice = @prompt.select(\"Which option would you like to take?\", menu)\n\n case choice\n when \"Start New Hike\"\n start_hike\n when \"End Hike\"\n end_hike\n when \"Edit Hike\"\n edit_options\n when \"List All My Hikes\"\n list_user_hikes\n end\n\n end", "def run\n greet\n menu\n end", "def playAgain()\n puts \"Would you like to play again? Yes (Y) or No (N)\"\n playAgain = $stdin.gets.chomp\n if playAgain.downcase == \"y\" || playAgain.downcase == \"yes\"\n playHangmanAgain = HangMan.new\n elsif playAgain.downcase != \"n\" && playAgain.downcase != \"no\" && playAgain.downcase != \"y\" && playAgain.downcase != \"yes\"\n puts \"That's not an option. Please enter Yes (Y) or No (N)\"\n playAgain()\n else\n puts \"Goodbye !\"\n @numOfGuesses = 11\n @foundWord = true\n end\n \n end", "def options\n opts = GetoptLong.new( \n [ \"--uptwitter\", \"-t\", GetoptLong::REQUIRED_ARGUMENT ],\n [ \"--upjabber\", \"-j\", GetoptLong::REQUIRED_ARGUMENT ],\n [ \"--delay\", \"-d\", GetoptLong::OPTIONAL_ARGUMENT ],\n [ \"--filter\", \"-f\", GetoptLong::OPTIONAL_ARGUMENT ],\n [ \"--help\", \"-h\", GetoptLong::NO_ARGUMENT ],\n [ \"--quiet\", \"-q\", GetoptLong::NO_ARGUMENT ]\n )\n \n def printusage(error_code)\n print \"twammer -- Send your Twitters to Yammer\\n\"\n print \"Usage: ./twammer -t STR:STR -j STR:STR [OPTIONS]\\n\"\n print \"\\n\"\n print \"Allowed options:\\n\"\n print \" -t, --uptwitter STR Twitter user:pass\\n\"\n print \" -j, --upjabber STR Jabber user:pass setup with Yammer IM\\n\"\n print \" -d, --delay MINUTES How far to look back for tweets (default: 15mins)\\n\"\n print \" -f, --filter STR Only send on messages with #<filter> in\\n\"\n print \" -h, --help Shows this help\\n\"\n print \" -q, --quiet Display, but don't actually send messages\\n\"\n print \"\\n\"\n print \"Examples:\\n\"\n print \" ./twammer -t [email protected]:mypass -j [email protected]:mypass1 -f bbc\\n\"\n print \" ./twammer -t [email protected]:mypass -j [email protected]:mypass1 -d 10 -q\\n\"\n print \"\\n\"\n exit(error_code)\n end\n \n begin\n o = {}\n\n opts.each do |opt, arg|\n\n case opt\n when \"--uptwitter\"\n o[:tuser], o[:tpass] = arg.split(':')\n if o[:tuser].nil? or o[:tpass].nil?\n puts \"Arg Missing --uptwitter required\"\n exit 0\n end\n when \"--upjabber\"\n o[:juser], o[:jpass] = arg.split(':')\n if o[:juser].nil? or o[:jpass].nil?\n puts \"Arg Missing --upjabber required\"\n exit 0\n end\n when \"--delay\"\n o[:delay] = arg || 15 \n when \"--filter\"\n o[:filter] = arg || nil \n when \"--help\"\n printusage(0)\n when \"--quiet\"\n o[:quiet] = true\n end\n\n end\n\n return o\n rescue \n printusage(1)\n end\nend", "def start_message\n\tputs \"\\t\\t\\t-- WORD MASTERMIND --\"\n puts \"\\n\\tYou will be given a 5 letter word and you must guess what the word is.\"\n puts \"\\n\\tYou are allowed a maximum of 10 guesses per round.\"\n\tputs \"\\n\\t\\tEnter '/' key to stop playing.\"\nend", "def get_foreman_list(debug,thing,passwd)\n hammer_cmd = \"hammer --output yaml\"\n if debug == true\n hammer_cmd = hammer_cmd + \" --debug\"\n end\n if passwd !=nil\n hammer_cmd = hammer_cmd + \" --password #{passwd}\"\n end\n hammer_cmd = hammer_cmd + \" #{thing} list\"\n\n list = YAML.load(`#{hammer_cmd}`)\n return list\nend", "def welcome\n puts message_list[:welcome]\n # help\n end", "def start\n jammit\n end", "def start!\n puts intro\n get_name\n player.enter_room\n loop {get_option}\n end", "def respond_to_guess(letter)\n letter = letter.clone.downcase\n\n if @incorrect_letters.include?(letter) || @progress.include?(letter) || @progress.include?(letter.upcase)\n puts \"You already guessed that letter!\"\n puts \"\"\n elsif @word.include?(letter) || @word.include?(letter.upcase)\n update_progress(letter)\n unless @progress.include?(\"_\")\n @round_finished = true\n @guessed = true\n end\n else\n @incorrect_letters << letter\n @round_finished = true if @incorrect_letters.size == 6\n end\n print_hangman\n end", "def hook_thyself\n me = self;\n\n # Show blacklist\n register_command(:omeg_blacklist_show, /^[Oo]megleBlacklist$/, /channel/){\n me.report_blacklist(bot, channel)\n }\n \n # Toggle use of blacklist for a user \n register_command(:omeg_blacklist, /^[Tt]oggleMe$/, /channel/){\n me.toggle_blacklist(bot, channel, nick)\n }\n\n # Toggle use of nick template\n register_command(:omeg_toggle, /^[Tt]oggleNick$/, /channel/){\n me.toggle_nick(bot, channel)\n }\n\n # Connect to a single stranger with <nickname> support\n register_command(:omeg_connect, /^[Oo]megle$/, /channel/){|*topics|\n me.ensure_not_blacklisted(channel, nick)\n me.summon_omegleite(bot, channel, topics)\n }\n \n # Connect to a single stranger with <nickname> support\n register_command(:omeg_ask, /^[Aa]skMe$/, /channel/){\n me.ensure_not_blacklisted(channel, nick)\n me.summon_omegleite(bot, channel, nil, true)\n }\n\n # Spy mode, ask a question and watch two people debate.\n register_command(:omeg_spy, /^[Aa]sk$/, /channel/){|*question|\n if(question.length < 0)\n bot.say(\"Please provide a question!\")\n else\n me.spy_mode(bot, channel, question.join(\" \"))\n end\n }\n\n end", "def play\n\t\twelcome\n\t\task_name\n\t\task_name2 \n\t\task_input\n\t\tturns\n\tend", "def start\n send_message('Hello! Welcome to Hedma store🥰')\n send_message('Which item do you want to buy, dear customer?')\n user.set_next_bot_command('pants')\n end", "def home\n @prompt = TTY::Prompt.new\n clear_terminal\n divider\n choice = @prompt.select(\"Hi,#{@user.name} what do you want to do today?\\n\",\n [\"Look for player information\",\"Look for club information\",\"Look for league information\", \"Trivia\"],\"-> Quit\",\"-> Restart\" )\n divider\n case choice\n when \"Look for player information\"\n players_home\n when \"Look for club information\"\n club_identification\n when \"Look for league information\"\n leagues_home \n when \"Trivia\"\n intro_trivia\n when \"3\"\n league_home\n when \"-> Quit\" || \"QUIT\"\n when \"-> Restart\" || \"RESTART\"\n run\n else\n puts \"Oops you miss the goal, try again...\"\n pause\n home\n end\n end", "def about\n cmds = String.new \"\"\n @cmds.each_pair {|k,v| (cmds << \" #{k}\") if not @my_cmds.include? k }\n self.say \"These are the current recognized commands: \\0037 #{cmds}\"\n #greets = @greetings.collect {|x| ' '+x}\n self.say \"I also respond to the following greetings (and my name): \\0036 Hi, Hello, Hey, Hay, Hola, Sup, Whats up, Yo\"\n self.say \"What do I do? What don't I do is more like it. I keep logs of the IRC channel, I ask trivia questions, I search for php functions, and I can even say things if you know the right command. Heck, I am so stuck up, I can't stop saying I!\"\n end", "def congrats\n\t\tp \"Congrats on Guessing the Word\"\n\tend", "def play_game\n\n $world.look\n while true\n print \"> \"\n $stdout.flush\n line = random_input\n puts \"#{line}\"\n\n args = line.split(' ')\n verb = args.first\n begin\n $world.__send__(verb.intern, *args[1..-1])\n rescue NoMethodError\n puts \"I don't know how to \\\"#{verb}\\\".\"\n end\n end\n\nend", "def initialize\n @difficulty = 0\n @word_to_guess\n @theme = \"\"\n puts \"Welcome to Word Guess!\".blink\n prompt\n end", "def draw_hangman\n puts @hangman[@guesses]\n end", "def help()\n\tputs \"Hier is een lijst handige commando's die je gaan helpen met je quest:\"\n\tputs \"ga (richting): Ga in de gespecificeerde richting\"\n\tputs \"open: open deuren, kisten, je hart, etc\"\n\tputs \"kijk: Krijg een beschrijving van de kamer waar je nu bent\"\n\tputs \"neem: Neem een item en stop het in je inventory\"\n\tputs \"gebruik X op X: Gebruik een item uit je inventory op een object\"\n\tputs \"inventory: Bekijk je inventory\"\n\tputs \"stop: Stop de game\"\nend", "def start_game\n Dir.mkdir(\"save\") unless Dir.exists? \"save\"\n puts \"\"\n puts \"Welcome to Hangman!\"\n puts \"\"\n game_choice\n puts \"\"\n puts \"Try to guess the secret word. You have #{@guesses_left} guesses.\"\n get_word\n create_blanks\n take_turn\n end", "def how_to\n system(\"clear\")\n font = font_instance\n prompt = prompt_instance\n file = File.read('how_to_play.json')\n how_to=JSON.parse(file)\n puts font.write(\"How To Play\")\n puts how_to \n prompt.select(\"\", show_help: :never) do |menu|\n menu.choice \"Back\", -> {start_menu} \n end\nend", "def display_help\n print(\n \"\n\nruby fuzzer.rb [discover | test] url OPTIONS\n\nCOMMANDS:\n discover Output a comprehensive, human-readable list of all discovered inputs to the system. Techniques include both crawling and guessing.\n test Discover all inputs, then attempt a list of exploit vectors on those inputs. Report potential vulnerabilities.\n\nOPTIONS:\n --custom-auth=string Signal that the fuzzer should use hard-coded authentication for a specific application (e.g. dvwa). Optional.\n\n Discover options:\n --common-words=file Newline-delimited file of common words to be used in page guessing and input guessing. Required.\n\n Test options:\n --vectors=file Newline-delimited file of common exploits to vulnerabilities. Required.\n --sensitive=file Newline-delimited file data that should never be leaked. It's assumed that this data is in the application's database (e.g. test data), but is not reported in any response. Required.\n --slow=1 Number of seconds considered when a response is considered \\\"slow\\\". Default is 1 second\n\nExamples:\n # Discover inputs\n fuzz discover http://localhost:8080 --common-words=mywords.txt\n\n # Discover inputs to DVWA using our hard-coded authentication\n fuzz discover http://localhost:8080 --common-words=mywords.txt\n\n \")\n exit\nend", "def initialize(word)\n # This is just some a printout of the game at initialization\n puts \"\n POORMAN's\n ___ ___ ____ ____ __ ____ ___ ___ _____ ____ __\n / / / / / _ | | \\\\ | | / ___\\\\ | \\\\ / | | _ \\\\ \\\\ \\\\_ \\\\ \\ \n / /__/ / / /_| | | |\\\\ \\\\| | | | ___ | |\\\\ \\\\ / /| | | |_\\\\ \\\\ \\\\ \\\\ \\\\ \\\\\n / ___ / / ___ | | | \\\\ | | |__| | | | \\\\ \\\\/ / | | | ___ \\\\ \\\\ \\\\\\\\ \\\\_\\\\ \\\\ \n /__/ /__/ /__/ |_| |_| \\\\__| \\\\____/ |_| \\\\__/ |_| |_| \\\\__\\\\ |_| \\_____|\n \n \"\n\n # instance variables for HangMan Class\n @word = word\n\n ## LOGIC: This is to set the number of guesses based on the length of the word\n if @word.length >= 12\n @guess_count = 9\n elsif @word.length >= 10 && @word.length < 12\n @guess_count = 8\n elsif @word.length >= 8 && @word.length < 10\n @guess_count = 7\n elsif @word.length >= 6 && @word.length < 8\n @guess_count = 6\n else\n @guess_count = 5\n end\n ## End of Logic\n\n @is_correct = false # Flag to see if the guess is correct\n # Nifty code to set a prompt variable with a bunch if underscores\n # Note the length of the underscores matches the length of the word\n @prompt = String.new(str=\"_\") * word.length\n @guess_history = Array.new # A guess history array to store guesses\n end", "def help\n puts \"I accept the following commands:\"\n puts \"- help : displays this help message\"\n puts \"- list : displays a list of songs you can play\"\n puts \"- play : lets you choose a song to play\"\n puts \"- exit : exits this program\"\nend", "def help\n puts \"I accept the following commands:\"\n puts \"- help : displays this help message\"\n puts \"- list : displays a list of songs you can play\"\n puts \"- play : lets you choose a song to play\"\n puts \"- exit : exits this program\"\nend", "def help\n puts \"I accept the following commands:\"\n puts \"- help : displays this help message\"\n puts \"- list : displays a list of songs you can play\"\n puts \"- play : lets you choose a song to play\"\n puts \"- exit : exits this program\"\nend", "def help\n puts \"I accept the following commands:\"\n puts \"- help : displays this help message\"\n puts \"- list : displays a list of songs you can play\"\n puts \"- play : lets you choose a song to play\"\n puts \"- exit : exits this program\"\nend", "def help\n puts \"I accept the following commands:\"\n puts \"- help : displays this help message\"\n puts \"- list : displays a list of songs you can play\"\n puts \"- play : lets you choose a song to play\"\n puts \"- exit : exits this program\"\nend", "def help\n puts \"I accept the following commands:\"\n puts \"- help : displays this help message\"\n puts \"- list : displays a list of songs you can play\"\n puts \"- play : lets you choose a song to play\"\n puts \"- exit : exits this program\"\nend", "def start_game()\n playing = true\n\n puts \"\\nWelcome to Hangman!\"\n sleep(@@sleep_time)\n puts \"Enter \\\"save\\\" at any time to save your game\\n\\n\"\n sleep(@@sleep_time)\n while playing\n sleep(@@sleep_time)\n # display which correct letters have already been chosen and \n # which incorrect letters have already been chosen\n @word.split('').each_with_index { |char, i|\n if @is_guessed_array[i]\n print \"#{char} \"\n else\n print \"_ \"\n end\n }\n\n puts \"\\nNumber of guesses remaining: #{@max_incorrect - @num_incorrect}\"\n print \"\\nGuess a character (or save your game): \"\n guess = gets.chomp\n if guess.downcase == \"save\"\n # serialize the Hangman object\n sleep(@@sleep_time)\n puts \"Your game was saved in saved_game.yaml\"\n return true\n end\n # get index of first occurrence of the guessed character in the correct word\n guess_index = @word.downcase.index(guess)\n # get indices of all occurrences of the guessed character in the correct word\n indices = ([email protected]).find_all { |i| @word.downcase[i] == guess.downcase }\n\n if guess_index != nil && @is_guessed_array[guess_index] == false\n # guess is correct\n puts \"Correct!\"\n indices.each { |index| @is_guessed_array[index] = true }\n else\n # guess is incorrect\n puts \"Incorrect!\"\n @num_incorrect += 1\n end\n\n puts\n if !@is_guessed_array.include?(false)\n sleep(@@sleep_time)\n puts \"You win!\"\n puts \"The word was #{@word}\"\n playing = false\n elsif @num_incorrect == @max_incorrect\n sleep(@@sleep_time)\n puts \"You lose!\"\n puts \"The word was #{@word}\"\n playing = false\n end\n end\n return false\n end", "def main\n system('cls')\n puts '***************************************************************'\n puts '* Welcome to Word Mastermind *'\n puts '***************************************************************'\n puts ''\n puts ' Welcome to Mastermind!'\n puts ''\n puts 'The game will randomly choose a five letter word, its your job'\n puts 'to guess the word'\n puts ''\n puts 'Each word will only have 1 occurance of any given letter and'\n puts 'after each round the game will let you know if the letters in'\n puts 'your guess are:'\n puts '- In the game word and in the right place'\n puts '- In the game word but in the wrong place'\n puts '- Not in the Game word'\n puts ''\n puts ''\n puts 'Good Luck!'\n puts ''\n puts ' Press G to start the game!'\n puts ' Press Q to quit!'\n puts ''\n print 'Option:'\n end", "def play\r\n @secret_word = get_random_word\r\n @secret_word_letters = @secret_word.chars.to_a\r\n print_instructions\r\n play_loop\r\n end", "def display_help\n print(\n \"\n\nruby fuzzer.rb [discover | test] url OPTIONS\n\nCOMMANDS:\n discover Output a comprehensive, human-readable list of all discovered inputs to the system. Techniques include both crawling and guessing.\n test Discover all inputs, then attempt a list of exploit vectors on those inputs. Report potential vulnerabilities.\n\nOPTIONS:\n --custom-auth=string Signal that the fuzzer should use hard-coded authentication for a specific application (e.g. dvwa). Optional.\n\n Discover options:\n --common-words=file Newline-delimited file of common words to be used in page guessing and input guessing. Required.\n\n Test options:\n --vectors=file Newline-delimited file of common exploits to vulnerabilities. Required.\n --sensitive=file Newline-delimited file data that should never be leaked. It's assumed that this data is in the application's database (e.g. test data), but is not reported in any response. Required.\n --random=[true|false] When off, try each input to each page systematically. When on, choose a random page, then a random input field and test all vectors. Default: false.\n --slow=500 Number of milliseconds considered when a response is considered \\\"slow\\\". Default is 500 milliseconds\n\nExamples:\n # Discover inputs\n fuzz discover http://localhost:8080 --common-words=mywords.txt\n\n # Discover inputs to DVWA using our hard-coded authentication\n fuzz discover http://localhost:8080 --common-words=mywords.txt\n\n # Discover and Test DVWA without randomness\n fuzz test http://localhost:8080 --custom-auth=dvwa --common-words=words.txt --vectors=vectors.txt --sensitive=creditcards.txt --random=false\\n\"\n )\n exit\nend", "def main\n puts \"Welcome to the Ada Slack CLI!\"\n @workspace = Slack::Workspace.new\n\n choice = get_user_input\n until (OPTIONS[-1].include? choice) #checks for quit command from user\n perform_action(choice)\n choice = get_user_input\n end\n puts \"\\n>>>>>> Thank you for using the Slack CLI! Goodbye.\"\nend", "def help\n send_command \"--help\"\n end", "def make_guess\n\t\tget_colors_from_player MAKE_GUESS_PROMPT\n\tend", "def setup_player(options = {})\n default_chips = 100\n if options[:bot]\n who = 'AI player'\n default_name = 'Kenny'\n else\n who = 'your player'\n default_name = 'Human'\n end\n\n @output.puts \"Setting up #{who}.\"\n @output.print \"Name [#{default_name}]: \"\n name = @input.gets.chomp\n name = default_name if name.empty?\n\n @output.print \"Chips [#{default_chips}]: \"\n chips = @input.gets.chomp.to_i\n chips = default_chips if chips.zero?\n\n return Gambler::Player.new(name, :chips => chips)\n end", "def respond_to_guess(guess)\n\t\t@guessed_letters << guess\n\t\t@secret_word.split(\"\").include?(guess)\t\n\tend", "def how_to_play(user)\n puts \"Welcome, #{user.name}!\\n\\n\".blue + \"Here's a quick rundown on how to play:\\n\\n\"\n puts \"The goal of the game is to guess all letters (or the word) of the puzzle word shown in the box.\"\n puts \"If the guess is wrong, the asteroid will get closer to your Dino!\"\n puts \"Type in \" + \"SOLVE \".blue + \"to guess a word.\"\n puts \"Type in \" + \"HINT \".green + \"to get the hint to the puzzle word, which will be a synonym or definition of the word.\"\n puts \"Using the HINT will advance the asteroid!\"\n puts \"You lose the game when the asteroid stikes the dino. :(\\n\\n\"\n puts \"Ready?\\n\\n\\n\"\nend", "def helpdesk_start\n\t# Commented out for initial submission due to guest functionality not fully developed.\n\n\t# Clears terminal screen\n\t# system(\"clear\")\n\t# # Declare new instance of tty-prompt gem class\n\t# prompt = TTY::Prompt.new\n\t# # Declare variable of artii gem class\n\t# a = Artii::Base.new :font => 'slant'\n\t# # Print to screen program title screen with artii and colorize gem customization\n\t# puts a.asciify('OpenDesk').colorize(:green)\n\t# puts \"\\n---------------------------------------------\\n\\nWelcome to OpenDesk - the open source helpdesk app built using Ruby.\"\n\t# # Ask user for chosen input using tty-prompt menu selection\n\t# mode = prompt.select(\"\\nSelect a login option:\") do |menu|\n\t# \tmenu.choice 'Admin', 1\n\t# \tmenu.choice 'Guest', 2\n\t# end\n\t# Call a chosen method dependant on returned menu option\n\t# if mode == 1\n\t\t# admin_login_method\n\t# else\n\t# \tputs \"Guest Mode!\"\n\t# end\nend", "def run\n choose_game(prompt)\nend", "def help(arguments=nil)\n #this currently looks horrible in code, but nice in output.\n #would be good to make it both\n\n text = %{\n #{r \"BOOM snippets\"} ___________________________________________________\n\n boom display high-level overview\n boom #{y \"all\"} show all items in all lists\n boom #{y \"edit\"} edit the boom JSON file in $EDITOR\n boom #{y \"help\"} this help text\n boom #{y \"storage\"} shows which storage backend you're using\n boom #{y \"switch\"} #{c \"<storage>\"} switches to a different storage backend\n\n boom #{c \"<list>\"} create a new list\n boom #{c \"<list>\"} show items for a list\n boom #{c \"<list>\"} #{y \"delete\"} deletes a list\n\n boom #{c \"<list> <name> <value>\"} create a new list item\n boom #{c \"<name>\"} copy item's value to clipboard\n boom #{c \"<list> <name>\"} copy item's value to clipboard\n boom #{y \"open\"} #{c \"<name>\"} open item's url in browser\n boom #{y \"open\"} #{c \"<list> <name>\"} open all item's url in browser for a list\n boom #{y \"random\"} open a random item's url in browser\n boom #{y \"random\"} #{c \"<list>\"} open a random item's url for a list in browser\n boom #{y \"echo\"} #{c \"<name>\"} echo the item's value without copying\n boom #{y \"echo\"} #{c \"<list> <name>\"} echo the item's value without copying\n boom #{c \"<list> <name>\"} #{y \"delete\"} deletes an item\n\n #{red \"KABOOM sharing\"} ___________________________________________________\n\n boom remote #{y \"<any command above>\"} using the #{y \"~/.boom.remote.conf\"} it\n kaboom #{y \"<any command above>\"} connects to an alternative backend\n meaning you can pipe to a remote\n backend storage\n\n e.g. to pipe config from a local boom to a remote boom do:\n\n kaboom #{c(\"config ackrc\")} < boom #{c \"config ackrc\"}\n\n ___________________________________________________________________\n all other documentation is located at:\n https://github.com/markburns/kaboom\n }.gsub(/^ {8}/, '') # strip the first eight spaces of every line\n\n output text\n end", "def display_menu choices\n\t\tmenu_array = [\"\\nHangman Options\", \"===============\"] + choices\n\t\tmenu_array.each { |menu| puts menu }\t\t\n\tend", "def help\n puts \"usage: simply type something and press enter to get started\\n\\n\"\n puts \"Talkbox commands available to you:\\n\"\n puts \"\\thelp\\t\\tyour current position\\n\"\n puts \"\\tset volume NUM\\tvolume of voice, ranges from 1 to 10\"\n puts \"\\tcorral\\t\\tsample all the voices offered to you\\n\"\n puts \"\\tshow voices\\ta list of voices you can use\\n\"\n puts \"\\tuse random\\tsample a random voice\\n\"\n puts \"\\tuse VOICE\\tuse a voice of your choosing(must be valid voice from list)\\n\"\n puts \"\\tdirty talk\\tallow talkbox to use colorful language\\n\"\n puts \"\\tclean talk\\tremove cuss words from talkbox\\n\"\n puts \"\\texit\\t\\tif your a party pooper\"\n end", "def user_help\n puts \"\"\n puts \"-l and --list\"\n puts \"Write either 'moodbooster -l' or 'moodbooster --list' in the command line to view your week's moods\"\nend", "def help\n\tcommands = [\"I accept the following commands:\", \"- help : displays this help message\", \"- list : displays a list of songs you can play\", \"- play : lets you choose a song to play\", \"- exit : exits this program\"]\n\tcommands.each {|command| puts command}\nend", "def run\n welcome\n main_menu_selection #choose to create a character or login to pre-existing character\n player_options #a list of options the selected player from 'selection_menu' can accomplish\nend", "def launch_program\n gametype = nil\n puts \"---Welcome to Hang-Man!---\"\n puts \"Anytime during the game you can write\"\n puts \"save\".colorize(:red) + \" or \" + \"quit\".colorize(:red)\n puts \"to either save or quit your game\"\n until gametype == \"newgame\" || gametype == \"load\"\n puts \"For a new game, type \" + \"newgame.\".colorize(:red)\n puts \"To load an old game, type \" + \"load.\".colorize(:red)\n gametype = gets.chomp.downcase\n if gametype == \"newgame\"\n game_start\n else\n load_game\n end\n end\n end", "def init\n # Validate and parse the flags\n OptionParser.new do |o|\n o.on('-a ALIAS', '--alias ALIAS') { |a| $alias = a }\n o.on('-r RECIEVER', '--reciever RECIEVER') { |e| $email = e }\n o.on('-h', '--help') { usage }\n o.parse!\n end\nend", "def difficulty_intro\n print \"\\nWhat difficulty would you like to play? (e)asy, (m)edium, or (h)ard? \"\n end", "def start\n puts \"=====================================================================\"\n puts \"Hello! Welcome to a command line version of the classic Hangman.\"\n print \"Please type 'number of row' you want in your board \"\n choice = gets.chomp\n choose_game(choice)\n end", "def process_initial_commands\n #in the game class\n case \n when play?\n game = Game.new(instream, outstream, display)\n game.start\n \n when instructions?\n display.game_objective1 # give the user instructions\n display.game_objective2\n\n when quit? # run the loop below until the user says to quit\n outstream.puts display.quit.magenta\n\n else # for anything else\n outstream.puts display.invalid_option\n end\n end", "def start_battle\n self.go_to_pokemon_center? if user.pokemon.hp == 0\n choice = prompt.select(Interactivity.fightPokemon?(@@wild_pokemon.name), [\"Let's BATTLE!\", \"No, I don't wanna battle.\"]) \n if choice == \"Let's BATTLE!\"\n self.accepts_battle\n elsif choice == \"No, I don't wanna battle.\"\n self.keep_exploring? \n end \n end", "def start()\r\n\t\t\[email protected](\"Welcome to Mastermind!\")\r\n\t\t\[email protected](\"Created by: #{created_by} (#{student_id})\")\r\n\t\t\[email protected](\"Starting game...\")\r\n\t\t\[email protected]('Enter \"1\" to run the game in the command-line window or \"2\" to run it in a web browser')\r\n\t\tend", "def play!(letter)\n if !over? && !@user_guesses.include?(letter)\n @user_guesses << normalize_letter(letter)\n end\n end", "def current_state\n Display.hangman(@lives)\n puts @hints.join('.')\n Display.errors(@incorrect)\n end", "def help\n puts \"_____________________________________\",\n \"Available commands:\",\n \" m <message> - chat with all players\",\n # \" m /t <player_name> <message> - chat with specified player\" #currently not supported\n \" u list - print all users in game with their states (busy or not)\",\n \" u game <username> - ask for game session with user <username>\",\n \"In game mode:\", #i'll write them later\n \" my hand - gets cards list (in hand)\",\n \" show board - shows my board and opponent's board\",\n \" move <card number> - puts card to board\"\n \"------------------------------------\"\n end", "def intro\n puts \"************************************************\"\n puts \"Hi #{ @user.strip }, I'm the #{ $0 } script\"\n puts \"************************************************\"\n puts \"\\tWelcome to Talkbox\"\n puts \"\\ttype 'help' to get started\"\n puts \"************************************************\"\n end", "def secret_menu\n puts \"\"\n options = [\"View Character Dictionary\", \"View Spellbook\", \"View House\", \"View Classmates\", \"Quit\"]\n choice = PROMPT.select(\"Welcome to Hogwarts. Feel free to explore the following:\", options)\n case choice\n when options[0]\n character_dictionary\n when options[1]\n which_user_spellbook_and_path?\n secret_menu_or_quit\n when options[2]\n house_info\n secret_menu_or_quit\n when options[3]\n user_classmates\n when options[4]\n goodbye\n end\n end", "def init \n { \"madlibs\" => :start_mad , \"madlibs-patterns\" => :list_patterns}\nend", "def welcome\n puts \"\", \"Welcome to the Endangered Animals CLI!\"\n end", "def help\n puts \"I accept the following commands:\" \n puts \"- help : displays this help message\" \n puts \"- list : displays a list of songs you can play\" \n puts \"- play : lets you choose a song to play\" \n puts \"- exit : exits this program\"\nend", "def start\n\t\t\[email protected](\"Welcome to Mastermind!\")\n\t\t\[email protected](\"Created by: #{created_by} (#{student_id})\")\n\t\t\[email protected](\"Starting game...\")\n\t\t\[email protected](\"The game has 12 turns!\")\n\t\t\t@secret = \"XXXX\"\n\t\t\tvalid1 = checksecret(secret)\n\t\tend", "def sce1_opt1\n # sce1_opt = gets.chomp.to_s.downcase\n puts \"\\nLooks like you will never solve the mystery\"\n puts \"Game Over\"\n `say -vFred Game Over`\nend", "def menu\n\t\tputs \"--------\"\n\t\tputs \"Hangman!\"\n\t\tputs \"--------\"\n\t\tputs \"Main Menu\"\n\t\tputs \"\"\n\t\tputs \"Enter one of the following:\"\n\t\tputs \"New\"\n\t\tif @blank_word_array\n\t\t\tputs \"Resume\"\n\t\t\tputs \"Save\"\n\t\tend\n\t\tputs \"Load\"\n\t\tputs \"Quit\"\n\t\tputs \"\"\n\t\tinput = gets.chomp.downcase \n\t\tcase input\n\t\twhen 'new'\n\t\t\tclear_screen\n\t\t\tset_game_variables\n\t\t\tgame_engine\n\t\twhen 'resume'\n\t\t\tclear_screen\n\t\t\tgame_engine\n\t\twhen 'save'\n\t\t\tto_json\n\t\t\tclear_screen\n\t\t\tputs \">Game saved<\"\n\t\t\tmenu\n\t\twhen 'load'\n\t\t\tfrom_json\n\t\t\tclear_screen\n\t\t\tputs \">Game loaded<\"\n\t\t\tgame_engine\n\t\twhen 'quit'\n\t\t\tabort(\">Exiting game<\")\n\t\telse\n\t\t\tclear_screen\n\t\t\terror\n\t\t\tmenu\n\t\tend\n\tend", "def run!\n puts \"Type 'help' to view commands\"\n run = true\n while run\n print \">> \"\n input = gets.split[0].to_sym\n output = handle_input input\n puts output\n run = false if output == \"Goodbye! Thanks for playing!\"\n end\n end", "def hook_thyself\n me = self\n\n register_command(:fortune, /^[Ff]ortune$/, /channel/){ \n me.fortune(bot)\n }\n\n register_command(:eight_ball, /^8(ball)?$/, /channel/){|*msg|\n me.eight_ball(bot, msg.join(\" \"))\n }\n end", "def run_challenge\n @rovers = []\n print_welcome\n get_plateau_coordinates\n get_rover_instructions\n print_output\n end", "def help\n puts \"I accept the following commands:\\n- help : displays this help message\\n- list : displays a list of songs you can play\\n- play : lets you choose a song to play\\n- exit : exits this program\"\nend" ]
[ "0.69504535", "0.66483015", "0.63478583", "0.6293502", "0.6260353", "0.6097988", "0.6094184", "0.608561", "0.603234", "0.6023287", "0.5988306", "0.59870327", "0.59004456", "0.58870834", "0.5858443", "0.58269334", "0.58191603", "0.5811835", "0.5808089", "0.57792044", "0.5778087", "0.577133", "0.5753027", "0.57125396", "0.5699087", "0.5681498", "0.56645703", "0.56524736", "0.564294", "0.56409526", "0.56391853", "0.5635487", "0.5629122", "0.55917597", "0.5586582", "0.5579635", "0.55682313", "0.55551475", "0.5546655", "0.55459815", "0.55438274", "0.55349344", "0.55284834", "0.55204296", "0.55189157", "0.55129", "0.55124617", "0.5501884", "0.5496596", "0.5493587", "0.54935384", "0.54788214", "0.54638743", "0.54592866", "0.54571235", "0.54571235", "0.54571235", "0.54571235", "0.54571235", "0.54571235", "0.5449788", "0.5440416", "0.543824", "0.542948", "0.542944", "0.5427303", "0.5420312", "0.54160416", "0.5412456", "0.5398968", "0.5379617", "0.5366106", "0.5363164", "0.5349259", "0.5345949", "0.5343778", "0.5339871", "0.5337197", "0.5325632", "0.5324658", "0.53194845", "0.53193873", "0.5313737", "0.53123695", "0.5304657", "0.5303441", "0.5302076", "0.52997774", "0.52995175", "0.52968246", "0.5294611", "0.5291505", "0.52879673", "0.5287008", "0.5285682", "0.52848965", "0.5284147", "0.52723366", "0.5271952", "0.52570707" ]
0.63702863
2
Play a game of hangman (offering the opportunity to save the game)
def play_game while true @view.display_game_state(@word, @misses, @hits, @guesses_left) break if game_over? guess = get_guess break if guess == :save update_game_state guess end save_game if guess == :save end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hangman\n game = Game.new\n game.new_or_load\n hangman if game.play_again\nend", "def start_game\n Dir.mkdir(\"save\") unless Dir.exists? \"save\"\n puts \"\"\n puts \"Welcome to Hangman!\"\n puts \"\"\n game_choice\n puts \"\"\n puts \"Try to guess the secret word. You have #{@guesses_left} guesses.\"\n get_word\n create_blanks\n take_turn\n end", "def play\n #calls to all the methods that produce game!\n end", "def game_play\n until game_over\n graphic\n guess\n end\n end", "def play\n display_welcome_message\n loop do\n human.choose\n computer.choose\n display_moves\n display_winner\n keep_score\n break unless play_again?\n end\n display_goodbye_message\n end", "def play\n # unless the game is over players take turns\n take_turn until game_over?\n\n #start a new game if the game is over\n new_game_or_quit\n end", "def play\n display_welcome_message\n loop do\n number_of_games = 0\n loop do\n computer.choose(@human)\n human.choose\n display_moves\n increment_game_count\n puts\n display_winner\n display_score\n update_win_history\n number_of_games += 1\n puts\n break if first_to_score?(10)\n end\n display_final_outcome\n reset_game\n break unless play_again?\n end\n display_goodbye_message\n end", "def play\n take_turn until @master.game_over?\n @master.show_board\n @robot.speak\n end", "def play\n\t\t@current_turn = 0\n\t\t@current_player = @hunter\n\t\tplayers.each{|p| p.write(game_parameters)}\n\t\tuntil is_game_over?\n\t\t\tpre_turn_wall_count = @walls.size\n\t\t\treport_state_to_spectators\n\t\t\t@current_player.take_turn\n\t\t\t# Only print the board every 10 turns or if a wall was added or removed\n\t\t\tprint_minified_board() if @current_turn%10 == 0 || @walls.size != pre_turn_wall_count\n\t\t\tadvance_turn!\n\t\t\tprint \"#{@current_turn} \"\n\t\tend\n\t\tresult = report_winner\n\t\tcleanup_players!\n\t\tcleanup_spectators!\n\t\tresult\t# Returns this so the EvasionServer can save results\n\tend", "def play\n\t\tprocessed = process_guesses(@user_guesses, @word)\n\t\tboard = draw(processed)\n\t\tinput = get_input\n\t\t@user_guesses << input\n\t\t@num_guesses -= 1\n\t\tresult = game_over?\n\t\tif result[:over]\n\t\t\tputs \"Game Over!\\n#{result[:message]}\"\n\t\t\tputs \"Word was #{@word}\"\n\t\t\treturn @controller.play_again\n\t\telse\n\t\t\treturn play\n\t\tend\n\n\tend", "def introduce_the_game\n @irc_server.puts \"Welcome to hangman!\"\n @irc_server.puts \"To get started, enter a word to be guessed\"\n end", "def play\n game_introductions\n\n loop do\n set_markers_and_first_mover\n\n loop do\n clear_screen_and_display_board\n loop_of_player_moves\n display_result\n break if someone_won_match?\n display_play_again_message\n reset\n end\n\n clear\n display_champion\n break unless rematch?\n reset_game_data\n end\n\n display_goodbye_message\n end", "def play\n\t\tputs \"Hello, welcome to my game!\"\n\n\t\tNUMBER_OF_ROUNDS.times do \n\t\t\tround = Round.new\n\t\t\tround.play\n\t\t\tputs \"You made #{round.number_of_guesses} guesses.\"\n\t\t\tadd_guesses(round.number_of_guesses)\n\t\t\tif round.won?\n\t\t\t\t@win_count += 1\n\t\t\tend\n\t\tend\n\t\tputs \"Your average number of guesses is #{average_guesses}.\"\n\t\tputs \"Your total correct guess is #{@win_count}\"\n\t\n\tend", "def play\n\t\tgame_loop\n\tend", "def play\n\n game=Game.new\n game.load\n while game.lives > 0 && !game.win?\n \tsystem \"clear\"\n \tprint game.word_guessed\n \tputs \"\"\n puts \"You have #{game.lives} lives remaining.\"\n puts \"\"\n puts \"Incorrect Letters:\"\n game.wrong.each {|letter| print \"#{letter}, \"}\n puts \"\"\n letter=game.guess_letter\n game.compare_letter(letter)\n sleep(1)\n end\n system \"clear\"\n if game.win?\n \tputs \"You Win!\"\n else \n puts \"You Lose!\"\n end\n puts \"The word was '#{game.word}'\"\n\n\nend", "def play\n reset\n loop do\n break if @guesses == 0 || @win == true\n status_message\n enter_number\n evaluation_message\n end\n lose_message if @guesses == 0 && @win == false\n end", "def play_game\n # WarAPI.play_turn()\n end", "def run\n puts \"Welcome to the Hangman game. You will need 2 players.\"\n\n h = Hangman.new # this creates a new instance of the game\n h.getWord\n h.welcomePlayer2\n\n h.startGuess\n\n #h.displayHangman\n\nend", "def play\n display_welcome_message\n\n # Each game...\n loop do\n # Each round...\n loop do\n display_game_history unless rounds.empty?\n round_results = Round.new(human, computer).play\n @rounds << round_results\n break if winner?\n end\n\n set_winner\n display_end_game\n\n break unless play_again?\n reset_game\n end\n\n display_goodbye_message\n end", "def play(cmd)\n play_game(cmd)\n end", "def start_new_game\n puts \"Welcome to Hangman! Try to guess my secret word!\"\n puts\n game_id = get_num_saved_games\n return HangmanGameState.new(game_id)\n end", "def play\r\n display_welcome_message\r\n init_players\r\n\r\n loop do\r\n play_match\r\n break unless play_again?\r\n end\r\n\r\n display_goodbye_message\r\n end", "def play_game\n loop do\n puts \"\\n\\n\"\n display_board\n player_turn\n check_game_status\n end\n end", "def start_screen()\n puts \"Welcome to Hangman.\"\n puts \"'N' to start a new game, 'L' to load!\"\n choice = gets.chomp.upcase\n if choice == 'N'\n self.play\n elsif choice == 'L'\n load_game\n else\n puts \"Please choose 'N' or 'L' next time.\"\n puts \"For now the culprit's fate is spared. Take care!\"\n end\n end", "def play\n loop do\n prep_game\n loop do\n current_player_moves\n break if board.someone_won? || board.full?\n board.clear_screen_and_display_board(players) if human_turn?\n end\n display_result\n break unless play_again?\n reset\n end\n display_goodbye_message\n end", "def start_game()\n playing = true\n\n puts \"\\nWelcome to Hangman!\"\n sleep(@@sleep_time)\n puts \"Enter \\\"save\\\" at any time to save your game\\n\\n\"\n sleep(@@sleep_time)\n while playing\n sleep(@@sleep_time)\n # display which correct letters have already been chosen and \n # which incorrect letters have already been chosen\n @word.split('').each_with_index { |char, i|\n if @is_guessed_array[i]\n print \"#{char} \"\n else\n print \"_ \"\n end\n }\n\n puts \"\\nNumber of guesses remaining: #{@max_incorrect - @num_incorrect}\"\n print \"\\nGuess a character (or save your game): \"\n guess = gets.chomp\n if guess.downcase == \"save\"\n # serialize the Hangman object\n sleep(@@sleep_time)\n puts \"Your game was saved in saved_game.yaml\"\n return true\n end\n # get index of first occurrence of the guessed character in the correct word\n guess_index = @word.downcase.index(guess)\n # get indices of all occurrences of the guessed character in the correct word\n indices = ([email protected]).find_all { |i| @word.downcase[i] == guess.downcase }\n\n if guess_index != nil && @is_guessed_array[guess_index] == false\n # guess is correct\n puts \"Correct!\"\n indices.each { |index| @is_guessed_array[index] = true }\n else\n # guess is incorrect\n puts \"Incorrect!\"\n @num_incorrect += 1\n end\n\n puts\n if !@is_guessed_array.include?(false)\n sleep(@@sleep_time)\n puts \"You win!\"\n puts \"The word was #{@word}\"\n playing = false\n elsif @num_incorrect == @max_incorrect\n sleep(@@sleep_time)\n puts \"You lose!\"\n puts \"The word was #{@word}\"\n playing = false\n end\n end\n return false\n end", "def play\n start = Time.now\n until @board.won?\n @player ? round_player : round_ai\n @attempts += 1\n sleep(2)\n system(\"cls\")\n @board.render\n end\n finish = Time.now\n time_to_finish = finish - start\n declare_win(time_to_finish)\n end", "def start\n load\n until @computer.round_finished\n save\n @computer.respond_to_guess(@player.prompt)\n end\n\n if @computer.guessed\n puts \"You won!\"\n else\n puts \"You lost!\"\n end\n end", "def play\n\t\tdisplay_welcome\n\t\twhile true\n\t\t\tchoice = get_menu_choice\n\t\t\tchoice_result = handle_menu_choice choice\n\t\t\tbreak if choice_result == :quit\n\t\tend\n\t\tputs \"Thanks for playing Hangman :-) Play again soon.\"\n\tend", "def play\n # Game play asks for players input on a turn of the game\n # Game play checks if the game is over after every turn\n # Game play plays the first turn of the game\n # Game play plays the first few turns of the game\n # Game play checks if the game is won after every turn\n # Game play checks if the game is a draw after every turn\n while !over?\n turn\n end\n # Game play stops playing if someone has won\n # Game play congratulates the winner X\n # Game play congratulates the winner O\n if won?\n puts \"Congratulations #{winner}!\"\n # Game play stops playing in a draw\n # Game play prints \"Cat's Game!\" on a draw\n elsif draw?\n puts \"Cat's Game!\"\n end\n end", "def play\n\t\n\t\tuntil over?\n\t\tturn\n\t\tend\n\t\t\n\t\tif won? \n\t\t\twinner\n\t\telsif draw? \n\t\t\tputs \"The game was a Draw!\"\n\t\telse \n\t\t\tputs \"Unexpected Error Occured\" \n\t\tend\n\tend", "def play\n board_setup\n gameplay_setup\n end", "def play_round\n @fragment = \"\"\n welcome\n\n until round_over?\n take_turn\n next_player!\n end\n\n update_standings\n end", "def play\n welcome()\n while @current_turn <= @max_turn && @display_word.include?(\"_\")\n puts \"Turn #{@current_turn} out of #{@max_turn}\"\n puts \"Word: #{@display_word}\"\n puts \"Enter a letter for a guess (will only count first letter):\"\n @current_guess = parse_letter(gets.chomp)\n if @current_guess == \"+\"\n save_game()\n else\n @current_turn +=1\n end\n update_display_word()\n end\n end_message()\n end", "def play_round\n puts @game_word + \"\\n\\n\"\n guess = @curr_player.get_guess\n if correct_guess?(guess)\n @curr_player.correct_guesses += [guess]\n else\n @curr_player.guesses_remaining -= 1\n @curr_player.incorrect_guesses += [guess]\n end\n puts \"#{@curr_player.name}'s' incorrect guesses: #{@curr_player.incorrect_guesses}\"\n puts \"#{@curr_player.name}'s guesses remaining: #{@curr_player.guesses_remaining}\"\n puts \"#{@curr_player.name}'s available points: #{@curr_player.correct_guesses.length * @secret_word.length}\"\n puts \"#{@curr_player.name}'s flower: \"\n puts File.read(\"flower#{@curr_player.guesses_remaining}.txt\")\n puts \"_____________________________________\"\n puts \"\\n\\n\"\n @curr_player_index = (@curr_player_index + 1) % 2\n @curr_player = @players[@curr_player_index]\n end", "def start_a_game\n jeopardy_board\n play_game\nend", "def main\n rounds = Game.start\n game = Game.new(rounds)\n roshambo = Roshambo.new(game)\n Roshambo.play(roshambo)\nend", "def new_game\n set_player\n\n if human_player?\n start_message(:welcome)\n\n set_grid\n puts\n set_bombs\n\n else #non-human\n start_message(:robot_game)\n @robot = Robot.new()\n @grid_size = @robot.grid_size\n @num_bombs = @robot.num_bombs\n end\n @play_again = true\nend", "def game_play\n find_word\n board\n load_game?\n if @confirm != 'y'\n game_intro\n end \n until game_end? || @incorrect_guess == 8 \n #p @the_word\n guess\n incorrect_guess?\n hang_man_figure\n update_board\n save?\n end\n if game_end? != true\n puts \"\\n\" * 100\n hang_man_figure\n update_board\n puts \"SORRY, YOU LOST!!\" \n puts \"\\n\"\n puts \"The word was....#{@the_word.upcase}!!\"\n exit\n elsif game_end? == true\n puts \"\\n\" * 100\n hang_man_figure\n update_board\n puts \"OMG!\"\n puts \"#{@the_word.upcase} is the word!\"\n puts \"YOU WIN!!! =)\"\n puts \"******!*******!*****!*******!*****!*****!\"\n exit\n end\nend", "def start\r\n initialize_game\r\n until @game.over?\r\n take_turn\r\n end\r\n print_outcome\r\n end", "def play_round\n take_turn\n puts \"Current word: #{@fragment}\"\n if losses(current_player) == true\n record(current_player)\n score_board\n end\n next_player!\n end", "def play\n display_welcome_message\n loop do \n human.choose #.choose is an instance method on the Player class, since human is an object of the Player class\n computer.choose\n display_winner\n break unless play_again? #could put play again loop here, but easier to not have double loop here\n end \n display_goodbye_message\n end", "def perform\n\tgame_menu\n\tgameplay\nend", "def run\n Interface::header\n Interface::newline\n\n count = get_number_of_players\n get_player_names( count )\n\n @b.play_game\n end", "def turn\n\t\toutputStatus\n\t\tif @guesses_left < 10\n\t\t\tsaveGame if save?\n\t\tend\n\t\tletter = getLetter\n\t\tif checkLetter(letter)\n\t\t\treplaceLetter(letter)\n\t\telse\n\t\t\twrongGuess(letter)\n\t\tend\n\tend", "def playGame\n #start the opening of the game\n #introduce the rules, ask for human or computer etc\n self.opening()\n\n end", "def play\n\t\twelcome\n\t\task_name\n\t\task_name2 \n\t\task_input\n\t\tturns\n\tend", "def play_round\n puts \"---D I N G ! N E W R O U N D !---\"\n @round_over = false\n take_turn(self.current_player) until @round_over\n if @round_over\n @fragment = \"\"\n self.display_standings\n sleep 5\n system(\"clear\")\n end\n end", "def game()\n $match_index_arr = []\n $guessed = []\n $turns = 10\n $index = 0\n $end_game = false\n\n get_word()\n puts $hangman[$index]\n show_word()\n loop do \n get_letter()\n letter_match()\n no_match()\n puts $hangman[$index]\n remaining_guesses()\n dash_to_letter()\n puts \"\"\n show_word()\n puts \"\"\n guessed_wrong_letter()\n game_over()\n if $end_game\n break\n end\n check_guess_count()\n end\n return\n end", "def run\n choose_game(prompt)\nend", "def play_round\n unless @continuing_saved_game == true\n reset_round_stats\n set_word_arrays\n end\n show_round_status # @continuing_saved_game reset to false here\n until @round_over\n guess = guess_letter\n break if guess == \"SAVE\" || guess == \"EXIT\"\n update_round(guess)\n check_round_over?\n update_score if @round_over == true\n show_round_status\n end\n end", "def start_game\n # Infinite loop\n while\n # Draw the board on the terminal\n @board.print_board\n # Ask the player to choose where to draw the symbol\n @active_player.choose_spot\n # Check if the current player won\n if @board.check_win(@active_player.player_symbol)\n @board.print_board\n puts 'Has ganado'\n @active_player.victory\n # Ask if the player wants to play again\n play_again\n # If not, the loop is broken\n break\n else\n # Check if there is a draw\n if @board.check_draw\n puts 'Empate'\n play_again\n break\n end\n # If there isn't a draw the game switch the current player\n switch_player\n end\n end\n end", "def play_game(game)\n keep_playing = true\n while keep_playing\n game.play_round\n keep_playing = game.play_again?\n end\n end", "def play\n puts\n puts \"How good is your memory? Let's play a memory game.\"\n puts \"Match the cards!\"\n puts\n sleep(3)\n until game_over?\n board.render\n #get_pos from the player\n begin \n make_guess(get_player_input)\n rescue => exception\n puts \"Select a card that hasn't been flipped\"\n retry\n end\n \n end\n puts \"I guess your memory is pretty good :D\"\n end", "def play!\n print_welcome()\n\n until @win || @lose\n print_current_status()\n letter_or_word = ask_player_letter_or_word()\n\n case letter_or_word\n when \"L\"\n letter_guess()\n when \"W\"\n word_guess()\n else\n puts \"There is an error in the program\"\n end\n\n if @lose == true\n print_lose\n elsif @win == true\n print_win\n end\n end\n end", "def play\n until game_over\n start_new_turn\n show_board\n make_move @current_player\n end\n show_board\n puts \"#{game_over} wins!\"\n end", "def play\n greeting\n get_tiles\n move_sequence\n end", "def launch_program\n gametype = nil\n puts \"---Welcome to Hang-Man!---\"\n puts \"Anytime during the game you can write\"\n puts \"save\".colorize(:red) + \" or \" + \"quit\".colorize(:red)\n puts \"to either save or quit your game\"\n until gametype == \"newgame\" || gametype == \"load\"\n puts \"For a new game, type \" + \"newgame.\".colorize(:red)\n puts \"To load an old game, type \" + \"load.\".colorize(:red)\n gametype = gets.chomp.downcase\n if gametype == \"newgame\"\n game_start\n else\n load_game\n end\n end\n end", "def play_game(game)\n\n\t\twhile game.totalHills > 1 and game.turn < 1000 \t\n\t \tgame.turn \n\t end\n\tend", "def play_game\r\n\r\n word = select_word #Call on the method that retrieves a random word\r\n\r\n Console_Screen.cls #Clear the display area\r\n\r\n consonants = get_consonants #Call on the method that prompts the player\r\n #to enter a list of consonants\r\n\r\n Console_Screen.cls #Clear the display area\r\n\r\n #Call on the method that prompts the player to enter a vowel\r\n vowel = get_vowel\r\n\r\n #Remove blank spaces from the word to create a short version of the word\r\n shortWord = word.gsub(\" \", \"\")\r\n\r\n #Call the method that processes player guesses\r\n prompt_for_guess(shortWord, word, consonants, vowel)\r\n\r\n Console_Screen.cls #Clear the display area\r\n\r\n end", "def start_game(user)\n $game_session = nil\n UserGuess.delete_all\n\n initiate_game(user)\n question_loop\n end_message\n menu(user)\nend", "def run_full_game()\n set_max_games()\n name_all_players()\n puts play_through_set_of_games()\n set_determine_set_winner()\n puts overall_winner_message()\n end", "def run\n start_game\n game_loop\n end_game\n end", "def play\n until over? do\n turn;\n end\n\n if won?\n puts \"Congratulations #{winner}!\";\n replay\n elsif draw?\n puts \"Cat's Game!\";\n replay\n end\n end", "def play\n # checks if the game is over after every turn\n until over?\n # plays the first few turns of the game\n turn\n end\n\n # checks if the game is won after every turn\n if won?\n puts \"Congratulations #{winner}!\"\n # checks if the game is draw after every turn\n elsif draw?\n puts \"Cats Game!\" # prints \"Cats Game!\" on a draw\n end\n\n end", "def start_game\n set_game_state 'play'\n @deck = Deck.new\n @deck.shuffle\n @deck.deal @players\n @hand_played = []\n @cards_on_table = []\n @war_is_on = false\n nil\n end", "def play\n @game.start if @game.waiting_to_start?\n if @game.active?\n play_cards if params[:commit] # play submitted cards, if a form submit occurred\n @sets = @game.fill_gamefield_with_sets\n end\n if @game.finished?\n publish_if_finished_and_promoted\n redirect_to :action => 'archive'\n else\n render :action => 'play'\n end\n end", "def play\n until over?\n turn\n end\n\n if won?\n puts \"Congratulations #{winner}!\"\n elsif draw?\n puts \"Cat's Game!\"\n end\n end", "def play\n turn until over?\n if won?\n puts \"Congratulations #{winner}!\"\n else\n puts \"Cats Game!\"\n end\n end", "def game; end", "def game; end", "def game; end", "def game; end", "def game; end", "def game; end", "def game; end", "def new_game \n Game.new.play_game\n end", "def go_play\n puts \"Let's start a new game\"\n @grid.print_board # prints the initial blank layout of the board\n puts @player1.name + \" \" + \"your turn first!\" # player 1 always goes first\n end", "def start_game\r\n\t puts \"Welcome to Hangman! A secret word has been chosen. You have #{turn_count} guesses to get the word correct. Good luck!\"\r\n\t (@secret_word.size).times { @correct_letters += \"_ \" }\r\n\t puts @correct_letters\r\n\t begin_guessing\r\n\tend", "def save_game\n game = {\n :word => @word,\n :max_turn => @max_turn,\n :current_turn => @current_turn,\n :display_word => @display_word,\n :current_guess => @current_guess\n }\n File.open(\"hangman.yaml\", 'w') { |f| f.write(game.to_yaml)}\n print \"Game is saved!\\n\"\n end", "def play\n until over?\n turn\n end\n\n if won?\n puts \"Congratulations #{winner}!\"\n\n else draw?\n puts \"Cat's Game!\"\n\n end\n end", "def new_game\n @breaker = Codebreaker.new\n @maker = Codemaker.new\n choose_role\n until @breaker.turns >= @breaker.max_turns\n @breaker.turn(@maker.code)\n @breaker.turns\n end\n puts \"Play again?\"\n start\n end", "def start_game\n game_logo\n game_start_screen\n game_rules\n last_rules\n choice = maker_breaker\n game_maker if choice == 'm'\n game_breaker if choice == 'b'\n end", "def play\r\n while !over?\r\n turn\r\n end\r\n if won?\r\n puts \"Congratulations #{winner}!\"\r\n elsif draw?\r\n puts \"Cats Game!\"\r\n end\r\n end", "def play_game\n @board.print_board\n until @quit || @restart || gameover?\n cell = take_turn(@current_player)\n if !cell.nil?\n coordinates = get_coordinates(cell)\n change_board(coordinates) if valid_cell?(coordinates)\n end\n @current_player = switch_player(@current_player)\n @board.print_board unless @restart || @quit\n end\n reset_board if @restart\n ending_screen if gameover?\n\n end", "def playGame(user, message)\n\t\t#Set up the game if this is the user's first time\n\t\tif user.scramble_game == nil\n\t\t\tgame = user.create_scramble_game \n\t\t\t# game.user_id = user.id\n\t\t\t# game.save\n\t\t\treturn initScrambleGame(game)\n\t\tend\n\n\t\t#passes on the word to the game\n\t\tgame = user.scramble_game\n\t\tplay(game, message)\n\tend", "def play\n while over? == false\n turn\n end\n if won?\n puts \"Congratulations #{winner}!\"\n elsif draw?\n puts \"Cat's Game!\"\n end\n end", "def play\n over = false\n\n until over\n display_score\n @board.render\n @guesses = []\n prompt\n if same_card?(@guesses[0], @guesses[1])\n puts \"you got it! Go again!\"\n @guesses[0].reveal_card\n @guesses[1].reveal_card\n @score[current_player] += 1\n else\n @guesses[0].hide\n @guesses[1].hide\n puts \"you suck! Go #{previous_player} is up.\"\n next_player!\n end\n\n\n over = true if board.won?\n end\n end", "def play_new_game\n #get new code word\n @word_master.choose_code_word\n @code_word = @word_master.code_word\n @good_guesses = Array.new(@code_word.length, '_ ')\n #tells you rules\n puts \"Try to figure out the word. If you guess 6 wrong letters, you lose!\"\n #starts playing\n game_loop\n end", "def new_game\n\t\tclear\n\t\tget_username\n\t\tselect_level\n\t\tget_deck\n\t\tshuffle\n\t\tget_hand\n\t\tcontinue_game\n\tend", "def game_start\n\n\tclear_screen\n\n\tprint_paragraph(\"Welcome to Trapped In A Cave.\\nGuess what? You're trapped in a cave...\nCan you make it out alive?\\n(For a list of commands type help at anytime.)\")\n\nstart_room\n\nend", "def play\n\t\t\n\t\tputs intro\n\t\tsection_completed = false\n\t\t\n\t\twhile section_completed == false do\n\t\t\n\t\t\tprompt\n\t\t\taction = gets.chomp.downcase\n\t\t\t\n\t\t\tif action.include? \"jump\"\n\t\t\t\tputs \"You jump and escape one of them. But look ahead they are still coming!! What next?\"\n\t\t\n\t\t\telsif action.include? \"kill\"\n\t\t\t\tsection_completed = true #set section complete = true\n\t\t\t\tputs \"You jump quick on them. The Goombas were beaten flat to the ground.\"\n\t\t\t\tputs \"You jump, jump... and jump again. The Goombas were beaten and you head forward with no fear. You hit the bricks on the way as they release coins for you when they break down.\"\n\t\t\t\t\n\t\t\t\t\n\t\t\telsif action.include? \"sing\"\n\t\t\t\tsection_completed = true\n\t\t\t\tputs \"You do not want to harm them as you know it would create even more conflicts in the kingdom.\"\n\t\t\t\tputs \"So you start singing...\"\n\t\t\t\t#call underground\n\t\t\t\t\n\t\t\telsif action.include? \"go back\"\n\t\t\t\tdead(\"{@go_back}\")\n\t\t\n\t\t\telsif action.include? \"suicide\"\n\t\t\t\tsuicide\n\t\t\telsif action == \"\"\n\t\t\t\tno_action\n\t\t\telse\n\t\t\t\tputs \"okay... well..\"\n\t\t\t\twrong_input\n\t\t\t\t\n\t\t\tend # end if\n\t\t\tend #end of While loop\n\t\t\n\t\tbonus #call mushroom\n\t\t\n\tend", "def play\n\t\t\twhile !win && @turns < TURNS\n\t\t\t\tturn\n\t\t\tend\n\t\t\t# counter increments at start of turn, so must be less than max turns\n\t\t\tif win\n\t\t\t\tplay_again\n\t\t\telse\n\t\t\t\tputs \"\\n Sorry, you ran out of turns. The word was #{@secret_word}\"\n\t\t\t\tplay_again\n\t\t\tend\n\t\tend", "def play\n puts \"#{name} got zoomies playing fetch!\"\n @hungry = true\n end", "def start_game\n puts \"----- WELCOME TO twO-O-Player MATH GAME! -----\"\n puts \"#{@player1.name} vs #{@player2.name} 🥊 Game on!\\n\\n\"\n end", "def play\nturn until over?\nif won?\n puts \"Congratulations #{winner}!\"\nelsif draw? == true\n puts \"Game over! Thanks for playing.\"\nend\nend", "def play\n until over?\n turn\n end\n if winner\n puts \"Congratulations #{winner}!\"\n else\n puts \"Cats Game!\"\n end\n end", "def start_game\n begin\n @game_text.intro\n\n # Run the tutorial\n ActionDirector.new(@world, @player).call({command: :talk, target: :jerry})\n\n # The main game\n while @player.alive? && @world.has_hostiles?\n @player.in_battle? ? battle_loop : game_loop\n end\n\n @player.alive? ? @player.win : @player.defeat\n rescue SystemExit, Interrupt # Catpure ctrl+c exit, end gracefully\n @game_text.exit\n end\n end", "def go_game\n #RPG::BGM.fade(30)\n #Graphics.fadeout(30)\n #Graphics.frame_count = 0\n DataManager.autosave(true, false)\n SceneManager.goto(Scene_Map)\n #$game_system.on_after_load\n end", "def play\n # letters to array [ [row, column, letter, points], [... ]\n letters = []\n params[:laid_letters].split('_').each_slice(4) do |ll|\n letters << [ll[0].to_i, ll[1].to_i, ll[2], ll[3].to_i]\n end\n logger.info '@@@@@@@@@@ ctrl letters: ' + letters.to_s\n\n # Check laying of letters\n @error = @turn.laid_oke(letters)\n if @error.blank?\n\n # Check the words\n @error = @turn.words_nok(letters)\n if @error.empty?\n\n # Update game and set next turn\n # @turn.started = Time.at( params[:js_start_time].to_i / 1000.0 )\n @turn.ended = Time.at(params[:js_time].to_i / 1000.0)\n # logger.info 'turn_ctrl - js_start_time: ' + @turn.started.to_s\n logger.info 'turn_ctrl - js_time: ' + @turn.ended.to_s\n @turn.update_turn(letters)\n @game.letters_to_board(letters)\n @turn = @game.goto_next(@turn) # @turn gets next_turn\n\n # to all players\n broadcast(letters)\n\n # Wrong words\n else\n render :play_error\n end\n\n # Laying not oke\n else\n render :play_error\n end\n # stop\n end" ]
[ "0.81919104", "0.7544899", "0.74681777", "0.7465632", "0.7420688", "0.73773915", "0.7345595", "0.7342244", "0.73275864", "0.7320259", "0.7318772", "0.7302483", "0.72825", "0.72774035", "0.7251603", "0.72477084", "0.7235299", "0.7227015", "0.71524835", "0.7150582", "0.7135166", "0.71307975", "0.71242255", "0.7103036", "0.70940936", "0.7090142", "0.70398873", "0.7019067", "0.701446", "0.7007431", "0.6999682", "0.6996305", "0.6990861", "0.69608355", "0.6950591", "0.6947085", "0.6945084", "0.69436306", "0.69291425", "0.6928092", "0.69239855", "0.6917246", "0.69172204", "0.69169277", "0.69039166", "0.689598", "0.68560034", "0.68559635", "0.68523926", "0.6851372", "0.6849794", "0.6847515", "0.6843087", "0.68352467", "0.6815394", "0.6812284", "0.67892206", "0.6777297", "0.67753035", "0.6768794", "0.67540306", "0.67505866", "0.6742022", "0.673889", "0.67321736", "0.67256004", "0.67250615", "0.6717137", "0.6716416", "0.6716344", "0.6716344", "0.6716344", "0.6716344", "0.6716344", "0.67158663", "0.67158663", "0.6709428", "0.67093164", "0.67059803", "0.6697118", "0.6683941", "0.6680049", "0.66739345", "0.6660534", "0.6645054", "0.66431177", "0.6637221", "0.6636216", "0.6630663", "0.6627876", "0.66140497", "0.6606279", "0.6602501", "0.6595012", "0.6592382", "0.6590021", "0.6588907", "0.65815514", "0.6581116", "0.6580333" ]
0.7818824
1
One time welcome message
def display_welcome puts "\t**************************" puts "\t*** Welcome To Hangman ***" puts "\t**************************" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def welcome\n puts message_list[:welcome]\n # help\n end", "def welcome\r\n end", "def magic_welcome(event)\n # TODO: Ditch this call to report - move to report lib if necessary\n report \"#{event.from} welcome message: #{event.message}\"\n if (event.message =~ /(\\S+)!\\S+$/)\n @me = $1\n elsif (event.message =~ /(\\S+)$/)\n @me = $1\n end\n\n @registered = true\n mode @me, 'i'\n end", "def welcome_message\n puts \"Welcome to Everything but the Kitchen Sink!\"\n end", "def set_welcome\n end", "def welcome \n end", "def welcome_message\n message = \"Welcome to Locavore Kitchen!\"\n end", "def welcome_message\n\t\tputs \"Welcome/Bienvenue \" + self.name\n\tend", "def welcome\n\tend", "def welcome \n end", "def welcome_message\n 'Benvenuto'\nend", "def welcome_message\n system('clear')\n puts \" _ _ _ _ \"\n sleep 0.1\n puts \"| | | | ___| | | ___ \"\n sleep 0.1\n puts \"| |_| |/ _ | |/ _ \\ \"\n sleep 0.1\n puts \"| _ | __/ | | (_) |\"\n sleep 0.1\n puts \"|_| |_| ___|_|_| ___/ \"\n sleep 0.1\n puts \"\" \n puts \"bienvenue dans mon jeu du morpion\"\n puts \"\\nAvant de commencer entre le nom des deux joueurs qui vont s'affronter\"\n end", "def verify_welcome_message\n if is_newbie_changed? && is_newbie == false\n generate_welcome_message\n DefaultFollowerService.new(self).assign\n end\n end", "def welcome_message\n @@welcome_message\n end", "def welcome\n puts \"\\nHello, welcome to DayTrader. Please sign in with your name (first + last): \"\n end", "def welcome\n clear\n output \"Welcome to Hangman\"\n output \"==================\"\n blank_line\n end", "def on_welcome(connection, user, text)\n end", "def welcome\n system 'clear'\n puts header.call \"Welcome to Ruby QuickNews\"\n puts \"Please login or create a new username\"\n login_menu\n end", "def welcome_message\n self.custom_welcome_message || self.default_welcome_message\n end", "def welcome\n # show welcome\n end", "def welcome_msg\n puts\n puts \"Welcome to BlackJack (by Luis Perez)!\"\n puts \"For instructions, press i.\"\n puts \"To quit, press q.\"\n puts\n end", "def welcome\nend", "def welcome_user\n puts \"Welcome to #{pastel.bright_cyan('Groupie')}.\"\n puts \"Keep up with your favorite bands, never miss a show!\"\n puts \"Type #{pastel.bright_cyan('exit')} at any time to quit the app.\"\n puts \"Type #{pastel.bright_cyan('concerts')} to get started.\"\n end", "def welcome_email\n # User welcome email sent.\n end", "def welcome_message\n puts \"\\n\"\n puts \"Welcome to Rock Paper Scissors\"\n end", "def welcome\n puts Rainbow(\"Welcome to Github Jobs\").indianred.bright.underline\n end", "def welcome(user)\n @greeting = \"Hi.\"\n @name = user.name unless user.name == nil || user.name = \"Anonymous\"\n\n mail to: user.email, subject: 'Hi & nice to meet you.'\n end", "def welcome\n\t\tputs \"Welcome to Hangman!\\n\\n\"\n\t\tputs \"The computer has selected a random secret word for you to guess.\\n\"\n\t\tputs \"Be careful - you have 6 incorrect guesses before you hang the man!\"\n\tend", "def welcome_message\n puts \"Welcome to Shiqing's Secret Number Game! \\nShiqing created this game.\"\nend", "def welcome_screen\n puts \"Bienvenue dans la secret place !\"\nend", "def welcome_screen\n puts \"\"\n puts \"Bienvenu sur votre espace TOP SECRET !\"\n puts \"Info : Aujourd'hui il fait beau (a ne pas divulguer)\" \nend", "def welcome_screen\n\n\nputs \"\"\nputs \"**************************************************************************\"\nputs \"Bienvenue dans la zone secrète, je vais te révéler tous les messages de Flo...\"\nputs \"Réhausse ton slip et mets tes lunettes !\"\nputs \"**************************************************************************\"\nputs \"\"\nputs \"**************************************************************************\"\nputs \"1er secret : Pour accentuer l'opportunité solutionnelle, chaque entité doit anticiper les cibles vente.\"\nputs \"2ème secret : Pour accentuer la mondialisation situationnelle, il faut rapidement chiffrer les référents qualité.\"\nputs \"3ème secret : Face à l'adaptabilité quantitative, mieux vaut optimiser les intervenants organisation.\"\nputs \"**************************************************************************\"\nputs \"\"\nputs \"Fais en bon usage !\"\nputs \"\"\n\n\nend", "def welcome\n puts \nend", "def start(data = nil, *)\n response = from ? I18n.t(:welcome, username: from['username']) : 'Здарова!'\n respond_with :message, text: response\n end", "def display_welcome_message\r\n prompt \"Welcome to Tic Tac Toe!\"\r\n end", "def welcome\n UserMailer.welcome\n end", "def welcome\n puts \"Hello Everyone!\"\nend", "def welcome\n # only admin can send emails like these\n if !@current_user.is_admin?\n respond_with_403 and return\n end\n \n \n if @user.is_active == 0\n flash[:error] = \"Please Activate this Agent before sending welcome email.\"\n else\n UserNotifier::deliver_user_created(@user, @user.save_new_password)\n flash[:notice] = 'Welcome email has been sent.'\n end\n \n \n redirect_to user_path\n end", "def handle_welcome(data)\n @id = data[1]\n @wamp_protocol = data[2]\n @server_ident = data[3]\n\n trigger(:welcome, self)\n end", "def welcome\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def greeting\n system 'clear'\n puts WELCOME_MESSAGE\n end", "def greet\n puts \"# Welcome to Mastermind!\"\n puts \"# Good luck!\"\n end", "def send_welcome_email\n UserMailer.welcome_message(self).deliver_later\n end", "def initial_message\n Kh.call(:server_connect)\n post @socket, server_name, RPL_WELCOME, @nick, \"Welcome to the Internet Relay Network #{@prefix}\"\n post @socket, server_name, RPL_YOURHOST, @nick, \"Your host is #{server_name}, running version #{server_version}\"\n post @socket, server_name, RPL_CREATED, @nick, \"This server was created #{Time.now}\"\n post @socket, server_name, RPL_MYINFO, @nick, \"#{server_name} #{server_version} #{available_user_modes} #{available_channel_modes}\"\n end", "def welcome\n puts \"\"\n puts \"Welcome, your score will be saved to #{@user.email}.\".yellow\n puts \"\"\n puts \"You have #{@user.questions.length} points.\"\n sleep(2)\n end", "def welcome(user)\n @user = user\n @greeting = \"Hi\"\n mail(to:\"[email protected]\", sub:\"Welcome to Devfolio\")\n end", "def welcome\t\n\t\tputs \"Enjoy the Game #{$person.show_name}\"\n\t\tputs \"This game is about guessing a '\\Secret Number'\\ between 1-10. You have 3 attempts to identify the '\\Secret Number'\\. \n\t\t You win if you guess the '\\Secret Number'\\ withing the 3 attempts, otherwise you lose the game!\"\n\tend", "def send_welcome_email\n UserMailer.welcome(self).deliver_now\n end", "def default_welcome_message\n msg = I18n.t('bigbluebutton_rails.rooms.default_welcome_msg_dial_number').html_safe\n if !self.dial_number.blank?\n msg += I18n.t('bigbluebutton_rails.rooms.default_welcome_msg_dial_number').html_safe\n end\n end", "def welcome(user)\n @greeting = \"Hi #{user.fullname}\"\n\n mail to: \"#{user.email}\"\n end", "def greet\n self.say \"Hello, I am #{@config[:nick]}. I am the resident uber-bot. To learn more, type '.about'.\"\n end", "def welcome\n @current_user = current_user\n end", "def welcome\n self.user_id = nil\n prompt.select(\"\\nWelcome to the Forum! Choose an action - \\n (Press Esc at any time to return to this menu!\") do |menu|\n menu.choice \"Login\", -> {login}\n menu.choice \"Create Account\", -> {account_creation}\n menu.choice \"Browse as a Guest\", -> {\n user_id = nil\n show_threads\n }\n menu.choice \"Exit\", -> {exit}\n end\n \n end", "def welcome(user)\n @user = user\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\", :subject => \"Awesome subject for welcome\"\n end", "def send_welcome_mail\n UserMailer.welcome(self).deliver_now\n end", "def welcome_user(opts)\n extract_vars(opts)\n @is_welcome_user = true\n\n I18n.with_locale(@newsletter_user.lang) do\n @newsletter = Newsletter.new(\n title: @newsletter_setting.title_subscriber,\n content: @newsletter_setting.content_subscriber\n )\n end\n\n process_email\n end", "def welcome_strings\n @@welcome_txt=\"Welcome to YouView\"\n @@welcome_msg=\"The YouView app lets you plan your TV viewing and set recordings wherever you are.\"\n end", "def greeting_hello\n answer_with_message(\"Halo bos, ada yang bisa saya bantu ?\")\n end", "def welcome_message\n \"Hello! I'm #{@name} and I'm from #{@country}\"\n end", "def welcome\n\tputs \"Welcome to your recipe manager!\"\nend", "def welcome_the_user()\n puts \"Hi there!\"\nend", "def welcome(nick_name, name)\n puts \"Hello, my friends call me #{nick_name}, but I prefer #{name}.\"\nend", "def run\n @user = \"\"\n welcome\n login_or_signup\n say_hi_to_user\n initial_menu \n end", "def welcome\n # redirect_back(fallback_location: root_path) if @commoner.user.sign_in_count > 1\n @commoner = current_user.meta\n end", "def welcome\n @header = \"This is the Welcome Page\"\n end", "def welcome\n @header = \"This is the Welcome Page\"\n end", "def print_welcome_message\n puts \"\\nThank you for using this amazing command line bowling scorecard, good luck!\\n\"\n end", "def welcome (name)\n\tputs \"Hello #{name}!\"\nend", "def welcome\n system 'clear'\n puts \"--------LOGIN--------\"\n menu = [\"Login\", \"Create new user\"]\n choice = @prompt.select(\"\", menu)\n case choice\n when \"Login\"\n login\n when \"Create new user\"\n create_account\n end\n end", "def greet_user\n greetings = %w[\n bonjour hola hallo sveiki namaste shalom salaam szia halo ciao\n ]\n first_name = message.from.nil? ? '' : ', ' + message.from.first_name\n send_message \"#{greetings.sample.capitalize}#{first_name}!\\n Enter /help for options.\"\n end", "def user_welcome_notice(user)\n @user = user\n mail(:to => @user.email, :subject => \"Welcome to SocialStreet\") unless @user.email.blank?\n end", "def welcome(user)\n\n mail to: user.email, subject: \"Welcome to Teamhuddle\"\n end", "def welcome(user)\n @user = user\n \n mail to: @user.email, subject: \"[Post] Welcome! Thanks for signing up.\"\n end", "def print_welcome_message\n puts \"Welcome to Movie Bookings\"\n puts \"------------------------\"\n end", "def welcome(user, password)\n @greeting = \"Hi\"\n @email = user.email\n @password = password\n\n mail to: user.email\n end", "def welcome_message\r\n system(\"clear\")\r\n a = Artii::Base.new :font => 'slant'\r\n puts a.asciify('Make 10').colorize(:white).on_green\r\n puts (\"This app can find solutions for the game Make 10.\")\r\n end", "def welcome\n render html: \"Welcome to Reel! The best location to find the perfect fishing trip!\"\n end", "def welcome(user)\n @appname = \"Oasis Books\"\n mail( :to => user.email,\n :subject => \"Welcome to #{@appname}!\")\n end", "def send_welcome\n UserMailer.welcome_email(self).deliver\n end", "def welcome(user)\n @name = user.email.split(\"@\").first\n @name = @name.titleize\n @greeting = \"Hi\"\n\n mail to: \"#{@name} <user.email>\"\n end", "def welcome_send\n UserMailer.welcome_email(self).deliver_now\n end", "def send_welcome_email\n UserMailer.delay.welcome_email(self)\n end", "def welcome(user)\n @user = user\n\n mail(to: user.email,\n cc: \"[email protected]\", \n subject: \"[AFL Finals Sharemarket] Welcome to the AFL Finals Sharemarket website\")\n end", "def welcome\n puts <<~DOC\n _____ _ _ _ _ _\n / ____| | | | | (_) | {_}\n| | ___ ___| | _| |_ __ _ _| | |(|\n| | / _ \\\\ / __| |/ / __/ _` | | | |=|\n| |___| (_) | (__| <| || (_| | | | / \\\\\n \\\\_____\\\\___/ \\\\___|_|\\\\_\\\\\\\\__\\\\__,_|_|_| |.--| \\\\~~~/\n| | (_) | | (_) || | \\\\_/\n| | _ ___| |_ _ _ __ __ _ || | Y\n| | | / __| __| | '_ \\\\ / _` | |'--| _|_\n| |____| \\\\__ \\\\ |_| | | | | (_| | '-=-'\n|______|_|___/\\\\__|_|_| |_|\\\\__, |\n __/ |\n |___/\nWelcome to the Cocktail Listing!\nWe are going to gets some drinks going so please select from\nthe options available below to get started...\n.......\n DOC\nend", "def send_welcome(user)\n @user = user\n mail(:to => user.email, :subject => \"Welcome to My Awesome Site\", :content_type => 'text/html', :template_name => 'send_welcome.html')\n end", "def send_welcome\n UserMailer.welcome_email(self).deliver!\n end", "def welcome\n InformationMailer.welcome\n end", "def welcomeUser(*args)\r\n user = args.first\r\n puts \"welcome #{user}\"\r\n # end of method\r\nend", "def welcome\n # welcome my user \n puts \"Welcome to the book search database\\n\"\nend", "def welcome_email\n NotifierMailer.welcome_email User.take\n end", "def welcome(user)\n \n user = @inquiry\n \n @greeting = \"Hi #{user.name}\"\n\n mail(:from => \"[email protected]\",\n :to => user.email,\n :subject => \"Thanks for reaching out\")\n end", "def print_welcome\n puts \"Welcome to Hangman!\"\n puts \"Guess the word: or be hung!\"\n puts \"Remember that you after 10 letter guesses you lose.\"\n end", "def welcome\n\t\tputs \"\\nWelcome to Hots-Fire-Builder, powered by www.heroesfire.com!\" \n\t\tputs \"Type \\\"exit\\\" at any point to exit the application.\"\n\t\tputs \"Enter \\\"help\\\" to see an explanation of the different commands or enter the name of the Hero you wish to search for:\"\n\tend", "def welcome(user)\n @user = user.first_name\n mail(to: user.account.email, subject: 'Welcome to the woods')\n end", "def send_welcome_newsletter\n WelcomeNewsletterJob.set(wait: 10.seconds).perform_later(@newsletter_user, @newsletter_setting)\n end", "def welcome(user)\n #def welcome(email)\n @appname = \"Birdy's golf store\"\n mail( :to => user.email,\n #mail( :to => email,\n :subject => \"Welcome to #{@appname}!\")\n end", "def tweet_greeting\n log \"greeting\"\n post \"Starting meitan-bot. Hello! #{Time.now.strftime('%X')}\"\n end", "def ux_fancy_home_welcome( teacher, first_home)\n if first_home\n if teacher.last_login == nil\n msg = \"Welcome to Geogem, \" << teacher.full_name\n else \n # construct a nice string for last login: earlier today, yesterday, or a specific date\n login_date = teacher.last_login.to_date\n if login_date == Date.today\n tmp = \"earlier today\"\n elsif login_date == Date.yesterday\n tmp = \"yesterday\"\n else\n tmp = teacher.last_login.strftime('%A %B %d')\n end\n msg = \"welcome back, \" << teacher.full_name << \"... your last login was \" << tmp\n end\n else\n msg = \"your home page, \" << teacher.full_name\n end\n msg\n end", "def welcome\n system 'rake db:seed'\n system 'clear'\n Logo.start\n puts \"Hello, and welcome to Crockpot Recipe Finder!\"\n puts \" \"\n sleep(2)\n login_page\n end", "def welcome(user_id)\n user = User.find(user_id)\n mail(\n to: \"#{user.email}\",\n subject: \"Welcome to Lister!\"\n )\n end" ]
[ "0.81495315", "0.7845505", "0.77892077", "0.7655088", "0.7621176", "0.7612295", "0.7593349", "0.7572082", "0.75670177", "0.7547656", "0.75437343", "0.7487602", "0.7476015", "0.7461549", "0.7376549", "0.7371658", "0.732853", "0.730973", "0.7309636", "0.7286397", "0.7285762", "0.7233006", "0.7223726", "0.7145504", "0.71372706", "0.7108832", "0.709259", "0.70776343", "0.703564", "0.7023115", "0.6999212", "0.6989983", "0.6969535", "0.6951627", "0.6932426", "0.6919545", "0.6918958", "0.69162995", "0.69000775", "0.6885996", "0.6847909", "0.684633", "0.6831367", "0.6822439", "0.6814414", "0.6795296", "0.67936087", "0.6790106", "0.67790264", "0.6768006", "0.6767372", "0.67568344", "0.67395234", "0.67297846", "0.6727441", "0.67190385", "0.6710837", "0.6703301", "0.66709137", "0.66693646", "0.6665342", "0.66447407", "0.66431886", "0.6640451", "0.664032", "0.664032", "0.6639855", "0.66286117", "0.66232604", "0.6621116", "0.6613636", "0.66120815", "0.6608541", "0.6592376", "0.6584057", "0.6574054", "0.65657765", "0.6561576", "0.65602547", "0.65584266", "0.65536183", "0.6552036", "0.6551613", "0.65470695", "0.6545948", "0.6542508", "0.65358365", "0.6531286", "0.6527894", "0.65116644", "0.6509021", "0.65085864", "0.64984435", "0.6492629", "0.6489742", "0.6472859", "0.64719206", "0.6467698", "0.64676386", "0.64654356" ]
0.7348568
16
Display main menu and get user's choice
def get_menu_choice choices = ["1. Play Hangman", "2. Load Saved Game", "3. Delete Saved Game", "4. List Saved Games", "5. Quit"] display_menu choices while true print "Enter Selection (1 - #{ choices.length }): " choice = gets.chomp.to_i return choice if choice.between?(1, choices.length) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main_menu\n menu = [\n \"My Stats\",\n \"My Hikes\",\n \"Trails\",\n \"Quit\"]\n choice = nil\n while choice != \"Quit\"\n system 'clear'\n puts \"------MAIN MENU------\"\n choice = @prompt.select(\"What would you like to do #{@current_user.name}?\", menu)\n\n case choice\n when \"My Stats\"\n user_stats\n when \"My Hikes\"\n hike_options\n when \"Trails\"\n trail_options\n end\n end\n end", "def main_menu\n choice = self.prompt.select(\"Hi there, #{self.user.name}! What would you like to do today?\", [\"Create a new post\", \"Find a book\", \"View or edit my posts\", \"Delete my account\", \"Logout\"])\n\n case choice\n when \"Create a new post\"\n self.new_post\n when \"Find a book\"\n self.find_book\n when \"View or edit my posts\"\n self.view_edit_posts\n when \"Delete my account\"\n self.delete_account\n when \"Logout\"\n self.spinner(\" ✌️✌️✌️ \")\n self.greet\n end\n end", "def main_menu\n prompt.select(\"What would you like to do today #{user.name}?\") do |menu|\n menu.choice \"Choose Protein\", -> {choose_protein}\n menu.choice \"Exit!\", -> {exit_helper}\n menu.choice \"Delete Account!?!?\", -> {delete_account_helper}\n end\n end", "def main_menu\n @ui.input_1_change\n @ui.user_input1.downcase\n unless %w[trains routes stations cars].include? @ui.user_input1\n puts 'There is no such option in the main menu.'\n end\n main_menu_choose_option(@ui.user_input1)\n end", "def display_menu\n puts \"Choose from the following options: \\n\n to find a candidate, type 'find id' (ex. find 1)\n to view all candidates, type 'all'\n to view all qualified candidates, type 'qualified'\n to exit, type 'quit' \n to view menu, type 'menu' \\n\\n\"\nend", "def main_menu\n @active = 0\n @prompt.select(\"\\nWhat would you like to do?\\n\".blue) do |menu|\n menu.choice \"Check out what's on today\", -> {today_menu} \n menu.choice \"Check out things to do on the weekend\", -> {weekend_menu}\n menu.choice \"Look at my favourites\", -> {display_favorites}\n menu.choice \"Exit\".red, -> {leave_app} \n end \n end", "def main_menu\n @@prompt.select(\"What would you like to do today?\".colorize(:yellow)) do |menu|\n menu.choice \"Read Reviews\", -> {self.read_reviews}\n menu.choice \"Write a review\", -> { self.writing }\n menu.choice \"Update a review\", -> { self.update_reviews }\n menu.choice \"Delete a review\", -> { self.deleting }\n menu.choice \"Log Out\", -> { self.log_out }\n end\n end", "def main_menu\n while true\n print_main_menu\n user_selected = gets.chomp.to_s\n call_option(user_selected)\n end\n end", "def display_menu\n system('clear')\n arr = ['My List', 'Recommendations', 'Playlist', 'Account Details', 'Exit']\n @prompt.select(\"》 MAIN MENU 《\\n\".colorize(:light_green), arr)\n end", "def main_menu\n name_selector\n puts \"Okay #{@name}, what would you like to do?\"\n loop do\n case menu_arrows\n when '1'\n @recommendation.recommendation_menu\n when '2'\n puts 'you have the following number of games in your library: '\n @game_library.game_instances\n puts 'your custom list of games:'\n @game_library.user_games_lister\n when '3'\n puts 'add a game:'\n @game_library.add_title\n when '4'\n @game_library.delete_games\n when '5'\n @time_used.time_wasted\n when '6'\n @game_library.write_games\n puts 'thanks for your time!'\n exit\n end\n end\n end", "def main_menu\n while true\n print_main_menu\n user_selected =gets.to_i\n call_option(user_selected)\n end\n end", "def main_menu\n menu_options = [\"Start exploring\", \"Check Inventory\", \"Check Your Score\", \"Go to Pokemon Center\", \"Quit\"]\n menu_prompt = Interactivity.mainMenu \n \n if user.pokemon == nil\n menu_options.shift()\n menu_options.unshift(\"Choose a Pokemon and start exploring\")\n elsif self.user_current_location\n menu_options.shift()\n menu_options.unshift(\"Keep Exploring\")\n end\n \n choice = prompt.select(menu_prompt, menu_options) \n if choice == \"Start exploring\" || choice == \"Choose a Pokemon and start exploring\" || choice == \"Keep Exploring\"\n self.trainer_chooses_pokemon if user.pokemon == nil \n self.trainer_chooses_town\n self.exploring_town\n elsif choice == \"Check Inventory\"\n puts \"MANAGE INVENTORY - CHANGE POKEMONS AROUND\"\n elsif choice == \"Go to Pokemon Center\"\n self.pokemon_center\n elsif choice == \"Check Your Score\"\n puts \"CHECK YOUR SCORE\"\n else\n Interactivity.quit\n end\n end", "def print_menu\n output.puts \"Madden's Car Selection Tool-\"\n \n # Print Current Model Info\n print_model_info\n\n # Print Menu Choices\n print_menu_choices\n\n # Get User Choice\n output.print \"Enter choice: \"\n end", "def case_menu(selection)\n case selection\n when 'Playlist'\n @playlist.menu\n when 'Account Details'\n account_details\n when 'Exit'\n p \"Is this exiting?\"\n end\n end", "def main_menu_selection\n puts \"\"\n PROMPT.select(\"What would you like to do?\") do |menu|\n menu.choice \"Download this week's quiz\", 1\n menu.choice \"Download last week's quiz\", 2\n menu.choice \"Exit app\", 3\n end\n end", "def display_main_menu\n loop do\n case main_menu_selection\n when 1\n RunApp.start_quiz(1)\n when 2\n RunApp.start_quiz(2)\n when 3\n exit\n end\n end\n end", "def main_menu\n\t\tputs '################################'\n\t\tputs '######### Tic Tac Toe ##########'\n\t\tputs '################################'\n\t\tputs '================================'\n\t\tputs '== Choose your weapon warrior =='\n\t\tputs '================================'\n\t\tputs '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'\n\t\tputs '^^^^^^ Type Your Choice: ^^^^^^^'\n\t\tputs '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'\n\t\tputs '$$$$$$$$$$$ 1. \"X\" $$$$$$$$$$$$$'\n\t\tputs '$$$$$$$$$$$ 2. \"O\" $$$$$$$$$$$$$'\n\t\tputs '--------------------------------'\n\tend", "def main_menu\n\tputs \"\\n1 Library\\n2 Staff Members\\n3 Books\\n4 Patrons\\n0 Exit\\n\"\n\tselect = make_selection\n\n\twhile select != \"1\" && select != \"2\" && select != \"3\" && select != \"4\" && select != \"0\"\n\t\tputs \"\\nInvalid choice selected\\n\"\t\t \t\t\n\t\tselect = make_selection\n\tend\n\n\tif select == \"1\"\n\t\tlibrary_choice = \"9\"\n\t\twhile library_choice != \"0\"\n\t\t\tlibrary_choice = select_choice_library\n\t\tend\n\n \telsif select == \"2\"\n\t\tstaff_member_choice = \"9\"\n\t\twhile staff_member_choice != \"0\"\n\t\t\tstaff_member_choice = select_choice_staff_member\n\t\tend\n\n\n\telsif select == \"3\"\n\t\tbook_choice = \"9\"\n\t\twhile book_choice != \"0\"\n\t\t\tbook_choice = select_choice_book\n\t\tend\n\n\n\telsif select == \"4\"\n\t\tpatron_choice = \"9\"\n\t\twhile patron_choice != \"0\"\n\t\t\tpatron_choice = select_choice_patron\n\t\tend\n\n\n\telsif select == \"0\"\n\t\tputs \"\\nGoodbye\"\t\t \t\t\n\tend\n\tselect \nend", "def main_menu\n finished = false\n while finished == false\n user_input = @prompt.select(\"\\nWelcome, Please choose from the following options\") do |menu|\n menu.choice 'View Rules'\n menu.choice 'View Balance'\n menu.choice 'View Ratio'\n menu.choice 'Play Game'\n menu.choice 'Quit'\n end\n\n if user_input == 'View Rules'\n @rules.each do |rule|\n puts rule\n end \n elsif user_input == 'View Balance'\n puts \"\\nYour bank balance is $#{@user[:balance]}\"\n elsif user_input == 'View Ratio'\n puts \"\\nYour win/loss ratio is #{@user[:ratio]}\"\n elsif user_input == 'Play Game'\n run_game() \n clear_hands()\n else user_input == 'Quit'\n finished = true\n update_file()\n end\n end\n end", "def menu\n puts \"\\n************************************************************\".colorize(:magenta).blink\n puts \"Select an option (1-5) from the menu below:\".colorize(:blue).bold\n puts \"------------------------------------------------------------\".colorize(:cyan)\n puts \"1. Don't want to think about what to cook? \\n Spin the RANDOM WHEEL OF RECIPES!\".colorize(:blue)\n puts \"------------------------------------------------------------\".colorize(:cyan)\n puts \"2. Need some inspiration for cooking? \\n Find recipe by name OR \\n if you have leftover ingredients search your ingredients!\".colorize(:blue)\n puts \"------------------------------------------------------------\".colorize(:cyan)\n puts \"3. Feeling creative? \\n Write and save your own recipe!\".colorize(:blue)\n puts \"------------------------------------------------------------\".colorize(:cyan)\n puts \"4. View ALL your favorite recipes in 1 place!\".colorize(:blue)\n puts \"------------------------------------------------------------\".colorize(:cyan)\n puts \"5. You're done? Time to exit...\".colorize(:blue)\n puts \"************************************************************\\n \".colorize(:magenta).blink\n end", "def displaymenu # Console only\r\n\t\t @output.puts \"Menu: (1) Play | (2) New | (3) Analysis | (9) Exit\"\r\n\t\t end", "def booth_main_menu\n prompt.select(\"Welcome Booth Operator, what would you like to do today?\" ) do |menu|\n menu.choice \"View Merchandise\", -> {self.user.check_merchandise}\n menu.choice \"Update Inventory\", -> {self.user.add_to_inventory}\n menu.choice \"List of Customers\", -> {self.user.list_of_attendees}\n menu.choice \"Number of Sales\", -> {self.user.number_of_sales}\n menu.choice \"Items Sold\", -> {self.user.sales_made}\n menu.choice \"Sales Revenue\", -> {self.user.sales_revenue}\n menu.choice \"Exit\", -> {exit!}\n end\n end", "def secret_menu\n puts \"\"\n options = [\"View Character Dictionary\", \"View Spellbook\", \"View House\", \"View Classmates\", \"Quit\"]\n choice = PROMPT.select(\"Welcome to Hogwarts. Feel free to explore the following:\", options)\n case choice\n when options[0]\n character_dictionary\n when options[1]\n which_user_spellbook_and_path?\n secret_menu_or_quit\n when options[2]\n house_info\n secret_menu_or_quit\n when options[3]\n user_classmates\n when options[4]\n goodbye\n end\n end", "def display_main_menu_choice\n #The disabled choice will be displayed with a cross ✘ character next to it and followed by an explanation:\n menu_choices = [\n 'First Time User, Want To Register',\n 'Already A Registered User, Want To Login',\n # { name: 'Goro', disabled: '(injury)' },\n 'Do Not Wish To Register, Just Browsing',\n 'Looking For Info About The App',\n 'Nothing Really, Spare Me Your @?%#&?|%!'\n ]\n choice_msg = 'What Will It Be, We Offer A Great Many Choices!'\n # system \"say #{choice_msg}\"\n main_menu_choice = prompt.select('What Will It Be, We Offer A Great Many Choices!'.colorize(:color => :light_blue), menu_choices)\nend", "def main_menu\n puts \"===============\"\n puts \"Make a selection\"\n puts \"===============\"\n puts \"1: Command line\"\n puts \"2: Atom\"\n puts \"3: Search?\"\n puts \"4: Quit\"\n puts \"===============\"\n\n case gets.strip\n when \"1\"\n command_line_menu\n when \"2\"\n atom_menu\n when \"3\"\n search_function\n reset\n when \"4\"\n exit 0\n else\n bad_choice\n main_menu\n end\nend", "def main_menu()\n system 'clear'\n loop do\n headline(\"My Petsitter App\")\n puts \"#{@emoji[:smiling_cat_face_with_open_mouth]} Welcome! #{@emoji[:dog_face]}\".colorize(:bold)\n puts @headline\n input = @prompt.select('Menu:') do |menu|\n menu.choice name: 'Pet Sitters', value: \"PET_SITTERS\"\n menu.choice name: 'Clients', value: \"CLIENTS\"\n menu.choice name: 'Jobs', value: \"JOBS\"\n menu.choice name: 'Logout', value: \"EXIT\"\n end\n puts '-' * 20\n go_to(input)\n end\n end", "def menu\n puts \"------Calculator----\"\n puts \"Welcome to the calculator!\"\n puts \"Please select an option:\"\n puts \"\\t1) Enter numbers and modifier\"\n puts \"\\t2) Enter a string input\"\n puts \"\\t3) View the calculations you have preformed\"\n puts \"\\t4) Exit\"\n main_menu\n end", "def list_option\n list_politicians\n list_voters\n puts\n puts \"(R)eturn to the main menu?\".center(80).green\n menu_return = gets\n end", "def display_main_menu\n puts \"\\nMain Menu\".colorize(:red)\n puts \"-----------------------\".colorize(:blue)\n puts \"You currently have $#{@player.wallet}\".colorize(:red)\n puts \"Please select one of the following:\".colorize(:red)\n puts \"1)Roulette\".colorize(:blue)\n puts \"2)Black Jack\".colorize(:blue)\n puts \"3)Slots\".colorize(:blue)\n puts \"4)Dice\".colorize(:blue)\n puts \"5)Horse Races\".colorize(:blue)\n puts \"6)Additional Options\".colorize(:blue)\n puts \"-----------------------\".colorize(:blue)\n print \"> \"\n choice = gets.to_i\n case choice\n when 1 # Roulette\n Roulette.new(@player)\n when 2 # Black Jack\n BlackJack.new(@player)\n when 3 # Slots\n Slots.new(@player)\n when 4 # Dice\n Dice.new(@player)\n when 5 # Horse Races\n HorseRaces.new(@player)\n when 6\n repeat_menu\n else\n puts \"Invalid input, try again.\".colorize(:red)\n sleep(1)\n display_main_menu\n end\n print `clear`\n repeat_menu\n end", "def present_menu\n puts \"-------------------\"\n puts t('select_features')\n puts t('feature_one')\n puts t('feature_two')\n puts t('feature_three')\n puts t('exit_option')\n\n selected_feature = gets.to_i\n\n case selected_feature\n when FEATURE_OPTION_MAJOR_STATES\n print_major_states\n when FEATURE_OPTION_AVERAGE_POP\n print_average_population_for_state\n when FEATURE_OPTION_BOUNDARY_CITIES\n print_boundary_cities_for_state\n when FEATURE_OPTION_EXIT\n return\n else\n puts t('invalid_option', option: selected_feature)\n run\n end\n end", "def main_menu\n choice = true\n while choice\n puts \"What would you like to do?\"\n puts \"(C)reate, (L)ist, (U)pdate, (D)elete, or (E)xit \"\n options = gets.chomp.downcase\n\n case options\n when \"c\"\n # runs method create line 101\n create\n when \"l\"\n #runs method list line 144\n list\n when \"u\"\n #runs method update line 161\n update\n when \"d\"\n #runs method delete line 229\n delete\n when \"e\"\n choice = false #exits world\n else\n puts \"Wrong Input. Please input C, L, U, D or E\"\n end\n end\n end", "def main_menu\n \twhile true\n \t\tprint_main_menu\n\n \t\tprint \"Choose an option:\"\n \t\tuser_input = gets.chomp.to_i\n\n \t\tbreak if user_input == 7\n \t\t\n choose_option(user_input)\n \tend\n end", "def show_menu\n\n menu_pick = @prompt.select('Please select a menu option: ') do |menu|\n menu.choice 'Show Events by Country', 'find by country'\n menu.choice 'Show Events by City', 'find by city'\n menu.choice 'Show Events By Date', 'find by date'\n menu.choice 'Get Event Info By Name', 'find by name'\n menu.choice 'Exit', 'exit'\n end\n\n return menu_pick if menu_pick == 'exit'\n\n event = handle_input(menu_pick)\n\n display_info(event) if event\n\n end", "def main_menu(user)\n user = user\n self.clear\n Ascii.image\n menu = [\"See all my plants\",\"Add new plant\",\"Delete my account\",\"Quit\"]\n menu_selection = @@prompt.select(\"What would you like to do?\",menu)\n \n case menu_selection\n when \"See all my plants\"\n my_plant(user)\n when \"Add new plant\"\n add_plant(user)\n when \"Delete my account\"\n answer = @@prompt.yes?(\"Are you sure?\")\n answer == true ? user.destroy : self.main_menu(user)\n when \"Quit\"\n index = 0\n # binding.pry\n color = [\"#7FFF00\",\"#6B8E23\",\"#008000\",\"#2F4F4F\",\"#00008B\"]\n 5.times do\n self.clear\n # binding.pry\n puts Paint[Ascii.goodbye, color[index]] \n index += 1\n sleep(0.7)\n end \n end\n end", "def menu\n puts \"#{dashes}\\n\n Choose from the following options - using the numbers (1-6) as your input:\\n\n - 1 - Create your user profile\n - 2 - Search for doctors by region\n - 3 - Search for doctors by specialty\n - 4 - Search for the doctors the user has visited\n - 5 - Does something else\n - 6 - Quit the application\n \"\n end", "def sub_menu\n puts \"\\n***********************************************\".colorize(:magenta).blink\n puts \"Type the following letters to do...\".colorize(:blue)\n puts \"-----------------------------------------------\".colorize(:cyan).bold\n puts \"s = Save Recipe to My Favorites\".colorize(:blue)\n puts \"r = Rate Recipe\".colorize(:blue)\n puts \"a = See Average Recipe Rating\".colorize(:blue)\n puts \"o = Open Link to See the Steps for This Recipe\".colorize(:blue)\n puts \"m = Back to Main Menu\".colorize(:blue)\n puts \"***********************************************\\n \".colorize(:magenta).blink\n end", "def login_menu_display\n puts \"Welcome to Ticket Search app!\"\n login_choice = @prompt.select(\"What would you like to do?\", [\"Create Account\", \"Login\", \"Exit\"])\n case login_choice\n when \"Create Account\"\n user_create\n system \"clear\"\n when \"Login\"\n account_login\n system \"clear\"\n when \"Exit\"\n exit\n end\n end", "def op_menu\n loop do\n case Prompts.op_selection\n when '1'\n user = User.new_user_input\n main_menu(user)\n when '2'\n User.user_login\n when '3'\n quit\n end\n end\n end", "def menu_choice\n user_input = gets.chomp\n case user_input\n when \"1\"\n # Call function to show all of the doctors by region\n\n # show_all_doctors_by_region\n\n show_all_article_by_with_authors\n return_to_menu\n when \"2\"\n # Call function to show all of the doctors by specialties\n show_all_article_titles_with_content\n return_to_menu\n when \"3\"\n # Call function to show all of the doctors a user has visited\n show_all_authors\n return_to_menu\n when \"4\"\n puts Rainbow(\"Here are all the authors to choose from:\\n\").white.bright\n show_all_authors\n puts Rainbow(\"\\nPlease provide an author name:\").white.bright\n author = gets.chomp\n find_article_titles_by_author(author)\n show_full_list_of_articles(author)\n return_to_menu\n when \"5\"\n show_latest_article\n return_to_menu\n when \"6\"\n quit\n else\n puts Rainbow(\"Invalid option. Please select a number between 1 and 6.\").white.bright\n menu\n menu_choice\n end\n end", "def main_menu\n options = [\"View recipe book\", \"Search by ingredient\", \"Quit app\"]\n answer = @prompt.select(\"Choose an option:\".colorize(:color => :blue), (options))\n if answer == options[0]\n select_recipe_from_book(@user.view_recipe_book)\n elsif answer == options[1]\n find_recipe\n elsif answer == options[2]\n puts ''\n puts \"Thanks for using Feed. See you next time!\".colorize(:color => :blue)\n system exit\n end\nend", "def start_menu\n printf \"\\nPrograma para a disciplina de LPD\\n\"\n printf \"Choose one option\\n\"\n printf \"------------------------------------\\n\"\n printf \"1) Insert user\\n\"\n printf \"2) Login user\\n\"\n printf \"3) Delete user\\n\"\n printf \"0) Exit\\n\"\nend", "def menu_options\n system \"clear\"\n puts \"~~~ Welcome #{@user.username} to the Main Menu ~~~\\n\\n\" \n puts \"{1} Continue from previous story \"\n puts \"{2} Create new story\"\n puts \"{3} Delete a story\"\n puts \"{4} Tutorial\"\n puts \"{5} End My Session\"\nend", "def main_menu\n\tputs \"Welcome, what would you like to do today?\"\n\tputs \"1) Add Items to Cart\"\n\tputs \"2) View Items in Cart\"\n\tputs \"3) Remove Items from Cart\"\n\tputs \"4) View Total\"\n\tputs \"5) Exit\"\n\tuser_input = gets.strip.to_i\n\n\n\tcase user_input\n\twhen 1\n\t\tadd_items\n\twhen 2\n\t\tview_items\n\twhen 3\n\t\tremove_item\n\twhen 4\n\t\tshow_total\n\twhen 5\n\t\tputs \"Thank you for shopping with DPL Grocery!\"\n\t\texit!\n\telse\n\t\tputs \"Wrong option bruuuh, try again!\"\n\t\t# puts \"Please choose from the options above, try again.\"\n\tmain_menu\n\tend\nend", "def main_menu\n main_menu_options = {'Interact with Existing Kits' => :list_and_select_kit,\n 'Create a new Kit' => :prompt_kit_params, \n 'Quit' => :quit}\n \n op = @io.select_from_options(\"What would you like to do?\", main_menu_options)\n @operation_stack.unshift op\n \n # return nil, because there's nothing to pass onto the next method\n return\n end", "def menu\n system('clear')\n selection = @prompt.select('》 PLAYLIST 《', ['Display', 'Add', 'Remove', 'Export To File', 'Back'])\n case selection\n when 'Display'\n list\n else\n case_menu(selection)\n end\n end", "def main_menu\n\tputs \"Welcome to Creighton Bank!\"\n\tputs \"Please make choose an option:\"\n\tputs \"------------------------------\"\n\tputs \"1. Create a new account\"\n\tputs \"2. View Account Information\"\n\tputs \"3. Exit Program\"\n\n\tprint \"Option: \"\n\n\toption = gets.chomp.to_i\n\n\tif option == 1\n\t\t\tcreate_account\n\t\t\tmain_menu\n\telsif option == 2\n\t\t\taccount_menu\n\telsif option == 3\n\t\t\tputs \"Thank you for stopping by!\"\n\telse\n\t\tputs \"Invalid entry! Please choose from the available options!\"\n\t\tmain_menu\n\n\tend\t\nend", "def main_menu\n\tputs \"Welcome to Happitails!\"\n\tputs \"Please choose from the options below\"\n\tputs \"1. Add Animal\"\n\tputs \"2. Create Client\"\n\tputs \"3. Adopt an animal\"\n\tputs \"4. Put animal up for adoption\"\n\tputs \"5. View all animals\"\n\tputs \"6. View all clients\"\n\n\n\t# puts \"Z. SECRET DEBUGGING MODE\"\n\n\tputs \"q. Quit\"\nend", "def main_menu\n\t\twhile true\n\t\t\tprint_main_menu\n\t\t\tuser_selected = gets.chomp.to_i\n\t\t\t\tif user_selected == 7\n\t\t\t\tputs \"Current session ended, goodbye!\"\n\t\t\t\treturn\n\t\t\tend\n\t\t\tcall_option(user_selected)\n\t\tend\n\tend", "def show_main_menu\n puts \"Welcome to the app. What would you like to do?\"\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" quit - Exit Application\"\n puts \" show - shows contact with specific id\"\n puts \" find - find a user\"\n print \"> \"\n end", "def main_menu(user)\n calories = Calories.new\n loop do\n calories.calorie_intake(user)\n case Prompts.main_selection\n when '1'\n calories.log_daily_meals\n when '2'\n calories.log_daily_intake\n when '3'\n Details.update_weight(user)\n when '4'\n Quotes.inspirational\n when '5'\n quit\n end\n end\n end", "def display_menu\n title_print\n puts \"Hi #{@todays_hero.name}!\"\n puts \"***************************\"\n selection = TTY::Prompt.new.select(\"What would you like to do?\", per_page: 10, cycle: true) do |menu|\n menu.enum '>'\n\n menu.choice 'Start a fight', 1\n menu.choice 'Train for battle', 2\n menu.choice 'Go on a Quest', 3\n menu.choice 'Show Stats', 4\n menu.choice 'Display Instructions', 5\n menu.choice 'Display Leaderboard', 6\n menu.choice 'Exit', 7\n end\n self.start_game_loop(selection)\n end", "def manage_account_menu\n choice = @prompt.select(\"Please choose from the following options:\") do |menu|\n menu.choice 'Change my name'\n menu.choice 'Change my password'\n menu.choice 'Delete my account'.blue\n menu.choice \"Back to Main Menu\"\n end\n\n if choice == \"Change my name\"\n change_name\n elsif choice == \"Change my password\"\n change_password\n elsif choice == \"Delete my account\".blue\n delete_account\n elsif choice == \"Back to Main Menu\"\n start_menu\n end\nend", "def main_menu\nputs \"-------------------------------------- \n Main Menu:\n What would you like to do? \n-- Create, List, Update, or Vote --\"\n\n case gets.chomp.capitalize\n when \"Create\"\n create\n when \"List\"\n list\n when \"Update\"\n update\n when \"Vote\"\n vote\n else\n main_menu\n end #end of case\nend", "def interactive_menu\n loop do\n print_menu\n user_choice(STDIN.gets.chomp)\n end\nend", "def main_menu\n puts\"(b) - basic calculator\"\n puts\"(a) - advanced calculator\"\n puts\"(bmi) - body mass index\"\n puts\"(t) - trip calculator\"\n puts\"(m) - morgage\"\n puts\"(q) - quit\"\nend", "def main_menu\n puts \"(b) - basic calculator\"\n puts \"(a) - advanced calculator\"\n puts \"(bmi) - BMI calculator\"\n puts \"(m) - mortgage calculator\"\n puts \"(t) - trip calculator\"\n puts \"(q) - quit\"\nend", "def menu\n print \"\\nWhat would you like to do? \".colorize(:green)\n input = gets.strip.upcase\n if input == 'ROSTER'\n list_heroes\n elsif input == 'EXIT'\n exit\n else\n display_hero(input)\n end\n end", "def show_menu\n clear_screen\n\n puts \"[+] #{FreelancerFinder::Job.all.count} Jobs Scraped [+]\".magenta\n puts \"_____________________________________________________________\"\n return @prompt.select(\"Please Select a Menu Option: \") do |menu|\n menu.choice \"show recent\"\n menu.choice \"scrape more\"\n menu.choice \"search\"\n menu.choice \"search by pay\"\n if @last_results\n menu.choice \"results\"\n end\n menu.choice \"exit\"\n end\n\n end", "def main_menu\n puts \"\"\n puts \"-----------------------------------------------\"\n puts \"\"\n puts \"Please select an option:\"\n puts \"\"\n puts \"Enter 'list' for a list characters, 'quote' for a random Stan Lee quote, or 'exit' to bid farewell.\"\n puts \"\"\n input = user_input\n\n if input == 'list'\n list_characters\n elsif input == 'quote'\n stan_lee_quote\n elsif input == 'exit'\n goodbye\n elsif input != 'list' || input != 'exit' # had to add \"input !=\" each time to avoid the string literal warning\n invalid_input\n main_menu\n end\n \n end", "def start_menu\n puts \"\"\n choice = @prompt.select(\"Welcome! Please choose from the following options:\") do |menu|\n menu.choice 'Play'\n menu.choice 'Account Management'\n menu.choice 'Check Scoreboard'\n menu.choice \"Exit\"\n end\n\n if choice == \"Play\"\n if @user\n play\n else\n login\n play\n end\n elsif choice == \"Account Management\"\n manage_account\n elsif choice == \"Check Scoreboard\"\n scoreboard\n elsif choice == \"Exit\"\n system 'killall afplay'\n goodbye\n end\nend", "def select_option\n print_menu\n @choice = gets.chomp\n perform_selection\n end", "def list_menu\n puts \"\\nMain Menu\"\n puts \"1. Daily Prophet - News!\"\n puts \"2. Evanesco - Exit\"\n end", "def present_menu_options\n space(1)\n puts \"Choose an option from the list below.\"\n space(1)\n puts '1. Search for events by city'\n puts '2. Search for events by artist or sports team'\n puts '3. See what I have coming up'\n puts '4. Delete my account'\n puts '5. Exit'\n space(1)\n pick_option\nend", "def main_menu\n\n puts \"Doctor's Office Manager\"\n puts \"Enter 'a' to access the appointments menu.\"\n puts \"Enter 's' to access specialities menu.\"\n puts \"Enter 'p' to access patient menu.\"\n puts \"Enter 'i' to access insurance menu.\"\n puts \"Enter 'd' to access doctor menu.\"\n puts \"Enter 'e' to exit\"\n puts \"Enter 'r' to access README\"\n\n user_choice = gets.chomp.downcase\n\n case user_choice\n when 'a'\n appointment_menu\n when 's'\n specialties_menu\n when 'p'\n patient_menu\n when 'i'\n insurance_menu\n when 'd'\n doctor_menu\n when 'e'\n puts \"Goodbye!\"\n sleep 1\n exit\n when 'r'\n display_readme\n else\n puts \"Enter something proper, ya jackass\"\n end\n\nmain_menu\nend", "def menu\n\n puts \"________________\"\n\n puts \"insert the user name to continue\"\n @user_name = gets.chomp\n response = User.find_by(user_name: @user_name)\n\n puts \"________________\"\n\n if response\n \n mainscreen\n else\n puts \"try again\"\n menu\n end\n end", "def main_menu(user_instance)\n user_greeting(user_instance)\n case help\n when \"1\", \"playlist\", \"playlists\"\n system(\"clear\")\n playlists_menu(user_instance)\n when \"2\", \"songs\", \"song\"\n system(\"clear\")\n songs_menu(user_instance)\n # when \"3\", \"artists\", \"artist\"\n # system(\"clear\")\n # artists_menu(user_instance)\n when \"exit\"\n system(\"clear\")\n goodbye\n exit\n else\n system(\"clear\")\n puts \"Please enter a valid command.\".colorize(:red).bold\n main_menu(user_instance)\n end\nend", "def main_menu\n\nputs \"------------------------------------------------ \n Main Menu:\n What would you like to do? \n-- Create, List, Update, or Vote --\"\n\n case gets.chomp.capitalize\n when \"Create\"\n create\n when \"List\"\n list\n when \"Update\"\n update\n when \"Vote\"\n vote\n else\n main_menu\n end #end of case\n\nend", "def menu\n\tputs \"(b)asic, (a)dvanced, or (q)uit\"\n\t$menu_choice = gets.chomp.downcase\nend", "def show_main_menu\n puts \"What would you like do next?\"\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" delete - Delete a contact\"\n puts \" show - Display contact details\"\n # puts \" find - Find a contact\"\n print \"> \"\n end", "def main_menu\r\n puts \"\\nMain Menu.\"\r\n puts \"A. List Buildings\"\r\n puts \"B. List Machines\"\r\n puts \"C. List Snacks\"\r\n puts \"D. List Users\"\r\n puts \"E. Find a Snack\"\r\n puts \"F. Add a New Snack\"\r\n puts \"G. Create New User\"\r\n puts \"H. List Favorites\"\r\n puts \"I. Find Favorites\"\r\n puts \"J. Add Favorites\"\r\n puts \"Q. Quit\"\r\nend", "def tableau_menu\n player_name_list = @mk.players.collect { |p| p.name }\n @@cli.choose do |menu|\n menu.prompt = \"Whose situation do you want information on? \"\n menu.choices(*player_name_list) do |chosen|\n @@cli.say \"You have chosen <%= color('#{chosen}', BOLD) %>. \"\n @mk.players.find { |p| p.name==chosen }.tableau.console_output\n end\n menu.choice(:none) { @@cli.say \"OK, leaving tableau menu\"}\n end\n end", "def menu\n selection = gets.chomp.to_i\n case selection\n when 1\n all_tickets = Tickets.new(@zendesk_tickets)\n all_tickets.view_all\n when 2\n single_ticket = Ticket.new(@zendesk_tickets)\n single_ticket.view_all\n when 3\n system 'clear'\n puts \"Goodbye!\"\n exit\n else\n system 'clear'\n puts \"Invalid choice, select between 1, 2 or 3\"\n welcome_message \n menu\n end\n end", "def main_menu(owner_name, owner)\n puts \"#{page_break}\\n\n Select from the following menu options to get started:\\n\n 1 - Make New Appointent\n 2 - Reschedule Appointment\n 3 - Cancel Appointment\n 4 - Search for a Groomer\n 5 - Exit\n \"\n end", "def main_menu\n input = 0\n until input.to_i == @@main_ops.length - 1 \n print \"\\e[H\\e[2J\" #clears the screen\n puts @name \n print_menu(@@main_ops)\n print \"Choose an option by entering a number: \"\n input = gets.chomp\n call_option(input)\n end\n end", "def display_menu\n # print the options\n puts \"Main menu:\"\n puts \"s = Start game\"\n puts \"c = Change size\"\n puts \"q = Quit\"\n # print the best score\n # if there is no best score yet a message is displayed instead\n if $best_score == 0\n puts \"No games played yet\"\n else\n puts \"Best game: #{$best_score} turns\"\n end\n \n # Then ask for input for one of the options\n print \"Please enter your choice: \"\n \nend", "def main_menu\n selection = input(@menu) {|o| (1..2) === o.to_i }.to_i\n \n if 1 == selection\n :continue\n elsif 2 == selection\n :quit\n end\n end", "def show_main_menu\n puts \"Welcome to the app. What's next?\"\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" find - Find by name\"\n puts \" quit - Exit Application\"\n print \"> \"\n end", "def display_menu\n\t\n\tputs \" \"\n\tputs \"Would you like to (a)dd a new apartment, (c)reate a new person?, or (q)uit?\"\n\tputs \" \"\n\tgets.chomp.downcase\nend", "def main_menu\n puts \"Main Menu\"\n puts \"(a) - Basic calculator\"\n puts \"(b) - Advanced calculator\"\n puts \"(c) - Special calculators\"\n puts \"(q) - Quit\"\nend", "def menu\n display_header\n until $player_quits do\n display_player_stats\n display_game_menu\n choice = @input.gets.chomp\n\n case choice\n when '1':\n play_blackjack\n when '2':\n raise 'This game is not implemented yet.'\n when '3':\n raise 'This game is not implemented yet.'\n when /a/i:\n add_ai_player\n when /p/i:\n setup_player\n when /d/i:\n debug_console\n when /q/i:\n $player_quits = true\n exit\n else\n @output.puts 'Invalid choice, dumbass.'\n end\n end\n end", "def menu\n # This uses a HEREDOC for multiline listing\n puts \"-------------------------\".colorize(:green) \n puts <<-MENU\n\nChoose a how you would like to see a card. You can view by name, creature, enchantment or sorcery:\n1. See cards by Name \n2. See cards by Creature \n3. See cards by Enchantment \n4. See cards by Sorcery\n\nOr type 'exit' at any time to leave the program. Type 'menu' to return to the main menu.\n MENU\n end", "def show_main_menu\n puts \"Welcome to the app. What's next?\".yellow\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" show - display details via index\"\n puts \" find - find someone by name\"\n puts \" quit - Exit Application\"\n print \"> \"\n end", "def menu\n input = gets.strip.downcase\n \n if input == \"hungry\"\n cuisine_list\n menu # return 'menu' don't want my user to get kicked out of application \n elsif input == \"goodbye\"\n goodbye\n else \n invalid_entry\n end \n end", "def print_menu\n puts \"Select one of the following options:\"\n puts \"----//--------//------\"\n puts \"1. Input the students\"\n puts \"2. Show the students\"\n puts \"3. Save the list of students\"\n puts \"4. Load the list of students\"\n puts \"9. Exit\" # 9 because we'll be adding more items\nend", "def main_menu\n \"Welcome to BATTLESHIP\\nEnter p to play or q to quit\"\n end", "def display_and_run\n\n # prints the menu name and waits briefly\n @dp.d_print(@menu_name + \":^^\")\n i = 1\n\n # displays the options\n @options.each do |option|\n print(i.to_s + ' ')\n puts(option.get_name)\n i += 1\n end\n\n # prompt and get valid input from the player\n print(@prompt_string)\n action = get_action\n\n # runs the selected action\n action.call :menu_select\n\n # some test code\n print(\"here\")\n end", "def menu\n puts \"- Type in a #{\"Nintendo Character\".colorize(:red)} | #{\"Game Series\".colorize(:blue)} | #{\"Amiibo Series\".colorize(:green)}\\n\\n\"\n puts \"- Type #{'1'.colorize(:yellow)} for a list of all the Game Series included in the Amiibo collection\"\n puts \"- Type #{'2'.colorize(:yellow)} for a list of all the Amiibo Series included in the Amiibo collection\"\n puts \"- Type #{'3'.colorize(:yellow)} for a list of all the Characters included in Amiibo collection\"\n puts \"- Type #{'4'.colorize(:yellow)} for a list of ALL Amiibos collection\\n\\n\"\n puts \"- Type #{'exit'.colorize(:yellow)} to exit the CLI\\n\\n\"\n puts \"--------------------------------------------------------------------------------\\n\\n\"\n sleep(2)\n end", "def display_menu\n puts \"\\nEnter option: \"\n puts '1. List Existing Threads'\n puts '2. List Single Thread'\n puts '3. Create new Thread'\n puts 'Q. Quit'\n end", "def main_menu\n puts \"Here is a list of available commands:\"\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" show - Show a contact\"\n puts \" search - Search contacts\"\n puts \" delete - Deletes a contact\"\n end", "def start_main_menu \n puts \"[1] Start\\n[2] Measurement Converter\\n[3] How to Use\".colorize(:yellow)\n user_input = gets.chomp.downcase\n if @answers[0][1].include?(user_input)\n self.start_recipe\n elsif @answers[0][2].include?(user_input)\n self.start_convert\n elsif @answers[0][3].include?(user_input)\n start_help() #module method\n self.start_main_menu\n elsif user_input == \"end\"\n exit \n else\n puts puts \"Do you not know how to press 1, 2 or 3 :| ... Try again.\".colorize(:red)\n self.start_main_menu\n end\n end", "def main_menu\n puts \"------------------------------------------------------------------------------------------------------\".colorize(:yellow)\n Artii::Base#asciify\n a = Artii::Base.new\n a.asciify(\"Toy Robot Challenge\")\n system(\"clear\")\n puts a.asciify(\"Toy Robot Challenge\").colorize(:red,)\n\n prompt = TTY::Prompt.new\n choices = [\n {name: 'New Game.', value: 1},\n {name: 'Exit.', value: 2},\n ]\n players_input = prompt.select(\"Select An Option:\", choices) \n case players_input\n when 1\n new_game\n when 2\n exit\n end \nend", "def interactive_menu\n puts \"\"\n puts \"-----Student Directory Program-----\".center(50)\n loop do\n print_menu_options\n selection = STDIN.gets.chomp\n menu_options(selection)\n end\nend", "def show_main_menu\n puts \"Welcome to the app. What's next?\"\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" find - Find by name\"\n puts \" delete - Delete by ID\"\n puts \" quit - Exit Application\"\n print \"> \"\n end", "def show_main_menu\n puts \" Welcome to the app. What's next?\"\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" list important - List all contacts\"\n puts \" show :id - Display contact details\"\n puts \" delete - Delete an entry\"\n puts \" find - Find an entry\"\n print \"> \"\n end", "def main_menu_options\n a = Artii::Base.new #display main title greeting\n a.asciify('Menu')\n puts a.asciify('Menu').colorize(:blue)\n\n puts \"\"\n puts \"1. Search movies.\"\n puts \"2. View your list.\"\n puts \"\"\n puts \"Please input the number corresponding to your choice.\"\n input = gets.chomp #todo Check to see if you can break this\n system \"clear\"\n if input == '1'\n puts \"Let's look at some movies.\"\n movie_search #send user to the movie search screen\n elsif input == '2'\n display_movie_list_and_movie_list_options #send movie to the movie list screen\n else\n \"Please select a valid option\"\n main_menu_options #call the method again\n end\n end", "def print_menu\n puts \"Which action [list|add|delete|mark|idea|quit]?\"\nend", "def main_menu\n prompt = TTY::Prompt.new(\n active_color: :red,\n symbols: {marker: \"⮊\"},\n quiet: true\n )\n\n puts \"\"\n menu_selection = prompt.select(\"Select an option:\") do |menu|\n menu.choice \"➊ Start a new game\", 1\n menu.choice \"➋ How to play\", 2\n menu.choice \"➌ Display win counts\", 3\n menu.choice \"➍ Exit program\", 4\n end\n\n case menu_selection\n when 1\n start_game\n when 2\n instructions\n when 3\n check_win_history\n when 4\n puts \"\\nThanks for playing\\n\\nGoodbye!\"\n exit\n else\n raise InvalidMenu\n end\n\n rescue InvalidMenu\n puts \"Invalid menu input. Please try again!\"\n retry\n rescue\n puts \"An unexpected error has occured. The program will now exit.\"\nend", "def main_menu\n\n\tputs \"***Ruby Cheatsheet***\"\n\tputs \"1. Command Line\"\n\tputs \"2. IDE\" \n\tputs \"3. Search\"\n\tputs \"4. Quit\"\n\tputs \"Make a selection 1 - 4:\"\n\nend", "def menu_selection\n PROMPT.select('Please make a selection!'.colorize(:magenta)) do |menu|\n menu.choice({ name: \"Track Today's Mood\", value: '1' })\n menu.choice({ name: 'View Tracked Moods', value: '2' })\n menu.choice({ name: 'Good Vibes Please', value: '3' })\n menu.choice({ name: 'Exit', value: '4' })\n end\n end", "def main_menu\n while true\n puts \"Options:\"\n puts \"[1] Add a new field of crops\"\n puts \"[2] Harvest crops\"\n puts \"[3] Status of farm\"\n puts \"[4] Relax and view fields\"\n puts \"[5] Exit\"\n puts \"Enter a Number\"\n main_menu_opt = gets.chomp.to_i\n case main_menu_opt\n when 1 then field #will run field method\n when 2 then harvest #will run harvest method\n when 3 then status #will run status method\n when 4 then relax #will run relax method\n else exit\n end\n end\n end", "def user_menu\n puts \"1-input data from file\"\n puts \"2-edit data\"\n puts \"3-form groups\"\n puts \"4-list groups\"\n puts \"5-write groups to file\"\n puts \"6-view course information\"\n puts \"0-exit the program\" \n user_selection = gets.chomp\n # case statement calls respective methods based on user's selection.\n # gives error if file is not loaded and returns to menu\n case user_selection\n when \"0\"\n abort\n when \"1\"\n input_data\n when \"2\"\n if @file_loaded\n edit_data\n else\n puts @dash+\"error-file-not-loaded\"+@dash\n user_menu\n end \n when \"3\"\n if @file_loaded\n form_groups\n else\n puts @dash+\"error-file-not-loaded\"+@dash\n user_menu\n end \n when \"4\"\n if @file_loaded\n list_groups\n else\n puts @dash+\"error-file-not-loaded\"+@dash\n user_menu\n end \n when \"5\"\n if @file_loaded\n write_groups\n else\n puts @dash+\"error-file-not-loaded\"+@dash\n user_menu\n end \n when \"6\"\n if @file_loaded\n list_course_info\n else\n puts @dash+\"error-file-not-loaded\"+@dash\n user_menu\n end \n else\n puts @dash+\"error-invalid-selection\"+@dash\n user_menu\n end\n end" ]
[ "0.82655966", "0.8160552", "0.815049", "0.8035662", "0.79972625", "0.7969904", "0.7906896", "0.7879877", "0.78299826", "0.78025043", "0.7754544", "0.77469045", "0.7730747", "0.76848626", "0.76721317", "0.76662695", "0.76249343", "0.76230127", "0.76120925", "0.76106876", "0.7581341", "0.7570156", "0.75479925", "0.7536476", "0.7517859", "0.7498824", "0.74937975", "0.74817777", "0.7479514", "0.747783", "0.7470121", "0.746972", "0.74642116", "0.7429301", "0.74193686", "0.74148506", "0.7413781", "0.74028325", "0.7383051", "0.7377944", "0.7370304", "0.73652697", "0.736377", "0.7362631", "0.7362113", "0.73529464", "0.7352575", "0.73509926", "0.7342595", "0.7341471", "0.733598", "0.73355055", "0.7329701", "0.7324684", "0.7324288", "0.7315994", "0.73027253", "0.7298861", "0.7298128", "0.7289286", "0.7284037", "0.72736037", "0.7267922", "0.72665644", "0.72663486", "0.72646296", "0.726209", "0.7260585", "0.7236988", "0.7232877", "0.7232366", "0.72262126", "0.72205824", "0.72174907", "0.7216199", "0.72123337", "0.7207137", "0.71962667", "0.7195216", "0.7191459", "0.71867025", "0.7172995", "0.7166309", "0.71569264", "0.71544266", "0.714075", "0.713966", "0.71388566", "0.71373767", "0.7136507", "0.7135635", "0.71297884", "0.71279764", "0.71260774", "0.71232975", "0.7123273", "0.7122786", "0.7122691", "0.7121257", "0.7120604", "0.71174467" ]
0.0
-1
Display the main menu
def display_menu choices menu_array = ["\nHangman Options", "==============="] + choices menu_array.each { |menu| puts menu } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main()\n main_menu(SHOW_HEADER);\n end", "def display_main_menu(clear_screen = false)\n clear if clear_screen\n title_header(TITLES[:main_menu],\"_\",\"-\",false)\n\n Api.main_topics.each_with_index do |type, i|\n puts \"#{(\" \" * (PROFILE_SIDE / 2))}#{i+1}\".green + \". #{type}\" \n end\n\n puts \"\\n NAVIGATE: \".black.on_green + \" #{nav_main}\".on_black\n input_menu\n end", "def show_main_menu\n puts \"Welcome to the app. What's next?\".yellow\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" show - display details via index\"\n puts \" find - find someone by name\"\n puts \" quit - Exit Application\"\n print \"> \"\n end", "def show_main_menu\n puts \"\\e[H\\e[2J\"\n puts \"Welcome to the app. What's next?\"\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" quit - Exit Application\"\n print \"> \"\n end", "def show_main_menu\n puts \" Welcome to the app. What's next?\"\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" list important - List all contacts\"\n puts \" show :id - Display contact details\"\n puts \" delete - Delete an entry\"\n puts \" find - Find an entry\"\n print \"> \"\n end", "def show_main_menu\n puts \"Welcome to the app. What's next?\"\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" find - Find by name\"\n puts \" quit - Exit Application\"\n print \"> \"\n end", "def list_menu\n puts \"\\nMain Menu\"\n puts \"1. Daily Prophet - News!\"\n puts \"2. Evanesco - Exit\"\n end", "def show_main_menu\n puts \"Welcome to the app. What's next?\"\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" find - Find by name\"\n puts \" delete - Delete by ID\"\n puts \" quit - Exit Application\"\n print \"> \"\n end", "def show_main_menu\n puts \"What would you like do next?\"\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" delete - Delete a contact\"\n puts \" show - Display contact details\"\n # puts \" find - Find a contact\"\n print \"> \"\n end", "def show_main_menu\n puts \"Welcome to the app. What's next?\"\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" show id - Show info for contact id number\"\n puts \" quit - Exit Application\"\n print \"> \"\n end", "def show_main_menu\n puts \"Welcome to the app. What would you like to do?\"\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" quit - Exit Application\"\n puts \" show - shows contact with specific id\"\n puts \" find - find a user\"\n print \"> \"\n end", "def displaymenu # Console only\r\n\t\t @output.puts \"Menu: (1) Play | (2) New | (3) Analysis | (9) Exit\"\r\n\t\t end", "def display_menu\n system('clear')\n arr = ['My List', 'Recommendations', 'Playlist', 'Account Details', 'Exit']\n @prompt.select(\"》 MAIN MENU 《\\n\".colorize(:light_green), arr)\n end", "def run_normal\n welcome_header\n main_menu \n end", "def main_menu\n puts \"Here is a list of available commands:\"\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" show - Show a contact\"\n puts \" search - Search contacts\"\n puts \" delete - Deletes a contact\"\n end", "def main_menu\r\n puts \"\\nMain Menu.\"\r\n puts \"A. List Buildings\"\r\n puts \"B. List Machines\"\r\n puts \"C. List Snacks\"\r\n puts \"D. List Users\"\r\n puts \"E. Find a Snack\"\r\n puts \"F. Add a New Snack\"\r\n puts \"G. Create New User\"\r\n puts \"H. List Favorites\"\r\n puts \"I. Find Favorites\"\r\n puts \"J. Add Favorites\"\r\n puts \"Q. Quit\"\r\nend", "def main_menu()\n system 'clear'\n loop do\n headline(\"My Petsitter App\")\n puts \"#{@emoji[:smiling_cat_face_with_open_mouth]} Welcome! #{@emoji[:dog_face]}\".colorize(:bold)\n puts @headline\n input = @prompt.select('Menu:') do |menu|\n menu.choice name: 'Pet Sitters', value: \"PET_SITTERS\"\n menu.choice name: 'Clients', value: \"CLIENTS\"\n menu.choice name: 'Jobs', value: \"JOBS\"\n menu.choice name: 'Logout', value: \"EXIT\"\n end\n puts '-' * 20\n go_to(input)\n end\n end", "def display_main_menu\n loop do\n case main_menu_selection\n when 1\n RunApp.start_quiz(1)\n when 2\n RunApp.start_quiz(2)\n when 3\n exit\n end\n end\n end", "def show_main_menu\n puts \"Welcome to Contacts APP, What's next?\"\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" update - Enter ID to update a contact\"\n puts \" show - Enter ID to show detail of a contact\"\n puts \" find - Find contacts by name\"\n puts \" save - Save contact to CSV file\"\n puts \" quit - Save & Exit Application\"\n print \"> \"\n end", "def main_menu\n name_selector\n puts \"Okay #{@name}, what would you like to do?\"\n loop do\n case menu_arrows\n when '1'\n @recommendation.recommendation_menu\n when '2'\n puts 'you have the following number of games in your library: '\n @game_library.game_instances\n puts 'your custom list of games:'\n @game_library.user_games_lister\n when '3'\n puts 'add a game:'\n @game_library.add_title\n when '4'\n @game_library.delete_games\n when '5'\n @time_used.time_wasted\n when '6'\n @game_library.write_games\n puts 'thanks for your time!'\n exit\n end\n end\n end", "def show_main_menu\n puts \"Welcome to Contacts APP, What's next?\"\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" show - Enter ID to show detail of a contact\"\n puts \" find - Find contacts by name\"\n puts \" add - Add phone numbers\"\n puts \" save - Save contact to CSV file\"\n puts \" quit - Save & Exit Application\"\n print \"> \"\n end", "def main_menu\n\t\tputs '################################'\n\t\tputs '######### Tic Tac Toe ##########'\n\t\tputs '################################'\n\t\tputs '================================'\n\t\tputs '== Choose your weapon warrior =='\n\t\tputs '================================'\n\t\tputs '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'\n\t\tputs '^^^^^^ Type Your Choice: ^^^^^^^'\n\t\tputs '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'\n\t\tputs '$$$$$$$$$$$ 1. \"X\" $$$$$$$$$$$$$'\n\t\tputs '$$$$$$$$$$$ 2. \"O\" $$$$$$$$$$$$$'\n\t\tputs '--------------------------------'\n\tend", "def main_menu_runner\n\n splash\n\n login_menu_display\n\n end", "def main_menu\n h = {\n a: :ag,\n z: :z_interface,\n # f: :file_actions,\n b: :bookmark_menu,\n c: :create_menu,\n f: :filter_menu,\n o: :order_menu,\n s: :selection_menu,\n t: :toggle_menu,\n v: :view_menu,\n '`' => :goto_parent_dir,\n x: :extras\n }\n menu 'Main Menu', h\nend", "def main_menu\n puts \"---------------Animal shelter 4.5A-----------\"\n puts\n puts \"[1] List clients\"\n puts \"[2] List animals for adoption\"\n puts \"[3] Add a new client\"\n puts \"[4] Add a new animal\"\n puts\n puts\n puts \"[5] exit\"\n puts \"---------------------------------------------\"\nend", "def print_main_menu\n puts \"1. Add a contact\"\n puts \"2. Modify a contact\"\n puts \"3. Display all contacts\"\n puts \"4. Display a contact\"\n puts \"5. Display contact attributes\"\n puts \"6. Delete a contact\"\n puts \"7. Exit\"\n end", "def display_main_menu\n puts '################################'\n puts '# {N}- Network Stuff #'\n puts '# {RF}- Read File #'\n # puts '# {GF}- Generate File #'\n # puts '# {D}- Run as Daemon #'\n # puts '# {TD}- Run as Trigger Daemon #'\n puts '# {Q}- Quit #'\n puts '################################'\nend", "def menu\n \n \n\nend", "def sub_menu\n puts \"\\n***********************************************\".colorize(:magenta).blink\n puts \"Type the following letters to do...\".colorize(:blue)\n puts \"-----------------------------------------------\".colorize(:cyan).bold\n puts \"s = Save Recipe to My Favorites\".colorize(:blue)\n puts \"r = Rate Recipe\".colorize(:blue)\n puts \"a = See Average Recipe Rating\".colorize(:blue)\n puts \"o = Open Link to See the Steps for This Recipe\".colorize(:blue)\n puts \"m = Back to Main Menu\".colorize(:blue)\n puts \"***********************************************\\n \".colorize(:magenta).blink\n end", "def main_menu\n puts \"Main Menu\"\n puts \"(a) - Basic calculator\"\n puts \"(b) - Advanced calculator\"\n puts \"(c) - Special calculators\"\n puts \"(q) - Quit\"\nend", "def show # Show method\n menu # Show menu method above\n end", "def main_menu\n puts\"(b) - basic calculator\"\n puts\"(a) - advanced calculator\"\n puts\"(bmi) - body mass index\"\n puts\"(t) - trip calculator\"\n puts\"(m) - morgage\"\n puts\"(q) - quit\"\nend", "def menu\n # This uses a HEREDOC for multiline listing\n puts \"-------------------------\".colorize(:green) \n puts <<-MENU\n\nChoose a how you would like to see a card. You can view by name, creature, enchantment or sorcery:\n1. See cards by Name \n2. See cards by Creature \n3. See cards by Enchantment \n4. See cards by Sorcery\n\nOr type 'exit' at any time to leave the program. Type 'menu' to return to the main menu.\n MENU\n end", "def print_menu\n output.puts \"Madden's Car Selection Tool-\"\n \n # Print Current Model Info\n print_model_info\n\n # Print Menu Choices\n print_menu_choices\n\n # Get User Choice\n output.print \"Enter choice: \"\n end", "def render_clf_main_menu(project, options = {})\n # Default options\n options = {\n :ul_class => 'nav',\n :li_class => 'menucontent',\n :menulink_class => 'menulink',\n :title => :clf2_text_main_menu\n }.merge(options)\n\n render_clf_menu((project && !project.new_record?) ? :project_menu : :application_menu, project, options)\n end", "def main_menu\n h = { \n :a => :ack,\n \"/\" => :ffind,\n :l => :locate,\n :v => :viminfo,\n :z => :z_interface,\n :d => :child_dirs,\n :r => :recent_files,\n :t => :dirtree,\n \"4\" => :tree,\n :s => :sort_menu, \n :F => :filter_menu,\n :c => :command_menu ,\n :B => :bindkey_ext_command,\n :M => :newdir,\n \"%\" => :newfile,\n :x => :extras\n }\n menu \"Main Menu\", h\nend", "def main_menu\n menu = [\n \"My Stats\",\n \"My Hikes\",\n \"Trails\",\n \"Quit\"]\n choice = nil\n while choice != \"Quit\"\n system 'clear'\n puts \"------MAIN MENU------\"\n choice = @prompt.select(\"What would you like to do #{@current_user.name}?\", menu)\n\n case choice\n when \"My Stats\"\n user_stats\n when \"My Hikes\"\n hike_options\n when \"Trails\"\n trail_options\n end\n end\n end", "def main_menu\n @ui.input_1_change\n @ui.user_input1.downcase\n unless %w[trains routes stations cars].include? @ui.user_input1\n puts 'There is no such option in the main menu.'\n end\n main_menu_choose_option(@ui.user_input1)\n end", "def menu\nend", "def goldberg_main_menu\n render :file => \"#{RAILS_ROOT}/vendor/plugins/goldberg/app/views/goldberg/menu_items/_menubar.rhtml\", :use_full_path => false, :locals => {:level => 0, :depth => 0, :class_attr => nil}\n end", "def menu\n \nend", "def display_menu\n if project?\n content_tag(:div, :id => 'menu') do\n render :partial => 'layouts/menu_nav'\n end\n end\n end", "def main_menu(owner_name, owner)\n puts \"#{page_break}\\n\n Select from the following menu options to get started:\\n\n 1 - Make New Appointent\n 2 - Reschedule Appointment\n 3 - Cancel Appointment\n 4 - Search for a Groomer\n 5 - Exit\n \"\n end", "def main_menu\n\tfinished = false\n\tbegin\n\t puts ' Text Music Player '.colorize(:color => :black, :background => :yellow)\n\t puts\n\t puts ' Main Menu: '.colorize(:color => :while, :background => :blue)\n\t puts '1 - Read in Album '.colorize(:color => :black, :background => :white)\n\t puts '2 - Display Albums Info '.colorize(:color => :black, :background => :white)\n\t puts '3 - Play Album '.colorize(:color => :black, :background => :white)\n\t puts '4 - Update Album '.colorize(:color => :black, :background => :white)\n\t puts '5 - Exit '.colorize(:color => :black, :background => :white)\n\t choice = read_integer_in_range(\"Option: \", 1, 5)\n\t case choice\n\t when 1\n\t\tdatabase_file = read_file\n\t\talbums = read_albums(database_file)\n\t when 2\n\t\tif validate(albums)\n\t\t\tprint_albums_info(albums)\n\t\tend\n\t when 3\n\t\tif validate(albums)\n\t\t\tplay_album(albums)\n\t\tend\n\t when 4\n\t\tif validate(albums)\n\t\t\tselect_update_album(albums)\n\t\tend\n\t else\n\t\tif isUpdated(albums)\n\t\t\tputs 'Updating album file infomation..'\n\t\tend\n\t\tfinished = true\n\t end\n\tend until finished\nend", "def print_menu\n\t\tsystem ('cls') or system ('clear')\n\t\t@todo_list.print_list\n\t\tprint_menu_options\n\tend", "def main_menu\n puts <<~Doc\n Welocome to the New York Times Bestsellers List!\n Please choose one of the following options to get started:\n Doc\n NytBestsellersList::Lists.print_list_names\n end", "def index\n\t\t@content_title = \"Main menu\"\n\tend", "def main_menu\n h = { \n \"1\" => :view_article,\n \"2\" => :view_comments,\n :f => :display_forum,\n :v => :view_menu,\n :r => :reload,\n :m => :fetch_more,\n :R => :reddit_options,\n :H => :hacker_options,\n :s => :sort_menu, \n :C => :config_menu,\n :a => :view_article,\n :c => :view_comments,\n :x => :extras\n }\n=begin\n :a => :ack,\n \"/\" => :ffind,\n :l => :locate,\n :v => :viminfo,\n :z => :z_interface,\n :d => :child_dirs,\n :r => :recent_files,\n :t => :dirtree,\n \"4\" => :tree,\n :F => :filter_menu,\n :c => :command_menu ,\n :B => :bindkey_ext_command,\n :M => :newdir,\n \"%\" => :newfile,\n=end\n\n menu \"Main Menu\", h\nend", "def main_menu\n\tputs \"Welcome to Happitails!\"\n\tputs \"Please choose from the options below\"\n\tputs \"1. Add Animal\"\n\tputs \"2. Create Client\"\n\tputs \"3. Adopt an animal\"\n\tputs \"4. Put animal up for adoption\"\n\tputs \"5. View all animals\"\n\tputs \"6. View all clients\"\n\n\n\t# puts \"Z. SECRET DEBUGGING MODE\"\n\n\tputs \"q. Quit\"\nend", "def main_menu\n prompt = TTY::Prompt.new(active_color: :blue)\n response = prompt.select(\"CTT-Lite\", available_options)\n system \"clear\"\n handle_main_menu(response)\n end", "def display_menu(menu)\n puts menu.title\n menu.menu_items.each_with_index { |item| puts \"#{item.key_user_returns}.\\t #{item.user_message}\" }\n end", "def display_menu\n puts \"Choose from the following options: \\n\n to find a candidate, type 'find id' (ex. find 1)\n to view all candidates, type 'all'\n to view all qualified candidates, type 'qualified'\n to exit, type 'quit' \n to view menu, type 'menu' \\n\\n\"\nend", "def menu_display\n system(\"clear\")\n\t\tputs \"##############################\"\n\t\tputs \"# #\"\n\t\tputs \"# Select a number #\"\n\t\tputs \"# from below #\"\n\t\tputs \"# #\"\n\t\tputs \"# 1. Balance #\"\n\t\tputs \"# 2. Deposit #\"\n\t\tputs \"# 3. Withdraw #\"\n\t\tputs \"# 4. History #\"\n\t\tputs \"# 5. Exit #\"\n\t\tputs \"# #\"\n\t\tputs \"# #\"\n\t\tputs \"##############################\"\n end", "def print_menu\n puts \"1. List patients\"\n # ....\n end", "def print_main_menu\n\t\tputs \"[1] Add a contact\"\n\t\tputs \"[2] Modify a contact\"\n\t\tputs \"[3] Display all contacts\" \n\t\tputs \"[4] Display one contact\"\n\t\tputs \"[5] Display an attribute\"\n\t\tputs \"[6] Delete a contact\"\n\t\tputs \"[7] Exit\"\n\t\tputs \"Enter a number\"\n\tend", "def main_menu\n puts \"(b) - basic calculator\"\n puts \"(a) - advanced calculator\"\n puts \"(bmi) - BMI calculator\"\n puts \"(m) - mortgage calculator\"\n puts \"(t) - trip calculator\"\n puts \"(q) - quit\"\nend", "def display_menu\n puts \"Welcome to Lorrayne and Sherwin's coffee emporium!\\n\\n\"\n puts \"1) Add item - $5.00 - Light Bag\"\n puts \"2) Add item - $7.50 - Medium Bag\"\n puts \"3) Add item - $9.75 - Bold Bag\"\n puts \"4) Complete Sale\"\n end", "def show_menu\n planet_list = \"\"\n i = 1\n @solar_system.length.times do |n|\n planet_list << \"\\n#{i}. #{@solar_system[n].name}\"\n i += 1\n end\n return \"\\nPlanet List#{planet_list}\\nOther: Exit\\n\\n\"\n end", "def main_menu\n @@prompt.select(\"What would you like to do today?\".colorize(:yellow)) do |menu|\n menu.choice \"Read Reviews\", -> {self.read_reviews}\n menu.choice \"Write a review\", -> { self.writing }\n menu.choice \"Update a review\", -> { self.update_reviews }\n menu.choice \"Delete a review\", -> { self.deleting }\n menu.choice \"Log Out\", -> { self.log_out }\n end\n end", "def main_menu\n\tputs \"[a] - addition\"\n\tputs \"[s] - subtraction\"\n\tputs \"[m] - multiplication\"\n\tputs \"[d] - divison\"\n\tputs \"[exp] - exponent\"\n\tputs \"[sqrt] - square root\"\n\tputs \"[q] - quit\"\nend", "def Mostrar_menu\n puts \"______________________________\"\n puts \"\\n-----[[ RUBY ARITMETICO]]-----\"\n puts \"______________________________\"\n puts \"1) Suma\"\n puts \"2) Resta\"\n puts \"3) División\"\n puts \"4) Multiplicación\"\n puts \"5) Potencia\"\n puts \"6) Residuo\"\n puts \"7) Volver al Menu Principal\"\n puts \"______________________________\"\n print \"Opcion: \"\n end", "def menu\n puts \"- Type in a #{\"Nintendo Character\".colorize(:red)} | #{\"Game Series\".colorize(:blue)} | #{\"Amiibo Series\".colorize(:green)}\\n\\n\"\n puts \"- Type #{'1'.colorize(:yellow)} for a list of all the Game Series included in the Amiibo collection\"\n puts \"- Type #{'2'.colorize(:yellow)} for a list of all the Amiibo Series included in the Amiibo collection\"\n puts \"- Type #{'3'.colorize(:yellow)} for a list of all the Characters included in Amiibo collection\"\n puts \"- Type #{'4'.colorize(:yellow)} for a list of ALL Amiibos collection\\n\\n\"\n puts \"- Type #{'exit'.colorize(:yellow)} to exit the CLI\\n\\n\"\n puts \"--------------------------------------------------------------------------------\\n\\n\"\n sleep(2)\n end", "def run\n welcome\n menu_exit\n end", "def main_menu\n input = 0\n until input.to_i == @@main_ops.length - 1 \n print \"\\e[H\\e[2J\" #clears the screen\n puts @name \n print_menu(@@main_ops)\n print \"Choose an option by entering a number: \"\n input = gets.chomp\n call_option(input)\n end\n end", "def view_menu\n h = {\n f: :select_from_visited_files,\n d: :select_from_used_dirs,\n b: :view_bookmarks,\n s: :list_selected_files,\n c: :child_dirs,\n r: :recent_files,\n t: :tree,\n e: :dirtree\n }\n menu 'View Menu', h\nend", "def main_menu\n prompt.select(\"What would you like to do today #{user.name}?\") do |menu|\n menu.choice \"Choose Protein\", -> {choose_protein}\n menu.choice \"Exit!\", -> {exit_helper}\n menu.choice \"Delete Account!?!?\", -> {delete_account_helper}\n end\n end", "def main_menu\n while true\n print_main_menu\n user_selected =gets.to_i\n call_option(user_selected)\n end\n end", "def display_menu()\n return 'Welcome to the Chicken Farm Simulator'\nend", "def menu\n\t\[email protected](0, 0, 11, 3)\n\t\[email protected]\n\t\[email protected] { |menu|\n\t\t\tmenu.draw\n\t\t}\n\t\tBATTLE_BACKGROUND.blit(@screen, [188, 106], nil)\n\t\[email protected]\n\tend", "def display_main_menu\n puts \"\\nMain Menu\".colorize(:red)\n puts \"-----------------------\".colorize(:blue)\n puts \"You currently have $#{@player.wallet}\".colorize(:red)\n puts \"Please select one of the following:\".colorize(:red)\n puts \"1)Roulette\".colorize(:blue)\n puts \"2)Black Jack\".colorize(:blue)\n puts \"3)Slots\".colorize(:blue)\n puts \"4)Dice\".colorize(:blue)\n puts \"5)Horse Races\".colorize(:blue)\n puts \"6)Additional Options\".colorize(:blue)\n puts \"-----------------------\".colorize(:blue)\n print \"> \"\n choice = gets.to_i\n case choice\n when 1 # Roulette\n Roulette.new(@player)\n when 2 # Black Jack\n BlackJack.new(@player)\n when 3 # Slots\n Slots.new(@player)\n when 4 # Dice\n Dice.new(@player)\n when 5 # Horse Races\n HorseRaces.new(@player)\n when 6\n repeat_menu\n else\n puts \"Invalid input, try again.\".colorize(:red)\n sleep(1)\n display_main_menu\n end\n print `clear`\n repeat_menu\n end", "def menu\n puts \"\\n************************************************************\".colorize(:magenta).blink\n puts \"Select an option (1-5) from the menu below:\".colorize(:blue).bold\n puts \"------------------------------------------------------------\".colorize(:cyan)\n puts \"1. Don't want to think about what to cook? \\n Spin the RANDOM WHEEL OF RECIPES!\".colorize(:blue)\n puts \"------------------------------------------------------------\".colorize(:cyan)\n puts \"2. Need some inspiration for cooking? \\n Find recipe by name OR \\n if you have leftover ingredients search your ingredients!\".colorize(:blue)\n puts \"------------------------------------------------------------\".colorize(:cyan)\n puts \"3. Feeling creative? \\n Write and save your own recipe!\".colorize(:blue)\n puts \"------------------------------------------------------------\".colorize(:cyan)\n puts \"4. View ALL your favorite recipes in 1 place!\".colorize(:blue)\n puts \"------------------------------------------------------------\".colorize(:cyan)\n puts \"5. You're done? Time to exit...\".colorize(:blue)\n puts \"************************************************************\\n \".colorize(:magenta).blink\n end", "def menu_options\n system \"clear\"\n puts \"~~~ Welcome #{@user.username} to the Main Menu ~~~\\n\\n\" \n puts \"{1} Continue from previous story \"\n puts \"{2} Create new story\"\n puts \"{3} Delete a story\"\n puts \"{4} Tutorial\"\n puts \"{5} End My Session\"\nend", "def start_menu\n printf \"\\nPrograma para a disciplina de LPD\\n\"\n printf \"Choose one option\\n\"\n printf \"------------------------------------\\n\"\n printf \"1) Insert user\\n\"\n printf \"2) Login user\\n\"\n printf \"3) Delete user\\n\"\n printf \"0) Exit\\n\"\nend", "def display_menu\n puts \"1. Scrapp townhalls' emails from web\"\n puts \"2. Send massive emails to townhalls\"\n puts \"3. Follow towhalls on Twitter\"\n puts \"4. Print me the JSON\"\n puts \"5. Exit program\"\n end", "def print_menu\n puts \"\\nMAIN MENU\"\n puts \"add (+)\"\n puts \"subtract (-)\"\n puts \"multiply (*)\"\n puts \"divide (/)\"\n puts \"modulo (%)\"\n puts \"exponify (^)\"\nend", "def menu\n system('clear')\n selection = @prompt.select('》 PLAYLIST 《', ['Display', 'Add', 'Remove', 'Export To File', 'Back'])\n case selection\n when 'Display'\n list\n else\n case_menu(selection)\n end\n end", "def main_menu\n while true\n print_main_menu\n user_selected = gets.chomp.to_s\n call_option(user_selected)\n end\n end", "def menu\n puts '1) Promedio de notas'\n puts '2) Inasistencia alumnos'\n puts '3) Alumnos aprobados'\n puts '4) Salir'\nend", "def print_main_menu\n\t\tputs \"[1] Add a new contact\"\n\t\tputs \"[2] Modify an existing contact\"\n\t\tputs \"[3] Delete a contact\"\n\t\tputs \"[4] Display all the contacts\"\n\t\tputs \"[5] Display an attribute\"\n\t\tputs \"[6] Exit\"\n\t\tputs \"Enter a number: \"\n \tend", "def main_menu_link; MAIN_MENU_LINK; end", "def Mostrar_menu\n puts \"______________________________\"\n puts \"\\n-----[[ RUBY RANGOS]-----\"\n puts \"______________________________\"\n puts \"1) Generación numérica\"\n puts \"2) Generación de letras\"\n puts \"3) Volver al Menu Principal\"\n puts \"______________________________\"\n print \"Opcion: \"\n end", "def menu\n puts \"------Calculator----\"\n puts \"Welcome to the calculator!\"\n puts \"Please select an option:\"\n puts \"\\t1) Enter numbers and modifier\"\n puts \"\\t2) Enter a string input\"\n puts \"\\t3) View the calculations you have preformed\"\n puts \"\\t4) Exit\"\n main_menu\n end", "def main_menu\n @active = 0\n @prompt.select(\"\\nWhat would you like to do?\\n\".blue) do |menu|\n menu.choice \"Check out what's on today\", -> {today_menu} \n menu.choice \"Check out things to do on the weekend\", -> {weekend_menu}\n menu.choice \"Look at my favourites\", -> {display_favorites}\n menu.choice \"Exit\".red, -> {leave_app} \n end \n end", "def display_game_menu\n @output.puts '-----------------------'.center(WIDTH)\n @output.puts '| 1) Blackjack |'.center(WIDTH)\n @output.puts '| 2) Stud Poker |'.center(WIDTH)\n @output.puts \"| 3) Texas Hold 'em |\".center(WIDTH)\n @output.puts '| A) Add AI Player |'.center(WIDTH)\n @output.puts '| D) Debug Console |'.center(WIDTH)\n @output.puts '| P) Setup Player |'.center(WIDTH)\n @output.puts '| Q) Quit |'.center(WIDTH)\n @output.puts '-----------------------'.center(WIDTH)\n @output.puts # spacer\n @output.print 'Command: '\n end", "def main_menu(user)\n user = user\n self.clear\n Ascii.image\n menu = [\"See all my plants\",\"Add new plant\",\"Delete my account\",\"Quit\"]\n menu_selection = @@prompt.select(\"What would you like to do?\",menu)\n \n case menu_selection\n when \"See all my plants\"\n my_plant(user)\n when \"Add new plant\"\n add_plant(user)\n when \"Delete my account\"\n answer = @@prompt.yes?(\"Are you sure?\")\n answer == true ? user.destroy : self.main_menu(user)\n when \"Quit\"\n index = 0\n # binding.pry\n color = [\"#7FFF00\",\"#6B8E23\",\"#008000\",\"#2F4F4F\",\"#00008B\"]\n 5.times do\n self.clear\n # binding.pry\n puts Paint[Ascii.goodbye, color[index]] \n index += 1\n sleep(0.7)\n end \n end\n end", "def show_menu\n clear_screen\n\n puts \"[+] #{FreelancerFinder::Job.all.count} Jobs Scraped [+]\".magenta\n puts \"_____________________________________________________________\"\n return @prompt.select(\"Please Select a Menu Option: \") do |menu|\n menu.choice \"show recent\"\n menu.choice \"scrape more\"\n menu.choice \"search\"\n menu.choice \"search by pay\"\n if @last_results\n menu.choice \"results\"\n end\n menu.choice \"exit\"\n end\n\n end", "def bar\n puts 'bar'\n main_menu\nend", "def display_menu\n title_print\n puts \"Hi #{@todays_hero.name}!\"\n puts \"***************************\"\n selection = TTY::Prompt.new.select(\"What would you like to do?\", per_page: 10, cycle: true) do |menu|\n menu.enum '>'\n\n menu.choice 'Start a fight', 1\n menu.choice 'Train for battle', 2\n menu.choice 'Go on a Quest', 3\n menu.choice 'Show Stats', 4\n menu.choice 'Display Instructions', 5\n menu.choice 'Display Leaderboard', 6\n menu.choice 'Exit', 7\n end\n self.start_game_loop(selection)\n end", "def main_menu\n\n\tputs \"***Ruby Cheatsheet***\"\n\tputs \"1. Command Line\"\n\tputs \"2. IDE\" \n\tputs \"3. Search\"\n\tputs \"4. Quit\"\n\tputs \"Make a selection 1 - 4:\"\n\nend", "def main_menu\n choice = self.prompt.select(\"Hi there, #{self.user.name}! What would you like to do today?\", [\"Create a new post\", \"Find a book\", \"View or edit my posts\", \"Delete my account\", \"Logout\"])\n\n case choice\n when \"Create a new post\"\n self.new_post\n when \"Find a book\"\n self.find_book\n when \"View or edit my posts\"\n self.view_edit_posts\n when \"Delete my account\"\n self.delete_account\n when \"Logout\"\n self.spinner(\" ✌️✌️✌️ \")\n self.greet\n end\n end", "def printMenu\n\t\tself.report(\"\n\t\tEscolha uma opção\n\t\t1 - Trocar palavra-chave.\n\t\t2 - Ver palavra-chave.\n\t\t3 - Ver arquivo.\n\t\t4 - Sair.\n\t\t? \", 1)\t\t\n\tend", "def main_menu\n \"Welcome to BATTLESHIP\\nEnter p to play or q to quit\"\n end", "def main_menu\n puts \"(b) - basic calculator\"\n puts \"(a) - advanced calculator\"\n puts \"(q) - quit\"\nend", "def main_menu\n puts \"(b) - basic calculator\"\n puts \"(a) - advanced calculator\"\n puts \"(q) - quit\"\nend", "def main_menu\n menu_options = [\"Start exploring\", \"Check Inventory\", \"Check Your Score\", \"Go to Pokemon Center\", \"Quit\"]\n menu_prompt = Interactivity.mainMenu \n \n if user.pokemon == nil\n menu_options.shift()\n menu_options.unshift(\"Choose a Pokemon and start exploring\")\n elsif self.user_current_location\n menu_options.shift()\n menu_options.unshift(\"Keep Exploring\")\n end\n \n choice = prompt.select(menu_prompt, menu_options) \n if choice == \"Start exploring\" || choice == \"Choose a Pokemon and start exploring\" || choice == \"Keep Exploring\"\n self.trainer_chooses_pokemon if user.pokemon == nil \n self.trainer_chooses_town\n self.exploring_town\n elsif choice == \"Check Inventory\"\n puts \"MANAGE INVENTORY - CHANGE POKEMONS AROUND\"\n elsif choice == \"Go to Pokemon Center\"\n self.pokemon_center\n elsif choice == \"Check Your Score\"\n puts \"CHECK YOUR SCORE\"\n else\n Interactivity.quit\n end\n end", "def show(screen)\n\n screen.set_pos_by_point(Point.zeroPoint)\n\n if @selected\n screen.attron(A_REVERSE)\n else\n screen.attron(A_UNDERLINE)\n end\n\n @menu_items.each do |menu_item|\n screen.addstr( \"#{menu_item} \")\n end\n\n p = screen.cur_point\n\n screen.addstr( ' ' * (screen.width - p.x) )\n\n if @selected\n screen.attroff(A_REVERSE)\n else\n screen.attroff(A_UNDERLINE)\n end\n\n end", "def welcome\n puts \"---------------------------------------------\".center(70).blue\n puts \"Welcome to the Makers Academy Student Database!\".center(70).green\n puts \"---------------------------------------------\".center(70).blue\n interactive_menu\nend", "def menu\n puts \"Menu\"\n puts \"1. List Channels\"\n puts \"2. List Users\"\n puts \"3. Select User\"\n puts \"4. Select Channel\"\n puts \"5. Send Message\"\n puts \"6. Quit\"\nend", "def nav_main(topic = \"main\")\n main = \"\"\n back = \"\"\n profile = \"[\" + \"\\#\".green + \"] View Profiles \"\n exit_cli = \"[\" + \"exit\".green + \"] Exit Program \"\n if topic != 'main'\n back = \"[\" + \"menu\".green + \"] Main Menu \" if topic != \"Top Ten\" || topic != \"kidnapped\"\n # else\n # main = \"[\" + \"menu\".green + \"] Main Menu \" if topic != \"main\"\n end\n \"#{profile}#{back}#{main}#{exit_cli}\"\n end", "def index\n @root_menus = @system_config.menus.root_menus\n end", "def display_menu\n print \"---------------------------------------------------------------------------------\\n\"\n print \"\\nChoose an option below by entering its corresponding number or type the name\"\n print \" of a job to get more details about it: \\n\"\n print \"1. Sort the jobs by minimum salary\\n\"\n print \"2. Sort the jobs by maximum salary\\n\"\n print \"3. Sort the jobs by upcoming application deadline\\n\"\n print \"4. Sort the jobs by posting start date\\n\"\n print \"5. Sort the jobs by posting end date\\n\"\n print \"6. Sort the jobs by positions available\\n\"\n print \"7. Print the job full time/ part time information\\n\"\n print \"8. Print the job temporary/regular information\\n\"\n print \"9. Compare two jobs by typing the first job, and then second job\\n\"\n print \"10. To enter a new keyword to search for a new list of jobs\\n\"\n print \"Type 'quit' to end the program.\\n\"\n end" ]
[ "0.83937234", "0.8151924", "0.7955263", "0.78879446", "0.7859454", "0.7824178", "0.7810328", "0.77719575", "0.775094", "0.7699558", "0.76984763", "0.7619968", "0.7614419", "0.75906056", "0.7428091", "0.7362183", "0.73243356", "0.7318705", "0.73004526", "0.7291751", "0.72595286", "0.72209007", "0.71853095", "0.7172872", "0.7169015", "0.7143656", "0.71180815", "0.7111789", "0.70674413", "0.7039651", "0.7012991", "0.7007756", "0.70051885", "0.7002309", "0.69772387", "0.69656616", "0.6964911", "0.69563806", "0.6948372", "0.69321495", "0.6909566", "0.69058347", "0.6899931", "0.68938124", "0.6891093", "0.6887076", "0.6883293", "0.6881966", "0.6858247", "0.6843443", "0.6840697", "0.68263423", "0.6825677", "0.68233895", "0.6816254", "0.67942697", "0.6772884", "0.6768979", "0.67676604", "0.6736515", "0.6733175", "0.6731578", "0.672172", "0.6715982", "0.66991407", "0.66866505", "0.6677312", "0.6666072", "0.6650195", "0.6644962", "0.66436356", "0.66365224", "0.6635838", "0.66302884", "0.6628536", "0.66273457", "0.66152644", "0.661247", "0.66077745", "0.6599406", "0.65948087", "0.6590727", "0.6587956", "0.65812385", "0.6573947", "0.65730625", "0.6569541", "0.6566708", "0.6546666", "0.65236646", "0.6513188", "0.65128386", "0.6491267", "0.6491267", "0.6490215", "0.6489711", "0.6481131", "0.6462765", "0.6458653", "0.6449884", "0.64453286" ]
0.0
-1
Controller that calls the appropriate method based on the user's choice
def handle_menu_choice choice case choice when 1 then setup_game; play_game when 2 then load_game when 3 then delete_game when 4 then list_games when 5 then return :quit end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request_choice(choice)\n case choice\n when \"GET\" then get_choice\n when \"POST\" then post_choice\n when \"EXIT\" then @runs = false\n end\n end", "def make method\n if params.include?(:user)\n @payment_type_id = params[:user][:payment_type_id].to_i\n @form_url = @user.subscribed_to < Time.zone.now ? make_payment_path(I18n.locale) : make_authorization_path(I18n.locale)\n @method = @user.subscribed_to ? 'sale' : 'authorization'\n case @payment_type_id\n when 1\n self.paypal method\n when 2..3\n self.card method\n else\n redirect_to request.referer, alert: t(:bad_payment, :scope => 'payments.errors') and return\n end\n else\n redirect_to request.referer, alert: t(:no_payment, :scope => 'payments.errors')\n end\n end", "def action\n end", "def store\n user_choice = @view.main_menu_display\n case user_choice\n when 2\n register_user \n when 1 \n login_user\n when 3 \n @view.goodbye \n end \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 action\n end", "def show\n case @user.action\n when \"CofA\"\n @action = \"Change Of Address\"\n when \"AR\"\n @action = \"Annual Report\"\n end\n end", "def handle\n # for user input\n if params[\"connections\"]\n connect(params)\n redirect_to action: \"show\"\n # starts optimization of plan or creats at least valid plan if possible\n elsif params[\"optimisation\"]\n @plan = SemesterPlan.find(params[:id])\n if @plan.ready_to_plan?\n optimize(params)\n else\n flash[:warning] = \"Abbruch! Nicht alle Einträge vorgenommen!\"\n redirect_to action: \"show\"\n\n end\n # activate plan for user input\n elsif params[\"free\"]\n flash[:success] = \"Plan zur Bearbeitung freigegeben\"\n SemesterPlan.find(params[:id]).update(free: true)\n redirect_to action: \"show\"\n end\n\n\n end", "def controller\n end", "def controller\n end", "def student_actions\n case params[:thing_to_do]\n when 'Advance year'\n advance_students\n when 'Revert year'\n revert_students\n when 'Deactivate'\n mass_deactivate\n when 'Activate'\n mass_reactivate\n when 'Edit teacher'\n editing_teacher\n when 'Assign tutor'\n assigning_tutor\n when 'Add notes'\n adding_notes\n else\n message = { message: 'That action is not defined.' }\n render json: message, status: :unprocessable_entity\n end\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def action_menu(choice,phonebook)\n case choice\n when \"1\"\n show_cities(phonebook)\n when \"2\"\n show_area_code(phonebook)\n else\n puts \"Invalid choice! Example: Type \\\"1\\\" to list all cities available. \\n\\n\"\n end\nend", "def call_option(selected)\n case selected\n when 1\n Contact.add_contact\n when 2\n Contact.modify\n when 3\n Contact.delete_versions\n when 4\n Contact.display_contacts\n when 5\n Contact.search_by_attribute\n when 6\n puts \"Bye bye Sasha...\"\n exit\n end\n\n end", "def call_option(user_selected)\n case user_selected\n when 1 then add_new_contact\n when 2 then modify_existing_contact\n when 3 then delete_contact\n when 4 then display_all_contacts\n when 5 then search_by_attribute\n when 6 then exit\n end\n end", "def route_user(action)\n case action\n when 1 then @patients_controller.list\n end\n end", "def call_option(user_selected) \n\t case user_selected\n\t when 1 then add_new_contact\t\t\n\t when 2 then modify_existing_contact\n\t when 3 then display_one_contact\n\t when 4 then delete_contact\n\t when 5 then display_all_contacts\n\t when 6 then display_by_attribute\n\t when 7\n\t\t\tputs \"Current session ended, goodbye!\"\n\t\t\treturn\n\t\telse\n\t\t\tputs \"Invalid Option, try again.\"\n\t\t\treturn\n\t\tend\t\n\tend", "def run(req, res)\n if matches?(req)\n controller = @controller_class.new(req, res)\n controller.send(@action_name)\n end\n end", "def select_view\n #redirect_to :action => params[:selection]\n if (SELECTABLE_ACTIONS_ADMIN.include? params[:selection].to_sym) || (SELECTABLE_ACTIONS.include? params[:selection].to_sym)\n redirect_to :action => params[:selection]\n else\n redirect_to :action => 'home'\n end\n end", "def show\n @request = Request.find(params[:request_id])\n case params[:id]\n when 'features'\n @new_feature = @request.features.new\n @features = @request.features.load\n @features.reverse!\n when 'select_recipient'\n @experts = User.where(role: :expert).load\n when 'select_what_kind_of_software'\n @software_groups = RequestGroup.all\n when 'upload_images'\n #@image = @request.images.new\n when 'image_preview'\n @images = [@request.images]\n else\n end\n render_wizard\n end", "def serve\n puts WELCOME\n menu.order_or_not\n # asks the user for input\n # sends that input to choose_to_order case method\n choose_to_order(gets.chomp.to_i)\n end", "def view\n end", "def do_action(action, args=[])\n case action\n when 1\n Customer.create_a_customer_account\n output_action_header(\"\\nCustomer Added!\")\n between_views\n when 2\n ActiveCustomer.list\n between_views\n when 3\n if $ACTIVE_CUSTOMER_ID == nil\n ActiveCustomer.list\n Payment.add_payment_to_active_customer\n output_action_header(\"\\nPayment Added!\")\n between_views\n else\n Payment.add_payment_to_active_customer\n output_action_header(\"\\nPayment Added!\")\n between_views\n end\n when 4\n if $ACTIVE_CUSTOMER_ID == nil\n ActiveCustomer.list\n Product.add_product_to_active_customer\n output_action_header(\"\\nProduct Added!\")\n between_views\n else\n Product.add_product_to_active_customer\n output_action_header(\"\\nProduct Added!\")\n between_views\n end\n when 5\n if $ACTIVE_CUSTOMER_ID == nil\n ActiveCustomer.list\n Product.add_product_to_active_customer_order\n between_views\n else\n Product.add_product_to_active_customer_order\n between_views\n end\n when 6\n if $ACTIVE_CUSTOMER_ID == nil\n ActiveCustomer.list\n CompleteOrder.get_active_user_order\n between_views\n else\n CompleteOrder.get_active_user_order\n between_views\n end\n when 7\n if $ACTIVE_CUSTOMER_ID == nil\n ActiveCustomer.list\n Product.remove_product\n between_views\n else\n Product.remove_product_customer\n between_views\n end\n when 8\n if $ACTIVE_CUSTOMER_ID == nil\n ActiveCustomer.list\n Product.update_product\n between_views\n else\n Product.update_product_customer\n between_views\n end\n when 9\n Product.stale_products\n between_views\n when 10\n if $ACTIVE_CUSTOMER_ID == nil\n ActiveCustomer.list\n CustomerRevenue.check_active_customer_rev\n between_views\n else\n CustomerRevenue.check_active_customer_rev\n between_views\n end\n when 11\n Product.product_popularity\n between_views\n when 12\n return :quit\n else\n puts \"I don't understand that command\"\n end\n end", "def perform(action)\n case action\n when :index, :new then get action\n when :show, :edit then get action, id: 1\n when :update then put :update, id: 1\n when :create then post :create\n when :destroy then delete :destroy, id: 1\n end\n end", "def action\n raise AccessDenied unless can?(params[:type].to_sym, @topic)\n\n case params[:type]\n when \"excellent\"\n @topic.excellent!\n when \"unexcellent\"\n @topic.unexcellent!\n when \"normal\"\n @topic.normal!\n when \"ban\"\n @topic.ban!\n when \"close\"\n @topic.close!\n when \"open\"\n @topic.open!\n end\n render json: {ok: 1}\n end", "def choose\n \n end", "def show # methods in controller are called ACTIONS\n end", "def _dispatch\n case @options[:action]\n when :init\n _init\n when :add\n fail 'No url given (-u option)' if @options[:url].empty?\n fail 'No name given (-n option)' if @options[:name].empty?\n _add\n when :delete\n fail 'No id given (-i option)' if @options[:id].nil?\n _delete\n when :list\n _list\n else\n fail \"Unknown action #{@options[:action]}\"\n end\n end", "def default_action; end", "def view; end", "def admin_choice\n @choice = params[:choice]\n end", "def main_menu_choose_option(user_input)\n case user_input\n when 'trains'\n manage_trains\n when 'routes'\n manage_routes\n when 'stations'\n manage_stations\n when 'cars'\n manage_cars\n else\n @ui.wrong_input_msg\n end\n end", "def index\n if params[:type] == 'UsedCar'\n used \n elsif params[:type] == 'CarAccessory'\n accessory\n else\n accident\n end \n end", "def triage_select\n case params['Digits']\n when '*'\n @phone_call.miss! 'after_hours'\n render action: :goodbye, formats: [:xml]\n return\n when '1'\n @phone_call.transfer! Member.robot\n @phone_call.miss! 'after_hours'\n @nurseline_phone_call = @phone_call.transferred_to_phone_call\n render action: :transfer_nurse, formats: [:xml]\n return\n end\n\n redirect_to action: :triage_menu, id: @phone_call.id\n end", "def process(selection)\n case selection\n when \"1\"\n get_students\n when \"2\"\n show_students\n when \"3\"\n save_students\n when \"9\"\n exit\n else puts \"I don't know what you mean. Please try again.\"\n end\nend", "def actions; end", "def controller(controller); end", "def action args = {}\n\t\tend", "def run(req, res)\n # The #run method will figure out what URL was requested, match it to\n # the path regex of one Route object, and finally ask the Route to\n # instantiate the appropriate controller, and call the appropriate method.\n end", "def view\n if @title == 'Action Items'\n ActionItems\n else\n Report\n end\n end", "def action_instances_tem\n type = params[:type]\n case type\n when \"edit_name\"\n respond_to do |format|\n @user = User.find(params[:data])\n if @user.update_attributes(full_name: params[:value])\n format.json { render json: @user }\n else\n format.json { render json: @user.errors.messages, status: :unprocessable_entity }\n end\n end\n\n when \"change_password\"\n respond_to do |format|\n @user = User.find(params[:data])\n if @user.valid_password?(params[:old_pass])\n if @user.update_attributes(password: params[:new_pass], password_confirmation: params[:new_pass])\n format.json { render json: @user }\n else\n format.json { render json: @user.errors.messages, status: :unprocessable_entity }\n end\n else\n format.json { render text: \"Current Password is incorrect\" }\n end\n end\n\n when \"long_create\"\n respond_to do |format|\n @current_title = CurrentTitle.find(params[:data])\n if @current_title.update_attributes(long_term: params[:value])\n format.json { render json: @current_title }\n else\n format.json { render json: @current_title.errors.messages, status: :unprocessable_entity }\n end\n end\n\n when \"long_edit\"\n respond_to do |format|\n @current_title = CurrentTitle.find(params[:data])\n if @current_title.update_attributes(long_term: params[:value])\n format.json { render json: @current_title }\n else\n format.json { render json: @current_title.errors.messages, status: :unprocessable_entity }\n end\n end\n\n when \"short_create\"\n respond_to do |format|\n @current_title = CurrentTitle.find(params[:data])\n if @current_title.update_attributes(short_term: params[:value])\n format.json { render json: @current_title }\n else\n format.json { render json: @current_title.errors.messages, status: :unprocessable_entity }\n end\n end\n \n when \"short_edit\"\n respond_to do |format|\n @current_title = CurrentTitle.find(params[:data])\n if @current_title.update_attributes(short_term: params[:value])\n format.json { render json: @current_title }\n else\n format.json { render json: @current_title.errors.messages, status: :unprocessable_entity }\n end\n end\n\n when \"delete_long\"\n respond_to do |format|\n @current_title = CurrentTitle.find(params[:data])\n @comments = Comment.where(current_title_id: params[:data], comment_type: \"long_term\")\n if @current_title.update_attributes(long_term: nil) && @comments.destroy_all\n format.json { render json: @current_title }\n else\n format.json { render json: @current_title.errors.messages, status: :unprocessable_entity }\n end\n end\n\n when \"delete_short\"\n respond_to do |format|\n @current_title = CurrentTitle.find(params[:data])\n @comments = Comment.where(current_title_id: params[:data], comment_type: \"short_term\")\n if @current_title.update_attributes(short_term: nil) && @comments.destroy_all\n format.json { render json: @current_title }\n else\n format.json { render json: @current_title.errors.messages, status: :unprocessable_entity }\n end\n end\n\n when \"create_comment\"\n p params[:comment], \"=================================\"\n comment_type = params[:comment_type] || nil\n sub_type = params[:sub_type] || nil\n obj_id = params[:obj_id] || nil\n\n respond_to do |format|\n @comment = Comment.new(comment: params[:comment], comment_type: sub_type, :\"#{comment_type}\" => obj_id, user_id: params[:data] )\n \n if @comment.save\n unless sub_type.eql?(\"\")\n owner_notification = Notification.create(user_id: params[:user_owner_id], obj_user_id: params[:data], notification_type: \"comment\", obj_id: obj_id, obj_type: \"#{comment_type}_#{sub_type}_owner\", is_seen: false) unless params[:user_owner_id].eql?(params[:data])\n if comment_type == \"evidence_id\"\n user_array = Evidence.find(obj_id).comments.map(&:user_id).uniq\n if user_array.length > 0\n user_array.delete(params[:user_owner_id].to_i)\n user_array.delete(params[:data].to_i)\n user_array.each do |user_id|\n notification = Notification.create(user_id: user_id, obj_user_id: params[:data], notification_type: \"comment\", obj_id: obj_id, obj_type: \"#{comment_type}_#{sub_type}\", is_seen: false)\n end\n end\n\n elsif comment_type == \"current_title_id\"\n user_array = CurrentTitle.find(obj_id).comments.map(&:user_id).uniq\n if user_array.length > 0\n user_array.delete(params[:user_owner_id].to_i)\n user_array.delete(params[:data].to_i)\n user_array.each do |user_id|\n notification = Notification.create(user_id: user_id, obj_user_id: params[:data], notification_type: \"comment\", obj_id: obj_id, obj_type: \"#{comment_type}_#{sub_type}\", is_seen: false)\n end\n end \n \n end \n else\n\n owner_notification = Notification.create(user_id: params[:user_owner_id], obj_user_id: params[:data], notification_type: \"comment\", obj_id: obj_id, obj_type: \"#{comment_type}_owner\", is_seen: false) unless params[:user_owner_id].eql?(params[:data])\n user_array = ShortTermObjective.find(obj_id).comments.map(&:user_id).uniq\n if user_array.length > 0\n user_array.delete(params[:user_owner_id].to_i)\n user_array.delete(params[:data].to_i)\n user_array.each do |user_id|\n notification = Notification.create(user_id: user_id, obj_user_id: params[:data], notification_type: \"comment\", obj_id: obj_id, obj_type: comment_type, is_seen: false)\n end\n end \n end\n \n format.json { render json: @comment }\n else\n format.json { render json: @comment.errors.messages, status: :unprocessable_entity }\n end\n end\n\n when \"edit_comment\"\n respond_to do |format|\n @comment = Comment.find(params[:data])\n if @comment.update_attributes(comment: params[:value])\n format.json { render json: @comment }\n else\n format.json { render json: @comment.errors.messages, status: :unprocessable_entity }\n end\n end\n\n when \"delete_comment\"\n respond_to do |format|\n @comment = Comment.find(params[:data])\n if @comment.destroy\n format.json { render json: @comment }\n else\n format.json { render json: @comment.errors.messages, status: :unprocessable_entity }\n end\n end\n\n when \"update_status\"\n respond_to do |format|\n @slot_assess = SlotAssess.find(params[:data])\n if @slot_assess.update_attributes(status: params[:status])\n format.json { render json: @slot_assess }\n else\n format.json { render json: @slot_assess.errors.messages, status: :unprocessable_entity }\n end\n end\n\n when \"create_short_term_objective\"\n @current_title = CurrentTitle.find(params[:data])\n\n @short_term_objective = ShortTermObjective.new(short_term: params[:short_term_objective], action_plan: params[:action_plan], target_date: params[:target_date], current_title_id: @current_title.id)\n respond_to do |format|\n if @short_term_objective.save\n format.json { render json: @short_term_objective }\n else\n format.json { render json: @short_term_objective.errors.messages, status: :unprocessable_entity }\n end\n end\n\n when \"edit_short_term_objective\"\n @short_term_objective = ShortTermObjective.find(params[:data])\n\n respond_to do |format|\n if @short_term_objective.update_attributes(short_term: params[:short_term_objective], action_plan: params[:action_plan], target_date: params[:target_date])\n format.json { render json: @short_term_objective }\n else\n format.json { render json: @short_term_objective.errors.messages, status: :unprocessable_entity }\n end\n end\n\n when \"delete_short_term_objective\"\n respond_to do |format|\n @short_term_objective = ShortTermObjective.find(params[:data])\n @comments = Comment.where(short_term_objective_id: params[:data])\n if @short_term_objective.destroy && @comments.destroy_all\n format.json { render json: @short_term_objective }\n else\n format.json { render json: @short_term_objective.errors.messages, status: :unprocessable_entity }\n end\n end\n \n when \"create_evidence\"\n slot_assess_ids = params[:values]\n evidence = params[:text]\n\n respond_to do |format|\n slot_assess_ids.each do |s|\n @evidence = Evidence.new(content: evidence, status: \"New\", slot_assess_id: s)\n unless @evidence.save\n format.json { render json: @evidence.errors.messages, status: :unprocessable_entity } \n end\n end\n format.json { render json: slot_assess_ids }\n end\n \n when \"edit_evidence\"\n @evidence = Evidence.find(params[:data])\n respond_to do |format|\n if @evidence.update_attributes(content: params[:value])\n format.json { render json: @evidence }\n else\n format.json { render json: @evidence.errors.messages, status: :unprocessable_entity }\n end\n end\n\n when \"delete_evidence\"\n respond_to do |format|\n @evidence = Evidence.find(params[:data])\n @comments = Comment.where(evidence_id: params[:data])\n if @evidence.destroy && @comments.destroy_all\n format.json { render json: @evidence }\n else\n format.json { render json: @evidence.errors.messages, status: :unprocessable_entity }\n end\n end\n\n when \"create_obj_evidence\"\n evidence = params[:text]\n obj_assess_id = params[:value]\n obj_type = params[:obj_type]\n\n respond_to do |format|\n\n @evidence = Evidence.new(content: evidence, status: \"New\", :\"#{obj_type}\" => obj_assess_id)\n if @evidence.save\n format.json { render json: @evidence }\n else\n format.json { render json: @evidence.errors.messages, status: :unprocessable_entity } \n end\n end\n\n when \"add_self_value\"\n respond_to do |format|\n @slot_assess = SlotAssess.find(params[:data])\n if @slot_assess.update_attributes(self_value: params[:self_value])\n format.json { render json: @slot_assess }\n else\n format.json { render json: @slot_assess.errors.messages, status: :unprocessable_entity }\n end\n end\n\n when \"add_self_score\"\n respond_to do |format|\n @other_subject_assess = OtherSubjectAssess.find(params[:data])\n if @other_subject_assess.update_attributes(self_score: params[:self_score])\n format.json { render json: @other_subject_assess }\n else\n format.json { render json: @other_subject_assess.errors.messages, status: :unprocessable_entity }\n end\n end\n\n when \"approve_slot_detail\"\n respond_to do |format|\n @slot_assess = SlotAssess.find(params[:data])\n approved_user = User.find(params[:approved_user_id])\n is_bod = params[:role]\n\n unless is_bod.eql?(\"\") #is bod\n p \"Bod\"\n if @slot_assess.update_attributes(value: params[:value], status: \"Passed\", approved_user_id: approved_user.id, is_notified: false)\n User.find(@slot_assess.user.id).update_attributes(new_approved: true)\n @notification2 = Notification.create(user_id: @slot_assess.user.id, obj_user_id: approved_user.id, notification_type: \"approve\", obj_id: @slot_assess.id, obj_type: \"slot\", is_seen: false)\n format.json { render json: @slot_assess }\n else\n format.json { render json: @slot_assess.errors.messages, status: :unprocessable_entity }\n end\n else\n p \"Manager\"\n if @slot_assess.update_attributes(value: params[:value], approved_user_id: approved_user.id, is_notified: true)\n \n # for teamleader notification\n if approved_user.is_team_leader\n # Notify to user\n notification1 = Notification.create(user_id: @slot_assess.user.id, obj_user_id: approved_user.id, notification_type: \"approve\", obj_id: @slot_assess.id, obj_type: \"slot\", is_seen: false)\n\n # Notify to manager -> submit\n manager = User.find(Department.find( @slot_assess.user.main_department_id).manager_id)\n notification2 = Notification.create(user_id: manager.id, obj_user_id: @slot_assess.user.id, notification_type: \"submit\", obj_id: @slot_assess.id, obj_type: \"slot\", is_seen: false)\n end\n\n # for manager notification\n if approved_user.is_manager\n # Notify to user\n @notification = Notification.create(user_id: @slot_assess.user.id, obj_user_id: approved_user.id, notification_type: \"approve\", obj_id: @slot_assess.id, obj_type: \"slot\", is_seen: false)\n \n # Notify to bod -> submit\n bod_users = User.where(is_bod: true).each do |bod_user|\n notification = Notification.create(user_id: bod_user.id, obj_user_id: @slot_assess.user.id, notification_type: \"submit\", obj_id: @slot_assess.id, obj_type: \"slot\", is_seen: false)\n end\n end\n\n # for bod notification\n \n \n format.json { render json: @slot_assess }\n else\n format.json { render json: @slot_assess.errors.messages, status: :unprocessable_entity }\n end\n end\n end\n\n when \"approve_other_subject_detail\"\n respond_to do |format|\n @other_subject_assess = OtherSubjectAssess.find(params[:data])\n approved_user = User.find(params[:approved_user_id])\n is_bod = params[:role]\n\n unless is_bod.eql?(\"\") #is bod\n p \"Bod\"\n if @other_subject_assess.update_attributes(status: \"Passed\", approved_user_id: approved_user.id, score: params[:score], is_notified: false)\n @notification2 = Notification.create(user_id: @other_subject_assess.user.id, obj_user_id: approved_user.id, notification_type: \"approve\", obj_id: @other_subject_assess.id, obj_type: \"other_subject\", is_seen: false)\n format.json { render json: @other_subject_assess }\n else\n format.json { render json: @other_subject_assess.errors.messages, status: :unprocessable_entity }\n end\n else\n p \"Manager\"\n if @other_subject_assess.update_attributes(approved_user_id: approved_user.id, score: params[:score], is_notified: true)\n \n # for teamleader notification\n if approved_user.is_team_leader\n # Notify to user\n notification1 = Notification.create(user_id: @other_subject_assess.user.id, obj_user_id: approved_user.id, obj_type: \"other_subject\", notification_type: \"approve\", obj_id: @other_subject_assess.id, is_seen: false)\n\n # Notify to manager -> submit\n manager = User.find(Department.find( @other_subject_assess.user.main_department_id).manager_id)\n notification2 = Notification.create(user_id: manager.id, obj_user_id: @other_subject_assess.user.id, notification_type: \"submit\", obj_id: @other_subject_assess.id, obj_type: \"other_subject\", is_seen: false)\n end\n\n # for manager notification\n if approved_user.is_manager\n # Notify to user\n @notification = Notification.create(user_id: @other_subject_assess.user.id, obj_user_id: approved_user.id, notification_type: \"approve\", obj_id: @other_subject_assess.id, obj_type: \"other_subject\", is_seen: false)\n \n # Notify to bod -> submit\n bod_users = User.where(is_bod: true).each do |bod_user|\n notification = Notification.create(user_id: bod_user.id, obj_user_id: @other_subject_assess.user.id, notification_type: \"submit\", obj_id: @other_subject_assess.id, obj_type: \"other_subject\", is_seen: false)\n end\n end\n\n # for bod notification\n \n \n format.json { render json: @other_subject_assess }\n else\n format.json { render json: @other_subject_assess.errors.messages, status: :unprocessable_entity }\n end\n end \n end\n\n when \"reject_slot_in_timeline\"\n respond_to do |format|\n @slot_assess = SlotAssess.find(params[:data])\n approved_user = User.find(params[:approved_user_id])\n is_bod = params[:role]\n\n unless is_bod.eql?(\"\") #is bod\n p \"Bod\"\n if @slot_assess.update_attributes(status: \"Not Passed\", approved_user_id: params[:approved_user_id], is_notified: false)\n notification1 = Notification.create(user_id: @slot_assess.user.id, obj_user_id: approved_user.id, notification_type: \"reject\", obj_id: @slot_assess.id, obj_type: \"slot\", is_seen: false)\n notification2 = Notification.create(user_id: Department.find(@slot_assess.user.main_department_id).manager_id, obj_user_id: approved_user.id, notification_type: \"return\", obj_id: @slot_assess.id, obj_type: \"slot\", is_seen: false)\n notification3 = Notification.create(user_id: @slot_assess.user.team_leader_id, obj_user_id: approved_user.id, notification_type: \"return\", obj_id: @slot_assess.id, obj_type: \"slot\", is_seen: false)\n format.json { render json: @slot_assess }\n else\n format.json { render json: @slot_assess.errors.messages, status: :unprocessable_entity }\n end\n else\n p \"Manager\"\n if @slot_assess.update_attributes(approved_user_id: params[:approved_user_id], is_notified: false)\n # for team leader & user notification\n if approved_user.is_manager\n notification1 = Notification.create(user_id: @slot_assess.user.id, obj_user_id: approved_user.id, notification_type: \"reject\", obj_id: @slot_assess.id, obj_type: \"slot\", is_seen: false)\n notification3 = Notification.create(user_id: @slot_assess.user.team_leader_id, obj_user_id: approved_user.id, notification_type: \"return\", obj_id: @slot_assess.id, obj_type: \"slot\", is_seen: false)\n end\n\n # for user notification\n if approved_user.is_team_leader\n notification1 = Notification.create(user_id: @slot_assess.user.id, obj_user_id: approved_user.id, notification_type: \"reject\", obj_id: @slot_assess.id, obj_type: \"slot\", is_seen: false)\n end\n \n format.json { render json: @slot_assess }\n else\n format.json { render json: @slot_assess.errors.messages, status: :unprocessable_entity }\n end\n end\n end\n \n when \"reject_slot_detail\"\n respond_to do |format|\n @slot_assess = SlotAssess.find(params[:data])\n value = params[:value] || 1\n approved_user = User.find(params[:approved_user_id])\n is_bod = params[:role]\n\n unless is_bod.eql?(\"\") #is bod\n p \"Bod\"\n if @slot_assess.update_attributes(value: value, status: \"Not Passed\", approved_user_id: params[:approved_user_id], is_notified: false)\n notification1 = Notification.create(user_id: @slot_assess.user.id, obj_user_id: approved_user.id, notification_type: \"reject\", obj_id: @slot_assess.id, obj_type: \"slot\", is_seen: false)\n notification2 = Notification.create(user_id: Department.find(@slot_assess.user.main_department_id).manager_id, obj_user_id: approved_user.id, notification_type: \"return\", obj_id: @slot_assess.id, obj_type: \"slot\", is_seen: false)\n notification3 = Notification.create(user_id: @slot_assess.user.team_leader_id, obj_user_id: approved_user.id, notification_type: \"return\", obj_id: @slot_assess.id, obj_type: \"slot\", is_seen: false)\n format.json { render json: @slot_assess }\n else\n format.json { render json: @slot_assess.errors.messages, status: :unprocessable_entity }\n end\n else\n p \"Manager\"\n if @slot_assess.update_attributes(value: value, approved_user_id: params[:approved_user_id], is_notified: false)\n # for team leader & user notification\n if approved_user.is_manager\n notification1 = Notification.create(user_id: @slot_assess.user.id, obj_user_id: approved_user.id, notification_type: \"reject\", obj_id: @slot_assess.id, obj_type: \"slot\", is_seen: false)\n notification3 = Notification.create(user_id: @slot_assess.user.team_leader_id, obj_user_id: approved_user.id, notification_type: \"return\", obj_id: @slot_assess.id, obj_type: \"slot\", is_seen: false)\n end\n\n # for user notification\n if approved_user.is_team_leader\n notification1 = Notification.create(user_id: @slot_assess.user.id, obj_user_id: approved_user.id, notification_type: \"reject\", obj_id: @slot_assess.id, obj_type: \"slot\", is_seen: false)\n end\n \n format.json { render json: @slot_assess }\n else\n format.json { render json: @slot_assess.errors.messages, status: :unprocessable_entity }\n end\n end\n end\n\n when \"reject_other_subject_detail\"\n respond_to do |format|\n @other_subject_assess = OtherSubjectAssess.find(params[:data])\n approved_user = User.find(params[:approved_user_id])\n is_bod = params[:role]\n\n unless is_bod.eql?(\"\") #is bod\n p \"Bod\"\n if @other_subject_assess.update_attributes(status: \"Not Passed\", approved_user_id: params[:approved_user_id], is_notified: false)\n notification1 = Notification.create(user_id: @other_subject_assess.user.id, obj_user_id: approved_user.id, notification_type: \"reject\", obj_id: @other_subject_assess.id, obj_type: \"other_subject\", is_seen: false)\n notification2 = Notification.create(user_id: Department.find(@other_subject_assess.user.main_department_id).manager_id, obj_user_id: approved_user.id, notification_type: \"return\", obj_id: @other_subject_assess.id, obj_type: \"other_subject\", is_seen: false)\n notification3 = Notification.create(user_id: @other_subject_assess.user.team_leader_id, obj_user_id: approved_user.id, notification_type: \"return\", obj_id: @other_subject_assess.id, obj_type: \"other_subject\", is_seen: false)\n format.json { render json: @other_subject_assess }\n else\n format.json { render json: @other_subject_assess.errors.messages, status: :unprocessable_entity }\n end\n else\n p \"Manager\"\n if @other_subject_assess.update_attributes(approved_user_id: params[:approved_user_id], is_notified: false)\n # for team leader & user notification\n if approved_user.is_manager\n notification1 = Notification.create(user_id: @other_subject_assess.user.id, obj_user_id: approved_user.id, notification_type: \"reject\", obj_id: @other_subject_assess.id, obj_type: \"other_subject\", is_seen: false)\n notification3 = Notification.create(user_id: @other_subject_assess.user.team_leader_id, obj_user_id: approved_user.id, notification_type: \"return\", obj_id: @other_subject_assess.id, obj_type: \"other_subject\", is_seen: false)\n end\n\n # for user notification\n if approved_user.is_team_leader\n notification1 = Notification.create(user_id: @other_subject_assess.user.id, obj_user_id: approved_user.id, notification_type: \"reject\", obj_id: @other_subject_assess.id, obj_type: \"other_subject\", is_seen: false)\n end\n \n format.json { render json: @other_subject_assess }\n else\n format.json { render json: @other_subject_assess.errors.messages, status: :unprocessable_entity }\n end\n end \n end\n\n when \"withdraw_slot_detail\"\n respond_to do |format|\n @slot_assess = SlotAssess.find(params[:data])\n @user = User.find(@slot_assess.user.id)\n\n \n if @user.team_leader_id\n\n @notification = Notification.where(user_id: @user.team_leader_id, obj_user_id: @user.id, obj_id: @slot_assess.id, obj_type: \"slot\", notification_type: \"submit\").order(\"created_at desc\").first\n if @notification\n if @notification.destroy\n @slot_assess.update_attributes(is_notified: false)\n format.json { render json: @slot_assess }\n else\n format.json { render json: @slot_assess.errors.messages, status: :unprocessable_entity }\n end\n else\n format.text { render text: \"Can't withdraw slot assess without having been notified yet.\"}\n end\n else\n format.text { render text: \"This user's team leader is not availble. Please contact your Administrator to resolve.\"}\n end\n\n end\n\n when \"withdraw_other_subject_detail\"\n respond_to do |format|\n @other_subject_assesses = OtherSubjectAssess.find(params[:data])\n @user = User.find(@other_subject_assesses.user.id)\n\n \n if @user.team_leader_id\n @notification = Notification.where(user_id: @user.team_leader_id, obj_user_id: @user.id, obj_id: @other_subject_assesses.id, obj_type: \"other_subject\", notification_type: \"submit\").order(\"created_at desc\").first\n if @notification\n if @notification.destroy\n @other_subject_assesses.update_attributes(is_notified: false)\n format.json { render json: @other_subject_assesses }\n else\n format.json { render json: @other_subject_assesses.errors.messages, status: :unprocessable_entity }\n end\n else\n format.text { render text: \"Can't withdraw other subject assess without having been notified yet.\"}\n end\n else\n format.text { render text: \"This user's team leader is not availble. Please contact your Administrator to resolve.\"}\n end\n\n end\n\n when \"notify_for_detail\"\n respond_to do |format|\n @slot_assess = SlotAssess.find(params[:data])\n if @slot_assess.self_value\n @user = User.find(@slot_assess.user.id)\n\n if @user.team_leader_id\n @notification = Notification.new(user_id: @user.team_leader_id, obj_user_id: @user.id, notification_type: \"submit\", obj_id: @slot_assess.id, obj_type: \"slot\", is_seen: false)\n if @notification.save\n @slot_assess.update_attributes(is_notified: true)\n format.json { render json: @slot_assess }\n else\n format.json { render json: @slot_assess.errors.messages, status: :unprocessable_entity }\n end\n else\n format.text { render text: \"This user's team leader is not availble. Please contact your Administrator to resolve.\"}\n end\n else\n format.text { render text: \"Please add your self assessment before notify to your manager\"}\n end\n\n end\n\n when \"notify_for_other_subject_detail\"\n respond_to do |format|\n @other_subject_assess = OtherSubjectAssess.find(params[:data])\n if @other_subject_assess.self_score\n @user = User.find(@other_subject_assess.user.id)\n\n if @user.team_leader_id\n @notification = Notification.new(user_id: @user.team_leader_id, obj_user_id: @user.id, notification_type: \"submit\", obj_id: @other_subject_assess.id, obj_type: \"other_subject\", is_seen: false)\n if @notification.save\n @other_subject_assess.update_attributes(is_notified: true)\n format.json { render json: @other_subject_assess }\n else\n format.json { render json: @other_subject_assess.errors.messages, status: :unprocessable_entity }\n end\n else\n format.text { render text: \"This user's team leader is not availble. Please contact your Administrator to resolve.\"}\n end\n else\n format.text { render text: \"Please add your assessment result before notify to your manager\"}\n end\n\n end\n\n when \"update_notification_is_seen\"\n notification_type = []\n notification_type.push(params[:notification_type])\n if params[:notification_type] == \"approve\"\n notification_type.push(\"submit\")\n end\n\n if params[:notification_type] == \"reject\"\n notification_type.push(\"return\")\n end\n\n @user = User.find(params[:data])\n rs = false\n respond_to do |format|\n if @user.notifications.where(notification_type: notification_type).length > 0\n @user.notifications.where(notification_type: notification_type).each do |notification|\n if notification.update_attributes(is_seen: true)\n rs = true\n else\n rs = false\n end\n\n unless rs\n format.json { render json: @user.errors.messages, status: :unprocessable_entity }\n end\n end\n\n if rs\n format.json { render json: @user }\n end\n else\n format.json { render json: @user }\n end\n\n end\n\n\n end\n\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 handle\n model.before_action_hook(type, request)\n send(\"handle_#{type}\")\n end", "def process(selection)\n options = {\"1\" => \"input_students\",\"2\" => \"show_students\",\"3\" => \"save_students\", \"4\" => \"load_students\"}\n if options[selection]\n method(options[selection]).call\n elsif selection == \"9\"\n puts \"Bye!\"\n exit \n else\n puts \"I don't know what you meant, try again\"\n end\nend", "def index\n puts \"You chose index!\"\nend", "def index\n puts \"You chose index!\"\nend", "def runReport\n#Check the value of the report_type parameter and based on its value redirect to a view.\n if params[:report_type] == '1'\n redirect_to usersByPosts_url #Go to the viewUsersByPosts view\n elsif params[:report_type] == '2'\n redirect_to viewByVote_url #Go to the viewPostsByVote view\n elsif params[:report_type] == '3'\n redirect_to(postsByDate_url(:from_date => params[:from_date], :to_date => params[:to_date])) #Go to the viewPostsByDate view\n\n end\n end", "def main_selector\n print \"What would you like to do? Create, List, Update, or Vote: \"\n main_decision = gets.chomp.downcase\n main_decision = main_decision[0]\n case main_decision\n when \"c\"\n create_person_or_politician\n when \"l\"\n list_characters_created\n when \"u\"\n update_character\n when \"v\"\n vote\n else\n puts \"That is not a valid entry please try again!\"\n main_selector\n end\n end", "def create\n puts \"(V)oter or (P)olitician\"\n options = gets.chomp.downcase # voter or politician\n case(options)\n when \"v\"\n voterclass\n when \"p\"\n politicianclass\n end\n end", "def legacy\n case params[:path][0]\n when 'list'\n if (params[:path][1] == 'novita.php')\n redirect_to :controller => 'books', :action => 'recent'\n elsif (params[:path][1] == 'sconti.php')\n redirect_to :controller => 'books', :action => 'offers'\n else\n redirect_to :controller => 'books', :action => 'list', :id => params[:path][1].sub('.php','').sub('_',' ')\n end\n when 'search.php'\n redirect_to :controller => 'books', :action => 'search'\n when 'links.php'\n redirect_to :controller => 'books', :action => 'links'\n else\n redirect_to '/' \n end\n end", "def launch!\n\t\tintroduction\n\n\t\tresult = nil\n\t\tuntil result == :quit\n\t\t\tprint \"> Choose one of these options: List, Sort, Find or Add.\\n\\n\"\n\t\t\tuser_response = gets.chomp\n\t\t\tresult = do_action(user_response)\n\t\tend\n\t\tconclusion\n\tend", "def choose_option(input)\n \t# input = user_input\n case input\n when 1 then add_contact\n when 2 then modify_contact\n when 3 then display_all_contacts\n when 4 then display_contact\n when 5 then display_contact_attributes\n when 6 then delete_contact\n when 7 then exit \t\n else puts \"I'm sorry Dave, but you cant do that.\"\n end\n end", "def view\n view_get if request.get?\n view_post if request.post?\n end", "def action\n args.first\n end", "def default_controller; end", "def run(req, res)\n @params = req.params\n controller_class.send(action_name)\n end", "def new\n payment_type = nil \n if params.has_key? :payment_type\n payment_type = params[:payment_type]\n else\n payment_type = 'sign_up'\n end\n @payment = Payment.new\n\n respond_to do |format|\n format.html {\n case payment_type\n when 'sign_up'\n # really want to go to a form, that submits here, i save that info, populate the send\n # thing and send it off to payp.\n render(:action => 'sign_up.rhtml') && return \n when 'trip'\n render(:action => 'trip_sign_up.rhtml') && return \n else\n end\n }\n format.xml { render :xml => @payment }\n end\n end", "def account_choice\n action = Dialog::how_can_we_help_you\n case action\n when \"new account\"\n do_new_account\n account_choice\n when \"balance\"\n show_accounts\n account_choice\n when \"deposit\"\n show_accounts\n do_dep_and_with {do_deposit}\n account_choice\n when \"withdraw\"\n show_accounts\n do_dep_and_with {do_withdraw}\n account_choice\n when \"end\"\n Dialog::goodbye_cust\n else\n Dialog::wrong_entry\n account_choice\n end\n end", "def surveyWorkflow\n survey_status = session[:survey_status]\n \n case survey_status\n when \"survey created\"\n redirect_to :controller=>'questions',:action=>'new',:survey_id=> @survey.id\n when \"questions created\"\n redirect_to :controller=>'surveys',:action=>'show',:id=> @survey.id,:notice=>'Great! Your Survey is Created!'\n when \"survey updated\"\n \tredirect_to :controller=>'questions',:action=>'edit',:survey_id=> @survey.id\n\twhen \"questions updated\"\n\t\tredirect_to :controller=>'themes',:action=>'index', :id=> @survey.id\n\twhen \"theme chosen\"\n\t\tredirect_to :controller=>'surveys',:action=>'show',:id=> @survey.id\t, :survey => @survey\t\n end\n \n end", "def index\n\n if current_user.isAdmin?\n @proposals = Proposal.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proposals }\n end\n\n elsif current_user.isStudent?\n @proposals = Proposal.all\n @proposal = Proposal.new\n\n respond_to do |format|\n format.html { render 'index_student' }\n format.json { render json: @proposals }\n end\n end\n\n end", "def run(req, res)\n if matches?(req)\n controller_instance = controller_class.new(req, res, route_params(req))\n controller_instance.invoke_action(action_name)\n else\n # extra precaution! won't be hit if `Router#run` is used\n res.status = 404\n res.write(\"No route matches for #{http_method} on #{controller_class}\")\n end\n end", "def handle_choice\n result = ''\n\n case @cfg\n when String then\n case @breadcrumbs[1].to_sym\n when :development then menu_method = self.method(:development_menu)\n when :heroku then menu_method = self.method(:heroku_menu)\n else menu_method = self.method(:missing_menu)\n end\n when Hash\n result = handle_by_shop_type\n finish!\n else\n raise \"don't know what to do with @cfg: #{@cfg.inspect}\"\n end\n\n if menu_method\n result << \"you picked #{@breadcrumbs.join('.')}\\n\"\n result << @cfg.inspect + \"\\n\"\n result << TColor.yellow { menu_method.call.print }\n end\n result\n end", "def ask\n @view = VIEWS[:ask]\n @contributions = Contribution.where(url: '')\n respond_to do |format|\n format.html { render :index }\n format.json { render json: @contributions }\n end\n end", "def create\n\t\tputs \"\\nWhat would you like to create? (P)olitician or (V)oter\"\n\t\tpolitics = gets.chomp.upcase\n\t\tcase politics\n\t\twhen \"V\"\n\t\t\tvoter_creation\n\t\twhen \"P\"\n\t\t\tpolitician_creation\n\t\telse\n\t\t\tputs \"\\nSomething went wrong. Please select again\"\n\t\t\tcreate\n\t\tend\n\t\tmain_menu\n\tend", "def change_cider_view\n if params[:artisan] == \"all\"\n @artisan = params[:artisan].downcase\n else\n @artisan = params[:artisan]\n end\n if params[:style] == \"all\"\n @style = params[:style].downcase\n else\n @style = params[:style].to_i\n end\n \n if user_signed_in?\n # determine if account has multiple users and add appropriate CSS class tags\n @user = current_user\n \n # need account users for projected rating partial\n @account_users = User.where(account_id: @user.account_id)\n @account_users_count = @account_users.count\n \n # check if user has already chosen drinks\n if current_user.subscription_status == \"subscribed\"\n # find if user has a delivery in process\n @next_delivery = Delivery.where(account_id: current_user.account_id, status: [\"admin prep next\", \"user review\"]).first\n @customer_drink_order = AccountDelivery.where(account_id: current_user.account_id, delivery_id: @next_delivery.id)\n @current_subscriber = true\n #set class for order dropdown button\n @customer_change_quantity = \"subscriber-change-quantity\"\n gon.page_source = \"stock\"\n else\n # find if user has an order in process\n @order_prep = OrderPrep.where(account_id: @user.account_id, status: \"order in process\").first\n if !@order_prep.blank?\n @customer_drink_order = OrderDrinkPrep.where(user_id: current_user.id, order_prep_id: @order_prep.id)\n else\n @customer_drink_order = nil\n end\n @current_subscriber = false\n @customer_change_quantity = \"nonsubscriber-change-quantity\"\n end\n end\n \n # get currently available drink info\n if @artisan == \"all\" && @style == \"all\"\n\n # get currently available beers to show in inventory\n @currently_available_ciders = Beer.current_inventory_ciders\n \n # get current inventory breweries for dropdown\n @currently_available_makers = Brewery.current_inventory_cideries\n # get currently available styles for dropdown filter\n @current_inventory_drink_style_ids = Beer.drink_style(@currently_available_ciders)\n @currently_available_styles = BeerStyle.where(id:@current_inventory_drink_style_ids)\n #Rails.logger.debug(\"Styles: #{@currently_available_styles.inspect}\")\n \n # set view\n @drink_count = @currently_available_ciders.count\n @artisan_count = @currently_available_makers.count\n \n # get inventory beer ids\n @inventory_beer_ids = @currently_available_ciders.pluck(:beer_id)\n\n elsif @artisan != \"all\" && @style == \"all\"\n # get info about chosen artisan\n @current_artisan = Brewery.friendly.find(@artisan)\n \n # get currently available beers to show in inventory\n @currently_available_ciders = Beer.current_inventory_ciders.where(brewery_id: @current_artisan.id)\n \n # get current inventory breweries for dropdown\n @currently_available_makers = Brewery.current_inventory_cideries\n # get currently available styles to show in dropdown\n @current_inventory_drink_style_ids = Beer.drink_style(@currently_available_ciders)\n @currently_available_styles = BeerStyle.where(id:@current_inventory_drink_style_ids)\n \n @drink_count = @currently_available_ciders.count\n @artisan_count = 1\n \n # get inventory beer ids\n @inventory_beer_ids = @currently_available_ciders.pluck(:beer_id)\n\n elsif @artisan == \"all\" && @style != \"all\"\n # get info about chosen style\n @current_style = BeerStyle.find_by_id(@style)\n \n # get currently available beers to show in inventory\n @currently_available_ciders = Beer.current_inventory_ciders\n #Rails.logger.debug(\"Current ciders: #{@currently_available_ciders.inspect}\")\n\n # get current inventory breweries for dropdown\n @currently_available_makers = Brewery.current_inventory_cideries_based_on_style(@style)\n # get currently available styles to show in dropdown\n @current_inventory_drink_style_ids = Beer.drink_style(@currently_available_ciders)\n @currently_available_styles = BeerStyle.where(id:@current_inventory_drink_style_ids)\n \n # get all related drink types\n @all_related_types = Array.new\n @all_related_types << BeerType.related_drink_type(@style)\n @all_related_types << BeerTypeRelationship.related_drink_type_one(@style)\n @all_related_types << BeerTypeRelationship.related_drink_type_two(@style)\n @all_related_types = @all_related_types.flatten.uniq\n \n # get currently available ciders to show in inventory\n @currently_available_ciders = Beer.current_inventory_ciders.where(beer_type_id: @all_related_types)\n @current_makers = @currently_available_ciders.pluck(:brewery_id).uniq\n \n @drink_count = @currently_available_ciders.count\n @artisan_count = @current_makers.count\n \n # get inventory beer ids\n @inventory_beer_ids = @currently_available_ciders.pluck(:beer_id)\n\n else\n # get info about chosen style and artisan\n @current_artisan = Brewery.friendly.find(@artisan) \n @current_style = BeerStyle.find_by_id(@style)\n \n # get currently available beers to show in inventory\n @currently_available_ciders = Beer.current_inventory_ciders.where(brewery_id: @current_artisan.id)\n \n # get current inventory breweries for dropdown\n @currently_available_makers = Brewery.current_inventory_cideries_based_on_style(@style)\n # get currently available styles to show in dropdown\n @current_inventory_drink_style_ids = Beer.drink_style(@currently_available_ciders)\n @currently_available_styles = BeerStyle.where(id:@current_inventory_drink_style_ids)\n \n # get all related drink types\n @all_related_types = Array.new\n @all_related_types << BeerType.related_drink_type(@style)\n @all_related_types << BeerTypeRelationship.related_drink_type_one(@style)\n @all_related_types << BeerTypeRelationship.related_drink_type_two(@style)\n @all_related_types = @all_related_types.flatten.uniq\n \n # get currently available ciders to show in inventory\n @currently_available_ciders = Beer.current_inventory_ciders.where(brewery_id: @current_artisan.id, beer_type_id: @all_related_types)\n \n @drink_count = @currently_available_ciders.count\n @artisan_count = 1\n \n # get inventory beer ids\n @inventory_beer_ids = @currently_available_ciders.pluck(:beer_id)\n end\n \n if user_signed_in?\n # get related user drink recommendations\n @drink_recommendations = ProjectedRating.where(user_id: @user.id, beer_id: @inventory_beer_ids).order(projected_rating: :desc).paginate(:page => params[:page], :per_page => 12)\n #Rails.logger.debug(\"Drink recommendations: #{@drink_recommendations.inspect}\")\n else\n # get related user drink recommendations\n @drink_recommendations = Inventory.where(beer_id: @inventory_beer_ids).includes(:beer).order('beers.beer_rating_one desc').uniq.paginate(:page => params[:page], :per_page => 12)\n #Rails.logger.debug(\"Drink recommendations: #{@drink_recommendations.inspect}\")\n end\n \n # update page\n respond_to do |format|\n format.js\n end # end of redirect to jquery\n \n end", "def what_sub\n case params[:key]\n when \"birds\"\n render :birds\n when \"butterflies\"\n render :butterflies\n when \"fungi\"\n render :fungi \n when \"plants\"\n render :plants\n\n else\n render :what_is_here\n end\n end", "def process(selection)\n case selection\n when \"1\"\n input_students\n when \"2\"\n show_students\n when \"3\"\n save_students\n when \"4\"\n load_students\n when \"5\"\n exit\n else\n puts \"Please try again.\"\n end\nend", "def process(selection)\n case selection\n when \"1\"\n input_students\n when \"2\"\n show_students\n puts \"Show successful\"\n when \"3\"\n save_students\n when \"4\"\n filename = get_filename\n load_students(filename)\n when \"9\"\n exit\n else\n puts \"I don't know what you mean, try again\"\n end\nend", "def main_menu\n choice = self.prompt.select(\"Hi there, #{self.user.name}! What would you like to do today?\", [\"Create a new post\", \"Find a book\", \"View or edit my posts\", \"Delete my account\", \"Logout\"])\n\n case choice\n when \"Create a new post\"\n self.new_post\n when \"Find a book\"\n self.find_book\n when \"View or edit my posts\"\n self.view_edit_posts\n when \"Delete my account\"\n self.delete_account\n when \"Logout\"\n self.spinner(\" ✌️✌️✌️ \")\n self.greet\n end\n end", "def index\n var = params['variable']\n @employees = Employee.all\n @patients = Patient.all\n @cases = Case.all\n if var == \"employeeList\"\n respond_to do |format|\n format.html { render :partial=> 'employees/listEmployee'}\n end\n elsif var == \"employeeTable\"\n respond_to do |format|\n format.html { render :partial=> 'employees/datatableEmployee'}\n end\n end\n end", "def process(selection)\n case selection\n when \"1\" then input_students #invoking input_students method\n when \"2\" then show_students #invoking show_students method\n when \"3\" then save_students\n when \"4\" then try_load_students\n when \"9\" then exit # this will end the program\n else puts \"I don't know what you meant, try again\"\n end\nend", "def create\n\nputs \"------------------------------------------------\nWho do you want to create: (Politician or Person)\"\ncreate_input= gets.chomp.downcase\n\n if create_input == \"politician\" \n Politician.create_politician\n elsif create_input == \"person\"\n Person.create_person\n else\n create #create, to loop to beginig of method create\n end #end of if\nmain_menu\nend", "def deciding_request\n request_friendship = RequestFriendship.find(params[:rf])\n\n n = current_user.id\n if n != request_friendship.recipient_id\n throw Exception\n end\n\n\n #Para que no sea grande ni saque datos explicitos ponemos un número 1 = ACCEPTED, 2 = REJECTED\n choice = \"ACCEPTED\"\n if (params[:choice] == \"2\")\n choice = \"REJECTED\"\n end\n\n\n result = RequestFriendship.where({recipient_id: current_user.id, sender_id: request_friendship.sender_id,\n status: \"PENDING\"}).last\n\n message_suffix = \"\"\n respond_to do |format|\n if result.update({status: choice})\n if(choice == \"ACCEPTED\")\n Friendship.createFriendship(result)\n message_suffix = \"ACEPTADO\"\n else\n message_suffix = \"DENEGADO\"\n end\n format.html { redirect_to welcome_index_path, notice: 'La petición se ha ' << message_suffix }\n else\n format.html { render 'welcome/index' }\n end\n end\n\n end", "def process(selection)\n case selection\n when \"1\"\n input_students\n when \"2\"\n show_students\n when \"3\"\n save_students\n when \"4\"\n load_students\n when \"5\"\n methcheck\n when \"9\"\n exit\n end\n puts input_fb(selection)\nend", "def execute_action(action)\n case action\n when 1\n create_station\n when 2\n stations.size > 1 ? create_route : (puts 'Для создания маршрута нужно хотя бы 2 станции.')\n gets\n when 3\n routes.empty? ? (puts 'Маршрутов не создано.') : edit_route \n when 4\n create_train\n when 5\n system 'clear'\n move_train \n when 6\n system 'clear'\n add_carriage_to_train\n when 7\n remove_carriage\n when 8\n set_route\n when 9\n system 'clear'\n display_all_stations\n when 0\n abort\n else\n puts \"Неизвестная команда!\"\n end\n end", "def show\n if current_user.is_frontdesk?\n redirect_to frontdesk_path(@record)\n elsif current_user.is_nurse?\n redirect_to nurse_path(@record)\n elsif current_user.is_doctor?\n redirect_to doctor_path(@record)\n elsif current_user.is_pharmacist?\n redirect_to pharmacist_path(@record)\n elsif current_user.is_admin?\n end\n end", "def method_missing(method, *args)\n if Track.session_dimensions.include?(params[:action])\n params[:action] = ['locality','region','country'] if params[:action] == 'locality'\n @site_summary = @property.site_summary(params).all\n render :action => 'site_summary'\n elsif Track.campaign_dimensions.include?(params[:action])\n @campaign_summary = @property.campaign_summary(params).all\n render 'campaigns/campaign_summary' \n elsif Track.loyalty_dimensions.include?(params[:action])\n @visit_summary = @property.visit_summary(params).all\\\n .sort{|a,b| a[params[:action]].to_i <=> b[params[:action]].to_i }\n render :action => 'visit_summary' \n elsif Track.event_dimensions.include?(params[:action])\n @site_summary = @property.content_summary(params).all\n render :action => 'content_summary'\n else\n raise ActiveRecord::RecordNotFound\n end\n end", "def GET; end", "def index\n if params[:submit].present?\n case params[:submit]\n when 'food'\n params[:minimum_price] == '' ? minimum_price = 0 : minimum_price = params[:minimum_price]\n params[:maximum_price] == '' ? maximum_price = Food.maximum(:price) : maximum_price = params[:maximum_price]\n\n @foods = Food.search(params[:food_name], params[:description], minimum_price, maximum_price)\n when 'order'\n params[:minimum_total_price] == '' ? minimum_price = 0 : minimum_price = params[:minimum_total_price]\n params[:maximum_total_price] == '' ? maximum_price = Order.maximum(:total) : maximum_price = params[:maximum_total_price]\n\n @orders = Order.search(params[:order_name], params[:address], params[:email], params[:payment_type], minimum_price, maximum_price)\n when 'restaurant'\n params[:minimum_food_count] == '' ? minimum_food_count = 0 : minimum_food_count = params[:minimum_food_count] \n params[:maximum_food_count] == '' ? maximum_food_count = Food.all.count : maximum_food_count = params[:maximum_food_count]\n @restaurants = Restaurant.search(params[:restaurant_name], params[:restaurant_address], minimum_food_count, maximum_food_count)\n end\n else\n\n end\n \n end", "def decision\n say_what = params[:say]\n\n if (say_what == 'bye')\n redirect_to(:controller => 'say', :action => 'goodbye')\n else\n\n redirect_to(:controller => 'say', :action => 'hello', :form_name => params[:name])\n end\n end", "def run(req, res)\n controller = controller_class.new(req, res, route_params(req))\n controller.invoke_action(action_name)\n end", "def switch_to_controller\n unless ( name = (path_matcher.view_name || path_matcher.model_name) )\n return\n end\n\n action = nil\n \tif path_matcher.is_view?\n \t action = File.basename(file_path).split(\".\").first\n else\n \t name = name.pluralize\n end\n\n controller = \"/app/controllers/#{name}_controller.rb\"\n\n if action\n goto_definition controller, \"def #{action}\"\n else\n open_file controller\n end\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 action_A\n case @mode\n when :menu\n action_A_menu\n else\n $game_system.se_play($data_system.decision_se)\n show_choice\n end\n end", "def default_method\n case @action.to_s\n when /create/\n :post\n when /update/\n :put\n when /destroy/\n :delete\n else# and when /(index|show|new|edit)/\n :get\n end\n end", "def method_missing method, *opt\n method.to_s =~ /^do_[A-Z]+$/ ? process_request(*opt) : super\n end", "def index\n redirect_to :action => 'request_bill'\n end" ]
[ "0.62969303", "0.62649393", "0.6223896", "0.619273", "0.6175284", "0.6175284", "0.6175284", "0.6175284", "0.6175284", "0.6175284", "0.6175284", "0.6175284", "0.6175284", "0.6175284", "0.6175221", "0.6121161", "0.61141604", "0.60795707", "0.60795707", "0.60608786", "0.60061574", "0.60061574", "0.60061574", "0.60061574", "0.60061574", "0.6005724", "0.5967824", "0.5961341", "0.59432304", "0.58846635", "0.58680326", "0.58616805", "0.58474183", "0.5838719", "0.5812584", "0.58057255", "0.57995546", "0.5789373", "0.57539344", "0.5734119", "0.5726544", "0.5725033", "0.5710695", "0.5695527", "0.56879425", "0.56781626", "0.56693405", "0.5646593", "0.5634834", "0.562524", "0.562443", "0.5623084", "0.56189317", "0.56163794", "0.5615405", "0.56003964", "0.557941", "0.55707574", "0.55707574", "0.5552884", "0.55489653", "0.5544489", "0.55439657", "0.5539946", "0.55311275", "0.55302674", "0.55235684", "0.55211294", "0.5498649", "0.548832", "0.54871637", "0.5477953", "0.54707164", "0.54700595", "0.5469616", "0.54685724", "0.5466019", "0.5463098", "0.54596585", "0.54489297", "0.5443906", "0.5436613", "0.5432543", "0.5420019", "0.5413292", "0.5408611", "0.5406318", "0.5406287", "0.5403316", "0.54024523", "0.54007584", "0.53786236", "0.53722763", "0.5371179", "0.536881", "0.53625184", "0.5359555", "0.53593427", "0.53583354", "0.53583187" ]
0.5381409
91
Intialize instance variables for a new game of Hangman
def setup_game @word = get_word.upcase @misses = [] @hits = [] @guesses_left = 10 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize\n\t\tsystem \"clear\"\n\t\tputs \"Lets play hangman!\"\n \t\t@guess_count = 0\n \t\t@game_status = false\n \t\t@guessed_letters=[]\n \t\t@guessing_word=[]\n \tend", "def initialize\n @e_tanks = 4\n\n # alive (true) ; defeated (false)\n @bubble_man = false\n @air_man = false\n @quick_man = false\n @wood_man = false\n @crash_man = false\n @flash_man = false\n @metal_man = false\n @heat_man = false\n end", "def initialize(word)\n # This is just some a printout of the game at initialization\n puts \"\n POORMAN's\n ___ ___ ____ ____ __ ____ ___ ___ _____ ____ __\n / / / / / _ | | \\\\ | | / ___\\\\ | \\\\ / | | _ \\\\ \\\\ \\\\_ \\\\ \\ \n / /__/ / / /_| | | |\\\\ \\\\| | | | ___ | |\\\\ \\\\ / /| | | |_\\\\ \\\\ \\\\ \\\\ \\\\ \\\\\n / ___ / / ___ | | | \\\\ | | |__| | | | \\\\ \\\\/ / | | | ___ \\\\ \\\\ \\\\\\\\ \\\\_\\\\ \\\\ \n /__/ /__/ /__/ |_| |_| \\\\__| \\\\____/ |_| \\\\__/ |_| |_| \\\\__\\\\ |_| \\_____|\n \n \"\n\n # instance variables for HangMan Class\n @word = word\n\n ## LOGIC: This is to set the number of guesses based on the length of the word\n if @word.length >= 12\n @guess_count = 9\n elsif @word.length >= 10 && @word.length < 12\n @guess_count = 8\n elsif @word.length >= 8 && @word.length < 10\n @guess_count = 7\n elsif @word.length >= 6 && @word.length < 8\n @guess_count = 6\n else\n @guess_count = 5\n end\n ## End of Logic\n\n @is_correct = false # Flag to see if the guess is correct\n # Nifty code to set a prompt variable with a bunch if underscores\n # Note the length of the underscores matches the length of the word\n @prompt = String.new(str=\"_\") * word.length\n @guess_history = Array.new # A guess history array to store guesses\n end", "def initialize\n @guesses = 0\n @hangman = [\n \"\n\n\n\n\n \",\n \"\n\n\n\n\n --------\",\n \"\n |\n |\n |\n |\n --------\",\n \" _____\n |\n |\n |\n |\n --------\",\n \" _____\n | |\n o |\n |\n |\n --------\",\n \" _____\n | |\n o |\n | |\n |\n --------\",\n \" _____\n | |\n o |\n /| |\n |\n --------\",\n \" _____\n | |\n o |\n /|\\\\ |\n |\n --------\",\n \" _____\n | |\n o |\n /|\\\\ |\n / |\n --------\",\n \" _____\n | |\n o |\n /|\\\\ |\n / \\\\ |\n --------\"\n ]\n end", "def initialize\n\t\t@answer_word = []\n\t\t@word_hidden = []\n\t\t@guessed_letters = []\n\t\t@guess_count = 0\n\t\t@number_guess = 0\n\t\t@game_over = 0\n\tend", "def initialize\n @name_boy = default_male_name\n @name_girl = default_female_name\n $game_switches[Yuki::Sw::Gender] = @playing_girl = false\n $game_variables[Yuki::Var::Player_ID] = @id_boy = rand(0x3FFFFFFF)\n @id_girl = (@id_boy ^ 0x28F4AB4C)\n @start_time = Time.new.to_i\n @play_time = 0\n @badges = Array.new(6 * 8, false)\n @region = 0\n @game_version = PSDK_CONFIG.game_version\n @current_version = PSDK_Version rescue 0\n @time_counter = 0\n load_time\n end", "def initialize\n super\n @op_hand = Array.new\n @my_hand = Array.new\n @unseen = Array.new\n @op_lands = Hash.new\n @discards = Hash.new\n @my_lands = Hash.new\n Game::LANDS.each do |land|\n @op_lands[land] = Array.new\n @discards[land] = Array.new\n @my_lands[land] = Array.new\n end\n moveover\n gameover\n end", "def initialize \n @letter_count = 0 \n @game_is_over = false\n end", "def initialize(chosen_word,word_guess,dead_man,time)\n @chosen_word = chosen_word\n @word_guess = word_guess\n @dead_man = dead_man\n @time = time\n end", "def initialize(word)\n\t\t@word = word\n\t\t@guesses = word.length\n\t\t# Initialize a instance variable with empty hash.\n\t\t@guessed_words = {}\n\t\t# Initialize the game_end to boolean false \n\t\t@game_end = false\n\t\t# Index is used to replace the dashes with the correct guess.\n\t\t@index = 0\n\t\t# Initialize the hidden word with dashes instead of alphabets.\n\t\t@hidden_word = word.tr(word,\"-\")\n\tend", "def set_game_variables\n\t\tword = @dictionary.random_word\n\t\t@answer_array = word.split('')\n\t\t@blank_word_array = []\n\t\tword.length.times do \n\t\t\t@blank_word_array << \"_\"\n\t\tend\n\t\t@guess_counter = 6\n\t\t@incorrect_array = []\n\tend", "def init(name, difficulty)\n case difficulty\n when 'easy'\n health = 100\n hunger = 100\n sanity = 100\n when 'medium'\n health = 50\n hunger = 50\n sanity = 50\n when 'hard'\n health = 25\n hunger = 25\n sanity = 25\n when 'arm fighter'\n health = 1\n hunger = 2\n sanity = 3\n end\n player = Player.new(name, health, hunger, sanity)\n game(player)\nend", "def initialize()\n @word = get_random_word\n @guesses = ''\n @wrong_guesses = ''\n end", "def initialize(secret_word)\n puts \"Initializing game for new secret word...\"\n @secret_word = secret_word\n @current_state = \"\"\n secret_word.length.times { @current_state << \"_\" }\n @prev_guesses = []\n @available_guesses = secret_word.length\n @is_over_won = false\n end", "def initialize(name)\n super(name: name)\n self.hit_points = 10\n self.charm_points = 10\n self.house_id = House.all.sample.id\n self.wand = Character.all.select{|c| !c.wand.start_with?(\" \") }.sample.wand\n self.pet = [\"cat\", \"owl\", \"toad\", \"rat\"].sample\n self.patronus = MY_ANIMAL_FAKER.sample\n @classmates_faced = []\n self.friends = 0\n self.victories = 0\n end", "def initialize\n @secret_code = Code::random\n @steps = 0\n @guess = nil\n @in_play = true\n end", "def initialize\n @rooms = { #defines the rooms available for use on each floor\n :upstairs => [\"Master Bedroom\", \"A Guest Room\", \"Tower\", \"Balcony\", \"Observatory\", \"The Hole Room\"],\n :main => [\"Kitchen\", \"Library\", \"Study\", \"Dining Room\", \"Living Room\", \"Vault\"],\n :downstairs => [\"Furnace Room\", \"Chapel\", \"Storage Room\", \"The Pit\"]\n }\n\n @used_rooms = []\n @omen_count = 0 #Omens are a game event that change the story line. Once the omen count reaches 10 the haunt starts\n @player = Character.new\n intro #script\n entry_hall(\"Main Hallway\")\n game\n end", "def initialize (money, life, fights, respect)\n #The health bar of the player, when the health gets down to 0 the player loses.\n @life = life\n #The wealth that the player has amassed throughout the game.\n @money = money\n #Respect that the player has earned winning fights in the game\n @respect = respect\n #Number of fight events that the player has won.\n @fights = fights\n #List of states for the game.\n @states = []\n\tend", "def initialize\n\t\t@health_info = { previous_health: PLAYER_MAX_HEALTH, heal_amount: 0 }\n\t\t@@look_comfort = 0\n\t\t@look = []\n\tend", "def start_new_game\n puts \"Welcome to Hangman! Try to guess my secret word!\"\n puts\n game_id = get_num_saved_games\n return HangmanGameState.new(game_id)\n end", "def initialize(guesses=3, range)\n\t\t@guesses = guesses\n\t\t@range = range\n\t\t@solved = false\n\t\t@player_record = {\"Wins\" => 0 , \"Losses\" => 0}\n\tend", "def initialize(word)\r\n\t\t\r\n# \ti. Put a initializing game statement on the screen\r\n\tputs \"Initializing game...\"\r\n# \tii. Instance variables for:\r\n# \t \ta. The word (entered by first user - the word to be guessed)\r\n\t\t@word = word\r\n# \t \tb. Split the word into letters that can be guessed and assign to a new instance variable\r\n\t\t@word_split = word.split(\"\")\r\n# \t \tc. Default a guess count instance variable to start at 0\r\n\t\t@guess_count = 0 \r\n# \t \td. The chances of winning the game based on the amount of guesses you have. \r\n\t\t@chance = word.length\r\n# \t \te. Amt of guesses should be assigned to a variable using the length of the word to be guessed.\r\n\t\t@guessed = Array.new(word.length, \"_\")\r\n# \t \tf. Set variable to false for end of game\r\n\t\t@end_game = false\r\n# \t \tg. Letter guessed assigned to a variable.\r\n\t\t@letter_guessed = letter_guessed\r\n\tend", "def initialize\n @difficulty = 0\n @word_to_guess\n @theme = \"\"\n puts \"Welcome to Word Guess!\".blink\n prompt\n end", "def run\n puts \"Welcome to the Hangman game. You will need 2 players.\"\n\n h = Hangman.new # this creates a new instance of the game\n h.getWord\n h.welcomePlayer2\n\n h.startGuess\n\n #h.displayHangman\n\nend", "def initialize\n\t\t@word = [\"buffalo\", \"llama\", \"kangaroo\", \"elephant\", \"aardvark\", \"orangutan\", \"hyena\"]\n\t\t@current_state = []\n\t\t@guess_array = []\n\tend", "def initialize(word)\n\t\t@word = word\n\t\t@guesses = word.length\n\t\t@game_over = false\n\t\t@letters = []\n\tend", "def initialize()\n @word = ''\n @guesses = ''\n @wrong_guesses = ''\n @word_with_guesses = '-'*word.length\n @check_win_or_lose = :play\n end", "def initialize(sample = nil)\r\n\r\n # Spielfeld\r\n @mastermind = Mastermind.new(sample)\r\n\r\n # Holt die Regelvarianten vom Spielfeld\r\n @range = @mastermind.range # Erlaubter Wertebereich\r\n @digits = @mastermind.digits # Anzahl der Felder auf Spielfeld\r\n\r\n # zaehler / Zustandsvariablen\r\n @left = possible_guesses()\r\n @last_guess\r\n @last_hits\r\n @solved = false\r\n\r\n # Fuer Testzwecke\r\n @loesung = [1,2,3,4]\r\n end", "def initialize\r\n\t\t# another way of making an array\r\n\t\t@words = %w\"learning lollipop education image computer mobile january february friday flower beauty light earth machine book\r\n\t\tnews yahoo google internet bangladesh india america cricket football friday sunday sunny\"\r\n\t\t@chances_left = 5\r\n\r\n\t\t@game_over = false\r\n\r\n\t\t\r\n\tend", "def initBoard\n\t\tprng = Random.new\n\t\tspotOne = prng.rand(6).truncate + 97\n\t\tspotTwo = prng.rand(6).truncate + 97\n\t\tspotThree = prng.rand(6).truncate + 97\n\t\tspotFour = prng.rand(6).truncate + 97\n\t\t@real = [spotOne, spotTwo, spotThree, spotFour]\n\t\t#@real = [98, 100, 97, 98]\n\t\t#classfield\n\t\t@guesses = []\n\tend", "def initialize(secret)\n @secret = secret\n @guess_count = secret.length\n @word_state = [\"_\"] * secret.length \n @guesses = []\n end", "def initialize(level)\n case level\n when \"heroes\"\n @word = Faker::Overwatch.unique.hero.upcase\n when \"locations\"\n @word = Faker::Overwatch.unique.location.upcase\n when \"quotes\"\n @word = Faker::Overwatch.unique.quote.upcase\n end\n @letters = @word.split('')\n @guess = 0\n @word_display = []\n @letters.each do |letter|\n if [\" \",\"!\",\",\",\".\",\"?\",\"\\\"\",\"'\",\":\",\";\",\"$\"].include?(letter)\n @word_display << letter\n else\n @word_display << \"_\"\n end\n end\n cat_position\n @guessed_letters = []\n end", "def initialize\n @lives = 5\n @gold = 0\n @health_points = 10\n end", "def initialize\n @game_settings = GameSettings.new\n super 920, 480\n self.caption = GAME_TITLE\n @settings_hovered = Options::START_SCREEN[0]\n @title_font, @subtitle_font = Gosu::Font.new(50), Gosu::Font.new(20)\n @background_image = Gosu::Image.new(\"media/background1.jpg\", :tileable => true)\n @blank_card = Gosu::Image.new(\"media/card.png\", :tileable => true)\n @button_option = Gosu::Image.new(\"media/button.png\", :tileable => true)\n @deck = Deck.new\n @playing_cards = Array.new\n @computer_signal = ComputerTimer.new\n @players_created, @mes, @false_mes, @true_mes, @trying_mes = false, false, false, false, false\n @hint = []\n #players\n @pressed, @p1, @p2 = nil, nil, nil\n @game_timer = Timers.new\n end", "def initialize\r\n @player_number = 1\r\n @turn = 0\r\n @draw = false # set the game to a draw\r\n @finished = false # bool value to end the game\r\n $arr =[false,false,false,false,false,false,false,false,false] # array to hold which value is occupied in the grid\r\n $letter_grid =[['','',''],['','',''],['','','']] # grid so that letters can be placed inside by the user\r\n end", "def initialize(referee = Computer.new, human = Human.define_name, dictionary)\n @referee = referee\n @human = human\n @dictionary = dictionary\n @board = []\n @guesses = []\n @failed_guess_count = 0\n end", "def initialize_globals(game)\n\n $available_letters = \"abcdefghijklmnopqrstuvwxyz\".split(\"\")\n $missed_letters = []\n\n if game.downcase == \"back\" \n\t$is_get_level = true\n\n elsif game.downcase == \"restart\"\n\t$is_get_level = false\n end\n\n $is_eof_game = false\n $guessed_word = [\"_\"]\n $word = \"\"\nend", "def new_game(dictionary)\n\t\t@dictionary = dictionary\n\t\t@frequency_hash = frequency_hash\n\t\t@vowels = vowels\n\t\t@letters = letters\n end", "def initialize(win_word)\r\n\t# Set winning word\r\n\t\t@win_word = win_word\r\n\t# Initialize remaining guesses to win_word length plus 5\r\n\t\t@remaining_guesses = win_word.length + 5\r\n\t# Initialize array to store past guesses to check for repeats\r\n\t\t@past_guesses = []\r\n\t# Initialize string to represent current state of word, or, hint\r\n\t\thint = \"\"\r\n\t\thint_length = win_word.length\r\n\t\thint_length.times { hint = hint + \"_ \" }\r\n\t\t@hint = hint\r\n\t\tputs \"Ok! User 2 please take over.\"\r\n\t\tputs \"Guess the word!\"\r\n\t\tputs \"Here's a hint: #{@hint}\"\r\n\tend", "def initialize( )\n\t\t\t@squares = Hash.new\n\t\t\t@turn = :white\n\t\t\t@en_passant = nil\n\t\t\t\n\t\t\tsetup\n\t\tend", "def initialize\n @code = generate_code\n @word_code = convert_code\n @guess = []\n @num_guess = []\n @remaining_guesses = 12\n end", "def initialize\n @board = Board.new(GAME_SIZE)\n @prev_guesses = []\n @player = AiPlayer.new(@board)\n end", "def initialize(word, image)\n @word = word\n @correct_guesses = Array.new(word.game_word.length)\n @dashes = Array.new(word.game_word.length, \"-\")\n @guesses = []\n @counter = 0\n @image = image\n end", "def defaults args\n fiddle args\n args.state.enemy.hammers ||= []\n args.state.enemy.hammer_queue ||= []\n args.state.tick_count = args.state.tick_count\n args.state.bridge_top = 128\n args.state.player.x ||= 0 # initializes player's properties\n args.state.player.y ||= args.state.bridge_top\n args.state.player.w ||= 64\n args.state.player.h ||= 64\n args.state.player.dy ||= 0\n args.state.player.dx ||= 0\n args.state.enemy.x ||= 800 # initializes enemy's properties\n args.state.enemy.y ||= 0\n args.state.enemy.w ||= 128\n args.state.enemy.h ||= 128\n args.state.enemy.dy ||= 0\n args.state.enemy.dx ||= 0\n args.state.game_over_at ||= 0\nend", "def initialize\n @wrong_letters = []\n @wrong_guesses = 0\n end", "def init(msg)\n msg.reply('Game starting! You have 5 tries! Submit an answer by using $game guess followed by a number!'.freeze)\n @started = true\n @random_number = rand(100)\n @tries = 0\n end", "def initialize()\n @word = ''\n @guesses = ''\n @wrong_guesses = ''\n end", "def initialize(word=WordGuesserGame.get_random_word, guesses = '',wrong_guesses='')\n @word = word\n @guesses = guesses\n @wrong_guesses = wrong_guesses\n end", "def initialize\n greeting\n init_players\n end", "def initialize (threat_level=:medium)\n super (threat_level)\n @habitat = \"graveyard\"\n\n\n end", "def initialize(guesses_allowed=3, set_of_numbers=10)\n @guesses_allowed = guesses_allowed #sets the number of guesses\n @current_guess_count = 0 #starts guess count at 0\n @player = Player.new #creates a new player\n @max_guess = set_of_numbers #i did this to keep track of the upper limit of the range of guesses\n @secret_number = SecretNumber.new(set_of_numbers)\n end", "def initialize(selected_class, decklist)\n @hero_class = selected_class\n case\n when @hero_class == 'druid'\n @name = 'Malfurion Stormrage'\n when @hero_class == 'hunter'\n @name = 'Rexxar'\n when @hero_class == 'mage'\n @name = 'Jaina Proudmoore'\n when @hero_class == 'paladin'\n @name = 'Uther Lightbringer'\n when @hero_class == 'priest'\n @name = 'Anduin Wrynn'\n when @hero_class == 'rouge'\n @name = 'Valeera Sanguinar'\n when @hero_class == 'shaman'\n @name = 'Thrall'\n when @hero_class == 'warlock'\n @name = 'Guldan'\n when @hero_class == 'warrior'\n @name = 'Garrosh Hellscream'\n end\n @deck = decklist\n @hand = []\n @health = 0\n @amour = 0\n @attack = 0\n @weapon = ''\n @total_mana = 0\n @mana_available = 0\n @cards_used_or_discarded = []\n @battlefield = [] # card hero has in play\n @attacked_this_turn = false\n end", "def game_init\r\n state(0)\r\n @game_deck.create_new_deck\r\n @player_deck = {}\r\n @dealer_deck = {}\r\n @player.points = 0\r\n @dealer.points = 0\r\n end", "def initialize()\r\n\t\t@time = Timer.new # the time the user has made\r\n\t\t@penalty = Penalty.new # the penalty time on the map\r\n\t\tself.reset()\r\n\tend", "def initialize (correct_answer) #add class-arguments here\r\n @correct_answer = correct_answer\r\n @updated_guess = \"\"; correct_answer.length.times { @updated_guess << \"_ \" }\r\n @guess_limit = @correct_answer.length # set the total-amount of guesses possible\r\n @number_of_guesses = 0 # counter for user's guess count\r\n @done = nil # simply to say this class is done.\r\n @past_guesses = [] # hold past guesses\r\n end", "def initialize\n @width = 800\n @width_tiles = @width / 32\n @height = 640\n @height_tiles = @height / 32\n @keys = []\n super(@width, @height, fullscreen = false)\n self.caption = \"Aetheris\"\n\n @spell = Gosu::Image.new(Utils.image_path_for(\"explosion\"), rect: [0, 0, 32 * 3, 32 * 3])\n @spell_cooldown = 0\n @game_name = Gosu::Image.from_text(\"Aetheris\", 100)\n @player = Player.new(self)\n @npc = NPC.new\n @player.warp(300, 200)\n @visibility = { fog: 3 }\n @map = Gosu::Image.new(\"images/map.jpg\")\n @low_grass = @map.subimage(32, 32 * 2, 22, 22)\n @camera = Camera.new(x: 0, y: 0, width: WIDTH, height: HEIGHT)\n @interacting = false\n @spell_avalanche_of_fire = nil\n end", "def hangman\n game = Game.new\n game.new_or_load\n hangman if game.play_again\nend", "def initialize(player_1_word)\n @word_to_guess = player_1_word.split('')\n @number_guesses_left = @word_to_guess.length\n @letters_tried=[]\n end", "def initialize(name = 'Kasih', file_name='./dictionary.txt')\n @name = name\n @full_dictionary = import_dictionary(file_name)\n @dictionary = @full_dictionary.dup\n @guessed_letters = [] #must reset at the end!\n @new_game = true\n end", "def initialize\n @start_time = Time.now\n @last_time_value, @score = 0, 0\n @level_num = rand(20...35)\n @insults = [\"Oh man, you SUCK\", \"GIT GUD\", \"Pick it up\", \"Woohoo I'm winning\", \"I'm the BEST\", \"You call this a game?\", \"B U R N\", \"Git better\", \"Git checkout skills\", \"You can't compete\", \"L O S E R\", \"Who needs a hint? Clearly you!\"]\n @mean_msg = @insults[rand([email protected])]\n end", "def initialize(word)\r\n\t\tputs \"game initializing\"\r\n\t\t@guessed_letters = []\r\n\t\t@word = word\r\n\t\ttemp = word.downcase.delete(' ')\r\n \t@secret_word = temp.split('')\r\n \t\r\n \t@guess_count = word.length.to_i + 4\r\n \tif(guess_count > 26)\r\n \t\tguess_count = 24\r\n \tend\r\n \r\n \t@gameover = false\r\n\r\n\t\tshow_progress(secret_word,guessed_letters)\r\n\r\n \twhile @gameover == false \r\n \t\r\n begin\r\n\t\t\t puts \"guess a letter or the word: \"\r\n\t\t\t letter = gets.chomp\r\n letter = letter.downcase\r\n \r\n \r\n end until @guessed_letters.include?(letter) == false\r\n if (letter == temp)\r\n puts \"Letters guessed #{guessed_letters}\"\r\n puts \"YOU WIN by means of guessing the word\"\r\n break\r\n end\r\n\r\n\t\t\t@guessed_letters.push(letter)\r\n\t\t\tguess(letter,secret_word)\r\n\t\t\tputs \"Letters guessed #{guessed_letters}\"\r\n\t\t\tshow_progress(secret_word,guessed_letters)\r\n\t\t\t\r\n\r\n\r\n\t\t end\r\n\r\n \tend", "def initialize(word)\n start_new_game(word)\n end", "def start_game\r\n\t puts \"Welcome to Hangman! A secret word has been chosen. You have #{turn_count} guesses to get the word correct. Good luck!\"\r\n\t (@secret_word.size).times { @correct_letters += \"_ \" }\r\n\t puts @correct_letters\r\n\t begin_guessing\r\n\tend", "def initialize\n @id = 0 ## event id\n @ai = 0\n @hp = 30\n @meele_damage = 30\n @range_damage = 10\n @last_attack = 0\n @cooldown = 3 * Graphics.frame_rate ### 3 seconds in frames\n @alive = false\n @index = 0\n @active = false\n @damage_taken = 0\n @initialized = false ## this turns true when Enemy is alive or dead\n \n end", "def initialize()\n @sides = DEFAULTS[:sides]\n @num_dice = DEFAULTS[:num_dice]\n @players = DEFAULTS[:players]\n @speed = DEFAULTS[:speed]\n @target_score = DEFAULTS[:target_score]\n end", "def initialize\n monster_chance\n end", "def initialize(bowling)\n @bowling=bowling\n @game = bowling.game\n @first_roll = -1\n @second_roll = 0\n @frame = 0\n @valid_roll= 0\n end", "def initialize(name)\n @name = name\n @strength = 60 + rand(1..100) # LINE 2620\n @wealth = 30 + rand(1..100)\n @food = 0\n @tally = 0\n @monsters_killed = 0\n @items = Hash.new\n @items[:torch] = true\n @items[:amulet] = true\n @items[:suit] = true\n @items[:weapons] = Set.new [:axe, :sword]\n end", "def initialize(cards)\n\n\n #while start waiting to east to start\n @state = :start\n #hand for each player\n @hands = {} \n @hands[:south] = cards.slice(0,10).sort!\n @hands[:east] = cards.slice(10,10).sort!\n @hands[:west] = cards.slice(20,10).sort!\n \n \n #cards played on table\n @played = {}\n # number of tricks taken by each player\n @taken = {}\n\n #sets taken and played\n @@PLAYERS.each do |player|\n @played[player] = nil\n @taken[player] = Array.new\n end \n # hole cards \n @hole_cards = cards.slice(30,2) \n @on_move = :east \n end", "def initialize(secretWord, maxWrongGuesses)\n @correctlyGuessedLetters = Set.new\n @incorrectlyGuessedLetters = Set.new\n @incorrectlyGuessedWords = Set.new\n\t\t@secretWord = secretWord.upcase\n\t\t@guessedSoFar = MYSTERY_LETTER*@secretWord.length\n\t\t@maxWrongGuesses = maxWrongGuesses\n end", "def initialize(name, set_of_numbers, guesses_allowed)\n @name = name\n @guesses_allowed = guesses_allowed\n @set_of_numbers = set_of_numbers\n @current_guess_count = 0\n @player = Player.new(@name, @current_guess_count)\n @secret_number = SecretNumber.new(@set_of_numbers)\n @current_guess = nil\n end", "def initialize\n @gold = 1000\n @food = 80\n @health_points = 500\n end", "def initialize(name) # je recrée un initialize et je fais appel aux caractéristiques de la classe mère avec super\n super(name)\n\n @life_points = 100 # j'ajoute les caractéristiques propres au joueur humain\n @weapon_level = 1\n end", "def initialize\n @hungry = true\n end", "def initialize(is_empty, has_stairs, has_enemy, has_captive, has_wall, is_ticking, has_golem)\n @is_empty = is_empty\n @has_stairs = has_stairs\n @has_enemy = has_enemy\n @has_captive = has_captive\n @has_wall = has_wall\n @has_bomb = is_ticking\n @has_golem = has_golem\n end", "def initialize\n puts \" -----------------------------------------------\"\n puts \"| |\"\n puts \"| Bienvenue sur 'ILS VEULENT TOUS MA POO' ! |\"\n puts \"| |\"\n puts \"|-----------------------------------------------|\"\n puts \"| |\"\n puts \"|Le but du jeu est d'être le dernier survivant !|\"\n puts \"| |\"\n puts \" -----------------------------------------------\"\n puts \"Nom du joueur?\"\n player1_input=gets.chomp\n puts \"\\n\"\n @player1=HumanPlayer.new(player1_input)\n @players_left=10\n @enemies_in_sight=[]\n\n \n \n end", "def initialize\r\n @counter = 6\r\n @wrong_guess = Array.new\r\n end", "def initialize_game\n p '########################################################################################'\n p '########################################################################################'\n p 'Bienvenu dans le Tic-Tac-Toe !'\n p 'Le plateau se décrit de la manière suivante :'\n p ' 1 | 2 | 3 '\n p ' ----------'\n p ' 4 | 5 | 6 '\n p ' ----------'\n p ' 7 | 8 | 9 '\n p 'A chaque tour, un des joueurs doit séléctionner la case ou il veut rentrer son symbole.'\n p 'Le premier joueur est les ronds, le second est les croix.'\n p 'Le jeu commence une fois que chaque joueur a inscrit son prénom.'\n p '########################################################################################'\n p '########################################################################################'\n @nb_tour = 1\n end", "def init_public_members\r\n @id = 0\r\n @x = 0\r\n @y = 0\r\n @real_x = 0\r\n @real_y = 0\r\n @tile_id = 0\r\n @character_name = \"\"\r\n @character_index = 0\r\n @move_speed = 4\r\n @move_frequency = 6\r\n @walk_anime = true\r\n @step_anime = false\r\n @direction_fix = false\r\n @opacity = 255\r\n @blend_type = 0\r\n @direction = 2\r\n @pattern = 1\r\n @priority_type = 1\r\n @through = false\r\n @bush_depth = 0\r\n @animation_id = 0\r\n @balloon_id = 0\r\n @transparent = false\r\n end", "def initialize (name) #when a fish is created in CL ie. f1 = Fish.new('nemo'), this method will autorun, and you have to give it a name\n puts 'new fish is born'\n # health = 10 # local\n @health = 10 # increases to an instance variable\n @speed = 5\n @name = name\n stomach = [ ]\n\n end", "def initialize \n\t\t@alive #checking they're alive\n\t\t\tputs \"I am alive\"\n\t\t@health=150 #initialize that all mammals start at 150\n\t\tself\n\tend", "def begin_game\n\t\t#Does this need really to be stored in a variable?\n\t\tg = Game.new(@name)\n\tend", "def my_initialize\n\t\t@classes = 1\n\t\t@toys = 0\n\t\t@books = 0\t\t\n\t\tsrand seed.to_i\n\t\t@location = nil\n\t\tnext_spot()\n\t\t@random_number = 0\n\t\ttrue\n\tend", "def init_public_members\n @id = 0\n @x = 0\n @y = 0\n @real_x = 0.0\n @real_y = 0.0\n @tile_id = 0\n @character_name = \"\"\n @character_index = 0\n @move_speed = 4\n @move_frequency = 6\n @walk_anime = true\n @step_anime = false\n @direction_fix = false\n @opacity = 255\n @blend_type = 0\n @direction = 2\n @pattern = 1\n @priority_type = 1\n @through = false\n @bush_depth = 0\n @animation_id = 0\n @balloon_id = 0\n @transparent = false\n end", "def setup_game(guess_total, pegs, user)\n new_screen\n @game_board = GameBoard.new(guess_total, pegs)\n @code_maker = CodeMaker.new(pegs, user)\n @game_board.secret_code = @code_maker.maker_code\n @code_breaker = user == 'human' ? Human.new(pegs) : Computer.new(pegs)\n end", "def initialize(name)\n @name = name\n @best_guess = []\n @key_pegs = []\n @encoded_guess = []\n @turn = 0\n @previous_shuffles = []\n @previous_values = []\n play\n end", "def initialize\n @gold = 1000\n @lumber = 500\n @food = 80\n @health_points = 500\n end", "def initialize(type)\n @type = type\n @name = \n if @type == \"human\"\n puts \"\\nPlease enter your name, lucky player:\"\n gets.chomp\n else\n nemesis_names = [\n \"The Strangulator\", \n \"Tic Tac Terminator\",\n \"Doomsday Derrick\",\n \"Tanya Ticky Tacky\",\n \"Chris Cross\",\n \"The Game Meister\",\n \"Tom the Time Bomb\",\n \"The 3x3 Grid Zombie\",\n \"Squirrel\"] \n nemesis_names.sample\n end\n @token = \n if @type == \"human\"\n puts \"\\nPlease select a game token, such as X, O, @, $, @ etc. \"\n gets.chomp[0]\n else\n {section: \"\\xc2\\xa7\",\n registered: \"\\xc2\\xae\",\n copyright: \"\\xc2\\xa9\",\n pilcrow: \"\\xc2\\xb6\",\n yen: \"\\xc2\\xa5\",\n pound: \"\\xc2\\xa3\"}.values[rand(0..5)]\n end \n end", "def initialize(player_name)\n @name = player_name\n @life_points = 10\n end", "def initialize\n Game.engine.draw(Game.engine.markdown.parse('# Bandit Mayhem'))\n selection = Game.engine.prompt.select('Select an option', 'New game', 'Load game', 'Quit')\n\n case selection\n when 'New game'\n save_name = Game.engine.prompt.ask('Enter save name:', default: 'bandit-mayhem')\n\n Game.player = Player.new(name: 'Nigel', health: 30, x: 1, y: 5, map: BanditMayhem::Map::Map.new('lynwood/strick_household'))\n\n # intro\n Cinematic.new('intro').play\n\n @quit = false\n when 'Load game'\n Game.load_save if File.exist?(DEFAULT_SAVE)\n # TODO fix\n # Game.player = Player.new(name: 'Nigel', health: 30, x: 1, y: 5, map: BanditMayhem::Map::Map.new('lynwood/strick_household'))\n @quit = false\n when 'Quit'\n @quit = true\n end\n end", "def initialize(name_to_update,life_points_to_update=10)\n @name = name_to_update\n @life_points = life_points_to_update\n @degat = 0 # j'initialise une variable de classe degat afin de m'en servir dans toute la classe\n @weapon_level = 1\n end", "def initialize\n super\n @height = 1.60\n @weight = 52\n @id_bis = 0\n @type1 = 1\n @type2 = 1\n @base_hp = @base_atk = @base_dfe = @base_spd = @base_ats = @base_dfs = 1\n @ev_hp = @ev_atk = @ev_dfe = @ev_spd = @ev_ats = @ev_dfs = 0\n @move_set = []\n @tech_set = []\n @evolution_level = 0\n @evolution_id = 0\n @special_evolution = nil\n @exp_type = 1\n @base_exp = 100\n @base_loyalty = 0\n @rareness = 0\n @female_rate = 60\n @abilities = [0, 0, 0]\n @breed_groupes = [15, 15]\n @breed_moves = []\n @master_moves = []\n @hatch_step = 1_000_000_000\n @items = [0, 0, 0, 0]\n @baby = 0\n end", "def init_private_members\r\n @original_direction = 2 # Original direction\r\n @original_pattern = 1 # Original pattern\r\n @anime_count = 0 # Animation count\r\n @stop_count = 0 # Stop count\r\n @jump_count = 0 # Jump count\r\n @jump_peak = 0 # Jump peak count\r\n @locked = false # Locked flag\r\n @prelock_direction = 0 # Direction before lock\r\n @move_succeed = true # Move success flag\r\n end", "def initialize(player1, player2, secret_word)\n @player1 = player1\n @player2 = player2\n @secret_word = secret_word\n\t\t# Code: Split the string into characters\n\t\t# Output: array of characters (secret_word_arr) \n @secret_word_arr = secret_word.chars\n \t@word_length = @secret_word_arr.length\n \t@guess_count = 0\n @is_over = false\n # @guess = nil\n @guesses = []\n\tend", "def initialize(pseudo)\n\t\t@name = pseudo\n\t\t@weapon_level = 1\n\t\t@life_points = 100\n\tend", "def init_guess_count\n @guess_count = 12\n end", "def initialize(fire, speed,turn, explosion, dead, number_of_attacks)\r\n @fire = 2\r\n @speed = 4\r\n @turn = 5\r\n @explosion = true\r\n @dead = true\r\n @number_of_attacks +=1\r\n end", "def defaults\n state.flash_at ||= 0\n state.zombie_min_spawn_rate ||= 60\n state.zombie_spawn_countdown ||= random_spawn_countdown state.zombie_min_spawn_rate\n state.zombies ||= []\n state.killed_zombies ||= []\n\n # Declares player as a new entity and sets its properties.\n # The player begins the game in the center of the screen, not moving in any direction.\n state.player ||= state.new_entity(:player, { x: 640,\n y: 360,\n attack_angle: 0,\n dx: 0,\n dy: 0 })\n end", "def initialize (threat_level=:medium)\n # note that zombies created without a threat level\n # will still have a default threat_level of :medium\n super(threat_level) \n @habitat = \"graveyard\"\n end", "def initialize(word)\n @word = word\n @guesses = ''\n @wrong_guesses = ''\n self\n end" ]
[ "0.7327131", "0.7277354", "0.7059402", "0.701629", "0.69521576", "0.69360846", "0.68813413", "0.6866532", "0.68251973", "0.67986506", "0.6783143", "0.6746939", "0.67460454", "0.67450684", "0.6744188", "0.67381465", "0.67189497", "0.6708105", "0.67072695", "0.6679388", "0.66493607", "0.6648767", "0.66240793", "0.6610722", "0.6585935", "0.6583357", "0.6554951", "0.6553324", "0.6542867", "0.6533319", "0.653039", "0.6520817", "0.65203017", "0.65093166", "0.64894176", "0.64872015", "0.64871", "0.6471815", "0.64571536", "0.64464265", "0.64340436", "0.6426542", "0.6421663", "0.64130265", "0.6411136", "0.6404139", "0.63996124", "0.63965833", "0.6387284", "0.6379515", "0.6368495", "0.6365106", "0.6362451", "0.6350467", "0.63465124", "0.6340005", "0.6339007", "0.6336922", "0.63331956", "0.63294363", "0.63232934", "0.6323221", "0.63202393", "0.63143915", "0.6309024", "0.6295119", "0.6292329", "0.62688226", "0.62647945", "0.62615114", "0.6252374", "0.62418354", "0.6237834", "0.6236052", "0.62248045", "0.6222046", "0.6219931", "0.6219227", "0.62190354", "0.6217174", "0.6211749", "0.62077904", "0.6204312", "0.61901474", "0.6177335", "0.61771643", "0.6173967", "0.6164492", "0.61624074", "0.6160575", "0.6150794", "0.61456174", "0.61419034", "0.61418897", "0.6139479", "0.6136491", "0.6129495", "0.6123337", "0.6123068", "0.6117347" ]
0.69991446
4
Get a random word to be guessed during the Hangman game
def get_word begin File.readlines(DICTIONARY_FILENAME). select { |word| word.length.between?(6, 13) }.sample.chomp rescue puts "Unable to read from file '#{ DICTIONARY_FILENAME }'." nil end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def guessed_word()\r\n\t\tresult = ''\r\n\r\n\t\t# TODO: fill in method body\r\n\t\t\r\n\t\treturn result\r\n\tend", "def get_word\n @word_to_guess.join\n end", "def random_word\n @words.fetch(rand(@words.length)).chomp\n end", "def random_word\n\t\tnumber = rand(@modified_dictionary.length)\n\t\t@modified_dictionary[number]\n\tend", "def random_word(msg)\n return if Variables::Constants::IGNORED_USERS.include?(msg.user.nick)\n word = LiterateRandomizer.word\n @last_words = [] if @last_words.nil?\n word = LiterateRandomizer.word while @last_words.include?(word)\n @last_words.prepend_capped(word, 5)\n msg.reply(word)\n end", "def select_word\r\n\t\t@answer = @words[rand(27)]\r\n\r\n\r\n\t\t# this would be a list of hashes\r\n\t\t@question = \"\"\r\n \t@tempque=\"\"\r\n\t\tfor x in [email protected]\r\n\r\n\t\t\t@question=@question+\"#\"\r\n \t\t@tempque=@tempque+\"#\"\r\n\t\tend\r\n\t\treturn @answer\r\n\r\n\tend", "def pick_random_word(dictionary)\n random_num = rand(dictionary.length)\n dictionary[random_num]\n end", "def pick_secret_word\n @word = dictionary.sample\n word\n end", "def get_random_word\r\n @word_list.sample\r\n end", "def random_word\n words = @dictionary.dictionary.keys\n words[rand(words.length)]\n end", "def selectWord\n\twords = [\n\t\t\"anvil\",\n\t\t\"black\",\n\t\t\"break\",\n\t\t\"clear\",\n\t\t\"doubt\",\n\t\t\"exist\",\n\t\t\"first\",\n\t\t\"girth\",\n\t\t\"heart\",\n\t\t\"icons\",\n\t\t\"joker\",\n\t\t\"loath\",\n\t\t\"mirth\",\n\t\t\"notch\",\n\t\t\"overt\",\n\t\t\"print\",\n\t\t\"qualm\",\n\t\t\"react\",\n\t\t\"solid\",\n\t\t\"trick\",\n\t\t\"until\",\n\t\t\"viola\",\n\t\t\"water\",\n\t\t\"young\",\n\t\t\"zebra\"\n\t]\n\treturn words[Random.rand(words.length)]\nend", "def random_word\n open('/usr/share/dict/words').read.split(/\\n/).sample\n end", "def a_word\n return @random_word\n end", "def chooseRandomWord() \n @randomWord = @wordsList[rand([email protected])]\n @randomWord.downcase\n \n #adding \"_\" to the letters array to display during the game\n randomWordSize = @randomWord.size - 1\n (1..randomWordSize).each do |i| \n @lettersDisplayArr.push(\" _ \")\n \n end\n beginGame()\n end", "def random_word\n wordpair = nil\n File.foreach(\"wordlist\").each_with_index do |line, number|\n wordpair = line if rand < 1.0/(number+1)\n end\n word = Word.new(wordpair.split(':')[0], wordpair.split(':')[1])\n return word\n end", "def pick_random_word\n random_word = @words.sample.gsub!(/\\s+/, \"\")\n end", "def get_random_word(words)\n # rand method with an integer argument (the length of words) get a new integer between 0 & the length of words\n return words[rand(words.count)]\n end", "def get_word\n word = @word_list[rand(@word_list.length)]\n @word = word.gsub(/\\s+/, \"\").downcase\n end", "def select_word\n uri = URI('https://random-word-api.herokuapp.com/word?number=5')\n words = Net::HTTP.get(uri) \n words = words.delete(\"[\").delete(\"]\").delete(\"\\\"\")\n words = words.split(\",\")\n index = rand(words.count - 1)\n return words[index]\n end", "def get(word)\r\n return \"\" if !@words[word]\r\n follow = @words[word]\r\n sum = follow.inject(0) { |sum,kv | sum +=kv[1] }\r\n random = rand(sum)+1\r\n part_sum = 0\r\n nextWord = follow.find do |word, count|\r\n part_sum += count\r\n part_sum >= random\r\n end.first\r\n nextWord\r\n\r\n end", "def random_word\n\t\tLEGAL_WORDS.sample # Gets random element from array\n\tend", "def random_word(lexicon)\n lexicon[rand(lexicon.length)] \n end", "def catch_phrase\n translate('faker.company.buzzwords').collect { |list| sample(list) }.join(' ')\n end", "def random_word\n word = WORDS[rand(WORDS.length)]\n word == \"\" ? random_word : word\nend", "def gensecretword\r\n\t\t \trand_index = rand(@wordtable.length)\r\n\t\t \t@secret_clue = @descr[rand_index]\r\n\t\t \t@num_words = @wordtable[rand_index].split(\" \").length\r\n\t\t return @wordtable[rand_index].upcase\r\n\t\t end", "def catch_phrase\n translate('faker.company.buzzwords').collect {|list| list.sample }.join(' ')\n end", "def get_word(dictionary)\n word = dictionary[rand(dictionary.length)]\n # Ensure that the word is between 5 and 12 letters long.\n if word.length.between?(5,12)\n return word.downcase.strip\n else\n get_word(dictionary)\n end\n end", "def word\n options = []\n case @theme\n when \"default\"\n options = [\"cast\", \"puppy\", \"pineapple\", \"bananas\"]\n @word_to_guess = options.sample\n when \"food\"\n options = [\"mango\", \"papaya\", \"guava\", \"apples\", \"lychee\"]\n @word_to_guess = options.sample\n when \"hacker\"\n options = [\"bandwidth\", \"synthesize\", \"bypass\", \"cyberpunk\", \"firewall\"]\n @word_to_guess = options.sample\n when \"game of thrones\"\n options = [\"stark\", \"lannister\", \"arya\", \"hodor\", \"meereen\"]\n @word_to_guess = options.sample\n when \"lord of the rings\"\n options = [\"lothorien\", \"galadriel\", \"frodo\", \"bombadil\", \"goldberry\"]\n @word_to_guess = options.sample\n end\n end", "def guessed_word(word)\n\t\tif @ans_word == word\n\t\t\tputs \"You are a genious\"\n\t\telse\n\t\t\tputs \"guess again\"\n\t\t\t@guess_word.pop\n\t\tend\n\tend", "def new_game\n\t\t# Get the full list of words\n\t\twords = File.readlines('wordlist.txt')\n\t\tvalid_words = []\n\t\twords.each do |w| \n\t\t\t# Take all new lines and returns out\n\t\t\tw.gsub!(/\\r\\n/, \"\")\n\t\t\t# Word is valid if it's between 5 and 12 characters and isn't a proper noun. (no fair using names and such!) \n\t\t\tvalid_words << w if w.length.between?(5,12) && w[0] != w[0].upcase\n\t\tend\n\t\t# Split secret word into an array of letters\n\t\t@word = valid_words.sample.split(\"\").to_a\n\t\t# This holds user's guess. Originally populated with \"_\" for each letter\n\t\t@guess = \"\"\n\t\[email protected] { @guess += \"_\"}\n\t\t# Holds user's wrong letters. Originally populated with 9 x \"_\"\n\t\t@wrong_letters = \"\"\n\t\t9.times { @wrong_letters += \"_\"}\n\t\t@turn = 0\n\t\tputs \"Your task is to guess the secret word, letter by letter.\"\n\t\tputs \"You have only 9 wrong letters before you lose, so guess carefully!\"\n\t\tputs\n\t\tputs \"Here is your word. Each _ is a letter.\"\n\t\tputs\n\t\tget_guess\n\tend", "def choose_word\n @word = @lines[rand(0..(@lines.length - 1))].chomp\n choose_word if @word.length < 5 || @word.length > 12\n end", "def get_word\r\n\t # Variable initialization\r\n\t wordArray = []\r\n\t count = 0\r\n\t random_int = 0\r\n\t \r\n\t # Stores each word that is on a new line into an array\r\n\t f = File.open(\"5desk.txt\", \"r\")\r\n\t f.each_line{ |line| wordArray << line }\r\n\t f.close\r\n\t \r\n\t # Selects the random word between the desired length of between 5 and 12 characters. \r\n\t # Note that this includes an extra delimiter at the end of each word\r\n\t until wordArray[random_int].length > 5 && wordArray[random_int].length < 14 do\r\n\t random_int = Random.new.rand(0..61405)\r\n\t end\r\n\t wordArray[random_int].chomp!\r\n\tend", "def word_with_guesses\n word_to_display = ''\n self.word.chars do |letter|\n # if we find letter in the word to be in guessed letters\n # replace it with the actual letter\n if self.guesses.include? letter\n word_to_display += letter\n else\n word_to_display += '-'\n end\n end\n return word_to_display\n end", "def current_word()\n current = $build_word.join(\" \") # return a string of placeholder underscores + correctly guessed letters\nend", "def pick_a_word\n\t\tbucket = @dictionary[@dictionary.keys[rand @dictionary.size]]\n\t\tpair = bucket[rand bucket.size]\n\t\tpair.last\n\tend", "def pick_mystery_word\n @picked_word = self.dict.sample\n self.picked_word.length\n end", "def choose_word\n @words = read_words unless @words\n return @words [rand @words.size]\nend", "def new_word\n\t\tdictionary = File.open(\"5desk.txt\", \"r\").readlines\n\t\tbegin \n\t\t\t@the_word = dictionary[rand(0..dictionary.length)]\n\t\tend while @the_word.length >= 12 || @the_word.length <=5\n\t\t@the_word\n\tend", "def getRandomWord\n @word = Wordnik.words.get_random_word(\n includePartOfSpeech: \"noun\",\n minLength: 5,\n maxLength: 10\n )\n if request.xhr?\n render :json => @word\n end\n end", "def word_status\n\t\t@ans_word.length.times do\n\t\t\t@guess << \"_\"\n\t\tend\n\t\tputs \"Guesser, your secret word has #{@ans_word.length} characters: #{@guess*\"\"}\"\n\tend", "def get_word(word)\n chosen = \"\"\n\n if [email protected][word].nil? then\n \n # sum up all values in our word to get range\n total = 0\n @graph.words[word].map { |k,v| total += v }\n\n # grab some random val from said range\n sel = rand(total)\n\n # return the first word that has a\n # weight greater than our 'random number'\n # ensure we remove the weight from random\n # on each iteration\n @graph.words[word].each do |k,v|\n\n if v > sel then\n chosen = k\n break\n end\n\n sel -= v\n\n end\n\n return chosen\n end\n\n end", "def get_word\n\t\tselection = IO.readlines(\"colors.txt\")\n\t\t@word = selection[rand(selection.length)].downcase.chomp\n\t\t@word_array= @word.chars.to_a\n\t\tputs \"Here's the word cheaty, #{@word.upcase}\"\n\tend", "def initialize()\n @word = get_random_word\n @guesses = ''\n @wrong_guesses = ''\n end", "def guess_hidden_word\n puts (\"Enter your guess: \")\n end", "def getWord\n return RandomWord.adjs.next\nend", "def randomly( word )\n send( [ :point, :delete, :insert ].random, word )\n end", "def guess_word(word_length)\n self.sample(dict.select { |word| word.length == word_length } )\n end", "def current_word\n #for each char in the word, either fill it in if its guessed or replace with '_'\n my_word = \"\"\n word.each_char do |c|\n if guesses.include? c\n my_word << c\n else\n my_word << \"_\"\n end\n end\n my_word\n\n end", "def dictionary_word\n dict = File.readlines(\"./data/5desk.txt\")\n word = dict[rand(dict.length)].strip while word.nil? || word.length <= 5 || word.length >= 12\n word\n end", "def draw_word\n @words.sample(random: Ibsenphrase::Random.prng)\n end", "def print_win\n puts \"Wow! You did it, the word is #{@random_word}! You guessed the word & you WIN!\"\n end", "def choose_word\n case @game_mode\n when \"computer guess\"\n puts \"Choose a word! (It must be in the dictionary)\"\n @word = gets.chomp\n when \"human guess\"\n @word = computer_guess\n end\n end", "def new_game\n dictionary = File.readlines(\"assets/5desk.txt\").map {|word| word.chomp}\n dictionary.select! {|word| word.length >= 5 && word.length <= 12}\n @chosen_word = dictionary[(dictionary.size * rand).floor]\n\n puts \"A word has been chosen that is #{@chosen_word.length} letters long.\"\n puts \"You may guess the letters in that word one letter at a time,\"\n puts \"or you may guess the whole word, but a man's life \\\"hangs\\\" in\"\n puts \"the balance. So be careful not to make too many wrong guesses,\"\n puts \"because once his whole body and both of his eyes have been\"\n puts \"drawn, he's dead and you lose!\"\n puts \"\\n\"\n\n @word_guess = WordGuess.new(@chosen_word)\n @dead_man = DeadMan.new\n\n round\n end", "def word_picker\n dictionary = File.readlines('lib/5desk.txt')\n word = dictionary.sample(1)[0].chomp.downcase\n word = dictionary.sample(1)[0].chomp.downcase until word.length.between?(5, 12)\n word\n end", "def get_word(key = '')\n words = self.words[key] || []\n extras = key == '' ? 2 : 3\n\n while true\n n = rand(words.length + extras)\n existing_word = words[n]\n return existing_word if existing_word\n\n new_word = make_word(key)\n bad = false\n self.words.each do |word|\n if word.include? new_word\n bad = true\n break\n end\n end\n next if bad\n words << new_word\n self.words[key] = words\n\n return new_word\n end\n end", "def guess(letter)\r\n\t\t@guessed << letter.downcase\r\n\t\t@word[0].each_index do |i| #Iterate through indexes instead of values\r\n\t\t\tif @word.dig(0,i) == letter #since @word is an array inside an array, dig helps us look in word ([0]) each index for the letter.\r\n\t\t\t\t@hidden_word[i] = letter #if found, substitute \"_\" for the letter guessed in the same index for @hidden_word\r\n\t\t\tend\r\n\t\tend\r\n\t\tp @hidden_word #give feedback of results\r\n\tend", "def print_lose\n puts \"Sorry, you made 10 wrong guesses, game over!\"\n puts \"The word was : #{@random_word}\"\n end", "def GetRandomWord(wordArray)\n index = rand(wordArray.size)\n return wordArray[index]\nend", "def get_word\n dictionary_file = '5desk.txt'\n dictionary = File.readlines(dictionary_file)\n until @secret_word.length > 5 && @secret_word.length < 12\n @secret_word = dictionary.sample.rstrip.downcase\n end\n @secret_word\n end", "def get_word(difficulty)\n WORDS.select{|word| word.length == difficulty}.sample\nend", "def guess_word(word)\n won = won?(word)\n @tries_left -= 1 unless won\n won\n end", "def pick_word\n @dictionary = File.readlines('dictionary.txt').map(&:chomp)\n @computer_word = @dictionary.sample\n end", "def letter_guess\n letter = get_letter_player()\n check_letter_in_random_word(@guess_letter)\n if @correct_guess == false\n @failed_attempts += 1\n if @failed_attempts == 10\n @lose = true\n end\n end\n guess_word_status_string = @guess_word_status.join()\n if guess_word_status_string == @random_word\n @win = true\n end\n end", "def setguessword\n\t\t@starting_word.each_index do |index|\n\t\t\t@guessing_word[index]=\"_ \"\n\t\tend\n\t\treturn @guessing_word\n\tend", "def get_new_word(level)\n\t\n\tdict_array_details = array_sort(level)\n\n\tsorted_dict_array = dict_array_details[0]\n\tsorted_dict_lengths = dict_array_details[1]\n\n\tif sorted_dict_lengths[\"end_\" + level.to_s] == nil\n\t message = \"Could not find a #{level} letter word. Try again!\"\n\telse\n \t len = sorted_dict_lengths[\"end_\" + level.to_s] - sorted_dict_lengths[\"start_\" + level.to_s] + 1\n\t offset = sorted_dict_lengths[\"start_\" + level.to_s]\n\n\t no = offset + rand(len)\n\t $word = sorted_dict_array[no].split(\"\")\n\t puts \"Debug: WORD is #{$word.join(\"\").to_s}\"\n\n\t $word.length.times do |i|\n\t \t $guessed_word[i] = \"_\"\n end\t\n $is_get_level = false\n message = \"Word has #{level} letters!\"\n \tend\t\nend", "def lose_game\n print \"Game Over! The word was #{@random_word}!\"\n end", "def pick_secret_word\n\t\t@secret_word = @dictionary.sample.chomp.downcase\n\t\t@secret_word.length\n\tend", "def select_word\r\n\r\n #Define an array of 40 words from which the game will randomly select\r\n words = [\"W I N D O W\", \"S T A T I O N\", \"H A M B U R G E R\",\r\n \"E X P R E S S I O N\", \"W A L L E T\", \"C A M E R A\",\r\n \"A I R P L A N E\", \"C A N D L E\", \"C O M P U T E R\",\r\n \"P I C T U R E\", \"F R A M E\", \"S H E L F\", \"B O W L I N G\",\r\n \"P O L I T E\", \"S T A T E M E N T\", \"N E G A T I V E\",\r\n \"M E T H O D\", \"F I S H I N G\", \"C O M P E N S A T E\",\r\n \"H A P P Y\", \"F O O T B A L L\", \"S A N D W I C H\",\r\n \"I L L U S I O N\", \"S K E L E T O N\", \"S P A G H E T T I\",\r\n \"P H O T O G R A P H\", \"P U R I F Y\", \"O T O M A N\",\r\n \"I N C E N S E\", \"S T A I R C A S E\", \"C O L O S S E U M\",\r\n \"H O N E Y\", \"S C U L P T U R E\", \"M E A T L O A F\",\r\n \"M O T O R C Y C L E\", \"R E V O L U T I O N\", \"B L A N K E T\",\r\n \"S L A U G H T E R\", \"K I T T E N\", \"S T A M P E D E\"]\r\n\r\n #Generate and return a random number between 0 and 39\r\n randomNo = rand(39)\r\n\r\n #Return a randomly selected word to the calling statement\r\n return words[randomNo]\r\n\r\n end", "def given_word(word)\n @guessword = word.to_s.split('')\n end", "def whole_word_guess(input,dead_man)\n guessed_word_array = input.split(//)\n if guessed_word_array == @correct_word_array\n win\n else\n puts \"The word you have guessed is incorrect!\"\n dead_man.wrong_guesses += 1\n display(dead_man) \n end\n end", "def guess_letters\n guess_array = []\n @current_word.each do\n guess_array << \"_\"\n end\n return guess_array\n end", "def feedback(guess_word)\n guessword_array=guess_word.split(\"\")\n [email protected](\"\")\n guessword_array.each do |letter|\n if word_array.include?(letter)\n @result[word.index(letter)]=letter\n end\n end\n puts \"here is your feedback: #{@result}\"\n end", "def get_response\r\n if @letter.size != 1\r\n puts \"Invalid input, try again\"\r\n elsif @secret_word_letters.include? @letter\r\n puts \"Yes! This word does include #{@letter}!\"\r\n elsif @chances > 1\r\n @chances -= 1\r\n puts \"#{@letter} is not a letter in the word. You have #{@chances} guesses left.\"\r\n else\r\n lost\r\n end\r\n end", "def guess\n\t\tcollect_words_of_length\n\t\tputs \"Already guessed letters by computer: #{@guessed_letters}\"\n\t\t@guessing_letter = nil\n\t\twhile @guessing_letter == nil || invalid?(@guessing_letter)\n\t\t\t@guessing_letter = guessing_letter\n\t\tend\n\t\t@guessed_letters << @guessing_letter\n\t\t@guessing_letter\n\tend", "def display_word(word, guesses)\n mask_word = \"\"\n word.chars.each do |char|\n if guesses.include?(char)\n mask_word += char\n else\n mask_word += \"_\"\n end\n end\n return mask_word\nend", "def word_guess\n puts \"\\nYou want to guess the whole word.\"\n print \"Please enter what you think the word is: \"\n word_guess = gets.chomp.upcase\n\n if word_guess == @random_word\n line_of_30_stars\n @win = true\n else\n line_of_30_stars\n puts \"No sorry, #{word_guess} is not right...\"\n @failed_attempts += 1\n if @failed_attempts == 10\n @lose = true\n end\n end\n end", "def initialize(word)\n # This is just some a printout of the game at initialization\n puts \"\n POORMAN's\n ___ ___ ____ ____ __ ____ ___ ___ _____ ____ __\n / / / / / _ | | \\\\ | | / ___\\\\ | \\\\ / | | _ \\\\ \\\\ \\\\_ \\\\ \\ \n / /__/ / / /_| | | |\\\\ \\\\| | | | ___ | |\\\\ \\\\ / /| | | |_\\\\ \\\\ \\\\ \\\\ \\\\ \\\\\n / ___ / / ___ | | | \\\\ | | |__| | | | \\\\ \\\\/ / | | | ___ \\\\ \\\\ \\\\\\\\ \\\\_\\\\ \\\\ \n /__/ /__/ /__/ |_| |_| \\\\__| \\\\____/ |_| \\\\__/ |_| |_| \\\\__\\\\ |_| \\_____|\n \n \"\n\n # instance variables for HangMan Class\n @word = word\n\n ## LOGIC: This is to set the number of guesses based on the length of the word\n if @word.length >= 12\n @guess_count = 9\n elsif @word.length >= 10 && @word.length < 12\n @guess_count = 8\n elsif @word.length >= 8 && @word.length < 10\n @guess_count = 7\n elsif @word.length >= 6 && @word.length < 8\n @guess_count = 6\n else\n @guess_count = 5\n end\n ## End of Logic\n\n @is_correct = false # Flag to see if the guess is correct\n # Nifty code to set a prompt variable with a bunch if underscores\n # Note the length of the underscores matches the length of the word\n @prompt = String.new(str=\"_\") * word.length\n @guess_history = Array.new # A guess history array to store guesses\n end", "def select_word\n @answer = \"\"\n @word = \"\"\n while not is_valid?\n @word = IO.readlines(\"../5desk.txt\")[rand(61405)].chomp\n end\n @word.downcase!\n puts @word\n @word.scan(/./){@answer << '*'}\n puts @answer\n end", "def weighted_random(lastword)\n # If word has no words in its dictionary (last word in source text file)\n # have it pick a random word to display instead.\n @dictionary.dictionary.fetch(lastword, NULL_OBJECT).sample\n end", "def select_word(words)\n word_selected = words[rand(words.length)].strip\n word_selected\n end", "def load_secret_word\n @secret_word = File.readlines('5desk.txt').sample.downcase.strip\n until @secret_word.length > 5 && @secret_word.length < 12\n puts \"Choosing secret word...\"\n @secret_word = File.readlines('5desk.txt').sample.downcase.strip\n end\n @secret_display = %{#{\"_\" * @secret_word.length}} # change this to update based on previous guesses\n end", "def choose_word\n word_index = 0\n loop{\n word_index = rand(@text_file.length.to_i)\n if @text_file[word_index].length.to_i > 4 && @text_file[word_index].length.to_i < 12\n break\n end\n }\n @word = @text_file[word_index]\n end", "def mcw(word)\n\tif $bigrams.has_key? word\n\t\tmax = 0\n\t\tkeys = []\n\t\t$bigrams[word].each do |key, count|\n\t\t\tif count > max\n\t\t\t\tkeys = [key]\n\t\t\t\tmax = count\n\t\t\telsif count == max\n\t\t\t\tkeys << key\n\t\t\tend\n\t\tend\n\n\t\tif keys.length > 1\n\t\t\treturn keys[Random.rand(keys.length)]\n\t\telse\n\t\t\treturn keys[0]\n\t\tend\n\tend\n\treturn \"\"\nend", "def check_letter_in_random_word(guess_letter)\n position_letter = 0\n @correct_guess = false\n @random_word.each_char do |letter_random_word|\n if letter_random_word == guess_letter\n change_guess_word_status(position_letter)\n @correct_guess = true\n end\n position_letter += 1\n end\n if @correct_guess == true\n line_of_30_stars\n puts \"WhoopWhoop: Letter '#{guess_letter}' is in the word!\\n\"\n else\n line_of_30_stars\n puts \"No, sorry, '#{guess_letter}' isn't in the word.\"\n end\n end", "def word_selector\n\t\t@game_word = @word.sample\n\tend", "def buzzword\n sample(translate('faker.company.buzzwords').flatten)\n end", "def guess!(letter)\n self.word.include? letter\n self.letter = letter\n end", "def make_guess(word)\n guess = word.upcase\n \n # If the game is over, let the player know.\n if @guesses_left == 0\n p \"This game is over!\"\n\n # Congratulatory message if they got it.\n elsif guess == @secret_word\n @number_of_guesses += 1\n p \"Congratulations! You got the word in #{@number_of_guesses} guesses!\"\n \n # If they already guessed the word:\n elsif @guessed_words.index(guess) != nil\n p \"You already guessed that word!\"\n p \"The secret word is: \" + feedback(guess)\n return \"You already guessed that word!\"\n\n # Count the guess and provide feedback on it.\n else\n\n @guessed_words.push(guess)\n @number_of_guesses += 1\n @guesses_left -= 1\n \n p \"Correct letters:\"\n p feedback(guess)\n\n # If that was the last guess, let the player know.\n if @guesses_left == 0\n p \"That was your last guess! Game over.\"\n\n else\n get_guesses_left\n \n end # control flow/guessed_word\n end # end control flow/make_guess\n end", "def guess(word_pattern, possible_words)\n all_words = possible_words.flatten\n guess = $avail_letters.sort_by {|c|\n all_words.select{|w|w.index c}.length}.last\n $avail_letters -= [guess]\n $guess = guess\nend", "def guess(letter)\r\n if word_has?(letter)\r\n \tput_letter_on_board(letter)\r\n else\r\n wrong_letter(letter) if [email protected]? letter\r\n end\r\n end", "def guess(word_pattern, possible_words)\r\n all_words = possible_words.flatten\r\n guess = $avail_letters.sort_by {|c|\r\n all_words.select{|w|w.index c}.length}.last\r\n $avail_letters -= [guess]\r\n $guess = guess\r\nend", "def scrambled_words\n print \"Enter a word: \"\n response = gets.chomp\n scrambled_version = response[0] + response[1..-2].chars.shuffle.join + response[-1]\n puts \"Scrambled version: #{scrambled_version}\"\nend", "def random_word\n letters = ('a'..'z').to_a\n word = []\n length = (rand 15) + 1\n \n length.times do\n word << letters[rand(25)] \n end\n\n word.join ''\nend", "def random_capitalized_word\n attempts = 0\n # If you don't find a capitalized word after 15 attempts, just use\n # a lowercase word as there may be no capitals in the dicationary.\n until attempts > 15\n attempts += 1\n words = @dictionary.dictionary.keys\n random_choice = words[rand(words.length)]\n if random_choice[0] =~ /[A-Z]/\n return random_choice\n end\n end\n random_word\n end", "def generate_secret_word\n dictionary = File.open('5desk.txt', 'r').readlines\n legal_words = []\n\n dictionary.each do |line|\n word = line.chomp\n legal_words << word if legal_word?(word)\n end\n\n legal_words.sample\n end", "def guessed_wrong_letter()\n if $hidden_word_arr.exclude?($input)\n $guessed.append($input)\n end\n end", "def output_word\n p @guessedWord\n end", "def start_game\r\n\t puts \"Welcome to Hangman! A secret word has been chosen. You have #{turn_count} guesses to get the word correct. Good luck!\"\r\n\t (@secret_word.size).times { @correct_letters += \"_ \" }\r\n\t puts @correct_letters\r\n\t begin_guessing\r\n\tend", "def choose_word\n input = File.open(\"words.txt\", 'r')\n words = []\n input.readlines.each do |line|\n words.push(line.strip().downcase)\n end\n input.close()\n words[rand(words.length)]\n end", "def guess_letter\n @unused_letters.pop\n end", "def word_with_guesses\n guesses_list = @guesses.to_s\n guesses_rx = /[^ #{guesses_list}]/\n @masked = @word.gsub(guesses_rx, \"-\")\n @masked.scan(/[a-z\\-]/).join\n end" ]
[ "0.79652137", "0.77442485", "0.7551", "0.7517821", "0.7436595", "0.74268794", "0.74098486", "0.7365595", "0.7346129", "0.7307494", "0.7298214", "0.7283181", "0.72830784", "0.72780216", "0.7243165", "0.7234417", "0.72233987", "0.72081923", "0.7200267", "0.71997267", "0.7172983", "0.71429724", "0.7128386", "0.70930433", "0.70817506", "0.7081519", "0.7079271", "0.7075789", "0.7071014", "0.70327884", "0.6976795", "0.69746476", "0.69704777", "0.69617945", "0.6944512", "0.69393", "0.6932541", "0.6930458", "0.6909774", "0.6906228", "0.6905874", "0.68808514", "0.68750525", "0.6861716", "0.68563414", "0.68153757", "0.6791723", "0.6785277", "0.67736924", "0.6772658", "0.67711794", "0.67669386", "0.6761264", "0.6760542", "0.67598593", "0.67502254", "0.67426825", "0.6741998", "0.674191", "0.6721773", "0.6717198", "0.6695583", "0.6690973", "0.66720784", "0.66687864", "0.66667426", "0.66550326", "0.66334254", "0.663161", "0.6617059", "0.66137", "0.6612137", "0.66112196", "0.66043705", "0.66007084", "0.66004413", "0.6593368", "0.6573454", "0.6573098", "0.6569325", "0.65687364", "0.65641034", "0.6551719", "0.6551349", "0.6547574", "0.653741", "0.65343446", "0.6528924", "0.65267164", "0.6519118", "0.65123373", "0.65059197", "0.6497439", "0.64963", "0.6495187", "0.64942384", "0.64937663", "0.64839196", "0.6480066", "0.64714766", "0.6469072" ]
0.0
-1
Check if a game is over
def game_over? if @guesses_left <= 0 message_then_enter "\nSorry. No more guesses left."\ " The word was '#{ @word.capitalize }'." true elsif @word.split('').uniq.length == @hits.length message_then_enter "\nCongratulations...You got the word." true else false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def game_over?\n true\n end", "def over?\n \t@game_over = true\n end", "def gameIsOver\n\t\treturn frameNumber() > @lastFrameNumber\n\tend", "def game_is_over?\n (won? || draw? || full?) ? true : false\n end", "def game_over\n end", "def game_over?\n @game_over\n end", "def game_over\n remaining_player.count == 1\n end", "def game_over?\n return true if victory? || (@turns == 12)\n false\n end", "def is_game_over?\n @guesses_left == 0 ? true : false\n end", "def game_over?\n remaining_players == 1\n end", "def game_over?\n self.lost? || self.won?\n end", "def check_if_lost\n\t\tif @guess_count == @number_guess + 1\n\t\t\t@game_over = 2\n\t\tend\n\t\t@game_over\n\tend", "def game_over?\n @board.game_over?\n end", "def game_over?\n if victory?\n puts \"The code has been broken!\"\n true\n elsif (@turns == 12)\n puts \"The codebreaker failed.\"\n true\n else\n false\n end\n end", "def game_over\n #some end game conditions\nend", "def over?\r\n won? || draw?\r\n end", "def game_over?\n alive_players.count == 1\n end", "def call_gameover\n\t\t@is_gameover = true\n\tend", "def over?\n draw? || won?\n end", "def over?\n draw? || won?\n end", "def game_over?\n\t\t(@board.guesses.key?(12) || @board.guesses.value?(@code)) ? true : false\n\tend", "def game_over?\n shots_remaining <= 0 || board.boats.all?(&:sunk?)\n end", "def game_over?\n return false unless @previous_piece\n\n previous_color = @previous_piece.color == :white ? :black : :white\n no_legal_moves_captures?(previous_color)\n end", "def over?\n won? || full? || draw?\n end", "def game_over?\n @lives == 0\n end", "def is_game_over?\n players.count < 2 ||\n @state == 'stop' ||\n @cards_on_table.count >= Deck.num_cards ||\n (players.map{|p| p.num_cards_remaining == Deck.num_cards}.include? true)\n end", "def over?()\n if won?() || draw?()\n return true\n end\n return false\n end", "def game_is_over(board)\n someone_wins(board) || tie(board)\n end", "def game_over\n [:winner, :tie].include?(board.status)\n end", "def game_over?\n @board.pieces['black'].empty? || @board.pieces['white'].empty? || (@board.moves(HUMAN_PLAYER).empty? && @board.moves(CPU_PLAYER).empty?)\n end", "def over?\n if won?\n return true\n elsif draw?\n return true\n else\n return false\n end\n end", "def over?\n draw? || won?\n end", "def over?\n draw? || won?\n end", "def game_over?\n if $board.has_value?(\"none\") == false then\n puts \"No more turns available\"\n return true\n else\n return false\n end\n end", "def over?\n if draw? || won?\n return true\n else\n return false\n end\n end", "def over?\n draw? || won? ? true : false\n end", "def update_game_over?\r\n # If game over\r\n if $game_temp.gameover\r\n # Switch to game over screen\r\n $scene = Scene_Gameover.new\r\n return true\r\n end\r\n return false\r\n end", "def game_over\n @game_over\n end", "def over?\n if won? || draw? || full?\n true\n end\n end", "def over? \n if draw?\n return true\n elsif won?\n return true\n end\n end", "def over?\n return draw? || won?\n end", "def over?\r\n won? || draw? ? true : false\r\n end", "def over?\n won? || draw? || full?\n end", "def over?\n won? || draw? || full?\n end", "def over?\n won? || draw? || full?\n end", "def over?\n won? || full? || draw?\n end", "def update_gameover?\r\n # If game over\r\n if $game_temp.gameover\r\n # Switch to game over screen\r\n $scene = Scene_Gameover.new\r\n return true\r\n end\r\n return false\r\n end", "def over?\n won? || draw?\n end", "def over?\n won? || draw?\n end", "def is_game_over?; won_by?(:hunter) || won_by?(:prey) end", "def over?\n won? || draw?\n end", "def end_game\r\n @game_over = true\r\n end", "def game_over\n @lives == 0\n end", "def game_over?\n return @gamestate.checkmate?(@current_player.team)\n end", "def game_over?\n method = game_over_method\n return unless method\n\n puts \"Game over by #{method}\"\n method == 'checkmate' ? puts(\"#{@current_player.colour} won!\") : puts(\"It's a draw!\")\n true\n end", "def game_over(won)\n if won\n puts 'The code has been broken! Game over'\n else\n puts 'The code could not be broken! Game over'\n end\n end", "def game_over?\n # Write a if condition - true\n if @lives == 0\n true\n end\n end", "def over?\n won? || draw? || full?\n end", "def over?\n won? || draw?;\n end", "def game_over?\n # puts\n # p @frames.size\n # p @frames[9].last if @frames.size >= 10\n # p @frames[10].last if @frames.size >= 11\n # game_over =\n @frames.size == 10 && !(@frames[9].last =~ /[X\\/]/) ||\n @frames.size == 11 && (@frames[9].last == '/' ||\n (@frames[9].last == 'X' && @frames[10].last != 'X')) ||\n @frames.size == 12 && @frames[9].last == 'X' && @frames[10].last == 'X'\n # p \" game_over: #{game_over}\"\n # game_over\n end", "def game_over?\n if victory?\n @@score[\"Player #{@other_player.mark}\"] += 1\n puts \"\\nBehold the winner - the #{@other_player}!!!\\n\"\n # show_score\n show_score\n true\n elsif @turns == 9\n @@score[:draws] += 1\n puts \"\\nIt's a draw!\\n\"\n # show_score\n show_score\n true\n else\n false\n end\n end", "def over?\n for i in 1..4\n if @figures[0].position == @figures[i].position\n log \"**GAME OVER:** Mr. X was caught - The agents win.\"\n @logger.save\n puts \"Game Over: The agents win\"\n return true\n end\n end\n if @turns > 19\n log \"**GAME OVER:** 20 turns have passed - Mr. X wins.\"\n @logger.save\n puts \"Game Over: Mr. X wins\"\n return true\n end\n return false\n end", "def game_over\n return :winner if winner?\n return :draw if draw?\n false\n end", "def over?\n if won? or draw? or full?\n return true\n else\n return false\n end\n end", "def game_over?\n return true if @game_over\n !find_set && @deck.count < 1\n end", "def check_game_over (guess, code)\n red_orb = give_hint(guess,code)[0]\n white_orb = give_hint(guess,code)[1]\n puts \"Red Orb: #{red_orb}, White Orb: #{white_orb}\"\n (give_hint(guess, code)[0] == 4) ? true : false\n end", "def over?\n if draw? == true or won? != false\n return true\n end\n end", "def check_win\n if @game_board.return_count == 5 and @timer.return_time >= 0\n @win = true\n end\n if @game_board.return_count < 5 and @timer.return_time == 0\n @lose = true\n end\n end", "def outOfGame\n @inGame = false\n end", "def gameover?\n full? or not check_winner.nil?\n end", "def game_over?\n @players.all? {|p| p.last_turn == \"skipped turn\"} || (@letter_bank.empty? && current_player.rack_empty?)\n end", "def is_game_over?\n\t\tif second_team_id.present?\n\t\t\tsecond_game = Game.game_for_week_id_and_team_id(week_id, second_team_id)\n\t\t\treturn pick_game.is_game_over? && second_game.is_game_over?\n\t\tend\n\t\treturn pick_game.is_game_over?\n\tend", "def game_over?\n losing_players != nil ? true: false\n end", "def check_for_game_over\n if @proposed_code == @secret_code && @player_role_selection == 'breaker'\n puts 'YOU WIN!'\n true\n elsif @proposed_code == @secret_code && @player_role_selection == 'maker'\n puts 'COMPUTER WINS!'\n true\n else\n false\n end\n end", "def over?\n if won? != false && won? != nil || draw? == true\n return true\n else\n return false\n end\n end", "def game_over?\n possible_moves(:white).empty? && possible_moves(:black).empty? \n end", "def check_if_won\n\t\tif @word_hidden == @answer_word\n\t\t\t@game_over = 1\n\t\tend\n\t\t@game_over\n\tend", "def game_over?\n (@player1.lives == 0) || (@player2.lives == 0)\n end", "def game_over? \n @player1.is_dead? || @player2.is_dead?\n end", "def over?\n if(!!won?)\n return true\n end\n if(draw?)\n return true\n end\n return false\n end", "def is_end_game?\n @status= \"End\"\n return @board.over?\n end", "def over?\n if draw? || won?\n true\n else \n false\n end\nend", "def over?\n if draw? == true || won? != false\n return true\n elsif full? == false\n return false\n end\n end", "def over?\n draw? || won? || full?\nend", "def isGameOver()\n\t\treturn isBoardFull() ||\n\t\t\t\t\t(!isValidMoveAvailableForDisc(WHITE) &&\n\t\t\t\t\t\t\t\t!isValidMoveAvailableForDisc(BLACK))\n\tend", "def isGameOver()\n\t\treturn isBoardFull() ||\n\t\t\t\t\t(!isValidMoveAvailableForDisc(WHITE) &&\n\t\t\t\t\t\t\t\t!isValidMoveAvailableForDisc(BLACK))\n\tend", "def isGameOver()\n return isBoardFull() ||\n (!isValidMoveAvailableForDisc(WHITE) &&\n !isValidMoveAvailableForDisc(BLACK))\n end", "def over?\n won = won?()\n draw = draw?()\n # Due to the won? method never explicitly returning a true value,\n # the program must instead check if it isn't false.\n if draw == true || won != false\n return true\n else\n return false\n end\n end", "def over?\n if won? || draw? || full?\n true\n else\n false\n end\nend", "def over?\n won? || board.full? || draw?\n end", "def over?\n\t\tdraw? || won?\n\tend", "def game_over?\n @guess == @answer\n end", "def game_over\n return;\nend", "def actions_when_game_is_lost\n puts \"\"\n puts \"GAME OVER\".red\n self.quit_game = true\n end", "def over?\n won? || tied?\n end", "def game_over?\n alive_robots.count == 1\n end", "def over?\n self.player.points == self.board.total_points\n end", "def over?\n\t\tdraw? || won? ? true : false\n\tend", "def did_player_win\n (@purses[@current_player] != 6)\n end", "def game_over?\r\n\r\n\t\t#If the number of guesses is greater or equal to the word length\r\n\t\t# 1. Game is over, let user know they made too many guesses\r\n\t\t# 2. @is_over = true\r\n\t\t#Elsif the board and the word arrays are equal to each other\r\n\t\t# 1. Game is over, player won, let user know\r\n\t\t# 2. @is_over = true\r\n\t\t#Else\r\n\t\t# 1. @is_over = false\r\n\r\n\t\tif @num_of_guesses >= @word_array.length\r\n\t\t\tputs \"Too many guesses! Game over.\"\r\n\t\t\t@is_over = true\r\n\r\n\t\telsif @word_array.join == @board_array.join\r\n\t\t\tputs \"You won the game! Game over.\"\r\n\t\t\t@is_over = true\r\n\t\telse\r\n\t\t\t@is_over = false\r\n\t\tend\r\n\tend", "def ensure_over\n if @frames.length < 10\n raise 'Score cannot be taken until the end of the game.'\n end\n if @frames[9].strike? && @frames.length != 11\n raise 'Game is not yet over, cannot score!'\n end\n end" ]
[ "0.880287", "0.8793957", "0.8166979", "0.81439126", "0.8086534", "0.80566823", "0.8043429", "0.80311227", "0.802161", "0.8012648", "0.79414487", "0.7906905", "0.78784204", "0.7869737", "0.78446007", "0.7836964", "0.77970713", "0.77834433", "0.7761446", "0.7751275", "0.77458894", "0.7730237", "0.7726858", "0.77262497", "0.77159643", "0.7687352", "0.7680895", "0.767945", "0.76780987", "0.7676836", "0.76688504", "0.76573706", "0.76573706", "0.7657286", "0.76526827", "0.7647177", "0.7640579", "0.7639738", "0.76389176", "0.7630233", "0.76287526", "0.7618154", "0.7615766", "0.7615766", "0.7615766", "0.76129854", "0.7612602", "0.76081336", "0.76081336", "0.7601259", "0.75984436", "0.75856465", "0.75824654", "0.7571842", "0.75680476", "0.75595796", "0.75516385", "0.7547633", "0.75470054", "0.753961", "0.7522603", "0.75220096", "0.7505569", "0.7500259", "0.7495547", "0.74909157", "0.74814284", "0.74789536", "0.74651605", "0.7461941", "0.7450125", "0.7422561", "0.74206674", "0.74126184", "0.7407624", "0.74066424", "0.74037474", "0.740291", "0.7382082", "0.7372025", "0.73656195", "0.73631555", "0.73481804", "0.7342154", "0.734108", "0.734108", "0.7339899", "0.7327444", "0.73121977", "0.7305485", "0.73041874", "0.7268819", "0.7257368", "0.7246822", "0.72421", "0.72369057", "0.7230854", "0.7203748", "0.72000074", "0.71961695", "0.7189127" ]
0.0
-1
After a guess is made, make appropriate changes to the game state
def update_game_state guess if @word.include?(guess) @hits << guess else @misses << guess @guesses_left -= 1 end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def computer_guess_turn\n feedback_engine\n sleep 2.5\n puts \"The computer is thinking...\"\n computer_change_guess\n puts \"Guess Board: #{@guess_board.state}\"\n end", "def guess\n state, cell, value = @alternatives.pop\n grid.set(state)\n cell.value = value \n true\n end", "def update_current_state(guess)\n start = 0\n while (i = @secret_word.index(guess, start)) != nil\n @current_state[i] = guess\n start = i + 1\n end\n @current_state\n end", "def play_game\n \twhile true\n \t\[email protected]_game_state(@word, @misses, @hits, @guesses_left)\n \t\tbreak if game_over?\n \t\tguess = get_guess\n \t\tbreak if guess == :save\n \t\tupdate_game_state guess\n \tend\n \tsave_game if guess == :save\n\tend", "def guess(guess,event)\n case @status\n when :new, :finished\n 'You need to start a game first: `!rfk start`'\n when :running\n if guess == @kitten\n # We currently get a warning trying to send a message and add a reaction\n # [WARN : ct-3 @ 2018-02-26 17:49:52.182] Locking RL mutex (key: [:channels_cid_messages_mid_reactions_emoji_me, 417679731291324417]) for 1.0 seconds preemptively\n #event.message.react('😸') # Smiley Cat\n @status=:finished\n \"#{event.message.author.mention} Woo you found kitten\"\n elsif @guesses.include?(guess)\n \"#{event.message.author.mention} someone already guessed `#{guess}`, the kitten doesn't move during a game\"\n else\n @guesses << guess\n \"#{event.message.author.mention} You found `#{@nki[guess]}` but that's not a kitten!\"\n end\n else\n puts \"We got a guess of #{guess} but not in a known state of #{@state}\"\n \"Wibble not sure what's happening here\"\n end\n end", "def game_set_up\n counter = 0\n correct = 0\n wrong = 0\n states = data[:states]\n\n states.each{|x| x.store(:correct, 0)}\n states.each{|x| x.store(:guesses, 0)}\n\n def start_round(states, counter, correct, wrong)\n states_mixed = states.shuffle\n\n states_mixed.each do |state|\n puts \"what is the capital of #{state[:name]}\"\n input = gets.chomp\n if input == state[:name]\n puts \"That is correct, the capital of #{state[:name]} is: #{state[:capital]}\"\n p '---------------'\n state[:correct] += 1\n state[:guesses] += 1\n p \"out of #{state[:guesses]} guesses you got #{state[:correct]} correct\"\n\n counter += 1\n correct += 1\n\n else\n puts \"Sorry that is not the correct capital of #{state[:name]} actually it is: #{state[:capital]}\"\n p '---------------'\n state[:guesses] += 1\n p \"out of #{state[:guesses]} guesses you got #{state[:correct]} correct\"\n\n\n counter += 1\n wrong +=1\n end\n\n p '_______________'\n\n end\n p \"This game you got #{correct} correct and #{wrong} incorrect\"\n\n p \"Would you like to play again? if yes press 'y' if no press 'n'\"\n another = gets.chomp\n\n another == 'y' ? start_round(states, counter, correct, wrong) : return\n\n end\n start_round(states, counter, correct, wrong)\n\nend", "def play_game \n\n @number_guesses = 0\n @start_time = Time.now\n puts \"I have generated a secret code, a sequence of four colors: (R)ed, (G)reen, (B)lue, and (Y)ellow\"\n\n game_over = false \n\n until game_over \n \n guess = get_guess\n\n exit_game if guess.upcase == \"Q\" \n guess = @secret_code if guess.upcase == \"C\" # provide option to cheat\n\n if validate_guess(guess)\n @number_guesses += 1\n # add_guess_to_history(guess_report(guess))\n display_history(guess)\n\n if guess.upcase == @secret_code\n game_over = true \n end_game\n else\n puts \"Please guess again.\" \n end\n end\n end\n end", "def make_guess(guess)\n @previous_guesses << guess \n display_string = show_progress()\n if !goal_word.include?(guess) \n guess_counter()\n end \n if display_string == @goal_word\n @player_won = true \n end\n end", "def guess(input)\n @last_guess = input\n compare(input)\n @turns += 1\n end", "def guess(input)\n @last_guess = input\n compare(input)\n @turns += 1\n end", "def turn()\n\tguess = \"\"\n\tif @human_is_guessing == true\n\t\tputs \"Enter your guess for the secret code\"\n\t\tguess = gets.chomp\n\t\twhile guess.length != 4 || (guess =~ /[^0-5]/)\n\t\t\tputs \" Please enter guess again. Remember it must be 4 numbers and only consist of values 0-5.\"\n\t\t\tguess = gets.chomp\n\t\tend\n\telse #computer is guessing\n\t\t#random guess from array of viable solutions.\n\t\tguess = @solutions.delete_at(rand(@solutions.length)).join.to_s\n\t\t\tputs \" I guess \" + guess\n\t\tend\n\t\tset_guess(guess)\n\t\t@score = compare_guess(guess)\n\t\tputs \"You have correctly guessed \" + @colors_correct.to_s + \" out of 4 digits in the code\" + \" and have \" + @placed_correct.to_s + \" in the right place.\"\n\t\[email protected]_if {|x| compare_guess(x.join.to_s, @guess) != @score }\n\t\t@turns += 1\n\tend", "def use_guess\n @guesses -= 1\n end", "def guess_feedback(guess)\n temp_hidden_code = []\n if @game_type_choice == \"cb\"\n temp_hidden_code.concat(@hidden_code)\n else\n temp_hidden_code.concat(@player_hidden_code)\n end\n for i in 0..3\n if guess[i] == temp_hidden_code[i]\n guess[i] = \"black\"\n temp_hidden_code[i] = \"taken\"\n end\n end\n for i in 0..3\n if temp_hidden_code.index(guess[i]) != nil\n temp_hidden_code[temp_hidden_code.index(guess[i])] = \"taken\"\n guess[i] = \"white\"\n end\n end\n for i in 0..3\n if guess[i] != \"black\" && guess[i] != \"white\" \n guess[i] = \"blank\" \n end\n end\n guess\nend", "def game\n game_mode \n set_solution\n until (@turns_left < 1 || @winner)\n guess\n checker\n @turns_left -= 1\n status\n end\n end", "def guessed\n\n end", "def reset_game\n\t\t\t@word = @@dictionary.sample.downcase[0..-3] #strips away \\r and \\n characters\n\t\t\t@guesses = 5\n\t\t\t@guess_map = Array.new(@guesses) {false}\n\t\t\t# puts @guess_map\n\t\tend", "def computer_change_guess\n changed_board = @guess_board.state\n @guess_board.state.each_with_index do |x, i|\n if @feedback_board.state[i] == 'Black'\n changed_board[i] = x\n next\n elsif @feedback_board.state[i] == 'White'\n @feedback_board.state.each_with_index do |y, j|\n if y == nil\n changed_board[j] = x\n changed_board[i] = nil\n @feedback_board.state[j] = 1\n break\n end\n if y == 'White' && j != i\n changed_board[j] = x\n changed_board[i] = nil\n @feedback_board.state[j] = 1\n break\n end\n end\n else\n loop do\n random_num = rand(1..@color_count).to_s\n if !(changed_board.include?(random_num))\n changed_board[i] = random_num\n break\n end\n end\n @feedback_board.state[i] = 1\n end\n end\n changed_board.each_with_index do |z, k|\n if z == nil\n loop do\n random_num = rand(1..@color_count).to_s\n if !(changed_board.include?(random_num)) && !(@guess_board.state.include?(random_num))\n changed_board[k] = random_num\n break\n end\n end\n end\n end\n @guess_board.state = changed_board\n end", "def make_guess(pos) #\n # byebug\n puts \"#{pos}\"\n current_value = @board.reveal(pos)\n @computer.memorize_card(pos, current_value) unless @computer.nil?\n if @previous_guess.nil?\n @computer.current_value = current_value if @current_player.is_a? AIPlayer\n @previous_guess = pos\n else\n if current_value != @board.reveal(@previous_guess)\n display_toggle\n @board[@previous_guess].hide\n @board[pos].hide\n @previous_guess = nil\n return false\n else # there is a match\n @current_player.score += 1\n @computer.memorize_match_card(@previous_guess, pos) unless @computer.nil?\n end\n # Refresh the current game for a new first guess\n @previous_guess = nil\n end\n true\n end", "def turn\n\t\toutputStatus\n\t\tif @guesses_left < 10\n\t\t\tsaveGame if save?\n\t\tend\n\t\tletter = getLetter\n\t\tif checkLetter(letter)\n\t\t\treplaceLetter(letter)\n\t\telse\n\t\t\twrongGuess(letter)\n\t\tend\n\tend", "def check_if_lost\n\t\tif @guess_count == @number_guess + 1\n\t\t\t@game_over = 2\n\t\tend\n\t\t@game_over\n\tend", "def correct_guess(guess)\n end", "def update_feedback(guess)\n\t\tguess.split('').each do |guess_letter|\n\t\t\[email protected] do |target|\n\t\t\t\tif target[0] == guess_letter\n\t\t\t\t\ttarget[1] = true\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tall_true_check = true\n\t\[email protected] do |x|\n\t\t\tif !x[1]\n\t\t\t\tall_true_check = false\n\t\t\tend\n\t\tend\n\t\tif all_true_check\n\t\t\t@win = true\n\t\t\t@is_over = true\n\t\tend\n\tend", "def process_guess(guess)\n\t\t\tunless @secret.include? guess\n\t\t\t\tputs \"Bad guess...\"\n\t\t\t\t@bad_guesses << guess\n\t\t\t\t@guesses -= 1\n\t\t\t\t@drawing[@bad_guess_count+1] = @drawing_animation[@bad_guess_count]\n\t\t\t\t@bad_guess_count += 1\n\t\t\tend\n\n\t\t\twhile @secret.include? guess\n\t\t\t\t@fill_in_word[@secret.index(guess) * 2] = guess\n\t\t\t\t@secret[@secret.index guess] = \" \"\n\t\t\tend\n\t\tend", "def guessing_for_the_win(letter)\n\t\tif repeat_guess(letter)\n\t\telsif guess_correct(letter)\n\t\telse wrong_guess(letter)\n\t\tend \n\n\t\tif @secret_word == @display\n\t\t\tcongrats\n\t\telsif @number_of_guesses > 0 \n\n\t\t\tp \"Keep guessing\"\n\t\telse\n\t\t\tfailure\n\t\tend\n\tend", "def game_play\n until game_over\n graphic\n guess\n end\n end", "def run(strategy, game)\n strategy.newGame\n while game.gameStatus == :KEEP_GUESSING\n #puts game\n guess = strategy.nextGuess(game)\n #puts guess\n guess.makeGuess(game)\n end\n puts game\n game.currentScore\nend", "def guess(guess)\n \t@guess = guess\n\n \tguess_response\n end", "def update_status(guesses) \n \t_count = 0\n \tguesses.each do |guess|\n \t\tif (guess.status == \"hit\") && (self.is_at(guess.x, guess.y))\n \t\t\t_count += 1\n \t\tend\n \tend\n\n \tself.status = _count === self.size ? \"sunk\" : \"safe\"\n\n \tself.status\n end", "def try_guess(guess)\n if !is_repeated_guess(guess)\n deduct_available_guesses\n add_to_previous_guesses(guess)\n end\n\n if guess.length > 1\n @secret_word == guess ? @is_over_won = true : false\n elsif guess.length > 0\n if @secret_word.include? guess\n update_current_state(guess)\n !is_word_complete() ? true : @is_over_won = true\n else\n false\n end\n else\n false\n end\n end", "def guess(guess)\r\n\t\t# Make sure the guess is either a letter or the whole word\r\n\t\tif guess.length != 1 && guess.length != @win_word.length\r\n\t\t\tp @remaining_guesses.to_s + \" guesses left\"\r\n\t\t\tp \"Guess a letter, or the complete word!\"\r\n\t\t# check for repeated guesses\r\n\t\telsif @past_guesses.include? guess\r\n\t\t\tp @remaining_guesses.to_s + \" guesses left\"\r\n\t\t\tp @hint\r\n\t\t\tp \"You guessed that already!\"\r\n\t\t# check if they guessed the entire word correctly\r\n\t\telsif guess == @win_word\r\n\t\t\twin\r\n\t\t# if the letter is not in the word\r\n\t\telsif !@win_word.include? guess\r\n\t\t\t# Add guess to arrayof past guesses\r\n\t\t\t@past_guesses << guess\r\n\t\t\tif @remaining_guesses == 1\r\n\t\t\t\tlose\r\n\t\t\telse\r\n\t\t\tguesses_remaining\r\n\t\t\tp @remaining_guesses.to_s + \" guesses left\"\r\n\t\t\tp @hint\r\n\t\t\tp \"Sorry, try again!\"\r\n\t\t\tend\r\n\t\t# if the letter is in the word\r\n\t\telsif @win_word.include? guess\r\n\t\t\t# Add guess to arrayof past guesses\r\n\t\t\t@past_guesses << guess\r\n\t\t\tguesses_remaining\r\n\t\t\tp @remaining_guesses.to_s + \" guesses left\"\r\n\t\t\tupdate_hint(guess)\r\n\t\t\tif @hint_str == @win_word\r\n\t\t\t\twin\r\n\t\t\telse\r\n\t\t\t\tp \"Nice guess!\"\r\n\t\t\tend\r\n\t\telse\r\n\t\t\tp \"Error\"\r\n\t\tend\r\n\r\n\tend", "def make_guess(word)\n raise_if_complete\n\n correct = word.downcase == password.word\n guesses.create!(word: word, correct: correct)\n self.game_state = 'lost' if lives_left.zero?\n self.game_state = 'won' if correct\n save!\n correct\n end", "def play\n puts \"I have generated a beginner sequence with four elements made up of: (r)ed,\n (g)reen, (b)lue, and (y)ellow. Use (q)uit at any time to end the game.\n What's your guess?\"\n mastermind = Game.new\n mastermind.game_solution\n amount_of_guesses = 0\n guess = gets.chomp\n user_guess = []\n user_guess << guess.chars\n amount_of_guesses += 1\n mastermind.check_for_correct_letters(user_guess)\n mastermind.check_for_correct_indexes(user_guess, mastermind.solution)\n until guess == \"q\"\n if guess == \"c\"\n puts \"The solution is #{mastermind.solution}\"\n break\n elsif guess.length > 4\n puts \"Your guess was too long.\"\n elsif guess.length < 4\n puts \"Your guess was too short.\"\n elsif guess != mastermind.solution\n puts \"You had #{mastermind.correct_letters} correct colors with #{mastermind.correct_indexes}\n in the correct position.\"\n break\n elsif guess == mastermind.solution.to_s\n \"You won! You guessed #{guess}. You had #{mastermind.correct_letters} correct\n colors in #{mastermind.correct_indexes} correct positions.\n You guessed #{amount_of_guesses.to_s} times.\"\n break\n else\n puts \"Goodbye, quitter.\"\n end\n end\nend", "def update_round(guess)\n if @word_array.include?(guess)\n @word_array.each_with_index do |letter, index|\n @word_array_player[index] = letter if guess == letter\n end\n else\n @errors_left -= 1\n end\n @letters_guessed.push(guess)\n end", "def guess(game)\n turn = nil\n\n # Wenn die moeglichen Kombinationen noch nicht berechnet wurden\n if @possible_turns.empty?\n @possible_turns = generate_all_possible_turns(game.setting_code_length, game.setting_code_range)\n end\n\n \n # Wenn noch kein Zug gemacht wurde, einen Zufaelligen aussuchen\n if !game.turns.empty?\n # Es wurde bereits ein Zug gemacht und daher muss ein Ergebnis vorliegen.\n # Jetzt werden die Unmoeglichen Codes entfernt\n\n working_set = @possible_turns.clone()\n last_turn = game.turns.last\n\n # Falls keine Zahl vorkam, alle entfernen die diese ziffern enthalten\n # Also: Wenn der letzte Zug das Ergebnis: WH = 0 und BH = 0 hatte, dann kann keine der Ziffern, Teil der Loesung sein\n if last_turn.white_hits == 0 && last_turn.black_hits == 0\n print talking?() ? \"KI: Oh no! I can do better!\\nThinking...\" : \"\"\n #Dafuer jede Moeglichkeit durchgehen\n @possible_turns.each do | one_possible_code |\n\n # Und pruefen ob einer der Ziffern im letzten Zug vorkam. Falls ja, ganze Moeglichkeit entfernen\n one_possible_code.each do |value|\n if last_turn.code.include?(value)\n print talking?() ? \".\" : \"\"\n working_set.delete(one_possible_code)\n break\n end\n end # Ziffern abgeglichen\n\n end # Moeglichkeiten durchsucht\n @possible_turns = working_set\n end # Alle entfernt, die mindestens eine Ziffer enthielten (da WH = 0 und BH = 0)\n\n # Zweite Block:\n # Falls mindestens ein Hit, dann alle Codes entfernen, die nicht mehr in Frage kommen\n if (last_turn.white_hits + last_turn.black_hits) > 0\n print talking?() ? \"KI: Hm. I need to think about it...\" : \"\"\n @possible_turns.each do | one_possible_code |\n # Jeden Durchgehen\n counter = 0\n one_possible_code.each do |value|\n if last_turn.code.include?(value)\n counter +=1\n end\n end\n\n # Wenn nicht genuegend treffer mit dieser Moeglichkeit moeglich sind, dann Diese entfernen\n if counter < (last_turn.white_hits + last_turn.black_hits)\n working_set.delete(one_possible_code)\n print talking?() ? \".\" : \"\"\n end\n\n end\n @possible_turns = working_set\n\n end\n\n \n # Jetzt die Blackhit auswertung vornhemen\n if( last_turn.black_hits > 0 )\n # Bei Blackhits sind deutlich weniger moeglichkeiten Uebrig, als bei white Hits, daher wird hier eine \n # Liste mit den Restlichen erstellt\n remaining_possibilities = []\n\n # Wie bei der Allgemeinen Hit Verabrietung, alle Moeglichkeiten durchgehen\n @possible_turns.each do | possible |\n\n hitcount = 0\n possible.each_with_index do | value, index |\n if possible[index] == last_turn.code[index]\n hitcount += 1\n end\n end\n\n # Und nur die Speichern, bei denen die gleichen Blackhits moeglich waeren\n if hitcount >= last_turn.black_hits\n remaining_possibilities.push(possible)\n print talking?() ? \".\" : \"\"\n end\n end\n \n # Die moeglichen Zuege durch die verbleibenden moeglichen ersetzen\n @possible_turns = remaining_possibilities\n\n end\n\n end\n\n if talking?() \n puts \"\\nKI: Sooo... There are #{@possible_turns.size()} possibilities left...\\n\"\n end\n \n turn_index = rand(0..(@possible_turns.size() -1))\n turn = Turn.new(@possible_turns[turn_index])\n # Den Zug aus den Moeglichkeiten fuer die naechste Runde entfernen\n @possible_turns.delete(turn.code)\n\n if talking?() \n puts \"KI: I'll try with: #{turn.code.to_s()}\"\n end\n\n return turn\n end", "def game_play\n find_word\n board\n load_game?\n if @confirm != 'y'\n game_intro\n end \n until game_end? || @incorrect_guess == 8 \n #p @the_word\n guess\n incorrect_guess?\n hang_man_figure\n update_board\n save?\n end\n if game_end? != true\n puts \"\\n\" * 100\n hang_man_figure\n update_board\n puts \"SORRY, YOU LOST!!\" \n puts \"\\n\"\n puts \"The word was....#{@the_word.upcase}!!\"\n exit\n elsif game_end? == true\n puts \"\\n\" * 100\n hang_man_figure\n update_board\n puts \"OMG!\"\n puts \"#{@the_word.upcase} is the word!\"\n puts \"YOU WIN!!! =)\"\n puts \"******!*******!*****!*******!*****!*****!\"\n exit\n end\nend", "def make_guess\n puts \"Make a guess:\"\n @current_guess = gets.chomp\n unless good_guess?\n puts \"That is an invalid guess, please try again!\"\n @current_guess = gets.chomp\n end\n puts\n guesses << current_guess unless current_guess == \"save\" || current_guess == secret_word\n end", "def player_guess\n print \"What four colours do you think? turns:#{@turns}\\n\"\n @current_guess = gets.chomp.split(\" \")\n #check input has been correctly inputed\n if input_correct?(@current_guess) == false\n print \"Incorrect input please try again you still have #{@turns} left\\n\"\n player_guess\n #Does the guess match the hidden code\n elsif correct_guess?(@current_guess)\n print \"Correct the hidden code was: #{@current_guess}\"\n #Has the player run out of turns\n elsif @turns<=0\n print \"Sorry no more turns left the hidden code was: #{@hidden_code}\"\n else\n @turns -= 1\n @guess_array.push(@current_guess.join(\" \").split(\" \"))\n print_board(@current_guess)\n player_guess\n end\nend", "def update_guess_count\n @guess_count > 0 ? @guess_count -= 1 : @guess_count\n end", "def save_guess\n if good_guess?\n matching_indexes(@code_word, @word_guesser.guess).each do |i|\n @good_guesses[i] = @word_guesser.guess\n end\n else\n @bad_guesses.push(@word_guesser.guess)\n end\n end", "def begin_guessing\r\n\t while @turn_count > 0 do\r\n\t puts \"\\nPlease enter 'guess' if you would like to guess the word. Otherwise, please enter a single letter guess.\"\r\n\t guess_input = gets.chomp\r\n\t\t\r\n\t\t# Handles the case if the user wants to guess the word\r\n\t\tif guess_input.downcase == \"guess\"\r\n\t\t puts \"\\nPlease enter your guess.\"\r\n\t\t full_guess = gets.chomp\r\n\t\t full_guess.downcase!\r\n\t\t if full_guess == @secret_word \r\n\t\t win_game \r\n\t\t else \r\n\t\t @turn_count -= 1\r\n\t\t puts \"\\nIncorrect guess.\"\r\n\t\t\tend_turn\r\n\t\t end\r\n\t\t \r\n\t\t# Handles the case if the user wants to guess a letter\r\n\t\telse\r\n\t guess_letter = guess_input[0].downcase\r\n\t game_board(guess_letter)\r\n\t\tend\r\n\t end\r\n\t lose_game if @turn_count == 0\r\n\tend", "def game_state_update(parsed_state)\n\t\tgame_state = nil\n\t\[email protected] do\n\t\t\tif parsed_state['player_data'] and my_data = parsed_state['player_data'][@player_id.to_s]\n\t\t\t\thand = decrypt_hand(my_data['hand'])\n\t\t\t\t@hand_hash[parsed_state['hand_number']] = hand\n\t\t\t\t@seat_number = my_data['seat_number']\n\t\t\t\t@bankroll = my_data['player']['bankroll']\n\t\t\telse\n\t\t\t\thand = @hand_hash[parsed_state['hand_number']]\n\t\t\tend\n\t\t\tgame_state = GameState.new(parsed_state, @player_id, hand)\n\t\tend\n\t\[email protected] do\n\t\t\tself.display_game_state(game_state) if self.respond_to?(:display_game_state)\n\t\t\tif game_state.is_acting_player? and game_state.hand\n\t\t\t\tbegin\n\t\t\t\t\t#Timeout.timeout(game_state.timelimit) do\n\t\t\t\t\t\tmove = ask_for_move(game_state)\n\t\t\t\t\t\tmove = 'fold' unless move\n\t\t\t\t\t\tmake_move(game_state, move)\n\t\t\t\t\t#end\n\t\t\t\t#rescue Timeout::Error\n\t\t\t\t\t#puts \"Took too long to make a move, folding\"\n\t\t\t\trescue\n\t\t\t\t\tputs \"Error: #{$!.inspect}\"\n\t\t\t\t\tpp $!.backtrace\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "def update_game(prize)\n action = bot_action\n\n if last_turn?\n prize[:final] = true\n prize[:action] = \"OPENED\"\n prize[:stolen] = false\n @game[prize[:id]] = prize\n elsif action == \"open\"\n prize[:finished] = true\n prize[:action] = \"OPENED\"\n prize[:stolen] = false\n @game[prize[:id]] = prize\n elsif action == \"steal_bot\"\n # Grab random index from array where finished\n random = [*0..finished_count - 1]\n random = random - [winner_prize[:id]] if winner_prize[:id] < finished_count\n index = random.sample\n bot_prize = @game[index]\n #set action\n prize[:action] = \"STOLEN\"\n bot_prize[:action] = \"DECIDING...\"\n #swap prizes\n temp_prize = prize[:prize]\n prize[:prize] = bot_prize[:prize]\n bot_prize[:prize] = temp_prize\n # set status\n prize[:finished] = true\n bot_prize[:finished] = false\n prize[:stolen] = false\n bot_prize[:stolen] = true\n #set game\n @game[prize[:id]] = prize\n @game[index] = bot_prize\n\n prize = bot_prize\n else\n # Grab index of user from array\n index = @game.find_index{ |item| !item[:bot]}\n bot_prize = @game[index]\n #set action\n prize[:action] = \"STOLEN\"\n bot_prize[:action] = \"DECIDING...\"\n #swap prizes\n temp_prize = prize[:prize]\n prize[:prize] = bot_prize[:prize]\n bot_prize[:prize] = temp_prize\n # set status\n prize[:finished] = true\n bot_prize[:finished] = false\n prize[:stolen] = false\n bot_prize[:stolen] = true\n #set game\n @game[prize[:id]] = prize\n @game[index] = bot_prize\n\n prize = bot_prize\n end\n\n cache.write(@key, @game, expires_in: 24.hours)\n prize\n end", "def play_game\r\n\r\n #Call on the generate_number method in order to get a random number\r\n number = generate_number\r\n $noOfGuesses = 0 \r\n\r\n #Loop until the player inputs a valid answer\r\n loop do\r\n \r\n Console_Screen.cls #Clear the display area\r\n \r\n \r\n\r\n if $noOfGuesses > $maxGameGuesses then\r\n print \"You exceeded the allowed number of guesses of \" + $maxGameGuesses.to_s + \".\"\r\n print \"\\nYou lose! Please try again.\"\r\n print \"\\n\\nPress enter to continue.\"\r\n Console_Screen.pause \r\n break\r\n end\r\n\r\n if $cheatMode == true then\r\n print \"\\nShh.... the answer is \" + number.to_s \r\n end\r\n\r\n #Prompt the player to make a guess\r\n print \"\\n\\nEnter your guess and press the Enter key: \"\r\n \r\n \r\n reply = STDIN.gets #Collect the player's answer\r\n reply.chop! #Remove the end of line character\r\n\r\n reply = reply.to_i\r\n\r\n if reply < 1 || reply > $maxChallengeRange then\r\n Console_Screen.cls\r\n print \"\\nInvalid entry. Please enter a number between 1 and \" + $maxChallengeRange.to_s\r\n print \"\\n\\nPlease press enter to continue.\"\r\n Console_Screen.pause\r\n redo #Redo the current iteration of the loop\r\n end\r\n \r\n $noOfGuesses = $noOfGuesses + 1\r\n \r\n #Analyze the player's guess to determine if it is correct\r\n if reply == number then #The player's guess was correct\r\n Console_Screen.cls #Clear the display area\r\n print \"You have guessed the number! Press enter to continue.\"\r\n Console_Screen.pause #Pause the game\r\n break #Exit loop\r\n elsif reply < number then #The player's guess was too low\r\n Console_Screen.cls #Clear the display area\r\n print \"Your guess is too low! Press Enter to continue.\\n\\n\"\r\n Console_Screen.pause #Pause the game\r\n elsif reply > number then #The player's guess was too high\r\n Console_Screen.cls #Clear the display area\r\n print \"Your guess is too high! Press Enter to continue.\\n\\n\"\r\n Console_Screen.pause #Pause the game\r\n end\r\n\r\n \r\n \r\n end\r\n\r\n end", "def process_guess(letter)\n\n\t\tletter = letter.downcase\n\n\t\tif @prev_guesses.include? letter\n\t\t\tputs \"\\\"#{letter}\\\" has already been guessed\"\n\t\t\tprint_status\n\t\t\treturn false \n\t\telse\n\t\t\t@prev_guesses << letter\n\t\t\tdecrement_guesses\n\t\tend\n\n\t\tif @original_word.include? letter\n\t\t\tupdate_gameboard(letter)\n\t\t\tprint_status\n\t\t\ttrue\n\t\telse\n\t\t\tprint_status\n\t\t\tfalse\n\t\tend\n\tend", "def make_guess\n guess = input_guess\n check_guess(guess)\n render_code(guess)\n render_pegs(@black_pegs, @white_pegs)\n end", "def round\n show_guess\n show_lives\n show_bank\n puts ''\n set_letter(ask_letter)\n add_to_bank\n add_to_guess\n take_life unless check_choice\n end", "def start_game(states,capitals,correct,incorrect)\n50.times do\n question = rand(0..50)\n puts \"what is the Capitol of \" + states[question]\n answer = gets.chomp\n if answer == capitals[question]\n \t puts \"You ROCKSTAR!\"\n correct += 1\n puts \"You have #{correct} correct answer(s) so far - and #{incorrect} incorrect answer(s)\"\n check_finish(states,capitals,correct,incorrect)\n else\n \t puts \"Learn our map... you UNPATRIOT!\"\n incorrect +=1\n puts \"You have #{incorrect} incorrect answer(s) so far - and #{correct} correct answer(s)\"\n check_finish(states,capitals,correct,incorrect)\n end\n end\nend", "def current_state\n Display.hangman(@lives)\n puts @hints.join('.')\n Display.errors(@incorrect)\n end", "def play_new_game\n #get new code word\n @word_master.choose_code_word\n @code_word = @word_master.code_word\n @good_guesses = Array.new(@code_word.length, '_ ')\n #tells you rules\n puts \"Try to figure out the word. If you guess 6 wrong letters, you lose!\"\n #starts playing\n game_loop\n end", "def game_play\n self.new_round # Start new round\n loop do\n puts \"Your Guess:\"\n @input = gets.chomp # Gets user input by making a prompt and capturing the input, chomp method removes the new line which would otherwise be stored in the input string\n if @input != \"/\"\n if @@word.legal?(@input)\n if self.check_guess\n puts \"Correct! You got the answer in #{@guess_count} guesses!\" # Use string interpolation instead of concatenating to include guess count\n\n self.new_round\n puts @current_word\n end\n puts \"You have #{MAX_GUESS - @guess_count} guesses remaining.\\n?????\" # Calculations can be made in string interpolation too\n else\n puts \"That guess doesn't count! Your guess can only be 5 characters in length, contain no duplicate letters and only contain letters.\" # Guess isn't a legal word\n end\n self.check_lost # Check if player has exhausted amount of guesses\n else\n exit\n end\n\t\tend\n\tend", "def guess\n puts \"Write down a guess.\"\n @guess_code.make_seq\n @code_seq = guess_code.sequence\n end", "def guess()\n\n # Hier gibt es keine While Schleife, damit der Benutzer die Moeglichkeit hat, zwischendurch das Cheat Kommando auszufuerehn\n # und dadurch in eine andere Methode zu springen\n begin\n puts \"\\nYou have #{@game.turns_left} turns left\\n\\n\"\n turn = @game.do_turn(@game.player_breaker.guess(@game))\n puts \"\\nReturned #{turn.to_s()} \"\n\n rescue TypeError, RuleViolationError => err\n # Anzeigen des Problems\n puts \"########################################\"\n puts \"Ups! #{err}\"\n puts \"########################################\"\n end\n\n end", "def guess(guess)\n \t@guess = guess\n \treturn :correct if solved?\n \t@guess > @answer ? :high : :low\n end", "def check_guess(guess,answer,win)\n\tif win != true #If the player has not won yet\n\t@@answer = \"X\" \n\t\tif @@turns == 0\n\t\t\t@@answer = @@secret_number\n\t\t\t@@secret_number = rand(100)\n\t\t\t@@turns = 5\n\t\t\t@@color = \"white\"\n\t\t\treturn \"GAME OVER!\"\n\t\telsif @@turns != 0\n\t\t\tif guess > 100 or guess < 0\n\t\t\t\t@@turns -= 1\n\t\t\t\treturn \"Invalid input!\"\n\t\t\telsif (guess - answer).abs <= 5 and (guess - answer).abs != 0\n\t\t\t\t@@turns -= 1\n\t\t\t\t@@color = \"#ff9999\"\n\t\t\t\treturn \"You're very close!\"\n\t\t\telsif (guess - answer).abs == 0\n\t\t\t\twin = true\n\t\t\t\t@@color = \"#b2ffb2\"\n\t\t\t\t@@answer = @@secret_number\n\t\t\t\t@@turns = 5\n\t\t\t\t@@secret_number = rand(100)\n\t\t\t\treturn \"You Won! Congrats.\"\n\t\t\telsif (guess - answer).abs <= 10\n\t\t\t\t@@turns -= 1\n\t\t\t\t@@color = \"#ff7f7f\"\n\t\t\t\treturn \"You're close!\"\n\t\t\telsif (guess - answer).abs <= 15\n\t\t\t\t@@color = \"#ff4c4c\"\n\t\t\t\t@@turns -= 1\n\t\t\t\treturn \"Not very close!\"\n\t\t\telsif (guess - answer).abs > 15\n\t\t\t\t@@color = \"#ff0000\"\n\t\t\t\t@@turns -= 1\n\t\t\t\treturn \"You're hopeless!\"\n\t\t\tend\n\t\tend\t\n\telsif win == true\t#If the player won!\n\t\t@@answer = @@secret_number\n\t\t@@secret_number = rand(100)\n\t\t@@turns = 5\n\t\treturn \"You Won!\"\n\tend\nend", "def play_game(value)\r\n\r\n #Call on the generate_number method in order to get a random number\r\n number = generate_number \r\n\r\n\tif value == \"c\"\r\n\t\tConsole_Screen.cls\r\n\t\tputs \"\\n\\nCHEAT MODE: secret number is \" + number.to_s \r\n\t\tConsole_Screen.cls\r\n\tend\r\n\t\r\n #Loop until the player inputs a valid answer\r\n loop do\r\n \r\n Console_Screen.cls #Clear the display area\r\n \r\n #Prompt the player to make a guess\r\n print \"\\nEnter your guess and press the Enter key: \"\r\n \r\n reply = STDIN.gets #Collect the player's answer\r\n reply.chop! #Remove the end of line character\r\n reply = reply.to_i #Convert the player's guess to an integer\r\n \r\n\t #Increment Guesses Variable\r\n\t $noOfGuesses += 1\r\n\t\r\n #Validate the player's input only allowing guesses between 1 and 100\r\n if reply < 1 or reply > 1000 then\r\n\t \r\n\t\tConsole_Screen.cls #clear screen\r\n\t\t\r\n\t\tputs \"\\nInvalid input was entered!\"\r\n\t\tprint \"\\n\\Only use numbers from 1 to 1000 for guesses. Press enter to continue.\" \r\n\t\t\r\n\t\tConsole_Screen.pause\r\n\t \r\n redo #Redo the current iteration of the loop\r\n end\r\n \r\n #Analyze the player's guess to determine if it is correct\r\n if reply == number then #The player's guess was correct\r\n Console_Screen.cls #Clear the display area\r\n print \"You have guessed the number! Press enter to continue.\"\r\n Console_Screen.pause #Pause the game\r\n break #Exit loop\r\n elsif reply < number then #The player's guess was too low\r\n Console_Screen.cls #Clear the display area\r\n print \"Your guess is too low! Press Enter to continue.\"\r\n Console_Screen.pause #Pause the game\r\n elsif reply > number then #The player's guess was too high\r\n Console_Screen.cls #Clear the display area\r\n print \"Your guess is too high! Press Enter to continue.\"\r\n Console_Screen.pause #Pause the game\r\n end\r\n \r\n\t\tif $noOfGuesses >= 10\t\t#Max guess attemps (10)\r\n\t\tConsole_Screen.cls \t#clear screen\r\n\t\t\tprint \"Your \" + $noOfGuesses.to_s + \" guesses are at max allowable attempts. Press enter to continue.\"\r\n\t\t\tConsole_Screen.pause\t#pause the game\r\n\t\t\tbreak\t#break loop\r\n\t\tend\r\n end\r\n\r\n end", "def play\n\n @board.render(clear=true)\n until @board.won? \n\n # should call reveal two time\n guess_1 = @board.reveal # gonna get position guess from the user and return the value\n @board.render(clear=true)\n guess_2 = @board.reveal # gonna get position guess from the user and return the value\n @board.render(clear=true)\n \n if guess_1 == guess_2\n puts \"It's a match!\" \n else\n # reset the board - set all card to face_up == false\n puts \"Try Again!\"\n @board.reset \n end\n sleep 3\n \n @board.render(clear=true)\n end\n end", "def turn\n puts \"You have #{@number_incorrect} incorrect guesses out of 6 possible.\" \n puts \"The current state of the board is:\" \n i = 0\n guess_letter = \"\"\n while i < @state_of_board.length\n print @state_of_board[i] + \" \"\n i += 1\n end\n\n puts \" \"\n puts \"What is your next guess?\"\n loop{\n guess_letter = gets.chomp\n \n if guess_letter == \"save\"\n break\n elsif guess_letter.length == 1 && guess_letter.match?(/[[:alpha:]]/)\n break\n else \n puts \"Incorrect input. Try again.\"\n end\n }\n #guess_letter = guess_letter.to_s.downcase\n return guess_letter.downcase\n end", "def play_round()\n # Deal hand to all players\n for p in @players\n hand = Hand.new\n hand.deal_hand()\n p.hands << hand\n end\n\n # Dealer deals his own hand\n @dealers_hand.deal_hand()\n\n # Gather bets from all players\n for p in @players\n game_state()\n puts \"Player #{p.player}, how much would you like to bet?\"\n bet_amount = gets.chomp.to_i\n while !(p.can_bet(bet_amount))\n game_state()\n puts \"Player #{p.player}, that's an invalid bet! Try again.\"\n bet_amount = gets.chomp.to_i\n end\n p.bet(bet_amount)\n\n for h in p.hands\n p.place_bet(h)\n end\n end\n\n # Allow players to finalize their bet(s) and hand(s)\n for player in @players\n for hand in player.hands\n while !(hand.is_stand())\n valid_moves = ['h']\n if hand.is_split and player.can_bet_double()\n valid_moves += ['s', 'd', 'e']\n elsif player.can_bet_double()\n valid_moves += ['d', 'e']\n else\n valid_moves += ['e']\n end\n\n game_state()\n puts \"Player #{player.player}, what would you like to do for your #{hand} hand? Your valid moves: #{valid_moves}\"\n puts \"Legend: ['h' -> hit, 's' -> split, 'd' -> double down, 'e' -> end turn]\"\n\n move = gets.chomp\n while !(valid_moves.include? move)\n game_state()\n puts \"Player #{player.player}, that is not a valid move! Try again. Your valid moves: #{valid_moves}\"\n puts \"Legend: ['h' -> hit, 's' -> split, 'd' -> double down, 'e' -> end turn]\"\n move = gets.chomp\n end\n\n case move\n when 'h'\n hand.hit()\n when 's'\n new_hand = hand.split()\n player.place_bet(new_hand)\n\n hand.hit()\n new_hand.hit()\n player.hands << new_hand\n when 'd'\n player.place_bet(hand)\n hand.hit()\n hand.stand()\n when 'e'\n hand.stand()\n end\n\n if hand.is_bust()\n puts \"You busted!\"\n hand.stand()\n end\n end\n end\n end\n\n # Determine dealer's ending hand\n while @dealers_hand.value() < 17\n @dealers_hand.hit()\n end\n\n puts \"-=-=-=- Resulting Hands For This Round -=-=-=-\"\n game_state()\n\n # Determine winnings of each player and their hand(s)\n for player in @players\n for hand in player.hands\n if (!hand.is_bust() and @dealers_hand.is_bust()) or (!hand.is_bust() and !@dealers_hand.is_bust and hand.value() > @dealers_hand.value())\n player.win_hand(hand)\n puts \"Player #{player.player}'s #{hand} beat the dealer's #{@dealers_hand} hand!\"\n elsif (hand.is_bust() and @dealers_hand.is_bust()) or (hand.value() == @dealers_hand.value())\n player.tie_hand(hand)\n puts \"Player #{player.player}'s #{hand} tied with the dealer's #{@dealers_hand} hand!\"\n else\n player.lose_hand(hand)\n puts \"Player #{player.player}'s #{hand} lost to the dealer's #{@dealers_hand} hand! :(\"\n end\n end\n end\n\n # Determine who can continue playing\n continuing_players = []\n for player in @players\n if player.money != 0\n continuing_players << player\n else\n puts \"Player #{player.player} has no money and is eliminated!\"\n end\n end\n @players = continuing_players\n\n # Clear all playing hands.\n for player in @players\n player.hands = []\n player.bet = 0\n end\n end", "def game_state\n end", "def start_game\n code_guessed = false\n if @player.is_creator?\n @s = %w(r g b y c m).repeated_permutation(4).to_a\n @s[0], @s[7] = @s[7], @s[0]\n puts \"Enter your secret code! Pick 4: (R)ed, (G)reen, (Y)ellow, (B)lue, (M)agenta, and (C)yan:\"\n @code = gets.chomp.downcase.scan(/[rgybmc]/).map {|n| n}\n @code_guess = []\n while !@game_over\n computer_guess\n if @code == @code_guess\n puts \"The computer guessed the code correctly!\"\n puts \"The code was #{@code}\"\n @game_over = true\n else\n results = guess_feedback(@code_guess)\n @s.delete_if {|possible_guess| guess_feedback(possible_guess) == results}\n print_board\n @turns -=1\n end\n sleep(1)\n puts \"#{@turns} left for the CPU!\" unless @game_over || @turns == 0\n if @turns == 0\n puts \"The computer ran out of guesses! The code was #{@code}!\"\n @game_over = true\n end\n end\n else\n generate_code\n while !@game_over\n guess\n if @code == @code_guess\n puts \"You guessed correctly!\"\n puts \"The code was #{@code}\"\n @game_over = true\n else\n guess_feedback(@code_guess)\n print_board\n @turns -=1\n end\n puts \"#{@turns} guesses left!\" unless @game_over || @turns == 0\n if @turns == 0\n puts \"You ran out of guesses! The code was #{@code}!\"\n @game_over = true\n end\n end\n end\n end", "def guess(guess)\n if guess.is_a?(Integer)\n @guess = guess\n else\n raise ArgumentError.new(\"You must provide an integer\") \n end\n @solved = false\n if @guess > @answer\n puts \"Your guess is high. Is it solved? #{@solved}\"\n return :high\n elsif @guess == @answer\n # Changed the instance variable if it is true\n @solved = true\n puts \"Your guess is correct. Is it solved? #{@solved}\" \n return :correct\n else\n print \"Your guess is low. Is it solved? #{@solved}\" \n return :low\n end \n end", "def give_feedback(guess, code)\n code_colors = code.colors.dup\n guess_colors = guess.colors.dup\n clues = new_clues\n clues = increment_correct_slot(guess_colors, code_colors, clues)\n clues = increment_correct_color(guess_colors, code_colors, clues)\n clues\n end", "def getFinalState()\r\n dealer_score = @dealer.hand.score\r\n case @dealer.state\r\n when \"bust\"\r\n #every player that didnt bust wins\r\n @players.each do |player|\r\n if(player.state != \"bust\")\r\n player.state = \"won\"\r\n else\r\n player.state = \"lose\"\r\n end\r\n end\r\n when \"fine\"\r\n #everyone with a lower score than the dealer loses, everyone with a higher score that didnt bust wins\r\n @players.each do |player|\r\n if(player.state == \"bust\")\r\n player.state = \"lose\"\r\n elsif(player.hand.score < dealer_score)\r\n player.state = \"lose\"\r\n elsif(player.hand.score > dealer_score)\r\n player.state = \"won\"\r\n else\r\n player.state = \"push\"\r\n end\r\n end\r\n when \"blackjack\"\r\n #everyone lower score loses, everyone equal score pushes\r\n @players.each do |player|\r\n if(player.hand.score == dealer_score)\r\n player.state = \"push\"\r\n else\r\n player.state = \"lose\"\r\n end\r\n end\r\n end\r\n end", "def guess_badly(guess)\n @remaining_guesses -= 1\n @current_index += 1\n @bad_guesses << guess\n end", "def check_guess\n reset_guess\n check_number_and_position\n check_number_only\n fill_result\n @result\n end", "def start_game(user)\n $game_session = nil\n UserGuess.delete_all\n\n initiate_game(user)\n question_loop\n end_message\n menu(user)\nend", "def calculate\n new_guess\n while @guess != @random_num\n if (@guess <= 100) && (@guess > @random_num)\n guesslower\n elsif (@guess >= 1) && (@guess < @random_num)\n guesshigher\n end\n end\n guesscongrats\n end", "def play\n puts\n puts \"How good is your memory? Let's play a memory game.\"\n puts \"Match the cards!\"\n puts\n sleep(3)\n until game_over?\n board.render\n #get_pos from the player\n begin \n make_guess(get_player_input)\n rescue => exception\n puts \"Select a card that hasn't been flipped\"\n retry\n end\n \n end\n puts \"I guess your memory is pretty good :D\"\n end", "def run_guessing_game\n\n player_guess = ''\n\n until player_guess == 'exit'\n welcome\n player_guess = get_player_guess\n check_guess(player_guess)\n end\nend", "def make_guess(secret_code)\n if guess == [0, 0, 0, 0]\n first_guess\n return guess\n end\n reduce_solution_set(secret_code)\n update_guess\n guess\n end", "def guess(guess)\n if guess.is_a?(Integer)\n @guess = guess\n else\n raise ArgumentError.new(\"You must provide an integer\") \n end \n if @guess > @answer\n @solved = false\n puts \"Your guess is high. \" \n puts \"Is it solved?\" \n puts @solved\n return :high\n elsif @guess == @answer\n # Changed the instance variable if it is true\n @solved = true\n puts \"Your guess is correct. \"\n puts \"Is it solved?\" \n puts @solved\n return :correct\n else\n @solved = false\n print \"Your guess is low. \"\n puts \"Is it solved?\" \n puts @solved\n return :low\n end \n end", "def turn_card(guess)\n @board[guess].reveal\n @player.store_cards(guess, @board[guess].value)\n p @player.store\n end", "def enter_guess\n\t\t@guess = nil\n\t\tuntil valid_guess?(@guess)\n\t\t\tputs \"Please enter your guess (A-Z) now, or type 'save' to save (and quit):\"\n\t\t\t@guess = gets.chomp.upcase\t\t\n\t\tend\n\tend", "def make_guess\n\tputs \"#{ @name } is thinking...\"\n\tif @first_guess==[]\n\t return make_first_guess\n\telse\n\t # update the last guess, get a random sample from the set of available codes\n\t sleep 1\n\t @last_guess = @set_of_codes.sample \n\t return @last_guess\n\tend\n end", "def expect_guess\n print \"Guess ##{turn}. What's your code? \"\n input = gets.chomp\n throw :quit if input == \"q\"\n \n if valid_input? input\n self.last_guess = Code.parse(input)\n puts \"Your guess was #{last_guess}.\"\n else\n puts \"Please enter 4 valid colors.\"\n expect_guess\n end\n end", "def game_guess\n if path == \"/game\" && verb == \"POST\"\n number = client.read\n game.guess(number)\n redirect(client)\n end\n end", "def start_guess\r\n\t\tuntil @is_over == true\r\n\t#player enters 1 letter string\r\n\r\n\t\t\tputs \"guess a letter you've already guessed #{@used}. #{@tries-@guess_count} attempts remain\"\r\n\t\t\tputs @blanks.join\r\n\t\t\tletter = gets.chomp\r\n\t#if letter is not in guessed box take a turn away\r\n\t\t\tif @used.include?(letter) == false\r\n\t\t\t\t@guess_count += 1\r\n\t\t\t\tif @tries == @guess_count \r\n\t\t\t\t\t@is_over = true\r\n\t\t\t\tend\r\n\t\t#if letter is in the world replace the blank\r\n\t\t\t\tif @word.include?(letter)\r\n\t\t\t\t\twordindex = @word.index(letter)\r\n\t\t\t\t\t@blanks[wordindex] = letter\r\n\t\t\t\t\tif @blanks.include?(\"_ \") == false\r\n\t\t\t\t\t\t@is_over = true\r\n\t\t\t\t\tend\r\n\t\t#if letter is not in the world add to guessed box\r\n\t\t\t\telse\r\n\t\t\t\t\t@used << letter\r\n\t\t\t\tend\r\n\t#if letter is in guessed box don't consume a turn\r\n\t\t\telse\r\n\t\t\t\tputs \"you already tried that letter\"\r\n\t\t\tend\r\n\t\tend\r\n\r\n\t#end:\r\n\t#if word is guessed correctly print congrants\r\n\t\tif @blanks.include?(\"_ \")\r\n\t\t\tputs \"haha try harder next time\"\r\n\t#if word is guessed wrong print taunt\r\n\t\telse\r\n\t\t\tputs \"well done! you guessed the word\"\r\n\t\tend\r\n\tend", "def new_round\n puts \"Wanna play again? Y/N\"\n answer = gets.chomp.upcase\n if answer == \"Y\"\n @board = Board.new\n @status = \"on going\"\n @count_turns = 0\n turn\n else\n game_end\n end\n end", "def generate_random_guesses\n position1 = validate_ai_input\n guess1 = @board.reveal(position1)\n @board.render\n position2 = validate_ai_input\n guess2 = @board.reveal(position2)\n @board.render\n result = is_match?(guess1, guess2)\n if !result\n write_to_ai_memory(guess1.value, position1, guess2.value, position2)\n end\n end", "def receive_revealed_card(val, pos)\n row, col = pos\n known_cards[row, col] = val \n analyze(val, row, col)\n prev_guess.empty? ? prev_guess << pos : prev_guess.pop \n end", "def game_over?\n @guess == @answer\n end", "def play_game\n\t\twhile @turn < 13\n\t\t\tputs \"Lets see if you figured out my code!\"\n\t\t\tputs \"Please select four colors as your guess. They can either mix and match or all be the same\"\n\t\t\tputs \"No spaces please!\"\n\t\t\tputs \"Your choices are 'R', 'G', 'B', 'Y', 'H', 'P'.\"\n\t\t\tguess = gets.chomp.upcase\n\t\t\tfeedback = compare(guess)\n\t\t\tif feedback == [\"O\", \"O\", \"O\", \"O\"]\n\t\t\t\tputs \"~~~~~~~~~~~\"\n\t\t\t\tputs \"You won!!!!\"\n\t\t\t\tputs \"~~~~~~~~~~~\"\n\t\t\t\tputs \"You have cracked the code of #{@master_code}\"\n\t\t\t\texit\n\t\t\telse\n\t\t\t\tputs \"Sorry! Guess again\"\n\t\t\t\tputs \"Here is currently what you have right #{feedback}\"\n\t\t\t\tputs \"---------------\"\n\t\t\t\tputs \"---------------\"\n\t\t\t\t@turn += 1\n\t\t\t\tputs \"That was turn number \" + @turn.to_s\n\t\t\t\tplay_game\n\t\t\tend\n\t\t\tputs \"You reached your max of 12 turns....game over!\"\n\t\tend\n\tend", "def incorrect_guess(guess)\n end", "def check_guess(guess)\n @current_guess = guess.downcase\n if @current_guess == @secret_word\n player_won?\n elsif @current_guess.length > 1 || @current_guess.nil?\n @feedback = \"Invalid Guess!\"\n else\n @feedback = \"\"\n if @secret_word.include? @current_guess\n show_letter\n else\n @turns -= 1\n end\n @guesses << @current_guess\n end\n end", "def start_game\n puts print_created_by\n\n puts \"What is your name?\"\n @player.name = $stdin.gets.chomp\n puts \"secret_numb: #{@secret_numb.secret_number}\"\n puts \"Welcome to my game, #{@player.name}.\"\n puts \"You have #{guesses_allowed} tries to guess a number between 1 and #{@secret_numb.set_of_numbers.length}.\"\n\n\n puts \"What is your #{current_guess_count + 1}st guess?\"\n @current_guess = $stdin.gets.strip.to_i\n increment_guess_count\n\n\n while @current_guess_count <= @guesses_allowed && guess_correct?(@current_guess) do\n increment_guess_count\n puts \"What is your #{current_guess_count}#{get_num_suffex(@current_guess_count)} guess?\"\n @current_guess = $stdin.gets.strip.to_i\n end\n end", "def resetgame\r\n\t\t \t @wordtable = []\r\n\t\t\t\t\t\t@secretword = \"\"\r\n\t\t\t\t\t\t@turn = 0\r\n\t\t\t\t\t\t@resulta = []\r\n\t\t\t\t\t\t@resultb = []\r\n\t\t\t\t\t\t@winner = 0\r\n\t\t\t\t\t\t@guess = \"\"\r\n\t\t\t\t\t\t@template = \"[]\"\r\n\t\t\t\t\t\t@turnsleft = GOES\r\n\t\t\t\t\t\t@score = 0\r\n\t\t\t\t\t\t@reward = \"\"\r\n\t\t\t\t\t\t@descr = []\r\n\t\t\t\t\t\t@num_words = 0\r\n\t\t\t\t\t\t@spin_flag = false\r\n\t\t\t\t\t\t@game_analysis.clear\r\n\t\t\t\t\t\t@spin_counter=0\r\n\t\t\t\t\t\t@guess_counter=0\r\n\t\t\t\t\t\t@num_guessed = 0\r\n\t\t\t\t\t\t@message = \"Guess a letter from the word/phrase.\"\r\n\t\t\t\t\t\t@web_initial = true\r\n\t\t\t\t\t\t@win = false\r\n\t\t\t\t\t\t@game_over = false\r\n\r\n\t\t end", "def play_as_codebreaker\n # answer = colors.sample(4)\n loop do\n display.tables(hint.table,decode.table)\n puts \"Please enter your guess #{colors.join(' | ')}:\"\n player.input = gets.split.map(&:capitalize)\n if player.valid_input?\n if player.win?(answer)\n puts \"You won! #{display_answer}\"\n exit\n elsif player.lose?\n puts \"You lost! #{display_answer}\"\n exit\n else\n complete_turn\n end\n else\n puts \"Not a valid input!\"\n end\n end\n end", "def game_state_update(parsed_state)\n\t\tgame_state = nil\n\t\[email protected] do\n\t\t\t@seat_number = parsed_state['seat_number']\n\t\t\t@bankroll = parsed_state['player']['bankroll']\n\t\t\tgame_state = GameState.new(parsed_state, @player_id, parsed_state['hand'])\n\t\tend\n\t\[email protected] do\n\t\t\tself.display_game_state(game_state) if self.respond_to?(:display_game_state)\n\t\t\tif game_state.is_acting_player? and game_state.hand\n\t\t\t\tbegin\n\t\t\t\t\tTimeout.timeout(game_state.timelimit) do\n\t\t\t\t\t\tmove = ask_for_move(game_state)\n\t\t\t\t\t\t@player_channel.publish({'table_id' => game_state.table_id,\n\t\t\t\t\t\t'command' => 'action', 'action' => move}.to_json)\n\t\t\t\t\tend\n\t\t\t\trescue Timeout::Error\n\t\t\t\t\tputs \"Took too long to make a move, folding\"\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "def increment_guess_count\n @current_guess_count += 1\n end", "def increment_guess_count\n @current_guess_count += 1\n end", "def check_guess guess\r\n\t\t\t\t @resultb.push(guess)\r\n\t\t\t\t phrase = @secretword.chars\r\n\t\t\t\t i = 0\r\n\t\t\t\t @num_guessed = 0\r\n\t\t\t\t while i < phrase.length do\r\n\t\t\t\t\t\t\t\tif phrase[i] == guess\r\n\t\t\t\t\t\t\t\t @resulta[i] = guess\r\n\t\t\t\t\t\t\t\t @num_guessed += 1\r\n\t\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\t\t\ti += 1\r\n\t\t\t\t end\r\n\t\t\t\t\t\t\t\tif @num_guessed > 0\r\n\t\t\t\t\t\t\t\t@score += (@reward.to_i * @num_guessed)\r\n\t\t\t\t\t\t\t else\r\n\t\t\t\t\t\t\t incrementturn\r\n\t\t\t\t\t\t\t\tend\r\n\t\t end", "def increment_guess_count\n @current_guess_count += 1\n end", "def setguessmatch(letter)\n\t\t@guess_count +=1\t\n\t\t@guessed_letters << letter\n\n\t\t@starting_word.each_with_index do |char,index|\n\t\t\tif char == letter\n\t\t\t\t@guessing_word[index] = char\n\t\t\t\tif starting_word == guessing_word\n\t\t\t\t\t@game_status = true\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "def new_round\n @guess_feedback = \"\" # Set guess feedback to be empty\n puts \"\\t\\tNext Round!\\n?????\"\n\t\t@guess_count = 0 # Reset amount of guesses\n\t\t@current_word = self.random_word # Set a new random chosen/current word\n\tend", "def update_current_state(player)\n player.correct_letters.each do |key, values|\n values.each do |index|\n player.current_state[index] = key\n end\n end\n end", "def store_and_redirect(guess)\n @guesses << guess\n game_response(guess)\n #redirect\n end", "def guesses_left\n\t\t@guesses -= 1\n\t\tguesses \n\tend", "def play_game\n # play the game until the board is the same as the word and no letters are left to guess\n until (@board == @word)\n puts \"\\nThe points for each correct guess this turn is #{@random_points}\\n\\n\"\n\n if (@turn == 1)\n puts \"Player one's turn: Player one currently has #{@player_one_points} points.\\n\"\n else\n puts \"Player two's turn: Player two currently has #{@player_two_points} points.\\n\"\n end\n\n puts \"Please enter a letter or number player #{@turn}\"\n letter = gets.chomp.to_s.downcase\n positions = @word.enum_for(:scan, /#{letter}/).map { Regexp.last_match.begin(0) }\n\n if (positions.length != 0)\n puts \"\\nCorrect! There is #{positions.length} of the letter #{letter}!\\n\"\n if (@turn == 1)\n @player_one_points = @player_one_points + @random_points * positions.length\n else\n @player_two_points = @player_two_points + @random_points * positions.length\n end\n else\n puts \"\\nIncorrect! There is not a(n) #{letter}!\\n\\n\"\n change_turn\n end\n\n # turn the board into the correct letter that was guessed at the correct index\n positions.map { |e| @board[e] = letter }\n puts @board\n\n # change the point value if both players have played their turns\n random_point_change\n end\n end", "def enter_colors\n speak\n guess\n end", "def guessing_game\n\tprint \"Hello, what should I call you? \"\n\tname = gets.chomp\n\tnumber = rand(100) + 1\n\tguesses_remaining = 10\n\tis_correct = false\n\tputs \"Welcome #{name}! It's time to play Guess My Number!\"\n\tputs \"I'm thinking of a number between 1 and 100, can you guess what it is?\"\n\twhile guesses_remaining > 0\n\t\tif guesses_remaining == 1\n\t\t\tputs \"You only have 1 guess remaining!!!\"\n\t\telse\n\t\t\tputs \"You have #{guesses_remaining} guesses remaining.\"\n\t\tend\n\t\tputs \"What do you guess?\"\n\t\tguess = gets.to_i\n\t\tguesses_remaining -= 1\n\t\tif guess == number\n\t\t\tif (10 - guesses_remaining) == 1\n\t\t\t\tputs \"Good job, #{name}! You guessed my number in only 1 guess!!!\"\n\t\t\telse\n\t\t\t\tputs \"Good job, #{name}! You guessed my number in #{10 - guesses_remaining} guesses!\"\n\t\t\tend\n\t\t\tis_correct = true\n\t\t\texit\n\t\telsif guess > number\n\t\t\tputs \"Oops, your guess was too HIGH!\"\n\t\telse\n\t\t\tputs \"Oops, your guess was too LOW!\"\n\t\tend\n\tend\n\n\tunless is_correct\n\t\tputs \"Sorry, you didn't get my number. It was #{number}!\"\n\t\tputs \"Better luck next time!\"\n\t\tplay_again?\n\tend\nend" ]
[ "0.71898717", "0.71877104", "0.7121402", "0.7099333", "0.7031077", "0.69804436", "0.6976921", "0.6946356", "0.6824474", "0.6824474", "0.67830676", "0.67822546", "0.67692757", "0.6751864", "0.6747637", "0.6732397", "0.67163473", "0.6702852", "0.66795653", "0.66727126", "0.6662743", "0.6661397", "0.66564524", "0.66296196", "0.6611923", "0.6590651", "0.658939", "0.65821815", "0.657865", "0.6575886", "0.6565089", "0.65638775", "0.65515804", "0.6547669", "0.6535205", "0.65089345", "0.6482187", "0.6479949", "0.64789176", "0.64761704", "0.64742875", "0.6470395", "0.6461437", "0.6455397", "0.6439586", "0.64284015", "0.6417066", "0.64094514", "0.64069635", "0.6376756", "0.637234", "0.63694894", "0.63655347", "0.63614315", "0.6354427", "0.6343526", "0.6343437", "0.6342856", "0.6339626", "0.63392776", "0.63351375", "0.6324542", "0.63240016", "0.63092965", "0.6306139", "0.6300351", "0.6294646", "0.62934446", "0.6292304", "0.62832946", "0.62783617", "0.6277296", "0.62759656", "0.6273062", "0.62628406", "0.62568104", "0.62546265", "0.6243158", "0.62254214", "0.6223334", "0.62212795", "0.62176263", "0.62089694", "0.6206896", "0.6200257", "0.61969936", "0.6195514", "0.6194793", "0.6191312", "0.6191312", "0.6191065", "0.61892134", "0.6186264", "0.61855924", "0.618392", "0.618118", "0.6177085", "0.61759067", "0.6171035", "0.6170506" ]
0.75073177
0
Get guess from the player (one letter) or 'save' to save the game
def get_guess while true guess = gets.chomp.upcase return :save if guess == "SAVE" || guess == "'SAVE'" if guess.between?('A', 'Z') && guess.length == 1 if @hits.include?(guess) || @misses.include?(guess) print "You guessed '#{ guess }' already. Select another letter: " next end return guess end print "Enter one letter for guess (or 'save' to save game): " end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_player_guess\n puts \"Guess a letter that has not been chosen yet or type 'save' to save game\"\n @input = gets.chomp.downcase\n @guess = (input.match(/[a-z]/) && input.length == 1) || input == 'save' ? input : '-'\n end", "def solicit_guess\n\t\tputs \"\\nPlease input a letter!\"\n\t\tguess = gets.chomp.downcase\n\t\tif guess.downcase == \"save\"\n\t\t\t$save = true\n\t\telse\t\n\t\t\tuntil !(@guess_tracker.include?(guess)) && (guess.length == 1) && (guess <= 'z' && guess >= 'a')\n\t\t\t\tputs \"Unacceptable input (maybe you already guessed that?), please try again!\"\n\t\t\t\tguess = gets.chomp.downcase\n\t\t\tend\n\t\tend\n\t\tguess\n\tend", "def get_guess\n\t\t# There are turns left...\n\t\tif @turn < 9\n\t\t\tshow_board\n\t\t\tputs \"Enter your letter guess...\"\n\t\t\tletter = gets.chomp.downcase\n\t\t\tvalidate_letter(letter)\n\t\t# No turns left, show losing message and delete game if it was previously saved\n\t\telse\n\t\t\tputs\n\t\t\tshow_board\n\t\t\tputs \"Dangit, you ran out of turns!\"\n\t\t\tputs \"The word was #{@word.join}...\"\n\t\t\tif @running_saved_game != nil\n\t\t\t\tover_write_data\n\t\t\tend\n\t\t\tgo_again\n\t\tend\n\tend", "def guess\n\t\tputs \"Pick a letter. (enter 'save' at anytime to save the game)\"\n\t\tinput = gets.chomp.downcase\n\t\treturn input if input.size == 1\n\t\tif input == 'save'\n\t\t\tsave_game\n\t\t\treturn menu\n\t\tend\n\t\tputs \"That doesn't make sense. Try again.\"\n\t\treturn guess\n\tend", "def guess_char\n\n\t\tbegin\n\t\t\tputs \"Input your guess or save:\"\n\t\t\tchar = gets.chomp.downcase\n\t\t\n\t\traise puts \"Wrong input!\" unless (char.length == 1 && ('a'..'z').include?(char)) || char == 'save'\n\n\t\trescue\n\t\t\tretry\n\t\t\n\t\telse\n\n\t\t\tif char == 'save'\n\t\t\t\tsave_game\n\t\t\t\tputs \"Game saved!\"\n\n\t\t\t\t@lives += 1 # because this is counted as a turn? :S\n\t\t\tend\n\t\t\n\t\tend\n\n\n\n\t\tguess_check(char)\n\t\tturn\n\tend", "def get_guess\n @guess = \"\"\n until @guess.match(/^[a-z]$/) && !@already_guessed.include?(@guess)\n print \"Please enter a letter. \"\n @guess = gets.chomp.downcase\n if @guess == 'save'\n save_game\n elsif @already_guessed.include?(@guess)\n puts \"You have already guessed that letter. Please try again.\"\n elsif [email protected](/^[a-z]$/)\n puts \"That is not a valid guess. Please enter a single letter.\"\n end\n end\n @guess\n end", "def guess_letter\n\t\tprint \"Your guess: \"\n\t\tguess = gets.chomp.downcase\n\t\treturn guess if guess == \"save\"\n\t\tif (guess.between?('a','z') && !(@guessed_letters.include? guess)\\\n\t\t\t&& guess.length == 1)\n\t\t\tprocess_guess(guess)\n\t\t\t@guessed_letters << guess\n\t\t\t@turns += 1\n\t\telse\n\t\t\tif guess.between?('a','z')\n\t\t\t\tputs \"\\nYour guess must be ONE letter\" unless guess.length == 1\n\t\t\t\tputs \"\\nYou've already guessed that!\" if @guessed_letters.include? guess\n\t\t\telse\n\t\t\t\tputs \"\\nYour guess must be a letter!\" unless guess.between?('a','z')\n\t\t\tend\n\t\t\tputs \"Try again!\\n\\n\"\n\t\t\tguess = guess_letter\n\t\tend\n\t\tguess\n\tend", "def get_guess\n puts \"#{@name}'s turn!\"\n print \"Enter 1 to guess a letter, or 2 to guess a word: \"\n choice = gets.chomp.downcase\n if choice == \"1\"\n print \"Guess a letter: \"\n guess = gets.chomp.downcase\n if valid_letter_guess?(guess)\n return guess\n else\n self.get_guess\n end\n elsif choice == \"2\"\n print \"Guess a word: \"\n guess = gets.chomp.downcase\n if valid_word_guess?(guess)\n return guess\n else\n self.get_guess\n end\n end\n end", "def guess_letters\n while @guess_count > 0 && @word_guessed.include?('_')\n print 'Guess a letter to play or type save to save game: '\n letter_guessed = gets.chomp.downcase\n if letter_guessed == 'save'\n save_game\n return\n else\n check_letters letter_guessed\n end\n end\n puts \"The secret word was #{@secret_word}\"\n end", "def guess_letter\n \tloop do \n \t puts \"Guess a letter or type 'save' to save the game and continue later.\"\n \t letter = gets.chomp.downcase.strip\n \t if letter == \"save\"\n \t \tsave\n \t else\n if letter.match(/[a-z]/) && letter.length == 1\n \t\t return letter\n else\n \t puts \"Invalid Character - Try Again\"\n \t end\n end\n end\n end", "def input\n\t\tprint_word\n\t\tprint \"\\n>> \"\n\t\tinput = gets.chomp\n\t\tif @player.word_to_guess.include? input\n\t\t\[email protected]_letters << input\n\t\telsif input == \"save game\"\n\t\t\toutput = File.new('save.yml', 'w')\n\t\t\toutput.puts YAML.dump(@player)\n\t\t\toutput.close\n\t\t\tputs \">game saved<\"\n\t\t\tgame_loop\n\t\telsif input == \"exit\"\n\t\t\texit\n\t\telse\n\t\t\[email protected] += 1\n\t\tend\n\tend", "def make_guess\n puts \"Make a guess:\"\n @current_guess = gets.chomp\n unless good_guess?\n puts \"That is an invalid guess, please try again!\"\n @current_guess = gets.chomp\n end\n puts\n guesses << current_guess unless current_guess == \"save\" || current_guess == secret_word\n end", "def enter_guess\n\t\t@guess = nil\n\t\tuntil valid_guess?(@guess)\n\t\t\tputs \"Please enter your guess (A-Z) now, or type 'save' to save (and quit):\"\n\t\t\t@guess = gets.chomp.upcase\t\t\n\t\tend\n\tend", "def check_guess\n if current_guess == secret_word\n player_won?\n else\n if secret_word.include? current_guess\n show_letter\n puts \"This word includes the guessed letter\\n\\n\"\n elsif current_guess == \"save\"\n create_save\n puts \"Game saved! Exiting game!\"\n exit\n else\n show_letter\n puts \"This word does not include the guessed letter\\n\\n\"\n end\n end\n end", "def guess_letter\n guess = \"\"\n if @letters_guessed.size > 0\n puts \"\\nSo far, you have already guessed the following letters:\"\n puts \"(\" + @letters_guessed.join(\", \") + \")\"\n end\n begin\n puts \"\\n\\nPlease enter a letter for your guess: \"\n puts \"(or type the entire keyword: 'SAVE' or 'EXIT')\"\n guess = gets.chomp.strip.upcase\n if guess == \"SAVE\"\n save_game\n elsif guess == \"EXIT\"\n puts \"\\nExiting the current round...\"\n puts \"\\n=================================================\"\n else\n error_msg1 = \"Selected letter was not of the correct format.\"\n raise ArgumentError.new(error_msg1) unless guess =~ /^[A-Z]$/\n error_msg2 = \"Selected letter has already been guessed.\"\n raise ArgumentError.new(error_msg2) if @letters_guessed.include?(guess)\n end\n rescue ArgumentError=>e\n puts \"Error: #{e.message}\"\n retry\n end\n return guess\n end", "def ask_letter\n letter = Display.ask\n if letter == 'save'\n save_game\n ask_letter\n end\n word_check = @word.map(&:clone)\n check_if_correct(word_check, letter)\n end", "def guess\n # takes human input and stores guess\n puts 'Pick a letter'\n self.human_guess = gets.chomp\n end", "def letter_guess\n letter = get_letter_player()\n check_letter_in_random_word(@guess_letter)\n if @correct_guess == false\n @failed_attempts += 1\n if @failed_attempts == 10\n @lose = true\n end\n end\n guess_word_status_string = @guess_word_status.join()\n if guess_word_status_string == @random_word\n @win = true\n end\n end", "def getguess guess\r\n\t\t\t\t\t@spin_flag = false\r\n\t\t\t\t if guess.length == 1\r\n\t\t\t\t if check_repeated_choice guess\r\n\t\t\t\t @message = \"Already guessed this letter!\"\r\n\t\t\t\t if @console\r\n\t\t\t\t\t\t\t\[email protected] \"#{@message}\"\r\n\t\t\t\t\t\t\t\tword_input = take_user_word_input\r\n\t\t\t\t\t\t\t\tvalid = false\r\n\t\t\t\t\t\t\t while !valid do\r\n\t\t if validate_input word_input\r\n\t\t valid = true\r\n\t\t else\r\n\t\t @output.puts \"Invalid input\"\r\n\t\t word_input = take_user_word_input\r\n\t\t end\r\n\t\t\t\t\t\t\t end\r\n\t\t\t\t\t\t\t\tif check_enter word_input\r\n\t\t\t\t\t\t\t\t\t\t@break_flag = true\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t getguess word_input\r\n\t\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t@spin_flag = true\r\n\t\t\t\t end\r\n\t\t\t\t else\r\n\t\t\t\t \t@message=\"Guess a letter from the word/phrase.\"\r\n\t\t\t\t @guess_counter+=1\r\n\t\t\t\t check_guess guess\r\n\t\t\t\t set_guess_analysis guess\r\n\t\t\t\t end\r\n\t\t\t\t success = check_phrase @resulta.join(',').gsub(\",\",\"\")\r\n\t\t\t\t return success ? true : false\r\n\t\t\t\telse\r\n\t\t\t\t\t if check_phrase guess\r\n\t\t\t\t\t\t phrase = @secretword.chars\r\n\t\t\t\t\t\t i = 0\r\n\t\t\t\t\t\t while i < phrase.length do\r\n\t\t\t\t\t\t\t\t\t\t@resulta[i] = phrase[i]\r\n\t\t\t\t\t\t\t\t\t\ti += 1\r\n\t\t\t\t\t\t end\r\n\t\t\t\t\t\t return true\r\n\t\t\t\t\t else\r\n\t\t\t\t\t\t @num_guessed = 0\r\n\t\t\t\t\t\t incrementturn\r\n\t\t\t\t\t\t @guess_counter+=1\r\n\t\t\t\t\t\t set_guess_analysis guess\r\n\t\t\t\t\t\t return false\r\n\t\t\t\t\t end\r\n\t\t\t\tend\r\n\t\t\t\tend", "def round\n puts \"Guess a letter, guess the whole word, \\\"save\\\" game and exit,\"\n puts \"or \\\"exit\\\" game without saving.\"\n input = gets.chomp.strip\n case input\n when \"exit\"\n GameMenu.new\n when \"save\"\n saved_game = SaveGame.new(@chosen_word,@word_guess,@dead_man,Time.now)\n saved_game.dump\n GameMenu.new\n when \"\"\n puts \"\\n\"\n round\n else\n @word_guess.guess(input,@dead_man)\n if @word_guess.letters_guessed_array.include?(\"__\")\n if @dead_man.wrong_guesses == 8\n GameMenu.new\n else\n round\n end\n else\n GameMenu.new\n end\n end\n end", "def evaluate_players_letter()\n letter= @player1.give_letter()\n if @hiddenword1.determine_if_correct_letter_given(letter)\n p @hiddenword1.obscured_word\n @guessed_letters.push(letter)\n else\n @player1.lives-=1\n p \"Please try again\"\n p @guessed_letters\n p @hiddenword1.obscured_word\n end\n end", "def take_a_turn(input = nil)\n print \"Guess a letter: \"\n loop do\n input ||= gets.chomp.upcase\n if input == \"SAVE\"\n save_game\n puts \"GAME SAVED!\"\n break\n elsif input.length != 1 || !board.letters.include?(input)\n puts \"invalid entry. Try again: \"\n input = nil\n else\n @turns += 1\n self.letter = input\n break\n end\n end\n end", "def gets_user_guess\n @guess = gets.strip.downcase\n generate_new_card\n end", "def take_a_guess\n puts \"Guess a letter or word: \"\n guess = gets.chomp.downcase\nend", "def game_guess\n if path == \"/game\" && verb == \"POST\"\n number = client.read\n game.guess(number)\n redirect(client)\n end\n end", "def guessing_for_the_win(letter)\n\t\tif repeat_guess(letter)\n\t\telsif guess_correct(letter)\n\t\telse wrong_guess(letter)\n\t\tend \n\n\t\tif @secret_word == @display\n\t\t\tcongrats\n\t\telsif @number_of_guesses > 0 \n\n\t\t\tp \"Keep guessing\"\n\t\telse\n\t\t\tfailure\n\t\tend\n\tend", "def good_guess?\n current_guess == \"save\" || current_guess == secret_word || current_guess.length == 1\n end", "def player_guess\n print \"> \"\n @guess = $stdin.gets.chomp\n end", "def player_guess\n puts \"Turn #{@turn} - Put your guess in below:\"\n begin\n guess = gets.chomp\n guess_code = Code.new(guess.upcase)\n rescue StandardError => e\n puts e\n retry\n end\n guess_code\n end", "def guess!(letter)\n end", "def ask_guess\n guess = gets.chomp.downcase\n check_guess_is_valid?(guess) ? guess : ask_guess\n end", "def prompt_player\n puts \"Enter a single character [a-z/A-Z]:\"\n input = gets.chomp.downcase\n\n if input.to_i == 1\n\n self.save_and_exit(@secret_word, @matched_letters, @guess, @guesses_left, @misses)\n print \"\\n\\n Goodbye!!! \\n\\n\".send(:yellow).send(:bold)\n\n elsif is_input_valid?(input)\n self.clear()\n @guess = input\n check_for_matches(input)\n display()\n \n if is_win?()\n print \" Congratulations!!! \\n\".send(:green).send(:bold)\n print \" You Guessed The Secret Word \\n\\n\"\n self.clear_memory() unless !self.is_game_saved?()\n play_again?()\n elsif is_game_over?()\n print \" Game Over!!! \\n\\n\".send(:yellow).send(:bold)\n print \"The secret word is: \" + \"#{@secret_word} \\n\\n\" .upcase.send(:bold).send(:green)\n self.clear_memory() unless !self.is_game_saved?()\n play_again?()\n else\n prompt_player()\n end\n else\n print \"\\n------------------Invalid Input-------------------\\n\".send(:red).send(:bold)\n prompt_player()\n end\n end", "def get_game\n\t\tif @file_exists == 1\n\t\t\t# If the file exists, but there are no rows in it, there are no saved games\n\t\t\tif @data.length == 0\n\t\t\t\tputs \"Oops, you have no saved games.\"\n\t\t\t\tputs \"Here, start a new one!\"\n\t\t\t\tputs\n\t\t\t\tnew_game\n\t\t\telse\n\t\t\t\tputs \"Which game?\"\n\t\t\t\t# Display each partially guessed word like: \"1. _ e _ _ t\"\n\t\t\t\[email protected]_with_index { |row, i| puts \"#{i+1}. #{row[1].split(\"\").join(\" \")}\" }\n\t\t\t\t# Get user's choice\n\t\t\t\tgame = gets.chomp.to_i\n\t\t\t\t# If the user entered a number that appears on the board...\n\t\t\t\tif game.between?(1,@data.length)\n\t\t\t\t\t# Get all info out of chosen row\n\t\t\t\t\t@word = @data[game-1][0].split(\"\").to_a\n\t\t\t\t\t@guess = @data[game-1][1]\n\t\t\t\t\t@wrong_letters = @data[game-1][2]\n\t\t\t\t\t@turn = @data[game-1][3].to_i\n\t\t\t\t\t@running_saved_game = (game - 1)\n\t\t\t\t\t# Get the next guess\n\t\t\t\t\tget_guess\n\t\t\t\telse\n\t\t\t\t\tputs \"Not a valid choice! Pick again\"\n\t\t\t\t\tget_game\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\tputs \"Oops, you have no saved games.\"\n\t\t\tputs \"Here, start a new one!\"\n\t\t\tputs\n\t\t\tnew_game\n\t\tend\n\tend", "def get_guess\n print \"\\nMake a guess: \"\n guess = gets.chomp.upcase\n\n #validate that guess has not already been guessed and is not blank\n while @bad_guesses.include?(guess) || @user_progress.include?(guess) || guess == \"\"\n puts \"You already guessed that!\" unless guess == \"\"\n print \"Guess again: \"\n guess = gets.chomp.upcase\n end\n return guess\n end", "def get_letter_player\n print \"Please give a letter: \"\n @guess_letter = gets.chomp.upcase\n puts \"\\nYou chose #{@guess_letter}\"\n end", "def choose_word\n case @game_mode\n when \"computer guess\"\n puts \"Choose a word! (It must be in the dictionary)\"\n @word = gets.chomp\n when \"human guess\"\n @word = computer_guess\n end\n end", "def turn\n puts \"You have #{@number_incorrect} incorrect guesses out of 6 possible.\" \n puts \"The current state of the board is:\" \n i = 0\n guess_letter = \"\"\n while i < @state_of_board.length\n print @state_of_board[i] + \" \"\n i += 1\n end\n\n puts \" \"\n puts \"What is your next guess?\"\n loop{\n guess_letter = gets.chomp\n \n if guess_letter == \"save\"\n break\n elsif guess_letter.length == 1 && guess_letter.match?(/[[:alpha:]]/)\n break\n else \n puts \"Incorrect input. Try again.\"\n end\n }\n #guess_letter = guess_letter.to_s.downcase\n return guess_letter.downcase\n end", "def save_guess\n if good_guess?\n matching_indexes(@code_word, @word_guesser.guess).each do |i|\n @good_guesses[i] = @word_guesser.guess\n end\n else\n @bad_guesses.push(@word_guesser.guess)\n end\n end", "def getGuess\n\t\tputs \"It's Player #{@myIndex}'s turn.\"\n\n\t\t#if this players last guess was not correct\n\t\tif (!@isCorrect)\n\t\t\t#just grab some unseen values\n\t\t\tguessPerson = @suspectsNotSeen[0]\n\t\t\tguessPlace = @locationsNotSeen[0]\n\t\t\tguessWeapon = @weaponsNotSeen[0]\n\n\t\t\t#check if you only have 3 options\n\t\t\tif(@suspectsNotSeen.length == 1 && @locationsNotSeen.length == 1 && @weaponsNotSeen.length == 1)\n\t\t\t\t@theGuess = Guess.new(guessPerson, guessPlace, guessWeapon, true)\n\t\t\telse \n\t\t\t\t@theGuess = Guess.new(guessPerson, guessPlace, guessWeapon, false)\n\t\t\tend\n\n\t\t\t@theGuess\n\t\t#if it was \n\t\telse\n\t\t\tputs \"Player #{@playerIndex} makes an Accusation: #{@theGuess.toString}!\"\n\t\t\t#take the last guess, change it to an accusation, and return it\n\t\t\[email protected]\n\t\t\t@theGuess\n\t\tend\n\tend", "def check_guess(letter)\n\t\t# If the guessed letter is in the word, replace \"_\" in the guess variable with the letter in the right spot\n\t\[email protected]_with_index do |l, i|\n\t\t\tif l == letter\n\t\t\t\t@guess[i] = letter\n\t\t\tend\n\t\tend\n\t\t# If the guessed word and the answer are the same, the user won!\n\t\t# Show message and if the game was previously saved, delete it\n\t\tif @word.join == @guess\n\t\t\tputs \n\t\t\tshow_board\n\t\t\tputs \"You won!!\"\n\t\t\tif @running_saved_game != nil\n\t\t\t\tover_write_data\n\t\t\tend\n\t\t\tgo_again\n\t\t# Got a letter but didn't win. Get another guess\n\t\telsif @word.include?(letter)\n\t\t\tputs\n\t\t\tputs \"You got a letter!\"\n\t\t\tget_guess\n\t\t# Letter wasn't in word, put letter in missed letter variable and guess again\n\t\telse\n\t\t\tputs \n\t\t\tputs \"No #{letter}'s.\"\n\t\t\t@wrong_letters.sub!(\"_\", letter)\n\t\t\t@turn += 1\n\t\t\tget_guess\n\t\tend\n\tend", "def ask_letter\n puts \"Please select a letter or type 'save' to save game\"\n correct_input = 0\n until correct_input == 1\n print 'Letter: '\n letter = gets.chomp.downcase\n if letter.length == 1 && letter.match(/[A-z]/) && [email protected]?(letter)\n correct_input = 1\n elsif letter == 'save'\n puts \"\\n\\n\\n\"\n save\n show_guess\n show_lives\n show_bank\n puts ''\n else\n puts 'PLEASE ENTER A LETTER WHICH HAS NOT BEEN USED'\n end\n end\n puts \"\\n\\n\"\n letter\n end", "def turn\n\t\toutputStatus\n\t\tif @guesses_left < 10\n\t\t\tsaveGame if save?\n\t\tend\n\t\tletter = getLetter\n\t\tif checkLetter(letter)\n\t\t\treplaceLetter(letter)\n\t\telse\n\t\t\twrongGuess(letter)\n\t\tend\n\tend", "def guess(letter)\r\n if word_has?(letter)\r\n \tput_letter_on_board(letter)\r\n else\r\n wrong_letter(letter) if [email protected]? letter\r\n end\r\n end", "def valid_guess?(guess)\n\t\tguess == 'SAVE' || (('A'..'Z').include?(guess) && (!(@wrong_letters.include?(guess))))\n\tend", "def read_guess\n print \"Pretty please enter your guess: \"\n gets.to_i\nend", "def guess(board)\n print \"Make a guess: \"\n gets.chomp\n end", "def guess letter\n raise InvalidGuessError if letter.strip.empty? || letter.length > 1\n letter = letter[0].upcase\n if @guesses.include?(letter)\n return {advance: false, message: \"#{letter} has already been played, silly!\"}\n else\n @guesses << letter\n end\n @guessed.each_with_index do |guessed_pos, index|\n if guessed_pos\n if letter == secret[index]\n return {advance: false, message: \"#{letter} has already been played, silly!\"}\n end\n else\n if letter == secret[index]\n reveal_all(letter)\n return {advance: true, message: \"We found #{letter}!\"}\n end\n end\n end\n {advance: true, message: \"Sorry, we did not find #{letter}!\"}\n end", "def play\n welcome()\n while @current_turn <= @max_turn && @display_word.include?(\"_\")\n puts \"Turn #{@current_turn} out of #{@max_turn}\"\n puts \"Word: #{@display_word}\"\n puts \"Enter a letter for a guess (will only count first letter):\"\n @current_guess = parse_letter(gets.chomp)\n if @current_guess == \"+\"\n save_game()\n else\n @current_turn +=1\n end\n update_display_word()\n end\n end_message()\n end", "def show_guess\n @guess\n end", "def game_play\n find_word\n board\n load_game?\n if @confirm != 'y'\n game_intro\n end \n until game_end? || @incorrect_guess == 8 \n #p @the_word\n guess\n incorrect_guess?\n hang_man_figure\n update_board\n save?\n end\n if game_end? != true\n puts \"\\n\" * 100\n hang_man_figure\n update_board\n puts \"SORRY, YOU LOST!!\" \n puts \"\\n\"\n puts \"The word was....#{@the_word.upcase}!!\"\n exit\n elsif game_end? == true\n puts \"\\n\" * 100\n hang_man_figure\n update_board\n puts \"OMG!\"\n puts \"#{@the_word.upcase} is the word!\"\n puts \"YOU WIN!!! =)\"\n puts \"******!*******!*****!*******!*****!*****!\"\n exit\n end\nend", "def check_guess(player_guess, display)\n letter_found = false\n @secret_word.chars.each_with_index do |char, index|\n if char.downcase == player_guess\n display[index] = char\n letter_found = true\n end\n end\n letter_found\n end", "def get_guess\n puts('type letter or whole capital:')\n guessed = gets.chomp\n unless valid_guess(guessed)\n puts 'only letters or spaces allowed'\n get_guess\n end\n guessed.upcase\n end", "def respond_to_guess(letter)\n letter = letter.clone.downcase\n\n if @incorrect_letters.include?(letter) || @progress.include?(letter) || @progress.include?(letter.upcase)\n puts \"You already guessed that letter!\"\n puts \"\"\n elsif @word.include?(letter) || @word.include?(letter.upcase)\n update_progress(letter)\n unless @progress.include?(\"_\")\n @round_finished = true\n @guessed = true\n end\n else\n @incorrect_letters << letter\n @round_finished = true if @incorrect_letters.size == 6\n end\n print_hangman\n end", "def turn\n\t\t\t@turns += 1\n\t\t\t@guess_letter = gets[0].downcase\n\t\t\tshow_matches\n\t\t\tcheck_win\n\t\tend", "def round\n show_guess\n show_lives\n show_bank\n puts ''\n set_letter(ask_letter)\n add_to_bank\n add_to_guess\n take_life unless check_choice\n end", "def check_guess(guess)\n @current_guess = guess.downcase\n if @current_guess == @secret_word\n player_won?\n elsif @current_guess.length > 1 || @current_guess.nil?\n @feedback = \"Invalid Guess!\"\n else\n @feedback = \"\"\n if @secret_word.include? @current_guess\n show_letter\n else\n @turns -= 1\n end\n @guesses << @current_guess\n end\n end", "def guess_letter(letter)\n won = false\n failed_guess = feedback(letter)\n if failed_guess\n @tries_left -= 1\n else\n won = won?(@display_word.split(\" \").join(\"\"))\n end\n won\n end", "def createGuess\n\t\tprint \"Please use lowercase letters a - f: \\n\" \n\t\tprint \"first spot: \" \n\t\tfirst = gets\n\t\tprint \"second spot: \" \n\t\tsecond = gets\n\t\tprint \"third spot: \" \n\t\tthird = gets\n\t\tprint \"fourth spot: \" \n\t\tfourth = gets\n\t\tguessBoard = [first.ord, second.ord, third.ord, fourth.ord]\n\t\tstore(guessBoard)\n\t\treturn [first.ord, second.ord, third.ord, fourth.ord]\n\tend", "def guess char\n #get 1st char\n \n if char.nil?\n raise ArgumentError, 'Argument is not string' \n return false\n end\n if char.length != 1\n raise ArgumentError, 'Argument is not string'\n return false\n end \n if char.match(/[a-zA-Z]/) == nil\n raise ArgumentError, 'Argument is not string' \n return false\n end\n \n pick = char.chr.downcase\n\n #catch replicant entries\n if @guesses.match(\"#{pick}\") != nil\n # @word_with_guesses << \"You have already used that letter\"\n return false\n end \n \n if @wrong_guesses.match(\"#{pick}\") != nil\n# @word_with_guesses << \"You have already used that letter\"\n return false\n end \n \n #actual match\n if @word.match(\"#{pick}\") != nil\n guesses << pick # 1st char\n else\n wrong_guesses << pick # \n @attempt += 1\n end\n \n # build up guess string i.e. \"----a-e\"\n @word_with_guesses = '';\n @check_win_or_lose = :win\n word.each_char { |a|\n if @guesses.match(\"#{a}\") != nil \n @word_with_guesses << a\n else\n @word_with_guesses << '-'\n @check_win_or_lose = :play\n end\n }\n \n #check game status\n if @attempt > 6\n @check_win_or_lose = :lose\n end\n \n return true\n end", "def guess(letter)\n # raise an execption\n # raise will 'break' the method if valid_guess? == false\n raise InvalidGuessException.new(\"Invalid guess!\") unless valid_guess?(letter)\n if word_has?(letter)\n \tput_letter_on_board(letter)\n else\n wrong_letter(letter) if [email protected]? letter\n end\n end", "def guess_hidden_word\n puts (\"Enter your guess: \")\n end", "def guessnumber\r\n\t\t@tries = @wordlength * 3 / 2\r\n\t\tputs \"player 2: you have #{@tries} guesses to get the word\"\r\n\tend", "def make_guess(guess)\n @previous_guesses << guess \n display_string = show_progress()\n if !goal_word.include?(guess) \n guess_counter()\n end \n if display_string == @goal_word\n @player_won = true \n end\n end", "def guess(guess)\r\n\t\t# Make sure the guess is either a letter or the whole word\r\n\t\tif guess.length != 1 && guess.length != @win_word.length\r\n\t\t\tp @remaining_guesses.to_s + \" guesses left\"\r\n\t\t\tp \"Guess a letter, or the complete word!\"\r\n\t\t# check for repeated guesses\r\n\t\telsif @past_guesses.include? guess\r\n\t\t\tp @remaining_guesses.to_s + \" guesses left\"\r\n\t\t\tp @hint\r\n\t\t\tp \"You guessed that already!\"\r\n\t\t# check if they guessed the entire word correctly\r\n\t\telsif guess == @win_word\r\n\t\t\twin\r\n\t\t# if the letter is not in the word\r\n\t\telsif !@win_word.include? guess\r\n\t\t\t# Add guess to arrayof past guesses\r\n\t\t\t@past_guesses << guess\r\n\t\t\tif @remaining_guesses == 1\r\n\t\t\t\tlose\r\n\t\t\telse\r\n\t\t\tguesses_remaining\r\n\t\t\tp @remaining_guesses.to_s + \" guesses left\"\r\n\t\t\tp @hint\r\n\t\t\tp \"Sorry, try again!\"\r\n\t\t\tend\r\n\t\t# if the letter is in the word\r\n\t\telsif @win_word.include? guess\r\n\t\t\t# Add guess to arrayof past guesses\r\n\t\t\t@past_guesses << guess\r\n\t\t\tguesses_remaining\r\n\t\t\tp @remaining_guesses.to_s + \" guesses left\"\r\n\t\t\tupdate_hint(guess)\r\n\t\t\tif @hint_str == @win_word\r\n\t\t\t\twin\r\n\t\t\telse\r\n\t\t\t\tp \"Nice guess!\"\r\n\t\t\tend\r\n\t\telse\r\n\t\t\tp \"Error\"\r\n\t\tend\r\n\r\n\tend", "def ask_play \n\tputs \" - Bon, tu joues quoi #{@name} ? je n'est pas que ca a faire !!! (Donne les coordonnees, ex : a1, b3, c2, etc.) \"\n\t@answer_play = gets.chomp \t\n end", "def get_new_letter\n loop do\n puts \"What letter would you like to guess?\"\n @guess = gets.chomp.downcase\n break if valid_letter?(@guess)\n end\n end", "def take_turn\n valid_input = false\n puts \"\"\n puts \"Current text is: #{@fragment}\"\n\n until valid_input\n player_char = @current_player.guess\n valid_input = valid_play?(player_char)\n unless valid_input\n @current_player.alert_invalid_guess\n end\n end\n\n @fragment += player_char\n end", "def guess_compare(guess)\n # Defining correct_guess as a guess where the letter is properly included\n correct_guess = @secret_word.include? guess\n if correct_guess == true\n puts \"The letter #{guess} is correct! Good job!\"\n print_teaser guess\n else\n @lives -= 1\n puts \"The letter #{guess} is incorrect!\"\n puts \"The hangman has #{@lives} lives left!\"\n end\n player_guess\n end", "def guess(letter)\n # STEP 1: check to make sure the letter is not any non-letter character and\n # raises an error if it is\n if /^[a-zA-Z]+$/.match(letter)\n letter.downcase!\n else raise_error(\"Invalid letter\")\n end\n\n # STEP 2: check to make sure the user does not guess the same letter more\n # than once\n if @guesses.include? letter; return false; end\n if @wrong_guesses.include? letter; return false; end\n\n # STEP 3: check to see if the guessed letter matches any letters in the \n # word\n if @word.include? letter\n @guesses += letter\n # if there is a match, update the word_with_guesses to show where\n # in the string the letter was matched\n @word.each_char.with_index do |c, i|\n if c == letter\n @word_with_guesses[i] = c\n end\n end \n else \n @wrong_guesses += letter\n @attempts += 1\n end\n # update the number of attempts and call the function to check if\n # the user won, lost, or continues playing\n check_win_or_lose\n end", "def guess?(letter)\n correct = false\n @@secret.length.times do |i|\n if (@@secret[i] == letter && @@progress[i] == '_')\n @@progress[i] = letter\n correct = true\n end\n end\n @@incorrect << letter if !correct\n @@guesses += 1\n puts(\"secret: #{@@secret}\")\n correct\n end", "def play_round\n puts @game_word + \"\\n\\n\"\n guess = @curr_player.get_guess\n if correct_guess?(guess)\n @curr_player.correct_guesses += [guess]\n else\n @curr_player.guesses_remaining -= 1\n @curr_player.incorrect_guesses += [guess]\n end\n puts \"#{@curr_player.name}'s' incorrect guesses: #{@curr_player.incorrect_guesses}\"\n puts \"#{@curr_player.name}'s guesses remaining: #{@curr_player.guesses_remaining}\"\n puts \"#{@curr_player.name}'s available points: #{@curr_player.correct_guesses.length * @secret_word.length}\"\n puts \"#{@curr_player.name}'s flower: \"\n puts File.read(\"flower#{@curr_player.guesses_remaining}.txt\")\n puts \"_____________________________________\"\n puts \"\\n\\n\"\n @curr_player_index = (@curr_player_index + 1) % 2\n @curr_player = @players[@curr_player_index]\n end", "def guessed\n\n end", "def correct_guess(guess)\n end", "def check_win_or_lose\n # if guessed letters are 7 then lose\n if self.wrong_guesses.length >= 7\n :lose\n elsif all_letters_in_word_in_guesses?\n :win\n else\n :play\n end\n end", "def game_display\n puts \" \"\n puts \" \"\n puts \"At any time, type 'save' to save and exit\"\n puts \"Guess progress: #{@secret_display}\"\n puts \"Wrong guesses: #{@wrong_guesses}\"\n puts \"Guesses remaining: #{@guess_count}\"\n end", "def round(game_status)\n puts \"Guess a new letter! Otherwise, enter 1 to solve the puzzle, 0 to quit, or 5 to save your game.\"\n guess = gets.chomp.downcase\n if guess == \"0\"\n puts \"Thanks for playing! Bye!\"\n return false\n elsif guess == \"1\"\n # Let the player guess the full answer.\n word_guess = gets.chomp.downcase.strip.split(\"\")\n if word_guess == game_status[:secret_word]\n puts \"Congratulations! You win!\"\n return false\n else\n puts \"Sorry, that's not the secret word.\"\n round(game_status)\n end\n elsif guess == \"5\"\n # Save the game.\n save_state = game_status.to_yaml\n savefile = File.open(\"savefile.txt\", \"w\") { |f| f.puts save_state}\n puts \"Your current game has been saved. See you again soon!\"\n return false\n elsif guess.length > 1\n puts \"Please enter only one letter at a time. Try again.\"\n round(game_status)\n else\n if game_status[:secret_word].include?(guess)\n game_status[:secret_word].each_with_index do |letter, i|\n game_status[:word][i] = guess if game_status[:secret_word][i] == guess\n end\n else\n game_status[:incorrect_guesses] << guess\n end\n show_board(game_status)\n end\n game_status\n end", "def start_guess\r\n\t\tuntil @is_over == true\r\n\t#player enters 1 letter string\r\n\r\n\t\t\tputs \"guess a letter you've already guessed #{@used}. #{@tries-@guess_count} attempts remain\"\r\n\t\t\tputs @blanks.join\r\n\t\t\tletter = gets.chomp\r\n\t#if letter is not in guessed box take a turn away\r\n\t\t\tif @used.include?(letter) == false\r\n\t\t\t\t@guess_count += 1\r\n\t\t\t\tif @tries == @guess_count \r\n\t\t\t\t\t@is_over = true\r\n\t\t\t\tend\r\n\t\t#if letter is in the world replace the blank\r\n\t\t\t\tif @word.include?(letter)\r\n\t\t\t\t\twordindex = @word.index(letter)\r\n\t\t\t\t\t@blanks[wordindex] = letter\r\n\t\t\t\t\tif @blanks.include?(\"_ \") == false\r\n\t\t\t\t\t\t@is_over = true\r\n\t\t\t\t\tend\r\n\t\t#if letter is not in the world add to guessed box\r\n\t\t\t\telse\r\n\t\t\t\t\t@used << letter\r\n\t\t\t\tend\r\n\t#if letter is in guessed box don't consume a turn\r\n\t\t\telse\r\n\t\t\t\tputs \"you already tried that letter\"\r\n\t\t\tend\r\n\t\tend\r\n\r\n\t#end:\r\n\t#if word is guessed correctly print congrants\r\n\t\tif @blanks.include?(\"_ \")\r\n\t\t\tputs \"haha try harder next time\"\r\n\t#if word is guessed wrong print taunt\r\n\t\telse\r\n\t\t\tputs \"well done! you guessed the word\"\r\n\t\tend\r\n\tend", "def run_guessing_game\n\n player_guess = ''\n\n until player_guess == 'exit'\n welcome\n player_guess = get_player_guess\n check_guess(player_guess)\n end\nend", "def guess\n\t\tcollect_words_of_length\n\t\tputs \"Already guessed letters by computer: #{@guessed_letters}\"\n\t\t@guessing_letter = nil\n\t\twhile @guessing_letter == nil || invalid?(@guessing_letter)\n\t\t\t@guessing_letter = guessing_letter\n\t\tend\n\t\t@guessed_letters << @guessing_letter\n\t\t@guessing_letter\n\tend", "def save_game_state(numberOfGuesses, secretWord, secretWordString, letterCorrectGuesses, letterWrongGuesses, win)\n puts \"Do you want to save your current file state? [y/N]\"\n answer_open = gets.chomp\n if answer_open != \"\" && answer_open.downcase[0] != \"n\"\n puts \"What pre-name do you want to give to your file?\"\n puts \"(press enter to save to the file opened at the beginning of the game)\"\n pre_name = gets.chomp\n\n if pre_name === \"\"\n name = Dir.glob(\"game_states/*_game_state.txt\")[$number]\n else\n name = \"game_states/#{pre_name}_game_state.txt\"\n end\n\n File.write(name,\n \"\"\" number_of_guesses = #{numberOfGuesses}\n secret_word_string = \\\"#{secretWordString}\\\"\n secret_word = #{secretWord}\n letter_correct_guesses = #{letterCorrectGuesses}\n letter_wrong_guesses = #{letterWrongGuesses}\n win = #{win}\"\"\")\n File.write(\"last_saved.txt\", name)\n puts \"Your game state is saved in #{name}\"\n end\n\n puts \"Do you want to exit the game? [y/N]\"\n answer_exit = gets.chomp\n ex = answer_exit != \"\" && answer_exit.downcase[0] != \"n\"\n puts \"Exiting game...\" if ex\n return ex\nend", "def play_turn(solution_arr)\n char = user_input(INPUT_MSGS['to_play'])\n return false unless char\n return false if duplicate_guess(char)\n\n if char == GAME_SAVE\n SaveGame.new(solution_arr, @turn, @wrong_arr, @guess_arr, @resolved_arr)\n else\n user_turn(solution_arr, char)\n display_turn_results\n end\n end", "def update\n respond_to do |format|\n if @round.make_guess(params[\"round\"][\"guessed_letter\"])\n update_current_player\n format.html { redirect_to game_round_path(@game, @round) }\n format.json { render :show, status: :created, location: @round }\n else\n format.html { redirect_to game_round_path(@game, @round), notice: 'Invalid guess' }\n format.json { render :show, status: :created, location: @round }\n end\n end\n end", "def load_prompt\n puts 'Do you want to load a saved game? (yes/no)'\n answer = gets.chomp\n if answer == 'yes'\n load_game\n else\n puts \"Enter 'save' to save the game between turns\"\n round_start\n end\n end", "def guess(name)\n choose(name)\n click_button(\"Guess\")\n end", "def make_guess\n\t\tget_colors_from_player MAKE_GUESS_PROMPT\n\tend", "def guess_final_word_or_letter\n\t\tputs \"\"\n\t\tputs display_word\n\t\tputs \"\"\n\t\tputs \"Choose to guess a word or letter.\"\n\t\tputs \"Enter 'l' to guess a letter or enter 'w' to guess the final word and solve the puzzle.\"\n\t\tfinal_word_or_letter_choice = gets.chomp.downcase\n\t\tif final_word_or_letter_choice == \"w\"\n\t\t\tfinal_guess\n\t\telsif final_word_or_letter_choice == 'l'\n\t\t\tevaluate_letter\n\t\telse\n\t\t\tputs \"That is not a valid input, please try again!\"\n\t\t\tputs \"\"\n\t\t\tsleep(1)\n\t\t\tguess_final_word_or_letter\n\t\tend\n\tend", "def guess(letter)\n raise InvalidGuessException.new(\"Invalid Guess!\") unless valid_guess?(letter)\n \n if word_has?(letter)\n \tput_letter_on_board(letter)\n else\n wrong_letter(letter) if [email protected]? letter\n end\n end", "def play\n while @tries.positive?\n print_guesses_remaining\n print_used_letters\n print_word\n\n input = scan_letter\n\n result = process_letter(input)\n\n if %w[save exit].include? result\n process_forced_exit(result)\n return\n end\n\n next unless win?\n\n print_word\n puts 'You won!'.green\n return\n end\n\n puts \"You lost! The word was #{@key}\".red\n end", "def show_board\n\t\tputs \"You have use #{@turn} of 9 turns. Type \\\"save\\\" to save game and quit.\"\n\t\tshow_hangman\n\t\tputs \"Word: #{@guess.split(\"\").join(\" \")}\"\n\t\tputs\n\t\tputs \"Misses: #{@wrong_letters.split(\"\").join(\" \")}\"\n\t\tputs\n\tend", "def ask_for_guess\n @guess_count += 1\n @guess = get_code(\"Please enter your guess in the format 'color color color color'(to list available color options enter 'options'):\")\n end", "def check_guess(guess)\n # checks human guess, displays discovered, and return if letter found\n letter_found = false\n self.secret_word.split('').each_with_index do |chr, ind|\n if chr == guess\n self.currently_discovered[ind] = chr\n letter_found = true\n end\n end\n p self.currently_discovered\n letter_found\n end", "def guess(hints = nil, turn = nil)\n computer_guess = get_guess(hints, turn)\n puts \"#{computer_guess[0]}, #{computer_guess[1]}, #{computer_guess[2]}, #{computer_guess[3]}\"\n computer_guess\n end", "def prompt\n if @first_guess\n first_turn\n else\n second_turn\n end\n end", "def get_guess\n @user_guess = \"\"\n if @count >= 5\n abort(\"You guessed 5 times incorrectly. You Lose\")\n else\n while guess_letters_check\n print \"You must guess exactly 4 colors (R,Y,B,P,O,G).\\nGuess here:\"\n @user_guess = gets.chomp.upcase\n end\n end\n @count += 1\n check_guess(@user_guess)\n end", "def capture_guess(user_input)\n @guess = user_input.scan(/./)\n end", "def begin_guessing\r\n\t while @turn_count > 0 do\r\n\t puts \"\\nPlease enter 'guess' if you would like to guess the word. Otherwise, please enter a single letter guess.\"\r\n\t guess_input = gets.chomp\r\n\t\t\r\n\t\t# Handles the case if the user wants to guess the word\r\n\t\tif guess_input.downcase == \"guess\"\r\n\t\t puts \"\\nPlease enter your guess.\"\r\n\t\t full_guess = gets.chomp\r\n\t\t full_guess.downcase!\r\n\t\t if full_guess == @secret_word \r\n\t\t win_game \r\n\t\t else \r\n\t\t @turn_count -= 1\r\n\t\t puts \"\\nIncorrect guess.\"\r\n\t\t\tend_turn\r\n\t\t end\r\n\t\t \r\n\t\t# Handles the case if the user wants to guess a letter\r\n\t\telse\r\n\t guess_letter = guess_input[0].downcase\r\n\t game_board(guess_letter)\r\n\t\tend\r\n\t end\r\n\t lose_game if @turn_count == 0\r\n\tend", "def game_play\n self.new_round # Start new round\n loop do\n puts \"Your Guess:\"\n @input = gets.chomp # Gets user input by making a prompt and capturing the input, chomp method removes the new line which would otherwise be stored in the input string\n if @input != \"/\"\n if @@word.legal?(@input)\n if self.check_guess\n puts \"Correct! You got the answer in #{@guess_count} guesses!\" # Use string interpolation instead of concatenating to include guess count\n\n self.new_round\n puts @current_word\n end\n puts \"You have #{MAX_GUESS - @guess_count} guesses remaining.\\n?????\" # Calculations can be made in string interpolation too\n else\n puts \"That guess doesn't count! Your guess can only be 5 characters in length, contain no duplicate letters and only contain letters.\" # Guess isn't a legal word\n end\n self.check_lost # Check if player has exhausted amount of guesses\n else\n exit\n end\n\t\tend\n\tend", "def check_win_or_lose\n if !@word_with_guesses.include?(\"-\")\n return :win\n elsif @word_with_guesses.include?(\"-\") && @attempts >= 8\n return :lose\n else \n return :play \n end\n end", "def get_input\n if previous_guess\n second_guess\n else\n first_guess\n end\n end", "def guess\n letters = @possible_letters.collect {|letter| [ score_for(letter),letter ]}\n letter = letters.min {|letter1,letter2| letter1 <=> letter2 }\n letter[1]\n end" ]
[ "0.8209502", "0.79731876", "0.7910549", "0.78682166", "0.7824495", "0.77333856", "0.77190953", "0.74309194", "0.73901296", "0.73671865", "0.72809607", "0.7272136", "0.7267714", "0.7241885", "0.7195924", "0.7174577", "0.7109691", "0.70436954", "0.69391716", "0.6894063", "0.68677205", "0.68661994", "0.6858094", "0.68554497", "0.6837272", "0.6820606", "0.6819971", "0.68154204", "0.67668974", "0.67487097", "0.6743543", "0.67390424", "0.6737622", "0.67332417", "0.66933465", "0.6693253", "0.66877955", "0.6676894", "0.6675608", "0.6675006", "0.6668857", "0.6647056", "0.66415274", "0.66407627", "0.6622809", "0.6617265", "0.65955263", "0.658882", "0.6587863", "0.6584455", "0.6574928", "0.6544774", "0.6539741", "0.6498725", "0.6484727", "0.64554125", "0.6440147", "0.64296573", "0.64229155", "0.64200395", "0.6413502", "0.6410899", "0.6409028", "0.6405729", "0.6404418", "0.64027274", "0.63987696", "0.63778675", "0.6376025", "0.6371833", "0.63612425", "0.6360835", "0.6358531", "0.63565516", "0.63565314", "0.63521165", "0.6351422", "0.63501316", "0.63490057", "0.6346049", "0.6342311", "0.63403267", "0.63285273", "0.63184834", "0.6316441", "0.6314438", "0.631251", "0.6307185", "0.62930286", "0.62918085", "0.6291764", "0.62909937", "0.62799317", "0.627615", "0.6267977", "0.6264709", "0.6262042", "0.6260084", "0.62543887", "0.6251761" ]
0.845249
0
Load a previously saved game and resume game play from last save
def load_game all_saved_games = yaml_load(SAVED_FILENAME) game_name = get_game_name(all_saved_games, "load") return if game_name.nil? saved_game = YAML::load(all_saved_games[game_name]) message_then_enter "'#{ game_name }' successfully loaded." saved_game.play_game end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_game_from_save\n #TODO implement game state saving and loading\n end", "def load_game\n print_saves\n begin\n read_save\n rescue IOError, SystemCallError\n puts 'File not found'\n load_game\n end\n end", "def load_game\n\t\tload_gameplay = YAML.load(File.read 'saved_game.yaml')\n\t\t@board = load_gameplay[0]\n\t\t@current_player = load_gameplay[1]\n\t\tshow_board\n\t\tinput_validation\n\tend", "def load_game\n save_file = YAML.load(File.read('save_game.yml'))\n @guess = save_file['guess']\n @secret_word = save_file['secret_word']\n @word_teaser = save_file['word_teaser']\n @lives = save_file['lives']\n round_start\n end", "def load #TODO: validation\n \tputs \"What game do you want to load?\"\n \tsaved_game = gets.chomp.gsub(' ', '_')\n \tsaved_game = \"#{saved_game}.yaml\"\n \tload_game(saved_game)\n end", "def load_game\n file = File.open(\"../saves/log.yml\", \"r\")\n s_log = file.read.to_i\n file.close\n if s_log == 0\n puts \"No save data.\"\n else\n puts \"Select a save file (1 to #{s_log}).\"\n s_choice = gets.chomp.to_i\n if s_choice <= s_log\n puts \"Loading save game # #{s_choice}...\"\n game_state = YAML.load(File.read(\"../saves/save_#{s_choice}.yml\"))\n game_state.play\n else\n puts \"Selected save file does not exist.\"\n end\n end\n end", "def load \n \tputs \"Type 'load' to load an existing game, or press Enter to continue.\"\n \tanswer = gets.chomp.downcase\n \tif answer == 'load'\n data = YAML.load_file('store.yml')\n @turns = data.turns\n @lives = data.lives\n @wrong = data.wrong\n @right = data.right\n @word= data.word\n puts \"Loading...\"\n sleep(2)\n end\n\n end", "def load_game\n if File.exists?(@save_file)\n File.open(@save_file, 'r') do |f|\n @hero = Marshal.load(f)\n end\n @cmd_window.setpos(0,0)\n @cmd_window << \"Game loaded!\".rjust(CMD_WIDTH)\n else\n @cmd_window.setpos(0,0)\n @cmd_window << \"No save file found!\".rjust(CMD_WIDTH)\n end\n end", "def load\n puts \"Would you like to load your previous game? (y/n)\"\n puts \"\"\n response = gets.strip.downcase\n puts \"\"\n if response == \"y\" && File.exist?(\"saves.yaml\")\n save = File.read(\"saves.yaml\")\n @computer = YAML::load(save)\n puts \"Your game has been loaded!\"\n puts \"\"\n else\n puts \"New game created!\"\n puts \"\"\n end\n end", "def load_game(i)\n sys('load')\n File.open(filename(i), \"rb\") do |file|\n Marshal.load(file)\n extract_save_contents(Marshal.load(file))\n $game.reload\n @index = i\n end\n return true\n end", "def load_or_new_game\n puts \"Welcome to Hangman!\"\n if File.exist?(\"savefile.txt\")\n puts \"Would you like to (1) load your saved game or (2) start a new game? Please enter 1 or 2.\"\n answer = gets.chomp\n if answer == \"1\"\n save_state = File.read(\"savefile.txt\")\n status = YAML.load(save_state)\n File.delete(\"savefile.txt\")\n else\n status = start_game\n end\n else \n status = start_game\n end\n show_board(status)\n return status\n end", "def load\n file_name = ask_save_file\n save_file = File.open(file_name, 'r')\n save_file.pos = 0\n contents = unserialize(save_file.read)\n @name = contents['name']\n @guess = contents['guess']\n @word = contents['word']\n @bank = contents['bank']\n @lives = contents['lives']\n @letter = contents['letter']\n puts \"Game has been loaded from Save File #{file_name[-5]}!\"\n puts \"\\n\\n\"\n end", "def endgame()\n\t\t@database = Database.new\n\t\[email protected]_files(@players)\n\t\[email protected]_files\n\tend", "def save_game\n\t\t# If current game was previously saved, delete the old version of current game...\n\t\tif @running_saved_game != nil\n\t\t\tover_write_data\n\t\tend\n\t\t# And add new version of current game to saved data\n\t\tFile.open(@path, 'a+') do |f|\n\t\t\t\tf.puts \"#{@word.join},#{@guess},#{@wrong_letters},#{@turn}\"\n\t\tend\n\tend", "def load_state\n begin\n save_file = File.read(\"saved_state.json\")\n rescue\n return \"No saved game found\"\n end\n json_hash = JSON.parse(save_file)\n json_hash[\"json_board\"].each do |key, value|\n value == nil ? @board[key] = nil : \n @board[key] = Chess.const_get(value[\"class\"]).new(value[\"team\"])\n end\n @current_player = json_hash[\"current_player\"]\n return \"Game loaded\"\n end", "def load_game?\n\t\tputs \"Would you like to load a previously saved game\"\n\t\tputs \"(yes or no)\"\n\t\tanswer = gets.chomp.downcase\n\t\tif answer == \"yes\"\n\t\t\tload\n\t\telsif answer == \"no\"\n\t\t\treturn\n\t\telse\n\t\t\tputs \"I did not understand that answer, try again\"\n\t\t\tload_game?\n\t\tend\n\tend", "def load_prompt\n puts 'Do you want to load a saved game? (yes/no)'\n answer = gets.chomp\n if answer == 'yes'\n load_game\n else\n puts \"Enter 'save' to save the game between turns\"\n round_start\n end\n end", "def restart_game\n @level = 0\n @level = Level.new(self)\n @player = Player.new(self, @level.start_x, @level.start_y)\n\n @menu_options = [\n :Play,\n :Instructions,\n :\"Save/Load\",\n :Quit\n ]\n\n @menu_selection = 0\n\n @state = :menu\n @paused = false\n end", "def save_game\n\t\tall_saved_games = yaml_load(SAVED_FILENAME)\n\t\tgame_name = get_save_name(all_saved_games)\n\t\treturn if game_name.nil?\n\n\t\tgame_string = self.to_yaml \n\t\tall_saved_games[game_name] = game_string\n\t\tyaml_save(SAVED_FILENAME, all_saved_games)\n\t\tmessage_then_enter \"'#{ game_name }' successfully saved.\"\n\tend", "def load_game\n $pokemon_party = @all_window[@index].data\n $pokemon_party.expand_global_var\n $pokemon_party.load_parameters\n $game_system.se_play($data_system.cursor_se)\n $game_map.setup($game_map.map_id)\n $game_player.moveto($game_player.x, $game_player.y) # center\n $game_party.refresh\n $game_system.bgm_play($game_system.playing_bgm)\n $game_system.bgs_play($game_system.playing_bgs)\n $game_map.update\n $game_temp.message_window_showing = false\n $trainer.load_time\n Pathfinding.load\n end", "def loadGame()\n\nend", "def determine_savefile\n if @saving\n if FileTest.exist?(make_filename(@last_slot_index))\n Sound.play_decision\n @confirm_window.show()\n @window_slotlist.active=false\n else\n Sound.play_save\n do_save()\n end\n else\n if FileTest.exist?(make_filename(@last_slot_index))\n Sound.play_load\n do_load()\n else\n Sound.play_buzzer\n end\n end\n end", "def load(game)\n\t\[email protected](game)\n\t\treturn self\n\tend", "def load_game\n\t\tprint \"Load game (y/n): \"\n\t\tload = gets.chomp.downcase[0]\n\t\treturn false if load == 'n'\n\t\treturn loader if load == 'y'\n\t\tload_game if (load != 'n' || load != 'y')\n\tend", "def load\n flush\n replay\n end", "def save_with_load\r\n @oksave = true\r\n save\r\n @oksave = nil\r\n end", "def save_game\n\t\tDir.mkdir('saved_games') unless Dir.exist? 'saved_games'\n\t\tDir.chdir(\"saved_games\")\n\t\tdata = save\n\t\tFile.open(\"save.yaml\", \"w\") do |file|\n\t\t\tsaved_games = YAML::dump(data)\n\t\t\tfile.write(saved_games)\n\t\tend\n\t\tputs \"Games Saved!!\"\n\t\tabort\n\tend", "def save_game\n\t\tputs \"Type a name for your saved game\"\n\t\tgame_name = gets.chomp\t\n\t\tfilename = \"#{game_name}.yml\"\n\n\t\t ex_file = File.expand_path(\"./saved_games/#{filename}\")\n\t\t \n\t\tif File.exists?(ex_file)\n\t puts \"#{filename} exists\" #overwrite method?\n\t \n\t self.save_game\n\t else\n\t\t\tFile.open(ex_file, \"w\") do |f|\n\t\t\t\tgame_state = YAML::dump(self)\n\t\t\t\tf.puts game_state\n\t\t\t\tputs \"Your game was saved as #{filename}\" \n\t\t\tend\n\t\tend\n\tend", "def go_game\n #RPG::BGM.fade(30)\n #Graphics.fadeout(30)\n #Graphics.frame_count = 0\n DataManager.autosave(true, false)\n SceneManager.goto(Scene_Map)\n #$game_system.on_after_load\n end", "def load_menu\n\t\ti = 1\n File.new(\"saved_games.yaml\",\"w\") unless File.exist?(\"saved_games.yaml\")\n if File.read(\"saved_games.yaml\").empty?\n puts \"There are no saved games, yet.\"\n initialize\n else\n YAML.load_stream(File.open(\"saved_games.yaml\")) do |saved_game|\n puts \"#{i}: \" + saved_game[-1].strftime(\"%m/%d/%Y %I:%M%P\")\n i += 1\n end\n puts \"\"\n puts \"Choose a game to load or \\\"exit\\\" to menu:\"\n game_index = gets.chomp.strip.downcase\n if game_index == \"exit\"\n initialize\n elsif game_index.to_i <= i && game_index.to_i >= 1\n game_index = game_index.to_i\n i = 1\n File.new(\"temp.yaml\",\"w\")\n puts \"\"\n YAML.load_stream(File.open(\"saved_games.yaml\")) do |game|\n if i == game_index\n \t@gameboard = game[0]\n @pieces = game[1]\n @player_color = game[2]\n else\n File.open(\"temp.yaml\",\"a\") do |out|\n YAML::dump(game,out)\n end\n end\n i += 1\n end\n File.delete(\"saved_games.yaml\")\n File.rename(\"temp.yaml\",\"saved_games.yaml\")\n Chess.new(@gameboard,@pieces,@player_color)\n else\n puts \"Invalid input. Try again...\"\n puts \"\"\n load_menu\n end\n end\n\tend", "def load_game\n begin\n display_saves\n choice = gets.chomp\n raise StandardError, 'Please choose an option from the above list.' unless choice.to_i.between?(0,\n Dir.children('./saves').size - 1)\n rescue StandardError => e\n puts e.message\n retry\n end\n\n \"./saves/#{Dir.children('./saves')[choice.to_i]}\"\nend", "def save_curr_game(fname)\n @log.debug \"Don't save the network game\"\n end", "def restore_run\n if $game_player.run_points < StandWalkRun::Run_points\n wait(1, true)\n $game_player.run_points += 1 if @wait_time2 == StandWalkRun::Run_points_restore\n @wait_time2 = 0 if @wait_time2 == StandWalkRun::Run_points_restore\n end\n end", "def restore_run\n if $game_player.run_points < StandWalkRun::Run_points\n wait(1, true)\n $game_player.run_points += 1 if @wait_time2 == StandWalkRun::Run_points_restore\n @wait_time2 = 0 if @wait_time2 == StandWalkRun::Run_points_restore\n end\n end", "def start\n $game_variables[VAR] = {}\n $game_variables[VAR2] = {}\n @load_hash = nil\n @load_item_hash = nil\n @item_amounts = {}\n save_turn_data\n end", "def save_game\n\t\tputs \"Type a name for your saved game\"\n\t\tgame_name = gets.chomp\n\t\tfilename = \"#{game_name}.txt\"\n\n\t\t ex_file = File.expand_path(\"./saved_games/#{filename}\")\n\t\t \n\t\tif File.exists?(ex_file)\n\t puts \"#{filename} exists\" #overwrite method?\n\t \n\t self.save_game\n\t else\n\t\t\tFile.open(ex_file, \"w\") do |f|\n\n\t\t\t\tf.puts YAML::dump(game_state)\n\n\t\t\t\tputs \"Your game was saved as #{filename}\" \n\t\t\tend\n\t\tend\n\tend", "def restart_game\n\t\tclear_screen\n\t\tpause_game(@pause)\n\t\t@asteroids_missed = 0\n\t\t@asteroids_hit = 0\n\t\t@asteroids_hit_missles = 0\n\t\t@shots_fired = 0\n\t\t@missles_fired = 0\n\t\t@pause = false\n\t\t@game_done = false\n\t\t@win = false\n\t\t@level = $StartingLevel\n\t\t@level_time = Time.now + $TimeLimit\n\tend", "def loadGame \n \"loadGame\" \n end", "def restore(name)\n Session.instance.load name\n end", "def play_round\n unless @continuing_saved_game == true\n reset_round_stats\n set_word_arrays\n end\n show_round_status # @continuing_saved_game reset to false here\n until @round_over\n guess = guess_letter\n break if guess == \"SAVE\" || guess == \"EXIT\"\n update_round(guess)\n check_round_over?\n update_score if @round_over == true\n show_round_status\n end\n end", "def save_game\n Dir.mkdir(\"../saves\") unless Dir.exists?(\"../saves\")\n @@save_count += 1\n binding.pry\n log_saves\n savefile = \"../saves/save_#{@@save_count}.yml\"\n File.open(savefile, 'w') do | file |\n file.write(self.to_yaml)\n end\n end", "def hangman\n game = Game.new\n game.new_or_load\n hangman if game.play_again\nend", "def load_resume\n if ( $cache_time.nil? || File.mtime(\"#{Rails.root}/files/resume.yml\") < $cache_time || [$resume].any?(&:nil?) )\n $cache_time = Time.now\n $resume = YAML.load(File.read('files/resume.yml'))\n end\n @resume = $resume\n end", "def load_game\n puts \"Would you like to load a saved game?\"\n puts \"Enter \\\"y\\\" or \\\"n\\\":\"\n input = gets.chomp\n if input != \"\" && input[0].downcase == \"y\"\n game = YAML.load(File.read(\"hangman.yaml\"))\n @word = game[:word]\n @max_turn = game[:max_turn]\n @current_turn = game[:current_turn]\n @display_word = game[:display_word]\n @current_guess = game[:current_turn]\n end\n puts \"Game is loaded!\"\n end", "def prompt_user_to_load_game\n saved_games = get_saved_games\n if saved_games.empty? then return false end\n\n print \"Would you like to load a saved game? [y/N]: \"\n input = gets.chomp.downcase\n puts\n if input != \"y\" then return false end\n\n if saved_games.length == 1 then return load_game(saved_games[0]) end\n\n saved_games.each_with_index do |saved_game, index|\n saved_game_name = saved_game.gsub(/\\.save\\.yaml/, \"\")\n puts \"(#{index}) #{saved_game_name}\"\n end\n puts\n print \"Enter number: \"\n save_number = gets.chomp.to_i\n puts\n if not (0...saved_games.length).cover?(save_number)\n save_number = 0\n end\n\n puts \"Loading game #{save_number}...\"\n return load_game(saved_games[save_number])\n end", "def load_into_cog(filename: 'savefile')\n game_state = nil\n File.open(\"saves/#{filename}.bin\", 'rb') do |f|\n game_state = Marshal.load(f)\n end\n save_cog(game_state: game_state, filename: filename)\n end", "def save_game\n store = YAML.dump(self)\n File.open('lib/saved_game.yml', 'w') do |file|\n file.puts(store)\n end\n puts 'your game has been saved!'\n end", "def bgm_restore\n bgm_play(@memorized_bgm)\n end", "def load_save\n return {} unless File.exist?(DEFAULT_SAVE)\n\n save_file_contents = YAML.unsafe_load_file(DEFAULT_SAVE)\n save_file_contents ||= {} # if game save file is empty\n\n raise GameSaveError, 'Invalid game save format.' unless save_file_contents.is_a?(Hash)\n\n save_file_contents.to_symbolized_hash\n end", "def force_save\n GamePlay::Save.save\n end", "def action\n Graphics.freeze\n if @all_window[@index].is_a?(UI::SaveWindow)\n Save.save_index = @all_window[@index].index if MAXIMUM_SAVE > 1\n if @all_window[@index].data\n load_game\n else\n Save.save_index -= 1 if MAXIMUM_SAVE > 1\n create_new_party\n $pokemon_party.expand_global_var\n $game_system.se_play($data_system.cursor_se)\n $game_map.update\n end\n else\n return custom_action\n end\n $trainer.redefine_var\n Yuki::FollowMe.set_battle_entry\n $pokemon_party.env.reset_zone\n $scene = Scene_Map.new\n Yuki::TJN.force_update_tone\n @running = false\n end", "def start\n puts \"Load game or start new?\"\n puts \"Type 'load' to load a previous save, or type 'new' to start a new game.\"\n game_type = gets.chomp.downcase.strip\n if game_type == \"load\"\n load\n elsif game_type == \"new\"\n load_secret_word\n init_guess_count\n @wrong_guesses = []\n else\n start\n end\n end", "def load_game\n @game = Game.find params[:id]\n head :unprocessable_entity unless @game\n end", "def save_game\n\t\tsaves = []\n\t\tsaves << @board\n\t\tsaves << @current_player\n\t\tsave_yaml = YAML.dump(saves)\n\n\t\tFile.open('saved_game.yaml', 'w') do |file|\n\t\t\tfile.puts save_yaml\n\t\tend\n\t\tputs \"Your game has been saved.\"\n\t\tputs \"Closing the game...\"\n\t\texit\n\tend", "def load_game\n\tsettings.game_data = Ben::Game.load\n\tgame_json\nend", "def on_load_success\r\n Sound.play_load\r\n fadeout_all\r\n $game_system.on_after_load\r\n SceneManager.goto(Scene_Map)\r\n end", "def backup_game(game_name)\n games = GameList.from_config\n game = games.find_game(game_name)\n\n couldnt_find_game!(game_name) unless game\n run_backup!(game)\n end", "def load_state()\n if session[:game_state_id] == nil\n send_code(\"E03\")\n return false\n else\n @game_state_id = session[:game_state_id]\n end\n\n @game_state = GameState.find_by(id: @game_state_id)\n @problem = Problem.find_by(id: @game_state.problem_id)\n begin\n @ia_player = IaSgf.new(@problem.ia_color, @problem.problem_file)\n rescue MyError::IaInitError\n send_code(\"E00\")\n return false\n end\n begin\n @ia_player.catch_up(@game_state.board.move_history)\n rescue MyError::IaError => e\n puts \"ERREUR ===============================================\"\n puts e.message\n puts e.backtrace\n puts \"======================================================\"\n send_code(\"E01\")\n return false\n end\n\n return true\n end", "def play_game\n \twhile true\n \t\[email protected]_game_state(@word, @misses, @hits, @guesses_left)\n \t\tbreak if game_over?\n \t\tguess = get_guess\n \t\tbreak if guess == :save\n \t\tupdate_game_state guess\n \tend\n \tsave_game if guess == :save\n\tend", "def start_game\n puts \"What would you like to do?\"\n puts \"1. Load Saved Game\"\n puts \"2. Start New Game\"\n choice = gets.chomp\n if choice == \"1\"\n find_save_file\n elsif choice == \"2\"\n initialize\n end\n end", "def start_game\n puts \"What would you like to do?\"\n puts \"1. Load Saved Game\"\n puts \"2. Start New Game\"\n choice = gets.chomp\n if choice == \"1\"\n find_save_file\n elsif choice == \"2\"\n initialize\n end\n end", "def check_up\n return delete_game_question if @delete_game\n # Make sure the save index is correct when multi save is allowed\n Save.save_index = 1 if MAXIMUM_SAVE > 1\n return create_new_game unless find_save\n @all_window.each { |window| window.visible = true }\n Graphics.transition\n end", "def load()\n code = File.open(@filename) {|file| file.read}\n dup = @players.last.dup\n begin\n dup.reset\n dup.instance_eval(code)\n @players.push(dup)\n rescue\n puts \"LOAD ERROR #{$!}\"\n end\n @load_time = Time.now.to_i\n end", "def sync\n @game.sync\n end", "def play_game_with_current_moves\n winners = get_games_winners\n save_winners(winners) unless winners.nil?\n winners\n end", "def open_save\n @in_save = true\n call_scene(Save) do |scene|\n @running = false if scene.saved\n Graphics.transition\n end\n @in_save = false\n end", "def save_game\n @drawing= false\n puts \"Save game...\"\n db = Db.new\n score = @window.level.mouse.score\n lvl = @window.level.num\n name = Time.now.strftime(\"%d/%m/%Y %H:%M\")\n db.save_game name, score, lvl\n end", "def prompt_save_deletion\r\n pbMessage(_INTL('The save file is corrupt, or is incompatible with this game.'))\r\n exit unless pbConfirmMessageSerious(\r\n _INTL('Do you want to delete the save file and start anew?')\r\n )\r\n self.delete_save_data\r\n $game_system = Game_System.new\r\n $PokemonSystem = PokemonSystem.new\r\n end", "def init_play\n # self.started_at = Time.now\n logger.info 'game.started_at: ' + started_at.to_s\n seq = 0\n gamers.order(:sequence_nbr).each do |g|\n turn = Turn.find_by(game_id: id, user_id: g.user_id)\n if g.accepted?\n seq += 1\n g.sequence_nbr = seq\n g.game_started # state --> waiting\n g.save\n turn.sequence_nbr = seq\n if seq == 1 #first player\n logger.info 'game.first player: ' + g.user_id.to_s\n turn.started = started_at\n turn.get_turn \n end\n turn.save!\n # delete turn of not accepting gamer\n else\n g.sequence_nbr = 0\n g.save\n turn.delete if turn\n end\n end\n save\n end", "def save_game\n save_data = YAML::dump(self)\n puts \"Please enter a name for your save game:\"\n prompt\n @filename = gets.chomp\n File.open(\"./saved/#{@filename}\", \"w\") { |file| file.write(save_data)}\n puts \"Saved\"\n get_input\n end", "def prompt_save_deletion\n pbMessage(_INTL('The save file is corrupt, or is incompatible with this game.'))\n exit unless pbConfirmMessageSerious(\n _INTL('Do you want to delete the save file and start anew?')\n )\n self.delete_save_data\n $game_system = Game_System.new\n $PokemonSystem = PokemonSystem.new\n end", "def prompt_save_deletion\n pbMessage(_INTL('The save file is corrupt, or is incompatible with this game.'))\n exit unless pbConfirmMessageSerious(\n _INTL('Do you want to delete the save file and start anew?')\n )\n self.delete_save_data\n $game_system = Game_System.new\n $PokemonSystem = PokemonSystem.new\n end", "def save_stop\n self.play_start = nil\n self.paused = false\n self.seconds_offset = 0.0\n ARUtils.save_cmdline(self)\n end", "def resume\n end", "def resume\n end", "def load_game\nputs \"Please choose one of the below saved profiles:\"\nsystem (\"ls *.ca\")\nprint \":\"\n$name = gets.chomp\n$file_name = $name + \".ca\"\nwhile(!system(\"test -e '#{$file_name}'\")) do\nputs \"Such profile does not exits, please choose a valid one.\"\nsystem (\"ls *.ca\")\nprint \":\"\n$name = gets.chomp\n$file_name = $name + \".ca\"\nend\ninfo = IO.readlines(\"#{$file_name}\") # info is a array and each index value is the info of a line info[3] = info that is on line number three.\n# now info is acctualy being loaded intro the system variables\n$name = info[0]\n$lvl = info[1]\n$gold = info[2]\nfor i in 3..((info.length)-1) do\n$inventory[$inventory.length] = info[i] # with $inventory.length start from 0 becuse it's initial null it will automaticaly grow\nend\nputs \"Loading please wait...\"\nsleep(2)\nprint \"............\"\nsleep(1)\nputs \"............\"\nputs $name\nputs $gold\nputs $lvl\nputs $inventory\n####call the level method\nend", "def on_save_success\r\n Sound.play_save\r\n return_scene\r\n end", "def save\n @@games[@gameId] = self\n end", "def run\n if @load_save == true\n puts 'Would you like to play your last saved game? (Yes/No)'\n gets.chomp.downcase == 'yes' ? load_game : (puts \"\\n#{@computer} is coming up with your word.\\n\")\n chosen_word\n end\n loop do \n start_game\n checker\n win_lose\n end\nend", "def reinitialize_game(player)\n self.quit_game = false\n self.current_player = player\n\n puts \"\"\n puts \"Welcome to a new version of the 2 Player Game.\"\n puts \"\"\n\n end", "def save_game_without_rescue(name)\n last_index = @last_savefile_index\n trace = rm_save_game_without_rescue(name)\n @last_savefile_index = last_index unless name.is_a?(Fixnum)\n trace\n end", "def load_saved_file\n\n begin\n parse_json_file('./data/user_data.json')\n\n puts \"Great to have you back #{@parsed_data[:userdata][:username]}!\"\n attribute_data_from_parsed_file()\n\n @prompt.keypress(Rainbow('Please press space or enter to continue!').orange.to_s, keys: %i[space return])\n\n rescue\n puts \"It appears that no previous file exists. Sorry... it just doesn't....\"\n\n @prompt.keypress(Rainbow('Please press space or enter to return!').orange.to_s,keys: %i[space return])\n\n upload_data_from_file()\n\n end\n\n end", "def save_game?\n answer = Ui.save_game_question\n if answer.downcase == 'save'\n saving\n exit_now\n end\n end", "def get_saved_game(game_id)\n res = @db.query(\"SELECT Board, GameType, Turn, LastPlayed FROM SavedGames WHERE GameID = #{game_id};\")\n row = res.fetch_row\n rows, columns = get_col_row(row[0])\n gs = GameState.new(2, row[1].to_sym, rows, columns)\n set_board(gs, row[0], rows, columns)\n coord = row[3].split\n gs.last_played = Coordinate.new(coord[0].to_i, coord[1].to_i)\n gs.player_turn = row[2].to_i\n gs\n end", "def save_game\n #yaml = YAML::dump(self)\n puts \"Please enter a filename for the saved game.\"\n save_file_name = gets.chomp.downcase\n save_file = File.write(\"saved_games/#{save_file_name}.yaml\", self.to_yaml)\n #save_file.write(yaml)\n puts \"Your game has been saved!\"\n puts \"Goodbye!\"\n end", "def restore\n self.suspended = false\n save(:validate => false)\n end", "def get_game\n\t\tif @file_exists == 1\n\t\t\t# If the file exists, but there are no rows in it, there are no saved games\n\t\t\tif @data.length == 0\n\t\t\t\tputs \"Oops, you have no saved games.\"\n\t\t\t\tputs \"Here, start a new one!\"\n\t\t\t\tputs\n\t\t\t\tnew_game\n\t\t\telse\n\t\t\t\tputs \"Which game?\"\n\t\t\t\t# Display each partially guessed word like: \"1. _ e _ _ t\"\n\t\t\t\[email protected]_with_index { |row, i| puts \"#{i+1}. #{row[1].split(\"\").join(\" \")}\" }\n\t\t\t\t# Get user's choice\n\t\t\t\tgame = gets.chomp.to_i\n\t\t\t\t# If the user entered a number that appears on the board...\n\t\t\t\tif game.between?(1,@data.length)\n\t\t\t\t\t# Get all info out of chosen row\n\t\t\t\t\t@word = @data[game-1][0].split(\"\").to_a\n\t\t\t\t\t@guess = @data[game-1][1]\n\t\t\t\t\t@wrong_letters = @data[game-1][2]\n\t\t\t\t\t@turn = @data[game-1][3].to_i\n\t\t\t\t\t@running_saved_game = (game - 1)\n\t\t\t\t\t# Get the next guess\n\t\t\t\t\tget_guess\n\t\t\t\telse\n\t\t\t\t\tputs \"Not a valid choice! Pick again\"\n\t\t\t\t\tget_game\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\tputs \"Oops, you have no saved games.\"\n\t\t\tputs \"Here, start a new one!\"\n\t\t\tputs\n\t\t\tnew_game\n\t\tend\n\tend", "def save(game)\n\t\tprint \"Name the save: \"\n\t\tsave_name = gets.chomp.downcase\n\t\tDir.mkdir \"saves\" unless Dir.exists? \"saves\"\n\t\tfile_path = File.join(\"saves\", \"#{save_name}\")\n\t\tFile.open(file_path, \"w\") { |f|\n\t\t\tf.write(YAML.dump(game))\n\t\t}\n\t\tputs \"The game has been saved!\"\n\tend", "def start\n load\n until @computer.round_finished\n save\n @computer.respond_to_guess(@player.prompt)\n end\n\n if @computer.guessed\n puts \"You won!\"\n else\n puts \"You lost!\"\n end\n end", "def load_state\n begin\n if File.file?(\"#{$statefile}\") && File.readable?(\"#{$statefile}\") \n @current_state = File.read(\"#{$statefile}\").strip.split(':')\n end\n rescue\n error('Invalid Resume Point')\n exit 1\n end\n end", "def play\n # unless the game is over players take turns\n take_turn until game_over?\n\n #start a new game if the game is over\n new_game_or_quit\n end", "def load_game\n @game = Game.find_by_id(params[:id])\n unless @game\n render( :status => :not_found, :text => \"Game not found.\")\n return false\n end\n return true\n end", "def new_game\n\t\tclear\n\t\tget_username\n\t\tselect_level\n\t\tget_deck\n\t\tshuffle\n\t\tget_hand\n\t\tcontinue_game\n\tend", "def resume\n\tend", "def restore\n end", "def save_game(game_state)\n save_file = File.open('save_game.yml', 'w')\n YAML.dump(game_state, save_file)\n save_file.close\n exit\n end", "def resume\n\n end", "def save_game \n File.open('hangman_save.yml', 'w') { |f| YAML.dump(self,f)}\n exit\n end", "def load_gamedata\n @time_stamp = Time.at(0)\n @file_exist = FileTest.exist?(@filename)\n if @file_exist\n file = File.open(@filename, \"r\")\n @time_stamp = file.mtime\n begin\n @characters = Marshal.load(file)\n @frame_count = Marshal.load(file)\n @last_bgm = Marshal.load(file)\n @last_bgs = Marshal.load(file)\n @game_system = Marshal.load(file)\n @game_message = Marshal.load(file)\n @game_switches = Marshal.load(file)\n @game_variables = Marshal.load(file)\n @total_sec = @frame_count / Graphics.frame_rate\n rescue\n @file_exist = false\n ensure\n file.close\n end\n end\n end", "def loader_helper\n\t\tif !(Dir.exists? \"saves\") || Dir[\"saves/*\"].length == 0\n\t\t\tputs \"There are no save files...Starting game.\"\n\t\t\treturn false\n\t\tend\n\t\tsaves = Dir.entries(\"saves\")\n\t\tsaves.delete(\".\")\n\t\tsaves.delete(\"..\")\n\t\tputs \"The save files are: #{saves.join(\", \")}\"\n\t\tprint \"Type the save name: \"\n\t\tsave = gets.chomp\n\t\tunless saves.include? save\n\t\t\tputs \"That file doesn't exist. Try again.\\n\\n\"\n\t\t\tsave = loader_helper \n\t\tend\n\t\tsave\n\tend" ]
[ "0.8245479", "0.746118", "0.7306961", "0.7003685", "0.6923872", "0.691414", "0.6909892", "0.6898701", "0.6855149", "0.67154264", "0.6691955", "0.6690254", "0.6635174", "0.6621412", "0.659606", "0.6544891", "0.6535775", "0.65208215", "0.6451219", "0.6393642", "0.6388279", "0.63879144", "0.6377327", "0.6354914", "0.6304852", "0.63019884", "0.6296371", "0.62780684", "0.6192246", "0.61635923", "0.612422", "0.6124099", "0.6113437", "0.6113437", "0.60879815", "0.60726136", "0.60554826", "0.60355425", "0.60348076", "0.60340524", "0.6030813", "0.59952646", "0.5992962", "0.5988014", "0.5975254", "0.59752214", "0.5954463", "0.5933203", "0.5929814", "0.5929086", "0.5912647", "0.5906063", "0.5903041", "0.589824", "0.58805764", "0.5864325", "0.58640486", "0.5854857", "0.584721", "0.5815679", "0.5815679", "0.581015", "0.5806107", "0.5791226", "0.5774604", "0.5757127", "0.5751209", "0.574383", "0.5728375", "0.57264596", "0.57066196", "0.57066196", "0.57027954", "0.5675029", "0.5675029", "0.56734556", "0.56711817", "0.5666519", "0.5653395", "0.5653157", "0.5626079", "0.56253326", "0.5621617", "0.56208044", "0.55974305", "0.55851406", "0.55798465", "0.55759865", "0.5573332", "0.5565682", "0.5564477", "0.5559208", "0.5554363", "0.5537454", "0.5536962", "0.55284363", "0.55257577", "0.55118126", "0.55097044", "0.5499748" ]
0.75375783
1
Get the name of a game (to load or delete) from the user
def get_game_name(all_saved_games, task) game_names = all_saved_games.keys while true print "Enter name of game to #{ task }: " game_name = gets.chomp return game_name if game_names.include? game_name next if yes_or_no "'#{ game_name }' doesn't exists; #{ task } another game" message_then_enter "You chose to not #{ task } any game." return nil end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def game_name\n fetch('sword_art_online.game_name')\n end", "def name\n @game_info['name']\n end", "def game_name()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n result = Native.Run_game_name(@handle.ptr)\n result\n end", "def get_player_name(name)\n return prompt(\"Player Name? [Player #{name}]\",\"Player #{name}\")\n end", "def get_game(game_name)\n\tgame_name = game_name.to_s\n\tObject.const_get(game_name)\nend", "def name\n\t\tsuper || game.name\n\tend", "def current_player_name\n Player.find(player_turn).name unless player_turn.nil?\n end", "def player_name(id)\n name = Player.find(id)\n end", "def title\n \"Game #{self.id}: \" + players.map { |p| p.username }.join(\" vs \")\n end", "def get_achievement_name(achievement)\n if initted?\n @@dll_SteamAPI_ISteamUserStats_GetAchievementName.call @i_user_stats, achievement\n else\n nil\n end\n end", "def game(name)\n\t\t\traise ArgumentError, 'BGGPlays::game Argument is not string' unless name.is_a? String \n\t\t\t#validates string\n\t\t\tname.to_s\n\t\t\tselect(:bg_name, name)\n\t\tend", "def get_save_name all_saved_games\n\t\tgame_names = all_saved_games.keys\n\n\t\twhile true\n\t\t\tprint \"Enter name to save game as: \"\n\t\t\tgame_name = gets.chomp\n\t\t\tnext if game_name == \"\"\n\t\t\treturn game_name unless game_names.include? game_name\n\n\t\t\treturn game_name if yes_or_no \"'#{ game_name }' already exists. Overwrite it\"\n\t\t\tnext if yes_or_no \"Save game with a different name\"\n\n\t\t\tmessage_then_enter \"You chose to not save this game.\"\n\t\t\treturn nil\n\t\tend\n\tend", "def get_player_name\n if players[1].name == \"You\"\n puts \"What's your name?\"\n players[1].name = gets.chomp\n puts \"Hey, #{players[1].name}. Let's play some blackjack.\\n\\n\"\n end\n end", "def game_title\n object.game ? object.game.title : 'Не прикреплен ни к одной игре'\n end", "def get_player_name\n get_console_input.capitalize\n end", "def get_player_name\n puts \"Who is playing WITCH WARRIOR today?\"\n @validate_input.get_input\n end", "def get_name\n\t\t# Ask the player for their name\n\t\tputs \"\\nWhat is your name?\"\n\n\t\t# Utilize the player class to store the input name\n\t\tself.player_name = Person.new(gets.strip)\n\tend", "def player_name\n player.name\n end", "def get_player\n\t @name\n\tend", "def get_name\n\t\tputs \"What tile would you like to claim? (1-9)\"\n\t\tname = gets.chomp\n\tend", "def get_player_name\n name = STDIN.gets.chomp\n name\n end", "def winner_name\n comp = Competitor.find_by_id(self.winner)\n name = comp.name\n return name\n end", "def player_name\n\tgame_sounds\n\t\tputs \"Hey man whats your name?\"\n\t\t@your_name = $stdin.gets.chomp.upcase\n\t\tplay_game\n\tend", "def name\n @gapi ? @gapi[\"name\"] : @name\n end", "def name_for_user\n self.team.name rescue ''\n end", "def name\n\t\tn = names\n\t\treturn n[:fullname] if n[:fullname]\n\t\treturn n[:username] if n[:username]\n\t\treturn I18n.translate(\"user.name.unknown\")\n\tend", "def name\n return @playing_girl ? @name_girl : @name_boy\n end", "def show\n @creator = User.find_by(id: @game.creator_id)\n @joined_users_name = Array.new\n @game.user_games.each do |joined_users|\n @this = User.find_by(id: joined_users.user_id)\n @joined_users_name << @this.nickname\n end\n end", "def user_name(uid)\n deter_lab.get_profile(uid).try(:[], \"name\")\n end", "def game_title\n\t\t\"#{home_team} vs. #{visitor_team}\"\n\tend", "def getplayername\n puts \"Enter your username:\\n\\n\"\n puts \"To exit the game, enter \" + \"EXIT\\n\\n\".red\n\n print \">> \"\n name = gets.chomp\n system('clear')\n if name.downcase == \"exit\" #if user input is exit, end the app\n end_program\n return nil\n elsif User.all.any? { |user| user.name.downcase == name.downcase } #if the user exists, get the user object\n user = User.all.select { |user| user.name.downcase == name.downcase}[0]\n puts \"Welcome back, #{user.name}\\n\\n\"\n else #create the user and give them a how to play instructions method call instead of just going to menu\n user = User.create(name: name)\n how_to_play(user)\n end\n user\nend", "def name\n @gapi[\"name\"]\n end", "def name\n @gapi[\"name\"]\n end", "def name\n \"Player#{@ix}\"\n end", "def name\n [\n model.discord_guild.name,\n model.discord_user.username\n ].join(' - ')\n end", "def name\n puts 'Ingresa el nombre del jugador: '\n name_player = gets.chomp\n name_player\n end", "def game\n fetch('games.super_mario.games')\n end", "def name_for_team\n self.user.show_name rescue ''\n end", "def nickname\n data = get 'name', resource: 'leaderboard'\n data.name\n end", "def generate_name(id)\n return GameData::Item[id].exact_name\n end", "def player_name(hash)\n return hash[:name]\nend", "def get_player_name(count)\n begin\n puts \"\"\n puts \"Enter Player #{count}'s name:\"\n\n temp = gets.chomp\n\n raise InvalidName if temp == \"\"\n\n self.name = temp\n\n rescue InvalidName\n puts \"You need to enter a player name.\"\n get_player_name(count)\n\n end\n end", "def get_player_name\n\tputs \"\\n-------------------------------------------------------\"\n\treturn gets.chomp.capitalize\nend", "def user_name(name = nil)\n return user_name_from_name(name) if name\n\n user_name_random\n end", "def get_user_name client, event\n # calls users_info on slack\n info = client.users_info(user: event.user_id ) \n info['user']['name']\n end", "def get_user_name client, event\n # calls users_info on slack\n info = client.users_info(user: event.user_id )\n info['user']['name']\n end", "def name\n \"#{self[:user].strip} #{self[:engine_id]}\".strip\n end", "def name_upper\n return GameData::Text.get(0,@step_remaining==0 ? @id : 0).upcase\n end", "def name\n userName\n end", "def name\n name = self[:name]\n name.blank? ? login : name\n end", "def main()\n name_game(\"Lincoln\")\nend", "def name(player_id, league_id)\n database do |db|\n return db.get_first_value 'SELECT DisplayName FROM Player\n WHERE PlayerID = :player_id\n AND LeagueID = :league_id',\n player_id, league_id\n end\nend", "def name\n text_get(6, @id)\n end", "def get_player_name(n)\n puts \"Player #{n}, what's your name?\"\n name = gets.chomp\n Player.new(name)\n end", "def name(other_user)\n return self.which_profile(other_user).ring.projected_name\n end", "def name\n @gapi.name\n end", "def get_name\n puts \"Please enter player #{id_number}'s name: \"\n while true\n begin\n @name = gets.chomp\n raise EmptyNameError if @name.empty?\n break\n rescue EmptyNameError\n puts \"You input was blank. Please try again.\"\n end\n end\n\n end", "def get_name\n name = Koala::Facebook::API.new(oauth_token).get_object('me?fields=name')['name']\n update(name: name)\n name\n rescue Koala::Facebook::AuthenticationError\n # Do nothing.\n end", "def name\n names.first\n end", "def get_user_name\n\tputs \"Quel sera ton nom pour cette partie ?\"\n\tprint \"> \"\n\tname = gets.chomp\n\treturn name\nend", "def set_game_name(game)\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n Native.Run_set_game_name(@handle.ptr, game)\n end", "def challenger\n Competitor.find_by(id: self.game.challenger_id).username\n end", "def name\n @gapi[\"displayName\"]\n end", "def choose_game(user)\n user == \"guest\" ? username = \"guest\" : username = user.name\n entry = nil\n message = []\n until entry\n display_menu_header([\"Game Search:\"], user)\n entry = display_string_menu([\"Please type a game title: \"], message)\n message = [\"Sorry, invalid game title. Please try again...\", \"You can also type 'exit' to exit or 'main' to go back.\"]\n exit_game_reviews if entry.downcase == \"exit\"\n main_menu(user) if entry.downcase == \"main\"\n game = Game.find_by(lowercase_name: entry.downcase)\n game = Game.where([\"name like ?\", \"%#{entry.downcase}%\"]).limit(1)[0] if !game\n entry = nil if !game || entry.size < 3\n end\n display_footer([\"Found an entry for #{game.name}!\"])\n game_menu(user, game)\nend", "def formated_name_for(game)\n return formated_release_date_for(game) if game.nil? || game.name.nil?\n \"#{game.name} - #{formated_release_date_for(game)}\"\n end", "def name\n @gapi.name\n end", "def get_random_profile_name\n @profiles_data[rand(0...@profiles_data.count)][:name]\n end", "def get_name(id)\n @users.each do |user|\n return user[:name] if user[:id] == id\n end\n nil\n end", "def get_name\n # The last sentence in a function is always returned so no need to mention return\n @name\n end", "def get_user_name(user_id)\n if self.is_api then\n user = begin \n HuiMain.plugin_data.find_one(\"_id\" => BSON::ObjectId(user_id))\n rescue BSON::InvalidObjectId\n nil\n end\n if user then \n user[\"name\"]\n else\n nil\n end\n else # not api\n session[:current_user_name]\n end\n end", "def retrieve_name\n return @name\n end", "def player_names(n)\n puts \"Player \" + n.to_s + \"! What is your name?\"\n return gets.chomp\n end", "def set_game_name(game)\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n Native.RunEditor_set_game_name(@handle.ptr, game)\n end", "def name\n @gapi[\"friendlyName\"]\n end", "def screen_name\n name || nickname\n end", "def get_current_user_name\n return @name if @name\n name = get_current_user_meta\n name = name['query']['userinfo']['name'] if name\n\n name\n end", "def naming\n puts (\"Hello player #{@@player_count}. Please choose a name.\").blue\n name = gets.chomp\n @@player_count += 1\n return name\n end", "def team_names\n game = Game.find(self.game_id)\n type = self.bet_type\n if over_under?\n return \"#{game.away_team} vs #{game.home_team}\"\n elsif type == \"lay\"\n if game.spread <= 0\n return game.home_team\n else\n return game.away_team\n end\n else\n if game.spread <= 0\n return game.away_team\n else\n return game.home_team\n end\n end\n end", "def get_name(user_info)\n return user_info[\"name\"]\n end", "def current_player\n @players.each do |name, letter|\n if letter == whose_turn\n return name\n end\n end\n end", "def get_name()\n return @me.uname if @me.brother.nil?\n return @me.brother.full_name\n end", "def user_name\n return User.find(user_id).name\n end", "def user_name\n return User.find(user_id).name\n end", "def get_name\n return \"#{name}\"\n end", "def user_name\n @user_name ||= SlackUtils::SingletonClient.instance.find_user_name(@user_id)\n end", "def game\n fetch('esport.games')\n end", "def choose_name\n\tprint \"Choisis ton pseudo:\"\n\tprint \">\"\n\tpseudo = gets.chomp\n\tplayer_h = HumanPlayer.new(pseudo)\n\tputs \"\"\n\tputs \"Prêt #{player_h.name} ?\"\n\tputs \"\"\n\treturn player_h\nend", "def name\n load! if not @loaded\n @name\n end", "def name\n return text_get(0, id)\n end", "def get_name\n return @name\n end", "def select_player_name\n puts \"\\nWho's playing today? (please enter your name)\"\n player_name = gets.chomp.strip\n puts \"\\nNice to meet you, #{player_name}.\\n \"\n return player_name\n end", "def home_team_name\n return home_team.try(:name)\n end", "def map_name; $game_temp.map_names[@map_id]; end", "def name=(value)\n if @playing_girl\n @name_girl = value\n else\n @name_boy = value\n end\n $game_actors[1].name = value\n end", "def name\n profile.user.name\n end", "def name\n names.first\n end", "def get_username(graph)\n graph.get_object('me')['name']\n end", "def name\n @name ||= names.first\n end", "def name\n parse('superhero.name')\n end", "def game=(name)\n gateway_check\n update_status(@idletime, name, nil)\n name\n end" ]
[ "0.7992116", "0.7918673", "0.7022698", "0.6999774", "0.6825105", "0.6824538", "0.6782793", "0.67799544", "0.6714476", "0.6689993", "0.66881275", "0.66365457", "0.66026074", "0.6596694", "0.657428", "0.6509314", "0.6434285", "0.6423771", "0.6407837", "0.6388779", "0.63652664", "0.6357299", "0.6333908", "0.63305837", "0.62900877", "0.6281612", "0.627322", "0.62564045", "0.62229323", "0.6215863", "0.62113404", "0.6187413", "0.6187413", "0.61848634", "0.61793834", "0.6166106", "0.61550903", "0.6145757", "0.61406446", "0.6104545", "0.60940886", "0.6090864", "0.6070156", "0.6068008", "0.60659814", "0.60529417", "0.60343325", "0.60216874", "0.6017456", "0.59993666", "0.5997373", "0.59932894", "0.5981715", "0.5979222", "0.59782565", "0.5970365", "0.596591", "0.59617656", "0.5950681", "0.594851", "0.594759", "0.594531", "0.5932602", "0.59287477", "0.5925188", "0.5925082", "0.5923669", "0.59155875", "0.59153247", "0.5911739", "0.5909001", "0.5903451", "0.5895099", "0.5888229", "0.58877045", "0.5880987", "0.5876367", "0.58738977", "0.5871561", "0.5871184", "0.5871055", "0.58696383", "0.58696383", "0.5866165", "0.5859654", "0.5858333", "0.5848787", "0.5841658", "0.5837882", "0.58372295", "0.58313954", "0.5826267", "0.5824734", "0.5822725", "0.58045334", "0.58043325", "0.5799597", "0.57949805", "0.5783655", "0.57825935" ]
0.72639954
2
Delete a previously saved game
def delete_game all_saved_games = yaml_load(SAVED_FILENAME) game_name = get_game_name(all_saved_games, "delete") return if game_name.nil? all_saved_games.delete(game_name) yaml_save(SAVED_FILENAME, all_saved_games) message_then_enter "'#{ game_name }' successfully deleted." end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_game\n\t\tclear\n\t\tget_username\n\t\tfile_name = get_saved_games\n\t\tif file_name != \"menu\"\n\t\t\tputs \"Are you sure you want to delete the game: \"+File.basename(file_name,\".setgame\")+\"?\"\n\t\t\tFile.delete(file_name) if gets.chomp.downcase[0]==\"y\"\n\t\tend\n\tend", "def delete_saved_game(game_id)\n @db.query(\"DELETE FROM SavedGames WHERE GameID = #{game_id};\")\n end", "def destroy\n @game.destroy\n redirect_to root_path\n end", "def destroy\n game = Game.find_by_id(params[:id])\n game.destroy\n end", "def delete_game(boardgames)\r\n\t\tputs \"What game do you want to delete?\"\r\n\t\tchoice = menu_options(boardgames.keys)\r\n\t\tputs \"I understand you want to delete #{choice}? Is that correct?\"\r\n\t\tid = boardgames[choice][:id]\r\n\t\tif y_or_n\r\n\t\t\tputs \"I have deleted that game.\"\r\n\t\t\tdelete_boardgame(@db, id)\r\n\t\tend\r\n\t\tmanage_games\r\n\tend", "def destroy\n @game = Game.find(params[:id])\n @game.is_deleted = 1\n @game.save\n redirect_to games_path\n end", "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n flash[:notice] = \"Game deleted.\"\n redirect_to user_path\n end", "def destroy\n @admingame = Game.find(params[:id])\n @admingame.destroy\n redirect_to '/adminCool'\n end", "def destroy\n @game.destroy\n flash[:success] = \"Du hast #{@game.name} erfolgreich gelöscht.\"\n redirect_to admin_games_path\n end", "def delete_game_question\n Graphics.transition\n # Message break prevention\n Graphics.update while Input.press?(:B)\n scene = $scene\n $scene = self\n message = text_get(25, 18)\n oui = text_get(25, 20)\n non = text_get(25, 21)\n # Delete the game ?\n c = display_message(message, 1, non, oui)\n if c == 1\n message = text_get(25, 19)\n # Really ?\n c = display_message(message, 1, non, oui)\n if c == 1\n # Ok deleted!\n File.delete(@filename)\n message = text_get(25, 17)\n display_message(message)\n end\n end\n $scene = scene\n return @running = false\n end", "def destroy\n @game = Game.find(params[:id]).destroy\n flash[:alert] =\" games successfully deleted\"\n redirect_to games_url\n end", "def destroy\n @game_safe.destroy\n respond_to do |format|\n format.html { redirect_to game_saves_url, notice: 'Game save was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def deletegames\n @games = Game.find(:all)\n if (@games.length > 0)\n @games.each { |game|\n logger.debug(\"Deleting game \" << game.id)\n game.destroy\n }\n end\n end", "def finish_game_session game_id\n craft_firebase_command(\"minesweeper/game#{game_id}.json\", \"DELETE\")\n\n # also, delete game id so that the queue will not contain unplayable game\n delete_game_id_in_queue(game_id)\nend", "def destroy\n if @game.destroy\n render json: { success: true, game: @game}\n end\n end", "def prompt_save_deletion\r\n pbMessage(_INTL('The save file is corrupt, or is incompatible with this game.'))\r\n exit unless pbConfirmMessageSerious(\r\n _INTL('Do you want to delete the save file and start anew?')\r\n )\r\n self.delete_save_data\r\n $game_system = Game_System.new\r\n $PokemonSystem = PokemonSystem.new\r\n end", "def destroy\n game = @round.game\n @round.destroy\n redirect_to edit_game_path(game), notice: 'Round was successfully destroyed.'\n end", "def destroy\n current_user.quit\n flash[:notice] = \"Your player has committed suicide and left this game. So tragic!\"\n redirect_to game_path(@game)\n end", "def leave_game(player)\n self.players.find(player.to_i).destroy\n self.save\n end", "def prompt_save_deletion\n pbMessage(_INTL('The save file is corrupt, or is incompatible with this game.'))\n exit unless pbConfirmMessageSerious(\n _INTL('Do you want to delete the save file and start anew?')\n )\n self.delete_save_data\n $game_system = Game_System.new\n $PokemonSystem = PokemonSystem.new\n end", "def prompt_save_deletion\n pbMessage(_INTL('The save file is corrupt, or is incompatible with this game.'))\n exit unless pbConfirmMessageSerious(\n _INTL('Do you want to delete the save file and start anew?')\n )\n self.delete_save_data\n $game_system = Game_System.new\n $PokemonSystem = PokemonSystem.new\n end", "def destroy\n @game.reset\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'La partie a bien été supprimée' }\n format.json { head :no_content }\n end\n end", "def endgame()\n\t\t@database = Database.new\n\t\[email protected]_files(@players)\n\t\[email protected]_files\n\tend", "def destroy\r\n if @game.is_empty?\r\n increment_winner_statistic\r\n\r\n # destroy bots users\r\n bots_ids = @game.users.collect {|user| user.id if user.is_bot}\r\n User.where(id: bots_ids).destroy_all\r\n @game.players.destroy_all # todo use it in future\r\n @game.destroy\r\n end\r\n end", "def destroy\n @times_game.destroy\n respond_to do |format|\n format.html { redirect_to :back}\n end\n end", "def destroy\n\t\[email protected]\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to games_url }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend", "def destroy\n @at_bat.destroy\n\n redirect_to(@game)\n end", "def delete_league\n\t#p \"clear teams y/n\"\n\t#opt = gets.chomp!\n\t#if opt == \"y\"\n\t\tFile.delete('teams.db')\n\t#end\nend", "def destroy\n @game = Game.get(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :ok }\n end\n end", "def delete_gamecall\n update_gamecall = Gamecall.find_by(id: self.gamecall_tag)\n update_gamecall.destroy if update_gamecall\n end", "def remove_game(game_id, league_id)\n database do |db|\n # get timestamp\n timestamp = db.get_first_value 'SELECT Timestamp FROM Game\n WHERE GameID = :game_id\n AND LeagueID = :league_id',\n game_id, league_id\n\n removed = game_to_s(game_id, false, league_id)\n\n # remove the game\n db.execute 'DELETE FROM Game\n WHERE GameID = :game_id\n AND LeagueID = :league_id',\n game_id, league_id\n\n db.execute 'DELETE FROM EloHistory\n WHERE GameID = :game_id\n AND LeagueID = :league_id',\n game_id, league_id\n\n slack_url = db.get_first_value 'SELECT Value FROM Config\n WHERE Setting = \"SlackUrl\"'\n\n message_slack(\"Game removed: #{removed}\", [], slack_url, league_id) if league_id == 1 || league_id == 41\n\n recalc(league_id, timestamp)\n end\nend", "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :ok }\n end\n end", "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :ok }\n end\n end", "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @game = Game.find_by_slug(params[:id])\n \n ActiveRecord::Base.transaction do\n @game.reviews.each {|review| review.destroy}\n\n # remove GameWords\n ActiveRecord::Base.connection.execute \"DELETE FROM game_words WHERE game_id = #{@game.id}\" \n\n @game.destroy\n end\n\n respond_to do |format|\n format.html { redirect_to profile_url }\n format.json { head :ok }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to contest_games_path }\n format.json { head :no_content }\n end\n end", "def destroy\n # delete Score first, then Game\n @score.destroy if @score\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n end\n end", "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to theme_games_url(@theme) }\n format.xml { head :ok }\n end\n end", "def cleanup\n return unless game_path?\n\n flash.flag!\n Wars.save(session)\n end", "def exit_screen\n @games.pop\n end", "def remove_game(channel)\n @games.delete(channel)\n end", "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n # @game.rounds.destroy_all\n # raise @game.inspect\n @game.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @games_leaderboard.destroy\n\n head :no_content\n end", "def destroy\n @game = Game.find(params[:game_id])\n @play = @game.plays.find(params[:id])\n @play.destroy\n\n\n respond_to do |format|\n format.html { redirect_to game_path(@game), notice: 'Play was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @espn_game.destroy\n respond_to do |format|\n format.html { redirect_to espn_games_url }\n format.json { head :no_content }\n end\n end", "def destroy_group_stage_game(game) \n # puts \"destroy: #{self.first_round.jornada}: #{game[0].name} vs #{game[1].name} \"\n \n @game = Game.find(:first, :conditions => [\"cup_id = ? and home_id = ? and away_id = ? and type_name = 'GroupStage'\", \n self.id, game[0].id, game[1].id])\n unless @game.nil?\n # puts \"destroy: #{self.first_round.jornada}: #{game[0].name} vs #{game[1].name} \"\n @game.destroy\n end\n end", "def destroy\n @game_game_instance = Game::GameInstance.find(params[:id])\n @game_game_instance.destroy\n\n respond_to do |format|\n format.html { redirect_to game_game_instances_url }\n format.json { head :ok }\n end\n end", "def destroy\n @bestgame = Bestgame.find(params[:id])\n @bestgame.destroy\n\n respond_to do |format|\n format.html { redirect_to bestgames_url }\n format.json { head :no_content }\n end\n end", "def save_game\n\t\t# If current game was previously saved, delete the old version of current game...\n\t\tif @running_saved_game != nil\n\t\t\tover_write_data\n\t\tend\n\t\t# And add new version of current game to saved data\n\t\tFile.open(@path, 'a+') do |f|\n\t\t\t\tf.puts \"#{@word.join},#{@guess},#{@wrong_letters},#{@turn}\"\n\t\tend\n\tend", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to organization_games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n unless @game.divisions.empty?\n redirect_to admin_games_url,\n notice: t('notice.delete_canceled',{model: \"#{t('activerecord.models.admin/game')}\", relation: \"#{t('activerecord.models.admin/division')}\"})\n else\n @game.destroy\n redirect_to admin_games_url, notice: t('notice.deleted',{model: \"#{t('activerecord.models.admin/game')}\"})\n end\n end", "def destroy\n # @game = Game.find(params[:id])\n # @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n begin\n @game.destroy\n rescue ActiveRecord::DeleteRestrictionError => exception\n flash[:error] = exception.message\n end\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n puts @game.date.to_s\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @gameplay = Gameplay.find(params[:id])\n @gameplay.destroy\n\n respond_to do |format|\n format.html { redirect_to gameplays_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_path }\n # format.json { head :no_content }\n end\n end", "def destroy\n @old_game = OldGame.find(params[:id])\n @old_game.destroy\n\n respond_to do |format|\n format.html { redirect_to old_games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @howtoplaygame.destroy\n respond_to do |format|\n format.html { redirect_to howtoplaygames_url, notice: 'Howtoplaygame was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'El juego ha sido correctamente eliminado.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @game_play.destroy\n respond_to do |format|\n format.html { redirect_to game_plays_url, notice: 'Game play was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @holdgame = Holdgame.find(params[:id])\n @holdgame.destroy\n\n respond_to do |format|\n format.html { redirect_to gamesmaps_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @holdgame = Holdgame.find(params[:id])\n @holdgame.destroy\n\n respond_to do |format|\n format.html { redirect_to gamesmaps_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to user_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @game = current_user.games.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :ok }\n end\n end", "def destroy\n if @mini_game.destroy\n render json: @mini_game, status: :ok\n else\n render json: @mini_game, status: :unprocessable_entity\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end" ]
[ "0.82256603", "0.8146937", "0.74158055", "0.734698", "0.7296928", "0.72785014", "0.71073985", "0.70227736", "0.7006533", "0.700581", "0.6992012", "0.69474924", "0.6904172", "0.6863012", "0.68444896", "0.6838989", "0.68306273", "0.6785475", "0.67705786", "0.6768806", "0.6768806", "0.67377985", "0.6723929", "0.67027736", "0.67011136", "0.6688483", "0.66722226", "0.6650665", "0.6647516", "0.6641774", "0.6630601", "0.6616099", "0.6616099", "0.6597605", "0.6597605", "0.6597605", "0.6597605", "0.6597605", "0.6597605", "0.6597605", "0.6597605", "0.6597605", "0.6597605", "0.6597605", "0.6597605", "0.659501", "0.6592128", "0.6585968", "0.6580782", "0.657108", "0.6540492", "0.6534864", "0.6527274", "0.6523498", "0.65172064", "0.65172064", "0.65172064", "0.65172064", "0.65172064", "0.65172064", "0.6499147", "0.64954656", "0.64954656", "0.64954656", "0.64954656", "0.64954656", "0.64954656", "0.64954656", "0.64782405", "0.6475498", "0.64673275", "0.64670014", "0.64635295", "0.64533085", "0.64518315", "0.6449161", "0.644842", "0.6443102", "0.643566", "0.64343494", "0.6431596", "0.6413188", "0.64122003", "0.6400883", "0.63828075", "0.638085", "0.6371738", "0.6369924", "0.6369924", "0.6367163", "0.63661945", "0.63634557", "0.63498574", "0.63498574", "0.63498574", "0.63498574", "0.63498574", "0.63498574", "0.63498574", "0.63498574" ]
0.8515317
0
Save a game in progress
def save_game all_saved_games = yaml_load(SAVED_FILENAME) game_name = get_save_name(all_saved_games) return if game_name.nil? game_string = self.to_yaml all_saved_games[game_name] = game_string yaml_save(SAVED_FILENAME, all_saved_games) message_then_enter "'#{ game_name }' successfully saved." end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_game\n\t\t# If current game was previously saved, delete the old version of current game...\n\t\tif @running_saved_game != nil\n\t\t\tover_write_data\n\t\tend\n\t\t# And add new version of current game to saved data\n\t\tFile.open(@path, 'a+') do |f|\n\t\t\t\tf.puts \"#{@word.join},#{@guess},#{@wrong_letters},#{@turn}\"\n\t\tend\n\tend", "def save_game\n Dir.mkdir(\"../saves\") unless Dir.exists?(\"../saves\")\n @@save_count += 1\n binding.pry\n log_saves\n savefile = \"../saves/save_#{@@save_count}.yml\"\n File.open(savefile, 'w') do | file |\n file.write(self.to_yaml)\n end\n end", "def save_game\n @drawing= false\n puts \"Save game...\"\n db = Db.new\n score = @window.level.mouse.score\n lvl = @window.level.num\n name = Time.now.strftime(\"%d/%m/%Y %H:%M\")\n db.save_game name, score, lvl\n end", "def save_game\n\t\tsaves = []\n\t\tsaves << @board\n\t\tsaves << @current_player\n\t\tsave_yaml = YAML.dump(saves)\n\n\t\tFile.open('saved_game.yaml', 'w') do |file|\n\t\t\tfile.puts save_yaml\n\t\tend\n\t\tputs \"Your game has been saved.\"\n\t\tputs \"Closing the game...\"\n\t\texit\n\tend", "def save_game\n File.open(@save_file, 'w') do |f|\n Marshal.dump(@hero, f)\n end\n @cmd_window.setpos(0,0)\n @cmd_window << \"Game saved!\".rjust(CMD_WIDTH)\n end", "def save_game\n puts \"=================================================\"\n puts \"\\nSaving game...\"\n filename = \"../saved_games/hangman_save.json\"\n File.open(filename, \"w\") { |file| file.puts self.serialize }\n puts \"Game Saved.\"\n puts \"\\n=================================================\"\n end", "def save_game\n Dir.mkdir 'save_files' unless Dir.exists?(\"save_files\")\n\n filename = \"save#{Dir[\"save_files/**/*\"].length}.json\"\n\n save_data = {\n code_word: @code_word,\n good_guesses: @good_guesses,\n bad_guesses: @bad_guesses,\n tries: @tries\n }\n\n File.write(\"save_files/#{filename}\", JSON.dump(save_data))\n end", "def save_game\n store = YAML.dump(self)\n File.open('lib/saved_game.yml', 'w') do |file|\n file.puts(store)\n end\n puts 'your game has been saved!'\n end", "def save_game\n file_name = input_save_name\n begin\n Dir.mkdir('saves') unless Dir.exist?('saves')\n save_file = File.new(file_name, 'w')\n save_file.puts generate_save\n save_file.close\n puts 'Game saved!'\n rescue IOError\n puts 'Save failed'\n end\n end", "def save\n completed_achievements = []\n @data_achievements.each do |index, achievement|\n completed_achievements << index if achievement.completed?\n end\r\n \r\n File.open(SAVE_FILE, \"wb+\") do |f|\r\n f.flock File::LOCK_EX\r\n completed_achievements |= load_save(f)\n Marshal.dump(completed_achievements, f)\r\n end\n end", "def save(game)\n\t\tprint \"Name the save: \"\n\t\tsave_name = gets.chomp.downcase\n\t\tDir.mkdir \"saves\" unless Dir.exists? \"saves\"\n\t\tfile_path = File.join(\"saves\", \"#{save_name}\")\n\t\tFile.open(file_path, \"w\") { |f|\n\t\t\tf.write(YAML.dump(game))\n\t\t}\n\t\tputs \"The game has been saved!\"\n\tend", "def save_game\n\t\tDir.mkdir('saved_games') unless Dir.exist? 'saved_games'\n\t\tDir.chdir(\"saved_games\")\n\t\tdata = save\n\t\tFile.open(\"save.yaml\", \"w\") do |file|\n\t\t\tsaved_games = YAML::dump(data)\n\t\t\tfile.write(saved_games)\n\t\tend\n\t\tputs \"Games Saved!!\"\n\t\tabort\n\tend", "def save_game(game_state)\n save_file = File.open('save_game.yml', 'w')\n YAML.dump(game_state, save_file)\n save_file.close\n exit\n end", "def save\n File.open(SaveLocation, 'w') do |file|\n file.puts @value.join(\"\")\n file.puts @progress.join(\"\")\n file.puts @bad_guesses.join(\"\")\n end\n end", "def save\n file_name = ask_save_file\n save_file = File.open(file_name, 'w')\n save_file.puts(serialize)\n save_file.close\n puts \"Game has been saved to Save File #{file_name[-5]}!\"\n puts \"\\n\\n\"\n end", "def save_game\n\t\tputs \"Type a name for your saved game\"\n\t\tgame_name = gets.chomp\n\t\tfilename = \"#{game_name}.txt\"\n\n\t\t ex_file = File.expand_path(\"./saved_games/#{filename}\")\n\t\t \n\t\tif File.exists?(ex_file)\n\t puts \"#{filename} exists\" #overwrite method?\n\t \n\t self.save_game\n\t else\n\t\t\tFile.open(ex_file, \"w\") do |f|\n\n\t\t\t\tf.puts YAML::dump(game_state)\n\n\t\t\t\tputs \"Your game was saved as #{filename}\" \n\t\t\tend\n\t\tend\n\tend", "def save_curr_game(fname)\n @log.debug \"Don't save the network game\"\n end", "def save\n puts \"Would you like to save your progress? (y/n)\"\n puts \"\"\n response = gets.strip.downcase\n puts \"\"\n if response == \"y\"\n File.open(\"saves.yaml\", \"w\") do |file|\n file.puts YAML::dump(@computer)\n end\n puts \"Your game has been saved!\"\n puts \"\"\n else\n puts \"Lets just keep playing then!\"\n puts \"\"\n end\n end", "def save_game\n\t\tputs \"Type a name for your saved game\"\n\t\tgame_name = gets.chomp\t\n\t\tfilename = \"#{game_name}.yml\"\n\n\t\t ex_file = File.expand_path(\"./saved_games/#{filename}\")\n\t\t \n\t\tif File.exists?(ex_file)\n\t puts \"#{filename} exists\" #overwrite method?\n\t \n\t self.save_game\n\t else\n\t\t\tFile.open(ex_file, \"w\") do |f|\n\t\t\t\tgame_state = YAML::dump(self)\n\t\t\t\tf.puts game_state\n\t\t\t\tputs \"Your game was saved as #{filename}\" \n\t\t\tend\n\t\tend\n\tend", "def save_game\n\tresponse\n\tif settings.game_data\n\t\tsettings.game_data.save\n\t\tresponse = \"Game saved.\"\n\telse\n\t\tresponse = \"No game loaded yet, so no game saved.\"\n\tend\n\treturn response\nend", "def save_game(file)\n \n score = 1000\n \n open(file, \"w\") do |f|\n f.puts(score)\n f.puts(Time.new.to_i)\n end\nend", "def save_game\n game = {\n :word => @word,\n :max_turn => @max_turn,\n :current_turn => @current_turn,\n :display_word => @display_word,\n :current_guess => @current_guess\n }\n File.open(\"hangman.yaml\", 'w') { |f| f.write(game.to_yaml)}\n print \"Game is saved!\\n\"\n end", "def save_game?\n answer = Ui.save_game_question\n if answer.downcase == 'save'\n saving\n exit_now\n end\n end", "def export\n # Temporarily use first database entry for all saves\n s = ChessSave.first\n s.position = @current_state[:position].join\n s.human_to_move = @current_state[:player] == :human\n s.save\n end", "def save_game\n save_data = YAML::dump(self)\n puts \"Please enter a name for your save game:\"\n prompt\n @filename = gets.chomp\n File.open(\"./saved/#{@filename}\", \"w\") { |file| file.write(save_data)}\n puts \"Saved\"\n get_input\n end", "def new_game(saver)\n File.open(\"#{saver}\",\"a\") do |line|\n write_to = open(Player.my_name, 'w')\n write_to.write(Player.my_name)\n write_to.write(\"\\n\")\n write_to.write(Player.type)\n write_to.write(\"\\n\")\n write_to.write(Player.location)\n write_to.write(\"\\n\")\n write_to.write(Player.x_pos)\n write_to.write(\"\\n\")\n write_to.write(Player.y_pos)\n write_to.write(\"\\n\")\n write_to.write(Player.exp_to_next_lvl)\n write_to.write(\"\\n\")\n write_to.write(Player.cur_exp)\n write_to.write(\"\\n\")\n write_to.write(Player.fatigue)\n write_to.write(\"\\n\")\n write_to.write(Player.stats.agility)\n write_to.write(\"\\n\")\n write_to.write(Player.stats.attack)\n write_to.write(\"\\n\")\n write_to.write(Player.stats.defense)\n write_to.write(\"\\n\")\n write_to.write(Player.stats.health_cur)\n write_to.write(\"\\n\")\n write_to.write(Player.stats.health_max)\n write_to.write(\"\\n\")\n write_to.write(Player.stats.vitality)\n write_to.write(\"\\n\")\n write_to.write(Player.inventory.name)\n write_to.write(\"\\n\")\n write_to.write(Player.level)\n write_to.write(\"\\n\")\n end\nend", "def determine_savefile\n if @saving\n if FileTest.exist?(make_filename(@last_slot_index))\n Sound.play_decision\n @confirm_window.show()\n @window_slotlist.active=false\n else\n Sound.play_save\n do_save()\n end\n else\n if FileTest.exist?(make_filename(@last_slot_index))\n Sound.play_load\n do_load()\n else\n Sound.play_buzzer\n end\n end\n end", "def save_turn_without_rescue\n File.open(SAVE_FILE, \"wb\") do |file|\n Marshal.dump($game_variables[VAR], file)\n Marshal.dump($game_variables[VAR2], file)\n end\n return true\n end", "def save_game\n #yaml = YAML::dump(self)\n puts \"Please enter a filename for the saved game.\"\n save_file_name = gets.chomp.downcase\n save_file = File.write(\"saved_games/#{save_file_name}.yaml\", self.to_yaml)\n #save_file.write(yaml)\n puts \"Your game has been saved!\"\n puts \"Goodbye!\"\n end", "def save_game(player)\n player_data = YAML::dump(player)\n File.open(\"player.yaml\", \"w\") do |file|\n file.puts player_data\n end\n print \"Successfully saved the game!\\n\\n\"\n return\nend", "def export\n # Temporarily use first database entry for all saves\n s = GomokuSave.first\n s.position = @current_state.position.join\n s.human_to_move = @current_state.player == :human\n s.human_last_row = @current_state.last_move[:human][0]\n s.human_last_column = @current_state.last_move[:human][1]\n s.computer_last_row = @current_state.last_move[:computer][0]\n s.computer_last_column = @current_state.last_move[:computer][1]\n s.top = @current_state.outer_bounds[:top]\n s.bottom = @current_state.outer_bounds[:bottom]\n s.left = @current_state.outer_bounds[:left]\n s.right = @current_state.outer_bounds[:right]\n s.save\n end", "def save_turn_data\n if SceneManager.scene_is?(Scene_Battle)\n $game_party.battle_members.each {|actor| fill_data(actor)}\n $game_troop.members.each {|enemy| fill_data(enemy)}\n fill_item_data($game_party.items, 0)\n fill_item_data($game_party.weapons, 1)\n fill_item_data($game_party.armors, 2)\n save_turn_without_rescue\n end\n end", "def save\n\t\t[@board, @player1, @player2, @player_turn, @check]\n\tend", "def save_game \n File.open('hangman_save.yml', 'w') { |f| YAML.dump(self,f)}\n exit\n end", "def record_save\n # Load mapinfo for map name\n mapinfos = load_data(\"Data/MapInfos.rxdata\")\n # Make the filename\n if Wep::Random_file_name and Wep::Modify_game_system\n filename = Wep::Game_version+\"-\"+$game_system.random_filename+\"-\"+Wep::Save_record_name\n else\n filename = Wep::Game_version+\"-\"+Wep::Save_record_name\n end\n estado = open(filename, \"a\")\n estado.write(\"------------------------------------------\\n\")\n estado.write(\"||||\"+Wep::Save_name+\" \"+($game_system.save_count+1).to_s+\"||||\")\n estado.write(\"\\n------------------------------------------\\n\") \n # Write time\n @total_sec = Graphics.frame_count / Graphics.frame_rate\n hour = @total_sec / 60 / 60\n min = @total_sec / 60 % 60\n sec = @total_sec % 60\n text = sprintf(\"%02d:%02d:%02d\", hour, min, sec)\n tiempo = \"\\nPlaytime: \"\n tiempo+= text\n estado.write(tiempo)\n # Write money\n money = \". Money: \"\n money += $game_party.gold.to_s\n estado.write(money)\n # Write actual map(and name)\n estado.write(\". Map: \"+$game_map.map_id.to_s+\" (\"+mapinfos[$game_map.map_id].name+\")\\n\")\n if Wep::Record_saves_actors\n if Wep::Record_saves_all_actors == false\n for actor in $game_party.actors\n estado.write(\"\\n\"+actor.name+\" (\"+$data_classes[actor.class_id].name+\") Nv\"+actor.level.to_s+\"\\n\")\n end\n else\n \n for i in 1...$data_actors.size\n estado.write(\"\\n\"+$game_actors[i].name+\" (\"+$data_classes[$game_actors[i].class_id].name+\") Nv\"+$game_actors[i].level.to_s+\"\\n\")\n end\n \n end\n end\n estado.write (\"\\n\")\n estado.close\n end", "def force_save\n GamePlay::Save.save\n end", "def saveGame \n \"saveGame\" \n end", "def save\n timeout_retry(3, 3){\n write \"SAVE\\r\\n\"\n status_code_reply\n }\n end", "def save\n dump = Marshal.dump(self)\n file = File.new(FILENAME, 'w')\n file = Zlib::GzipWriter.new(file)\n file.write(dump)\n file.close\n puts \"Bot state saved.\"\n end", "def action\n Graphics.freeze\n if @all_window[@index].is_a?(UI::SaveWindow)\n Save.save_index = @all_window[@index].index if MAXIMUM_SAVE > 1\n if @all_window[@index].data\n load_game\n else\n Save.save_index -= 1 if MAXIMUM_SAVE > 1\n create_new_party\n $pokemon_party.expand_global_var\n $game_system.se_play($data_system.cursor_se)\n $game_map.update\n end\n else\n return custom_action\n end\n $trainer.redefine_var\n Yuki::FollowMe.set_battle_entry\n $pokemon_party.env.reset_zone\n $scene = Scene_Map.new\n Yuki::TJN.force_update_tone\n @running = false\n end", "def save\n\n playerset('')\n $savefile = File.new(\"../Resources/Saves/save.txt\", \"w\")\n $savefile.puts(@@hand, @@ehand)\n cputs(\"saved\", \"green\")\n\nend", "def save_file\r\n @saved = true\r\n saving\r\n Dir.mkdir(\"saves\") unless Dir.exists? \"saves\"\r\n File.open(\"my_save.yaml\", \"w\") {|f| f.puts YAML::dump(self) }\r\n end", "def create_save\n @save_data = {:turns => @turns,:guesses => @guesses,:secret_word => @secret_word, :hidden_word => @hidden_word}\n save = File.new(\"./lib/save.txt\", \"w+\")\n save.puts JSON::dump(save_data)\n save.close\n end", "def perform\n Game.update_all_progress_caches\n end", "def save_result\n @running = Facade::SportSession::Running.find_by id: params[:id]\n\n if not @running.is_confirmed_participant(current_user)\n redirect_to runnings_url, alert: 'Permission denied'\n end\n\n @result = @running.result(current_user)\n\n # read gpx file if present\n track = nil\n if results_params[:file].present?\n @result = Track.create_track_and_update_result(@result, results_params[:file])\n track = @result.track\n else\n @result.time = results_params[:time]\n @result.length = results_params[:length]\n end\n\n if @result.save\n track.save if track.present?\n # Check for new Achievements!\n achievement_checker = AchievementsChecker.new @result\n achievements = achievement_checker.check true\n if achievements.count > 0\n titles = '\"' + achievements.map { |a| a.achievement.title}.join('\", \"') + '\"'\n flash[:notice] = [\"Congratulations, you obtained new achievements: #{titles}\"]\n flash[:notice] << 'Successfully saved results'\n else\n flash[:notice] = 'Successfully saved results'\n end\n\n redirect_to runnings_url\n else\n render :edit_result\n end\n\n end", "def create_save\n @save_data = {:turns => @turns,:guesses => @guesses,:secret_word => @secret_word, :hidden_word => @hidden_word}\n save = File.new(\"save.txt\", \"w+\")\n save.puts JSON::dump(save_data)\n save.close\n end", "def save_all(game_objects)\n log \"Saving given objects (#{game_objects.length})...please wait...\"\n @saved = 0\n game_objects.each do |o|\n if o.is_a? Player\n save_player(o)\n else\n store_object(o)\n end\n end\n log \"...done saving objects (#{@saved}).\"\n end", "def on_save_success\r\n Sound.play_save\r\n return_scene\r\n end", "def save_data(obj, filename) \r\n File.open(File.join(Yrgss.game.getPath.getAbsolutePath,filename), \"wb\") { |f|\r\n Marshal.dump(obj, f)\r\n }\r\nend", "def save\n @@games[@gameId] = self\n end", "def save\n file_path = self.class.file_path(@save_id)\n File.open(file_path, 'w') { |file| \n bytes = file.write @items.inspect\n if bytes > 0\n puts \"saved to #{file_path}\"\n else\n puts \"save to #{file_path} failed\"\n end\n }\n end", "def load_game_from_save\n #TODO implement game state saving and loading\n end", "def save_game_without_rescue(name)\n last_index = @last_savefile_index\n trace = rm_save_game_without_rescue(name)\n @last_savefile_index = last_index unless name.is_a?(Fixnum)\n trace\n end", "def save file='GOL.sav'\n File.open(file,'w') do |f|\n Marshal.dump(state,f)\n end\n end", "def bgsave\n timeout_retry(3, 3){\n write \"BGSAVE\\r\\n\"\n status_code_reply\n }\n end", "def save_game\n\t\tputs \"To save game please provide a game name. Please only use letters, numbers and underscores\"\n\t\tinput = gets.chomp.downcase\n\t\tvalid = input.index(/[^\\d,\\w,_]/)\n\t\tuntil !valid\n\t\t\tputs \"Please enter a valid name\"\n\t\t\tinput = gets.chomp.downcase\t\n\t\t\tvalid = input.index(/[^\\d+,\\w+, _+]/)\t\t\t\n\t\tend\n\t\tputs \"Saving #{input}\"\n\t\tyaml = YAML::dump(self)\n\t\tif !Dir.exists?(\"saved\")\n\t\t\tDir.mkdir(\"saved\") \n\t\tend\n\t\tsave_file = File.open(\"saved/#{input}.yaml\", 'w')\n\t\tsave_file.write(yaml)\n\t\tsave_file.close\n\t\tputs \"Game Saved!\"\n\t\texit\n\tend", "def game_finished\n\tif @skip == true\n \t@game_finished = true\n end\nend", "def dump\n File.open(\"saved_games.yaml\", \"a\") do |out|\n YAML::dump(self, out)\n end\n end", "def log_saves \n s_log = File.open(\"../saves/log.yml\", \"w\")\n s_log.puts @@save_count\n s_log.close\n end", "def save_enabled\n !$game_system.save_disabled\n end", "def save_enabled\n !$game_system.save_disabled\n end", "def save_moves\n\t\tFile.open(@filename, 'w') {|f| f.write(@past_moves.to_yaml)}\n\tend", "def save_game(game_id)\n db = Database.new\n user2 = @game_list[game_id].user2\n if user2.nil?\n user2 = ''\n end\n db.save_game(game_id, @game_list[game_id].user1, user2, game_state(game_id))\n db.close\n ''\n end", "def save_data(name, score)\n prompt = TTY::Prompt.new\n save_output = prompt.select(\"Would you like to submit your score to ranking board?\", [\"Yes\", \"No\"])\n if save_output == \"Yes\"\n # test ID 16\n begin\n File.write('./files/ranking.txt', \"#{name}, #{score}\\n\", File.size('./files/ranking.txt'), mode: 'a')\n rescue\n loading_spinner(2, \"Error loading file. Your score could not be added.\")\n else\n loading_spinner(2, \"Your score has been successfully submitted.\")\n end\n elsif save_output == \"no\"\n puts \"alright. navigating you back to menu...\"\n hold_and_clear_terminal(0.7)\n end\n end", "def open_save\n @in_save = true\n call_scene(Save) do |scene|\n @running = false if scene.saved\n Graphics.transition\n end\n @in_save = false\n end", "def save\r\n # Draw a frame.\r\n frame = Draw.new\r\n frame.stroke(\"black\")\r\n frame.stroke_width(2)\r\n frame.fill_opacity(0)\r\n frame.rectangle(0, 0, @image.columns-1, @image.rows-1)\r\n frame.draw(@image)\r\n \r\n @image.write(name + '.png')\r\n end", "def sync\n @game.sync\n end", "def save_playing\n self.play_start = DateTime.now\n self.paused = false\n self.seconds_offset = 0.0\n return ARUtils.save_cmdline(self)\n end", "def endgame()\n\t\t@database = Database.new\n\t\[email protected]_files(@players)\n\t\[email protected]_files\n\tend", "def finishGame\n if @roundsWon > @roundsLost\n puts \"You won the game!\"\n @gamesWon += 1\n else\n puts \"You lost the game :(\"\n @gamesLost += 1\n end\n puts \"Games Won: #{@gamesWon}. Ganes Lost: #{@gamesLost}\"\n requestNewGame()\n end", "def save(output_path=nil)\n to_output_path(output_path)\n run_command(@command,*@args << @input)\n @info = FlashTool.flash_info(@output_path)\n end", "def save!; File.write @path, @data end", "def scoreSave()\n\t\tscoreFile = File.new(\"save_files/save_score.yml\", \"w\") \n\t\n\t\tif(!scoreFile.closed?)\n\t\t\tprint \"Sauvegarde du tableau de score...\\n\"\n\t\tend\n\n\t\t#for cpt in 0...10\n\t\t#\tscoreFile.write (self.score_tableau[cpt].getNom()+\":\"+self.score_tableau[cpt].getScore().to_s()+\"\\n\")\n\t\t#end\t\t\n\t\t@score_tableau.sort\n\t\tscoreFile.puts YAML::dump(@score_tableau)\n\t\tscoreFile.close()\n\n\t\tif(scoreFile.closed?)\n\t\t\tprint \"Sauvegarde du tableau de score terminée !\\n\"\n\t\tend\n\n\tend", "def check_up\n return delete_game_question if @delete_game\n # Make sure the save index is correct when multi save is allowed\n Save.save_index = 1 if MAXIMUM_SAVE > 1\n return create_new_game unless find_save\n @all_window.each { |window| window.visible = true }\n Graphics.transition\n end", "def save\n\t\t# Ask the user for a file.\n\t\t# Defaults to current file.\n\t\tans = $screen.ask(\"save to: \",[@filename],true,true)\n\t\tif ans == nil\n\t\t\t$screen.write_message(\"Cancelled\")\n\t\t\treturn\n\t\tend\n\t\tif ans == \"\" then ans = @filename end\n\t\tif ans == \"\"\n\t\t\t$screen.write_message(\"Cancelled\")\n\t\t\treturn\n\t\tend\n\t\t# If name is different from current file name,\n\t\t# ask for verification.\n\t\tif ans != @filename\n\t\t\tyn = $screen.ask_yesno(\"save to different file: \"+ans+\" ? [y/n]\")\n\t\t\tif yn == \"yes\"\n\t\t\t\t@filename = ans\n\t\t\t\tset_filetype(@filename)\n\t\t\telse\n\t\t\t\t$screen.write_message(\"aborted\")\n\t\t\t\treturn\n\t\t\tend\n\t\tend\n\t\t# Dump the text to the file.\n\t\tFile.open(@filename,\"w\"){|file|\n\t\t\ttext = @text.join(@eol)\n\t\t\tfile.write(text)\n\t\t}\n\t\t# Let the undo/redo history know that we have saved,\n\t\t# for revert-to-saved purposes.\n\t\t@buffer_history.save\n\t\t# Save the command/search histories.\n\t\tif $hist_file != nil\n\t\t\t$buffers.save_hists\n\t\tend\n\t\t$screen.write_message(\"saved to: \"+@filename)\n\tend", "def save(prog, problem_id)\n FileUtils::mkdir_p get_workspace_for_problem(problem_id) # make the directory\n path = File.join(get_workspace_for_problem(problem_id), prog.original_filename) # create the file path\n File.open(path, \"wb\") { |f| f.write(prog.read) } # write the file\n end", "def save_state file=nil\n App.out.write_text_files file\nend", "def save # :nodoc:\n if @file\n File.open(SAVE_FILE, 'w') do |f|\n Marshal.dump(file, f)\n end\n else\n forget\n end\n end", "def save # :nodoc:\n if @file\n File.open(SAVE_FILE, 'w') do |f|\n Marshal.dump(file, f)\n end\n else\n forget\n end\n end", "def backup_game(game_name)\n games = GameList.from_config\n game = games.find_game(game_name)\n\n couldnt_find_game!(game_name) unless game\n run_backup!(game)\n end", "def save\n filename = Time.now.strftime(\"measures-%Y-%m-%d-%H%M%S.json\")\n dirname = \"goals/measures\"\n hash = { \"objective\" => @name}\n @outcomes.each {|o|\n hash.store(\"outcome\", o.name)\n hash.store(\"scale\", \"#{o.scale.class.name}.rb\")\n hash.store(\"baseline\", o.baseline)\n hash.store(\"baseline date\", o.baseline_date)\n hash.store(\"target\", o.target)\n hash.store(\"target date\", o.target_date)\n hash.store(\"measure\", o.last_measure.value)\n hash.store(\"measure date\", Time.now.strftime(\"%b %-d, %Y\"))\n }\n\n if !File.exists? dirname\n FileUtils.mkdir_p dirname\n end\n\n File.open(\"#{dirname}/#{filename}\",\"a\") do |f|\n f.write(JSON.pretty_generate(hash))\n f.write(\"\\n\")\n end\n end", "def background_save\n Process.detach( fork { save } )\n end", "def save\n File.open(@file, 'w') do |file|\n file.write(Psych.dump(@params))\n end\n @saved = true\n end", "def save_output(data)\n ::File.open(datastore['OUTFILE'], 'wb') do |f|\n f.write(data)\n print_status(\"Saved results in #{datastore['OUTFILE']}\")\n end\n end", "def save_output(data)\n ::File.open(datastore['OUTFILE'], 'wb') do |f|\n f.write(data)\n print_status(\"Saved results in #{datastore['OUTFILE']}\")\n end\n end", "def quickSave\n puts \"quick save\"\n sdc = FXDCWindow.new(@exportImage) #Select the exportImage object\n sdc.foreground = FXRGB(255, 255, 255)\n sdc.fillRectangle(0, 0, @canvas.width, @canvas.height) #Paint the exportImage white(\"Flush the image\")\n \n index = @layerArray.length() #Index is a pointer that starts at the end of the layer array\n while index >= 0\n if @dirtyArray[index] == true\n sdc.drawImage(@imageArray[index], 0, 0) #The while loop goes index by index in the image array and if data exists, it draws it onto the exportImage.\n end\n index = index - 1\n end\n sdc.end\n \n if @saved #Checks if the user has previously saved data using the file dialog save.\n \n FXFileStream.open(@savePath, FXStreamSave) do |outfile| #Open a file stream\n @exportImage.restore #Ensure exportImage data is allocated\n @exportImage.savePixels(outfile) #Save the image data to the stored savePath int the event that a long save has previously occured, overwriting the previous image.\n end\n end\n return 1\n end", "def save_game(game)\n print \"Enter a new filename to save game in: \"\n filename = gets.chomp\n File.open(filename, \"w\") {|f| f.puts game.to_yaml}\nend", "def save_with_load\r\n @oksave = true\r\n save\r\n @oksave = nil\r\n end", "def save_game(game_id, user1, user2, game_state)\n delete_saved_game(game_id)\n @db.query(\"INSERT INTO SavedGames \n (GameID, User1, User2, GameType, Board, Turn, LastPlayed)\n VALUES (#{game_id},\n '#{user1}',\n '#{user2}',\n '#{game_state.type}',\n '#{get_board(game_state)}',\n #{game_state.player_turn},\n '#{game_state.last_played.row} #{game_state.last_played.column}');\")\n end", "def move_to_storage\n process_emulation 5\n clear_progress_bar\n self.finished_at = Time.now.utc\n save! && ready!\n end", "def save\n prepare\n h = {}\n h[:title] = @title\n h[:sequence] = @sequence.map(&:export)\n outfile = File.join(@basedir, \"#{@name}.json\")\n File.open(outfile, 'w') do |f|\n f.write JSON.pretty_generate(h)\n end\n end", "def save_game name, score, level\n begin\n db.execute \"INSERT INTO '#{table}' ('name', 'score', 'level') VALUES ('#{name}', '#{score}', '#{level}')\"\n\n rescue SQLite3::Exception => e\n puts \"Database Exception occured\"\n puts e\n \n ensure\n db.close if db\n end\n end", "def save_state\n @refused['size'] = @auth_log.size\n IO.write(state_file, Psych.to_json(@refused))\n end", "def save\n now = Time.now\n\n data = {\n :id => @id,\n :desc => @desc,\n :ctime => Timestamp.dump(@ctime) || Timestamp.dump(now),\n :mtime => Timestamp.dump(now),\n :ppg_filename => @ppg_filename,\n }\n jobinfo.write(YAML.dump(data))\n end", "def save_output\n\n end", "def save!\n ScriptoriaCore::Ruote.engine.storage_participant.do_update(_workitem)\n end", "def save #always post\n #TODO: don't let people overwrite others' posts by changing the URL\n @post ||= generate_post(@user, {\n :paint_time=>0, \n :in_progress=>true})\n #overwrite work in progress\n if params[:started_at] && @post.paint_time.present?\n @post.paint_time += Time.now.to_i - params[:started_at].to_i\n else\n @post.paint_time = nil\n end\n @post.image = params[:picture]\n @post.anim = params[:chibifile]\n @post.palette = params[:swatches]\n @post.rotation = params[:rotation]\n @post.save!\n \n #save and continue drawing option\n render :text=>\"CHIBIOK\\n\" and return\n end", "def check_progress\n if self.can_check_progress\n on_db :adage do\n self.completed = !AdaData.with_game(self.name).where(user_id: self.user_id).last.nil?\n self.save\n end\n end\n return self.completed\n end", "def save_state\n json_object = { :secret_word => @secret_word, :display_content => @display_content,\n \t :failed_attemps => @failed_attemps }.to_json\n File.open(\"saved_state.json\", \"w\") { |file| file.write(json_object) }\n end", "def save\n @saved = @state\n end" ]
[ "0.75464237", "0.75269324", "0.7448396", "0.72396153", "0.72199243", "0.7209335", "0.71532375", "0.7134466", "0.7071716", "0.7052457", "0.6999557", "0.69832164", "0.69699836", "0.6964754", "0.6877685", "0.68243", "0.6781489", "0.6738818", "0.6719366", "0.66736895", "0.6663417", "0.66377157", "0.66178006", "0.66162145", "0.66074747", "0.6582076", "0.65705025", "0.6505465", "0.6501076", "0.6487301", "0.6461398", "0.64592475", "0.6446168", "0.64406073", "0.6437672", "0.6404173", "0.6390028", "0.63457716", "0.62814534", "0.6265169", "0.6253356", "0.6238789", "0.6196991", "0.61853456", "0.6150704", "0.61360806", "0.61225754", "0.61018246", "0.6094446", "0.6056319", "0.6055832", "0.60532314", "0.60523635", "0.6027295", "0.60272694", "0.6025901", "0.60046244", "0.5999461", "0.5994312", "0.59839356", "0.59839356", "0.5979548", "0.59533477", "0.59514725", "0.59485316", "0.59148806", "0.5900984", "0.5898685", "0.5886142", "0.58807385", "0.5879793", "0.58797085", "0.5855809", "0.5829053", "0.58189905", "0.5803612", "0.57956916", "0.57853514", "0.57853514", "0.5773981", "0.57724357", "0.575146", "0.5745539", "0.5742402", "0.5742402", "0.57418936", "0.57249624", "0.5718065", "0.5717301", "0.57162154", "0.5712805", "0.57102305", "0.5696935", "0.56951445", "0.5690087", "0.56883395", "0.5673957", "0.5622157", "0.5622058", "0.562175" ]
0.69011414
14
Get the name that the game in progress will be saved as
def get_save_name all_saved_games game_names = all_saved_games.keys while true print "Enter name to save game as: " game_name = gets.chomp next if game_name == "" return game_name unless game_names.include? game_name return game_name if yes_or_no "'#{ game_name }' already exists. Overwrite it" next if yes_or_no "Save game with a different name" message_then_enter "You chose to not save this game." return nil end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name\n @game_info['name']\n end", "def generate_filename(game)\n \"./data/#{Time.now.to_i}#{game.json.gamestate.opponent}.yml\"\n end", "def current_player_name\n Player.find(player_turn).name unless player_turn.nil?\n end", "def game_name\n fetch('sword_art_online.game_name')\n end", "def name\n return '_untitled_' if self[:name].blank?\n self[:name]\n end", "def name\n filename\n end", "def name\n filename\n end", "def pending_file_name(item = nil)\n get_file_data(item)[:name].presence\n end", "def get_name(name)\n name+\"_#{get_time_stamp}.xlsx\"\n end", "def name\n self.filename\n end", "def get_game_name(all_saved_games, task)\n\t\tgame_names = all_saved_games.keys\n\n\t\twhile true\n\t\t\tprint \"Enter name of game to #{ task }: \"\n\t\t\tgame_name = gets.chomp\n\t\t\treturn game_name if game_names.include? game_name\n\n\t\t\tnext if yes_or_no \"'#{ game_name }' doesn't exists; #{ task } another game\"\n\n\t\t\tmessage_then_enter \"You chose to not #{ task } any game.\"\n\t\t\treturn nil\n\t\tend\n\tend", "def name() @filename end", "def name\n @name ||= filename.split(\".\").first.sub(/^_/, \"\")\n end", "def proper_name\n \"#{@name} (Session: #{video_session}).#{file_extension}\"\n end", "def file_name\n\t\treturn 'st' + student_id.to_s + 'pr' + problem_id.to_s + 'so' + id.to_s\n\tend", "def game_name()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n result = Native.Run_game_name(@handle.ptr)\n result\n end", "def file_name\n file_name = (\"./tmp/database_doings/doing_uniques/uniques_done.txt\")\n end", "def name\n\t\tsuper || game.name\n\tend", "def name\n @name ||= File.basename(path)\n end", "def name\n @name ||= File.basename(path)\n end", "def winner_name\n comp = Competitor.find_by_id(self.winner)\n name = comp.name\n return name\n end", "def filename\n @filename ||= \"#{ @component.name }-#{(t=Time.now).to_i}-#{t.usec}.yaml\"\n end", "def file_name\n \"#{Time.current.to_i}-#{@file.original_filename}\"\n end", "def task_name\n raise \"This Stage has not been bound to a name\" if @name.nil?\n name.name\n end", "def name\n @name ||= ::File.basename(@path)\n end", "def filename\n File.join(%w{public finished-jobs},Digest::SHA1.hexdigest(url)+\".txt\")\n end", "def name()\n basename.to_s\n end", "def filename\n @filename ||= YoutubeDL::Output.new(@last_download_output).filename\n end", "def name\n @name ||= File.basename(path)\n end", "def save_curr_game(fname)\n @log.debug \"Don't save the network game\"\n end", "def name\n @name ||= File.basename(Dir.pwd)\n end", "def get_saved_title()\n begin\n return File.read(TITLE_FILE).strip!\n rescue => e\n return \"\"\n end\nend", "def name\n @name ||= File.basename(relative_file, '.png')\n end", "def save_game\n\t\tall_saved_games = yaml_load(SAVED_FILENAME)\n\t\tgame_name = get_save_name(all_saved_games)\n\t\treturn if game_name.nil?\n\n\t\tgame_string = self.to_yaml \n\t\tall_saved_games[game_name] = game_string\n\t\tyaml_save(SAVED_FILENAME, all_saved_games)\n\t\tmessage_then_enter \"'#{ game_name }' successfully saved.\"\n\tend", "def filename\n @data[:name]\n end", "def battler_name\n classname = self.class.classname\n name = \"#{base_battler_name+classname+state_trans_name}_#{battler_index}\"\n unless data_battler.folder_ref.empty?\n name = data_battler.folder_ref + \"/\" + name\n end\n if flip && custom_flip?\n name += \"_flip\"\n end\n return name\n end", "def original_filename\n @original_filename ||= \"profile-#{Time.now.to_i}-#{SecureRandom.hex(16)}.png\"\n end", "def name\n load! if not @loaded\n @name\n end", "def default_game_filename\n 'metro'\n end", "def name_upper\n return GameData::Text.get(0,@step_remaining==0 ? @id : 0).upcase\n end", "def name\n @name ||= @data_files.map(&:name).join(\",\")\n end", "def game_title\n object.game ? object.game.title : 'Не прикреплен ни к одной игре'\n end", "def name\n @name ||= File.basename(file).chomp(File.extname(file))\n end", "def get_achievement_name(achievement)\n if initted?\n @@dll_SteamAPI_ISteamUserStats_GetAchievementName.call @i_user_stats, achievement\n else\n nil\n end\n end", "def filename\n return @filename unless @filename.nil?\n generate_file_name()\n @filename\n end", "def get_player_name\n get_console_input.capitalize\n end", "def get_player_name(name)\n return prompt(\"Player Name? [Player #{name}]\",\"Player #{name}\")\n end", "def formated_name_for(game)\n return formated_release_date_for(game) if game.nil? || game.name.nil?\n \"#{game.name} - #{formated_release_date_for(game)}\"\n end", "def getfilename()\n current_time = Time.new.strftime(\"%Y-%m-%d\")\n \n # Create filename\n filename = current_time + \"_sprint_update_CS.html\"\n\n # Create folder with all file of sprint update\n foldername = \"History\"\n Dir.mkdir(foldername) unless File.exists?(foldername)\n\n return File.join(\".\", foldername, filename)\nend", "def save_game\n save_data = YAML::dump(self)\n puts \"Please enter a name for your save game:\"\n prompt\n @filename = gets.chomp\n File.open(\"./saved/#{@filename}\", \"w\") { |file| file.write(save_data)}\n puts \"Saved\"\n get_input\n end", "def name\n return UNNAMED if @tracks.empty?\n return @tracks.first.name()\n end", "def filename\n @io.original_filename\n end", "def storage_filename\n File.join(storage_path, @placeholder, @export_filename + @extension)\n end", "def get_full_name\n \"#{get_scheduled_date} #{get_event_type}: #{rank}) #{athlete_name}, #{get_timing}\"\n end", "def participant_name\n\n workitem.participant_name\n end", "def to_s() name end", "def dumpFilename\n DumpDir + '/' + @name + '-' + dateMark\n end", "def filename\n @name ||= \"#{timestamp}-#{secure_token(8)}.#{file.extension}\" if original_filename.present?\n end", "def filename\n current_time = Time.new\n formatted_current_time = current_time.strftime(\"%Y%m%d_%H%M%S\")\n formatted_current_time + \"_\" + original_filename\n end", "def filename\n current_time = Time.new\n formatted_current_time = current_time.strftime(\"%Y%m%d_%H%M%S\")\n formatted_current_time + \"_\" + original_filename\n end", "def save_game\n\t\tputs \"Type a name for your saved game\"\n\t\tgame_name = gets.chomp\n\t\tfilename = \"#{game_name}.txt\"\n\n\t\t ex_file = File.expand_path(\"./saved_games/#{filename}\")\n\t\t \n\t\tif File.exists?(ex_file)\n\t puts \"#{filename} exists\" #overwrite method?\n\t \n\t self.save_game\n\t else\n\t\t\tFile.open(ex_file, \"w\") do |f|\n\n\t\t\t\tf.puts YAML::dump(game_state)\n\n\t\t\t\tputs \"Your game was saved as #{filename}\" \n\t\t\tend\n\t\tend\n\tend", "def filename()\n @name ||= \"#{SecureRandom.hex()}.png\"\n end", "def name\n not_yet\n end", "def output_name\n @output_name || @names.first\n end", "def square_name\n \"#{file}#{rank}\".to_sym\n end", "def object_name\n @name ||= File.split(@source_path).last.gsub('.txt', '')\n end", "def name\n File.basename(self.path)\n end", "def generate_name(id)\n return GameData::Item[id].exact_name\n end", "def get_namecoin_name\n return @chunks[-10] if is_name_firstupdate?\n return @chunks[-9] if is_name_update?\n end", "def filename\r\n \"#{model.user_id.to_s}_#{model.id.to_s}.mov\" if original_filename\r\n end", "def player_name\n player.name\n end", "def name()\n return self.manager.dictionary[self]\n end", "def getName()\n\t\t\treturn @_name\n\t\tend", "def getFilename\r\n\t\t\t\t\treturn @filename\r\n\t\t\t\tend", "def save_game_without_rescue(name)\n last_index = @last_savefile_index\n trace = rm_save_game_without_rescue(name)\n @last_savefile_index = last_index unless name.is_a?(Fixnum)\n trace\n end", "def filename\n \"mp-#{make_stamp}-1024.jpg\" if original_filename\n end", "def name(other_user)\n return self.which_profile(other_user).ring.projected_name\n end", "def filename_for_export\n return \"No file attached to this asset\" if target_item.files.empty?\n target_item.original_file.file_name.first\n end", "def name\n \"Player#{@ix}\"\n end", "def title\n \"Game #{self.id}: \" + players.map { |p| p.username }.join(\" vs \")\n end", "def filename\n __advance!\n @_st_fileName\n end", "def get_name\n return @m_name\n end", "def get_name\n return @m_name\n end", "def get_name\n return @m_name\n end", "def get_name\n return @m_name\n end", "def name\n @name ||= doc.search('.moviename-big').text\n end", "def filename\n if super.present?\n @name ||= Digest::MD5.hexdigest(File.dirname(current_path))\n \"#{@name}#{File.extname(original_filename).downcase}\"\n end\n end", "def filename\n if super.present?\n @name ||= Digest::MD5.hexdigest(File.dirname(current_path))\n \"#{@name}#{File.extname(original_filename).downcase}\"\n end\n end", "def log_folder_name\n File.join self.class.log_folder, video.id.to_s, \"#{Time.now.utc.strftime(\"%Y-%m-%d_%H-%M-%S\")}_#{::Thread.main.object_id}\"\n end", "def file_name\n @_file_name ||= [@file_name, 'checkout_step'].join('_')\n end", "def player_name(id)\n name = Player.find(id)\n end", "def get_full_name\n \"#{get_scheduled_date}, #{get_event_type}: #{rank}) #{get_team_name}, #{get_timing}\"\n end", "def experiment_filename\n date = DateTime.now.strftime('%Y-%m-%d')\n \"#{date}_Job_#{job.id}\"\n end", "def to_s\n return \"WaitObject: \"+@name\n end", "def name()\n return @name\n end", "def name\n read_property('Name') || asmname || proj_filename_noext\n end", "def filename\n \"#{@user.name}.png\"\n end", "def saveGame \n \"saveGame\" \n end", "def getName()\n return @name ;\n end", "def filename\n if super.present?\n @name ||=\"#{SecureRandom.hex}.#{file.extension.downcase}\" if original_filename\n Rails.logger.debug(\"(BaseUploader.filename) #{@name}\")\n @name\n end\n end" ]
[ "0.6969733", "0.682412", "0.6627701", "0.65858066", "0.6514677", "0.6444092", "0.6444092", "0.6345322", "0.63022304", "0.62978303", "0.6293685", "0.6284822", "0.627947", "0.6272518", "0.6237412", "0.6233601", "0.6219157", "0.620106", "0.61439955", "0.61439955", "0.6137059", "0.61181957", "0.6095484", "0.6082493", "0.6077704", "0.6077258", "0.60756505", "0.606967", "0.6065121", "0.6059259", "0.6055022", "0.60506004", "0.604057", "0.6009862", "0.6005759", "0.60019207", "0.59949887", "0.5974091", "0.597279", "0.59671396", "0.59573466", "0.59478754", "0.59469914", "0.5945181", "0.5928982", "0.59184647", "0.5916171", "0.5915591", "0.5913497", "0.59092087", "0.59081", "0.59061563", "0.5904488", "0.5904025", "0.59033525", "0.5902817", "0.5896804", "0.5896144", "0.589579", "0.589579", "0.58864015", "0.5886017", "0.5885889", "0.58828616", "0.5877757", "0.5863715", "0.5853619", "0.5844636", "0.58442414", "0.583635", "0.5833611", "0.5831443", "0.5831232", "0.5829922", "0.5822943", "0.5810996", "0.5809895", "0.58024174", "0.58008015", "0.5797259", "0.57960314", "0.5795559", "0.5795559", "0.5795559", "0.5795559", "0.57847166", "0.57795906", "0.57795906", "0.5775158", "0.5769458", "0.5768469", "0.57664686", "0.57613593", "0.5760574", "0.5744441", "0.5742546", "0.5742418", "0.5741449", "0.5739787", "0.57378364" ]
0.6740965
2
List the names of all previously saved games
def list_games all_saved_games = yaml_load(SAVED_FILENAME) game_string = "Saved Games\n===========\n" all_saved_games.keys.each { |game_name| game_string += "#{ game_name }\n"} message_then_enter game_string end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_saved\n\t\tputs Dir.glob(\"./saved_games/*\")\n\tend", "def get_save_name all_saved_games\n\t\tgame_names = all_saved_games.keys\n\n\t\twhile true\n\t\t\tprint \"Enter name to save game as: \"\n\t\t\tgame_name = gets.chomp\n\t\t\tnext if game_name == \"\"\n\t\t\treturn game_name unless game_names.include? game_name\n\n\t\t\treturn game_name if yes_or_no \"'#{ game_name }' already exists. Overwrite it\"\n\t\t\tnext if yes_or_no \"Save game with a different name\"\n\n\t\t\tmessage_then_enter \"You chose to not save this game.\"\n\t\t\treturn nil\n\t\tend\n\tend", "def see_all_games\n system \"clear\"\n puts \"Here is the catalog of games.\"\n game_list = Game.pluck(:name)\n puts game_list\n puts puts\n prompt = TTY::Prompt.new\n prompt.select(\"What would you like to do?\") do |menu|\n menu.choice \"Go back to main menu\", -> {welcome}\n menu.choice \"Exit\", -> {clear}\n end\n end", "def game_history\n MyCliProject::Game.all.each do |game|\n puts Rainbow(\"------------------------------\").red\n puts \"#{game.game_name}\"\n puts Rainbow(\"------------------------------\").red\n end\n continue_or_exit \n end", "def get_saved_games_list(username)\n result = Array.new()\n res = @db.query(\"SELECT DISTINCT GameID, User1, User2, GameType FROM SavedGames WHERE User1 = '#{username}' OR User2 = '#{username}';\")\n while row = res.fetch_row do\n result.push(GameListElement.new(row[0], row[1], row[2], row[3]))\n end\n result\n end", "def display_games_index\n index = ['Welcome to textVENTURE! Please choose a game from the selection below:']\n Game.where(publish: true).find_each do |game|\n index.push(game.name)\n end\n index.push('Simply type the name of the game you wish to play, and hit enter')\n end", "def name_all_players\n (0..num_players - 1).each { |i| @players[i].name_player('Player' + i.to_s)}\n end", "def show_games\n puts Rainbow(\"------------------------------\").red\n puts MyCliProject::Game.all.last.description\n puts Rainbow(\"------------------------------\").red\n continue_or_exit\n end", "def std_player_names\n\t\tnames = []\n\t\tfor i in 1..Constants::MAX_PLAYERS\n\t\t\tnames << \"Player\" + i.to_s\n\t\tend\n\t\tnames\n\tend", "def index\n @game_saves = GameSave.all\n end", "def all_games\r\n\t\t@all_games = @tournament.all_games\r\n\tend", "def game_name\n fetch('sword_art_online.game_name')\n end", "def team_names\n names = []\n game_hash.each do | team, attributes|\n names << game_hash[team][:team_name]\n end\n return names\nend", "def team_names\n names = []\n game_hash.each do |k, team|\n names.push(team[:team_name])\n end\n names\nend", "def recent_games\n fetch_games\n end", "def names\n @songs.map(&:name).uniq\n end", "def get_game_name(all_saved_games, task)\n\t\tgame_names = all_saved_games.keys\n\n\t\twhile true\n\t\t\tprint \"Enter name of game to #{ task }: \"\n\t\t\tgame_name = gets.chomp\n\t\t\treturn game_name if game_names.include? game_name\n\n\t\t\tnext if yes_or_no \"'#{ game_name }' doesn't exists; #{ task } another game\"\n\n\t\t\tmessage_then_enter \"You chose to not #{ task } any game.\"\n\t\t\treturn nil\n\t\tend\n\tend", "def name\n @game_info['name']\n end", "def list_all_gameseries\n puts \"--------------------------------------------------------------------------------\\n\\n\"\n puts Amiiboproject::Amiibo.all.map {|x| x.gameSeries}.uniq\n puts \"--------------------------------------------------------------------------------\\n\\n\"\n end", "def index\n @games = Game.get_all_active\n end", "def print_songs\n song_names = []\n self.songs.collect {|song| song_names << song.name}\n puts song_names\n end", "def team_names\n team_names = []\n for location in game_hash.keys\n team_names.push(game_hash[location][:team_name])\n end\n return team_names\nend", "def print_saves\n puts 'Current saves:'\n Dir.children(SAVE_FOLDER).each { |file| puts file.delete('.JSON') }\n end", "def team_names\n names = []\n game_hash.each do |location, data|\n names << data[:team_name]\n end\n names\nend", "def team_names\n output =[]\n game_hash.each do |location, team_data|\n output.push(team_data[:team_name])\n end\n output\nend", "def team_names\n teams = []\n teams << game_hash[:home][:team_name]\n teams << game_hash[:away][:team_name]\n return teams\nend", "def index\n @games = Game.all.sort_by { |title| }\n end", "def title\n \"Game #{self.id}: \" + players.map { |p| p.username }.join(\" vs \")\n end", "def all_players_for_a_team(team_name, game)\n player_names = []\n game[:home_team][:players].each do |player_hash|\n player_names << player_hash[:player_name] if game[:home_team][:team_name] == team_name\n end\n game[:away_team][:players].each do |player_hash|\n player_names << player_hash[:player_name] if game[:away_team][:team_name] == team_name\n end\n player_names\nend", "def player_names\n self.players.pluck(:username).join(\", \")\n end", "def name_all_players()\n set_name()\n set_other_name()\n end", "def team_names\n [\n game_hash.dig(:home, :team_name),\n game_hash.dig(:away, :team_name)\n ]\nend", "def index\n @games = current_creator.games\n redirect_to root_path\n end", "def team_names\n team_names = []\n \n game_hash.each do |key, value|\n team_names << value[:team_name]\n end\n team_names\nend", "def team_names()\n result = []\n game_hash.each do |side,team|\n result.push(team[:team_name])\n end\n result\nend", "def get_games\n\tgameTypes = []\n\tDir[\"./games/*.rb\"].each do |game|\n\t\tgameTypes << game.split('/')[2].gsub(\".rb\", \"\")\n\tend\n\tgameTypes\nend", "def index\n listing_games\n end", "def save_game\n\t\t# If current game was previously saved, delete the old version of current game...\n\t\tif @running_saved_game != nil\n\t\t\tover_write_data\n\t\tend\n\t\t# And add new version of current game to saved data\n\t\tFile.open(@path, 'a+') do |f|\n\t\t\t\tf.puts \"#{@word.join},#{@guess},#{@wrong_letters},#{@turn}\"\n\t\tend\n\tend", "def record\n word = \"GHOST\"\n @losses.each do |player, losses|\n p \"#{player.name}: #{word[0...losses]}\"\n end\n end", "def playoff_games\n self.games.select { |game| game.version == 'playoff'}\n end", "def index\n\t\t@games = Game.all\n\tend", "def team_names\n fin_arr = []\n fin_arr << game_hash[:home][:team_name]\n fin_arr << game_hash[:away][:team_name]\n fin_arr\nend", "def display_saves\n Dir.children('./saves').each_with_index { |name, idx| puts \"#{idx}. #{name}\" }\nend", "def save_game\n\t\tall_saved_games = yaml_load(SAVED_FILENAME)\n\t\tgame_name = get_save_name(all_saved_games)\n\t\treturn if game_name.nil?\n\n\t\tgame_string = self.to_yaml \n\t\tall_saved_games[game_name] = game_string\n\t\tyaml_save(SAVED_FILENAME, all_saved_games)\n\t\tmessage_then_enter \"'#{ game_name }' successfully saved.\"\n\tend", "def players_list(players)\n output \"Loaded Players\"\n output \"==============\"\n \n File.open(\"log.txt\", 'a') do |log|\n players.each_with_index do |player, x|\n output \"#{x + 1}: #{player.new.name}\"\n log.write \"#{x + 1}: #{player.new.name}\\r\"\n end\n end \n output \"* No players loaded :o(\" if players.empty?\n \n blank_line\n end", "def store_names\n\n names = @store_names.dup\n names << \"users\" unless names.include?(\"users\")\n names\n end", "def team_names\n team_name = []\n game_hash.each do |team,info|\n team_name << info[:team_name]\n end\n team_name\nend", "def games\n @logger.log(BEFORE_CHECK_GAMES)\n parsed_response = get_and_parse(\"/api/games/my_turn.json\")\n games = parsed_response[\"body\"]\n @logger.log(AFTER_CHECK_GAMES, \"Found #{games.size} games\")\n games\n end", "def get_champion_names\n Static.get_champion_list.keys\n end", "def team_names\n arrayOfTeamNames = [] #initialize new hash\n arrayOfTeamNames << game_hash[:home][:team_name]\n arrayOfTeamNames << game_hash[:away][:team_name] #shovel it with the data\nend", "def team_names\n team = []\n game_hash.values.each do |team_info|\n team << team_info[:team_name]\n end\n team\nend", "def games\n @games ||= populate_game_array\n end", "def index\n @games = Game.all\n end", "def index\n @games = Game.all\n end", "def index\n @games = Game.all\n end", "def index\n @games = Game.all\n end", "def index\n @games = Game.all\n end", "def index\n @games = Game.all\n end", "def index\n @games = Game.all\n end", "def index\n @games = Game.all\n end", "def index\n @games = Game.all\n end", "def index\n @games = Game.all\n end", "def index\n @games = Game.all\n end", "def index\n @games = Game.all\n end", "def index\n @games = Game.all\n end", "def index\n @games = Game.all\n end", "def index\n @games = Game.all\n end", "def index\n @games = Game.all\n end", "def index\n @games = Game.all\n end", "def index\n @games = Game.all\n end", "def index\n @games = Game.all\n end", "def index\n @games = Game.all\n end", "def index\n @games = Game.all\n end", "def index\n @games = Game.all\n end", "def index\n @games = Game.all\n end", "def index\n @games = Game.all\n end", "def team_names\n game_hash.collect do |team_key, team_value|\n team_value[:team_name]\n end\nend", "def show_all_guesses\n\t\t@already_guessed.sort.join(\", \")\n\tend", "def store_all_window_names variable_name\r\n command 'storeAllWindowNames', variable_name\r\n end", "def show\n @creator = User.find_by(id: @game.creator_id)\n @joined_users_name = Array.new\n @game.user_games.each do |joined_users|\n @this = User.find_by(id: joined_users.user_id)\n @joined_users_name << @this.nickname\n end\n end", "def team_names\n game_hash.collect do |location, team_data|\n team_data[:team_name]\n end\nend", "def team_names\n team_names = []\n game_hash.each do |home_or_away, team_stats|\n team_names << team_stats[:team_name]\n end\n team_names\nend", "def both_team_names(game)\n both_teams = []\n both_teams << game[:home_team][:team_name]\n both_teams << game[:away_team][:team_name]\n both_teams\nend", "def display_all_playlists\n all_playlists = Playlist.all.map{|playlist| playlist.name }.sort\n playlist_name = prompt(\"Choose a Playlist: \", all_playlists)\n end", "def saved_list\n @savedToListModel = Array.new\n\n Image.where(saved_to_list: true).find_each do |item|\n @savedToListModel.append(item.url_name)\n end\n\n if @savedToListModel.empty?\n @savedToListModel.append(\"no_item.png\")\n else\n @@imageSavedList = @savedToListModel\n @@currentIndex = 0\n @currIfSaved = \"Saved\";\n end\n end", "def lifter_names\n gym_lifters.map(&:name)\n end", "def store_all_window_titles variable_name\r\n command 'storeAllWindowTitles', variable_name\r\n end", "def index\n @wantedgames = Wantedgame.all\n end", "def team_names\n\tnew_hash = game_hash\n\tnew_hash.map{|key, value| new_hash[key][:team_name]}\nend", "def index\n @playedgames = Playedgame.all\n end", "def index\n @league_games = LeagueGame.all\n end", "def player_names\n groups.flat_map{ |group| group.users }.map{ |user| user.login }\n end", "def team_names\n new_array = []\n new_array<< game_hash[:home][:team_name]\n new_array<< game_hash[:away][:team_name]\n return new_array\nend", "def list_genre\n genre = gets.chomp\n Genre.all.each do |a|\n if a.name == genre\n a.songs.collect { |s| puts \"#{s.artist.name} - #{s.name} - #{s.genre.name}\" }\n end\n end\n end", "def index\n @saved_titles = SavedTitle.all\n end", "def team_names\n teams = []\n teams << game_hash[:home][:team_name] << game_hash[:away][:team_name]\nend", "def team_names\n game_hash.collect do |location, attributes|\n attributes[:team_name]\n end\nend", "def get_league_names\n res = []\n\n if @league_names\n # league names were downloaded before\n @league_names.each do |l|\n res.push(l.name)\n end\n\n else\n # league names were not downloaded, extract them from the league objects\n @leagues.each do |l|\n res.push(l.name)\n end\n end\n\n res\n end", "def get_opponents(game)\n opponents = []\n game.get_players.each do |player|\n if player.get_team(game) != self.get_team(game)\n opponents.push player\n end\n end\n opponents\n end", "def index\n @game_infos = GameInfo.all\n end" ]
[ "0.7366903", "0.70876217", "0.66351086", "0.6621169", "0.63993144", "0.6335849", "0.612223", "0.6055781", "0.60381716", "0.6026532", "0.60247284", "0.5974726", "0.5961545", "0.59478503", "0.59443456", "0.59434617", "0.5940125", "0.59362316", "0.59320354", "0.59198046", "0.5912398", "0.5906335", "0.59023356", "0.5876202", "0.5874025", "0.5867517", "0.586216", "0.586081", "0.58480275", "0.5839554", "0.5826117", "0.58174807", "0.5810368", "0.57919014", "0.57850444", "0.57828236", "0.57757664", "0.5772151", "0.5758008", "0.5749614", "0.57493174", "0.57279295", "0.5722948", "0.5717279", "0.57170886", "0.57161796", "0.5704356", "0.5697217", "0.56921023", "0.5685677", "0.56797576", "0.56738836", "0.56604713", "0.5659243", "0.5659243", "0.5659243", "0.5659243", "0.5659243", "0.5659243", "0.5659243", "0.5659243", "0.5659243", "0.5659243", "0.5659243", "0.5659243", "0.5659243", "0.5659243", "0.5659243", "0.5659243", "0.5659243", "0.5659243", "0.5659243", "0.5659243", "0.5659243", "0.5659243", "0.5659243", "0.5654792", "0.56436974", "0.56397915", "0.56382823", "0.56341857", "0.56301373", "0.5627349", "0.56232446", "0.55896443", "0.5574037", "0.55704874", "0.55654186", "0.55649185", "0.556243", "0.555482", "0.55442786", "0.5538089", "0.5528219", "0.5527387", "0.5518754", "0.55168307", "0.55144805", "0.551336", "0.55117416" ]
0.8249531
0
Load the contents of a file and convert it to an object with YAML
def yaml_load(filename) begin YAML::load(File.read filename) rescue puts "Unable to read from file '#{ filename }'." nil end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yml_file_to_object(options={})\n content = read_file_content(options)\n YAML.load(content)\nend", "def load_yaml(filename); end", "def load\n if File.file?(@file_name)\n File.open(@file_name, 'r') do |file|\n YAML::load(file)\n end\n else\n default\n end\n end", "def load_yml(filename); end", "def yaml_load filename\n yaml_string = File.read filename\n\n YAML::load yaml_string\nend", "def yaml_load filename\n yaml_string = File.read filename\n\n YAML::load yaml_string\nend", "def formatting(file)\n data = File.read(file)\n\n YAML.load(data)\n end", "def load_from_file(path)\n YAML.load_file(path).each { |n,v| instance_variable_set(n, v) }\n end", "def yaml_load(file)\n\t\tYAML.load_file(file.to_s)\n\tend", "def load_file(file)\n buf = File.read(file)\n\n # parse the document into a Psych tree; we don't load here because we want\n # the file/line info while creating our entities.\n doc = YAML.parse(buf, filename: file)\n\n # Document should be an Array of Hashes\n seq = doc.children.first or return # ignore empty documents\n load_error!('not a yaml sequence (Array)', file, seq) unless seq.sequence?\n\n # Loop through each Hash\n seq.children.each do |map|\n\n # Make sure it's a mapping before we convert it to a ruby Hash\n load_error!('not a yaml mapping (Hash)', file, map) unless map.mapping?\n entity = YAML.send(:symbolize_names!, map.to_ruby)\n\n # Ensure they're not using some unknown keys\n unknown_keys = entity.keys - SUPPORTED_KEYS\n load_error!(\"unknown keys: #{unknown_keys}\", file, map) unless\n unknown_keys.empty?\n\n load_error!(\"id and update are mutually exclusive\", file, map) if\n entity[:id] and entity[:update]\n\n source = \"#{file}:#{map.start_line + 1}\"\n\n create = {}\n create[:id] = entity[:id] if entity.has_key?(:id)\n create[:update] = entity[:update] if entity.has_key?(:update)\n\n # Create an Array of the various base Entities that will be layered into\n # this Entity\n create[:base] = [entity[:base]].flatten.compact\n\n # Construct an Array of component arguments that will be sent to\n # Morrow::EntityManager#create_entity\n entity[:components] ||= []\n load_error!('The `components` field must be an Array; %s' %\n [ entity[:components].inspect ], file, map) unless\n entity[:components].is_a?(Array)\n\n create[:components] = entity[:components].map do |conf|\n case conf\n when Symbol\n conf\n when String\n conf.to_sym\n when Hash\n load_error!(<<~ERROR, file, map) unless conf.size == 1\n Multiple keys found in single component configuration. Note that\n the `components` field is an Array. Perhaps you missed a '-'\n before the next component after this one.\n ERROR\n\n # A Hash is a component with non-default values. The values may be\n # provided as a Hash, an Array (must have all elements), or a scalar\n # (for single field Components)\n comp, config = conf.first\n case config\n when Hash\n config.rekey! { |k| k.to_sym }\n when Array\n # don't make any changes\n else\n # turn this non-array value into an array of a single element\n config = [ config ]\n end\n { comp.to_sym => config }\n else\n load_error!('Unsupported component configuration type: %s' %\n [ conf.inspect ], file, map)\n end\n end\n\n create[:remove] = entity[:remove] || []\n\n # defer the action if we're not able to do it at the moment\n begin\n create_or_update(**create)\n rescue Morrow::UnknownEntity\n defer(source: source, entity: create)\n rescue Exception => ex\n raise Morrow::Error, <<~ERROR.chomp\n error in entity file: #{source}: #{entity.pretty_inspect\n .chomp.gsub(/\\n/, \"\\n\" + ' ' * 16)}\n ERROR\n end\n end\n\n # Attempt to flush any deferred actions now that we've loaded everything in\n # the file.\n flush\n end", "def load_file!(file)\n if File.file?(file)\n yaml = %w{.yaml .yml}.include?(File.extname(file))\n text = File.read(file)\n if yaml or /\\A---/ =~ text\n #text = ERB.new(text).result(Object.new.instance_eval{binding})\n data = YAML.load(text)\n data.each do |k,v|\n __send__(\"#{k}=\", v)\n end\n else\n # TODO: Should we really do this here?\n instance_eval(text, file, 0)\n end\n end\n end", "def loadyaml(filename) YAML.load_file(filename) 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 load_from_file(file_path)\n require \"erb\"\n opts = YAML.load(ERB.new(File.read(file_path)).result) || {}\n symbolize_keys(opts)\n end", "def load_yaml\n if has_file? \"#{name}.yml\"\n YAML.load_file(path / \"#{name}.yml\").apply_to self\n end\n end", "def load_yaml_file file\r\n load_yaml \"parse_file\", file\r\n end", "def load(filename)\n update! YAML.load_file(filename)\n end", "def load\n yaml = YAML.load_file(@file_path)\n yaml.each {|k, v| interpolate_setting(yaml, v)}\n settings = OpenStruct.new\n add_hash(settings, yaml)\n\n @lock.synchronize do\n @yaml = yaml\n @settings = settings\n end\n rescue\n puts \"Failed to load file: #{@file_path}\\n#{$!}\"\n end", "def load_yaml(file)\n @data = YAML.load(File.open(file))\n\n @data[\"people\"].each do |yaml_person|\n person = Person.new(yaml_person[\"fname\"], yaml_person[\"surname\"], yaml_person[\"dob\"])\n\n yaml_person[\"emails\"].each do |e|\n person.add_email(e)\n end\n\n yaml_person[\"phones\"].each do |e|\n person.add_phone(e)\n end\n\n add(person) \n end\n end", "def load(args)\n YAML::load_file(args[:file_name])\n end", "def yaml\n @yaml ||= YAML.load_file path\n rescue StandardError\n {}\n end", "def read_file(path)\r\n YAML::load( File.open(path) )\r\n end", "def parse_yaml(path)\n require 'yaml'\n\n str = Nitro::Template.new.render(File.read(path))\n\n if yaml = YAML::load(str)\n for name, data in yaml\n self[name] = instantiate(data)\n end\n end\n\n # sort the objects.\n\n str.scan(/^(\\w*?):$/).each do |key|\n @objects << self[key.to_s]\n end\n end", "def from_yaml(filename)\n require \"yaml\" unless defined?(YAML)\n from_hash(YAML.load(IO.read(filename)))\n end", "def load_yaml(yaml_path, variables = nil)\n #puts \"load_yaml #{yaml_path}\"\n if variables\n YAML.load(ERB.new(File.read(yaml_path)).result(OpenStruct.new(variables).instance_eval { binding })) \n else\n YAML.load(ERB.new(File.read(yaml_path)).result)\n end\nend", "def yaml(*files, **options, &block) = read(*files, parse: :yaml, ext: ['.yml', '.yaml'], **options, &block)", "def read_yaml_data_file filename\n data = {}\n File.open(filename, 'r') do |f|\n data = YAML.load(f)\n end\n data\nend", "def read_yaml_data_file filename\n data = {}\n File.open(filename, 'r') do |f|\n data = YAML.load(f)\n end\n data\nend", "def read file=STDIN\n\n yaml = case file\n when String\n raise \"Input file not defined\" unless file\n raise \"Input file does not exist\" unless File.exist? file\n raise \"Input file is not readable \" unless File.readable? file\n \n File.read(file)\n when IO\n file.read\n end\n\n raise \"Cannot read YAML data\" unless yaml\n load yaml\n end", "def yaml(filename)\n YAML.load(IO.read(filename).gsub(/---\\z/, ''))\nend", "def parse(path)\n YAML.load(File.read(path))\n end", "def open_create_yaml(file)\n file_structure = nil\n begin\n file_structure = YAML.load_file file\n rescue\n File.open(file, 'w') {|f| f.write '{}' }\n file_structure = YAML.load_file file\n end\n file_structure\nend", "def load_yaml_data( file )\n yaml_data = {}\n yaml_data.merge!( File.open( file ) { |yf| YAML::load( yf ) } )\n\n return yaml_data\n end", "def yaml_load(file_path)\n YAML.load(File.read(file_path)).to_smash\n end", "def load(file_path, local_variables = {})\n yaml = render file_path, local_variables\n YAML.load yaml\n end", "def load_yaml(file)\n require 'yaml'\n tokens = YAML.load_file(file)\n tokens.each do |token, category|\n @db[token] = category\n end\n end", "def import!(file)\n if File.directory?(file)\n # ...\n else\n case File.extname(file)\n when '.yaml', '.yml'\n merge!(YAML.load(File.new(file)))\n else\n text = File.read(file)\n if /\\A---/ =~ text\n name = File.basename(file)\n self[name] = YAML.load(text)\n else\n name = File.basename(file)\n self[name] = text.strip\n end\n end\n end\n end", "def from_yaml\n YAML.load(self)\n end", "def load(filename)\n files= filename.include?(',') ? filename.split(',') : [filename]\n @yml = files.inject({}) do |total_merge,file|\n total_merge.merge!(::YAML.load(ERB.new(File.read(\"#{yml_directory}/#{file}\")).result(binding)))\n end\n end", "def read!\n file = root + FILENAME\n if file.exist?\n data = YAML.load(File.new(file))\n data.each do |name, value|\n self[name] = value\n end\n end\n return self\n end", "def load_from_file(file, options = {})\n hash =\n if yaml = YAML.load_file(file)\n yaml.to_hash\n else\n {}\n end\n\n Overcommit::Configuration.new(hash, options)\n end", "def load_metadata_from_yaml(file)\n @metadata = {}\n @metadata = YAML::load(file)\n end", "def load_object (path)\n\n o = YAML.load_file(path)\n File.delete(path)\n o\n end", "def load_from_yaml(file)\n document_lines = File.readlines(file)\n\n headers = document_lines.enum_for(:each_with_index).\n find_all { |line, _| line =~ /^---/ }\n if headers.empty? || headers.first[1] != 0\n headers.unshift [\"--- name:default\", -1]\n end\n\n options = headers.map do |line, line_number|\n line_options = Hash.new\n line = line.chomp\n line.split(/\\s+/)[1..-1].each do |opt|\n if opt =~ /^(\\w+):(.*)$/\n line_options[$1] = $2\n else\n raise ArgumentError, \"#{file}:#{line_number}: wrong format #{opt}, expected option_name:value, where 'value' has no spaces\"\n end\n end\n line_options['merge'] = (line_options['merge'] == 'true')\n line_options['chain'] = (line_options['chain'] || '').split(',')\n [line_options, line_number]\n end\n options[0][0]['name'] ||= 'default'\n\n options.each do |line_options, line_number|\n if !line_options['name']\n raise ArgumentError, \"#{file}:#{line_number}: missing a 'name' option\"\n end\n end\n\n sections = []\n options.each_cons(2) do |(_, line0), (_, line1)|\n sections << document_lines[line0 + 1, line1 - line0 - 1]\n end\n sections << document_lines[options[-1][1] + 1, document_lines.size - options[-1][1] - 1]\n\n changed_sections = []\n @conf_options = options\n\n sections.each_with_index do |doc, idx|\n doc = doc.join(\"\")\n doc = evaluate_dynamic_content(file, doc)\n\n result = YAML.load(StringIO.new(doc))\n\n conf_options = options[idx].first\n name = conf_options.delete('name')\n changed = in_context(\"while loading section #{name} of #{file}\") do\n add(name, result || Hash.new, conf_options)\n end\n\n if changed\n changed_sections << name\n end\n end\n\t if !changed_sections.empty?\n\t \t@merged_conf.clear\n\t end\n changed_sections\n rescue Exception => e\n raise e, \"error loading #{file}: #{e.message}\", e.backtrace\n end", "def load(file = nil)\n @file = file if file\n @cfg = YAML.load_file(@file)\n end", "def initialize_from_yaml(path)\n # FIXME: It would be a lot cleaner if the YAML library would raise an\n # exception if it fails to read the file. We'll handle it like this for now\n # load_file just returns \"false\" if it fails\n yaml_data = YAML.load_file(path)\n\n unless yaml_data.nil?\n raise InitializationError.new(\"Bad YAML format, key/value pairs expected\") unless yaml_data.kind_of?(Hash)\n\n yaml_data.each do |variable, value|\n self.store(variable, value)\n end\n end\n\n after_initialize\n dump\n end", "def load_yaml(path, environment = nil)\n env = environment ? environment.to_s : env_name\n\n contents = File.read(path)\n if contents.empty?\n raise Mongoid::Errors::EmptyConfigFile.new(path)\n end\n\n # These are the classes that can be used in a Mongoid\n # configuration file in addition to standard YAML types.\n permitted_classes = [\n # Symbols occur as values for read preference, for example.\n Symbol,\n # BSON::Binary occur as keyId values for FLE (more precisely,\n # the keyIds are UUIDs).\n BSON::Binary,\n ]\n\n result = ERB.new(contents).result\n data = if RUBY_VERSION < '2.6'\n YAML.safe_load(result, permitted_classes, [], true)\n else\n YAML.safe_load(result, permitted_classes: permitted_classes, aliases: true)\n end\n\n unless data.is_a?(Hash)\n raise Mongoid::Errors::InvalidConfigFile.new(path)\n end\n\n data[env]\n end", "def load_config(config_file)\n YAML.load(File.open(config_file))\nend", "def load_storage\n YAML.load_file(file_path) || {}\n end", "def load_yaml(filename)\n\t\tpath = File.realpath(filename)\n\t\tdata = YAML.load_file(path)\n\t\tload_hash(data)\n\tend", "def take_yaml(yml)\n @data = YAML.load(yml)\n end", "def take_yaml(yml)\n @data = YAML.load(yml)\n end", "def load_yaml(args = {})\n file = File.read(args[:file] || CMUX_YAML)\n yaml = YAML.load(file)\n args[:key] ? yaml[args[:key]] : yaml\n rescue Psych::SyntaxError\n message = \"Make sure you've written #{file} in YAML Simple Mapping.\" \\\n ' Please check README.'\n raise message.red\n end", "def load_state file=nil\n file=App.outpath + \"save.rb\" if file.nil?\n f=File.open(file,'r')\n content=f.read\n # puts content\n App.out= YAML.load(content)\n f.close\nend", "def load_yaml(yaml_file)\n fail \"File #{yaml_file} doesn't exist.\" unless File.exist?(yaml_file)\n # Parse YAML file into a tree of nodes\n # Psych::SyntaxError doesn't inherit from StandardError in some versions,\n # so we want to explicitly catch it if using Psych.\n rescue_errors = [::StandardError, ::Psych::SyntaxError]\n yaml_parsed = File.open(yaml_file, 'r') do |f|\n begin\n YAML.parse(f)\n rescue *rescue_errors => e\n raise \"unable to parse #{yaml_file}: #{e}\"\n end\n end\n return {} unless yaml_parsed\n # Validate the node tree\n validate_yaml(yaml_parsed, yaml_file)\n # If validation passed, convert the node tree to a Ruby Hash.\n yaml_parsed.transform\n end", "def load_from_yaml(yaml_file)\n data = ::YAML.load_file(yaml_file)\n @headers = data[:headers]\n @currencies = data[:currencies]\n end", "def get_yaml_data_from_file(file)\n parsed = begin\n YAML.load(File.open(file))\n rescue ArgumentError => e\n fatal_error(\"invalid YAML syntax in file #{file}\")\n end\n return parsed\nend", "def load_yml(yml_file)\n if File.exist?(yml_file)\n yml_cfg = OpenStruct.new(YAML.load_file(yml_file))\n yml_cfg.jira_properties.each do |k, v|\n instance_variable_set(\"@#{k}\", v)\n end\n else\n raise StandardError, \"unable to find yml config file\"\n end\n end", "def read_yml(filename)\n YAML.load(File.read(filename))\n end", "def read_yaml(base, name, opts = {})\n begin\n self.content = File.read(File.join(base, name),\n merged_file_read_opts(opts))\n if content =~ /\\A(---\\s*\\n.*?\\n?)^((---|\\.\\.\\.)\\s*$\\n?)/m\n self.content = $POSTMATCH\n self.data = SafeYAML.load($1)\n end\n rescue SyntaxError => e\n Jekyll.logger.warn \"YAML Exception reading #{File.join(base, name)}: #{e.message}\"\n rescue Exception => e\n Jekyll.logger.warn \"Error reading file #{File.join(base, name)}: #{e.message}\"\n end\n\n self.data ||= {}\n end", "def from_yaml\n\t\tdata = YAML.load File.read(\"save.yaml\")\n\t\t@board = Board.new(data[:board], data[:positions])\n\t\t@current_turn = data[:current_turn]\n\t\t@ai_on = data[:ai_on]\t\t\n\tend", "def read_yaml(path)\n data = File.read path\n\n # Necessary to be backward-compatible with documentation generated\n # by earliar RDoc versions.\n data = data.gsub(/ \\!ruby\\/(object|struct):(RDoc::RI|RI).*/, '')\n data = data.gsub(/ \\!ruby\\/(object|struct):SM::(\\S+)/,\n ' !ruby/\\1:RDoc::Markup::\\2')\n\n OpenStructHash.convert YAML.load(data)\n end", "def load_map_file map_file\n return YAML.load(map_file.read)\nend", "def load yaml\n data = YAML::load yaml \n raise \"Cannot load YAML data\" unless data\n\n @raw = @data = @errors = @commands = nil\n @errors = data.delete('__ERRORS__')\n @commands = data.delete('__COMMANDS__')\n @raw = OpenStruct.new data\n @data = { }\n end", "def load_yaml(path)\n YAML.load_file File.expand_path(\"../#{path}\", File.dirname(__FILE__))\n end", "def load_config(file_path)\n config = OpenStruct.new\n YAML.load_file(file_path).each do |k,v|\n config.send(\"#{k}=\", v)\n end\n return config\n end", "def from_file(filename, &block)\n deserialize(open(filename))\n end", "def config_from_yaml(file)\n build_data = Pkg::Util::Serialization.load_yaml(file)\n config_from_hash(build_data)\n end", "def load_yml(template, options={})\n case File.extname(template)\n when '.erb'\n parse_erb(template, options)\n else\n YAML.load_file(template)\n end\n end", "def load_file(filename='~/grapevine.yml')\n filename = File.expand_path(filename)\n hash = YAML.load(File.open(filename))\n load(hash)\n end", "def load\r\n return unless File.exist?(STORAGE)\r\n\r\n props = YAML.load(File.read(STORAGE))\r\n props.each{|k, v| instance_variable_set(\"@#{k}\", v) }\r\n end", "def load_module_yaml(file_name)\n\t\tFile.open(file_name) { |file| YAML.load(file) }\n\tend", "def load!(file)\n hash = {}\n YAML.load_file(file).each do |k, v|\n hash[Pathname(k)] = v.map{|vv| Pathname(vv) }\n end\n replace(hash)\n end", "def load_yaml_file(path)\n if (file = find_data_file(path))\n YAML.load_file(file)\n end\n end", "def load_yaml(path) # Path must be in /data\n # path must be a yaml file path\n YAML.load_file(File.join(__dir__, \"../data/#{path}.yml\"))\n # YAML keys will be allways strings (never symbols)\n # Returns hash of values (strings)\nend", "def read_yaml(base, name)\n self.content = File.read(File.join(base, name))\n\n if self.content =~ /^(---\\s*\\n.*?\\n?)^(---\\s*$\\n?)/m\n self.content = $POSTMATCH\n\n begin\n self.data = YAML.load($1)\n rescue => e\n puts \"YAML Exception reading #{name}: #{e.message}\"\n end\n end\n\n self.data ||= {}\n end", "def yaml\n parse_yaml_string(yaml_string(config_file), config_file)\n end", "def load_model_element_file(filename)\n YAML.load(File.open(filename, 'r'))\n end", "def load(file)\r\n help = \"Use `srcpress gen-config` to generate a template config file\"\r\n Message::Error.no_file(\"config\", file, help) unless File.exist?(file)\r\n\r\n press_yml = YAML.load_file(file)\r\n self.output = press_yml[\"OutputFile\"]\r\n self.ovr_output = press_yml[\"OverrideOutput\"]\r\n self.import_kwords = press_yml[\"ImportKeywords\"]\r\n\r\n press_yml[\"FileOrder\"]\r\n end", "def load_file( file, hash = {})\n fail 'given file is nil' unless file\n hash.merge!( YAML.load_file(file) )\n end", "def load(file); end", "def read\n @metadata = {}\n @content = File.read(path)\n\n if @content =~ /^(---\\s*\\n.*?\\n?)^(---\\s*$\\n?)/m\n @content = $POSTMATCH\n\n begin\n @metadata = YAML.load($1)\n raise unless @metadata.is_a? Hash\n rescue => ex\n $stderr.puts \"#{File.basename($PROGRAM_NAME)}: #{ex.to_s}\"\n $stderr.puts \"WARNING: Couldn't load metadata.\"\n @metadata = {}\n end\n\n @metadata.symbolize_keys!\n import_metadata\n end\n end", "def load\n @filename = File.expand_path(file_name('feeds.yml'))\n end", "def read_yaml_file(file)\n if File.exist?(file)\n return YAML::load(File.read(file))\n end\n raise \"-- ERROR: file doesn't exist: \" + file\n end", "def load( filepath )\n unserialize( IO.read( filepath ) )\n end", "def read_concept_file(path)\n YAML.load(File.read path)\n end", "def load\n if @file && File.exist?(@file) && File.stat(@file).size > 0\n h = YAML::load open(@file, 'r').read\n h.each { |k,v| self[k.to_sym] = v}\n return true\n end\n false\n end", "def read_file(file)\n extension = file.split('.').last\n\n raise \"Models file should be of the format yml or xmi. The given file '#{file}' has an '#{extension}' extension.\" unless extension =~ /yml|xmi/\n\n begin\n @original_hash = extension == \"xmi\" ? XmiReader.new(file).to_h : YAML::load_file(file) \n HashWithIndifferentAccess.new(original_hash).symbolize_keys!\n\n rescue StandardError => e\n raise \"Models file '#{file}' could not be loaded: #{e}\"\n end\n end", "def pets\n load_yaml('personaje/pets')\nend", "def load_yaml(file, default={})\n default.merge(YAML.load_file(file))\n end", "def parse_yaml(readable_obj)\n ::YAML.load(readable_obj)\n end", "def load_config(file)\n @config = YAML.load_file(file)\n end", "def load(str)\n YAML.load(str)\n end", "def initialize(path)\n @data = YAML.load_file(path)\n end", "def load_yaml(yaml_file, merge = nil)\n raise ArgumentError, \"Cannot find file #{yaml_file}\" unless File.exist?(yaml_file)\n raise ArgumentError, \"Cannot find file #{merge}\" unless merge.nil? || File.exist?(merge)\n unless merge.nil?\n merge_data = YAML.load_file(merge)\n merge_data.each do |key, value|\n self.set(key, value)\n end\n end\n proc = YAML.load_file(yaml_file)\n @id = proc['id']\n @description = proc['description']\n proc['properties'].each do |key, value|\n self.set(key, value)\n end\n end", "def load_yaml(yaml_file)\n @options = YAML.load_file(yaml_file)\n end", "def load!(path)\n settings = YAML.safe_load(ERB.new(File.new(path).read).result)['api']\n from_hash(settings) if settings.is_a? Hash\n end", "def read\n Fepath.logger.debug \"Reading: #{filepath}\"\n\n begin\n self.content = File.read(filepath)\n match_data = YAML_FRONT_MATTER_REGEXP.match(content)\n if match_data\n self.content = match_data.post_match\n self.attributes.merge!(YAML.load(match_data[1]))\n end\n rescue SyntaxError => e\n Fepath.logger.fatal \"YAML Exception reading #{filepath}: #{e.message}\"\n rescue Exception => e\n Fepath.logger.fatal \"Error reading file #{filepath}: #{e.message}\"\n end\n\n return self\n end", "def initialize\n @tree = YAML::parse(File.open(CONFIG_FILE))\n end", "def data\n YAML::load_file(files[:config])\n end" ]
[ "0.8233501", "0.78425264", "0.7704821", "0.76582724", "0.7563641", "0.7563641", "0.7485994", "0.74460703", "0.74125373", "0.7372754", "0.7353208", "0.73426557", "0.73119974", "0.7277625", "0.7262874", "0.7256929", "0.7235613", "0.72314256", "0.71865624", "0.7184676", "0.71521217", "0.7135804", "0.71299154", "0.7073797", "0.70507056", "0.70127577", "0.6978626", "0.69777465", "0.69751817", "0.69706404", "0.6970287", "0.69541585", "0.6953266", "0.69516605", "0.69112", "0.69007164", "0.68913966", "0.68748814", "0.68537617", "0.6844886", "0.6839234", "0.68244195", "0.6820812", "0.68188137", "0.68120295", "0.6801501", "0.67825407", "0.6760329", "0.67495143", "0.6730156", "0.67195", "0.67195", "0.67168796", "0.6700069", "0.6696815", "0.66913235", "0.6682598", "0.66744065", "0.66700673", "0.6648767", "0.6644321", "0.66075844", "0.6601044", "0.65926605", "0.6589632", "0.6584129", "0.65792084", "0.6562462", "0.6560738", "0.65441334", "0.65416694", "0.65356874", "0.6530312", "0.6512517", "0.6506452", "0.65022296", "0.6500587", "0.649703", "0.6496291", "0.64814997", "0.6477326", "0.64720064", "0.6468317", "0.64673656", "0.64643", "0.644605", "0.64392644", "0.64281934", "0.64129394", "0.6412002", "0.6407061", "0.64066786", "0.6406523", "0.6401727", "0.64002633", "0.63916457", "0.6381665", "0.63756996", "0.63737845", "0.6346343" ]
0.66756874
57
Use YAML to save an object to file
def yaml_save(filename, to_save) begin File.open(filename, 'w') do |file| file.write(to_save.to_yaml) end true rescue puts "Unable to save to file '#{ filename }'." nil end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yaml_save object, filename\nFile.open filename, 'w' do |f| f.write(object.to_yaml)\nend end", "def yaml_save object, filename\n File.open filename, 'w' do |f|\n f.write(object.to_yaml)\n end\nend", "def yaml_save object, filename\n File.open filename, 'w' do |f|\n f.write(object.to_yaml)\n end\nend", "def yaml_save object, filename\n File.open filename, 'w' do |f|\n f.write(object.to_yaml)\n end\nend", "def yaml_save object, filename\n File.open filename, 'w' do |f|\n f.write(object.to_yaml)\n end\nend", "def yaml_save object, filename\n File.open filename, 'w' do |f|\n f.write(object.to_yaml)\n end\nend", "def yaml_save object, filename\n File.open filename, 'w' do |f|\n f.write(object.to_yaml)\n end\nend", "def yaml_save object, filename\n File.open filename, 'w' do |f|\n f.write(object.to_yaml)\n end\nend", "def yaml_save object, filename\n\tFile.open filename, 'w' do |f|\n\t\tf.write(object.to_yaml)\n\tend\nend", "def yaml_save object, filename\n\tFile.open filename, 'w' do |f|\n\t\tf.write(object.to_yaml)\n\tend\nend", "def yaml_save(object, filename)\n File.open filename, 'w' do |f|\n f.write(object.to_yaml)\n end\nend", "def yaml_save(object, filename)\n File.open (filename), \"w\" do |f|\n f.write(object.to_yaml)\n end\nend", "def write_yml(filename,object)\n File.open(filename,'w') do |f|\n f.write(YAML.dump(object))\n end\n end", "def yaml_dump(file, obj)\n\t\tFile.open(file.to_s, 'w+') {|f| f.write obj.to_yaml}\n\tend", "def save\n File.open(yaml_file, 'w') {|f| f.write(to_yaml) }\n end", "def save\n File.write(yfile, to_yaml)\n end", "def save\n File.open(file_name, 'w') { |f| f.write config.to_yaml }\n end", "def save\n ::File.open(@file, \"w\") { |file| file << self.to_hash.to_yaml }\n end", "def generate_save\n YAML.dump(self)\n end", "def save\n File.open(file, \"w\") {|f| f.write(to_hash.to_yaml) }\n end", "def save( file )\n begin\n File.open( file, 'w' ) { |f| f.write( YAML.dump( self ) ) }\n rescue\n File.open( file, 'wb' ) { |f| f.write( Marshal.dump( self ) ) }\n end\n end", "def save\n File.open(file, \"w\") {|f| f.write(to_hash.to_yaml) }\n end", "def save\n File.open(path, 'w') do |out|\n YAML.dump(data, out)\n end\n end", "def save(path_or_io)\n yaml = YAML.dump(to_yaml_hash)\n\n case path_or_io\n when String, Pathname\n File.open(path_or_io, 'w') { |f| f.write(yaml) }\n else\n path_or_io.write(yaml)\n end\n end", "def save\n File.open(file_path, 'w') do |file|\n YAML.dump(data, file)\n end\n end", "def serialize(object)\n YAML.dump(object)\n end", "def save_data\n puts \"saving data\"\n\n File.open(generate_filename(self), \"w\") do |f|\n f.write(ostruct_to_hash(self.json).to_yaml)\n end\n end", "def save\n \tdata = self\n \t\n \tFile.open('store.yml','w') do |f|\n \t\tf.write(data.to_yaml)\n \tend\n \tputs data\n \tputs \"Saved!\"\n \tputs \"\"\n end", "def save\n require 'yaml'\n File.open(output_file, 'w') { |f| f.puts(generate.to_yaml) }\n end", "def save!(file=nil)\n file = file || @file || self.class.default_filename\n file = @root + file if String === file\n now! # update date\n File.open(file, 'w'){ |f| f << yaml }\n end", "def save_yaml(yaml)\n yaml_file = File.join(thor_root, \"thor.yml\")\n\n unless File.exist?(yaml_file)\n FileUtils.mkdir_p(thor_root)\n yaml_file = File.join(thor_root, \"thor.yml\")\n FileUtils.touch(yaml_file)\n end\n\n File.open(yaml_file, \"w\") { |f| f.puts yaml.to_yaml }\n end", "def write_to_yaml(data,yaml_file) \n File.open(yaml_file,'w') { |yf| YAML.dump(data,yf) }\nend", "def aorta( obj )\n tempfile = File.join('/tmp',\"yobj_#{ Time.now.to_i }\")\n File.open( tempfile, 'w' ) { |f| f << obj.to_yaml }\n system( \"#{ ENV['EDITOR'] || 'vi' } #{ tempfile }\" )\n return obj unless File.exists?( tempfile )\n content = YAML::load( File.open( tempfile ) )\n File.delete( tempfile )\n content\nend", "def save_to_file(path)\n variables_to_save = instance_variables.reject { |v| v =~ /_proc$/ || v =~ /^@med/ }\n File.open(path, 'w') { |f| f.puts(\n variables_to_save.inject({}) { |h,n| h[n] = instance_variable_get(n); h }.to_yaml\n ) }\n end", "def save\r\n props = {}\r\n instance_variables.each{|v|\r\n # props[v.to_s[1..-1]] = instance_variable_get(\"#{v}\")\r\n p = v.to_s[1..-1]\r\n props[p] = self.send(p)\r\n }\r\n File.write(STORAGE, YAML.dump(props))\r\n end", "def save_file\r\n @saved = true\r\n saving\r\n Dir.mkdir(\"saves\") unless Dir.exists? \"saves\"\r\n File.open(\"my_save.yaml\", \"w\") {|f| f.puts YAML::dump(self) }\r\n end", "def y(obj)\n puts obj.to_yaml\nend", "def y(obj)\n puts obj.to_yaml\nend", "def save\n @filename = @filename || gen_filename\n file = File.open(File.join(@dir, @filename), 'w') { |f|\n f.puts @issue.to_yaml\n }\n end", "def persist!\n raise \"Robut::Storage::YamlStore.file must be set\" unless file\n File.open(file, \"w\") do |f|\n f.puts internal.to_yaml\n end\n end", "def store\n File.open(@file_name, 'w') do |file|\n file.write YAML::dump(@data)\n end\n end", "def to_yaml\n # write yaml\n end", "def save_yaml( f_enzyme, f_reference=nil, f_supplier=nil )\n File.open(f_enzyme, 'w') { |f| f.puts YAML.dump(@enzyme_data) }\n File.open(f_reference, 'w') { |f| f.puts YAML.dump(@reference_data) } if f_reference\n File.open(f_supplier, 'w') { |f| f.puts YAML.dump(@supplier_data) } if f_supplier\n end", "def save\n if !Dir.exists? @config_directory\n FileUtils.mkdir_p @config_directory\n end\n\n open(@file, 'w').write @main.to_yaml\n end", "def write(filename, hash)\n File.open(filename, \"w\") { |f| f.write(hash.to_yaml) }\nend", "def save(dir = \".\")\n File.open(File.join(dir, \"#{name}.yaml\"), 'w') do |f|\n f.print YAML.dump(self)\n end\n end", "def save()\n File.open(CONFIG_FILE, 'w'){ |f| f.write config.to_yaml } # Store\n end", "def save_settings\n File.open(@path, \"w\") do |file|\n file.write @settings.to_yaml\n end\n end", "def to_file filename\n File.open(filename, 'w') do |io|\n io.write self.to_yaml\n end\n end", "def save\n open @config_path, 'w' do |io|\n io.write({'files' => @files.collect(&:to_hash)}.to_yaml)\n end\n end", "def []= (fei, object)\n\n #linfo { \"[]= #{fei}\" }\n\n fei_path = compute_file_path(fei)\n\n fei_parent_path = File.dirname(fei_path)\n\n FileUtils.makedirs(fei_parent_path) \\\n unless File.exist?(fei_parent_path)\n\n File.open(fei_path, 'w') { |file| YAML.dump(object, file) }\n end", "def save!\n filepath.dirname.mkpath\n filepath.open( \"w\" ) do |f|\n f << YAML.dump( @entries )\n end\n clear_modified\n true\n end", "def save( file = @hobix_yaml )\n unless file\n raise ArgumentError, \"Missing argument: path to save configuration (0 of 1)\"\n end\n File::open( file, 'w' ) do |f|\n YAML::dump( self, f )\n end\n self\n end", "def to_yml outfile, arr = @arr\n require 'yaml'\n # cannot just convert / to __ in filename since path gets converted too\n #if outfile.index(\"/\")\n #outfile = outfile.gsub(\"/\",\"__\")\n #end\n File.open(outfile, 'w' ) do |f|\n f << YAML::dump(arr)\n end\n end", "def to_yaml\n\t\tFile.write(\"save.yaml\", YAML.dump({\n\t\t\t:board => @board.board,\n\t\t\t:positions => @board.positions,\n\t\t\t:current_turn => @current_turn,\n\t\t\t:ai_on => @ai_on\n\t\t\t}))\n\tend", "def save(hash)\n File.open(\"#{@directory}/#{@store}.yml\", 'w+') {|f| f.write(hash.to_yaml) }\n end", "def save_yaml(path=nil)\n unless path\n # Display file explorer\n path = Qt::FileDialog.getSaveFileName(self, \"Save configuration file\", \"./myconfig.yml\", \"YAML Files (*.yml *.yaml)\")\n end\n\n begin\n config_hash = Hash.new\n @container_hash.each do |pos, container|\n config_hash[pos] = container.config\n end\n File.open(path, \"w\") {|f| f.write(config_hash.to_yaml) }\n rescue Exception => e\n Vizkit.error \"A problem occured while trying to write configuration to '#{path}': \\n#{e.message}\"\n end\n end", "def save\n if any?\n FileUtils.mkdir_p basedir if !Dir.exist? basedir\n backup if @backup\n\n # I do this the long way because I want an immediate sync.\n f = open(@file, 'w')\n f.write YAML::dump self\n f.sync\n f.close\n\n set_mode if @mode\n end\n true\n end", "def save(file = nil)\n @file = file if file\n raise Error.new(Error::FileError) unless @file\n File.open(@file, 'w') do |f|\n f.puts(@prefix) if @prefix\n YAML.dump(@cfg, f)\n f.puts ''\n f.puts(@suffix) if @suffix\n end\n end", "def write_to_file(high_score)\n file = File.open(\"data/highscores.yml\",\"a+\"){ |file| file.write(high_score.to_yaml)}\nend", "def yaml_save(packages)\n FileUtils.mkdir_p(File.dirname(yaml_file))\n File.open(yaml_file, \"w\") do |file|\n file.write(packages.to_yaml)\n end\n end", "def dump( obj, &block )\n f = File.open( get_unique_filename, 'w' )\n\n serialized = serialize( obj )\n f.write( serialized )\n\n block.call( serialized ) if block_given?\n\n f.path\n ensure\n f.close\n end", "def save(filename)\n FileUtils.mkdir_p(File.dirname(filename))\n File.write(filename, YAML.dump(@metadata) + \"---\\n#{text}\")\n end", "def write(filename)\n File.open(filename, 'w') { |f| YAML.dump(self, f) }\n end", "def to_file( filename )\n File.open( filename, 'w' ) do |f|\n f.write( to_yaml )\n end\n end", "def dump\n File.open(\"saved_games.yaml\", \"a\") do |out|\n YAML::dump(self, out)\n end\n end", "def save_game(player)\n player_data = YAML::dump(player)\n File.open(\"player.yaml\", \"w\") do |file|\n file.puts player_data\n end\n print \"Successfully saved the game!\\n\\n\"\n return\nend", "def storeTree(inTree, filename)\n File.open(filename, \"w\") do |file|\n file.puts YAML::dump(inTree)\n end\n end", "def write(filename, hash)\n File.open(filename, \"a\") do |f|\n f.write(yaml(hash))\n end\nend", "def write_yaml(stations)\n log(' - Writing YAML...', false)\n File.open(YAML_PATH.to_s, 'w') { |file| file.write(stations.to_yaml) }\n log('DONE')\nend", "def write\n require 'yaml'\n open config_file_name, 'w' do |io|\n io.write to_yaml\n end\n end", "def save\n unless @filespec.nil?\n yaml_filespec = @filespec.ext('.yaml')\n if !File.exist?(yaml_filespec) || (File.mtime(@filespec) > File.mtime(yaml_filespec))\n @logger.info { \"saving: #{yaml_filespec}\" }\n File.open(yaml_filespec, \"w\") do |f|\n YAML.dump(\n {\n :title_isbn_hash => @title_isbn_hash,\n :isbn_title_hash => @isbn_title_hash,\n :isbn_dvd_hash => @isbn_dvd_hash,\n }, f)\n end\n else\n @logger.info { \"not saving, yaml file is newer than xml file\" }\n end\n else\n @logger.error { \"can not save, the filespec is nil\" }\n end\n end", "def to_yaml() end", "def save!(file_path)\n File.open(file_path, \"w\") do |f|\n f.write(YAML.dump(@log))\n end\n end", "def save_settings!\n File.open(settings_path, \"w\") { |f| f << settings.to_nested_hash.to_yaml }\n settings.create_accessors!\n end", "def store ( yml, name )\n storefile = File.new( name, \"w\")\n storefile.puts(yml)\n storefile.close\n return [yml]\n end", "def write_gce_fixture(obj, filename, quiet=false)\n File.open(filename, \"w+\") do |fd|\n s = YAML.dump(obj)\n fd.write(s.gsub(/\\d{12}/,'111111111111'))\n end\n puts \"Wrote: #{filename}\" unless quiet\n end", "def save_game\n store = YAML.dump(self)\n File.open('lib/saved_game.yml', 'w') do |file|\n file.puts(store)\n end\n puts 'your game has been saved!'\n end", "def save(path)\n Pathname.new(path).write(self.to_yaml)\n\n true\n rescue\n # TODO Add a custom exception here to track why it erred. IO? Permissions? etc.\n false\n end", "def save\n File.open(SETTING_FILE, 'w') do |file|\n file.write @values.to_yaml\n end\n end", "def save_to_file(obj)\n File.open(@filename, @mode) do |aFile|\n aFile.puts \"#{obj}\"\n end\n end", "def write_to_fixture(name)\n File.open(self.class.file_path(name), \"w\") do |file|\n file.write to_yaml\n end\n end", "def dump\n File.open(@meta_data_file_location,'w') { |f| f.write(YAML.dump(@meta_data))}\n end", "def save\n File.open( @plugins_file, 'w' ) do |out|\n YAML.dump( @plugins, out )\n end\n end", "def make_file_package(path, content, options = {})\n path.dirname.mkpath\n\n path.open('w') do |f|\n if options.any?\n f.puts stringify_hash_keys(options).to_yaml\n f.puts '---'\n end\n\n f.puts content\n end\nend", "def write_post(path, metadata, content = nil)\n File.open(path, 'w') do |f|\n f.puts metadata.to_yaml\n f.puts '---'\n f.puts content\n end\nend", "def write_yaml\n File.open(@path, \"w\") do |f| \n if [email protected]?\n f.write @comments.join(\"\\n\")\n f.write(\"\\n\")\n end\n f.write YAML.dump(yaml)\n end\n end", "def save(file)\n serialized_vars = []\n vars.each do |k, v|\n if marked_for_save.include?(k)\n serialized_vars << { 'name' => k, 'value' => v }\n end\n end\n File.open(file, 'w') do |out|\n YAML.dump(serialized_vars, out)\n end\n end", "def yml_file_to_object(options={})\n content = read_file_content(options)\n YAML.load(content)\nend", "def save_game(game)\n print \"Enter a new filename to save game in: \"\n filename = gets.chomp\n File.open(filename, \"w\") {|f| f.puts game.to_yaml}\nend", "def save_page_as_yml outputfile, page\n h = {}\n h[:url] = page.url\n h[:next_url] = page.next_url\n h[:subforum] = page.subforum\n h[:create_date] = page.create_date\n articles = []\n page.each do |a| articles << a.hash; end\n\n h[:articles] = articles\n\n to_yml outputfile, h\n end", "def save_game\n #yaml = YAML::dump(self)\n puts \"Please enter a filename for the saved game.\"\n save_file_name = gets.chomp.downcase\n save_file = File.write(\"saved_games/#{save_file_name}.yaml\", self.to_yaml)\n #save_file.write(yaml)\n puts \"Your game has been saved!\"\n puts \"Goodbye!\"\n end", "def save\n file = File.new(@file, 'w+')\n @properties.each { |key, value| file.puts \"#{key}=#{value}\\n\" }\n end", "def dump(hash)\n File.write(@fp.path, YAML.dump(hash))\n end", "def paml(x)\n\n puts(YAML.dump(x))\nend", "def write(io=@resource)\n File.open(io, 'w+') do |f|\n f << YAML::dump(@con)\n end\n \n if io == @resource\n reload_from_file\n end\n end", "def yaml(object) \n title = split(object)\n category = split(object, 1)\n ret = ''\n \n ret += '---' + \"\\n\"\n ret += \"layout: styleguide\" + \"\\n\"\n ret += \"title: #{title.capitalize}\" + \"\\n\"\n ret += \"category: #{category}\" + \"\\n\"\n ret += \"scss: _#{title}.scss\" + \"\\n\"\n ret += '---' + \"\\n\"\n \n ret\n end", "def store!(file_path)\n\n filename = File.basename(file_path)\n file = File.open(file_path, 'r')\n\n object_name = \"#{Date.today.strftime('%Y-%m-%d')}_#{filename}\"\n object = container.create_object(object_name)\n object.write(file)\n\n file.close\n\n puts \" -> Stored #{file_path} as #{object_name}\"\n\n end", "def save_queen(filename)\n File.open(filename, \"w+\") { |f| f.puts self.to_hash.to_yaml}\n end", "def write_yaml_data_file filename, data\n File.open(filename, 'w') { |f| f << YAML.dump(data) }\nend" ]
[ "0.8966893", "0.89403033", "0.89403033", "0.89403033", "0.89403033", "0.89403033", "0.89403033", "0.89403033", "0.887623", "0.887623", "0.88475907", "0.8830506", "0.8318458", "0.7803265", "0.7561209", "0.7365749", "0.7357892", "0.7340802", "0.7324636", "0.73052925", "0.7290073", "0.7218361", "0.71756625", "0.71347284", "0.7112338", "0.70247644", "0.70086354", "0.69841117", "0.6930225", "0.69299537", "0.69097084", "0.6894911", "0.6894756", "0.68934184", "0.6873626", "0.68713033", "0.6863008", "0.6863008", "0.6838274", "0.6808956", "0.6805917", "0.67840815", "0.67404264", "0.6739147", "0.6699875", "0.6689941", "0.66828144", "0.662866", "0.6627908", "0.65704864", "0.6541057", "0.6517839", "0.65004265", "0.6477705", "0.64527464", "0.6444936", "0.64327157", "0.64269716", "0.64121985", "0.64070374", "0.6406456", "0.6386723", "0.63627595", "0.6354603", "0.634998", "0.63406706", "0.63223493", "0.63214034", "0.63098824", "0.630802", "0.6300865", "0.62991816", "0.6296348", "0.62825745", "0.6280961", "0.6270281", "0.6270261", "0.6267271", "0.62672424", "0.62548375", "0.6230749", "0.6217487", "0.61946857", "0.6179158", "0.61768734", "0.6159814", "0.61566323", "0.61515415", "0.6144469", "0.6134612", "0.6105351", "0.61022055", "0.6102196", "0.6092777", "0.60660625", "0.60617", "0.6051902", "0.6049754", "0.60423446", "0.6038003" ]
0.66873497
46
Return boolean response to a yes/no question from the user
def yes_or_no(question) while true print (question + " (y/n): ") response = gets.chomp.strip.downcase if response == 'y' || response == 'yes' return true elsif response == 'n' || response == 'no' return false end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yes_no reply\n\tif reply == 'yes'\n\t\treturn true\t\n\telsif reply == 'no'\n\t\treturn false\n\telse\n\t\tputs \"Please answer yes or no\"\n\t\treturn nil\n\tend\nend", "def ask_boolean(question)\n yes? ask(question, true, ['y/n'])\n end", "def yes? response \r\n case response\r\n when \"y\", \"Y\"\r\n return true\r\n when \"n\", \"N\", \"exit\"\r\n return false\r\n else\r\n puts \"Please enter y/Y or n/N:\".colorize(:red)\r\n yes?(gets.chomp)\r\n end\r\n end", "def yes?(question)\r\n answer = ask(question).downcase\r\n answer == \"y\" || answer == \"yes\"\r\n end", "def yes?(question)\n answer = ask(question).downcase\n answer == \"y\" || answer == \"yes\"\n end", "def response\n response = gets.chomp\n if (response.downcase == \"yes\" || response.downcase == \"y\")\n initialize\n welcome\n return true\n elsif (response.downcase == \"no\" || response.downcase == \"n\")\n return true\n end\n end", "def is_yes?(input)\n input.downcase == \"yes\" ? true : false\n end", "def yes_entered?\n /y|Y/.match(connection.gets.chomp)\n end", "def will_answer?\n return true\n end", "def accept?(question)\n ! (ask(\"#{question} [YES/no] >\") =~ /n/i)\n end", "def yes?\r\n input.to_s[0,1].downcase == 'y' or input.to_i == 1\r\n end", "def is_true(user_input)\n if user_input == \"yes\"\n true\n else\n false\n end\nend", "def getYesOrNo ( question )\n response = getInput(\"#{question} (y/n)\")\n\n if response.downcase == \"y\"\n true\n elsif response.downcase == \"n\"\n false\n else\n puts \"Invalid response\\n\"\n getYesOrNo( question )\n end\nend", "def answer?\n return @answer\n end", "def yes?\n choose do |menu|\n menu.prompt = ''\n menu.choice('yes') { true }\n menu.choice('no') { false }\n end\n end", "def yes?(question, options={})\n print \"#{question} [Y/n] \"\n input = STDIN.readline.chomp.downcase\n BOOLEAN_MAP[input] || true\n end", "def valid_yesno?(data)\n data == 'y' || data == 'n' ? (true) : (false)\nend", "def no?(question)\r\n !yes?(question)\r\n end", "def ask_for_yes_no(msg)\n ['y','yes'].include?(ask_for_user_input(\"#{msg} [y/N]\").strip.downcase)\nend", "def ask_yes_or_no question\n case(r = ask_getch(question, \"ynYN\"))\n when ?y.ord, ?Y.ord\n true\n when nil\n nil\n else\n false\n end\n end", "def yes_no?(msg)\n answer = ui.ask(\"#{msg} yes/no ? \") do |res|\n res.case = :down\n res.validate = /y|n|yes|no/\n res.responses[:not_valid] = \"Use 'yes', 'no', 'y', 'n':\"\n end\n\n case answer\n when 'y', 'yes'\n true\n when 'n', 'no'\n false\n end\n end", "def speel_opnieuw?\nwhile true\nspeel_opnieuw = (get_response_for \"Play again (y/n)\").downcase\ncase speel_opnieuw\nwhen 'y', 'yes' then return true\nwhen 'n', 'no' then return false\nend\nend\nend", "def answered?\n return @answered\n end", "def ask question \n\twhile true\n\t\tputs question\n\t\treply = gets.chomp.downcase\n\n\t\tif (reply == 'yes' || reply == 'no')\n\t\t\tif reply == 'yes'\n\t\t\t\treturn true \t\t\t #I like to state return values explictly\n\t\t\telse\n\t\t\t\treturn false\n\t\t\tend\n\t\t\tbreak\n\t\telse\n\t\t\tputs 'Please answer \"yes\" or \"no\"'\n\t\tend\n\tend\nend", "def confirmed?\n confirmation == 'yes'\n end", "def player_response\n\n if compare_answer\n return puts \"#{@current_asker.name}: YES! You are correct.\"\n end\n\n puts \"#{@current_asker.name}: Seriously? No!\"\n\n end", "def ask_yes_no(question, default = nil)\n ui.ask_yes_no question, default\n end", "def yes_or_no?(question, action_if_yes, action_if_no, snd = false)\n clear_minibuffer(snd)\n prompt_in_minibuffer(question,\n lambda do |response|\n clear_minibuffer(snd)\n if response == \"yes\" or response == \"y\"\n action_if_yes.call(snd)\n else\n action_if_no.call(snd)\n end\n end,\n snd,\n true)\n end", "def no?(question)\n !yes?(question)\n end", "def ask question\n\twhile true\n\t\tputs question\n\t\treply = gets.chomp.downcase\n\n\t\tif (reply == 'yes' || reply || 'no')\n\t\t\tif reply == 'yes'\n\t\t\t\treturn true\n\t\t\telse\n\t\t\t\treturn false\n\t\t\tend\n\t\t\tbreak\n\t\telse\n\t\t\tputs 'Please answer \"yes\" or \"no\".'\n\t\tend\n\tend\n\n\tanswer #this is what is returned\nend", "def confirmed?\n confirmation == 'yes'\n end", "def yes?(question)\n case question\n when %r|_cancel/path/|\n return false\n end\n return true\n end", "def awaiting_dialog_response?\n dialog && dialog.question?\n end", "def prompt_yes_no(msg, default)\n def yes_no(x)\n return (x.downcase == \"y\" or x.downcase == \"yes\" or\n x.downcase == \"n\" or x.downcase == \"no\")\n end\n return promptFunction(msg, default, method(:yes_no)).chars.first == \"y\"\n end", "def yes_or_no(boolean)\n\t if boolean\n\t 'Yes'\n else\n 'No'\n end\n end", "def ask question\n\twhile true\n\t\tputs question\n\t\treply = gets.chomp.downcase\n\n\t\tif (reply == \"yes\" || reply == \"no\")\n\t\t\tif reply == \"yes\"\n\t\t\t\tanswer = true\n\t\t\telse\n\t\t\t\tanswer = false\n\t\t\tend\n\t\t\tbreak\n\t\telse\n\t\t\tputs \"Please answer 'yes' or 'no'.\"\n\t\tend\n\tend\n\n\tanswer # this will return (true or false).\nend", "def handle_yes_no_question\n answer = %w[Yes No].sample\n @user.session[:last_answer] = answer\n say answer\n end", "def yes_no(bool)\n case bool\n when 1\n \"yes\"\n when 0\n \"no\"\n end\n end", "def ask question\n\twhile true\n\t\tputs question\n\t\treply = gets.chomp.downcase\n\n\t\t\n\t\t\tif reply == 'yes'\n\t\t\t\treturn true\n\t\t\tend\n\n\t\t if reply == 'no'\n\t\t\t\treturn false\n\t\t\tend\n\t\t\t\n\t\t\n\t\t\tputs 'Please answer \"yes\" or \"no\".'\n\tend\nend", "def no_answer?\n return true if @no_answer.nil?\n @no_answer\n end", "def performer_yes?\n\t \t\tperformer == \"yes\"\n\t\tend", "def y_or_n\r\n\t\tputs \"Please answer [y]es or [n]:\"\r\n\t\tanswer = gets.chomp.downcase\r\n\t\tif answer == 'y' || answer == 'yes' || answer == '[y]es'\r\n\t\t\ttrue\r\n\t\telse\r\n\t\t\tfalse\r\n\t\tend\r\n\tend", "def pending_answer?\r\n\t\t\treturn (@type == 'answer' && @state == 're')\r\n\t\tend", "def confirm(prompt)\n return true if config[:yes]\n valid_responses = %w[yes no y n]\n response = nil\n 3.times do\n response = ui.ask(prompt).downcase\n break if valid_responses.include? response\n ui.warn \"Valid responses are #{valid_responses}\"\n end\n response.match(/^y/)\n end", "def ask_input_yes_no question\n begin\n puts \"#{question} (Y or N)\"\n # 'gets' includes the newline, so need chomp to prevent the include? from returning false\n decision = gets.chomp\n end while (not ([\"Y\", \"y\", \"N\", \"n\"].include? decision))\n decision == 'Y' || decision == 'y'\n end", "def yes_or_no(question)\n loop do\n print \"#{question}\\nyes(y), no(n), quit(q): \"\n $stdout.flush # Clear buffer\n response = gets.chomp\n case response.downcase\n when 'y', 'yes' then return true\n when 'n', 'no' then return false\n when 'q', 'quit' then exit\n else $stderr.puts \"Please answer \\\"yes\\\", \\\"no\\\", or \\\"quit\\\".\"\n end\n end\nend", "def answer_correct?(answer)\n @correct_answer == answer\n end", "def ask question\n while true\n puts question\n reply = gets.chomp.downcase\n\n if (reply == 'yes' || reply == 'no')\n if reply == 'yes'\n answer = true\n else\n answer = false\n end\n break\n else\n puts 'Please answer \"yes\" or \"no\".'\n end\n end\n \n answer # This is what we return (true or false).\nend", "def ask question\n while true\n puts question\n reply = gets.chomp.downcase\n\n if (reply == 'yes' || reply == 'no')\n if reply == 'yes'\n answer = true\n else\n answer = false\n end\n break\n else\n puts 'Please answer by either \"yes\" or \"no\".'\n end\n end\n\n answer # this is what we return (true or false)\nend", "def yes_no_q(question)\n\tresponse = \"\"\n\tloop do\n\t\tp question + \" (y/n)\"\n \t\tresponse = gets.chomp\n \t\tresponse = yn_booleen(response)\n \t\tbreak if response == true || response == false\n \tend #loop\n \tresponse\nend", "def yes?(prompt)\n begin\n @console.yes?(prompt)\n rescue TTY::Prompt::ConversionError => exception\n say \"Invalid input. Proceeding as if \\\"Y\\\" was entered.\"\n return true\n end\n end", "def ASK question\n while true\n puts question\n reply = gets.chomp.downcase\n if reply == \"yes\"\n return true\n end\n if reply == \"no\"\n return false\n end\n puts \"Please answer yes or no !\"\n end\nend", "def yes?(input)\n input[/^(y|Y)/].to_s.downcase == 'y'\n end", "def query_gender_neutral\n print 'Would you prefer a gender neutral experience? y/n '\n query_yesno == 'y' ? (return true) : (return false)\nend", "def yesno(bool)\n return 'N/A' if bool.nil?\n bool ? 'YES' : 'NO'\n end", "def ask question\n\twhile true\n\tputs question\n\treply = gets.chomp.downcase\n\tif reply == 'yes'\n\t\treturn true\n\tend\n\tif reply == 'no'\n\t\treturn false\n\tend\n\tputs 'Please answer \"yes\" or \"no\".'\n\tend\nend", "def get_confirmation(msg)\n print msg << \"(y/n) \"\n loop do\n answer = gets\n if answer.nil?\n return false\n end\n case answer.strip\n when \"y\", \"yes\" then break true\n when \"n\", \"no\" then break false\n else\n puts \"Invalid answer, must be y/n or yes/no\"\n end\n end\n end", "def ask questions\n\twhile true\n\t\tputs questions\n\t\treply = gets.chomp.downcase\n\t\tif reply == \"yes\"\n\t\t\treturn true\n\t\tend\n\t\tif reply == \"no\"\n\t\t\treturn false\n\t\tend\n\t\tputs \"plans answer with yes or no\"\n\tend\nend", "def answered?\n !body.blank?\n end", "def as_yes_or_no(boolean)\n boolean ? 'Yes' : 'No'\n end", "def another_game?\n\n puts \"Do you want to play another game? Y/N \"\n\n answer = gets.chomp\n\n return true if answer == 'Y'\n\n false\n\nend", "def filled?\n return true if confirmation.present?\n\n @message = 'You must choose an answer'\n false\n end", "def yes_no(prompt)\n medium_rainbow_typer(prompt)\n br\n TTY::Prompt.new.yes?('?')\n end", "def ask question\r\n\twhile true\r\n\t\tputs question\r\n\t\treply = gets.chomp.downcase\r\n\t\tif reply == 'yes'\r\n\t\t\t\treturn true\r\n\t\t\t\tbreak\r\n\t\tend\r\n\t\tif reply == 'no'\r\n\t\t\t\treturn false\r\n\t\t\t\tbreak\r\n\t\tend\r\n\t\t#else - I had an \"else\" in here, which doesn't belong. Need to remove and just 'Puts' if neither of the two above are included.\r\n\r\n\t\t\tputs 'Please answer \"yes\" or \"no\".'\r\n\t\tend\r\n\t\r\nend", "def another_game?\n\n puts \"\"\n puts \"Do you want to play another game? Y/N \"\n\n answer = gets.chomp\n\n return true if answer == 'Y'\n\n false\n\n end", "def view_another?\n yesno = gets.chomp.to_s\n if yesno == \"yes\"\n display_titles\n ask_for_movie_choice\n elsif yesno == \"no\"\n puts \"Thanks for using paste top anime movies CLI, come back soon!\"\n else\n puts \"please put in a valid answer of yes or no\"\n view_another?\n end\n end", "def is_correct?(answer)\r\n self.answer.to_s == answer\r\n end", "def ask question\n while question != \" \"\n puts question\n reply = gets.chomp.downcase\n if reply == \"yes\"\n return true\n elsif reply == \"no\"\n return false\n end\n puts \"Please put 'yes' or 'no'.\"\n end\nend", "def confirm(message='Are you sure?')\n while true\n tell_user [message, '(Y)es | (N)o']\n case input = user_input\n when /y|yes/ then return true\n when /n|no/ then return false\n else tell_user \"Invalid option: '#{input}'\"\n end\n end\n end", "def is_yesno(answer)\n [answer.downcase == \"y\", \"\"]\nend", "def confirm(question)\n formatted_question = \"\\n #{question} [Y/n]\"\n answer = ask(formatted_question).strip\n fail unless [\"Y\", \"y\", \"\"].include?(answer)\n end", "def yes?(prompt)\n begin\n answer = ask(\"#{prompt} [y/n]: \") { |q| q.limit = 1; q.case = :downcase }\n end until %w(y n).include? answer\n answer == 'y'\n end", "def yes_no_prompt(msg)\n answer = \"\"\n while answer !~ /^y$|^n$/\n print \"#{@script} -> #{msg} [y/n] ? \"\n answer = STDIN.gets.chomp\n end\n return true if answer =~ /^y$/i\n false\nend", "def compare_answer\n\n if @question.answer == @user_answer \n return true\n end\n\n # return false if incorrect\n false\n\n end", "def yes=(value)\n @yes = value\n end", "def needs_yes(question, message)\n $stdout.print question\n response = $stdin.gets.chomp\n Breadcrumbs.drop(\"Answered '#{response}' to '#{question}'\", true)\n if response.match?(/^n/i)\n puts message\n exit 1\n end\n end", "def ask_bool(question)\n puts(question)\n puts 'y/n'\n answer = gets.chomp!\n answer.downcase\nend", "def notify_boolean(value)\n value.present? ? 'yes' : 'no'\n end", "def display_boolean(value)\n value == \"true\" ? \"Yes\" : \"No\"\n end", "def yn_booleen(value)\n\tif value == \"y\"\n\t\treturn true\n\telsif value == \"n\"\n\t\treturn false\n\telse\n\t\tp \"Sorry, that response was not understood. Please use 'y' for yes and 'n' for no.\"\n\t\treturn value\n\tend #if\nend", "def ask question\n while true\n puts question\n reply = gets.chomp.downcase\n\n if (reply == 'yes' || reply == 'no')\n if reply == 'yes'\n answer = true\n else\n answer = false\n end\n break\n else\n puts 'Please answer \"yes\" or \"no\".'\n end\n end\n\n answer\nend", "def response?\n !!response\n end", "def yes_or_no(value = false)\n value ? \"Yes\" : \"No\"\n end", "def done_with_survey?\n if session[:user]\n ## check on users survey\n response = Datafile.checkSurveyByUser(session[:user])\n if response == \"yes\"\n redirect_to(:controller => 'webportal', :action => 'index')\n flash[:notice] = \"You have already submitted your survey! Thank you!!\"\n flash[:color] = \"valid\"\n return false\n else\n return true \n end\n else\n session[:return_to] = request.fullpath\n redirect_to(:controller => 'users', :action => 'login')\n flash[:notice] = \"You need to login to view the requested page! \"\n flash[:color]= \"invalid\"\n return false\n end \n end", "def are_you_sure? # Define a method. Note question mark!\n while true # Loop until we explicitly return\n print \"Are you sure? [y/n]: \" # Ask the user a question\n response = gets # Get her answer\n case response # Begin case conditional\n when /^[yY]/ # If response begins with y or Y\n return true # Return true from the method\n when /^[nN]/, /^$/ # If response begins with n,N or is empty\n return false # Return false\n end\n end\nend", "def correct?\n @correct ||= (answer == correct_answer)\n end", "def user_verify(answer)\n answer.downcase!\n if answer.start_with?('y')\n return true\n else\n return false\n end\nend", "def confirmed?\n confirmation == 'Confirmed'\n end", "def asks_mentor_questions?\n !mentor_questions.empty?\n end", "def check_answer(user_answer)\n self.answers.each do |answer|\n if answer.answer == user_answer\n return true\n end\n end\n return false\n end", "def human_boolean(boolean_statement)\n\t\tboolean_statement ? \"Yes\" : \"No\"\n\tend", "def response_equal_answer?\n @response.to_i == eval(@question)\n end", "def prompt_user(message)\n \"no\"\n end", "def ask(question)\n answer = 'n'\n answer = 'y' if agree(\"#{question} (y/n) \")\n answer\n end", "def done_playing?\n response = true\n SHELL.confirm(\"Keep Playing Blackjack?\")\n begin\n response = SHELL.ask(\"Enter 'Yes' or 'No'\").read_bool\n rescue Exception => e\n SHELL.error(\"Exiting due to error: #{e}\")\n response = true\n ensure\n return !response\n end\n end", "def prompt_b\n loop do\n print \"[(yes/no)]\"\n print \"> \"\n input_str = @input.gets\n if input_str.nil?\n raise \"No input left (must be automated input)\"\n end\n input_str = input_str.chomp\n input_bool = Input.str_to_bool input_str\n unless input_bool.nil?\n return input_bool\n else\n print \"[Please enter yes/no, y/n or true/false]\"\n end\n end\n end", "def answered?\n !(%w(answered) & flags).empty?\n end", "def ask question\n while true\n puts question\n reply = gets.chomp.downcase\n return true if reply == 'yes'\n return false if reply == 'no'\n puts 'Please answer \"yes\" or \"no\".'\n end\nend", "def answered_questionnaire?(user)\n answered_users.include?(user)\n end", "def no?(question, options={})\n print \"#{question} [y/N] \"\n input = STDIN.readline.chomp.downcase\n BOOLEAN_MAP[input] || false\n end" ]
[ "0.81545484", "0.8104073", "0.79222196", "0.7786147", "0.77118903", "0.76959395", "0.7680339", "0.7675007", "0.7636174", "0.75534624", "0.7551895", "0.7536992", "0.75200266", "0.7425014", "0.7391339", "0.7389808", "0.7365121", "0.7350209", "0.728548", "0.72570896", "0.724554", "0.72443706", "0.72306794", "0.7219179", "0.71893144", "0.718504", "0.71718", "0.7159841", "0.71509427", "0.7146025", "0.7110814", "0.7094876", "0.70913684", "0.7090992", "0.7085606", "0.70794773", "0.7076424", "0.704272", "0.7023358", "0.7022955", "0.70207995", "0.69923556", "0.69902736", "0.69825447", "0.6980126", "0.69781387", "0.69745255", "0.6962565", "0.6945118", "0.69213635", "0.6916352", "0.6908468", "0.6903769", "0.68982476", "0.6890857", "0.68664783", "0.6843829", "0.6819225", "0.6808057", "0.6796577", "0.67843676", "0.67763644", "0.6761849", "0.6744863", "0.6737185", "0.6729662", "0.6721653", "0.6721588", "0.67139393", "0.6710856", "0.6702245", "0.6691343", "0.66840464", "0.66726875", "0.6665287", "0.6662889", "0.66586536", "0.6646732", "0.66398406", "0.66385853", "0.66362274", "0.66352296", "0.66332984", "0.6627015", "0.66183853", "0.66124856", "0.66114604", "0.6607913", "0.66032696", "0.65992975", "0.659635", "0.6593016", "0.65865785", "0.65769625", "0.6572243", "0.657015", "0.65658164", "0.65647095", "0.6554694", "0.6551217" ]
0.76056576
9
Display a message to the user and wait for user input to continue
def message_then_enter(message) print(message += "\nPress Enter to continue...") gets end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def message_restriction\n puts \"Enter a Valid Input To Continue!\".red\n sleep(2)\n end", "def wait(str='Press ENTER to continue.')\n puts\n self.warning(str)\n STDIN.gets\n end", "def wait_for_message\n message = gets.strip\n publish_message(@current_user, message)\n wait_for_message\n end", "def wait_for_message\n loop do\n message = gets.strip\n publish_message(@current_user, message)\n end\n end", "def show_success_message_return\n puts \"Success - type any key to return to main screen\"\n print \":>\"\n gets.chomp\n end", "def wait_for_prompt\n while !@prompted do\n sleep(0.2)\n end\n end", "def wait_for_message\n listen_for_messages\n loop { publish_message(@current_user, gets.strip) }\n end", "def wait_user_input\n self.pause = true\n until Input.trigger?(:A) || (Mouse.trigger?(:left) && simple_mouse_in?) || stop_message_process?\n message_update_processing\n end\n $game_system.se_play($data_system.cursor_se)\n self.pause = false\n end", "def _pause_if_needed\n return unless Nenv.cuke_step?\n\n STDOUT.puts \"\\n\\nPress enter to continue\"\n STDIN.gets\n end", "def showMainMenu\r\n #clear user input field\r\n @userInput = \"\";\r\n #display main menu respond to user and wait for response\r\n @userRespone = \"Welcome To Voter Simulation! \\n\\nWhat would you like to do?\\n(C)reate, (L)ist, (U)pdate, (D)elete or (E)xit\"\r\n puts @userRespone;\r\n @userInput = gets.chomp;\r\n #call check user input after coming out of the loop\r\n checkUserInput();\r\n end", "def coming_soon_message\n puts \"Feature coming soon!\"\n puts \"Return to main? (y)es (e)xit Votersim\"\n\n @input = gets.chomp.downcase\n\n case @input\n when \"y\"\n prompt_user_for_initial_choices\n when \"e\"\n exit\n else\n coming_soon_message\n end\n end", "def ask! message\n print message\n\n STDIN.noecho(&:gets).chomp\n end", "def pause_here\n puts \"\\n\\nHit ENTER to continue\"\n gets.chomp\nend", "def display_message_and_wait(message, start = 1, *choices)\n choice = display_message(message, start, *choices)\n close_message_window\n return choice\n end", "def pause\r\n STDIN.gets\r\n end", "def prompt(message)\n print \"#{message}: \"\n $stdin.gets\n end", "def pause\n $stderr.write('Press CTRL+j or ENTER to continue') && $stdin.gets\n end", "def get_text(input)\n \n check = false\n until check == true\n puts \"Please enter your character's #{input}.\".colorize(:cyan).indent(10)\n print \"***>\".indent(10)\n user_input = gets.chomp\n puts \"Your character's #{input} is: #{user_input.capitalize.bold}\".colorize(:cyan).indent(10)\n check = confirm_text\n end\n user_input\n\nend", "def continue_browsing\n puts \"Would you like to keep learning more about COVID-19 spread?\".green\n user_input = gets.strip.downcase\n\n until user_input == \"yes\" || user_input == \"no\"\n puts \"I didn't understand that command.\".red\n puts \"Please enter YES or NO\".green\n user_input = gets.strip.downcase\n end\n\n user_input == \"yes\" ? program_run : sign_off\n end", "def pause\n print \"Press Enter/Return to continue...\"\n gets\n end", "def continue\n puts \"Would you like more information about another job posting? (yes/no)\"\n choice = gets.chomp\n if choice == 'yes' || choice == 'list'\n main\n elsif choice == 'no'\n goodbye\n exit\n elsif choice == 'exit' || choice == ''\n exit\n else\n print_error\n sleep 1\n continue\n end\n end", "def pause(msg=\"paused, press return key to continue\")\n puts msg\n STDIN.gets\n end", "def prompt_user(msg)\n puts \" => #{msg}\"\nend", "def loadingMessage()\n puts \"\\n\"\n print \"Thank you #{$_userNameVar}. Now I will do work for you :)\"\n sleep(1)\n print '.'\n sleep(1)\n print '.'\n sleep(1)\n print '.'\n sleep(1)\n puts '.'\nend", "def await_command(message = nil)\n puts message if message\n print \"#{@config.prompt} \".magenta\n input = STDIN.gets.chomp\n\n # Strip and process\n action, *params = input.strip.gsub(/\\s{2,}/, \" \").split(\" \")\n run_command(action || \"help\", params)\n end", "def provide_user_option \r\n @user_choice = user_input \"\\nWhat would you like to do?\\nPress 1 to pick a file and play normally\\nPress 2 to play file in reverse\\nPress 3 if you'd like to exit\\n\"\r\nend", "def pbWaitMessage\r\n return if !@briefMessage\r\n pbShowWindow(MESSAGE_BOX)\r\n cw = @sprites[\"messageWindow\"]\r\n MESSAGE_PAUSE_TIME.times do\r\n pbUpdate(cw)\r\n end\r\n cw.text = \"\"\r\n cw.visible = false\r\n @briefMessage = false\r\n end", "def welcome_message_for_user_as_codemaker\n puts \"OK, great! You're the codemaker.\"\n puts \"In order to play, you need to think up a secret code with 4 spots.\"\n puts \"The colors you can choose from are: red, blue, green, yellow, purple, and orange.\"\n puts \"Hit enter when you're ready for my first guess!\"\n get_input\n end", "def continue_prompt\r\n puts \"Press enter key to continue....\"\r\n continue = gets.chomp\r\n end", "def popup(message, selection = \"Okay\")\n setKeypad(true)\n\n while true\n clearBox(true)\n Color.set(self, :yellow, :bright)\n setCursor(1, 0)\n\n curspos = getCursor()\n message.split(/\\n/).each { |line|\n setCursor(curspos[0], getCursor()[1] + 1)\n addText(line)\n }\n\n Color.set(self, :white, :dim)\n setCursor(2, getCursor()[1] + 1)\n addText(\"- Press Enter, K or 3 to continue.\", true)\n\n setCursor(1, getCursor()[1] + 2)\n Color.set(self, :green, :bright)\n addText(\"-> \" + selection, false)\n\n character = @display.getch\n case character\n when 10, \"k\", \"K\", \"3\" # Confirm option\n break\n else\n debug \"#{character}\"\n end\n doupdate\n end\n setKeypad(false)\n @display.refresh()\n return true\n end", "def enter_to_continue\n puts \"\\n\"\n puts \"\\t\\t--------Press Enter to Continue------\"\n continue = gets\n end", "def write(msg)\n @prompted = false\n @input.puts msg\n print msg + \"\\n\"\n $stdout.flush\n if(msg != \"c\" && msg != \"continue\")\n wait_for_prompt\n end\n end", "def prompt\n\tputs \"Any Key to continue\"\n\tgets\nend", "def ask message\nprint message\nSTDIN.gets.chomp\nend", "def didYouLogin()\n puts \"\\n\\nDID YOU LOG INTO -- VPN PULSE SECURE-- YET?! \\n\\n \"\n sleep (3)\n puts \"IF NOT, DO SO *** NOW *** OR THIS PROGRAM WILL CRASH AND INPUT WILL BE LOST :)...FOREVER.\\n\\n\"\n sleep (5)\n puts \"Press 'Enter' to begin.\"\n gets.strip\n puts \"\\n\\n\\n\\n\"\n puts \"----------------------------------------------------------------\"\nend", "def ask(&parser)\n until input = get_input(parser)\n puts @notify_invalid if @notify_invalid\n end\n puts\n input\n end", "def prompt(message)\n Kernel.puts(\"=> #{message}\")\n\n end", "def input( message )\n selection = nil\n\n print message\n until yield(selection = gets.strip)\n print message\n end\n\n selection\n end", "def start\n begin\n Ui.print_formatted WELCOME_MESSAGE\n loop do\n choice = UserInputHandler.request_input @options_msg.join(\"\\n\")\n execute_choice(choice)\n end\n rescue StandardError => e\n handle_error(e)\n end\n end", "def prompt (message)\r\n puts \"==> #{message}\"\r\nend", "def finish_turn\n waiting_to_confirm_done = true\n invalid_confirmation = nil\n\n while waiting_to_confirm_done\n DisplayManager.prepare_ingame_display\n show_state\n puts 'Done! Your turn is now over.'\n puts InputManager.input_options({ affirmative: 'Hide my Rack'}, invalid_confirmation)\n invalid_confirmation = nil\n \n response = InputManager.get\n\n if InputManager.affirmative?(response)\n waiting_to_confirm_done = false\n elsif InputManager.negative?(response)\n # do nothing, wait\n else\n invalid_confirmation = response\n end\n end \n\n DisplayManager.prepare_ingame_display\n end", "def prompt(message)\n\tprint messaage\n\tgets.chomp # implicit return\nend", "def tmp_get_msg\n while TRUE do\n puts '='*20 + \"\\n\" + 'Enter the message please: '\n @pc_message_queue << gets.chomp\n end\n end", "def prompt_after_search\n puts \"\"\n puts \"--------------------| Search Completed |----------------------\"\n puts \" Type 'start' to start over or 'exit' to exit search \"\n input = gets.strip\n if input == \"exit\"\n puts \"Search Ended....\"\n elsif input == \"start\"\n puts \"Enter New Search\"\n self.define_scraper\n end\n end", "def get_user_input(message)\n puts message\n gets.chomp\n end", "def prompt( message )\n\tprint message\n\tgets.chomp\nend", "def printSurrenderMessage\n puts \"Aww it's sad to see you go so early. Better luck next round!\"\n pressKeyToContinue\nend", "def prompt_user(message)\n puts message\n print \">> \"\n gets.chomp\nend", "def prompt(message)\n\tKernel.puts \"=> #{message}\"\nend", "def pause_program\n puts\n puts \"Press enter to continue\"\n pause = STDIN.gets\nend", "def ask message\n print message\n STDIN.gets.chomp\nend", "def ask message\n print message\n STDIN.gets.chomp\nend", "def ask message\n print message\n STDIN.gets.chomp\nend", "def pause_program\n STDIN.gets\n end", "def ask_to_continue_or_cancel(msg=nil)\n puts msg if msg\n print \"(Ctrl-C to cancel or any key to continue)\"\n STDOUT.flush\n STDIN.getc\nend", "def main\n finished = false\n begin\n puts 'Main Menu:'\n puts '1 To Enter or Update Album'\n puts '2 To Play existing Album'\n puts '3 Exit'\n choice = read_integer_in_range(\"Please enter your choice:\", 1, 3)\n #read_string('Press enter to continue')\n case choice\n when 1\n maintain_albums\n when 2\n play_exisiting_album\n when 3\n finished = true \n end\n end until finished \nend", "def prompt(message)\n Kernel.puts(\"=> #{message}\")\n end", "def prompt(message)\n\tprint message\n\tgets.chomp\nend", "def message(input)\r\n start_line\r\n puts input.colorize(:light_blue)\r\n sleep(1.5)\r\n end", "def prompt(message)\n puts(\"#{message}\")\nend", "def prompt(message)\n\tprint message\n\tgets.chomp #Implicit Return\nend", "def do_manual\n display_world\n puts \"Press enter to continue\"\n STDOUT.flush\n input = STDIN.gets.chomp\n if input == \"quit\" or input == \"exit\"\n exit\n end\n end", "def prompt(text)\n @output += %(#{text}\\n)\n print text\n STDIN.gets\n end", "def prompt_user\n puts \"Type 'h' to hit or 's' to stay\"\nend", "def prompt_user\n puts \"Type 'h' to hit or 's' to stay\"\nend", "def prompt_user\n puts \"Type 'h' to hit or 's' to stay\"\nend", "def prompt(message)\n puts \"=> #{message}\"\n end", "def read_user_input(message, default = \"\", show_input = true)\n print interpolate_message(message, default)\n show_input ? gets : silent_command { gets }\n ($_.chomp.empty?) ? default.chomp : $_.chomp\n end", "def prompt(message)\n Kernel.puts(message.to_s)\nend", "def prompt(message)\r\n Kernel.puts(\"=> #{message}\")\r\nend", "def ask(question)\n while true\n\n ### Fill in with your code ###\n\n end\nend", "def prompt(message)\r\n puts \"=> #{message}\"\r\nend", "def prompt(message)\r\n puts \"=> #{message}\"\r\nend", "def prompt(message)\r\n puts \"=> #{message}\"\r\nend", "def prompt(message)\r\n puts \"=> #{message}\"\r\nend", "def prompt(message)\r\n puts \"=> #{message}\"\r\nend", "def user_name \n sleep 1\n puts \"Please Enter your name:\"\n input = gets.chomp(\" \")\n end", "def continue\n print \"Press enter to face the next wave\"\n gets\nend", "def prompt(msg, default)\n result = nil\n while not result\n display(msg)\n result = gets.strip\n if result.downcase == \"q\"\n throw :quit\n elsif result.downcase == \"i\"\n result = nil\n instructions\n elsif result.downcase == \"m\"\n display(\"Statistics can only be shown during a round!\")\n elsif result == \"\"\n return default.to_s\n else \n return result \n end\n end\n return result\n end", "def answer(msg)\n puts Time.now\n puts msg\n STDIN.gets.chomp\nend", "def ask_user\n\tprint \"User: \".blue\n\tgets.chomp\nend", "def prompt message\n puts (\"=> #{message}\")\nend", "def main\r\n finished = false\r\n begin\r\n puts 'Main Menu:'\r\n puts '1 To Enter or Update Album'\r\n puts '2 To Play Existing Album'\r\n puts '3 Exit'\r\n choice = read_integer_in_range(\"Please enter your choice:\", 1, 3)\r\n case choice\r\n when 1\r\n maintain_albums\r\n when 2\r\n play_album\r\n when 3\r\n finished = true\r\n else\r\n puts \"Please select again\"\r\n end\r\n end until finished\r\nend", "def enter_at_mode\n while gets.size > 0; end # discard remain data\n Machine.delay(1000) # wait 1 second\n loop {\n self.write '+'; Machine.delay(1)\n self.write '+'; Machine.delay(1)\n self.write '+'\n Machine.delay(1000) # wait 1 second\n rsp = self.gets\n return rsp if rsp == \"OK\\r\"\n }\n end", "def prompt(message)\r\n puts(\"=> #{message}\")\r\nend", "def prompt(message)\n puts(\"=> #{message}\")\n end", "def wait_for_any_input\n Bot.on :message do |message|\n puts \"Received '#{message.inspect}' from #{message.sender}\"\n sender_id = message.sender['id']\n show_humour_replies(sender_id, HUMOUR)\n end\nend", "def prompt(message)\n puts \"=> #{message}\"\nend", "def test_method\n prompt(\"test message\")\nend", "def hold_screen\n print 'Press Enter to continue.'\n gets.chomp\n end", "def prompt(message)\n puts(\"==> #{message}\")\nend", "def ready_check(player)\n system 'clear'\n puts \"#{player.player_name},\".light_green + ' are you ready to act?'\n puts 'Enter ' + '(Y)es'.light_green + ' to continue'\nend", "def confirm(message='Are you sure?')\n while true\n tell_user [message, '(Y)es | (N)o']\n case input = user_input\n when /y|yes/ then return true\n when /n|no/ then return false\n else tell_user \"Invalid option: '#{input}'\"\n end\n end\n end", "def continue_game\n\t\thandle_no_set\n\t\tuntil @is_end\n\t\t\tshow_progress\n\t\t\tshow_hand\n\t\t\tuser_input = get_user_cards\n\t\t\tupdate user_input\n\t\t\thandle_no_set\n\t\tend\n\tend", "def wait_for_message\n @message_window.update\n while $game_message.visible \n update_basic\n end\n end", "def printNoMoreHandsMessage\n puts \"Looks like you don't have more valid hands. Sorry :(\"\n pressKeyToContinue\nend", "def prompt_user_song\n puts \"Please enter a song name or number:\"\nend", "def make_selection\n\tprint \"\\nPlease make a selection \"\n\tgets.chomp\nend", "def ask_question(message, message1=nil, message2=nil, message3=nil)\n clear_message_box\n @ui.set_colour(DungeonOfDoom::C_BLACK_ON_YELLOW)\n @ui.place_text(message.ljust(20),1,2)\n @ui.place_text(message1.ljust(20),1,3) if message1\n @ui.place_text(message2.ljust(20),1,4) if message2\n @ui.place_text(message3.ljust(20),1,5) if message3\n @ui.input.upcase rescue ''\n end", "def prompt_user\n puts \"Type \\'h\\' to hit or \\'s\\' to stay\"\nend" ]
[ "0.79984224", "0.773115", "0.76078093", "0.7595329", "0.7409753", "0.73368937", "0.7149752", "0.70927507", "0.696557", "0.6965026", "0.68973184", "0.6810682", "0.6808272", "0.674812", "0.67429453", "0.66967726", "0.66887504", "0.6683571", "0.66487956", "0.6647096", "0.6623625", "0.66202384", "0.6615477", "0.66016626", "0.6590169", "0.6574511", "0.65583056", "0.65575635", "0.6557384", "0.6557", "0.65530604", "0.6547962", "0.6545641", "0.65414256", "0.6541403", "0.65302724", "0.6529658", "0.65296435", "0.65223396", "0.6502982", "0.6494783", "0.64928997", "0.64817023", "0.64792585", "0.64753604", "0.64706343", "0.64690083", "0.6453378", "0.6434622", "0.6434354", "0.64325196", "0.64325196", "0.64325196", "0.6428222", "0.6427333", "0.6421902", "0.6412874", "0.6409184", "0.6407763", "0.6406397", "0.63783675", "0.63738316", "0.6359732", "0.63586295", "0.63586295", "0.63586295", "0.63564825", "0.6350488", "0.63352305", "0.63313663", "0.63212657", "0.6316253", "0.6316253", "0.6316253", "0.6316253", "0.6316253", "0.6308412", "0.62960464", "0.6286617", "0.6285981", "0.62845665", "0.6283698", "0.6268308", "0.6261713", "0.62549746", "0.6251834", "0.6250763", "0.6248748", "0.62486255", "0.6247512", "0.6244959", "0.624467", "0.6242946", "0.6238641", "0.6236251", "0.62357545", "0.6229951", "0.62297827", "0.62281245", "0.6227719" ]
0.69861305
8
start function creat block
def create @block = Block.new(params[:block]) if @block.save redirect_to :controller=>"blocks",:action=>"index",:pageId=>params[:block]["pageId"] else render 'new' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_block(arg_type , frame_type)\n @callable.create_block(arg_type ,frame_type)\n end", "def blocks() end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def blocks; end", "def blocks; end", "def blocks; end", "def start\n create('start')\n end", "def start;end", "def begin_create\n create_stack.push(true)\n end", "def start &block\n @actions[:start] = block\n end", "def pre_block\n end", "def pre_block\n end", "def start\n yield\n end", "def run(&block); end", "def new_block_el(*args); end", "def start_new_block\n if (@block_buffer)\n add_block(@block_buffer)\n @block_buffer = nil\n end\n end", "def initialize_starting_block\n nil\n end", "def starting; end", "def start; end", "def start; end", "def start; end", "def start; end", "def start; end", "def start; end", "def start; end", "def start; end", "def start; end", "def start; end", "def start; end", "def start; end", "def start; end", "def start; end", "def start; end", "def start_run; end", "def define &block\n new block\n end", "def create_block_object(&block)\n block\nend", "def start\n end", "def start\n end", "def start\n end", "def start\n end", "def initialize\n start\n if block_given?\n yield\n stop\n end\n end", "def run() end", "def list_block()\n\nend", "def block_node; end", "def block_node; end", "def begin; end", "def new\n\t\t@block = Block.new\n\tend", "def run(&block)\n end", "def start\n end", "def start\n end", "def start\n end", "def start\n end", "def start\n end", "def start\n end", "def start\n end", "def start\n end", "def parfait_block(compiler)\n return @parfait_block if @parfait_block\n @parfait_block = compiler.create_block( make_arg_type , make_frame(compiler))\n end", "def start_handler\n\tend", "def start\n \n\tend", "def command_start; end", "def command_start; end", "def command_start; end", "def start\n end", "def start\n end", "def block(name=\"block\", &proc)\n gen = self.class.new(@library, @module, @function, @function.add_block(name))\n gen.instance_eval(&proc)\n return gen\n end", "def start(*)\n self\n end", "def on_start(&block)\n @on_start << block\n end", "def function_define(name=\"\",&block)\n \"function #{name}() { #{block.call} }\" \n end", "def started; end", "def post_block\n end", "def post_block\n end", "def start\n end", "def start(info); end", "def spawned; end", "def spawned; end", "def builder &block\n if block_given?\n @builder = Proc.new do\n say_name\n block.call\n shell.padding += 1\n save_instructions if instructions.present?\n shell.padding -= 1\n end\n else\n @builder\n end\n end", "def runner(&blk); end", "def runner(&blk); end", "def start\n\n end", "def start_handler\n end", "def create_blocked\n end", "def create_first_block\n\ti = 0\n\tinstance_variable_set( \"@b#{i}\", \n\t\t\t\t\t\t\t\t\t\t\t\t Block.first( \n\t\t\t\t\t\t\t\t\t\t\t\t\t{ from: \"Dutchgrown\", to: \"Vincent\", what: \"Tulip Bloemendaal Sunset\", qty: 10 },\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ from: \"Keukenhof\", to: \"Anne\", what: \"Tulip Semper Augustus\", qty: 7 } )\n\t\t\t\t\t\t\t\t\t\t\t )\n\tLEDGER << @b0\n\tpp @b0\n\tp \"============================\"\n\tadd_block\nend" ]
[ "0.7125281", "0.6617578", "0.64229137", "0.64229137", "0.64229137", "0.64229137", "0.64229137", "0.64229137", "0.64229137", "0.64229137", "0.64229137", "0.64229137", "0.64229137", "0.64229137", "0.64229137", "0.64229137", "0.64229137", "0.64229137", "0.64229137", "0.64229137", "0.64229137", "0.64229137", "0.6394419", "0.6394419", "0.6394419", "0.6370725", "0.63673997", "0.6343659", "0.6289185", "0.62854", "0.62854", "0.6224364", "0.6205149", "0.61464006", "0.61312413", "0.6128351", "0.61129797", "0.6101319", "0.6101319", "0.6101319", "0.6101319", "0.6101319", "0.6101319", "0.6101319", "0.6101319", "0.6101319", "0.6101319", "0.6101319", "0.6101319", "0.6101319", "0.6101319", "0.6101319", "0.60889304", "0.6079291", "0.60759515", "0.60549074", "0.60549074", "0.60549074", "0.60549074", "0.6049006", "0.60442024", "0.602897", "0.60208446", "0.60208446", "0.5993291", "0.5991911", "0.59817827", "0.5966867", "0.5966867", "0.5966867", "0.5966867", "0.5966867", "0.5966867", "0.5966867", "0.5966867", "0.5956246", "0.5950239", "0.5946015", "0.59351873", "0.59351873", "0.59351873", "0.5932617", "0.5932617", "0.591457", "0.5906945", "0.5904859", "0.5903657", "0.58910877", "0.5886734", "0.5886734", "0.58846223", "0.5884164", "0.585805", "0.585805", "0.5851302", "0.58259606", "0.58259606", "0.5784864", "0.57676035", "0.5766831", "0.57617193" ]
0.0
-1
end function creat block
def edit @blockId = params[:id] @a=Block.select('blocks.*,block_contents.id as id1,block_contents."blockId",block_contents."section1",block_contents."section2",block_contents."section3",block_contents."section4",block_contents."quote1",block_contents."quote2",block_contents."quote3",block_contents."languageCode"'). joins('LEFT JOIN block_contents ON blocks.id = block_contents."blockId"').where("blocks.id=?",@blockId) @block = @a.find(@blockId) @page =Page.where("id=?",@block.pageId) @listLanguages = Language.all @listIcons =Icon.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def new_block_el(*args); end", "def create_block(arg_type , frame_type)\n @callable.create_block(arg_type ,frame_type)\n end", "def blocks() end", "def blocks; end", "def blocks; end", "def blocks; end", "def return(&block); end", "def end; end", "def end; end", "def end; end", "def block_node; end", "def block_node; end", "def post_block\n end", "def post_block\n end", "def main_end ; end", "def end() end", "def begin; end", "def yield; end", "def create_block_object(&block)\n block\nend", "def end\n end", "def end\n end", "def begin() end", "def list_block()\n\nend", "def end\n end", "def block?; end", "def after_block_boundary?; end", "def close_block\n push_silent \"end\"\n @template_tabs -= 1\n end", "def create_blocked\n end", "def new\n\t\t@block = Block.new\n\tend", "def returns; end", "def block_node=(_); end", "def block=(_arg0); end", "def block=(_arg0); end", "def end\n end", "def define &block\n new block\n end", "def addTeardownBlock( &block ); self.class.addTeardownBlock( &block ); end", "def body\n Node::Block.new([return_operation])\n end", "def build_end\n @code << <<-CODE\n\t \t\t\treturn result\n\t\t\tend\t\n\t\tCODE\n end", "def create_blocks(count)\n begin\n create_blocks! count\n rescue\n nil\n end\n end", "def pre_block\n end", "def pre_block\n end", "def compile_end_construct\n if content = compiler.eof_content\n line 'var $__END__ = Opal.Object.$new();'\n line \"$__END__.$read = $return_val(#{content.inspect});\"\n end\n end", "def finish(*args,&ruby_block)\n # Gain access to the accesser as local variable.\n finisher_proc = @finisher_proc\n # Execute the code generating the accesser in context.\n HDLRuby::High.space_push(@namespace)\n HDLRuby::High.cur_block.open do\n instance_exec(ruby_block,*args,&finisher_proc)\n end\n HDLRuby::High.space_pop\n end", "def closure! \n end", "def _end!; end", "def after_create(&block)\n DSL.new(@employee, :after_create, &block)\n end", "def berlioz; end", "def nebula; end", "def finish(*args,&ruby_block)\n # Gain access to the finisher as local variable.\n finisher_proc = @finisher_proc\n # Execute the code generating the accesser in context.\n HDLRuby::High.space_push(@namespace)\n HDLRuby::High.cur_block.open do\n instance_exec(ruby_block,*args,&finisher_proc)\n end\n HDLRuby::High.space_pop\n end", "def parfait_block(compiler)\n return @parfait_block if @parfait_block\n @parfait_block = compiler.create_block( make_arg_type , make_frame(compiler))\n end", "def return!(&block); end", "def with_block(&block)\n end", "def finalized; end", "def finalize!; end", "def require_block; end", "def body; end", "def body; end", "def body; end", "def body; end", "def body; end", "def body; end", "def body; end", "def body; end", "def body; end", "def body; end", "def body; end", "def body; end", "def body; end", "def body; end", "def body; end", "def body; end", "def close() end", "def close() end", "def close() end", "def close() end", "def close() end", "def end(arg0)\n end", "def at_end; end", "def createEntryBlockAlloca(theFunction, varName)\n# IRBuilder<> TmpB(TheFunction.getEntryBlock, TheFunction.getEntryBlock.begin )\n# return TmpB.CreateAlloca(Type::getDoubleTy(getGlobalContext()), 0, VarName)\n end", "def run(&block); end", "def block_class() Block; end" ]
[ "0.694858", "0.694858", "0.694858", "0.694858", "0.694858", "0.694858", "0.694858", "0.694858", "0.694858", "0.694858", "0.694858", "0.694858", "0.694858", "0.694858", "0.694858", "0.694858", "0.694858", "0.694858", "0.694858", "0.694858", "0.6744916", "0.6663996", "0.6628072", "0.6620341", "0.6620341", "0.6620341", "0.6538165", "0.6527613", "0.6527613", "0.6527613", "0.65117186", "0.65117186", "0.6477416", "0.6477416", "0.6450469", "0.6443356", "0.6345205", "0.6333463", "0.6317913", "0.62979263", "0.62979263", "0.6281393", "0.62585014", "0.6257652", "0.62358767", "0.62212956", "0.6151925", "0.6091437", "0.60697275", "0.6056197", "0.60457814", "0.6038004", "0.6038004", "0.6037391", "0.59766644", "0.59677476", "0.5887898", "0.5868548", "0.5868032", "0.5846715", "0.5846715", "0.5820329", "0.5814467", "0.58081704", "0.58052284", "0.58029884", "0.5800759", "0.57934624", "0.5787152", "0.5782434", "0.57726043", "0.57578176", "0.57420266", "0.5728199", "0.57267845", "0.5709626", "0.5709626", "0.5709626", "0.5709626", "0.5709626", "0.5709626", "0.5709626", "0.5709626", "0.5709626", "0.5709626", "0.5709626", "0.5709626", "0.5709626", "0.5709626", "0.5709626", "0.5709626", "0.5708035", "0.57071257", "0.57071257", "0.57071257", "0.57071257", "0.56940645", "0.56939137", "0.5690006", "0.5687944", "0.56861603" ]
0.0
-1
start function update block
def update @block = Block.find(params[:id]) @paramsBlock = {"pageId"=>params[:block]["pageId"],"blockName"=>params[:block]["blockName"],"isAlternative"=>params[:block]["isAlternative"],"picture"=>params[:block]["picture"],"active"=>params[:block]["active"] } if params[:block]["id1"]=='' @paramsBlockContent = {"blockId"=>@block.id,"section1"=>params[:block]["section1"],"section2"=>params[:block]["section2"],"section3"=>params[:block]["section3"],"section4"=>params[:block]["section4"],"quote1"=>params[:block]["quote1"],"quote2"=>params[:block]["quote2"],"quote3"=>params[:block]["quote3"],"languageCode"=>params[:block]["languageCode"]} @blockContent = BlockContent.new(@paramsBlockContent) @blockContent.save @msg = 'Successfully saved !' else @paramsBlockContent = {"section1"=>params[:block]["section1"],"section2"=>params[:block]["section2"],"section3"=>params[:block]["section3"],"section4"=>params[:block]["section4"],"quote1"=>params[:block]["quote1"],"quote2"=>params[:block]["quote2"],"quote3"=>params[:block]["quote3"],"languageCode"=>params[:block]["languageCode"]} @id = Integer(params[:block]["id1"]) @blockContent = BlockContent.find(@id) @blockContent.update_attributes(@paramsBlockContent) end @block.update_attributes(@paramsBlock) redirect_to :controller=>"blocks",:action=>"index", :pageId=>params[:block]["pageId"] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update() end", "def update ; end", "def update()\n end", "def update(&block)\n instance_eval(&block)\n end", "def update\n ;\n end", "def update(&block)\n @update_block = block\n 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\r\n # write some gangsta code here\r\n end", "def update &block\n receive_update_callbacks << block\n end", "def update\n \n end", "def start_update \n @updating = $app.animate(UPDATE_SPEED) do\n update\n end\n end", "def update; end", "def update\n #\n # NO-OP\n #\n end", "def update\n \t\n end", "def update\n \t\n end", "def update\n run_callbacks :update do\n true\n end\n end", "def update( &block )\n self.instance_eval( &block ) if block_given? \n update_layers\n @output\n end", "def start_synchronize(updater); end", "def each_frame &block\n\t\t\t@update_block = block\n\t\tend", "def update(...)\n end", "def on_update(&block)\n @on_update = block\n end", "def update_for_wait\n update_basic\n end", "def update\r\n\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 \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_fusion\n end", "def update\n puts \"Updating...\"\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(data)\n @update_block.call(data)\n end", "def update\r\n end", "def update\n # Not generally used\n end", "def update\n # Not generally used\n end", "def update(elapsed)\n \n end", "def update\n #Nothing necessary\n end", "def run(&block); end", "def update\n end", "def run() end", "def refresh; schedule_update end", "def update\n update_phase\n end", "def start\r\n loop do\r\n t1 = Time.now\r\n update\r\n t2 = Time.now\r\n update_duration = t2 - t1\r\n \r\n milliseconds = (@update_interval/1000 - update_duration)\r\n sleep(milliseconds) if milliseconds > 0\r\n end\r\n end", "def run\n\t\t\[email protected] do\n\t\t\t\tself.update\n\t\t\t\t\n\t\t\t\tyield @walker if block_given?\n\t\t\tend\n\t\tend", "def update(current)\n end", "def start\n\t\t\t@thread = Thread.new do\n\t\t\t\twhile true\n\t\t\t\t\tupdate\n\t\t\t\tend\n\t\t\tend\n\t\tend", "def update\n \n end", "def update\n \n end", "def update(node); end", "def update\n @time+=1\n temp_map = {}\n @update_map.each { |k, v| temp_map[k-1] = v }\n @update_map = temp_map\n\n update_set = @update_map.delete(0)\n return unless update_set\n\n update_set.each do |component|\n component.update_inputs\n end\n\n yield if block_given?\n\n update_set.each do |component|\n component.update_outputs\n end\n\n self.changed = true\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.75045866", "0.7212294", "0.71131235", "0.7088026", "0.70759904", "0.70677996", "0.6914439", "0.6914439", "0.6914439", "0.6914439", "0.6914439", "0.6914439", "0.6914439", "0.6914439", "0.68635774", "0.6856793", "0.68547416", "0.6816258", "0.67826605", "0.66960627", "0.66634965", "0.6646683", "0.66379184", "0.66379184", "0.6632938", "0.6534515", "0.65344894", "0.6529098", "0.6516318", "0.64991593", "0.6488456", "0.6475685", "0.6396564", "0.6396564", "0.6396564", "0.6396564", "0.6386095", "0.6379166", "0.6368378", "0.6368378", "0.6368378", "0.6368378", "0.6368378", "0.6368378", "0.6368378", "0.6368378", "0.6368378", "0.6368378", "0.634934", "0.6348204", "0.63138837", "0.63138837", "0.63138837", "0.63138837", "0.63138837", "0.63138837", "0.63138837", "0.63138837", "0.63138837", "0.63138837", "0.63138837", "0.629833", "0.6287057", "0.6276487", "0.6276487", "0.6253425", "0.62463546", "0.623395", "0.62095976", "0.6188901", "0.61876535", "0.61822593", "0.61734813", "0.6137138", "0.6134677", "0.6118089", "0.6117777", "0.6117777", "0.61147976", "0.6090762", "0.6075587", "0.6075587", "0.6075587", "0.6075587", "0.6075587", "0.6075587", "0.6075587", "0.6075587", "0.6075587", "0.6075587", "0.6075587", "0.6075587", "0.6075587", "0.6075587", "0.6075587", "0.6075587", "0.6075587", "0.6075587", "0.6075587", "0.6075587", "0.6075587" ]
0.0
-1
end function update block
def destroy @block = Block.find(params[:id]) @block.destroy redirect_to :back end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update() end", "def update\n ;\n 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;end", "def update\n \n end", "def update()\n end", "def update\n \n end", "def update\n #\n # NO-OP\n #\n end", "def update; end", "def update\n \t\n end", "def update\n \t\n end", "def update(&block)\n instance_eval(&block)\n end", "def update(&block)\n @update_block = block\n end", "def update(...)\n end", "def update\r\n\r\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 # Not generally used\n end", "def update\n # Not generally used\n end", "def update\n\t\t# Left empty intentionally.\n\tend", "def updated_data; 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\r\n end", "def update\r\n end", "def update\r\n end", "def update\r\n end", "def update\r\n end", "def after_update; end", "def after_update; end", "def update\n\t\t\n\t\tend", "def updated_data\n\tend", "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\n \n end", "def update\n \n end", "def update_block(hash, attrs)\n raise \"Not implemented\"\n end", "def each_frame &block\n\t\t\t@update_block = block\n\t\tend", "def update\n nil\n end", "def update( &block )\n self.instance_eval( &block ) if block_given? \n update_layers\n @output\n end", "def update\n\t\tend", "def update\n\t\tend", "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.7681421", "0.7578545", "0.74766845", "0.73044056", "0.73044056", "0.73044056", "0.73044056", "0.73044056", "0.73044056", "0.73044056", "0.73044056", "0.72896594", "0.7232451", "0.71868455", "0.71471", "0.7109022", "0.7042136", "0.6928708", "0.6928708", "0.68815464", "0.6868625", "0.6822626", "0.68096465", "0.6798681", "0.67790633", "0.67744464", "0.67648435", "0.67648435", "0.67379856", "0.6730683", "0.66996723", "0.66996723", "0.66996723", "0.66996723", "0.66996723", "0.66996723", "0.66996723", "0.66996723", "0.66996723", "0.66996723", "0.66908205", "0.66773605", "0.66773605", "0.66773605", "0.66773605", "0.66324997", "0.66324997", "0.66107255", "0.660727", "0.6591878", "0.6591878", "0.6591878", "0.6591878", "0.6591878", "0.6591878", "0.6591878", "0.6591878", "0.6591878", "0.6591878", "0.6591878", "0.6589376", "0.6571928", "0.6571928", "0.65560085", "0.655284", "0.65450466", "0.6533248", "0.6500272", "0.6500272", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375", "0.6483375" ]
0.0
-1
Check if the cache is valid and useable.
def valid? @valid end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cache_valid?\n return false unless File.exist?(cache_path)\n return true if checksum.nil?\n checksum == file_digest(cache_path)\n end", "def cacheable?\n return false unless CACHEABLE_RESPONSE_CODES.include?(status)\n return false if cache_control.no_store? || cache_control.private?\n validateable? || fresh?\n end", "def valid?\n @data_lru.size == @data_ttl.size\n end", "def cache_valid?(uri)\n last = last_cached(uri)\n (last > 0 && Time.now.to_i <= (last + @options[:expires_after].to_i))\n end", "def cache?\n caching && true\n end", "def cache_valid?(certificate_entry)\n return false if certificate_entry.nil?\n\n (Time.now <= (certificate_entry[:timestamp] + CERTIFICATE_CACHE_TIME))\n end", "def cached?\n cache_path.exist?\n end", "def cached?\n cache_path.exist?\n end", "def cacheable?\n @cacheable\n end", "def cacheable?\n true\n end", "def using_cache\n\t\t(@modcache_invalidated != true)\n\tend", "def valid_root_cache?\n return true\n (! options[:purge_cache]) && File.directory?(options[:cache_dir])\n end", "def invalidates_cache?\n return true if method.in? INVALIDATING_METHODS\n end", "def cache_exist?\n File.exist?(@cache_file)\n end", "def cacheable?\n return false if method != :get && method != :head\n return false if cache_control.no_store?\n true\n end", "def cache_exists?\n File.exist?(cached_file)\n end", "def cache_filled?\n !!@cache[:header] && !!@cache[:footer]\n end", "def cached?(key)\n not @memcache.get(key).nil?\n end", "def valid_cache_key?(key, expires = nil)\n cache_valid_from\n rv = @cache[key] && (@cache[key][:inserted_at] > cache_valid_from) && (expires.nil? || (@cache[key][:inserted_at] < expires)) ? true : false\n rv\n end", "def cached?\n !(!@cached)\n end", "def cached?\n @rules = cached_rules if cached_rules? && caching_on?\n end", "def valid?\n return false if @class_id.nil?\n class_id_validator = EnumAttributeValidator.new('String', [\"softwarerepository.CachedImage\"])\n return false unless class_id_validator.valid?(@class_id)\n return false if @object_type.nil?\n object_type_validator = EnumAttributeValidator.new('String', [\"softwarerepository.CachedImage\"])\n return false unless object_type_validator.valid?(@object_type)\n action_validator = EnumAttributeValidator.new('String', [\"None\", \"GeneratePreSignedUploadUrl\", \"GeneratePreSignedDownloadUrl\", \"CompleteImportProcess\", \"MarkImportFailed\", \"PreCache\", \"Cancel\", \"Extract\", \"Evict\"])\n return false unless action_validator.valid?(@action)\n cache_state_validator = EnumAttributeValidator.new('String', [\"ReadyForImport\", \"Importing\", \"Imported\", \"PendingExtraction\", \"Extracting\", \"Extracted\", \"Failed\", \"MetaOnly\", \"ReadyForCache\", \"Caching\", \"Cached\", \"CachingFailed\", \"Corrupted\", \"Evicted\", \"Invalid\"])\n return false unless cache_state_validator.valid?(@cache_state)\n true\n end", "def cache?\n false\n end", "def cacheable?(response)\n return false unless response.success?\n return false unless method.in? CACHEABLE_METHODS\n return false if header.cache_control && header.cache_control.include?('no-store')\n true\n end", "def cache?(key)\n auth_objects_cache.key? key\n end", "def cached?(key)\n false\n end", "def check_cache(file)\n\t\t# If the module cache has been invalidated, then we return false to\n\t\t# indicate that we should go ahead and load the file now.\n\t\treturn false if (@modcache_invalidated)\n\n\t\tif (@modcache and @modcache.group?('FileModificationTimes'))\n\t\t\tno_exist = false\n\n\t\t\tbegin\n\t\t\t\tcurr_mtime = File::Stat.new(file).mtime\n\t\t\trescue Errno::ENOENT\n\t\t\t\tno_exist = true\n\t\t\tend\n\n\t\t\tif (no_exist or \n\t\t\t @modcache['FileModificationTimes'][file].nil? or\n\t\t\t @modcache['FileModificationTimes'][file].to_s != curr_mtime.to_i.to_s)\n\t\t\t\traise ModuleCacheInvalidated, \"File #{file} has a new mtime or did not exist\"\n\t\t\tend\n\t\tend\n\n\t\treturn true\n\tend", "def valid?\n return false if @image.nil?\n return false if @image_id.nil?\n return false if @name.nil?\n return false if @ready.nil?\n return false if @restart_count.nil?\n return true\n end", "def valid?\n @stale == false\n end", "def cache_expired?\n return true unless cache_exist?\n File.new(@cache_file).mtime < Time::now - (@cache_life.to_i * 60)\n # TODO check html rendered date\n end", "def cacheable?(env)\n result = false\n if (url = request_url(env)).blank?\n log(\"NO URI for request #{env.inspect}\")\n elsif cacheable_paths&.none? { |path| url.include?(path) }\n log(\"NON-CACHEABLE URI: #{url}\")\n else\n result = true\n end\n result\n end", "def cacheable?(env)\n result = false\n if (url = request_url(env)).blank?\n log(\"NO URI for request #{env.inspect}\")\n elsif cacheable_paths&.none? { |path| url.include?(path) }\n log(\"NON-CACHEABLE URI: #{url}\")\n else\n result = true\n end\n result\n end", "def should_attempt_cache_invalidate\n attempt_invalidate_cache = ENV['drupal.export.attempt_invalidate_cache']\n invalidate = false\n\n unless attempt_invalidate_cache.nil? || attempt_invalidate_cache.empty?\n invalidate = true if attempt_invalidate_cache =~ /true/\n end\n invalidate\n end", "def usable?\n false\n end", "def valid?(name)\n\t\t# If we're using cache, then we need to pre-create an instance of this.\n\t\tcreate(name) if (using_cache)\n\n\t\t(self[name]) ? true : false\n\tend", "def should_cache?\n false\n end", "def check_cache(type, id)\n end", "def cached?(name, *args)\n return false if Rails.env == 'development'\n cache = Cacheable.cache[self][name.to_sym]\n return false unless cache.key?(args)\n params = cache[args]\n !(params[:force] && (params[:time] < (Time.new - params[:ttl])))\n end", "def cached?(key)\n if @cache.key?(key)\n _data, _expire = *cache_read(key)\n return true if _expire.nil? || Time.now < _expire\n expire(key)\n end\n false\n end", "def use_cache?\n super && !against_head?\n end", "def use_cache?\n super && !against_head?\n end", "def check_cache(type, id)\n end", "def check_cache(type, id)\n end", "def is_cache_expired?(key)\n raise 'The is_cache_expired method must be implemented'\n end", "def valid?\n !missing? && !future? && !expired?\n end", "def fresh?\n if cache_control\n return false if cache_control.include?(\"no-cache\")\n\n # check age: max-age\n max_age = cache_control.find { |directive| directive.start_with?(\"s-maxage\") }\n\n max_age ||= cache_control.find { |directive| directive.start_with?(\"max-age\") }\n\n max_age = max_age[/age=(\\d+)/, 1] if max_age\n\n max_age = max_age.to_i if max_age\n\n return max_age > age if max_age\n end\n\n # check age: expires\n if @headers.key?(\"expires\")\n begin\n expires = Time.httpdate(@headers[\"expires\"])\n rescue ArgumentError\n return true\n end\n\n return (expires - Time.now).to_i.positive?\n end\n\n true\n end", "def valid?\n return false if @_403.nil?\n return false if @_404.nil?\n return false if @_500.nil?\n return false if @_504.nil?\n return false if @start_timestamp.nil?\n return false if @end_timestamp.nil?\n return false if @start_datetime.nil?\n return false if @end_datetime.nil?\n return false if @total_requests.nil?\n return false if @cache_hits.nil?\n return false if @cache_hit_rate.nil?\n return false if @total_request_time.nil?\n return false if @avg_origin_response_time.nil?\n return false if @response_time_ms.nil?\n return false if @_100_x.nil?\n return false if @_20_x.nil?\n return false if @_30_x.nil?\n return false if @_40_x.nil?\n return false if @_50_x.nil?\n return false if @_50th.nil?\n return false if @_95th.nil?\n return false if @_99th.nil?\n true\n end", "def may_cache?\n may_cache_field?(headers['cache-control'])\n end", "def cacheable_request?\n (request.get? || request.head?) && (request.params[:cache] != 'false')\n end", "def cacheable?\n last.nil? || last.cacheable\n end", "def verify\n @cache[:last_accessed] = nil if\n @cache.has_key?(:last_accessed) &&\n @cache[:last_accessed].to_date != Date.today\n end", "def is_in_cache(var)\n Rails.cache.exist?(var)\nend", "def _valid_file?(name)\n @cache_valid ||= {}\n @cache_valid[name.to_sym] ||= !_config_files(name).empty?\n end", "def lut_cache_exists?(name)\n !lut_read_cache_item(name, 0).nil?\n end", "def from_cache?\n @from_cache\n end", "def consider_caching?(path)\n return false if self.disabled\n return true if self.except.blank? && self.only.blank?\n return false if list_match?(self.except, path)\n return true if self.only.blank?\n return true if list_match?(self.only, path)\n false\n end", "def is_valid?\n # Expiration date is nil, or equal to or greater than today?\n (self.expiration.nil? || self.expiration >= Date.current) &&\n # Limit is set to 0 (for unlimited) or limit is greater than the current used count.\n (self.limit == 0 || self.limit > self.used)\n\tend", "def cached?(method, url, params = nil, body = nil)\n status = status(method, url, params, body)\n status[:status] != 'miss'\n end", "def exist?\n @lock.synchronize { valid? }\n end", "def page_cache_exists?(url)\n File.exists? page_cache_test_file(url)\n end", "def check_for_changes\n\t\t\t# Check on disk changes\n\t\t\tunless @disks[0][:changes] == false\n\t\t\t\t\t$log.info \"Cachefile changed by user. Honoring changes.\"\n\t\t\t\t\t@disks[0][:changes] = false\n\t\t\t\t\twrite_disk_cache\n\t\t\t\t\treturn true\n\t\t\tend\n\t\t\treturn false\n\t\tend", "def prepare\n unless File.readable?(@config[:cache_directory]) &&\n File.writable?(@config[:cache_directory])\n raise NotAccessible, @config[:cache_directory]\n end\n true\n end", "def cache_valid_from\n if caching_enabled?\n @cache_valid_from ||= Time.now\n else\n invalidate_cache!\n end\n @cache_valid_from\n end", "def validate(expiration_buffer_sec = 0)\n return true if (Time.now + expiration_buffer_sec).to_i < expires_on\n\n unless refresh_token\n logger.verbose('Cached token is almost expired but no refresh token ' \\\n 'is available.')\n return false\n end\n logger.verbose('Cached token is almost expired, attempting to refresh ' \\\n ' with refresh token.')\n refresh_response = refresh\n if refresh_response.instance_of? SuccessResponse\n logger.verbose('Successfully refreshed token in cache.')\n @token_response = refresh_response\n true\n else\n logger.warn('Failed to refresh token in cache with refresh token.')\n false\n end\n end", "def cached?(key)\n cache_file = @config[:cache_directory] / \"#{key}.cache\"\n _data = _expire = nil\n if File.file?(cache_file)\n _data, _expire = Marshal.load(cache_read(cache_file))\n return true if _expire.nil? || Time.now < _expire\n FileUtils.rm_f(cache_file)\n end\n false\n end", "def check_cache_validity(client)\n msg = @lookupserver.gets.chomp\n while msg.empty? do\n msg = @lookupserver.gets.chomp\n end\n accessTimeServer = Time.parse(msg)\n compare = accessTimeServer <=> @accessTimeCache\n if (compare <= 0) #Cache copy is valid\n cache_read(client)\n else\n puts @client_msg\n @lookupserver.puts(@client_msg)\n listen_fserver_read(client)\n end\n end", "def read_from_cache?\n raise NotImplementedError, \"You must implement #{self.class}##{__method__}\"\n end", "def response_publicly_cached?\n !!(response.cache_control[:public])\n end", "def cache_refresh_needed()\n\n refresh_needed = false\n reason = \"\"\n subscription_cache_filename = File.dirname(__FILE__) + \"/\" + SUB_CACHE\n workspace_cache_filename = File.dirname(__FILE__) + \"/\" + WORKSPACE_CACHE\n project_cache_filename = File.dirname(__FILE__) + \"/\" + PROJECT_CACHE\n\n if !FileTest.exist?(subscription_cache_filename) ||\n !FileTest.exist?(workspace_cache_filename) ||\n !FileTest.exist?(project_cache_filename) then\n refresh_needed = true\n reason = \"One or more cache files is not found.\"\n return refresh_needed, reason\n end\n\n cache_age = get_cache_age()\n if cache_age > @max_cache_age then\n refresh_needed = true\n reason = \"Age of workspace/project cache is greater than specified max of #{@max_cache_age}\"\n return refresh_needed, reason\n end\n\n read_subscription_cache()\n cached_subscription_id = @cached_sub_id\n current_subscription_id = get_current_sub_id()\n\n if current_subscription_id != cached_subscription_id then\n refresh_needed = true\n reason = \"Specified SubID: #{current_subscription_id} is different from cached SubID: #{cached_subscription_id}\"\n return refresh_needed, reason\n end\n\n # If we've fallen through to here, no refresh is needed\n reason = \"No workspace/project cache refresh currently required\"\n return refresh_needed, reason\n end", "def exist?(key)\n File.exist?(cache_path(key))\n end", "def cached?\n options[:cache] == true\n end", "def cached?; end", "def cached_write?\n [email protected]?\n end", "def cache?\n persisted?\n end", "def has_cache?\n laravel_exists_in_directory?(@cache)\n end", "def validate_cached(cached_cookbook)\n unless version_constraint.satisfies?(cached_cookbook.version)\n raise ConstraintNotSatisfied, \"A cookbook satisfying '#{name}' (#{version_constraint}) not found at #{self}\"\n end\n\n true\n end", "def has_key?(key)\n @cache.has_key?(key)\n end", "def check(cache)\n target = cache.get(@service_name, @section_name, @graph_name)\n\n if target.nil?\n return false, [\"target path #{@service_name}/#{@section_name}/#{@graph_name} not exists\"]\n elsif self.complex? ^ target.complex?\n return false, [\"complex type is not match\"]\n end\n\n if self.complex?\n self.check_complex(cache, target)\n else\n self.check_graph(cache, target)\n end\n end", "def check_cache(policies, key)\n already_run = []\n policies.each do |p|\n cached_result = policy_cache[p][key]\n if cached_result # return if it passed\n return true \n else \n # Reject the policy from the policies if it's false, i.e. previously failed\n already_run << p unless cached_result.nil?\n end \n end\n already_run\n end", "def do_http_cache?\n resources.flatten.select do |resource|\n resource.respond_to?(:updated_at)\n end &&\n controller.response.last_modified.nil? && !new_record?\n end", "def cached_lookup_allowed?\n @klass.use_activerecord_cache && arel.where_sql.nil? && arel.join_sources.empty? && @limit_value.nil? && @offset_value.nil?\n end", "def check_validity!\n # nothing\n end", "def valid?\n fetch { errors.empty? }\n end", "def cached? *key\n @cache.has_key? key\n end", "def is_usable\n return @is_usable\n end", "def allowed?(request)\n t1 = request_start_time(request)\n key = cache_key(request)\n bucket = Marshal.load(cache_get(key)) rescue nil\n bucket ||= LeakyBucket.new(options[:burst], options[:average])\n bucket.maximum, bucket.outflow = options[:burst], options[:average]\n bucket.leak!\n bucket.increment!\n allowed = !bucket.full?\n begin\n cache_set(key, Marshal.dump(bucket))\n allowed\n rescue StandardError => e\n allowed = true\n # If an error occurred while trying to update the timestamp stored\n # in the cache, we will fall back to allowing the request through.\n # This prevents the Rack application blowing up merely due to a\n # backend cache server (Memcached, Redis, etc.) being offline.\n end\n end", "def existe_cache?(recurso)\n if Rails.cache.exist?(\"#{recurso}_#{id}\")\n cache = Rails.cache.read(\"#{recurso}_#{id}\")\n\n begin\n (cache[:created_at] + cache[:expires_in]) > Time.now.to_f\n rescue\n false\n end\n\n else\n false\n end\n end", "def valid?\n return false if @web_url.nil?\n return false if @project.nil?\n return false if @parallel_runs.nil?\n return false if @started_at.nil?\n return false if @latest_workflow.nil?\n return false if @name.nil?\n return false if @executor.nil?\n return false if @parallelism.nil?\n return false if @number.nil?\n return false if @pipeline.nil?\n return false if @duration.nil?\n return false if @created_at.nil?\n return false if @messages.nil?\n return false if @contexts.nil?\n return false if @organization.nil?\n return false if @queued_at.nil?\n true\n end", "def use_cache?(opts = {})\n return true if opts[:cache].nil?\n opts[:cache]\n end", "def valid?\n check!\n true\n rescue\n false\n end", "def leaked_request?\n !CacheUpdater.executing?\n end", "def cacheable?(env)\n if (url = request_url(env)).blank? # NOTE: 0% coverage for this case\n log(\"NO URI for request #{env.inspect}\")\n elsif @cacheable_paths&.none? { |path| url.include?(path) }\n log(\"NON-CACHEABLE URI: #{url}\")\n elsif env&.body && env.body.include?('\"jump_request\"') # NOTE: 0% coverage for this case\n log(\"NON-CACHEABLE URI (jump_request): #{url}\")\n else\n true\n end\n end", "def expire_cache_key?\n true\n end", "def valid?\n \n if @action_url.nil?\n false\n elsif @digit_timeout_ms.nil?\n false\n elsif @finish_on_key.nil?\n false\n elsif @flush_buffer.nil?\n false\n elsif @initial_timeout_ms.nil?\n false\n elsif @max_digits.nil?\n false\n elsif @min_digits.nil?\n false\n elsif @prompts.nil?\n false\n elsif @privacy_mode.nil?\n false\n else\n list_invalid_properties.length() == 0\n end\n end", "def cache_check(compiler)\n ok = Mom::Label.new(\"cache_ok_#{self.object_id}\")\n check = build_condition(ok, compiler) # if cached_type != current_type\n check << Mom::SlotLoad.new([dynamic_call.cache_entry, :cached_type] , receiver_type_definition(compiler))\n check << Mom::ResolveMethod.new( @name , dynamic_call.cache_entry )\n check << ok\n end", "def assert_cached(url)\n assert page_cache_exists?(url), \"#{url} is not cached\"\n end", "def using_local_cache?\n @use_local_cache == true\n end", "def cache_hit?\n @gapi.cache_hit\n end", "def caching?\n @params.key?(:cache) ? @params[:cache] : @@caching\n end", "def cached?\n Dir.exist?(cached_repo_path)\n end", "def expired?(options = {})\n self.class.expired?(test_cache_url(options))\n end" ]
[ "0.7752887", "0.726279", "0.7220659", "0.7124914", "0.7010389", "0.6915741", "0.690005", "0.6873399", "0.6850447", "0.6757166", "0.67429966", "0.6697123", "0.6669442", "0.66629434", "0.6638964", "0.66243976", "0.6589056", "0.6575784", "0.656864", "0.6560738", "0.6557314", "0.6529485", "0.6514138", "0.64929855", "0.6490609", "0.6489", "0.6478164", "0.6472216", "0.64653295", "0.6460979", "0.64202875", "0.64202875", "0.6408653", "0.6404872", "0.6374624", "0.63717514", "0.6369639", "0.6358279", "0.6356977", "0.6354593", "0.6354593", "0.6341412", "0.6341412", "0.6338748", "0.63319236", "0.62860423", "0.6284923", "0.62790376", "0.6277547", "0.62706435", "0.626829", "0.6258321", "0.6234297", "0.61991256", "0.61886173", "0.6186711", "0.6186094", "0.618572", "0.61664313", "0.615789", "0.61574", "0.6156332", "0.61457783", "0.61399007", "0.61271584", "0.6114365", "0.6111627", "0.6108092", "0.6105852", "0.6104739", "0.6092744", "0.6090079", "0.6087425", "0.60750246", "0.60634345", "0.6058054", "0.60290074", "0.6028903", "0.6028183", "0.6022008", "0.6010782", "0.60080236", "0.6005263", "0.6003112", "0.5993348", "0.59699535", "0.5950647", "0.5946517", "0.59447616", "0.594343", "0.5939647", "0.59130836", "0.589981", "0.58944726", "0.58857477", "0.58837867", "0.5880904", "0.5875089", "0.5872751", "0.5871453", "0.5871435" ]
0.0
-1
Remove all cached resources and empty out the cache directory.
def purge! return false unless valid? autorelease_pool do Dir.foreach(@cache_path) do |entry| path = File.join(@cache_path, entry) File.unlink(path) if File.file? path end end true rescue SystemCallError false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_all\n FileUtils.rm_rf(CACHE_DIR)\n end", "def clean\n cache = Cache.instance\n # remove all built files\n cache.targets(false).each do |target|\n cache.remove_target(target)\n FileUtils.rm_f(target)\n end\n # remove all created directories if they are empty\n cache.directories(false).sort {|a, b| b.size <=> a.size}.each do |directory|\n cache.remove_directory(directory)\n next unless File.directory?(directory)\n if (Dir.entries(directory) - ['.', '..']).empty?\n Dir.rmdir(directory) rescue nil\n end\n end\n cache.write\n end", "def clean_up\n FileUtils.rm_rf \"#{@path}\" unless create_in_current_directory?\n FileUtils.rm_rf \"#{@cache}\"\n end", "def delete_cache_files; end", "def delete_cache_files; end", "def clear_cache(cache_path = @@cache_directory_path)\n\t\t\tbegin\n\t\t\t\tFileUtils.remove_dir(cache_path)\n\t\t\trescue Exception => e \n\t\t\t\t\n\t\t\tend\n\t\tend", "def clear_cache(cache_path = @@cache_directory_path)\n\t\t\tbegin\n\t\t\t\tFileUtils.remove_dir(cache_path)\n\t\t\trescue Exception => e \n\t\t\t\t\n\t\t\tend\n\t\tend", "def clear\n FileUtils.rm_f(cache_file)\n initialize!\n end", "def invalidate_all!\n FileUtils.rm_r(@cache_path, force: true, secure: true)\n end", "def flush\n Dir[ File.join( store, '*.cache' ) ].each do |file|\n File.delete(file)\n end\n end", "def cleanup\n FileUtils.rm_rf(sfx_cache_path)\n end", "def clear_all!\n @cache = Cache.new\n end", "def clear\n cache.clear\n end", "def remove_unnecessary_cache_files!\n current_keys = cache_files.map do |file|\n get_cache_key_from_filename(file)\n end\n inmemory_keys = responses.keys\n\n unneeded_keys = current_keys - inmemory_keys\n unneeded_keys.each do |key|\n File.unlink(filepath_for(key))\n end\n end", "def clear_cache\n FileUtils.rm File.expand_path(\"cms-css/#{self.slug}.css\", Rails.public_path), :force => true\n FileUtils.rm File.expand_path(\"cms-js/#{self.slug}.js\", Rails.public_path), :force => true\n end", "def clear\n Dir[File.join(@output_dir, '*')].each do |path|\n File.delete(path)\n end\n end", "def clear(path)\n return unless @cache_base\n\n target = (@cache_base + path)\n target.exist? && target.rmtree\n end", "def clear_cache\n ccs.each(&:clear_cache)\n end", "def clear\n @uploaders.each do |uploader| \n full_preview_path = \"#{Rails.root}/public/uploads/tmp/#{uploader.preview.cache_name}\"\n cache_dir = File.expand_path('..', full_preview_path)\n uploader.remove!\n Dir.delete(cache_dir)\n end\n\n @uploaders.clear\n @downloaded_images.clear\n end", "def clear_local\n execute(:rm, '-rf', File.join(local_cache_path, '*')) if test!(\"[ -d #{local_cache_path} ]\")\n File.unlink(cached_gemfile_md5_path)\n end", "def clear\n @cache.clear\n end", "def clear\n FileUtils.rm_rf(path)\n end", "def delete_all_caching_without_touching_additives\n\t\t\tself.delete_category_menu_fragments\n \t\tself.delete_cache\n \t\tself.delete_shared_item_items\n\t\t\tself.delete_category_browser_fragments\nend", "def expire_cache\n cache_dir = ActionController::Base.page_cache_directory\n dirs = [\"articles\", \"tags\"]\n files = [\"index.html\", \"about.html\", \"contact.html\", \"articles.html\", \"tags.html\", \"articles.rss\", \"comments.rss\"]\n (files + dirs).each {|f| FileUtils.rm_r(Dir.glob(cache_dir + \"/#{f}\")) rescue Errno::ENOENT }\n RAILS_DEFAULT_LOGGER.info(\"Cache directory '#{cache_dir}' fully sweeped.\")\n end", "def clean_up\n @files.each {|file| FileUtils.remove(file.path)}\n end", "def cleanup_script_execution\n FileUtils.rm_rf(InstanceConfiguration::CACHE_PATH)\n end", "def destroy\n all.each { |file| FileUtils.rm_f(file) }\n end", "def prune_cache!\n Dir.chdir @cache_path do\n branches = Dir.glob('*/')\n return if branches.nil? or branches.length <= @cache_num\n\n branches \\\n .sort_by {|f| File.mtime(f)}[@cache_num..-1] \\\n .each do|dir|\n FileUtils.rm_rf(dir)\n @cached_branches.delete(dir.gsub('/', ''))\n end\n end\n end", "def clear_cache\n @all = nil\n end", "def clear\n raise \"unsafe test stage directory -- #{Dir.pwd}\" unless /#{Dir.tmpdir}/ =~ Dir.pwd\n Dir['*'].each do |path|\n FileUtils.rm_r(path)\n end\n end", "def clean!\n stop\n FileUtils.remove_entry(download_path) if File.exists? download_path\n FileUtils.remove_entry(tmp_save_dir, true) if File.exists? tmp_save_dir\n FileUtils.remove_entry(instance_dir, true) if File.exists? instance_dir\n FileUtils.remove_entry(md5sum_path) if File.exists? md5sum_path\n FileUtils.remove_entry(version_file) if File.exists? version_file\n end", "def clean!\n stop\n FileUtils.remove_entry(download_path) if File.exists? download_path\n FileUtils.remove_entry(tmp_save_dir, true) if File.exists? tmp_save_dir\n FileUtils.remove_entry(instance_dir, true) if File.exists? instance_dir\n FileUtils.remove_entry(md5sum_path) if File.exists? md5sum_path\n FileUtils.remove_entry(version_file) if File.exists? version_file\n end", "def cleanall\n FileUtils.rm_r(OUTPUT_DIR, force: true, verbose: true)\n end", "def clear_cache(options={})\n clean\n cmd=\"rm -f /var/cache/apt/*.bin /var/lib/apt/lists/*_* /var/lib/apt/lists/partial/*\"\n send(run_method, cmd, options)\n end", "def erase_cache_symlinks #:nodoc:\n Dir.chdir(self.cache_full_path) do\n Dir.glob('*').each do |entry|\n # FIXME how to only erase symlinks that points to a CBRAIN cache or local DP?\n # Parsing the value of the symlink is tricky...\n File.unlink(entry) if File.symlink?(entry)\n end\n end\n end", "def clear\n # TODO: this is rather brutal, in future need to be able to revert\n Rails.logger.info(\"Clearing OpenbisMedataStore at #{filestore_path}\")\n # cache.delete_matched(/.*/)\n # need to add an entry to empty cache otherwise the clear failes on unexisting deak\n cache.fetch('fake') { '' } unless File.exist?(cache.cache_path)\n cache.clear\n end", "def clear\n Dir[File.join(@output_dir, '*.json')].each do |path|\n File.delete(path)\n end\n end", "def clear_all_caches\n TemplateCache.clear\n HardCache.clear\n redirect_to 'Adminful#dashboard', :flash => 'Cleared template and view cache'\n end", "def delete_all\n super\n Rails.cache.delete_matched(/#{self.configure.cache.namespace}/)\n end", "def cache_clear\n @client.flushall\n end", "def sweep_partial_cache\n cache_dir = RAILS_ROOT+\"/tmp/cache/views/*\"\n FileUtils.rm_r(Dir.glob(cache_dir)) rescue Errno::ENOENT\n logger.debug(\"Cache '#{cache_dir}' delete.\")\n end", "def clean_up\n FileUtils.rm_rf @temp_root\n end", "def expire_caches\n expired_cache = \"expired_cache.#{Time.now.to_f}\"\n Dir.chdir(\"#{Rails.root}/tmp\") do\n FileUtils.mv('cache', expired_cache, :force => true)\n FileUtils.rm_rf(expired_cache)\n end\n end", "def clearCachedContentFiles\n #N Without this, the (local) source cached content file won't be deleted\n @sourceLocation.clearCachedContentFile()\n #N Without this, the (remote) source cached content file won't be deleted\n @destinationLocation.clearCachedContentFile()\n end", "def clear_cached\n Rails.cache.delete(self.cache_key, opts_for_cache)\n end", "def clear_cache\n CircleCi.request(conf, \"#{base_path}/build-cache\").delete\n end", "def clear_atomic_path_cache\n self.path = nil\n _base.instance_variable_set(\"@atomic_paths\", nil)\n end", "def purge\n\n FileUtils.remove_dir(@basepath)\n end", "def clear\r\n @cache.flush\r\n end", "def clear\n @directory.clear\n @directory[ROOT] = Set.new\n @file.clear\n @mtime.clear\n end", "def clear_cache!\n @cache = {}\n end", "def clear_cache!\n @cache = {}\n end", "def destroy\n delete_files_and_empty_parent_directories\n end", "def distclean\n cache = Cache.instance\n clean\n cache.clear\n FileUtils.rm_rf(@build_dir)\n end", "def destroy()\n\n path = self.get_dir\n FileUtils.remove_entry_secure(path, true)\n _clean_dir(File.dirname(path))\n\n super()\n end", "def cache_clear\n @store.delete\n end", "def cleanup_files\n FileUtils.rm_rf(File.join(Rails.root, \"tmp\"))\n end", "def clear_cache() @cache = {}; end", "def cleanup\n FileUtils.rm(@out_filename)\n\n # XXX: could be rm-rf, but be safe for now. Might have\n # problems if app creates files in $PWD\n FileUtils.rmdir(@opts[:tmpdir])\n end", "def clear_cache; end", "def purge\n self.files.each do |f|\n f.destroy\n end\n self.commits.each do |c|\n c.destroy\n end\n end", "def _clear_cache\n @cache_parent.clear\n end", "def cleanup\n FileUtils.rm_f(@path)\n delete\n end", "def clear_cache\n @cache = {}\n end", "def destroy\n remove_files(@path + \"*\")\n end", "def clear\n @pages.clear\n @page_counter = 0\n begin\n @f.truncate(0)\n rescue IOError => e\n raise RuntimeError, \"Cannote truncate cache file #{@file_name}: \" +\n e.message\n end\n end", "def cache_clear\n @store.clear\n end", "def clean_files\n FileUtils.rm(Dir[File.join(Rails.root, 'public/sitemap*.xml.gz')])\n end", "def clear\n with_config do\n self.storage.delete_expired_tempfiles\n end\n end", "def expire_all\n FileUtils.rm_rf(Dir.glob(\"#{@config[:cache_directory]}/*\"))\n Merb.logger.info(\"cache: expired all\")\n true\n end", "def clear_all_caches\n $CACHE.clear\n remove_cached_feeds\n remove_cached_list_of_taxon_concepts\n if ActionController::Base.cache_store.class == ActiveSupport::Cache::MemCacheStore\n ActionController::Base.cache_store.clear\n return true\n else\n return false\n end\n end", "def clear_cache\n\t\tprint \"Clearing cache...\"\n\t\turl = get_url(\"clear\", @uid, @password, @sid)\n\t\trun_1010(url, \"\") { puts \"done\" }\n\tend", "def clean()\n\t\ttmpdir = Dir.open(@tmpout) do |dir|\n\t\t\tdir.each do |file|\n\t\t\t\tif file != \".\" and file != \"..\" then\n\t\t\t\t\tFile.unlink(@tmpout + \"/\" + file)\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\tDir.rmdir @tmpout\n\tend", "def cleanup(dir)\n Dir.glob(dir+\"/*\").each do |file|\n File.unlink(file)\n end\n Dir.unlink(dir)\nend", "def clean!\n stop\n remove_instance_dir!\n FileUtils.remove_entry(config.download_path) if File.exists?(config.download_path)\n FileUtils.remove_entry(config.tmp_save_dir, true) if File.exists? config.tmp_save_dir\n md5.clean!\n FileUtils.remove_entry(config.version_file) if File.exists? config.version_file\n end", "def cleanup_cached_images()\n\n # swap_dir = \"../public/swap\" # use when running locally from /lib/s3_bucket.rb\n swap_dir = \"./public/swap\" # use when running via app.rb\n swap_contents = \"#{swap_dir}/*\"\n gitkeep = \"#{swap_dir}/.gitkeep\"\n\n if File.directory?(swap_dir)\n FileUtils.rm_rf(Dir.glob(swap_contents)) # delete contents of /public/swap \n file = File.new(gitkeep, 'w') # recreate .gitkeep file\n file.close if file\n else\n puts \"sightings directory does not exist!\"\n end\n\nend", "def clear!\n @cache = {}\n end", "def cache_clear\n @dataset.delete\n end", "def cache_clear\n @dataset.delete\n end", "def remove_cache_path\n cache_path.run_action(:delete)\n end", "def cleanup\n remove_files(TEST_INPUT_DIR)\n remove_files(TEST_OUTPUT_DIR)\nend", "def clear_remote\n execute(:rm, '-rf', File.join(remote_cache_path, '*')) if test!(\"[ -d #{remote_cache_path} ]\")\n end", "def clear_cache\n CircleCi.request(@conf, \"/project/#{username}/#{project}/build-cache\").delete\n end", "def clean!\n FileUtils.rm_rf(dir)\n end", "def cleanup\n @agent_file_history.each { |af| FileUtils.rm_f(af) }\n @key_file_history.each { |kf| FileUtils.rm_f(kf) }\n end", "def clear\n @cache.clear\n entries.clear\n self\n end", "def destroy\n FileUtils.rm_rf @root\n end", "def clean_cache(staging_path, metadata)\n actual_file_list = Dir.glob(File.join(staging_path, \"**/*\"))\n expected_file_list = []\n CookbookMetadata.new(metadata).files { |_, path, _| expected_file_list << File.join(staging_path, path) }\n\n extra_files = actual_file_list - expected_file_list\n extra_files.each do |path|\n if File.file?(path)\n FileUtils.rm(path)\n end\n end\n end", "def remove_archive_cache\n expire_action(:controller => '/articles', :action => 'index')\n expire_fragment(%r{/articles/page/*})\n expire_fragment(%r{/categories/*})\n articles_folder = ActionController::Base.page_cache_directory + '/articles/'\n FileUtils.rmtree articles_folder if File.exists? articles_folder \n end", "def clear\r\n @resources.clear\r\n end", "def delete_all(key, parent_path: nil)\n @caches.each do |cache|\n cache.delete(key, parent_path: parent_path)\n end\n\n @children.each do |child_group|\n child_group.invalidate_cache_group(key)\n end\n end", "def purge_resources\n fetch_page\n parse_page\n @urls = find_resources\n\n return if @urls.empty?\n\n tidy_resources\n purge_queue\n end", "def expire_cache\n filename = name_changed? ? name_was : name\n FileUtils.rm_rf(File.join(Shapes.cache_dir_path, filename))\n FileUtils.rm_f(File.join(Shapes.cache_dir_path, \"#{filename}.xml\"))\n end", "def rm_r_cached(path)\n invoke(:rm, '-r', '--cached', path)\n true\n end", "def stage_clear\n stage_safe!\n Dir['*'].each do |path|\n #p path\n FileUtils.rm_r(path)\n end\n end", "def cleanup\n\tsh 'del /F /Q .\\_site\\*'\n\t# sh 'rm -rf ./_site'\nend", "def clear\n @files.clear\n end", "def cache_clear\n @moneta.clear\n end", "def cleanup\n if dir and File.exists?(dir)\n FileUtils.rm_rf(dir)\n end\n\n nil\n end", "def clear_cache(uri)\n if last_cached(uri) > 0\n cache_store.delete(cache_key([uri, last_cached(uri)]))\n cache_store.delete(cache_key(uri))\n end\n end", "def cleanup_cached_images()\n\n # swap_dir = \"../public/swap\" # use when running locally from /lib/b2_bucket.rb\n swap_dir = \"./public/swap\" # use when running via app.rb\n swap_contents = \"#{swap_dir}/*\"\n gitkeep = \"#{swap_dir}/.gitkeep\"\n\n if File.directory?(swap_dir)\n FileUtils.rm_rf(Dir.glob(swap_contents)) # delete contents of /public/swap \n file = File.new(gitkeep, 'w') # recreate .gitkeep file\n file.close if file\n else\n puts \"Directory does not exist!\"\n end\n\nend" ]
[ "0.8316178", "0.81105113", "0.7569809", "0.74797946", "0.74797946", "0.7470338", "0.7470338", "0.7457585", "0.74457014", "0.7442326", "0.73289967", "0.724199", "0.72192335", "0.71591246", "0.71524704", "0.71466404", "0.7133023", "0.7088302", "0.699119", "0.69715077", "0.69691956", "0.6959607", "0.692323", "0.69166017", "0.6894999", "0.6882503", "0.68584245", "0.684738", "0.684588", "0.6837035", "0.67722815", "0.67722815", "0.6764631", "0.6751135", "0.6740966", "0.6727751", "0.67270875", "0.67193305", "0.6708229", "0.66793203", "0.66684085", "0.6658831", "0.66519403", "0.6650788", "0.6649719", "0.6623614", "0.6611689", "0.6610773", "0.660587", "0.66014606", "0.6601416", "0.6601416", "0.66005486", "0.6599462", "0.6595849", "0.65919906", "0.6575393", "0.65618336", "0.65570885", "0.6541833", "0.6533247", "0.6526324", "0.65230536", "0.65205383", "0.6500793", "0.64960635", "0.64600664", "0.64396596", "0.6429726", "0.64262384", "0.6419009", "0.6417641", "0.64116275", "0.63996786", "0.63940203", "0.63928944", "0.6389499", "0.6387237", "0.6387237", "0.638092", "0.6375197", "0.6373507", "0.637195", "0.6361792", "0.6359864", "0.6347459", "0.63441694", "0.6340997", "0.6339564", "0.63393754", "0.6327712", "0.6323914", "0.6317707", "0.6314666", "0.6292789", "0.62916774", "0.62904555", "0.628857", "0.6283797", "0.62791556", "0.6260381" ]
0.0
-1
Compact the cache by removing resources which are no longer referenced. Internally this works by checking the hardlinke count of all files inside the cache directory and removing all with a link count less than 2.
def compact! return false unless valid? autorelease_pool do Dir.foreach(@cache_path) do |entry| path = File.join(@cache_path, entry) File.unlink(path) if File.stat(path).nlink < 2 end end true rescue SystemCallError false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_unnecessary_cache_files!\n current_keys = cache_files.map do |file|\n get_cache_key_from_filename(file)\n end\n inmemory_keys = responses.keys\n\n unneeded_keys = current_keys - inmemory_keys\n unneeded_keys.each do |key|\n File.unlink(filepath_for(key))\n end\n end", "def prune_cache!\n Dir.chdir @cache_path do\n branches = Dir.glob('*/')\n return if branches.nil? or branches.length <= @cache_num\n\n branches \\\n .sort_by {|f| File.mtime(f)}[@cache_num..-1] \\\n .each do|dir|\n FileUtils.rm_rf(dir)\n @cached_branches.delete(dir.gsub('/', ''))\n end\n end\n end", "def erase_cache_symlinks #:nodoc:\n Dir.chdir(self.cache_full_path) do\n Dir.glob('*').each do |entry|\n # FIXME how to only erase symlinks that points to a CBRAIN cache or local DP?\n # Parsing the value of the symlink is tricky...\n File.unlink(entry) if File.symlink?(entry)\n end\n end\n end", "def purge_resources\n fetch_page\n parse_page\n @urls = find_resources\n\n return if @urls.empty?\n\n tidy_resources\n purge_queue\n end", "def prune(max)\n old = Dir.pwd\n Dir.chdir(@cache_dir)\n files = Dir[\"*-*\"].sort{|x, y| File.ctime(x) <=> File.ctime(y)}\n size = 0\n files.each do |file|\n size += File.size(file)\n end\n\n while (size > max && !files.empty?)\n size -= File.size(files[0])\n puts \"Pruning #{files[0]}\"\n File.delete(files[0])\n end\n Dir.chdir(old)\n end", "def delete_cache_files; end", "def delete_cache_files; end", "def delete_all_caching_without_touching_additives\n\t\t\tself.delete_category_menu_fragments\n \t\tself.delete_cache\n \t\tself.delete_shared_item_items\n\t\t\tself.delete_category_browser_fragments\nend", "def tidy_resources\n Varnisher.log.info 'Tidying resources...'\n\n @urls = @urls.make_absolute(@uri).with_hostname(@uri.host)\n\n Varnisher.log.info \"#{@urls.length} purgeable resources found.\\n\"\n end", "def clean_cache(staging_path, metadata)\n actual_file_list = Dir.glob(File.join(staging_path, \"**/*\"))\n expected_file_list = []\n CookbookMetadata.new(metadata).files { |_, path, _| expected_file_list << File.join(staging_path, path) }\n\n extra_files = actual_file_list - expected_file_list\n extra_files.each do |path|\n if File.file?(path)\n FileUtils.rm(path)\n end\n end\n end", "def cleanup_old_files\n # make a local copy of to_delete while simultaneously clearing the original (atomicity)\n # local_to_delete = $to_delete.slice!(0..-1).to_a\n local_to_delete = []\n $to_delete.delete_if { |v| local_to_delete << v; true }\n\n $files.each_pair do |uuid, file|\n if file.nil?\n $files.delete uuid\n elsif local_to_delete.include?(uuid) || (Time.now - 60*60) > file.ctime\n file.close # Close it\n file.unlink if file.respond_to? :unlink # Unlink it if we can\n $files.delete uuid\n end\n end\n GC.start\nend", "def clean\n cache = Cache.instance\n # remove all built files\n cache.targets(false).each do |target|\n cache.remove_target(target)\n FileUtils.rm_f(target)\n end\n # remove all created directories if they are empty\n cache.directories(false).sort {|a, b| b.size <=> a.size}.each do |directory|\n cache.remove_directory(directory)\n next unless File.directory?(directory)\n if (Dir.entries(directory) - ['.', '..']).empty?\n Dir.rmdir(directory) rescue nil\n end\n end\n cache.write\n end", "def clean_cache!(seconds)\n File.grid.namespace.\n where(filename: /\\d+-\\d+-\\d+(?:-\\d+)?\\/.+/).\n and(:filename.lt => (Time.now.utc - seconds).to_i.to_s).\n delete\n end", "def sweep_partial_cache\n cache_dir = RAILS_ROOT+\"/tmp/cache/views/*\"\n FileUtils.rm_r(Dir.glob(cache_dir)) rescue Errno::ENOENT\n logger.debug(\"Cache '#{cache_dir}' delete.\")\n end", "def remove_stale_files() = stale_files.each { |file| remove_file(file) }", "def remove_deleted_files\n cache_file_hash = {}\n @cookbooks_by_name.each_key do |k|\n cache_file_hash[k] = {}\n end\n\n # First populate files from cache\n cache.find(File.join(%w{cookbooks ** {*,.*}})).each do |cache_file|\n md = cache_file.match(%r{^cookbooks/([^/]+)/([^/]+)/(.*)})\n next unless md\n\n (cookbook_name, segment, file) = md[1..3]\n if have_cookbook?(cookbook_name)\n cache_file_hash[cookbook_name][segment] ||= {}\n cache_file_hash[cookbook_name][segment][\"#{segment}/#{file}\"] = cache_file\n end\n end\n # Determine which files don't match manifest\n @cookbooks_by_name.each_key do |cookbook_name|\n cache_file_hash[cookbook_name].each_key do |segment|\n manifest_segment = cookbook_segment(cookbook_name, segment)\n manifest_record_paths = manifest_segment.map { |manifest_record| manifest_record[\"path\"] }.to_set\n to_be_removed = cache_file_hash[cookbook_name][segment].keys.to_set - manifest_record_paths\n to_be_removed.each do |path|\n cache_file = cache_file_hash[cookbook_name][segment][path]\n\n Chef::Log.info(\"Removing #{cache_file} from the cache; its is no longer in the cookbook manifest.\")\n cache.delete(cache_file)\n @events.removed_cookbook_file(cache_file)\n end\n end\n end\n end", "def purge\n self.files.each do |f|\n f.destroy\n end\n self.commits.each do |c|\n c.destroy\n end\n end", "def free\n cache.clear\n nil\n end", "def cleanup\n FileUtils.rm_rf(sfx_cache_path)\n end", "def invalidate_all!\n FileUtils.rm_r(@cache_path, force: true, secure: true)\n end", "def clear_all\n FileUtils.rm_rf(CACHE_DIR)\n end", "def clean_remote\n to_delete = remote_assets - local_compiled_assets\n to_delete.each do |f|\n delete_remote_asset(bucket.files.get(f))\n end\n end", "def clean!\n if @keys.size > Cache.max_size\n @keys = @keys[(Cache.max_size/2)[email protected]]\n reject! { |key, value| [email protected]?(key) }\n end\n end", "def clean_cache_collection collection # :nodoc:\n collection.each do |name, item|\n if item.empty? then\n collection.delete name\n else\n # HACK mongrel-1.1.5 documents its files twice\n item.uniq!\n item.sort!\n end\n end\n end", "def clear\n @pages.clear\n @page_counter = 0\n begin\n @f.truncate(0)\n rescue IOError => e\n raise RuntimeError, \"Cannote truncate cache file #{@file_name}: \" +\n e.message\n end\n end", "def erase\n HDB.verbose and puts \"Erasing successfully-copied files\"\n unlinkable = @files.collect do |x|\n f = get_real_filename(x)\n File.directory?(f) or File.symlink?(f)\n end\n # TODO: unlink them now.\n # TODO: rmdir directories, starting with child nodes first\n raise \"erase unimplemented\"\n end", "def clean!\n return false unless @path\n\n @cache[:paths].delete_if do |key, _|\n not @path.dirname.join(key).file? or\n # Remove any path to a file not in a subtree (:data_uri images).\n key[0..2] == NON_SUBTREE\n end\n\n sprite_keys = @project.sprites.map { |sprite| key(sprite) }\n\n @cache[:sprites].delete_if do |key, _|\n not sprite_keys.include?(key)\n end\n end", "def remove_doc_resources(path)\n count = 0\n doc_resources(path).each do |res_path|\n remove_resource(path, res_path)\n count += 1\n end\n count\n end", "def prune_cgroup_links(cgroup_path)\n sync do\n link = @path_cache.delete(cgroup_path)\n return if link.nil?\n\n prog = @programs[link.prog_name]\n\n @links[link.prog_name].delete(cgroup_path)\n prog.detach(link)\n\n if @links[link.prog_name].empty?\n @links.delete(link.prog_name)\n @programs.delete(link.prog_name)\n prog.destroy\n end\n end\n\n nil\n end", "def clear_cache\n FileUtils.rm File.expand_path(\"cms-css/#{self.slug}.css\", Rails.public_path), :force => true\n FileUtils.rm File.expand_path(\"cms-js/#{self.slug}.js\", Rails.public_path), :force => true\n end", "def purge!\n return false unless valid?\n\n autorelease_pool do\n Dir.foreach(@cache_path) do |entry|\n path = File.join(@cache_path, entry)\n File.unlink(path) if File.file? path\n end\n end\n\n true\n rescue SystemCallError\n false\n end", "def invalidate(blob_access, delete_single=false)\n if delete_single\n FileSystemMetaData.new(cache_file_path(blob_access)).delete\n else\n cache_path(blob_access).entries.each {|cache_file|\n unless cache_file.to_s.match(/\\.meta$/) || cache_file.directory?\n base_name = cache_file.to_s\n FileSystemMetaData.new(cache_path(blob_access).join(cache_file)).delete if base_name.match(cache_file_base(blob_access))\n end\n } if Dir.exist?(cache_path(blob_access))\n end\n end", "def clear_cache\n ccs.each(&:clear_cache)\n end", "def cleanup_created_resources\n # Avoid the use of any short circuiting folds.\n cleanup_commands.reverse.inject(true) { |accum, x| accum && x.cleanup }\n end", "def cleanup_cache\n\t\t\tputs \"Cleaning up cache\"\n\t\t\texpire_older_than = ((Time.now.to_f - MiniProfiler::EXPIRE_TIMER_CACHE) * 1000).to_i\n\t\t\t@timer_struct_lock.synchronize {\n\t\t\t\t@timer_struct_cache.delete_if { |k, v| v['Root']['StartMilliseconds'] < expire_older_than }\n\t\t\t}\n\t\tend", "def clean_up\n @files.each {|file| FileUtils.remove(file.path)}\n end", "def flush\n Dir[ File.join( store, '*.cache' ) ].each do |file|\n File.delete(file)\n end\n end", "def remove_materialized_artifacts\n Dir.glob(\"#{Terraspace.cache_root}/**/*\").each do |path|\n next unless within_env?(path)\n next if path.include?(\".tfstate\")\n FileUtils.rm_f(path) if File.file?(path)\n end\n end", "def purgeFiles\n Dir[\"#{@pagespath}/*\"].reject{ |f| f[\"#{@pagespath}/.keep\"] }.each do |filename|\n File.delete filename\n end\n\n Dir[\"#{@assetpath}/*\"].reject{ |f| f[\"#{@pagespath}/.keep\"] }.each do |filename|\n File.delete filename\n end\n end", "def clear\n FileUtils.rm_f(cache_file)\n initialize!\n end", "def rm_r_cached(path)\n invoke(:rm, '-r', '--cached', path)\n true\n end", "def removed_unmarked_paths\n #remove dirs\n dirs_enum = @dirs.each_value\n loop do\n dir_stat = dirs_enum.next rescue break\n if dir_stat.marked\n dir_stat.marked = false # unset flag for next monitoring\\index\\remove phase\n #recursive call\n dir_stat.removed_unmarked_paths\n else\n # directory is not marked. Remove it, since it does not exist.\n write_to_log(\"NON_EXISTING dir: \" + dir_stat.path)\n # remove file with changed checksum\n $local_content_data_lock.synchronize{\n $local_content_data.remove_directory(dir_stat.path, Params['local_server_name'])\n }\n rm_dir(dir_stat)\n end\n end\n\n #remove files\n files_enum = @files.each_value\n loop do\n file_stat = files_enum.next rescue break\n if file_stat.marked\n file_stat.marked = false # unset flag for next monitoring\\index\\remove phase\n else\n # file not marked meaning it is no longer exist. Remove.\n write_to_log(\"NON_EXISTING file: \" + file_stat.path)\n # remove file with changed checksum\n $local_content_data_lock.synchronize{\n $local_content_data.remove_instance(Params['local_server_name'], file_stat.path)\n }\n # remove from tree\n @files.delete(file_stat.path)\n end\n end\n end", "def drop_caches\n # old habits die hard\n logger.info \" dropping caches\"\n 3.times { %x[ /bin/sync ] }\n File.open( \"/proc/sys/vm/drop_caches\", \"w\" ) do |f|\n f.puts 3\n end\n end", "def clear_obsoleted_cookbooks\n @events.cookbook_clean_start\n\n if remove_obsoleted_files\n remove_old_cookbooks\n else\n Chef::Log.info(\"Skipping removal of obsoleted cookbooks from the cache\")\n CookbookCacheCleaner.instance.skip_removal = true\n end\n\n remove_deleted_files\n\n @events.cookbook_clean_complete\n end", "def clearCachedContentFiles\n #N Without this, the (local) source cached content file won't be deleted\n @sourceLocation.clearCachedContentFile()\n #N Without this, the (remote) source cached content file won't be deleted\n @destinationLocation.clearCachedContentFile()\n end", "def expire_cache\n cache_dir = ActionController::Base.page_cache_directory\n dirs = [\"articles\", \"tags\"]\n files = [\"index.html\", \"about.html\", \"contact.html\", \"articles.html\", \"tags.html\", \"articles.rss\", \"comments.rss\"]\n (files + dirs).each {|f| FileUtils.rm_r(Dir.glob(cache_dir + \"/#{f}\")) rescue Errno::ENOENT }\n RAILS_DEFAULT_LOGGER.info(\"Cache directory '#{cache_dir}' fully sweeped.\")\n end", "def sweep\n @stats.swept_objects = @db.delete_unmarked_objects do |id|\n @cache.evict(id)\n end\n @db.clear_marks\n GC.start\n PEROBS.log.debug \"#{@stats.swept_objects} objects collected\"\n @stats.swept_objects\n end", "def clear_obsoleted_cookbooks\n @events.cookbook_clean_start\n # Remove all cookbooks no longer relevant to this node\n cache.find(File.join(%w{cookbooks ** *})).each do |cache_file|\n cache_file =~ /^cookbooks\\/([^\\/]+)\\//\n unless have_cookbook?($1)\n Chef::Log.info(\"Removing #{cache_file} from the cache; its cookbook is no longer needed on this client.\")\n cache.delete(cache_file)\n @events.removed_cookbook_file(cache_file)\n end\n end\n @events.cookbook_clean_complete\n end", "def cleanup_cached_images()\n\n # swap_dir = \"../public/swap\" # use when running locally from /lib/b2_bucket.rb\n swap_dir = \"./public/swap\" # use when running via app.rb\n swap_contents = \"#{swap_dir}/*\"\n gitkeep = \"#{swap_dir}/.gitkeep\"\n\n if File.directory?(swap_dir)\n FileUtils.rm_rf(Dir.glob(swap_contents)) # delete contents of /public/swap \n file = File.new(gitkeep, 'w') # recreate .gitkeep file\n file.close if file\n else\n puts \"Directory does not exist!\"\n end\n\nend", "def subtract_cache\n tracker = Tracker.new\n tracker.read_articles\n @articles.delete_if { |x| tracker.articles.include?(x.link) }\n end", "def delete_all\n super\n Rails.cache.delete_matched(/#{self.configure.cache.namespace}/)\n end", "def cleanup_cached_images()\n\n # swap_dir = \"../public/swap\" # use when running locally from /lib/s3_bucket.rb\n swap_dir = \"./public/swap\" # use when running via app.rb\n swap_contents = \"#{swap_dir}/*\"\n gitkeep = \"#{swap_dir}/.gitkeep\"\n\n if File.directory?(swap_dir)\n FileUtils.rm_rf(Dir.glob(swap_contents)) # delete contents of /public/swap \n file = File.new(gitkeep, 'w') # recreate .gitkeep file\n file.close if file\n else\n puts \"sightings directory does not exist!\"\n end\n\nend", "def clean_cache\n node.normal['cloudflare']['threat_control']['status_cache'].reject! { |ip, data| is_stale? data['datetime'] }\nend", "def prune_index\n# missing_files=index_time_dbm_file.reject{|filename,itime| File.exists?(filename) && Picolena::IndexedDirectories.any?{|dir,alias_path| filename.starts_with?(dir)}}\n# missing_files.each{|filename, itime|\n# index.writer.delete(:complete_path, filename)\n# index_time_dbm_file.delete(filename)\n# logger.debug \"Removed : #{filename}\"\n# }\n# index.optimize\n end", "def clean_references\n s3_file_processor.clean_local_file if s3_file_processor.file_path\n end", "def clear_path_results(path)\n [path_assets_key(path), path_links_to_key(path), path_linked_to_from_key(path)].each do |key|\n redis.del key\n end\n end", "def remove_archive_cache\n expire_action(:controller => '/articles', :action => 'index')\n expire_fragment(%r{/articles/page/*})\n expire_fragment(%r{/categories/*})\n articles_folder = ActionController::Base.page_cache_directory + '/articles/'\n FileUtils.rmtree articles_folder if File.exists? articles_folder \n end", "def clear_all_caches\n $CACHE.clear\n remove_cached_feeds\n remove_cached_list_of_taxon_concepts\n if ActionController::Base.cache_store.class == ActiveSupport::Cache::MemCacheStore\n ActionController::Base.cache_store.clear\n return true\n else\n return false\n end\n end", "def clean\n nonces = Dir[@nonce_dir.join(\"*\")]\n now = Time.now\n \n nonces.each do |nonce|\n filename = nonce_dir.join(nonce)\n begin\n st = File.stat(filename)\n rescue Errno::ENOENT\n next\n else\n nonce_age = now - st.mtime\n self.remove_if_present(filename) if nonce_age > @max_nonce_age\n end\n end\n\n association_filenames = Dir[@association_dir.join(\"*\")]\n association_filenames.each do |af|\n begin\n f = File.open(af, 'r')\n rescue Errno::ENOENT\n next\n else\n begin\n assoc_s = f.read\n ensure\n f.close\n end\n begin\n association = OpenID::Association.deserialize(assoc_s)\n rescue \"VersionError\"\n self.remove_if_present(af)\n next\n else\n self.remove_if_present(af) if association.expires_in == 0 \n end\n end\n end\n end", "def prune(retain = 0)\n\t\t\t\tunused = []\n\t\t\t\t\n\t\t\t\[email protected] do |resource, usage|\n\t\t\t\t\tunused << resource if usage.zero?\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tunused.each do |resource|\n\t\t\t\t\tif block_given?\n\t\t\t\t\t\tyield resource\n\t\t\t\t\telse\n\t\t\t\t\t\tretire(resource)\n\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\tbreak if @resources.size <= retain\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\treturn unused.size\n\t\t\tend", "def clean!\n stop\n FileUtils.remove_entry(download_path) if File.exists? download_path\n FileUtils.remove_entry(tmp_save_dir, true) if File.exists? tmp_save_dir\n FileUtils.remove_entry(instance_dir, true) if File.exists? instance_dir\n FileUtils.remove_entry(md5sum_path) if File.exists? md5sum_path\n FileUtils.remove_entry(version_file) if File.exists? version_file\n end", "def clean!\n stop\n FileUtils.remove_entry(download_path) if File.exists? download_path\n FileUtils.remove_entry(tmp_save_dir, true) if File.exists? tmp_save_dir\n FileUtils.remove_entry(instance_dir, true) if File.exists? instance_dir\n FileUtils.remove_entry(md5sum_path) if File.exists? md5sum_path\n FileUtils.remove_entry(version_file) if File.exists? version_file\n end", "def invalidate!\n @changelog = nil\n @manifest = nil\n \n invalidate_tag_cache!\n invalidate_branch_cache!\n end", "def test_cachedel_non_empty_file\n _generic_cachedel_test 4000\n end", "def evict\n return if @cache.empty?\n @semaphor.synchronize(){|| \n keys = @cache.keys\n least_recently_used = keys.first\n @cache.each_pair do |url, response|\n least_recently_used = url if @cache[least_recently_used].timestamp > @cache[url].timestamp\n end\n @current_load = @current_load - @cache[least_recently_used].response.bytesize()\n @cache.delete(least_recently_used)\n }\n end", "def remove_all_images\n self.cover_image.purge if self.cover_image.attached?\n self.images.each {|image| image.purge} if self.images.attached?\n end", "def prune_index\n missing_files=index_time_dbm_file.reject{|filename,itime| File.exists?(filename) && Picolena::IndexedDirectories.any?{|dir,alias_path| filename.starts_with?(dir)}}\n missing_files.each{|filename, itime|\n index.writer.delete(:complete_path, filename)\n index_time_dbm_file.delete(filename)\n logger.debug \"Removed : #{filename}\"\n }\n index.optimize\n end", "def clear(path)\n return unless @cache_base\n\n target = (@cache_base + path)\n target.exist? && target.rmtree\n end", "def delete_remaining_s3_assets\n # This gets up to 1000 objects.\n # If the user has over 1000 objects that were not in the database then there may be some assets remaining.\n keys = S3_BUCKET.objects(prefix: user.unique_id).map(&:key)\n\n s3_deletion_service.bulk_delete(keys)\n end", "def purge_queue\n Varnisher.log.info 'Purging resources...'\n\n Parallel.map(@urls) do |url|\n Varnisher.log.debug \"Purging #{url}...\"\n\n Varnisher.purge(url.to_s)\n end\n\n Varnisher.log.info 'Done.'\n end", "def clear\n @uploaders.each do |uploader| \n full_preview_path = \"#{Rails.root}/public/uploads/tmp/#{uploader.preview.cache_name}\"\n cache_dir = File.expand_path('..', full_preview_path)\n uploader.remove!\n Dir.delete(cache_dir)\n end\n\n @uploaders.clear\n @downloaded_images.clear\n end", "def clean_up\n FileUtils.rm_rf \"#{@path}\" unless create_in_current_directory?\n FileUtils.rm_rf \"#{@cache}\"\n end", "def clear\n cache.clear\n end", "def cleanup\n reshaper_orig_cleanup\n\n # remove some unwanted pages\n pages.delete_if do |page|\n path = page.destination(source)\n path =~ /shared\\/layouts/ or\n path =~ /shared\\/includes/\n end\n\n # remove some unwanted static files\n static_files.delete_if do |file|\n file.path =~ /shared\\/includes/ or\n file.path =~ /\\.styl$/ or # stylus files should be generated into site.css\n file.path =~ /readme\\./ # readme files are for github\n end\n\n end", "def clean()\n rels = releases()\n rels.pop()\n\n unless rels.empty?\n rm = ['rm', '-rf'].concat(rels.map {|r| release_dir(r)})\n rm << release_dir('skip-*')\n cmd.ssh(rm)\n end\n end", "def unbuild(verbose=false)\n say \"Removing stale assets...\" if verbose\n\n pipeline = BPM::Pipeline.new self\n asset_root = File.join root_path, 'assets'\n pipeline.buildable_assets.each do |asset|\n next if asset.logical_path =~ /^bpm_/\n asset_path = File.join asset_root, asset.logical_path\n next unless File.exists? asset_path\n say \"~ Removing #{asset.logical_path}\" if verbose\n FileUtils.rm asset_path\n\n # cleanup empty directories\n while !File.exists?(asset_path)\n asset_path = File.dirname asset_path\n FileUtils.rmdir(asset_path) if File.directory?(asset_path)\n if verbose && !File.exists?(asset_path)\n say \"~ Removed empty directory #{File.basename asset_path}\"\n end\n end\n end\n\n say \"\\n\" if verbose\n end", "def flush_cache\n Linker.flush_cache\n end", "def clear_atomic_path_cache\n self.path = nil\n _base.instance_variable_set(\"@atomic_paths\", nil)\n end", "def clear_all!\n @cache = Cache.new\n end", "def cleanup\n @agent_file_history.each { |af| FileUtils.rm_f(af) }\n @key_file_history.each { |kf| FileUtils.rm_f(kf) }\n end", "def clear_stored_results\n paths = get_stored_paths\n redis.pipelined do\n paths.each do |path|\n [stored_paths_key, paths_visited_key, paths_to_visit_key].each do |key|\n redis.del key\n end\n\n clear_path_results(path)\n end\n end\n end", "def cleanup\n cleanup_unpack_path\n cleanup_download_path\n end", "def remove_cache_path\n cache_path.run_action(:delete)\n end", "def remove_old_cookbooks\n cache.find(File.join(%w{cookbooks ** {*,.*}})).each do |cache_file|\n cache_file =~ %r{^cookbooks/([^/]+)/}\n unless have_cookbook?($1)\n Chef::Log.info(\"Removing #{cache_file} from the cache; its cookbook is no longer needed on this client.\")\n cache.delete(cache_file)\n @events.removed_cookbook_file(cache_file)\n end\n end\n end", "def cleanup!\n FileUtils.rm_rf(obsolete_files)\n FileUtils.rm_rf(metadata_file) unless @site.incremental?\n end", "def clear_cache; end", "def clear_cache\n @all = nil\n end", "def clear_cache(uri)\n if last_cached(uri) > 0\n cache_store.delete(cache_key([uri, last_cached(uri)]))\n cache_store.delete(cache_key(uri))\n end\n end", "def clean!\n stop\n remove_instance_dir!\n FileUtils.remove_entry(config.download_path) if File.exists?(config.download_path)\n FileUtils.remove_entry(config.tmp_save_dir, true) if File.exists? config.tmp_save_dir\n md5.clean!\n FileUtils.remove_entry(config.version_file) if File.exists? config.version_file\n end", "def cleanup_app_caches(app_name, instance_name)\n Dir.chdir RailsPwnerer::Config[app_name, instance_name][:app_path] do\n if File.exist?('Gemfile')\n Kernel.system 'bundle exec rake assets:clean RAILS_ENV=production'\n else\n Kernel.system 'rake assets:clean RAILS_ENV=production'\n end\n end\n end", "def clean_files\n ck_valid\n File.unlink(pid_file) if File.exists?(pid_file)\n File.unlink(prof_file) if File.exists?(prof_file)\n File.unlink(socket_file) if File.exists?(socket_file)\n end", "def clear_local\n execute(:rm, '-rf', File.join(local_cache_path, '*')) if test!(\"[ -d #{local_cache_path} ]\")\n File.unlink(cached_gemfile_md5_path)\n end", "def clean_sprockets_assets\n manifest.clean(backups_to_keep)\n end", "def _clear_cache\n @cache_parent.clear\n end", "def delete_files(files)\n not_found = []\n files.each do |file|\n file_stored = Files.where({ '_id' => file[:uuid]}).first\n if file_stored.nil?\n logger.error 'File not found ' + file.to_s\n not_found << file\n else\n if file_stored['pkg_ref'] == 1\n # Referenced only once. Delete in this case\n file_stored.destroy\n del_ent_dict(file_stored, :files)\n file_md5 = Files.where('md5' => file_stored['md5'])\n if file_md5.size.to_i.zero?\n # Remove files from grid\n grid_fs = Mongoid::GridFs\n grid_fs.delete(file_stored['grid_fs_id'])\n end\n else\n # Referenced above once. Decrease counter\n file_stored.update_attributes(pkg_ref: file_stored['pkg_ref'] - 1)\n end\n # file_stored.destroy\n # del_ent_dict(file_stored, :files)\n #\n # # Remove files from grid\n # grid_fs = Mongoid::GridFs\n # grid_fs.delete(file_stored['grid_fs_id'])\n end\n end\n not_found\n end", "def scrub!\n ui.confirm \"Remove all contents from local cache (#{cache_directory})\" unless opts[:yes]\n run_action \"Scrubbing local cache\" do\n FileUtils.rm_rf(cache_directory)\n nil\n end\n end", "def clear_cache\n CircleCi.request(conf, \"#{base_path}/build-cache\").delete\n end", "def clear\n @cache.clear\n entries.clear\n self\n end", "def uncache file \n refresh = nil\n begin\n is_a_file = F === file\n path = (is_a_file ? file.path : file.to_s) \n stat = (is_a_file ? file.stat : F.stat(file.to_s)) \n refresh = tmpnam(F.dirname(path))\n ignoring_errors do\n F.link(path, refresh) rescue F.symlink(path, refresh)\n end\n ignoring_errors do\n F.chmod(stat.mode, path)\n end\n ignoring_errors do\n F.utime(stat.atime, stat.mtime, path)\n end\n ignoring_errors do\n open(F.dirname(path)){|d| d.fsync}\n end\n ensure \n ignoring_errors do\n F.unlink(refresh) if refresh\n end\n end\n end", "def cache_clear\n @moneta.clear\n end" ]
[ "0.68260294", "0.67973644", "0.67063093", "0.6537052", "0.6520091", "0.6439185", "0.6439185", "0.6398989", "0.630482", "0.6251173", "0.61982805", "0.61875933", "0.6181617", "0.6145845", "0.6016775", "0.59843755", "0.5905372", "0.58984494", "0.58150476", "0.58121455", "0.5788421", "0.5777687", "0.57570285", "0.57469463", "0.5685377", "0.5677345", "0.5674509", "0.566751", "0.566479", "0.5642261", "0.5634924", "0.56338847", "0.56271976", "0.5620677", "0.56132376", "0.55912864", "0.557454", "0.55678225", "0.5564682", "0.55530167", "0.55507237", "0.5539555", "0.55376834", "0.553037", "0.5524224", "0.5523648", "0.5523489", "0.550222", "0.5488668", "0.54856575", "0.5464897", "0.54414845", "0.5434977", "0.54345256", "0.5431644", "0.5423718", "0.5423529", "0.54197055", "0.5411446", "0.5410244", "0.5382246", "0.5382246", "0.5382185", "0.5369368", "0.53595334", "0.53549516", "0.53542", "0.534179", "0.53355116", "0.5331406", "0.531972", "0.5318147", "0.5315999", "0.5309766", "0.5296396", "0.5296277", "0.52948654", "0.5288543", "0.5286801", "0.5278169", "0.5273718", "0.52733344", "0.52728933", "0.52634025", "0.52620274", "0.5245045", "0.5229499", "0.521989", "0.5214766", "0.5214617", "0.5212598", "0.5206267", "0.51893806", "0.5184499", "0.51808244", "0.5178116", "0.51755244", "0.51721877", "0.5167159", "0.5160579" ]
0.6766417
2
Check if the cache contains the resource at +path+. If found the original file at +path+ will be replaced my a hardlink to the cached resource. If not found a hardlink for the file at +path+ will be created in the cache for future use.
def cache_resource( path ) resource_hash = compute_hash(path) return true if find_resource(resource_hash) copy_resource(resource_hash, path) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy_resource( resource_hash, path )\n # NOTE: the whole caching assumes that two files with the same\n # resource hash contain the same data.\n cache_path = find_resource(resource_hash)\n unless cache_path.nil?\n File.unlink(cache_path)\n end\n\n cache_path = File.join(@cache_path, \"#{resource_hash}#{File.extname(path)}\")\n File.link(path, cache_path)\n\n true\n rescue SystemCallError\n false\n end", "def force(path)\n cache[path] = true\n end", "def exists?(path)\n return unless @cache_base\n\n File.exists?(@cache_base + path)\n end", "def lookup(path)\n unless @cached.has_key?(path)\n @cached[path] = _lookup!(path)\n end\n return @cached[path]\n end", "def dangling?(path)\n p = get(path)\n\n if File.symlink?(p)\n src = File.readlink(p)\n not File.exists?(src)\n else\n nil\n end\n end", "def cache_path_for(resource)\n return false unless @cache_dir\n return false unless Dir.exist?(@cache_dir)\n # sanity check the resource\n return false unless resource && !resource.empty?\n # don't use URL params\n resource = resource.split('?', 2)[0]\n # join and expand the path\n expanded_path = File.expand_path(File.join(@cache_dir, resource))\n # don't allow requests to read outside the given cache directory\n # (eg: resource = '../../../../tmp/foo.txt')\n return false unless expanded_path.start_with?(@cache_dir)\n expanded_path\n end", "def cache_file(file)\n FileUtils.cp(file, path)\n end", "def ensure_cache_path(path)\n FileUtils.makedirs(path) unless ::File.exist?(path)\n end", "def modified?(path)\n return true if disabled?\n\n # objects that don't have a path are always regenerated\n return true if path.nil?\n\n # Check for path in cache\n return cache[path] if cache.key? path\n\n if metadata[path]\n # If we have seen this file before,\n # check if it or one of its dependencies has been modified\n existing_file_modified?(path)\n else\n # If we have not seen this file before, add it to the metadata and regenerate it\n add(path)\n end\n end", "def cache_hit?(client)\n expanded_path = cache_path_for(client.resource)\n return false unless expanded_path\n # this covers permissions and the file actually existing on disk\n return false unless File.readable?(expanded_path)\n # return true if this is a regular file (eg: not a directory)\n return expanded_path if File.file?(expanded_path)\n end", "def file(path, *args)\n return file_via_connection(path, *args) unless cache_enabled?(:file)\n\n @cache[:file][path] ||= file_via_connection(path, *args)\n end", "def ensure_cache_path(path)\n FileUtils.makedirs(path) unless File.exist?(path)\n end", "def cached?\n cache_path.exist?\n end", "def add(path)\n return true unless File.exist?(path)\n\n metadata[path] = {\n \"mtime\" => File.mtime(path),\n \"deps\" => [],\n }\n cache[path] = true\n end", "def fetch_dynamic_asset(path)\n return yield unless cache_dynamic_assets\n\n mtime = File.mtime(path)\n cached_mtime, contents = @dynamic_asset_cache[path]\n\n if cached_mtime.nil? || mtime != cached_mtime\n @dynamic_asset_cache[path] = [mtime, yield]\n @dynamic_asset_cache[path][1]\n else\n contents\n end\n end", "def cache_exists?\n File.exist?(cached_file)\n end", "def put(src, uri)\n # prepare cache path\n path = prepare_cache_path\n\n # move the file from the working directory to cache\n FileUtils.mv(src, path)\n\n # make a symbolic link from original location to the cache\n FileUtils.symlink(path, src)\n\n # copy from cache to the resource file\n @table[uri.to_s] = path\n Resource[uri].link_from(path)\n end", "def symlink(guest_path, bucket_path = \"/tmp/vagrant-cache/#{@name}\")\n return if @env[:cache_dirs].include?(guest_path)\n\n @env[:cache_dirs] << guest_path\n comm.execute(\"mkdir -p #{bucket_path}\")\n unless symlink?(guest_path)\n comm.sudo(\"mkdir -p `dirname #{guest_path}`\")\n if empty_dir?(bucket_path) && !empty_dir?(guest_path)\n # Warm up cache with guest machine data\n comm.sudo(\"shopt -s dotglob && mv #{guest_path}/* #{bucket_path}\")\n end\n comm.sudo(\"rm -rf #{guest_path}\")\n comm.sudo(\"ln -s #{bucket_path} #{guest_path}\")\n end\n end", "def cache_exist?\n File.exist?(@cache_file)\n end", "def rm_r_cached(path)\n invoke(:rm, '-r', '--cached', path)\n true\n end", "def write_cache(cache, path)\n if @use_cache then\n File.open path, \"wb\" do |cache_file|\n Marshal.dump cache, cache_file\n end\n end\n\n cache\n rescue Errno::EISDIR # HACK toplevel, replace with main\n cache\n end", "def resolve_path(path)\n fail_script_unless_file_exists path\n return path\n end", "def resolve_path(path)\n fail_script_unless_file_exists path\n return path\n end", "def cache_path\n File.join @path, 'cache.ri'\n end", "def get_path_linked_to_from(path)\n redis.smembers path_linked_to_from_key(path)\n end", "def append_path_if_exists(path)\n lambda do |release, links|\n if links.map { |link| link.content.delete('/') }.include?(path)\n release.merge(url: \"#{release[:url]}#{path}/\")\n else\n release\n end\n end\n end", "def already_cached?\n File.exist?(cached_installer_path) and File.zero?(cached_installer_path) == false\nend", "def cached?\n cache_path.exist?\n end", "def cache_page(content, path)\n return unless perform_caching\n\n benchmark \"Cached page: #{page_cache_file(path)}\" do\n FileUtils.makedirs(File.dirname(page_cache_path(path)))\n File.open(page_cache_path(path), \"wb+\") { |f| f.write(content) }\n end\n end", "def get_path_assets(path)\n redis.smembers path_assets_key(path)\n end", "def store_path_linked_to_from(path, links)\n return if links.empty?\n redis.sadd path_linked_to_from_key(path), links\n end", "def check_from_cache(url, username, password)\n key = generate_key url, username, password\n\n res = @@file_cache[key]\n\n return nil if res.nil? || !File.exist?(res[:data_tmp_path])\n\n if (res[:time_stored] + 3600) < Time.now\n FileUtils.rm res[:data_tmp_path]\n return nil\n end\n\n res\n end", "def sync_to_cache_for_archiving\n result = sync_to_cache(false)\n self.erase_cache_symlinks rescue nil\n result\n end", "def include?(value)\n File.exist?(File.join(cache_path, value))\n end", "def cache_fleximage( content, path )\n return unless perform_caching && APP_CONFIG['perform_fleximage_caching']\n benchmark \"Cached page: #{page_cache_file(path)}\" do\n FileUtils.makedirs(File.dirname(page_cache_path(path)))\n File.open(page_cache_path(path), \"wb+\") { |f| f.write(content) }\n end\n end", "def cache_path(uri:, path:)\n return if File.exist?(path)\n\n WebMock.disable!\n development_config = Figgy.all_environment_config[\"development\"]\n client = ArchivesSpace::Client.new(\n ArchivesSpace::Configuration.new(\n base_uri: development_config[\"archivespace_url\"],\n username: development_config[\"archivespace_user\"],\n password: development_config[\"archivespace_password\"]\n )\n )\n client.login\n result = client.get(uri)\n FileUtils.mkdir_p(Pathname.new(path).dirname)\n File.open(path, \"w\") do |f|\n f.write(result.body)\n end\n WebMock.enable!\n end", "def store_path_visited(path)\n redis.sadd paths_visited_key, path\n end", "def cache_file_path\n raise IOError.new 'Write permission is required for cache directory' unless File.writable?(@args[:cache_directory])\n \"#{@args[:cache_directory]}/#{Digest::SHA1.hexdigest((@args[:cache_ref] || @path).to_s + size.to_s + last_modified.to_s)}.cache\"\n end", "def cached_file?\n Settings.documents.page_cache && File.exists?(cache_file)\n end", "def store_path_links_to(path, links)\n return if links.empty?\n redis.sadd path_links_to_key(path), links\n end", "def cache_filename_for_uri( path )\n uid = Digest::MD5.hexdigest( \"#{@uid}:#{path}\" )\n # NOTE: this path needs to exist with r/w permissions for webserver\n @cache_dir.join( uid )\n end", "def look_aside(mutable_file_cache, uri)\n fail \"Buildpack cache not defined. Cannot look up #{uri}.\" unless @buildpack_stashes\n\n key = URI.escape(uri, '/')\n @buildpack_stashes.each do |buildpack_stash|\n stashed = buildpack_stash + \"#{key}.cached\"\n @logger.debug { \"Looking in buildpack cache for file '#{stashed}'\" }\n if stashed.exist?\n mutable_file_cache.persist_file stashed\n @logger.debug { \"Using copy of #{uri} from #{buildpack_stash}.\" }\n return\n end\n end\n\n message = \"Buildpack cache does not contain #{uri}\"\n @logger.error { message }\n @buildpack_stashes.each do |buildpack_stash|\n @logger.debug { \"#{buildpack_stash} contents:\\n#{`ls -lR #{buildpack_stash}`}\" }\n end\n fail message\n end", "def get_path_links_to(path)\n redis.smembers path_links_to_key(path)\n end", "def cache_hit?(name, version='master')\n page = wiki.page(name, version)\n File.exists?(page_path(name, version)) unless page.nil?\n end", "def link_exists_on(host, link_path)\n # Links are weird on windows, fall back to seeing if the file exists\n return file_exists_on(host, link_path) if host[:platform].include?('windows')\n\n return on(host, Command.new(%(test -L \"#{link_path}\"), accept_all_exit_codes: true)).exit_code.zero?\n end", "def make_link(old) File.link(old, path) end", "def write_cache(resource, content)\n expanded_path = cache_path_for(resource)\n return false unless expanded_path\n FileUtils.mkdir_p(File.dirname(expanded_path))\n @logger.info(self.class) { \"Caching #{content.length} B for #{resource}\" }\n File.write(expanded_path, content)\n end", "def store_path_assets(path, assets)\n return if assets.empty?\n redis.sadd path_assets_key(path), assets\n end", "def compile_asset_from_cache(asset_path, &block)\n # TODO(philc): We should not check the file's md5 more than once when we're running in production mode.\n contents = File.read(asset_path)\n md5 = Digest::MD5.hexdigest(contents)\n cached_asset = $compiled_cache[asset_path]\n if md5 != cached_asset[:md5]\n cached_asset[:contents] = block_given? ? block.yield(asset_path) : File.read(contents)\n cached_asset[:md5] = md5\n end\n cached_asset[:contents]\n end", "def fetch_cache(file, url)\n @path = \"tmp/\" + file + \".html\";\n @temp = @path + \".fetch\"\n @doFetch = !(FileTest.exists?(@path) && (Time.new - File.mtime(@path) < (5 * 60)))\n\n if @doFetch and download_page(@temp,url) then\n File.delete(@path) if File.exists?(@path)\n File.rename(@temp, @path)\n end\n\n if File.exists?(@path) then\n return @path\n else\n @useOnce = @path + \".\" + rand(100000).to_s + \".once\"\n download_page(@useOnce, url)\n return @useOnce\n end\n end", "def path_with_cache_buster(path, options = {})\n return path if !options.key?(:cache_buster) && options[:cache_buster_type].nil?\n\n buster_path = nil\n type = options[:cache_buster_type] || :soft\n\n if options.key?(:cache_buster)\n # Pass :cache_buster even if it's nil\n buster_path = Juicer::CacheBuster.send(type, filename, options[:cache_buster])\n else\n # If :cache_buster wasn't specified, rely on default value\n buster_path = Juicer::CacheBuster.send(type, filename)\n end\n\n path.sub(File.basename(path), File.basename(buster_path))\n end", "def exist?(key)\n File.exist?(cache_path(key))\n end", "def include?(key)\n File.exist?(cache_path(key))\n end", "def cached_file(source, checksum = nil)\n if source =~ %r{^(file|ftp|http|https):\\/\\/}\n uri = as_uri(source)\n cache_file_path = \"#{Chef::Config[:file_cache_path]}/#{::File.basename(::CGI.unescape(uri.path))}\"\n Chef::Log.debug(\"Caching a copy of file #{source} at #{cache_file_path}\")\n\n remote_file cache_file_path do\n source source\n backup false\n checksum checksum unless checksum.nil?\n end\n else\n cache_file_path = source\n end\n\n Chef::Util::PathHelper.cleanpath(cache_file_path)\n end", "def move_to_cache\r\n true\r\n end", "def in_cache_dir(*paths); end", "def file_exist?(path)\n full_path = ::File.join(@static_server.root, ::Merb::Parse.unescape(path))\n ::File.file?(full_path) && ::File.readable?(full_path)\n end", "def cached?\n Dir.exist?(cached_repo_path)\n end", "def file_exists?(path)\n response = self.class.head(File.join('/', path), request_options)\n response.code >= 200 && response.code < 300\n end", "def check_existance_of_path(path)\n\n if not path == nil\n question = absolute_path(path)\n File.exists?(question)\n else\n nil\n end\n end", "def consider_caching?(path)\n return false if self.disabled\n return true if self.except.blank? && self.only.blank?\n return false if list_match?(self.except, path)\n return true if self.only.blank?\n return true if list_match?(self.only, path)\n false\n end", "def exists? path\n find_blob(full_path(path))\n end", "def cache(input_path, output_path, data=nil)\n path = input_path\n @new_hashes[input_path] = hash(@input_directory, input_path)\n\n if data\n @data[path] = data if data\n @wildcard_dependencies[path] = data[:wildcard_dependencies] if data[:wildcard_dependencies]\n @dependencies[path] = data[:dependencies] if data[:dependencies]\n end\n\n FileUtils.mkdir_p(File.dirname(cached_path_for(path)))\n\n if File.exist? File.join(@output_directory, output_path)\n FileUtils.cp(File.join(@output_directory, output_path), cached_path_for(path))\n else\n FileUtils.cp(File.join(@input_directory, input_path), cached_path_for(input_path))\n end\n end", "def cache_path\n @cache_path ||= Pathname.new(Berkshelf.berkshelf_path).join('.cache', 'halite', dependency.name)\n end", "def lookup(path)\n manifest = manifests.detect { |m| m.match?(path) }\n if manifest && (asset = manifest.lookup(path))\n return mount(asset)\n end\n path\n end", "def update_cache_symlinks #:nodoc:\n self.erase_cache_symlinks\n self.make_cache_symlinks\n end", "def path_exists(path)\n return @mappings.path_exists(path)\n end", "def absolute_path\n if is_url?\n # Use the last path component without the query string plus the name\n # of the resource in Base64. This should be both mildly readable and\n # also unique per invocation.\n url_part = URI(path).path.split(/\\//).last\n base64_name = Base64.strict_encode64(name).gsub(/\\=/, '')\n ::File.join(Chef::Config[:file_cache_path], \"#{base64_name}_#{url_part}\")\n else\n ::File.expand_path(path, Chef::Config[:file_cache_path])\n end\n end", "def resolve_asset_path(path, allow_non_precompiled = T.unsafe(nil)); end", "def resolve_asset_path(path, allow_non_precompiled = T.unsafe(nil)); end", "def loadable?(path)\n return false unless File.exists? path\n\n @stat = File.stat path\n @stat.file? and @stat.readable?\n end", "def move_to_cache\n true\n end", "def move_to_cache\n true\n end", "def move_to_cache\n true\n end", "def expire_cache(path = nil)\n return unless Sinatra.options.cache_enabled\n \n path = (path.nil?) ? cache_page_path(request.path_info) : cache_page_path(path)\n if File.exist?(path)\n File.delete(path)\n #log.info( \"Expired Page deleted at: [#{path}]\")\n else\n #log.info( \"No Expired Page was found at the path: [#{path}]\")\n end\n end", "def cached?(file_id)\n synchronize do\n return @cached_files.include?(file_id)\n end\n end", "def write_cache?\n if site.front_page_cached and c = cache_url\n #Rails.logger.info(\"request.path:::: #{request.path}\")\n cache_page(response.body, File.join(site.cache_path, c).to_s)\n end\n end", "def by_path(path); end", "def lookup_by_path(path, opts = T.unsafe(nil)); end", "def latest_version_of(path)\n @latest_version_of_cache ||= {}\n @latest_version_of_cache[path] ||= begin\n if relative_url_versioned?(path)\n if has_current_version_for?(path)\n non_versioned_path(path)\n else\n latest_version = list_versions_for(path).first\n path_for_version(latest_version, path)\n end\n else\n path\n end\n end\n end", "def update_cache\n Rails.logger.debug \"Updating cache for... #{@@cache_file}\"\n fp = File.new(@@cache_file, 'w')\n if fp\n # acquire an exclusive lock (writer)\n if fp.flock(File::LOCK_EX)\n content = open(@@file_path).read\n \n if content\n #logger.debug \"Generate cache file: #{@@cache_file}\"\n fp.write(content) # writes to the file\n end\n \n fp.flock(File::LOCK_UN) # release a lock\n end\n fp.close\n end\n end", "def remote_symlink_exists?(full_path)\n remote_filetest_passes?('-L', full_path)\n end", "def _resolve path, options = {}\n candidates(path).detect do |path|\n downloadable? path, options\n end || resolve(File.dirname(path), options)\n end", "def in_cache_dir(*paths)\n paths.reduce(cache_dir) do |base, path|\n Jekyll.sanitized_path(base, path)\n end\n end", "def handle(path)\n File.exist?(path) ? attach(path) : failed!\n end", "def handle(path)\n File.exist?(path) ? attach(path) : failed!\n end", "def handle(path)\n File.exist?(path) ? attach(path) : failed!\n end", "def move_to_cache\n true\n end", "def store(from, path = nil)\n return unless @cache_base\n\n path ||= from\n clear path\n copy from, (@cache_base + path)\n end", "def cache_file_path\n File.join @homepath, 'cache'\n end", "def read_from_cache\n if config.cache.is_a?(Proc)\n config.cache.call(nil)\n elsif (config.cache.is_a?(String) || config.cache.is_a?(Pathname)) &&\n File.exist?(file_path)\n open(file_path).read\n end\n end", "def load_cache\n begin\n file = File.join(\"inline\", File.basename(so_name))\n if require file then\n dir = Inline.directory\n warn \"WAR\\NING: #{dir} exists but is not being used\" if test ?d, dir and $VERBOSE\n return true\n end\n rescue LoadError\n end\n return false\n end", "def delete_if_exists(path)\n FileUtils.remove_entry_secure(path) if test(?e, path)\n end", "def write\n return false unless @path\n\n clean!\n\n @path.open('w') do |file|\n file.puts YAML.dump(@cache)\n end\n\n true\n end", "def cache_path\n Pathname.new(File.expand_path(File.join(ChefCLI::Helpers.package_home, \"cache\")))\n .join(\".cache\", \"git\", Digest::SHA1.hexdigest(uri))\n end", "def clear(path)\n return unless @cache_base\n\n target = (@cache_base + path)\n target.exist? && target.rmtree\n end", "def load_cached_partial(path, context)\n context.registers[:cached_partials] ||= {}\n cached_partial = context.registers[:cached_partials]\n\n if cached_partial.key?(path)\n cached_partial[path]\n else\n unparsed_file = context.registers[:globals]\n .liquid_renderer\n .file(path)\n begin\n # Cache a version of the\n cached_partial[path] = unparsed_file.parse(read_file(path, context))\n rescue Liquid::Error => e\n e.template_name = path\n e.markup_context = \"included \" if e.markup_context.nil?\n raise e\n end\n end\n end", "def _lookup!(path)\n found = nil\n\n $LOAD_PATH.each do |base|\n rb_file = File.join( base, \"translation_maps\", \"#{path}.rb\" )\n yaml_file = File.join( base, \"translation_maps\", \"#{path}.yaml\" )\n prop_file = File.join(base, \"translation_maps\", \"#{path}.properties\" )\n\n if File.exist? rb_file\n found = eval( File.open(rb_file).read , binding, rb_file )\n break\n elsif File.exist? yaml_file\n found = YAML.load_file(yaml_file)\n break\n elsif File.exist? prop_file\n found = Traject::TranslationMap.read_properties(prop_file)\n break\n end\n end\n\n # Cached hash can't be mutated without weird consequences, let's\n # freeze it!\n found.freeze if found\n\n return found\n end", "def asset_requirable?(path)\n pathname = resolve(path)\n content_type = environment.content_type_of(pathname)\n stat = environment.stat(path)\n return false unless stat && stat.file?\n self.content_type.nil? || self.content_type == content_type\n end", "def replace(entry, src_path)\n check_file(src_path)\n remove(entry)\n add(entry, src_path)\n end" ]
[ "0.695947", "0.6684801", "0.6523238", "0.6331892", "0.6022272", "0.59683704", "0.59377813", "0.59205884", "0.5918271", "0.59041023", "0.5879262", "0.5871114", "0.58165413", "0.5809605", "0.5798855", "0.5798588", "0.5755671", "0.5747455", "0.5725216", "0.5720542", "0.5719726", "0.5686754", "0.5686754", "0.5683557", "0.5680804", "0.56506026", "0.5646218", "0.5642523", "0.5600053", "0.55857813", "0.5583707", "0.557454", "0.5566778", "0.5556314", "0.5554817", "0.5533358", "0.5497155", "0.54948664", "0.54688627", "0.5462795", "0.54603344", "0.5446751", "0.54439414", "0.54425716", "0.54384494", "0.54302007", "0.54047936", "0.54027003", "0.5397287", "0.53792", "0.5368602", "0.5328216", "0.53281015", "0.5320781", "0.53185844", "0.530252", "0.529808", "0.52822816", "0.52811676", "0.5278503", "0.5275474", "0.5263726", "0.52597755", "0.52527666", "0.5233026", "0.5231872", "0.5227804", "0.52206355", "0.51987463", "0.51987463", "0.51938397", "0.519215", "0.519215", "0.519215", "0.51914454", "0.5180557", "0.51784027", "0.51777875", "0.5168736", "0.5150655", "0.5148651", "0.51478994", "0.5147487", "0.51449805", "0.51413965", "0.51413965", "0.51413965", "0.5141394", "0.5139991", "0.51392704", "0.5136634", "0.51333195", "0.51293826", "0.5090708", "0.50833225", "0.50775814", "0.5077581", "0.50752926", "0.50733054", "0.5072279" ]
0.80705315
0
Compute a unique hash of the file contents at +path+ and return it in string form.
def compute_hash( path ) res = '0' autorelease_pool { res = NSData.sha1FromContentsOfFile(path) } res end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def digest\n OpenSSL::Digest::SHA256.file(path).hexdigest\n end", "def sha1(path)\n result = nil\n chunk_size = 10240\n File.open(path, \"r\") do |file|\n sha1 = Digest::SHA1.new\n\n while true\n chunk = file.read chunk_size\n break if ! chunk\n sha1.update chunk\n end\n result = sha1.hexdigest\n end\n result\n end", "def integrity(path)\n \"sha256-#{Base64.encode64(Digest::SHA256.digest(File.read(path))).chomp}\"\n end", "def filehash(filepath)\n sha1 = Digest::SHA1.new\n File.open(filepath) do|file|\n buffer = ''\n # Read the file 512 bytes at a time\n while not file.eof\n file.read(512, buffer)\n sha1.update(buffer)\n end\n end\n return sha1.to_s\n end", "def path_hash(path)\n if File.exist?(path)\n %x{\n { cd cookbooks;\n export LC_ALL=C;\n find #{path} -type f -exec md5sum {} + | sort; echo;\n find #{path} -type d | sort;\n find #{path} -type d | sort | md5sum;\n } | md5sum\n }.split(' ', 2).first\n end\n end", "def file_checksum(file_path)\n Digest::SHA256.file(file_path).hexdigest\n end", "def file_sha256_hash(file_path)\n file = File.read(file_path)\n Digest::SHA256.hexdigest(file) if file\n end", "def hash_path(path)\n Digest::MD5.hexdigest(path)[0..5]\n end", "def digest\n assert_file!\n Digest::SHA256.hexdigest(@name + Digest::SHA256.file(@path).to_s)\n end", "def checksum(path)\n FileChecksum.new(path, Digest::SHA1).checksum\n end", "def hash\n Digest::MD5.hexdigest(abs_filepath)[0..5]\n end", "def checksum\n digest = @digest_klass.new\n buf = ''\n\n File.open(@path, \"rb\") do |f|\n while !f.eof\n begin\n f.readpartial(BUFFER_SIZE, buf)\n digest.update(buf)\n rescue EOFError\n # Although we check for EOF earlier, this seems to happen\n # sometimes anyways [GH-2716].\n break\n end\n end\n end\n\n digest.hexdigest\n end", "def file_digest(path)\n if stat = self.stat(path)\n self.stat_digest(path, stat)\n end\n end", "def get_file_hash(fullPath)\n contents = File.read(fullPath)\n fileHash = Digest::MD5.hexdigest(contents)\n return fileHash\nend", "def hash\r\n # TODO what if file is empty?\r\n @hash ||= Digest::SHA1.file(File.join(@directory, @filename)).hexdigest\r\n end", "def contents_hash(paths)\n return if paths.nil?\n\n paths = paths.compact.select { |path| File.file?(path) }\n return if paths.empty?\n # rubocop:disable GitHub/InsecureHashAlgorithm\n paths.sort\n .reduce(Digest::XXHash64.new, :file)\n .digest\n .to_s(16) # convert to hex\n # rubocop:enable GitHub/InsecureHashAlgorithm\n end", "def hexdigest\n self.class.hexdigest_for(path)\n end", "def file_sha256\n Digest::SHA256.file(self).hexdigest\n end", "def get_sha1(path)\n return @cache_sha1 unless @cache_sha1.nil?\n sha1 = \"\"\n if File.exist?(path)\n Dir.chdir(path) do\n sha1 = %x(git rev-parse HEAD).delete(\"\\n\")\n end\n end\n\n @cache_sha1 = sha1\n sha1\n end", "def hash_file(name, length)\n pieces = String.new\n file = ::File.open(name, 'r')\n pieces << Digest::SHA1.digest(file.read(length)) until file.eof?\n file.close\n pieces\n end", "def hash\n return (path + file_id.to_s).hash\n end", "def generate_sha(file)\n\n sha1 = Digest::SHA1.file file\n return sha1\n\nend", "def generate_uniq_filename_from(data)\n if data.respond_to?(:path)\n Digest::MD5.hexdigest(data.path)\n elsif data.respond_to?(:read)\n chunk = data.read(1024)\n data.rewind\n Digest::MD5.hexdigest(chunk)\n else\n Digest::MD5.hexdigest(data)\n end\n end", "def generate_uniq_filename_from(data)\n if data.respond_to?(:path)\n Digest::MD5.hexdigest(data.path)\n elsif data.respond_to?(:read)\n chunk = data.read(1024)\n data.rewind\n Digest::MD5.hexdigest(chunk)\n else\n Digest::MD5.hexdigest(data)\n end\n end", "def hash_file path, hash_store\r\n\thexdigest = HASH_DIGEST.hexdigest(open(path, 'rb') { |io| io.read })\r\n\thash_store[hexdigest] << path\r\nend", "def findSmallHash(f)\r\n return Digest::SHA1.file(f).hexdigest()\r\nend", "def sha1\n RunLoop::Directory.directory_digest(path)\n end", "def file_sha1\n Digest::SHA1.file(self).hexdigest\n end", "def md5sum(path)\n digest, buf = Digest::MD5.new, \"\"\n File.open(path) do |f|\n while f.read(4096, buf)\n digest.update(buf)\n end\n end\n digest.hexdigest\n end", "def calculate_file_name(file_path,file_name)\n file_sha = Digest::SHA256.file(file_path)\n \"#{file_sha}_#{file_name}\"\n end", "def md5\n Digest::MD5.file(@path).to_s\n end", "def sha1(name)\n Digest::SHA1.file(path(name)).hexdigest\n end", "def file_digest(path)\n if stat = self.stat(path)\n # Caveat: Digests are cached by the path's current mtime. Its possible\n # for a files contents to have changed and its mtime to have been\n # negligently reset thus appearing as if the file hasn't changed on\n # disk. Also, the mtime is only read to the nearest second. Its\n # also possible the file was updated more than once in a given second.\n cache.fetch(['file_digest', path, stat.mtime.to_i]) do\n if stat.directory?\n # If its a directive, digest the list of filenames\n digest_class.digest(self.entries(path).join(','))\n elsif stat.file?\n # If its a file, digest the contents\n digest_class.file(path.to_s).digest\n end\n end\n end\n end", "def digest\n Digest::MD5.file(file).hexdigest\n end", "def md5 path\n return unless File.file?(path)\n self.md5s[path] ||= Digest::MD5.file(path).hexdigest[0...8]\n end", "def fedora_shasum\n \"urn:sha1:#{Digest::SHA1.file(file_path)}\"\n end", "def git_sha_for(path)\n website.git_repository.git_sha path\n end", "def file_digest(file)\n # Get the actual file by #tempfile if the file is an `ActionDispatch::Http::UploadedFile`.\n Digest::SHA256.file(file.try(:tempfile) || file).hexdigest\n end", "def getHash element\n\tfile = File.new(element)\n\thash = Digest::SHA256.file file\n\tfile.close\n\treturn hash.hexdigest \n\tend", "def checksum(file)\n sha = ::Digest::SHA1.new\n File.open(file, 'r') do |fh|\n fh.each_line do |l|\n sha << l\n end\n end\n sha.hexdigest\n end", "def genhash(absolute_filename)\n HDB.debug and puts \"Absolute filename #{absolute_filename}\"\n if File.file?(absolute_filename)\n HDB.debug and puts \"Digesting\"\n hash = Digest::SHA512.new\n # Save atime\n PRESERVE_ATIME and atime = File.stat(absolute_filename).atime\n File.open(absolute_filename, 'r') do |fh|\n while buffer = fh.read(BUFSIZE)\n hash << buffer\n end\n end\n # Reset atime, preserve mtime\n PRESERVE_ATIME and File.utime(atime, File.stat(absolute_filename).mtime, absolute_filename)\n return hash.to_s\n else\n HDB.debug and puts \"Not a file\"\n return NAHASH\n end\n end", "def sha1\n @sha1 ||= digest(path, :sha1)\n end", "def md5; Digest::MD5.file(fname).hexdigest; end", "def get_md5(fname)\n Digest::MD5.hexdigest(File.read(fname))\nend", "def md5sum_file(file)\n return `md5sum #{file}`\n end", "def hash_file(filename)\n file = File.read(filename)\n tlsh_hash(file.bytes)\n end", "def file_md5\n Digest::MD5.file(self).hexdigest\n end", "def asset_digest(path, options = {})\n return unless digest_assets\n\n if digest_path = asset_digest_path(path, options)\n digest_path[/-(.+)\\./, 1]\n end\n end", "def raw(path)\n details = ASSETS.fetch(path)\n create_fullpath(path, details[:md5], hashless: details[:hashless])\n rescue KeyError\n \"/#{path}\"\n end", "def checksum_file(digest_class, path)\n digester = digest_class.new\n digester.file(path)\n digester.hexdigest\n end", "def path_to_sha(path, head=@current_branch)\n # Return the root of the repo if no path is specified\n return root_sha(head) if (not path) || (path.empty?)\n\n if staging?\n @staging_index.sync\n head = @staging_index.current_tree.id\n end\n\n dir = tree(head, [path])\n (dir && dir.contents.length > 0) ? dir.contents.first.id : nil\n end", "def etag\n stat = ::File.stat(@path)\n '\"' + Digest::SHA1.hexdigest(stat.ino.to_s + stat.size.to_s + stat.mtime.to_s) + '\"'\n end", "def digest_file( x)\n path = requested_file( x[:request] )\n if File.exist?(path) && !File.directory?(path)\n Digest::MD5.hexdigest(File.read(path))\n else\n nil\n end\n end", "def file_remote_digestsha1(file_name)\n data = read_file(file_name)\n chksum = nil\n if data\n chksum = Digest::SHA1.hexdigest(data)\n end\n return chksum\n end", "def hash(pathname)\n ext = pathname.extname\n ext = ('' == ext || nil == ext) ? :none : ext.to_sym\n digest = Digest::MD5.hexdigest(File.read(pathname.to_s))\n @scanned[ext] ||= {}\n @scanned[ext][digest] ||= []\n @scanned[ext][digest] << pathname\n end", "def sha256\n @sha256 ||= digest(path, :sha256)\n end", "def get_md5sum(file)\n get_sum(file, 'md5')\n end", "def sha256(files)\n sha = Digest::SHA2.new\n files.each do |f|\n next if File.directory?(f)\n\n content = File.binread(f)\n # work around possible git checkout issues by removing CR and LF from the file\n content.gsub!(\"\\n\", \"\")\n content.gsub!(\"\\r\", \"\")\n sha << content\n end\n sha.hexdigest\n end", "def fetch_md5\n # Create a hash digest for the current file.\n digest = Digest::MD5.new\n File.open(@path, 'r') do |handle|\n while buffer = handle.read(1024)\n digest << buffer\n end\n end\n digest\n end", "def file_remote_digestsha2(file_name)\n data = read_file(file_name)\n chksum = nil\n if data\n chksum = Digest::SHA256.hexdigest(data)\n end\n return chksum\n end", "def digest_filename(filename)\n digest = Digest::SHA256.digest(filename.to_s)\n Base64.urlsafe_encode64(digest, padding: false)\n end", "def hash\n path.hash\n end", "def hashed_content\n @hashed_content ||= valid? ? Digest::SHA1.hexdigest(content) : nil \n end", "def sign(path)\n status \"Checksums for #{File.basename(path)}:\"\n\n puts\n puts \" md5: #{Digest::MD5.file(path)}\" if @md5\n puts \" sha1: #{Digest::SHA1.file(path)}\" if @sha1\n puts \" sha2: #{Digest::SHA2.file(path)}\" if @sha2\n puts \" sha512: #{Digest::SHA512.file(path)}\" if @sha512\n puts\n end", "def checksum(file_path, hash_class, _bit_size)\n # Size of each chunk\n chunk_size = 2048\n # Hash that is the checksum function\n # when a bitsize was specified\n if _bit_size\n hash = hash_class.new(_bit_size)\n else\n hash = hash_class.new\n end\n # File handler\n file_object = File.open(file_path, 'r')\n # loop to update the hash\n while true\n content = file_object.read chunk_size\n # Break the loop if we don't get any byte\n unless content\n return hash.hexdigest\n end\n # Update the hash\n hash.update content\n end\nend", "def filehash(filename, algorithm = DEFAULT_ALGORITHM)\n algo_class = Digest.const_get(algorithm.to_s.upcase)\n\n # Safety check\n unless algo_class.class == Class and algo_class.respond_to?(:new)\n raise \"Unknown filehash provider #{algo_class}\"\n end\n\n hash = algo_class.new()\n File.open(filename,'r') do |f|\n until f.eof?\n hash.update(f.read(READ_SIZE))\n end\n end\n\n return hash.hexdigest\n end", "def digests_for(path)\n\t\t\ttotal = 0\n\n\t\t\[email protected] do |key, digest|\n\t\t\t\tdigest.reset\n\t\t\tend\n\n\t\t\tFile.open(path, \"rb\") do |file|\n\t\t\t\tbuffer = \"\"\n\t\t\t\twhile file.read(1024 * 1024 * 10, buffer)\n\t\t\t\t\ttotal += buffer.bytesize\n\t\t\t\t\t\n\t\t\t\t\[email protected](total) if @progress\n\t\t\t\t\t\n\t\t\t\t\[email protected] do |key, digest|\n\t\t\t\t\t\tdigest << buffer\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tmetadata = {}\n\t\t\t\n\t\t\[email protected] do |key, digest|\n\t\t\t\tmetadata[\"key.\" + key] = digest.hexdigest\n\t\t\tend\n\t\t\t\n\t\t\treturn metadata\n\t\tend", "def remote_file_content_same_as?(full_path, content)\n Digest::MD5.hexdigest(content) == capture(\"md5sum #{full_path} | awk '{ print $1 }'\").strip\n end", "def asset_version path\n path = File.expand_path(File.join(public_dir, path))\n md5(path)\n end", "def get_hash(path=\"\")\n Element.get_hash(@element, path)\n end", "def encode(path)\n str = path.split(\"/\").map { |f| h(f) }.join('/')\n return str\n end", "def asset_digest_path(path, options = T.unsafe(nil)); end", "def asset_digest_path(path, options = T.unsafe(nil)); end", "def hash(message)\n return Digest::SHA1.hexdigest(message)\n end", "def digest_path\n if DigestUtils.already_digested?(@name)\n logical_path\n else\n logical_path.sub(/\\.(\\w+)$/) { |ext| \"-#{etag}#{ext}\" }\n end\n end", "def checksum\n\t\t@checksum ||= FileManager.checksum(@path)\n #\t\tif file?\n #\t\t\treturn FileManager.checksum(@path)\n #\t\tend\n end", "def file_digest(path, data = nil)\n if stat = self.stat(path)\n # `data` maybe provided\n if data\n digest.update(data)\n\n # If its a file, digest the contents\n elsif stat.file?\n digest.file(path)\n\n # If its a directive, digest the list of filenames\n elsif stat.directory?\n contents = self.entries(path).join(',')\n digest.update(contents)\n end\n end\n end", "def path_fingerprint(path)\n path[/-([0-9a-f]{8})\\.[^.]+$/, 1]\n end", "def summarize_file path\n \"#<File:#{path} (#{File.size(path)} bytes)>\"\n end", "def getRawFileContents(path)\n rtn = ''\n\n begin\n file = File.open(path, 'r')\n file.each{|line|\n rtn += line.strip() + ' '\n }\n rescue\n return ''\n end\n\n return rtn\nend", "def id(source_file)\n Digest::SHA1.hexdigest(source_file.filename)\n end", "def id(source_file)\n Digest::SHA1.hexdigest(filename(source_file))\n end", "def digest_sha1(*files)\n files.flatten.collect { |file| \n File.exists?(file) ? Digest::SHA1.hexdigest(File.read(file)) : nil\n }\n end", "def path_fingerprint(path)\n path[/-([0-9a-zA-Z]{7,128})\\.[^.]+\\z/, 1]\n end", "def calculate_unique_hash\n unique = ''\n unique += self.content if self.content.present?\n unique += self.summary if self.summary.present?\n unique += self.title if self.title.present?\n self.unique_hash = Digest::MD5.hexdigest unique\n end", "def sha256(options = {})\n required_input_files :path\n required_output_values :sha256\n\n path = input_file(:path)\n\n unless File.exist?(path)\n raise \"path '#{path}' does not exist\"\n end\n \n sha256 = FileHash.sha256(path)\n output_value(:sha256, sha256)\n\n return true\n end", "def cache_filename_for_uri( path )\n uid = Digest::MD5.hexdigest( \"#{@uid}:#{path}\" )\n # NOTE: this path needs to exist with r/w permissions for webserver\n @cache_dir.join( uid )\n end", "def grab_md5_from_file(file_path, cfile)\n Helpers::log(\"Checking #{file_path} for #{cfile} md5sum\")\n if File.exist?(file_path)\n md5 = \"\"\n File.open(file_path).each do |f|\n if /#{cfile}/.match(f)\n md5 = f\n end\n end\n md5\n else\n File.new(file_path,\"w\")\n \"\"\n end\n end", "def dirHash(directory, regexp)\n directory = Pathname.new(directory)\n contents = \"\"\n Dir.foreach(directory) {\n | entry |\n if entry =~ regexp\n contents += IO::read(directory + entry)\n end\n }\n return Digest::SHA1.hexdigest(contents)\nend", "def regenerate_hash\n path = tempfile_path\n unless File.exist?(path)\n path = file_path\n end\n\n unless File.exist?(path)\n errors.add(:file, \"not found\")\n return false\n end\n\n hashes = Moebooru::Hasher.compute(path, [:crc32, :md5])\n\n self.md5 = hashes[:md5]\n self.crc32 = hashes[:crc32]\n end", "def file_digest_key(stat)\n \"file_digest:#{compressed_path}:#{stat}\"\n end", "def job_key\n Digest::MD5.hexdigest(path)\n end", "def script_sha(conn, file_name)\n if (sha = SCRIPT_SHAS.get(file_name))\n return sha\n end\n\n sha = conn.script(:load, script_source(file_name))\n SCRIPT_SHAS.put(file_name, sha)\n sha\n end", "def file_remote_digestmd5(file_name)\n data = read_file(file_name)\n chksum = nil\n if data\n chksum = Digest::MD5.hexdigest(data)\n end\n return chksum\n end", "def computed_sha(string)\n provider.computed_sha(string)\n end", "def hashFromFile(file, auth, algo)\n u = URI::NI.buildFromFile(auth, file, nil, algo)\n type=`file --mime-type #{file}`.split[1]\n u.contentType!(type)\n u\nend", "def hash\n digest = Digest::MD5.new\n digest << title.to_s\n digest << content.join('').to_s\n digest.to_s\n end", "def getfile(md5, client = nil, clientip = nil)\n bucket = Puppet::FileBucket::File.indirection.find(\"md5:#{md5}\")\n contents = bucket.contents\n\n if client\n return Base64.encode64(contents)\n else\n return contents\n end\n end", "def filename\n [Digest::SHA1.hexdigest(file.read),file.extension].join('.') if original_filename\n end", "def full_digest_path\n File.join(@load_path, digest_path)\n end" ]
[ "0.7501175", "0.7312052", "0.7267653", "0.72653913", "0.71541595", "0.71220833", "0.70308334", "0.69989717", "0.696551", "0.6824768", "0.68020064", "0.6737963", "0.6672756", "0.66539884", "0.66484284", "0.66211677", "0.6500485", "0.6477016", "0.64415014", "0.64311135", "0.6420555", "0.6388639", "0.6339466", "0.6339466", "0.63279366", "0.6309092", "0.62820446", "0.62637043", "0.6262444", "0.62345564", "0.6194877", "0.6178829", "0.61760825", "0.616867", "0.6123729", "0.6061167", "0.60593396", "0.60087514", "0.600589", "0.599881", "0.5960069", "0.5955049", "0.593058", "0.5925107", "0.59059834", "0.58929026", "0.5865576", "0.58295274", "0.58165216", "0.5810177", "0.57682484", "0.5764927", "0.5761324", "0.5756659", "0.57432884", "0.57374555", "0.57054365", "0.5689627", "0.5656723", "0.5638893", "0.5637219", "0.5623586", "0.56093276", "0.5607386", "0.560384", "0.5601621", "0.5595635", "0.5572161", "0.55500054", "0.5533381", "0.5522499", "0.55140877", "0.55140877", "0.5511426", "0.55023456", "0.54840803", "0.5460813", "0.5460665", "0.54605705", "0.54403466", "0.5433987", "0.5428619", "0.5424163", "0.54091316", "0.54018843", "0.53767526", "0.53473425", "0.5346805", "0.5330786", "0.5329685", "0.5327313", "0.5325511", "0.53116924", "0.5298396", "0.5292045", "0.52872795", "0.52842677", "0.5267297", "0.52632165", "0.5248205" ]
0.7791914
0
Locate a resource file given it's resource hash.
def find_resource( resource_hash ) return nil unless valid? Dir.glob(File.join(@cache_path, "#{resource_hash}.*")).first end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lookup_file(resource_directory, file)\n file_path = File.join resource_directory, file\n if File.exists?(file_path)\n file_path\n end\n end", "def locate(spec)\n spec = Artifact.to_hash(spec)\n File.join(local, spec[:group].split('.'), spec[:id], spec[:version], Artifact.hash_to_file_name(spec))\n end", "def find(filename)\n find_location filename do |file|\n return File.new file\n end\n end", "def read_file(resource)\n File.read(resource)\n end", "def find_file( path )\n find_files( path ).first\n end", "def find_resource\n get params[:resource_path]\n end", "def load_current_resource\n @current_resource ||= Chef::Resource::Download.new(r.name)\n @current_resource.path(r.path)\n\n if ::File.exist?(@current_resource.path)\n @current_resource.checksum(checksum(@current_resource.path))\n if @current_resource.checksum == r.checksum\n @current_resource.exist = true\n else\n @current_resource.exist = false\n end\n else\n @current_resource.exist = false\n end\n @current_resource\n end", "def find_resource_entry(filename, opts={}, seen=nil)\n extname = File.extname(filename)\n rootname = filename.gsub(/#{extname}$/,'')\n entry_extname = entry_rootname = nil\n\n ret = entries_for(:resource, opts.merge(:hidden => :none)).reject do |entry|\n entry_extname = File.extname(entry.filename)\n entry_rootname = entry.filename.gsub(/#{entry_extname}$/,'')\n\n ext_match = (extname.nil? || extname.size == 0) || (entry_extname == extname)\n !(ext_match && (/#{rootname}$/ =~ entry_rootname))\n end\n\n ret = ret.first\n\n if ret.nil?\n seen = Set.new if seen.nil?\n seen << self\n all_required_bundles.each do |bundle|\n next if seen.include?(bundle) # avoid recursion\n ret = @bundle.find_resource_entry(filename, opts, seen)\n return ret unless ret.nil?\n end\n end\n return ret\n end", "def find filename\n return filename if File.exists? filename\n filename = \"./haml/\"+filename\n return filename if File.exists? filename\n filename = @src_folder+\"/\"+filename\n return filename if File.exists? filename\n throw \"Could not find file: #{filename}\"\nend", "def load_current_resource\n @current_resource ||= Chef::Resource::Download.new(new_resource.name)\n @current_resource.path(new_resource.path)\n\n if ::File.exist?(@current_resource.path)\n @current_resource.checksum(checksum(@current_resource.path))\n if @current_resource.checksum == new_resource.checksum\n @current_resource.exist = true\n else\n @current_resource.exist = false\n end\n else\n @current_resource.exist = false\n end\n @current_resource\n end", "def find(uuid)\n file_path = File.join(@path, uuid+'.plist')\n\n File.new(file_path).read\n end", "def find_resource(resource, &block)\n found = Varnisher::Urls.new\n\n @doc.css(resource.selector).each do |e|\n attribute = e[resource.attribute]\n\n Varnisher.log.debug(\"Found resource: #{attribute}\")\n\n yield attribute if block_given?\n found << attribute\n end\n\n found\n end", "def getfile(sum)\n source_path = \"#{@rest_path}md5/#{sum}\"\n file_bucket_file = Puppet::FileBucket::File.indirection.find(source_path, :bucket_path => @local_path)\n\n raise Puppet::Error, \"File not found\" unless file_bucket_file\n file_bucket_file.to_s\n end", "def find(path); end", "def find(path); end", "def find_resource(type, name, created_at: nil, run_context: self.run_context, &resource_attrs_block)\n find_resource!(type, name, run_context: run_context)\n rescue Chef::Exceptions::ResourceNotFound\n if resource_attrs_block\n declare_resource(type, name, created_at: created_at, run_context: run_context, &resource_attrs_block)\n end # returns nil otherwise\n end", "def lookup_file_path\n file_path_list.each do |candidate_file_path|\n next unless File.file?(File.expand_path(candidate_file_path))\n return candidate_file_path\n end\n nil\n end", "def copy_resource( resource_hash, path )\n # NOTE: the whole caching assumes that two files with the same\n # resource hash contain the same data.\n cache_path = find_resource(resource_hash)\n unless cache_path.nil?\n File.unlink(cache_path)\n end\n\n cache_path = File.join(@cache_path, \"#{resource_hash}#{File.extname(path)}\")\n File.link(path, cache_path)\n\n true\n rescue SystemCallError\n false\n end", "def resolve(logical_path, options = {})\n # If a block is given, preform an iterable search\n if block_given?\n args = attributes_for(logical_path).search_paths + [options]\n trail.find(*args) do |path|\n yield Pathname.new(path)\n end\n else\n resolve(logical_path, options) do |pathname|\n return pathname\n end\n raise FileNotFound, \"couldn't find file '#{logical_path}'\"\n end\n end", "def find_by_path(resource_path)\n idents = resource_path.split(/#/).delete_if {|x| x.blank? }\n return unless ident.eql?(idents.shift)\n return self if idents.empty?\n child = children.select{|r| r.ident == idents.first}.first\n child and child.find_by_path(idents * '#')\n end", "def find_by(id:)\n path = file_path(id)\n storage_object_id, file_category = id_from_path(path)\n\n moab_path = find_moab_filepath(storage_object_id, path, file_category)\n\n Valkyrie::StorageAdapter::File.new(id: Valkyrie::ID.new(id.to_s), io: ::File.open(moab_path, 'rb'))\n rescue ::Moab::FileNotFoundException\n raise Valkyrie::StorageAdapter::FileNotFound\n end", "def resource\n klass, param = resource_class\n klass&.find(params[param.to_sym])\n end", "def find_file_named name\n @files_hash[name]\n end", "def localize_resource(tag, sym, loader, uri, dir, subdir, h, props)\n rel_url = tag[sym]\n src_url = absolute_url_for(uri, rel_url)\n\n buf = download_resource(loader, src_url)\n return if (! buf) or (buf.empty?)\n\n path = path_for_url(dir, subdir, rel_url)\n # Fix for super-long filenames. wikipedia, for example, has these\n if path.length > 256\n path = path_for_url(dir, subdir, rel_url[0,256])\n end\n\n local_ref = ref_path(dir, subdir, path)\n\n # localize tag ref\n tag[sym.to_s] = local_ref\n\n # store remote contents in Hash under path\n h[path] = buf\n # TODO: mime-type?\n props[path] = { :origin => src_url, :relative_path => local_ref }\n end", "def find_resource(request, response)\n if route = find_route(request)\n prepare_resource(route, request, response)\n end\n end", "def find(basename)\n list.include?(basename) ?\n self.read_from_disk(basename) :\n throw('Not Found')\n end", "def find_by(id:)\n return unless handles?(id: id)\n Valkyrie::StorageAdapter::File.new(id: Valkyrie::ID.new(id.to_s), io: ::File.open(file_path(id), 'rb'))\n end", "def find(path, type, setting); end", "def file(path)\n file = opened_crate.dereference(path)\n if file\n file.source\n else\n opened_crate.find_entry(path)\n end\n end", "def find(revision, options = {})\n get_path(\n path_to_find(revision),\n options,\n Tinybucket::Parser::CommitParser\n )\n end", "def find_resource_from_manifest(url)\n components = url.split(\"/\")\n return unless !components.empty? && components.last == \"manifest\"\n id = components[-2]\n find_resource(id)\n end", "def find_matching_file_set(hash_key_for_file)\n filename = Array(params[hash_key_for_curation_concern][hash_key_for_file]).first.original_filename\n curation_concern.file_sets.select {|fs| fs.label == filename }.first\n end", "def resource_path\n '.' + Dir[File.dirname(__FILE__)][/\\/resource\\/.*/]\n end", "def findMappedResource(resources)\n obj=nil\n resources.each { |uri|\n if uri\n case uri.scheme\n when \"file\"\n file=uri.path\n if File.exists?(file)\n obj=File.open(file)\n end\n when \"http\"\n resp=Net::HTTP.get_response(uri)\n obj=resp.body if resp.code==\"200\"\n end\n if obj\n print \"found mapped resource #{uri}\\n\"\n break\n end\n end\n }\n obj\nend", "def find_file(path_info, accept_encoding:); end", "def load_resource_relative(path, mode='r')\n\n absolute_path = File.dirname(caller_locations(1,1)[0].path) + '/' + path\n if absolute_path.to_s.chars.first == ':'\n absolute_path = OpenStudio.get_absolute_path(absolute_path)\n end\n\n if EmbeddedScripting::hasFile(absolute_path)\n return EmbeddedScripting::getFileAsString(absolute_path)\n end\n\n result = \"\"\n if File.exists?(absolute_path)\n File.open(absolute_path, mode) do |file|\n result = file.read\n end\n elsif File.exists?(path)\n File.open(path, mode) do |file|\n result = file.read\n end\n end\n return result\n end", "def object_for_hash(given_hash)\n @opener.open(name, \"r\") do |fp|\n given_hash.force_encoding(\"ASCII-8BIT\") if given_hash.respond_to?(:force_encoding)\n entry = nil\n if index\n starting_at = index.offset_for_hash(given_hash)\n return PackFileEntry.at(starting_at, fp).to_raw_object\n else\n starting_at = cached_offset(given_hash) || DATA_START_OFFSET\n fp.seek(starting_at, IO::SEEK_SET)\n while fp.tell < @end_of_data\n entry = PackFileEntry.read(fp)\n cache_entry(entry)\n return entry.to_raw_object if entry.hash_id == given_hash\n end\n end\n end\n nil\n end", "def find_file path, options = {}\n ensure_connection!\n resp = connection.get_file name, path, options\n if resp.success?\n File.from_gapi resp.data, connection\n else\n fail ApiError.from_response(resp)\n end\n end", "def find_source block, uri\n to_check = [block.document.base_dir]\n checked = []\n\n resources = block.document.attr 'resources'\n if resources and not resources.empty?\n begin\n to_check += CSV.parse_line(resources)\n rescue CSV::MalformedCSVError => error\n logger.error message_with_context \"Error loading [resources]: #{error}\",\n :source_location => block.source_location\n end\n end\n\n while (dir = to_check.shift)\n checked << block.normalize_system_path(uri, dir)\n return checked.last if File.readable? checked.last\n next unless Dir.exist?(dir)\n Dir.new(dir).each { |f|\n next if f == '.' || f == '..'\n f = File.join(dir, f)\n to_check << f if File.directory?(f)\n }\n end\n\n # We'll skip images we can't find but we should log something about it so\n # we can fix them.\n logger.warn message_with_context \"can't read image at any of #{checked}\", :source_location => block.source_location\n nil\n end", "def read_resource(resource, content, extension=\"\")\n path = get_path(resource, extension)\n return File.open(path, 'r')\n end", "def find_location(filename)\n Find.find(path) do |element| \n if element.include? filename\n candidate = Pathname.new(element)\n yield candidate.dirname.to_s\n end \n end\n end", "def lookup_by_path(path, opts = T.unsafe(nil)); end", "def load hash_id\n raise NotFoundError\n end", "def find_a_source_file\n # find a file in source dir with the proper file extension.\n end", "def find_resource(resource_uri, description = {}, opts = {})\n if UUID.validate(resource_uri)\n @resource_class.first(uuid: resource_uri)\n else\n slice = get_context_resource(:slices, opts)\n slice.find_sliver(resource_uri)\n end\n end", "def lookup(path)\n manifest = manifests.detect { |m| m.match?(path) }\n if manifest && (asset = manifest.lookup(path))\n return mount(asset)\n end\n path\n end", "def file(name, version = 'master')\n @file_class.new(self).find(name, version)\n end", "def find(name_or_pointer, opts={})\n pointer = find_file(name_or_pointer, opts)\n return nil unless pointer\n\n @ruhoh.cache.get(pointer['realpath']) ||\n @ruhoh.cache.set(pointer['realpath'], load_model_view(pointer))\n end", "def _get_file(name)\n File.read(\"%s/%s\" % [uri, name])\n end", "def find_file(name)\n path = File.join(TEST_FILES, name)\n raise \"Can't find #{path}\" unless File.exist?(path)\n\n yield path if block_given?\n path\n end", "def resource(path)\n File.expand_path(File.join(staging_resources_path, path))\n end", "def resource(gem_name, path)\n if not loaded? gem_name\n raise PluginNotLoaded.new(\"Plugin #{gem_name} not loaded when getting resource #{path}\")\n end\n\n file = File.join(@gems[gem_name], \"resources\", path)\n\n if File.exist? file\n return file\n else\n return nil\n end\n end", "def resource_get class_name, resource_name\n\t\t\tpath = \"#{class_to_basefile(class_name)}.#{resource_name}\"\n\t\t\tdata, readed = nil, false\n\t\t\tif File.exist? path\n\t\t\t\tdata = File.read path\n\t\t\t\treaded = true\n\t\t\telse\n\t\t\t\tpath = \"#{class_to_basefile(class_name)}.res/#{resource_name}\"\n\t\t\t\tif File.exist? path\n\t\t\t\t\tdata = File.read path\n\t\t\t\t\treaded = true\n\t\t\t\tend\n\t\t\tend\n\t\t\traise Resource::NotExist unless readed\t\t\t\t\t\n\t\t\treturn data\n\t\tend", "def find_entry_by_hash(hash)\n payload = db.get_entry_payload_from_hash(hash)\n return nil unless payload\n ChainEntry.parse_from_payload(payload)\n end", "def find_by_rel(matching_rel)\n resource_templates.select{|resource_template| matching_rel === resource_template.rel}\n end", "def blob_path(relative = true)\n blob_path = File.join(self.class.name, hash.to_s)\n if relative\n blob_path\n else\n File.join(repository_path, blob_path)\n end\n end", "def virtual_path\n\t\tself.class.local_file_path_from_hash( Pathname.new('/managed_file_resource_images/'), self.file_hash ).to_s\n end", "def source filename\n source_hash[filename]\n end", "def file\n @file ||= find_file\n end", "def find(file, report = self)\n current_path = File.join self.path, file\n if File.exist? current_path\n current_path\n else\n if superclass == Object\n raise FileNotFoundError.new file, report\n end\n superclass.find file, report\n end\n end", "def find_s3_file(file_name)\n S3File.find_by_file_name(file_name) if file_name.start_with? self.folder_name\n end", "def lookup_checksum(file)\n @lookup_checksums[file] || calculate_checksum(file)\n end", "def find_requirable_file(file)\n root = full_gem_path\n\n require_paths.each do |lib|\n base = \"#{root}/#{lib}/#{file}\"\n Gem.suffixes.each do |suf|\n path = \"#{base}#{suf}\"\n return path if File.file? path\n end\n end\n\n return nil\n end", "def path_for(name, **options)\n lookup!(name, **options).fetch('file')\n end", "def file(name, version = nil, try_on_disk = false)\n ::Gollum::File.find(self, name, version.nil? ? @ref : version, try_on_disk)\n end", "def find_attachment(resource_id, attachment_id)\n http.get(\"#{attachment_endpoint(resource_id)}/#{attachment_id}\") do |response|\n Rexpense::Entities::Attachment.new response.parsed_body\n end\n end", "def which(template, extension)\n template_with_extension = with_extension(template, extension)\n\n path = absolute_paths.find do |path|\n File.exists?(File.join(path, template_with_extension))\n end\n\n if path\n File.join(path, template_with_extension)\n end\n end", "def find_file(path, future_file_paths)\n return path if File.exist?(path) || Pathname.new(path).absolute?\n modulepath = Bolt::Config::Modulepath.new(config.modulepath)\n modules = Bolt::Module.discover(modulepath.full_modulepath, config.project)\n mod, file = path.split(File::SEPARATOR, 2)\n\n if modules[mod]\n @logger.debug(\"Did not find file at #{File.expand_path(path)}, checking in module '#{mod}'\")\n found = Bolt::Util.find_file_in_module(modules[mod].path, file || \"\", future_file_paths)\n path = found.nil? ? File.join(modules[mod].path, 'files', file) : found\n end\n path\n end", "def find_resource(type, name)\n begin\n return resource_collection.lookup(\"#{type}[#{name}]\")\n rescue Chef::Exceptions::ResourceNotFound; end\n\n resource_collection.all_resources.find do |resource|\n resource_name(resource) == type && (name === resource.identity || name === resource.name)\n end\n end", "def resolve_path_with(resolver)\n @real_path = resolver.resolve(logical_path)\n\n raise ::Sprockets::FileNotFound, \"Couldn't find asset '#{logical_path}'\" if real_path == nil || real_path == ''\n end", "def fetch(resource)\n local_path = \"data/sources/#{resource}.xml\"\n xml = nil\n begin\n if File.exists?(local_path) && File.mtime(local_path) > (Time.now - 300) # More than 5 minutes ago.\n xml = File.read(local_path)\n else\n Timeout.timeout(REQUEST_TIMEOUT) { xml = open(SOURCES[resource]).read }\n File.open(local_path, 'w+') {|f| f.write(xml) }\n end\n rescue Timeout::Error, OpenURI::HTTPError => e\n xml = File.read(local_path) if File.exists? local_path\n end\n raise \"Could not fetch #{resource}\" unless xml\n Hpricot xml\n end", "def lookup(base_path, relative_path, options={})\n exts = default_file_extensions\n if options[:load] or exts.include?(File.extname(relative_path))\n abspath = File.join(base_path, relative_path)\n File.exist?(abspath) ? abspath : nil\n else\n exts.each do |ext|\n abspath = File.join(base_path, relative_path + ext)\n return abspath if File.exist?(abspath)\n end\n nil\n end\n end", "def url_for_file(filename, anchor = T.unsafe(nil)); end", "def resource_path(resource)\n \"#{test_dir}/#{resource}\"\n end", "def calculated_checksum\n send(\"#{@resource[:checksum_type]}_file\".to_sym, @resource[:path]) \n end", "def file() = pathname.relative_path_from(Cnfs.config.paths.definitions)", "def find_file_path(filename)\n filepath=\"#{ENV['IMPORT_PATH']}/#{filename}\"\n #filepath = Dir.glob(\"#{ENV['IMPORT_PATH']}/#{filename}\").first\n raise \"Cannot find file #{filename}... Are you sure it has been uploaded and that the filename matches?\" if filepath.nil?\n filepath\n end", "def remote_file_resource\n Chef::Log.info \"Remote file: #{file_location}\"\n Chef::Log.info \"Local file: #{new_resource.name}\"\n @remote_file_resource ||= remote_file new_resource.name do\n source file_location\n checksum new_resource.checksum if !new_resource.checksum.nil?\n owner new_resource.owner\n group new_resource.group\n backup false\n action :nothing\n end\nend", "def compare(file_path, hash_class, _bit_size, hash)\n # Check if the file exists\n ## \"file_state\" if the result of the compared hash and file\n if File.file? file_path\n # Always try to check file permissions\n begin\n # When the file is not corrupted\n if checksum(file_path, hash_class, _bit_size) == hash\n file_state = \"SECURE ------------ \"\n else\n # When the file is corrupted\n file_state = \"CORRUPTED --------- \"\n end\n rescue => error\n puts error\n # When we can't access to it\n file_state = \"ACCESSDENIED --- \"\n end\n else\n # When we can't find the file with the path provided\n # Usually the file was deleted but also returns it can be moved\n file_state = \"NOTEXISTS/MOVED - \"\n end\n puts \"#{file_state}#{file_path}\"\nend", "def find_resource(resource_id)\n query_service.find_by(id: Valkyrie::ID.new(resource_id))\n end", "def find(spec, options = {})\n get_path(path_to_find(spec), options)\n end", "def find(path)\n path = full_path(path)\n page_blob = find_blob(path)\n raise MissingResource unless page_blob\n new(page_blob, path)\n end", "def initialize(relativePath, hash)\n #N Without this, we won't rememeber the relative path value\n @relativePath = relativePath\n #N Without this, we won't remember the file's cryptographic hash of its contents\n @hash = hash\n end", "def link_target(name, resource)\n read(name, resource) do |file|\n if file.header.typeflag == \"2\"\n return File.absolute_path(file.header.linkname,File.dirname(resource))\n end\n return nil\n end\n return nil\n end", "def get_cache_file(key)\n _find_file_key(key)\n end", "def file_contents(full_path)\n\t\t::File.read(full_path)\n\trescue Errno::ENOENT\n\t\traise Rush::DoesNotExist, full_path\n\tend", "def file_contents(full_path)\n\t\t::File.read(full_path)\n\trescue Errno::ENOENT\n\t\traise Rush::DoesNotExist, full_path\n\tend", "def file_report(file_hash)\n FileScanReport.new(api_key: @api_key, resource: file_hash).response\n end", "def file_matching_path\n !!container.stored_files.where(file_name: file_name, path: path).first\n end", "def locate_image(partial_filename, path = absolute_images_path)\n # Strips integerprefix_es and slashes\n partial_filename = strip_prefix_and_slashes(partial_filename)\n return partial_filename if File.exists?(File.join(path, partial_filename))\n Find.find(path) do |f|\n # Strip search path from file path to get file\n filename = f.gsub(path, '')\n unless filename.nil? || filename.match(/^\\..*$/)\n if filename.match(/\\.(jpg|jpeg|png|gif|JPG|JPEG|PNG|GIF)$/)\n if filename.match(partial_filename)\n # Strip slashes\n return filename.gsub(/\\//,'')\n end\n end\n end\n end\n return partial_filename\n end", "def get_file(path)\n raise FileNotFoundError.new(path) unless @files[path]\n \n return Chance.get_file(@files[path])\n end", "def find_header_file(header)\n filename = nil\n header_include_paths.each do |path|\n maybe_filename = \"#{path}/#{header}\"\n if File.exists?(maybe_filename)\n filename = maybe_filename\n break\n end\n end\n filename\nend", "def findFile(file)\n file = file.to_s\n\n # check if absolute and exists\n if Pathname.new(file).absolute?\n if File.exist?(file)\n return OpenStudio::OptionalPath.new(OpenStudio.toPath(file))\n end\n\n # absolute path does not exist\n return OpenStudio::OptionalPath.new\n end\n\n absoluteFilePaths.each do |file_path|\n result = File.join(file_path.to_s, file)\n if File.exist?(result)\n return OpenStudio::OptionalPath.new(OpenStudio.toPath(result))\n end\n end\n OpenStudio::OptionalPath.new\n end", "def file_path\n @file_path ||= lookup_file_path\n end", "def find(pathname, options={})\n options = options.rekey\n\n from, path = File.split_root(pathname)\n\n if absolute_path = Utils.absolute_path?(pathname)\n return absolute_path\n end\n\n # TODO: Should `-I` locations be searched first? What about ENV['RUBYLIB'] locations?\n\n library = current(from)\n\n if library\n file = library.find(pathname, options)\n else\n # TODO: Is searching all of $LOAD_PATH too much?\n file = Utils.find_path($LOAD_PATH, pathname, options)\n end\n\n file\n end", "def find_asset(filename)\n path = \"\"\n if Rails.application.assets\n Rails.application.assets.find_asset(filename).pathname\n else\n Rails.application.assets_manifest.assets.each do |f,p|\n if File.basename(f) == filename\n path = p\n end\n end\n path.blank? ? nil : File.join(Rails.public_path, 'assets', path)\n end\n end", "def find_file_named name\n @store.find_file_named name\n end", "def find_file_named(name)\n top_level.class.find_file_named(name)\n end", "def find(id)\n code, data = @session.get(element_path(id) + '.json')\n if code == 200\n key = @resource.name.to_s.split('::').last.downcase\n @resource.new(data[key].merge(:session =>@session))\n elsif code == 404\n raise ResourceNotFound\n end\n end", "def get_entry(path, commit = @commit)\n entry_hash = get_entry_hash(path, commit)\n if entry_hash.nil?\n entry = nil\n else\n entry = @repo.lookup(entry_hash[:oid])\n end\n entry\n end" ]
[ "0.65337414", "0.610796", "0.60067755", "0.5930381", "0.59193987", "0.58928114", "0.58445406", "0.58109325", "0.5767511", "0.565055", "0.5646835", "0.5601913", "0.5583527", "0.5553507", "0.5553507", "0.554553", "0.5500834", "0.5497419", "0.54793996", "0.54537815", "0.5435223", "0.54306394", "0.5429245", "0.54289746", "0.5397312", "0.5357542", "0.5353067", "0.53072804", "0.53059924", "0.53034776", "0.5241199", "0.5226416", "0.5223991", "0.5219864", "0.5215444", "0.5200199", "0.5196607", "0.51930636", "0.5170932", "0.51632917", "0.51564074", "0.5145603", "0.51428306", "0.5137554", "0.51342136", "0.5129453", "0.5129187", "0.51184136", "0.5117561", "0.51057726", "0.5101401", "0.50995314", "0.5065025", "0.5061217", "0.50456166", "0.50433654", "0.5041344", "0.5040183", "0.50393873", "0.50382036", "0.50370187", "0.50343126", "0.5026613", "0.50084037", "0.50064486", "0.49995965", "0.49992636", "0.49985054", "0.4996949", "0.4996289", "0.49961403", "0.49924475", "0.49856955", "0.4985123", "0.49842158", "0.49791905", "0.4977933", "0.49772918", "0.49769676", "0.49751163", "0.49674127", "0.49644136", "0.49570146", "0.49544504", "0.49540633", "0.49508238", "0.49508238", "0.4948202", "0.4948015", "0.49456245", "0.49404553", "0.49371716", "0.49297777", "0.49293503", "0.49218765", "0.4918091", "0.49128872", "0.49120757", "0.4900483", "0.4899878" ]
0.7689201
0
Copy the file at +path+ into the cache using +resource_hash+ as the storage id. Internally the cache will be checked for an existing file matching +resource_hash+. If found this file will first be unlinked. Following this check a hardlink between the cache file and the original located at +path+ is created.
def copy_resource( resource_hash, path ) # NOTE: the whole caching assumes that two files with the same # resource hash contain the same data. cache_path = find_resource(resource_hash) unless cache_path.nil? File.unlink(cache_path) end cache_path = File.join(@cache_path, "#{resource_hash}#{File.extname(path)}") File.link(path, cache_path) true rescue SystemCallError false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cache_resource( path )\n resource_hash = compute_hash(path)\n return true if find_resource(resource_hash)\n\n copy_resource(resource_hash, path)\n end", "def cache_file(file)\n FileUtils.cp(file, path)\n end", "def copy_file(file_id, destination)\n synchronize do\n if cached?(file_id)\n source = File.join(@cache_root, Utils.fileid2name(file_id))\n FileUtils.cp(source, destination)\n \n if File.exist?(destination)\n @cached_files[file_id].last_copy = DateTime::now\n else\n message = \"Cache: Unable to copy file '#{source}' to '#{destination}'.\"\n @logger.error(message) if @logger\n raise message\n end\n else\n message = \"Cache: File with id #{file_id} does not exist in cache.\"\n @logger.error(message) if @logger\n raise message\n end\n end\n end", "def find_resource( resource_hash )\n return nil unless valid?\n\n Dir.glob(File.join(@cache_path, \"#{resource_hash}.*\")).first\n end", "def put(src, uri)\n # prepare cache path\n path = prepare_cache_path\n\n # move the file from the working directory to cache\n FileUtils.mv(src, path)\n\n # make a symbolic link from original location to the cache\n FileUtils.symlink(path, src)\n\n # copy from cache to the resource file\n @table[uri.to_s] = path\n Resource[uri].link_from(path)\n end", "def save_file(file_id, source)\n synchronize do\n unless cached?(file_id)\n destination = File.join(@cache_root, Utils.fileid2name(file_id))\n FileUtils.cp(source, destination)\n \n if File.exist?(destination)\n cached_file = CachedFile.new\n cached_file.filename = File.basename(source)\n cached_file.last_copy = DateTime::now\n \n @cached_files[file_id] = cached_file\n else\n message = \"Cache: Unable to copy file with id #{file_id}.\"\n @logger.error(message) if @logger\n raise message\n end\n end\n end\n end", "def cached_file(source, checksum = nil)\n if source =~ %r{^(file|ftp|http|https):\\/\\/}\n uri = as_uri(source)\n cache_file_path = \"#{Chef::Config[:file_cache_path]}/#{::File.basename(::CGI.unescape(uri.path))}\"\n Chef::Log.debug(\"Caching a copy of file #{source} at #{cache_file_path}\")\n\n remote_file cache_file_path do\n source source\n backup false\n checksum checksum unless checksum.nil?\n end\n else\n cache_file_path = source\n end\n\n Chef::Util::PathHelper.cleanpath(cache_file_path)\n end", "def write_cache(resource, content)\n expanded_path = cache_path_for(resource)\n return false unless expanded_path\n FileUtils.mkdir_p(File.dirname(expanded_path))\n @logger.info(self.class) { \"Caching #{content.length} B for #{resource}\" }\n File.write(expanded_path, content)\n end", "def compile_asset_from_cache(asset_path, &block)\n # TODO(philc): We should not check the file's md5 more than once when we're running in production mode.\n contents = File.read(asset_path)\n md5 = Digest::MD5.hexdigest(contents)\n cached_asset = $compiled_cache[asset_path]\n if md5 != cached_asset[:md5]\n cached_asset[:contents] = block_given? ? block.yield(asset_path) : File.read(contents)\n cached_asset[:md5] = md5\n end\n cached_asset[:contents]\n end", "def cache(input_path, output_path, data=nil)\n path = input_path\n @new_hashes[input_path] = hash(@input_directory, input_path)\n\n if data\n @data[path] = data if data\n @wildcard_dependencies[path] = data[:wildcard_dependencies] if data[:wildcard_dependencies]\n @dependencies[path] = data[:dependencies] if data[:dependencies]\n end\n\n FileUtils.mkdir_p(File.dirname(cached_path_for(path)))\n\n if File.exist? File.join(@output_directory, output_path)\n FileUtils.cp(File.join(@output_directory, output_path), cached_path_for(path))\n else\n FileUtils.cp(File.join(@input_directory, input_path), cached_path_for(input_path))\n end\n end", "def copy!(new_path)\n if exists?\n FileUtils.cp(path, new_path) unless new_path == path\n else\n File.open(new_path, \"wb\") { |f| f.write(read) }\n end\n end", "def hash_file path, hash_store\r\n\thexdigest = HASH_DIGEST.hexdigest(open(path, 'rb') { |io| io.read })\r\n\thash_store[hexdigest] << path\r\nend", "def cache_resource(dest_dir=@local_cache_dir, options={})\n unless dest_dir\n raise ArgumentError, \"Must specify destination directory when creating resource\", caller\n end\n self.local_cache_dir=dest_dir\n @size = update_cache(@url, @local_path, options)\n if options[:include_pack_gz]\n @relative_local_path_pack_gz = \"#{@relative_local_path}.pack.gz\"\n @local_path_pack_gz = \"#{dest_dir}/#{@relative_local_path_pack_gz}\"\n @size_pack_gz = update_cache(@url_pack_gz, @local_path_pack_gz, options)\n end\n @signature_verified ? @size : @signature_verified\n end", "def sync_file_resource(resource, version)\n fetch_resource(resource, version) do |download_file|\n # move downloaded file to its place in data dir\n # ex: data/tenant1/automatortype/chef-solo/roles/cluster.json/1/cluster.json\n data_file = %W(#{@datadir} #{resource} #{version} #{resource.split('/')[-1]}).join('/')\n log.debug \"storing fetched file #{download_file} into data dir: #{data_file}\"\n # set file permissions if specified\n if @resourcespec.resource_permissions.key?(resource) && [email protected]_permissions[resource].nil?\n log.debug \"setting file permissions #{@resourcespec.resource_permissions[resource]}\"\n octal_mode = @resourcespec.resource_permissions[resource].to_i(8)\n FileUtils.chmod octal_mode, download_file\n end\n FileUtils.mkdir_p(File.dirname(data_file))\n FileUtils.mv(download_file, data_file)\n end\n end", "def store(from, path = nil)\n return unless @cache_base\n\n path ||= from\n clear path\n copy from, (@cache_base + path)\n end", "def update_cache(source=@url, destination=@local_path, options={})\n unless destination\n raise ArgumentError, \"Must specify destination directory when updatng resource\", caller\n end\n file_exists = File.exists?(destination)\n if file_exists && @signature_verified == nil\n verify_signature\n end\n unless file_exists && @signature_verified\n FileUtils.mkdir_p(File.dirname(destination))\n puts \"reading: #{source}\" if options[:verbose]\n tried_to_read = 0\n begin\n jarfile = open(source)\n rescue OpenURI::HTTPError => e\n puts e\n if tried_to_read < 1\n tried_to_read += 1\n retry\n end\n end\n if jarfile.class == Tempfile\n FileUtils.cp(jarfile.path, destination)\n puts \"copying to: #{destination}\" if options[:verbose]\n else\n File.open(destination, 'w') {|f| f.write jarfile.read }\n puts \"writing to: #{destination}\" if options[:verbose]\n end\n puts \"#{jarfile.size} bytes written\" if options[:verbose]\n verify_signature ? jarfile.size : false\n else\n File.size(destination)\n end\n end", "def send_resource(path)\n path = resource_path(path)\n begin\n mtime = path.mtime\n rescue Errno::ENOENT\n send_not_found \"Resource not found: #{path}\"\n return\n end\n check_last_modified(path.mtime) {\n path.open {|f|\n @response_body << f.read\n }\n }\n end", "def cache_path_for(resource)\n return false unless @cache_dir\n return false unless Dir.exist?(@cache_dir)\n # sanity check the resource\n return false unless resource && !resource.empty?\n # don't use URL params\n resource = resource.split('?', 2)[0]\n # join and expand the path\n expanded_path = File.expand_path(File.join(@cache_dir, resource))\n # don't allow requests to read outside the given cache directory\n # (eg: resource = '../../../../tmp/foo.txt')\n return false unless expanded_path.start_with?(@cache_dir)\n expanded_path\n end", "def add_hash(id, hash, source)\n @hashes[id] = {:deletehash => hash, :source => source, :stamp => Time.now}\n end", "def fetch_local(new_dest, fetch_if_missing = true)\n if !File.exists? @repo.cache_path\n if fetch_if_missing\n fetch\n else\n raise \"Source cache #{@repo.cache_path} not readable.\"\n end\n end\n FileUtils.cp_r @repo.cache_path, new_dest\n end", "def populate_cache_path(container)\n cache_path.run_action(:create)\n\n r = Chef::Resource::File.new(::File.join(new_resource.cache_path, 'cid'), run_context)\n r.content(container.id)\n r.run_action(:create)\n end", "def copy_over_cache_files\n FileUtils.cp_r \"#{@cache}/.\", @path\n end", "def copy_remote_shared_cache_to_release_path\n logger.debug \"Copying the remote shared cache to release path\"\n run \"mkdir -p #{configuration[:release_path]} && cp -RPp #{revision_cache_dir}/* #{configuration[:release_path]}\"\n end", "def cache_file_path\n raise IOError.new 'Write permission is required for cache directory' unless File.writable?(@args[:cache_directory])\n \"#{@args[:cache_directory]}/#{Digest::SHA1.hexdigest((@args[:cache_ref] || @path).to_s + size.to_s + last_modified.to_s)}.cache\"\n end", "def resource(path, &block)\n raise \"Resource path cannot be nil\" if path.nil?\n (@path_parts ||= []) << path\n block.call\n @path_parts.pop\n end", "def compute_hash( path )\n res = '0'\n autorelease_pool { res = NSData.sha1FromContentsOfFile(path) }\n res\n end", "def copy_to_local srcpath, dstpath\n src_bucket = bucket(srcpath)\n src_key_path = key_path(srcpath)\n dstfile = File.new(dstpath, 'w')\n @s3.interface.get(src_bucket, src_key_path) do |chunk|\n dstfile.write(chunk)\n end\n dstfile.close\n end", "def file(path, *args)\n return file_via_connection(path, *args) unless cache_enabled?(:file)\n\n @cache[:file][path] ||= file_via_connection(path, *args)\n end", "def compare(file_path, hash_class, _bit_size, hash)\n # Check if the file exists\n ## \"file_state\" if the result of the compared hash and file\n if File.file? file_path\n # Always try to check file permissions\n begin\n # When the file is not corrupted\n if checksum(file_path, hash_class, _bit_size) == hash\n file_state = \"SECURE ------------ \"\n else\n # When the file is corrupted\n file_state = \"CORRUPTED --------- \"\n end\n rescue => error\n puts error\n # When we can't access to it\n file_state = \"ACCESSDENIED --- \"\n end\n else\n # When we can't find the file with the path provided\n # Usually the file was deleted but also returns it can be moved\n file_state = \"NOTEXISTS/MOVED - \"\n end\n puts \"#{file_state}#{file_path}\"\nend", "def add(from, path = nil)\n return unless @cache_base\n\n path ||= from\n copy from, (@cache_base + path)\n end", "def install\n if cached?\n # Update and checkout the correct ref\n Dir.chdir(cache_path) do\n hg %|pull|\n end\n else\n # Ensure the cache directory is present before doing anything\n FileUtils.mkdir_p(cache_path)\n\n Dir.chdir(cache_path) do\n hg %|clone #{uri} .|\n end\n end\n\n Dir.chdir(cache_path) do\n hg %|update --clean --rev #{revision || ref}|\n @revision ||= hg %|id -i|\n end\n\n # Gab the path where we should copy from (since it might be relative to\n # the root).\n copy_path = rel ? cache_path.join(rel) : cache_path\n\n begin \n # Validate the thing we are copying is a Chef cookbook\n validate_cached!(copy_path)\n\n # Remove the current cookbook at this location (this is required or else\n # FileUtils will copy into a subdirectory in the next step)\n FileUtils.rm_rf(install_path)\n\n # Create the containing parent directory\n FileUtils.mkdir_p(install_path.parent)\n\n # Copy whatever is in the current cache over to the store\n FileUtils.cp_r(copy_path, install_path)\n\n ensure\n\n # Remove the .hg directory to save storage space\n # TODO this can have huge performance implications, \n # make it a config option?\n if (hg_path = install_path.join('.hg')).exist?\n FileUtils.rm_r(hg_path)\n end\n\n FileUtils.rm_rf (copy_path)\n end\n end", "def build_asset(path, pathname, options)\n # Memory cache\n key = cache_key_for(pathname, options)\n if @assets.key?(key)\n @assets[key]\n else\n @assets[key] = begin\n # Persisted cache\n cache_asset(key) do\n super\n end\n end\n end\n end", "def checksum(file_path, hash_class, _bit_size)\n # Size of each chunk\n chunk_size = 2048\n # Hash that is the checksum function\n # when a bitsize was specified\n if _bit_size\n hash = hash_class.new(_bit_size)\n else\n hash = hash_class.new\n end\n # File handler\n file_object = File.open(file_path, 'r')\n # loop to update the hash\n while true\n content = file_object.read chunk_size\n # Break the loop if we don't get any byte\n unless content\n return hash.hexdigest\n end\n # Update the hash\n hash.update content\n end\nend", "def load_current_resource\n @current_resource ||= Chef::Resource::Download.new(new_resource.name)\n @current_resource.path(new_resource.path)\n\n if ::File.exist?(@current_resource.path)\n @current_resource.checksum(checksum(@current_resource.path))\n if @current_resource.checksum == new_resource.checksum\n @current_resource.exist = true\n else\n @current_resource.exist = false\n end\n else\n @current_resource.exist = false\n end\n @current_resource\n end", "def cache_for(bundle_path, variant)\n key = [\"#{bundle_path}.scss\", variant].join(CONFIG['manifest_key_seperator'])\n fingerprint = combined_checksums[key]\n raise \"Fingerprint not found. #{bundle_path} #{variant}\" unless fingerprint\n fingerprint\n end", "def update_cache\n Rails.logger.debug \"Updating cache for... #{@@cache_file}\"\n fp = File.new(@@cache_file, 'w')\n if fp\n # acquire an exclusive lock (writer)\n if fp.flock(File::LOCK_EX)\n content = open(@@file_path).read\n \n if content\n #logger.debug \"Generate cache file: #{@@cache_file}\"\n fp.write(content) # writes to the file\n end\n \n fp.flock(File::LOCK_UN) # release a lock\n end\n fp.close\n end\n end", "def update\n return unless @hash\n begin\n lockf = File.open(@path+\".lock\", File::CREAT|File::RDWR, 0600)\n lockf.flock File::LOCK_EX\n f = File.open(@path+\".new\", File::CREAT|File::TRUNC|File::WRONLY, 0600)\n for k,v in @hash\n f.printf \"%s=%s\\n\", CGI.escape(k), CGI.escape(String(Marshal.dump(v)))\n end\n f.close\n File.rename @path+\".new\", @path\n ensure\n f&.close\n lockf&.close\n end\n end", "def put_hash(name, hash)\n file_name = File.join(@db_dir, name + '.json')\n begin\n RobustFile.write(file_name, hash.to_json)\n rescue IOError => e\n PEROBS.log.fatal \"Cannot write hash file '#{file_name}': #{e.message}\"\n end\n end", "def fetch_dynamic_asset(path)\n return yield unless cache_dynamic_assets\n\n mtime = File.mtime(path)\n cached_mtime, contents = @dynamic_asset_cache[path]\n\n if cached_mtime.nil? || mtime != cached_mtime\n @dynamic_asset_cache[path] = [mtime, yield]\n @dynamic_asset_cache[path][1]\n else\n contents\n end\n end", "def clear!(resource)\n @cache.delete(resource)\n end", "def store_resource(resource)\n @@resources[resource.name.to_sym] = resource\n resource\n end", "def copy_file(source_file, destination_file, version)\n # add new filename to existing digest in current state.\n # If destination file already exists, overwrite it.\n existing_files = get_files(version)\n\n if existing_files.key?(destination_file)\n delete_file(destination_file, version)\n end\n # should NOT call add_file, as add_file updates the manifest.\n # Should instead JUST update current state with new filepath.\n digest = get_digest(source_file, version) # errors out if source_file not found in current state\n\n my_state = get_state(version)\n my_files = my_state[digest]\n my_files << destination_file\n unique_files = my_files.uniq # Just in case we're trying to add the same thing multiple times.\n # Need to actually add this to @versions!\n @versions[OcflTools::Utils.version_int_to_string(version)]['state'][digest] = unique_files\n # Prove we actually added to state\n get_state(version)\n # self.add_file(destination_file, self.get_digest(source_file, version), version)\n end", "def calculated_checksum\n send(\"#{@resource[:checksum_type]}_file\".to_sym, @resource[:path]) \n end", "def copy_to_local srcpath, dstpath\n src_bucket,src_key_path = split_path(srcpath)\n dstfile = File.new(dstpath, 'w')\n @s3.interface.get(src_bucket, src_key_path) do |chunk|\n dstfile.write(chunk)\n end\n dstfile.close\n end", "def update_new_file_state(path=@new_resource.path)\n if !::File.directory?(path) \n @new_resource.checksum(checksum(path))\n end\n\n if Chef::Platform.windows?\n # TODO: To work around CHEF-3554, add support for Windows\n # equivalent, or implicit resource reporting won't work for\n # Windows.\n return\n end\n\n acl_scanner = ScanAccessControl.new(@new_resource, @new_resource)\n acl_scanner.set_all!\n end", "def copy_from_local srcpath, destpath\n bucket,key = split_path(destpath)\n if File.exists?(srcpath)\n if File.directory?(srcpath)\n raise \"NotYetImplemented\"\n else\n @s3.interface.put(bucket, key, File.open(srcpath))\n end\n else\n raise Errno::ENOENT, \"No such file or directory - #{srcpath}\"\n end\n end", "def temporary_path(path)\n src = source_path(path)\n dst = temporary_unique_path(path)\n FileUtils.mkdir_p File.dirname(dst)\n FileUtils.cp src, dst\n dst\n end", "def symlink(guest_path, bucket_path = \"/tmp/vagrant-cache/#{@name}\")\n return if @env[:cache_dirs].include?(guest_path)\n\n @env[:cache_dirs] << guest_path\n comm.execute(\"mkdir -p #{bucket_path}\")\n unless symlink?(guest_path)\n comm.sudo(\"mkdir -p `dirname #{guest_path}`\")\n if empty_dir?(bucket_path) && !empty_dir?(guest_path)\n # Warm up cache with guest machine data\n comm.sudo(\"shopt -s dotglob && mv #{guest_path}/* #{bucket_path}\")\n end\n comm.sudo(\"rm -rf #{guest_path}\")\n comm.sudo(\"ln -s #{bucket_path} #{guest_path}\")\n end\n end", "def load_current_resource\n @current_resource ||= Chef::Resource::Download.new(r.name)\n @current_resource.path(r.path)\n\n if ::File.exist?(@current_resource.path)\n @current_resource.checksum(checksum(@current_resource.path))\n if @current_resource.checksum == r.checksum\n @current_resource.exist = true\n else\n @current_resource.exist = false\n end\n else\n @current_resource.exist = false\n end\n @current_resource\n end", "def cache!(io, phase:)\n cache.upload(io, context.merge(phase: phase))\n end", "def cache_path(uri:, path:)\n return if File.exist?(path)\n\n WebMock.disable!\n development_config = Figgy.all_environment_config[\"development\"]\n client = ArchivesSpace::Client.new(\n ArchivesSpace::Configuration.new(\n base_uri: development_config[\"archivespace_url\"],\n username: development_config[\"archivespace_user\"],\n password: development_config[\"archivespace_password\"]\n )\n )\n client.login\n result = client.get(uri)\n FileUtils.mkdir_p(Pathname.new(path).dirname)\n File.open(path, \"w\") do |f|\n f.write(result.body)\n end\n WebMock.enable!\n end", "def cache_filename_for_uri( path )\n uid = Digest::MD5.hexdigest( \"#{@uid}:#{path}\" )\n # NOTE: this path needs to exist with r/w permissions for webserver\n @cache_dir.join( uid )\n end", "def hash_path(hash, *path)\n path.inject(hash) { |hash, key| hash[key] if hash }\n end", "def resource(path)\n File.expand_path(File.join(staging_resources_path, path))\n end", "def delete(resource, key)\n @cache[resource].delete(key)\n end", "def version_for_cache\n \"path:#{source_path}|shasum:#{destination_shasum}\"\n end", "def initialize(relativePath, hash)\n #N Without this, we won't rememeber the relative path value\n @relativePath = relativePath\n #N Without this, we won't remember the file's cryptographic hash of its contents\n @hash = hash\n end", "def sync_file(file)\n cache_filename = File.join(\"cookbooks\", file.cookbook.name, file.manifest_record[\"path\"])\n mark_cached_file_valid(cache_filename)\n\n # If the checksums are different between on-disk (current) and on-server\n # (remote, per manifest), do the update. This will also execute if there\n # is no current checksum.\n if !cached_copy_up_to_date?(cache_filename, file.manifest_record[\"checksum\"])\n download_file(file.manifest_record[\"url\"], cache_filename)\n @events.updated_cookbook_file(file.cookbook.name, cache_filename)\n else\n Chef::Log.trace(\"Not storing #{cache_filename}, as the cache is up to date.\")\n end\n\n # Load the file in the cache and return the full file path to the loaded file\n cache.load(cache_filename, false)\n end", "def add_content(checksum, path)\n Log.debug2(\"Try to add content:%s to copy waiting list\", checksum)\n @keeper.synchronize{\n # if content is being copied or waiting then skip it\n if !@contents_under_copy[checksum]\n if !@contents_to_copy[checksum]\n if @contents_under_copy.size < @max_contents_under_copy\n @contents_under_copy[checksum] = [path, false, Time.now]\n $process_vars.set('contents under copy', @contents_under_copy.size)\n @copy_input_queue.push([:SEND_ACK_MESSAGE, checksum])\n $process_vars.set('Copy File Queue Size', @copy_input_queue.size)\n else\n # no place in copy streams. Add to waiting list\n Log.debug2(\"add content:%s to copy waiting list\", checksum)\n @contents_to_copy[checksum] = true # replace with a set\n @contents_to_copy_queue.push([checksum, path])\n $process_vars.set('contents to copy queue', @contents_to_copy_queue.size)\n end\n else\n Log.debug2(\"content:%s already in waiting list. skipping.\", checksum)\n end\n else\n Log.debug2(\"content:%s is being copied. skipping.\", checksum)\n end\n }\n end", "def duplicate_resource(resource)\n resource.dup\n end", "def write_cache(cache, path)\n if @use_cache then\n File.open path, \"wb\" do |cache_file|\n Marshal.dump cache, cache_file\n end\n end\n\n cache\n rescue Errno::EISDIR # HACK toplevel, replace with main\n cache\n end", "def force(path)\n cache[path] = true\n end", "def hash\n @hash ||= @client.get_hash(path)\n @hash\n end", "def hash\n @hash ||= @client.get_hash(path)\n @hash\n end", "def cache_path\n return @cache_resources unless @cache_resources.nil?\n\n @cache_resources = Chef::Resource::Directory.new(::File.join(new_resource.cache_path), run_context)\n @cache_resources.recursive(true)\n\n return @cache_resources\n end", "def copy_static_file(path, new_path = false)\n # puts \"Installing #{path}...\".magenta\n new_path = path unless new_path\n remove_file new_path\n file new_path, File.read(File.join(@static_files, path))\n # puts \"\\n\"\nend", "def store_path_assets(path, assets)\n return if assets.empty?\n redis.sadd path_assets_key(path), assets\n end", "def cache(file_obj, data_result, url, username, password)\n data_result[:uuid] = UUID.generate\n key = generate_key url, username, password\n\n begin\n data_result[:data_tmp_path] = store_data_to_tmp file_obj, data_result[:uuid]\n data_result[:time_stored] = Time.now\n @@file_cache[key] = data_result\n rescue Exception => e\n @@file_cache[key] = nil\n end\n end", "def create_resource id, url, hash\n # TODO\n page = resource_page id\n if is_url? url\n create_new_archive page, url, hash\n end\n content = 'TODO'\n write! page, content\n end", "def hash_path(hash, *path)\n path.inject(hash) { |hash, key| hash[key] if hash }\n end", "def cache_path\n Pathname.new(File.expand_path(File.join(ChefCLI::Helpers.package_home, \"cache\")))\n .join(\".cache\", \"git\", Digest::SHA1.hexdigest(uri))\n end", "def cache_copy(from,to)\n return unless @cache_base\n\n copy(@cache_base + from, @cache_base + to)\n end", "def copy(path)\n source_path = Pathname.new(path)\n target_path = @directory + path\n @writer.copy(source_path, target_path)\n end", "def cache_path\n File.join @path, 'cache.ri'\n end", "def get(uri)\n # check cached or not\n unless @table.has_key?(uri)\n # prepare cache path\n path = prepare_cache_path\n\n # link the resource file to cache path\n Resource[uri].link_to(path)\n @table[uri.to_s] = path\n end\n\n return @table[uri.to_s]\n end", "def regenerate_hash\n path = tempfile_path\n unless File.exist?(path)\n path = file_path\n end\n\n unless File.exist?(path)\n errors.add(:file, \"not found\")\n return false\n end\n\n hashes = Moebooru::Hasher.compute(path, [:crc32, :md5])\n\n self.md5 = hashes[:md5]\n self.crc32 = hashes[:crc32]\n end", "def cache_path\n @cache_path ||= Pathname.new(Berkshelf.berkshelf_path).join('.cache', 'halite', dependency.name)\n end", "def get_file(path)\n remove_file path\n resource = File.join(TEMPLATE_HOST, TEMPLATE_BRANCH, 'files', path)\n create_file path, download_resource(resource)\nend", "def checksum(path)\n FileChecksum.new(path, Digest::SHA1).checksum\n end", "def cache(uri, obj)\n filename=cacheFileName(uri)\n print(\"Creating #{filename}\\n\")\n File.open(filename, 'w') {|f| f.write(obj) }\nend", "def fetch(storage_path, local_path)\n super\n FileUtils.cp absolute_path(storage_path), local_path\n end", "def save\n Chef::FileCache.store(\"remote_file/#{sanitized_cache_file_basename}\", json_data)\n end", "def copy_static_file(path)\n puts \"Installing #{path}...\".yellow\n remove_file path\n file path, File.read(File.join(@static_files, path))\nend", "def set_file_for_remote_storage\n set_resource_mounter_file open(original_resource_mounter.url)\n end", "def path(resource, &block)\n if block\n path_object = Skeleton::Path.new\n yield(path_object)\n paths[resource] = path_object\n else\n paths[resource]\n end\n end", "def update_file(file_data)\n sha = file_data['sha256']\n file_dir = create_cache_dir(file_data['sha256'])\n file_path = File.join(file_dir, File.basename(file_data['filename']))\n if check_file(file_path, sha)\n @logger.debug(\"Using prexisting file: #{file_path}\")\n return file_path\n end\n\n @logger.debug(\"Queueing download for: #{file_path}\")\n serial_execute { download_file(file_path, sha, file_data['uri']) }\n end", "def sync_to_cache_for_archiving\n result = sync_to_cache(false)\n self.erase_cache_symlinks rescue nil\n result\n end", "def copy(dest, overwrite=false)\n @resource.copy(dest, overwrite)\n end", "def lookup(path)\n unless @cached.has_key?(path)\n @cached[path] = _lookup!(path)\n end\n return @cached[path]\n end", "def copy_file(path:, copy_destination:)\n BrickFTP::API::FileOperation::Copy.create(path: path, 'copy-destination': copy_destination)\n end", "def cache!(new_file)\n super\n @old_tmp_file = new_file\n end", "def cache!(new_file)\n super\n @old_tmp_file = new_file\n end", "def cache(resource, identifier, reload = false, &block)\n if CostAgent.cache_provider.nil?\n block.call\n else\n if (!reload && CostAgent.cache_provider.exists?(self.subdomain, resource, identifier))\n CostAgent.cache_provider.get(self.subdomain, resource, identifier)\n else\n CostAgent.cache_provider.set(self.subdomain, resource, identifier, block.call)\n end\n end\n end", "def cache!( new_file )\n super\n @old_tmp_file = new_file\n end", "def add(path)\n return true unless File.exist?(path)\n\n metadata[path] = {\n \"mtime\" => File.mtime(path),\n \"deps\" => [],\n }\n cache[path] = true\n end", "def uncache file \n refresh = nil\n begin\n is_a_file = F === file\n path = (is_a_file ? file.path : file.to_s) \n stat = (is_a_file ? file.stat : F.stat(file.to_s)) \n refresh = tmpnam(F.dirname(path))\n ignoring_errors do\n F.link(path, refresh) rescue F.symlink(path, refresh)\n end\n ignoring_errors do\n F.chmod(stat.mode, path)\n end\n ignoring_errors do\n F.utime(stat.atime, stat.mtime, path)\n end\n ignoring_errors do\n open(F.dirname(path)){|d| d.fsync}\n end\n ensure \n ignoring_errors do\n F.unlink(refresh) if refresh\n end\n end\n end", "def sync_archive_resource(resource, version)\n fetch_resource(resource, version) do |archive|\n dest_dir = %W(#{@datadir} #{resource} #{version}).join('/')\n log.debug \"exploding fetched archive #{archive} into data dir: #{dest_dir}\"\n # process the tar.gz\n Gem::Package::TarReader.new(Zlib::GzipReader.open(archive)) do |targz|\n dest = nil\n targz.each do |entry|\n dest = File.join dest_dir, entry.full_name\n # check if any old data exists, could happen if same resource name reused with different format\n if File.directory? dest\n log.debug \"removing existing directory (#{dest} before extracting archive there\"\n FileUtils.rm_rf dest\n elsif File.file? dest.chomp('/')\n log.debug \"removing existing file (#{dest.chomp}) before extracting archive there\"\n File.delete dest.chomp('/')\n end\n # extract\n if entry.directory?\n FileUtils.mkdir_p dest, mode: entry.header.mode\n elsif entry.file?\n # ensure extraction directory exists\n d_dir = File.dirname(dest)\n FileUtils.mkdir_p d_dir unless File.exist? d_dir\n\n File.open dest, 'wb' do |f|\n f.print entry.read\n end\n FileUtils.chmod entry.header.mode, dest\n elsif entry.header.typeflag == '2' # symlink\n File.symlink entry.header.linkname, dest\n end\n dest = nil\n end\n end\n end\n end", "def _http_put resource, path\n uri = ::URI.parse(resource.auth_uri)\n path = _path uri, path\n request = Net::HTTP::Put.new(path)\n _build_request resource, request\nend", "def _http_put resource, path\n uri = ::URI.parse(resource.auth_uri)\n path = _path uri, path\n request = Net::HTTP::Put.new(path)\n _build_request resource, request\nend", "def download_file(url, destination)\n raw_file = server_api.get_rest(url, true)\n\n Chef::Log.info(\"Storing updated #{destination} in the cache.\")\n cache.move_to(raw_file.path, destination)\n end" ]
[ "0.7250869", "0.57528096", "0.5703945", "0.56016165", "0.5565846", "0.55129224", "0.530239", "0.52865165", "0.5244784", "0.51926225", "0.51596266", "0.51512223", "0.50620484", "0.5013486", "0.49482006", "0.48527953", "0.48388007", "0.48222888", "0.4775096", "0.47533083", "0.47511265", "0.47275713", "0.4726445", "0.47178838", "0.47041625", "0.4703579", "0.46634066", "0.4660975", "0.46338484", "0.46188906", "0.46090838", "0.45994008", "0.45953682", "0.4590228", "0.45683795", "0.45629928", "0.45617095", "0.45548737", "0.45537245", "0.45455945", "0.45326713", "0.45272028", "0.45225045", "0.4520274", "0.4518088", "0.4512199", "0.44905162", "0.44749272", "0.447437", "0.44732562", "0.4473068", "0.4463126", "0.44612908", "0.44594705", "0.44543704", "0.4446214", "0.44329557", "0.4429714", "0.44205132", "0.4416712", "0.4407073", "0.44027996", "0.43852144", "0.43852144", "0.43819603", "0.43811497", "0.43794173", "0.43732765", "0.4370775", "0.43677393", "0.43668476", "0.43639758", "0.43536577", "0.4351074", "0.43459582", "0.43451187", "0.4340479", "0.43377736", "0.43370643", "0.4333412", "0.43307394", "0.43229905", "0.43190876", "0.4314202", "0.43138462", "0.4298645", "0.42941782", "0.42854017", "0.42804822", "0.42790434", "0.4276501", "0.4276501", "0.4275286", "0.42717585", "0.4267364", "0.42672586", "0.42659628", "0.42534226", "0.42520332", "0.42495033" ]
0.8058952
0
GET /vargessos GET /vargessos.json
def index @vargessos = Vargesso.where(user_id: current_user.id).order("id DESC") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 get_varrays(auth=nil, cert=nil)\n\t\trest_get(\"#{@base_url}/vdc/varrays\", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert)\n\tend", "def index\n @variences = Varience.all\n end", "def index\n @pluto_environment_variables = collection\n\n respond_to do |format|\n format.json { render json: @pluto_environment_variables }\n end\n end", "def set_vargesso\n @vargesso = Vargesso.find(params[:id])\n end", "def show\n render json: @vat\n end", "def show\n @vano = Vano.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vano }\n end\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 @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 @variants = Variant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @variants }\n end\n end", "def show\n @voprosy = Voprosy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @voprosy }\n end\n end", "def index\n @vdms = Vdm.all\n\n render json: @vdms\n end", "def show\n @var_conf = VarConf.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @var_conf }\n end\n end", "def index\n @vampires = Vampire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vampires }\n end\n end", "def index\n\t\tvendas = Venda.all\n\t\trender json: vendas, status: :ok\n\tend", "def index\n @ivas = Iva.all\n\n render json: @ivas\n end", "def get_varray(varray_id,auth=nil, cert=nil)\n\t\trest_get(\"#{@base_url}/vdc/varrays/#{varray_id}\", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert)\n\tend", "def show\n @voc = Voc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @voc }\n end\n end", "def index\n @releases = @environment.releases.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @releases }\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 show\n @app_var = AppVar.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @app_var }\n end\n end", "def index\n @distros = getmydata(\"Distro\")\n pagination\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @distros }\n end\n end", "def show\n @pluto_environment_variable = collection.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @pluto_environment_variable }\n end\n end", "def show\n @volantino = Volantino.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @volantino }\n end\n end", "def index\n @admin_villages = Admin::Village.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_villages }\n end\n end", "def index\n @regiones = Region.all\n\n render json: @regiones\n end", "def show\n @grm_vetappt = GrmVetappt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grm_vetappt }\n end\n end", "def list_all_tenantcircles_for_a_version_box(args = {}) \n get(\"/aosversions.json/aosversionbox/circles/#{args[:aosVersionBoxId]}\", args)\nend", "def list_varieties\n\treturn if authorise_for_web('varieties','read') == false \n\n \tif params[:page]!= nil \n\n \t\tsession[:varieties_page] = params['page']\n\n\t\t render_list_varieties\n\n\t\t return \n\telse\n\t\tsession[:varieties_page] = nil\n\tend\n\n\tlist_query = \"@variety_pages = Paginator.new self, Variety.count, @@page_size,@current_page\n\t @varieties = Variety.find(:all,\n\t\t\t\t :limit => @variety_pages.items_per_page,\n\t\t\t\t :offset => @variety_pages.current.offset)\"\n\tsession[:query] = list_query\n\trender_list_varieties\nend", "def show\n @viaje = Viaje.find(params[:id])\n @sitio = Site.find(@viaje.site_id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @viaje }\n end\n end", "def show\n @ventas_seguimiento = Ventas::Seguimiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ventas_seguimiento }\n end\n end", "def index\n @variations = Variation.all\n end", "def index\n @variations = Variation.all\n end", "def index\n @vistos = Visto.all\n end", "def index\n @pugs = Pug.all\n\n render json: @pugs\n end", "def index\n @varietals = Varietal.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @varietals }\n end\n end", "def show\n @safra_verdoso = SafraVerdoso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @safra_verdoso }\n end\n end", "def show\n @virus = Virus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @virus }\n end\n end", "def index\n @prueba_jsons = PruebaJson.all\n end", "def flavors()\n return get_request(address(\"/flavors/detail\"), @token)\t\n end", "def index\n @vanos = Vano.all\n end", "def index\n @vitaminas = Vitamina.all\n end", "def list_all_aos_versions(args = {}) \n get(\"/aosversions.json/all\", args)\nend", "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 @vegetable = Vegetable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vegetable }\n end\n end", "def list_all_aos_version_boxes(args = {}) \n get(\"/aosversions.json/aosversionbox\", args)\nend", "def show\n @ventas_presupuesto = Ventas::Presupuesto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ventas_presupuesto }\n end\n end", "def index\n @grupoassuntos = Grupoassunto.all\n\n render json: @grupoassuntos\n end", "def index\n @search = Variety.ransack(params[:q])\n @variety = Variety.new\n @varieties = @search.result.order(created_at: :desc).page(params[:page])\n respond_to do |format|\n format.html\n format.js\n end\n end", "def show\n @vodka = Vodka.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vodka }\n end\n end", "def show\n @observacao_vocacionada = ObservacaoVocacionada.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @observacao_vocacionada }\n end\n end", "def index\n @universes = Universe.all.page(params[:page]).per(25)\n respond_to do |format|\n format.html\n format.json { render json: @universes }\n end\n end", "def show\n @seguidore = Seguidore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @seguidore }\n end\n end", "def index\n @variations = Variation.all\nend", "def server_get_data(vmid,field)\n @site[\"nodes/#{@nodename}/openvz/#{vmid}/status/current\"].get @auth_params do |response, request, result, &block|\n data = (field.match(\"all\"))?JSON.parse(response.body)['data'] : JSON.parse(response.body)['data'][field]\n end\nend", "def show\n @vachana = Vachana.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vachana }\n end\n end", "def show\n @vachana = Vachana.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vachana }\n end\n end", "def vips\n request :get, '/vips'\n end", "def create\n @vargesso = current_user.vargessos.build(vargesso_params)\n\n respond_to do |format|\n if @vargesso.save\n format.html { redirect_to @vargesso, notice: 'Vargesso was successfully created.' }\n format.json { render :show, status: :created, location: @vargesso }\n else\n format.html { render :new }\n format.json { render json: @vargesso.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @village = Village.find(params[:id])\n @collections = @village.collections\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @village }\n end\n end", "def index\n @ginasios = Ginasio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ginasios }\n end\n end", "def index\n @loves = Love.all\n render json: @loves\n end", "def get_varray_virtual_pools(varray_id,auth=nil, cert=nil)\n\t\trest_get(\"#{@base_url}/vdc/varrays/#{varray_id}/vpools\", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert)\n\tend", "def index\n @protectoras = Protectora.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @protectoras }\n end\n end", "def index\n @vitimas = Vitima.all\n end", "def index\n authorize! :view, Var\n\n @vars = Var.all\n end", "def index\n @viajes = Viaje.all\n end", "def corona_virus\n # endpoint = \"https://corona.lmao.ninja/all\"\n endpoint = 'https://corona.lmao.ninja/v2/all'\n response = HTTParty.get(endpoint)\n data = JSON.parse response.body\n res = data\n result = []\n result<<{\n country: \"world\",\n cases: res[\"cases\"],\n todayCases: res[\"todayCases\"],\n deaths: res[\"deaths\"],\n todayDeaths: res[\"todayDeaths\"],\n recovered: res[\"recovered\"],\n active: res[\"active\"],\n critical: res[\"critical\"],\n casesPerOneMillion: res[\"casesPerOneMillion\"],\n deathsPerOneMillion: res[\"deathsPerOneMillion\"],\n tests: res[\"tests\"],\n testsPerOneMillion: res[\"testsPerOneMillion\"],\n affectedCountries: res[\"affectedCountries\"]\n }\n render json: result\n end", "def index\n @vas_responses = VasResponse.all\n end", "def index\n @parishes = Parish.all\n\n render json: @parishes\n end", "def show\n @tags_of_novel = TagsOfNovel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tags_of_novel }\n end\n end", "def index\n @variates = Variate.all\n\n respond_to do |format|\n format.html\n format.xml { render xml: @variates.to_xml }\n end\n end", "def show\n @gethotelstaticdatagd = Gethotelstaticdatagd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gethotelstaticdatagd }\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: @parish\n end", "def index\n @verbs = Verb.all\n\n render json: @verbs\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 @variates = Variate.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @variates.to_xml }\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 @viagens = Viagem.all\n end", "def index\n @genotypes = Genotype.paginate(:page => params[:page], :per_page => 10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @genotypes }\n end\n end", "def show\n @gasto = Gasto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gasto }\n end\n end", "def index\n info = Aws.get_recipes_from_db\n render :json => info\n end", "def show\n @genotype = Genotype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @genotype }\n end\n end", "def index\n @pedidos = Pedido.find(:all, :conditions => [\"cliente_id=?\", session[:usuario_id]])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pedidos }\n end\n end", "def index\n @sub_variants = SubVariant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sub_variants }\n end\n end", "def get_variant\n @product = Spree::Product.find_by :slug => params[:product_id]\n @variant = @product.find_variant_by_options(params[:ids].split(','))\n if @variant\n respond_to do |format|\n format.json {render json: {variant_id: @variant.id, image_ids: @variant.image_ids}}\n end\n end\n end", "def show\n @distro = Distro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @distro }\n end\n end", "def show\n @distro = Distro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @distro }\n end\n end", "def index\n @tipo_denuncia = TipoDenuncium.all\n\n render json: @tipo_denuncia\n end", "def list_active_aos_versions(args = {}) \n get(\"/aosversions.json/\", args)\nend", "def index\n @prova_livros = ProvaLivro.all\n end", "def show\n @ink_varnish = InkVarnish.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ink_varnish }\n end\n end", "def show\n @variant = Variant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @variant }\n end\n end", "def show\n @variant = Variant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @variant }\n end\n end", "def index\n @places = @site.places.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @places }\n end\n end", "def index\n @nvs_subsystems = NvsSubsystem.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @nvs_subsystems }\n end\n end", "def index\n @vets = Vet.all\n end", "def index\n @verbindungs = Verbindung.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @verbindungs }\n end\n end", "def index\n @cartridges = Cartridge.all\n\n respond_to do |format|\n format.html\n format.json { render json: @cartridges }\n end\n end" ]
[ "0.64268935", "0.6408409", "0.6053613", "0.59624565", "0.5887085", "0.58649427", "0.58516276", "0.58437115", "0.5841745", "0.58327943", "0.57882595", "0.5788078", "0.57863945", "0.5784141", "0.5768851", "0.57620144", "0.57511187", "0.5723649", "0.570875", "0.5700527", "0.56918836", "0.5668502", "0.5653237", "0.56414145", "0.56310695", "0.5628361", "0.5618067", "0.5602507", "0.55993533", "0.5594577", "0.5587744", "0.5586454", "0.5586454", "0.5578097", "0.5569499", "0.55608344", "0.55396575", "0.5534232", "0.5531129", "0.5530437", "0.5527283", "0.5526452", "0.5526309", "0.55166847", "0.54959726", "0.5490748", "0.54753107", "0.54684323", "0.5467151", "0.5458468", "0.54577106", "0.5457666", "0.5454973", "0.5452132", "0.5451272", "0.5449333", "0.5449333", "0.54419434", "0.5439073", "0.54296154", "0.5424825", "0.54244107", "0.54227716", "0.5421852", "0.54211134", "0.5417218", "0.5407576", "0.54069257", "0.5405662", "0.5404021", "0.5402677", "0.54023224", "0.5400241", "0.53991055", "0.53938425", "0.53936386", "0.5389111", "0.5387492", "0.53866583", "0.5382647", "0.53810436", "0.5376209", "0.5375067", "0.53733015", "0.53725576", "0.53633136", "0.53589123", "0.5356519", "0.5356519", "0.5348392", "0.5347262", "0.53442657", "0.5342572", "0.5339793", "0.5339793", "0.5338786", "0.5337196", "0.53370905", "0.5331512", "0.5326744" ]
0.5629968
25
GET /vargessos/1 GET /vargessos/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 @voprosy = Voprosy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @voprosy }\n end\n end", "def show\n @vano = Vano.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vano }\n end\n end", "def index\n @distros = getmydata(\"Distro\")\n pagination\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @distros }\n end\n end", "def show\n @voc = Voc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @voc }\n end\n end", "def show\n @distro = Distro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @distro }\n end\n end", "def show\n @distro = Distro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @distro }\n end\n end", "def 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 show\n @var_conf = VarConf.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @var_conf }\n end\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 get_aos_version(args = {}) \n get(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def show\n @seguidore = Seguidore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @seguidore }\n end\n end", "def show\n @volantino = Volantino.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @volantino }\n end\n end", "def show\n render json: @vat\n end", "def get_varrays(auth=nil, cert=nil)\n\t\trest_get(\"#{@base_url}/vdc/varrays\", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert)\n\tend", "def show\n @virus = Virus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @virus }\n end\n end", "def show\n @app_var = AppVar.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @app_var }\n end\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 list_all_tenantcircles_for_a_version_box(args = {}) \n get(\"/aosversions.json/aosversionbox/circles/#{args[:aosVersionBoxId]}\", args)\nend", "def show\n @viaje = Viaje.find(params[:id])\n @sitio = Site.find(@viaje.site_id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @viaje }\n end\n end", "def show\n @vegetable = Vegetable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vegetable }\n end\n end", "def get_json(path)\n puts \"*** GET #{path}\"\n\n response = Net::HTTP.get_response(build_uri(path))\n result = JSON.parse(response.body)\n puts \"HTTP #{response.code}\"\n\n puts JSON.pretty_generate(result)\n result\nend", "def show\n @ventas_seguimiento = Ventas::Seguimiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ventas_seguimiento }\n end\n end", "def get_json(path)\n puts \"*** GET #{path}\"\n\n response = Net::HTTP.get_response(build_uri(path))\n result = JSON.parse(response.body)\n puts \"HTTP #{response.code}\"\n\n #puts JSON.pretty_generate(result)\n result\nend", "def get_json(path)\n puts \"*** GET #{path}\"\n\n response = Net::HTTP.get_response(build_uri(path))\n result = JSON.parse(response.body)\n puts \"HTTP #{response.code}\"\n\n #puts JSON.pretty_generate(result)\n result\nend", "def set_vargesso\n @vargesso = Vargesso.find(params[:id])\n end", "def index\n @releases = @environment.releases.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @releases }\n end\n end", "def index\n @vampires = Vampire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vampires }\n end\n end", "def show\n @servicio = Servicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @servicio }\n end\n end", "def show\n @safra_verdoso = SafraVerdoso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @safra_verdoso }\n end\n end", "def show\n @observacao_vocacionada = ObservacaoVocacionada.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @observacao_vocacionada }\n end\n end", "def index\n @variants = Variant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @variants }\n end\n end", "def server_get_data(vmid,field)\n @site[\"nodes/#{@nodename}/openvz/#{vmid}/status/current\"].get @auth_params do |response, request, result, &block|\n data = (field.match(\"all\"))?JSON.parse(response.body)['data'] : JSON.parse(response.body)['data'][field]\n end\nend", "def show\n @grm_vetappt = GrmVetappt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grm_vetappt }\n end\n end", "def show\n @gasto = Gasto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gasto }\n end\n end", "def get_json(path)\n response = Net::HTTP.get_response(build_uri(path))\n result = JSON.parse(response.body)\n #puts \"🤖 GET #{path}\"\n #puts \"HTTP #{response.code}\"\n #puts JSON.pretty_generate(result)\n result\nend", "def show\n @genotype = Genotype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @genotype }\n end\n end", "def get_varray(varray_id,auth=nil, cert=nil)\n\t\trest_get(\"#{@base_url}/vdc/varrays/#{varray_id}\", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert)\n\tend", "def show\n @serv = Serv.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @serv }\n end\n end", "def show\n @pluto_environment_variable = collection.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @pluto_environment_variable }\n end\n end", "def index\n @vdms = Vdm.all\n\n render json: @vdms\n end", "def list_all_aos_versions(args = {}) \n get(\"/aosversions.json/all\", args)\nend", "def show\n @statuspagamento = Statuspagamentoe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @statuspagamento }\n end\n end", "def show\n @vodka = Vodka.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vodka }\n end\n end", "def show\n @gethotelstaticdatagd = Gethotelstaticdatagd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gethotelstaticdatagd }\n end\n end", "def list_active_aos_versions(args = {}) \n get(\"/aosversions.json/\", args)\nend", "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 @nvs_subsystems = NvsSubsystem.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @nvs_subsystems }\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 index\n @variences = Varience.all\n end", "def get_json()\n\n http = Net::HTTP.new(STATUS_URI.host, STATUS_URI.port)\n http.use_ssl = false\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Get.new(\"/api/services.json\")\n\n response = http.request(request)\n JSON.parse(response.body)\nend", "def get_aos_version_box_by_id(args = {}) \n get(\"/aosversions.json/aosversionbox/#{args[:aosVersionBoxId]}\", args)\nend", "def index\n @ginasios = Ginasio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ginasios }\n end\n end", "def show\n @ventas_presupuesto = Ventas::Presupuesto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ventas_presupuesto }\n end\n end", "def index\n\t\tvendas = Venda.all\n\t\trender json: vendas, status: :ok\n\tend", "def vips\n request :get, '/vips'\n end", "def show\n @solicitud_servicio = SolicitudServicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @solicitud_servicio }\n end\n end", "def show\n @ovode = Ovode.find_by_url(params[:id])\n \n @title = @ovode.try(:seotitle)\n @seodesc = @ovode.try(:seodesc)\n @seokeys = @ovode.try(:seokeywords)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ovode }\n end\n end", "def index\n @pedidos = Pedido.find(:all, :conditions => [\"cliente_id=?\", session[:usuario_id]])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pedidos }\n end\n end", "def list_all_aos_version_boxes(args = {}) \n get(\"/aosversions.json/aosversionbox\", args)\nend", "def index\n info = Aws.get_recipes_from_db\n render :json => info\n end", "def show\n @sistema = Sistema.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sistema }\n end\n end", "def show\n @tipo_vehiculo = TipoVehiculo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_vehiculo }\n end\n end", "def show\n @verbo = Verbo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @verbo }\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 @ivas = Iva.all\n\n render json: @ivas\n end", "def index\n @vistos = Visto.all\n end", "def index\n @admin_villages = Admin::Village.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_villages }\n end\n end", "def show\n @vessel = Vessel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vessel }\n end\n end", "def get_aos_version_box_by_name(args = {}) \n get(\"/aosversions.json/aosversionbox/name/#{args[:aosVersionBoxName]}\", args)\nend", "def index\n @pluto_environment_variables = collection\n\n respond_to do |format|\n format.json { render json: @pluto_environment_variables }\n end\n end", "def show\n @vnic = Vnic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vnic }\n end\n end", "def show\n @verbindung = Verbindung.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @verbindung }\n end\n end", "def index\n @universes = Universe.all.page(params[:page]).per(25)\n respond_to do |format|\n format.html\n format.json { render json: @universes }\n end\n end", "def index\n @servers = getmydata(\"Server\")\n\tpagination\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @servers }\n end\n end", "def index\n @vargessos = Vargesso.where(user_id: current_user.id).order(\"id DESC\")\n end", "def show\n @sitio = Sitio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sitio }\n end\n end", "def show\n repo = assets_repo\n @v_asset = repo.get(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @v_asset }\n end\n end", "def show\n @variant = Variant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @variant }\n end\n end", "def show\n @variant = Variant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @variant }\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 @vachana = Vachana.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vachana }\n end\n end", "def show\n @vachana = Vachana.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vachana }\n end\n end", "def show\n @ink_varnish = InkVarnish.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ink_varnish }\n end\n end", "def index\n @pugs = Pug.all\n\n render json: @pugs\n end", "def show\n @pologeno = Pologeno.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pologeno }\n end\n end", "def show\n @safra_produto = SafraProduto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @safra_produto }\n end\n end", "def get_aos_version_by_name(args = {}) \n get(\"/aosversions.json/version/#{args[:aosVersionName]}\", args)\nend", "def show\n @os_release = OsRelease.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @os_release }\n end\n end", "def show\n @osoba = Osoba.find(params[:id])\n\n render json: @osoba\n end", "def show\n @storage_lun = StorageLun.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @storage_lun }\n end\n end", "def show\n @ginasio = Ginasio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @ginasio }\n end\n end", "def show\n @contato_produto = ContatoProduto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contato_produto }\n end\n end", "def show\n @vampire = Vampire.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vampire }\n end\n end", "def show\n @flavor = compute.get_flavor(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @flavor }\n end\n end", "def show\n @os_type = OsType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @os_type }\n end\n end", "def show\n @seguro = Seguro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @seguro }\n end\n end", "def show\n @taxonomy = Taxonomy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @taxonomy }\n end\n end", "def view\n res = @client.get(path)\n @attributes = res.json if res.success?\n end", "def show\n @village = Village.find(params[:id])\n @collections = @village.collections\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @village }\n end\n end", "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @supervisions }\n end\n end" ]
[ "0.61151934", "0.6101978", "0.5954104", "0.59473556", "0.5937285", "0.5887393", "0.5887393", "0.5849227", "0.583295", "0.58254546", "0.5817063", "0.5804472", "0.5797435", "0.5781924", "0.5781307", "0.5770215", "0.57589144", "0.5754593", "0.5732095", "0.5721557", "0.57181025", "0.57097286", "0.57021534", "0.56927913", "0.56927913", "0.5691921", "0.5680722", "0.5673893", "0.5670403", "0.5665122", "0.56650937", "0.56645614", "0.56416374", "0.56354684", "0.5604867", "0.56040883", "0.5600379", "0.5588206", "0.5584065", "0.5583422", "0.5569249", "0.5568261", "0.55617255", "0.55609006", "0.55591357", "0.5558929", "0.55557555", "0.5552268", "0.5552192", "0.55442846", "0.5530109", "0.55276686", "0.55123454", "0.55041677", "0.5503271", "0.5493938", "0.54925346", "0.54917324", "0.5487332", "0.54871947", "0.54852754", "0.54851604", "0.5483556", "0.5482694", "0.5482038", "0.54818356", "0.54759204", "0.5471389", "0.5470022", "0.54686874", "0.54635876", "0.5462738", "0.5456952", "0.545596", "0.54536825", "0.54515916", "0.54472876", "0.54472166", "0.5445587", "0.5445587", "0.544451", "0.54409915", "0.54409915", "0.5440646", "0.5430179", "0.54271734", "0.54230714", "0.54220176", "0.5418434", "0.5417807", "0.5415017", "0.5414474", "0.54124063", "0.54103553", "0.5406634", "0.54027903", "0.5401965", "0.5400614", "0.53917", "0.5390981", "0.5390646" ]
0.0
-1
POST /vargessos POST /vargessos.json
def create @vargesso = current_user.vargessos.build(vargesso_params) respond_to do |format| if @vargesso.save format.html { redirect_to @vargesso, notice: 'Vargesso was successfully created.' } format.json { render :show, status: :created, location: @vargesso } else format.html { render :new } format.json { render json: @vargesso.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vargesso_params\n params.require(:vargesso).permit(:user_id, :ano, :profundidade, :areaAplicacao, :teorCalcio)\n end", "def create\n @varience = Varience.new(varience_params)\n\n respond_to do |format|\n if @varience.save\n format.html { redirect_to @varience, notice: 'Varience was successfully created.' }\n format.json { render action: 'show', status: :created, location: @varience }\n else\n format.html { render action: 'new' }\n format.json { render json: @varience.errors, status: :unprocessable_entity }\n end\n end\n end", "def fd_variacaoproduto_params\n params.require(:fd_variacaoproduto).permit(:valr_produto, :fd_variaco_id, :fd_produto_id)\n end", "def create\n @tovar = Tovar.new(tovar_params)\n\n respond_to do |format|\n if @tovar.save\n format.html { redirect_to @tovar, notice: 'Товар успешно создан.' }\n format.json { render :show, status: :created, location: @tovar }\n else\n format.html { render :new }\n format.json { render json: @tovar.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @app_var = AppVar.new(params[:app_var])\n\n respond_to do |format|\n if @app_var.save\n format.html { redirect_to @app_var, notice: 'App var was successfully created.' }\n format.json { render json: @app_var, status: :created, location: @app_var }\n else\n format.html { render action: \"new\" }\n format.json { render json: @app_var.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 @variety = Variety.new(variety_params)\n\n respond_to do |format|\n if @variety.save\n format.html { redirect_to admin_varieties_path, notice: 'La variedad fue creada' }\n format.json { render :show, status: :created, location: @variety }\n format.js{}\n else\n format.html { render :new }\n format.js{}\n format.json { render json: @variety.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @variation = Variation.new(variation_params)\n\n respond_to do |format|\n if @variation.save\n format.html { redirect_to @variation, notice: 'Variação criada com sucesso.' }\n format.json { render :show, status: :created, location: @variation }\n else\n format.html { render :new }\n format.json { render json: @variation.errors, status: :unprocessable_entity }\n end\n end\n end", "def criar_sobrevivente\n @suvivor = Sobrevivente.create(\n name: params[:name], genero: params[:genero], idade: params[:idade],\n lat: params[:lat], lon: params[:lon],\n agua: params[:agua], comida: params[:comida], medicamento: params[:medicamento],\n municao: params[:municao]\n )\n render json: @suvivor\n end", "def create\n @var_conf = VarConf.new(params[:var_conf])\n\n respond_to do |format|\n if @var_conf.save\n format.html { redirect_to @var_conf, :notice => 'Var conf was successfully created.' }\n format.json { render :json => @var_conf, :status => :created, :location => @var_conf }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @var_conf.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n authorize! :manage, Var\n\n @var = Var.new(var_params)\n\n respond_to do |format|\n if @var.save\n format.html { redirect_to Instrument.find(@var.instrument_id), notice: 'Variable was successfully created.' }\n format.json { render :show, status: :created, location: @var }\n else\n format.html { render :new }\n format.json { render json: @var.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n # {\"vcpus\": 1, \"disk\": 1, \"name\": \"test\", \"rxtx_factor\": 1, \"OS-FLV-EXT-DATA:ephemeral\": 1, \"ram\": 512, \"id\": 6, \"swap\": 1}}'\n @flavor = compute.create_flavor(\"rxtx_factor\"=>1,\"OS-FLV-EXT-DATA:ephemeral\"=>params[:ephemeral],:vcpus=>params[:vcpus],:disk=>params[:disk],:name=>params[:name],:ram=>params[:ram],:id=>params[:id],:swap=>params[:swap])\n\n respond_to do |format|\n format.html { redirect_to flavors_path, :notice => 'Flavor was successfully created.' }\n format.json { render :json => @flavor, :status => :created, :location => @flavor }\n end\n end", "def create\n @substancia = Substancia.new(substancia_params)\n\n respond_to do |format|\n if @substancia.save\n format.html { redirect_to @substancia, notice: 'Substancia was successfully created.' }\n format.json { render :show, status: :created, location: @substancia }\n else\n format.html { render :new }\n format.json { render json: @substancia.errors, status: :unprocessable_entity }\n end\n end\n end", "def variable_params\n params.require(:variable).permit(:tipo_variable, :codigo_variable, :descricion_variable, :dato_extra, :dato_extra2, :dato_extra3, :estado, :usu_crea, :fec_crea, :usu_mod, :fec_mod)\n end", "def set_vargesso\n @vargesso = Vargesso.find(params[:id])\n end", "def varience_params\n params.require(:varience).permit(:varience, :desc)\n end", "def create\r\n @tipo_item_variado = ItemVariado.new(tipo_item_variado_params)\r\n\r\n respond_to do |format|\r\n if @tipo_item_variado.save\r\n format.html { redirect_to tipo_item_variado_path(@tipo_item_variado), notice: 'ItemVariado criada com sucesso.' }\r\n format.json { render :show, status: :created, location: @tipo_item_variado }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @tipo_item_variado.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def create\n @visto = Visto.new(visto_params)\n\n\n respond_to do |format|\n if @visto.save\n format.html { redirect_to @visto, notice: 'Visto was successfully created.' }\n format.json { render :show, status: :created, location: @visto }\n else\n format.html { render :new }\n format.json { render json: @visto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @variate = Variate.new(params[:variate])\n\n flash[:notice] = 'Variate was successfully created.' if @variate.save\n respond_with @variate\n end", "def create\n @vano = Vano.new(vano_params)\n\n respond_to do |format|\n if @vano.save\n format.html { redirect_to @vano, notice: 'Vano was successfully created.' }\n format.json { render :show, status: :created, location: @vano }\n else\n format.html { render :new }\n format.json { render json: @vano.errors, status: :unprocessable_entity }\n end\n end\n end", "def tovar_params\n params.require(:tovar).permit(:name)\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 @vano = Vano.new(params[:vano])\n\n respond_to do |format|\n if @vano.save\n format.html { redirect_to @vano, notice: 'Vano was successfully created.' }\n format.json { render json: @vano, status: :created, location: @vano }\n else\n format.html { render action: \"new\" }\n format.json { render json: @vano.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @voprosy = Voprosy.new(params[:voprosy])\n\n respond_to do |format|\n if @voprosy.save\n format.html { redirect_to @voprosy, notice: 'Voprosy was successfully created.' }\n format.json { render json: @voprosy, status: :created, location: @voprosy }\n else\n format.html { render action: \"new\" }\n format.json { render json: @voprosy.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @varietal = Varietal.new(params[:varietal])\n\n respond_to do |format|\n if @varietal.save\n format.html { redirect_to(varietals_path, :notice => 'Varietal was successfully created.') }\n format.xml { render :xml => @varietal, :status => :created, :location => @varietal }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @varietal.errors, :status => :unprocessable_entity }\n end\n end\n end", "def common_variable_relationships_post(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: CommonVariableRelationshipApi#common_variable_relationships_post ...\"\n end\n \n # resource path\n path = \"/commonVariableRelationships\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'access_token'] = opts[:'access_token'] if opts[:'access_token']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'body'])\n \n\n auth_names = ['quantimodo_oauth2']\n result = @api_client.call_api(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'inline_response_200_4')\n if Configuration.debugging\n Configuration.logger.debug \"API called: CommonVariableRelationshipApi#common_variable_relationships_post. Result: #{result.inspect}\"\n end\n return result\n end", "def variable_params\n params.require(:variable).permit(:name, :description, :value)\n end", "def create\n @variable = Variable.new(variable_params)\n\n respond_to do |format|\n if @variable.save\n format.html { redirect_to @variable, notice: 'Variable was successfully created.' }\n format.json { render :show, status: :created, location: @variable }\n else\n format.html { render :new }\n format.json { render json: @variable.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @variable = Variable.new(params[:variable])\n\n respond_to do |format|\n if @variable.save\n format.html { redirect_to @variable, notice: 'Variable was successfully created.' }\n format.json { render json: @variable, status: :created, location: @variable }\n else\n format.html { render action: 'new' }\n format.json { render json: @variable.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @pluto_environment_variable = collection.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pluto_environment_variable }\n end\n end", "def create\n # Crear nuevo voto\n @voto = Voto.new(params[:voto])\n\n # Asociarlo con el usuario\n @voto.usuario_id = current_usuario.id\n\n # Asociarlo con la Pregunta o Respuesta\n votable_type = params[:voto][:votable_type]\n votable_id = params[:voto][:votable_id]\n if votable_type=='Pregunta'\n @voto.votable = Pregunta.find(votable_id)\n else\n @voto.votable = Respuesta.find(votable_id)\n end\n\n respond_to do |format|\n if @voto.save\n resp = {\n :votos_total => @voto.votable.votos_total,\n :votos_menos => @voto.votable.votos_menos,\n :votos_mas => @voto.votable.votos_mas\n }\n format.json { render json: resp, status: :created, location: @voto }\n else\n format.json { render json: @voto.errors, status: :unprocessable_entity }\n end\n end\n end", "def var_params\n params.require(:var).permit(:name, :shortname, :instrument_id, :units, :measured_property_id)\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 @site_variable = SiteVariable.new(site_variable_params)\n\n respond_to do |format|\n if @site_variable.save\n format.html { redirect_to '/administrator/site_variables', notice: 'SiteVariable was successfully created.' }\n format.json { render :show, status: :created, location: @site_variable }\n else\n format.html { render :new }\n format.json { render json: @site_variable.errors, status: :unprocessable_entity }\n end\n end\n end", "def post(path, json, params = {})\n if path.include?('covid19')\n request = Net::HTTP::Post.new(path, @headers)\n else\n request = Net::HTTP::Post.new('/v2' + path, @headers)\n end\n request.add_field('Content-Type', 'application/json')\n request.body = json\n params.each do |k, v|\n request[k] = v\n end\n send_request(request)\n end", "def create\n @ventas_presupuesto = Ventas::Presupuesto.new(params[:ventas_presupuesto])\n @ventas_presupuesto.vendedor = current_user.id\n\n respond_to do |format|\n if @ventas_presupuesto.save\n format.html { redirect_to @ventas_presupuesto, notice: 'Presupuesto was successfully created.' }\n format.json { render json: @ventas_presupuesto, status: :created, location: @ventas_presupuesto }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ventas_presupuesto.errors, status: :unprocessable_entity }\n end\n end\n end", "def pv_params\n params.require(:pv).permit(:productos, :generadores, :eliminadores, :tareas, :ganancias, :frustaciones, :proyect_id)\n end", "def prueba_json_params\n params[:prueba_json]\n end", "def create\n @valet_datum = ValetDatum.new(valet_datum_params)\n\n respond_to do |format|\n if @valet_datum.save\n format.html { redirect_to @valet_datum, notice: 'Valet datum was successfully created.' }\n format.json { render :show, status: :created, location: @valet_datum }\n else\n format.html { render :new }\n format.json { render json: @valet_datum.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @safra_verdoso = SafraVerdoso.new(params[:safra_verdoso])\n\n respond_to do |format|\n if @safra_verdoso.save\n format.html { redirect_to \"/safra_produtos/#{@safra_verdoso.safra_produto_id}/descontos\"}\n format.json { render json: @safra_verdoso, status: :created, location: @safra_verdoso }\n else\n format.html { render action: \"new\" }\n format.json { render json: @safra_verdoso.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tipoenvolvido = Tipoenvolvido.new(tipoenvolvido_params)\n\n respond_to do |format|\n if @tipoenvolvido.save\n format.html { redirect_to @tipoenvolvido, notice: 'Tipoenvolvido was successfully created.' }\n format.json { render action: 'show', status: :created, location: @tipoenvolvido }\n else\n format.html { render action: 'new' }\n format.json { render json: @tipoenvolvido.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @pluto_environment_variable = collection.build(params[:pluto_environment_variable])\n\n respond_to do |format|\n if @pluto_environment_variable.save\n format.html do\n flash[:success] = 'Environment variable was successfully created.'\n redirect_to @core_application\n end\n format.json { render json: @pluto_environment_variable, status: :created, location: @pluto_environment_variable }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pluto_environment_variable.errors, status: :unprocessable_entity }\n end\n end\n end", "def render_process_variables_json (variables)\n\n OpenWFE::Json.encode(variables)\n end", "def create\n @varietywine = Varietywine.new(varietywine_params)\n\n respond_to do |format|\n if @varietywine.save\n format.html { redirect_to @varietywine, notice: 'Сорт вина успешно создан.' }\n format.json { render :show, status: :created, location: @varietywine }\n else\n format.html { render :new }\n format.json { render json: @varietywine.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @variate = Variate.new(params[:variate])\n\n respond_to do |format|\n if @variate.save\n flash[:notice] = 'Variate was successfully created.'\n format.html { redirect_to variate_url(@variate) }\n format.xml { head :created, :location => variate_url(@variate) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @variate.errors.to_xml }\n end\n end\n end", "def create\n @veterinario = Veterinario.new(veterinario_params)\n\n respond_to do |format|\n if @veterinario.save\n format.html { redirect_to @veterinario, notice: \"Veterinario was successfully created.\" }\n format.json { render :show, status: :created, location: @veterinario }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @veterinario.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @vongdau = Vongdau.new(vongdau_params)\n\n respond_to do |format|\n if @vongdau.save\n format.html { redirect_to @vongdau, notice: 'Vongdau was successfully created.' }\n format.json { render :show, status: :created, location: @vongdau }\n else\n format.html { render :new }\n format.json { render json: @vongdau.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @variation = Variation.new(variation_params)\n\n respond_to do |format|\n if @variation.save\n format.html { redirect_to @variation, notice: \"Variation was successfully created.\" }\n format.json { render :show, status: :created, location: @variation }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @variation.errors, status: :unprocessable_entity }\n end\n end\nend", "def create\n @veterinario = Veterinario.new(veterinario_params)\n\n respond_to do |format|\n if @veterinario.save\n format.html { redirect_to @veterinario, notice: 'Veterinario was successfully created.' }\n format.json { render :show, status: :created, location: @veterinario }\n else\n format.html { render :new }\n format.json { render json: @veterinario.errors, status: :unprocessable_entity }\n end\n end\n end", "def variable_params\n params.require(:variable).permit(:value)\n end", "def create\n puts 'AQQQQQUUUUUUUIIIIII'\n json = ActiveSupport::JSON.decode(params[:pessoa])\n puts json\n @pessoa = Pessoa.new(json)\n # @address = Address.new(params[:address])\n\n # @client.addresses = @address\n\n respond_to do |format|\n if @pessoa.save\n format.html { redirect_to @pessoa, notice: 'Pessoa was successfully created.' }\n format.json { render json: @pessoa, status: :created, location: @pessoa }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pessoa.errors, status: :unprocessable_entity }\n end\n end\n end", "def postavka_params\n params.require(:postavka).permit(:zaporednaSt, :kolicina, :popust, :racun_id, :storitev_id)\n end", "def new\n @var_conf = VarConf.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @var_conf }\n end\n end", "def create\n @vacuna = Vacuna.new(vacuna_params)\n @vacuna.mascota_id = @mascota.id\n respond_to do |format|\n if @vacuna.save\n format.html { redirect_to @vacuna, notice: 'Vacuna Agregada exitosamente' }\n format.json { render :show, status: :created, location: @vacuna }\n else\n format.html { render :new }\n format.json { render json: @vacuna.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @valores_de_pago = ValoresDePago.new(valores_de_pago_params)\n\n respond_to do |format|\n if @valores_de_pago.save\n format.html { redirect_to @valores_de_pago, notice: 'Valores de pago was successfully created.' }\n format.json { render :show, status: :created, location: @valores_de_pago }\n else\n format.html { render :new }\n format.json { render json: @valores_de_pago.errors, status: :unprocessable_entity }\n end\n end\n end", "def user_variables_post(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: UserVariableApi#user_variables_post ...\"\n end\n \n # resource path\n path = \"/userVariables\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'access_token'] = opts[:'access_token'] if opts[:'access_token']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'body'])\n \n\n auth_names = ['quantimodo_oauth2']\n result = @api_client.call_api(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'inline_response_200_26')\n if Configuration.debugging\n Configuration.logger.debug \"API called: UserVariableApi#user_variables_post. Result: #{result.inspect}\"\n end\n return result\n end", "def create\n response = post_request(URI.parse(\"http://\"+Storage.find(cookies[:donabe_ip]).data+\"/\"+Storage.find(cookies[:current_tenant]).data+\"/containers.json\"), params[:container].to_json, Storage.find(cookies[:current_token]).data)\n json_respond response.body \n\n end", "def vitamina_params\n params.require(:vitamina).permit(:marca, :tipo, :precio, :presentacion, :stock, :liquido)\n end", "def substancia_params\n params.require(:substancia).permit(:DS_CAS, :DS_SUBSTANCIA)\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 vaga = Vaga.new(vaga_params)\n if vaga.save\n render json: {status: 'SUCCESSO', message:'Vaga adicionada com sucesso!', data:vaga},status: :ok\n else\n render json: {status: 'ERRO', message:'Houve um erro ao adicionar a vaga.', data:vaga.errors},status: :unprocessable_entity\n end\n end", "def post(resource, params)\n case resource\n when \"pedidos\", \"place_order\", \"new_order\" then url = \"/pedidos\"\n when \"envios\", \"shipping\" then url = \"/envios\"\n else url = \"/#{resource}\"\n end\n\n post_request(url, params)\n end", "def create\n @my_visa = MyVisa.new(my_visa_params)\n\n respond_to do |format|\n if @my_visa.save\n format.html { redirect_to @my_visa, notice: 'My visa was successfully created.' }\n format.json { render :show, status: :created, location: @my_visa }\n else\n format.html { render :new }\n format.json { render json: @my_visa.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @vodka = Vodka.new(params[:vodka])\n\n respond_to do |format|\n if @vodka.save\n format.html { redirect_to @vodka, notice: 'Vodka was successfully created.' }\n format.json { render json: @vodka, status: :created, location: @vodka }\n else\n format.html { render action: \"new\" }\n format.json { render json: @vodka.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tipo_ventum = TipoVentum.new(tipo_ventum_params)\n\n respond_to do |format|\n if @tipo_ventum.save\n format.html { redirect_to @tipo_ventum, notice: 'Tipo ventum was successfully created.' }\n format.json { render :show, status: :created, location: @tipo_ventum }\n else\n format.html { render :new }\n format.json { render json: @tipo_ventum.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @estacionamiento = Estacionamiento.new(estacionamiento_params)\n @lista_departamentos = Ubigeo.find_by_sql(\"select distinct idDepartamento, Departamento from ubigeos\")\n @lista_provincias = Ubigeo.find_by_sql(\"select distinct idProvincia, Provincia from ubigeos\")\n @lista_distritos = Ubigeo.find_by_sql(\"select distinct idDistrito, Distrito from ubigeos\")\n @serv_adicinales = ServAdicinale.all\n\n respond_to do |format|\n if @estacionamiento.save\n format.html { redirect_to @estacionamiento, notice: 'Estacionamiento was successfully created.' }\n format.json { render :show, status: :created, location: @estacionamiento }\n else\n format.html { render :new }\n format.json { render json: @estacionamiento.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @situacion_revistum = SituacionRevistum.new(situacion_revistum_params)\n\n respond_to do |format|\n if @situacion_revistum.save\n format.html { redirect_to @situacion_revistum, notice: 'Situacion revistum was successfully created.' }\n format.json { render json: @situacion_revistum, status: :created, location: @situacion_revistum }\n else\n format.html { render action: \"new\" }\n format.json { render json: @situacion_revistum.errors, status: :unprocessable_entity }\n end\n end\n end", "def votacion_params\n params.require(:votacion).permit(:razon, :inicio, :finalizacion, :numero_maximo_votantes, :numero_maximo_autenticaciones, :tiempo_maximo_votos, :balotas)\n end", "def create\n @dias_semanas_vaga = DiasSemanasVaga.new(dias_semanas_vaga_params)\n\n respond_to do |format|\n if @dias_semanas_vaga.save\n format.html { redirect_to @dias_semanas_vaga, notice: 'Dias semanas vaga was successfully created.' }\n format.json { render :show, status: :created, location: @dias_semanas_vaga }\n else\n format.html { render :new }\n format.json { render json: @dias_semanas_vaga.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ventaganancium = Ventaganancium.new(ventaganancium_params)\n\n respond_to do |format|\n if @ventaganancium.save\n format.html { redirect_to @ventaganancium, notice: 'Ventaganancium was successfully created.' }\n format.json { render :show, status: :created, location: @ventaganancium }\n else\n format.html { render :new }\n format.json { render json: @ventaganancium.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @pv = Pv.new(pv_params)\n @pv.proyect = @proyect\n\n respond_to do |format|\n if @pv.save\n format.html { redirect_to proyect_pv_path(@proyect,@pv), notice: 'Propuesta de Valor ha sido creada.' }\n format.json { render :show, status: :created, location: @pv }\n else\n format.html { render :new }\n format.json { render json: @pv.errors, status: :unprocessable_entity }\n end\n end\n end", "def variant_params\n params.require(:variant).permit(:name, :precio, :product)\n end", "def create\n if @indexer.present?\n @variation = Variation.new(variation_params)\n\n if @variation.save\n render json: @variation, status: :created # Ver como resolver o location\n else\n render json: ErrorSerializer.to_422('Variation', @variation.errors.messages), status: :unprocessable_entity\n end\n else\n render json: ErrorSerializer.to_404('Indexer'), status: :not_found\n end\n end", "def create\n @saida_produto = SaidaProduto.new(saida_produto_params)\n\n respond_to do |format|\n if @saida_produto.save\n format.html { redirect_to @saida_produto, notice: 'Saida produto was successfully created.' }\n format.json { render :show, status: :created, location: @saida_produto }\n else\n format.html { render :new }\n format.json { render json: @saida_produto.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_aos_version(args = {}) \n post(\"/aosversions.json/\", args)\nend", "def create\n @vitamina = Vitamina.new(vitamina_params)\n\n respond_to do |format|\n if @vitamina.save\n format.html { redirect_to @vitamina, notice: 'Vitamina was successfully created.' }\n format.json { render :show, status: :created, location: @vitamina }\n else\n format.html { render :new }\n format.json { render json: @vitamina.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @verma = Verma.new(verma_params)\n\n respond_to do |format|\n if @verma.save\n format.html { redirect_to @verma, notice: 'Verma was successfully created.' }\n format.json { render :show, status: :created, location: @verma }\n else\n format.html { render :new }\n format.json { render json: @verma.errors, status: :unprocessable_entity }\n end\n end\n end", "def vendamesa_params\n params.require(:vendamesa).permit(:total, :dinheiro, :cartao, :cheque, :nota, :mesa_id, :estabelecimento_id, :funcionario_id, :troco)\n end", "def create\n @venta = Venta.new(venta_params)\n\n respond_to do |format|\n if @venta.save\n format.html { redirect_to @venta, notice: 'Venta was successfully created.' }\n format.json { render :show, status: :created, location: @venta }\n else\n format.html { render :new }\n format.json { render json: @venta.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @venta = Venta.new(params[:venta])\n\n respond_to do |format|\n if @venta.save\n format.html { redirect_to @venta, notice: 'Venta was successfully created.' }\n format.json { render json: @venta, status: :created, location: @venta }\n else\n format.html { render action: \"new\" }\n format.json { render json: @venta.errors, status: :unprocessable_entity }\n end\n end\n end", "def save_vigencias\n #raise @tags.to_yaml\n unless @vigencias.nil?\n @vigencias.each do |vigencia_id|\n Tienevigencia.create(producto_id:self.id,vigencia_id:vigencia_id)\n end\n end\n\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 @prova_livro = ProvaLivro.new(prova_livro_params)\n\n respond_to do |format|\n if @prova_livro.save\n format.html { redirect_to @prova_livro, notice: 'Prova livro was successfully created.' }\n format.json { render :show, status: :created, location: @prova_livro }\n else\n format.html { render :new }\n format.json { render json: @prova_livro.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @veiculo = Veiculo.new(params[:veiculo])\n\n respond_to do |format|\n if @veiculo.save\n format.html { redirect_to @veiculo, :notice => 'Veiculo was successfully created.' }\n format.json { render :json => @veiculo, :status => :created, :location => @veiculo }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @veiculo.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @prueba_json = PruebaJson.new(prueba_json_params)\n\n respond_to do |format|\n if @prueba_json.save\n format.html { redirect_to @prueba_json, notice: 'Prueba json was successfully created.' }\n format.json { render action: 'show', status: :created, location: @prueba_json }\n else\n format.html { render action: 'new' }\n format.json { render json: @prueba_json.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @prorroga = Prorroga.new(prorroga_params)\n\n respond_to do |format|\n if @prorroga.save\n format.html { redirect_to @prorroga, notice: 'Prorroga was successfully created.' }\n format.json { render :show, status: :created, location: @prorroga }\n else\n format.html { render :new }\n format.json { render json: @prorroga.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n response = post_request(URI.parse(\"http://\"+(sesh :donabe_ip)+\"/\"+(sesh :current_tenant)+\"/containers.json\"), params[:container].to_json, (sesh :current_token))\n json_respond response.body \n\n end", "def create\n @osoba = Osoba.new(params[:osoba])\n\n if @osoba.save\n render json: @osoba, status: :created, location: @osoba\n else\n render json: @osoba.errors, status: :unprocessable_entity\n end\n end", "def create\n @product_variety = ProductVariety.new(product_variety_params)\n\n respond_to do |format|\n if @product_variety.save\n format.js\n format.html { redirect_to @product_variety, notice: 'Product variety was successfully created.' }\n format.json { render action: 'show', status: :created, location: @product_variety }\n else\n format.js\n format.html { render action: 'new' }\n format.json { render json: @product_variety.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t tags = params[:tags].gsub(\" \",\"\").split(\",\")\n @vaga = Vaga.new(params[:vaga])\n\n\t empresa = Empresa.find(session[:user_id])\n\t empresa.nome_empresa = params[:empresa] if params[:empresa]\n\t empresa.save\n\t @vaga.empresa = empresa\n respond_to do |format|\n if @vaga.save\n\t\t @vaga.create_tags(tags)\n format.html { redirect_to(@vaga, :notice => 'Vaga was successfully created.') }\n format.xml { render :xml => @vaga, :status => :created, :location => @vaga }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @vaga.errors, :status => :unprocessable_entity }\n end\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 @tipo_veiculo = TipoVeiculo.new(tipo_veiculo_params)\n\n respond_to do |format|\n if @tipo_veiculo.save\n format.html { redirect_to @tipo_veiculo, notice: 'Tipo veiculo was successfully created.' }\n format.json { render :show, status: :created, location: @tipo_veiculo }\n else\n format.html { render :new }\n format.json { render json: @tipo_veiculo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @uva = Uva.new(uva_params)\n\n respond_to do |format|\n if @uva.save\n format.html { redirect_to @uva, notice: 'Uva was successfully created.' }\n format.json { render :show, status: :created, location: @uva }\n else\n format.html { render :new }\n format.json { render json: @uva.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @variety = Variety.new(variety_params)\n @product_id = params[:variety][:product_id]\n\n respond_to do |format|\n if @variety.save\n format.html { redirect_to @variety, notice: 'Variety was successfully created.' }\n format.json { render :show, status: :created, location: @variety }\n else\n format.html { render :new }\n format.json { render json: @variety.errors, status: :unprocessable_entity }\n end\n end\n end", "def post(url_variables:, body:)\n ensure_service_document\n\n end", "def create\n @volantino = Volantino.new(params[:volantino])\n\n respond_to do |format|\n if @volantino.save\n format.html { redirect_to @volantino, notice: 'Volantino was successfully created.' }\n format.json { render json: @volantino, status: :created, location: @volantino }\n else\n format.html { render action: \"new\" }\n format.json { render json: @volantino.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @vuelo = Vuelo.new(vuelo_params)\n\n respond_to do |format|\n if @vuelo.save\n format.html { redirect_to @vuelo, notice: 'Vuelo was successfully created.' }\n format.json { render :show, status: :created, location: @vuelo }\n else\n format.html { render :new }\n format.json { render json: @vuelo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ink_varnish = InkVarnish.new(params[:ink_varnish])\n\n respond_to do |format|\n if @ink_varnish.save\n format.html { redirect_to @ink_varnish, notice: 'Ink Varnish was successfully created.' }\n format.json { render json: @ink_varnish, status: :created, location: @ink_varnish }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ink_varnish.errors, status: :unprocessable_entity }\n end\n end\n end", "def venta_params\n params.require(:venta).permit(:documento, :serie, :numero, :dia, :nit, :nombre, :bienes, :servicios, :base, :iva, :total, :libr_venta_id)\n end", "def create\n megam_rest.post_promos(to_hash) #WONT BE USED AS OF NOW\n end" ]
[ "0.6051926", "0.58743495", "0.5856221", "0.58055484", "0.5707497", "0.57014376", "0.5692925", "0.5636187", "0.5629566", "0.5624502", "0.56223667", "0.55535567", "0.55518776", "0.5546741", "0.5546592", "0.5546083", "0.54289407", "0.5424694", "0.5424501", "0.5416451", "0.5370025", "0.53647435", "0.5356803", "0.5339339", "0.5323749", "0.53163016", "0.531598", "0.530942", "0.5305037", "0.52962613", "0.5290195", "0.52782845", "0.5273671", "0.52581984", "0.5251073", "0.5245069", "0.5244398", "0.5234666", "0.52339584", "0.52247065", "0.5222565", "0.52193224", "0.5214063", "0.52129185", "0.52069366", "0.5204566", "0.5200243", "0.51960415", "0.51878256", "0.51784724", "0.51601726", "0.5153864", "0.5151002", "0.5149912", "0.51457226", "0.5134838", "0.5134558", "0.513227", "0.51312184", "0.5129265", "0.51286614", "0.5120856", "0.5117548", "0.51027054", "0.50982517", "0.5097457", "0.5093042", "0.5089465", "0.50866127", "0.5082952", "0.5071221", "0.5069309", "0.5065751", "0.5065293", "0.5064799", "0.5063998", "0.5062602", "0.50620586", "0.50608706", "0.5059949", "0.50587714", "0.5056899", "0.50524974", "0.5051967", "0.50497717", "0.50456077", "0.5044998", "0.50440556", "0.504323", "0.5042464", "0.5041868", "0.5038404", "0.5031516", "0.5029303", "0.50226206", "0.5014873", "0.50139934", "0.50093156", "0.50079423", "0.500673" ]
0.6568733
0
PATCH/PUT /vargessos/1 PATCH/PUT /vargessos/1.json
def update respond_to do |format| if @vargesso.update(vargesso_params) format.html { redirect_to @vargesso, notice: 'Vargesso was successfully updated.' } format.json { render :show, status: :ok, location: @vargesso } else format.html { render :edit } format.json { render json: @vargesso.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "def update_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 patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end", "def patch!\n request! :patch\n end", "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend", "def patch(path, **args); end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def put!\n request! :put\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 patch(path, data, params = {}, request_options = {})\n request(:patch, path, data, params)\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!(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 patch options\n rest_request({ method: :patch }.merge(options))\n end", "def patch options\n rest_request({ method: :patch }.merge(options))\n end", "def rm_update path, data, msg\n\n re = rm_request path, data, 'PUT'\n puts re.body\n chk (re.code!='200'), msg + \"\\n#{re.code} #{re.msg}\\n\\n\"\n return true\n\nend", "def http_put(path, data, content_type = 'application/json')\n http_methods(path, :put, data, content_type)\n end", "def patch(path, opts = {})\n request(:patch, path, opts).body\n end", "def patch(path, body_params = {})\n debug_log \"PATCH #{@host}#{path} body:#{body_params}\"\n headers = { 'Content-Type' => 'application/json' }\n res = connection.run_request :put, path, body_params.to_json, headers\n debug_log \"Response status:#{res.status}, body:#{res.body}\"\n res\n end", "def 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(operation, path, value = nil)\n ensure_client && ensure_uri\n body = {\n 'op' => operation,\n 'path' => path,\n 'value' => value\n }\n response = @client.rest_patch(@data['uri'], { 'Content-Type' => 'application/json-patch+json', 'body' => [body] }, @api_version)\n @client.response_handler(response)\n end", "def patch\n end", "def update_tenant_maintenance_window(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/maintenance/{tenantId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def put(*args)\n request :put, *args\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(path)\n output { patch(path, params) }\n end", "def update(data = :object || :json)\n end", "def UpdateView params = {}\n \n APICall(path: 'views.json',method: 'PUT',payload: params.to_json)\n \n end", "def update # PATCH\n raise NotImplementedError\n end", "def update(attrs, path=nil)\n resp = api_client.put(path || url, JSON.dump(attrs))\n refresh(JSON.load(resp.body))\n end", "def update\n respond_to do |format|\n if @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 options={}\n client.put(\"/#{id}\", options)\n end", "def update_current_tenant_maintenance_window(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/maintenance\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def put(path, data = {})\n request 'PUT', path, body: data.to_json\n end", "def update\n respond_to do |format|\n if @varience.update(varience_params)\n format.html { redirect_to @varience, notice: 'Varience was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @varience.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(request)\n end", "def update(request)\n end", "def update_user_for_tenant(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/{tenantId}/users/{userId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\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_radios_for_array(args = {}) \n id = args['id']\n temp_path = \"/radios.json/{arrayId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"radioId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def api_put(path, data = {})\n api_request(:put, path, :data => data)\n end", "def patch(operation, path, value)\n response = @client.rest_patch(@data['uri'], 'body' => [{ op: operation, path: path, value: value }])\n @client.response_handler(response)\n end", "def patch(path, params)\n time(\"PATCH #{path}\") { Cloudflarer.new.patch(path, params) }\n end", "def update\n respond_to do |format|\n if @json.update(json_params)\n format.html { redirect_to @json, notice: 'Json was successfully updated.' }\n format.json { render :show, status: :ok, location: @json }\n else\n format.html { render :edit }\n format.json { render json: @json.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @json.update(json_params)\n format.html { redirect_to @json, notice: 'Json was successfully updated.' }\n format.json { render :show, status: :ok, location: @json }\n else\n format.html { render :edit }\n format.json { render json: @json.errors, status: :unprocessable_entity }\n end\n end\n end", "def rest_patch(base_uri,json_payload,params)\n begin\n @response = RestClient.patch(base_uri,json_payload,params)\n rescue => e\n puts @response.code\n end\n return @response\n end", "def update\n @var_conf = VarConf.find(params[:id])\n\n respond_to do |format|\n if @var_conf.update_attributes(params[:var_conf])\n format.html { redirect_to @var_conf, :notice => 'Var conf was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @var_conf.errors, :status => :unprocessable_entity }\n end\n end\n end", "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 put(*args)\n request(:put, *args)\n end", "def put(path = '/files/', params = {})\n request :put, path, params\n end", "def put payload, path = \"\"\n make_request(path, \"put\", payload)\n end", "def update!(**args)\n @json_schemas = args[:json_schemas] if args.key?(:json_schemas)\n @schema = args[:schema] if args.key?(:schema)\n end", "def update(*args)\n put(*args)\n end", "def update(*args)\n put(*args)\n end", "def update\n respond_to do |format|\n if @sivic_discipulo.update(sivic_discipulo_params_netested)\n format.html { redirect_to @sivic_discipulo, notice: 'Registro alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sivic_discipulo.errors, status: :unprocessable_entity }\n end\n end\n end", "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 respond_to do |format|\n if @resto.update(resto_params)\n format.html { redirect_to @resto, notice: 'Entry was successfully updated.' }\n format.json { render :show, status: :ok, location: @resto }\n else\n format.html { render :edit }\n format.json { render json: @resto.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(operation, path, value = nil)\n ensure_client && ensure_uri\n body = [{ 'op' => operation, 'path' => path, 'value' => value }]\n patch_options = { 'If-Match' => @data['eTag'] }\n response = @client.rest_patch(@data['uri'], patch_options.merge('body' => body), @api_version)\n @client.response_handler(response)\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 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 respond_to do |format|\n if @tipoenvolvido.update(tipoenvolvido_params)\n format.html { redirect_to @tipoenvolvido, notice: 'Tipoenvolvido was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tipoenvolvido.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(request)\n request.method = :patch\n request.call\n end", "def patch(url, payload, headers={})\n RestClient.patch url, payload, headers\n end", "def update\n respond_to do |format|\n if @patch.update(patch_params)\n format.html { redirect_to @patch, notice: 'Patch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @patch.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(path, opts = {}, &block)\n request(:patch, path, opts, &block)\n end", "def patch(path, opts = {}, &block)\n request(:patch, path, opts, &block)\n end", "def update_current_logged_in_users_password(args = {}) \n id = args['id']\n temp_path = \"/users.json/current/password\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"userId\")\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!(**args)\n @group_kinds = args[:group_kinds] if args.key?(:group_kinds)\n @json_path = args[:json_path] if args.key?(:json_path)\n @namespaces = args[:namespaces] if args.key?(:namespaces)\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 patch(path, to: nil, as: nil, **constraints, &blk)\n add_route(::Rack::PATCH, path, to, as, constraints, &blk)\n end", "def update\n# respond_to do |format|\n# if @req.update(req_params)\n format.json { render :json => {:status => 'success'}}\n# format.html { redirect_to @req, notice: 'Req was successfully updated.' }\n# format.json { render :show, status: :ok, location: @req }\n# else\n format.json { render :json => {:status => 'failed'}}\n# format.html { render :edit }\n# format.json { render json: @req.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 put :update\n end", "def update_array_for_tenant(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/{tenantId}/arrays/{arrayId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\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 @voprosy = Voprosy.find(params[:id])\n\n respond_to do |format|\n if @voprosy.update_attributes(params[:voprosy])\n format.html { redirect_to @voprosy, notice: 'Voprosy was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @voprosy.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 patch(operation, path, value)\n response = @client.rest_patch(@data['uri'], 'body' => [{ op: operation, path: path, value: value }])\n @client.response_handler(response)\n end", "def update\n respond_to do |format|\n if @rest_api.update(rest_api_params)\n format.html { redirect_to @rest_api, notice: 'Rest api was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @rest_api.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @osoba = Osoba.find(params[:id])\n\n if @osoba.update(params[:osoba])\n head :no_content\n else\n render json: @osoba.errors, status: :unprocessable_entity\n end\n end", "def patch(uri, options = T.unsafe(nil)); end", "def update\n @request.assign_json_attributes(params) if @request.resume?\n respond_to do |format|\n if @request.update(request_params)\n format.html { redirect_to @request, notice: 'Request was successfully updated.' }\n format.json { render :show, status: :ok, location: @request }\n else\n format.html { render :edit }\n format.json { render json: @request.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @json_schema = args[:json_schema] if args.key?(:json_schema)\n @name = args[:name] if args.key?(:name)\n @struct_schema = args[:struct_schema] if args.key?(:struct_schema)\n end", "def update!(**args)\n @json_schema = args[:json_schema] if args.key?(:json_schema)\n @name = args[:name] if args.key?(:name)\n @struct_schema = args[:struct_schema] if args.key?(:struct_schema)\n end", "def update(context)\n context.request.body.rewind # in case someone already read it\n\n begin\n data = JSON.parse(context.request.body.read)\n rescue JSON::ParserError\n context.halt(406, { status: 'error', message: 'Not acceptable JSON payload' }.to_json)\n end\n\n set_resource(context)\n\n begin\n permitted_params = resource_fields.map { |k| k[:name] }\n permitted_params = data.select { |k, _| permitted_params.include?(k) }\n\n if instance_variable_get(:\"@#{resource_name}\").update_attributes(permitted_params)\n instance_variable_get(:\"@#{resource_name}\").reload\n instance_variable_get(:\"@#{resource_name}\").to_json\n else\n errors = instance_variable_get(:\"@#{resource_name}\").errors.map { |k, v| \"#{k}: #{v}\" }.join('; ')\n context.halt(406, { status: 'error', message: errors }.to_json)\n end\n rescue StandardError => e\n context.halt(500, { status: 'error', message: e.message }.to_json)\n end\n end", "def patch; end", "def patch; end", "def update\n fn = params[:id].gsub('DOTDOT','.').gsub('SLASHSLASH','/')\n File.open(fn,'w+') { |f| \n f.puts params[:content]\n }\n respond_to do |format|\n format.json { render json: { success: true} }\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!(**args)\n @operations = args[:operations] if args.key?(:operations)\n @service_config_id = args[:service_config_id] if args.key?(:service_config_id)\n end", "def update\n respond_to do |format|\n if @jogo.update(jogo_params)\n format.html { redirect_to @jogo, notice: 'Jogo was successfully updated.' }\n format.json { render :show, status: :ok, location: @jogo }\n else\n format.html { render :edit }\n format.json { render json: @jogo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_resource(kind, data, body, pr)\n\n if body.size > 0\n result = parse_json(body,kind)\n data = result if !OpenNebula.is_error?(result)\n end\n\n resource = case kind\n when \"vdc\" then\n vdc_data=Hash.new\n vdc_id = nil\n data.each{|key,value|\n vdc_data[key.downcase.to_sym]=value if key!=\"id\"\n vdc_id = value if key==\"id\"\n }\n\n # Check parameters\n if !vdc_data[:hosts] || !vdc_id\n return [400, OZones::Error.new(\n \"Error: Couldn't update resource #{kind}. \" +\n \"Need ID and HOSTS to update.\").to_json]\n end\n\n # Check if the referenced Vdc exists\n vdc=OZones::Vdc.get(vdc_id)\n if !vdc\n error = OZones::Error.new(\"Error: Vdc \" +\n \"#{vdc_id} not found, cannot update Vdc.\")\n return [404, error.to_json]\n end\n\n # Get the zone where the Vdc belongs\n zone=OZones::Zones.get(vdc.zones.id)\n if !zone\n error = OZones::Error.new(\"Error: Zone \" +\n \"#{vdc.zones.id} not found, cannot update Vdc.\")\n return [404, error.to_json]\n end\n \n if (!vdc_data[:force] or vdc_data[:force].upcase!=\"YES\") and\n !host_uniqueness?(zone, vdc_data[:hosts], vdc_id.to_i)\n return [403, OZones::Error.new(\n \"Error: Couldn't update resource #{kind}. \" +\n \"One or several hosts belong to a different VDC \"+\n \"and no force option was provided.\").to_json]\n end\n\n rc = @ocaInt.update_vdc_hosts(zone, vdc, vdc_data[:hosts])\n\n if !OpenNebula.is_error?(rc)\n vdc.hosts = vdc_data[:hosts]\n vdc.get_host_acls!(rc)\n\n vdc.save\n\n if vdc.saved?\n return [200, vdc.to_json]\n else\n return [500, OZones::Error.new(\n \"Error: Couldn't update resource #{kind}.\").to_json]\n end\n\n else\n return [500, OZones::Error.new(\n \"Error: Couldn't update resource #{kind.upcase}.\" +\n \" Failed to update ACLs\").to_json]\n end\n else\n error = OZones::Error.new(\n \"Error: #{kind.upcase} resource update not supported\")\n return [404, error.to_json]\n end\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\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 put(path, body = nil, ctype = 'application/json')\n make_call(mk_conn(path, 'Content-Type': ctype,\n 'Accept': 'application/json'),\n :put, nil, body.to_json)\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", "def put(path, data=nil)\n request(:put, path, data)\n end" ]
[ "0.66866046", "0.64722985", "0.6425174", "0.64218205", "0.63731396", "0.61969095", "0.6184843", "0.61606044", "0.6082787", "0.60651094", "0.60651094", "0.6016754", "0.6015713", "0.6001262", "0.59550464", "0.59550464", "0.5949379", "0.59020805", "0.58992594", "0.58915335", "0.58846235", "0.5876263", "0.5863594", "0.58335006", "0.582035", "0.58114296", "0.58114296", "0.5783555", "0.5768703", "0.57618713", "0.5740317", "0.5739914", "0.5726337", "0.57256246", "0.5713414", "0.5709291", "0.5709232", "0.5705443", "0.5705443", "0.57028145", "0.5699767", "0.56987816", "0.568321", "0.56556493", "0.5648693", "0.5648693", "0.56399447", "0.56183904", "0.56173235", "0.56032395", "0.5601053", "0.55827117", "0.55749387", "0.55723", "0.55723", "0.5571278", "0.5563176", "0.55609363", "0.5560069", "0.5559877", "0.55553585", "0.5549868", "0.55469334", "0.5541783", "0.55409366", "0.55367166", "0.55367166", "0.5531049", "0.55309546", "0.5529467", "0.55293804", "0.5524062", "0.5523632", "0.5519898", "0.55128247", "0.5510148", "0.5509737", "0.5507101", "0.5503241", "0.54942924", "0.54925793", "0.54924446", "0.5490404", "0.5490404", "0.5489667", "0.5486646", "0.5486646", "0.5483023", "0.5478862", "0.54775614", "0.54758847", "0.5472044", "0.5463544", "0.5463544", "0.5463544", "0.5463544", "0.5461103", "0.54585034", "0.54578775", "0.54576355" ]
0.58184236
25
DELETE /vargessos/1 DELETE /vargessos/1.json
def destroy @vargesso.destroy respond_to do |format| format.html { redirect_to vargessos_url, notice: 'Vargesso was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def delete(path)\n repository = path.split(/\\//)[2]\n objectid = path.split(/\\//)[3]\n if storage_fetch(repository, objectid) && storage_delete(repository, objectid)\n ['200', {}, []]\n else\n ['404', {}, [\"Repository #{repository} or ObjectID #{objectid} not found: #{path}\"]]\n end\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def delete(path)\n path = relativize_path path\n\n Precog.connect self do |http|\n uri = Addressable::URI.new\n uri.query_values = { :apiKey => api_key }\n\n http.delete \"/ingest/v#{VERSION}/fs/#{path}?#{uri.query}\"\n end\n end", "def destroy\n @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 @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", "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 @nodo.destroy\n respond_to do |format|\n format.html { redirect_to nodos_url }\n format.json { head :no_content }\n end\n end", "def api_delete(path, data = {})\n api_request(:delete, path, :data => data)\n end", "def delete(path)\n request(:delete, path)\n end", "def destroy\n @storage = @client.storages.find(params[:id])\n @storage.destroy\n\n respond_to do |format|\n format.html { redirect_to client_url(@client) }\n format.json { head :no_content }\n end\n end", "def destroy\n @var_conf = VarConf.find(params[:id])\n @var_conf.destroy\n\n respond_to do |format|\n format.html { redirect_to var_confs_url }\n format.json { head :ok }\n end\n end", "def cmd_delete argv\n setup argv\n uuid = @hash['uuid']\n response = @api.delete(uuid)\n msg response\n return response\n end", "def delete\n request(:delete)\n end", "def delete(path)\n\t\trequest(path, :delete)\n\tend", "def delete\n client.delete(url)\n @deleted = true\nend", "def destroy\n @gasto = Gasto.find(params[:id])\n @gasto.destroy\n\n respond_to do |format|\n format.html { redirect_to gastos_url }\n format.json { head :no_content }\n end\n end", "def 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 @varience.destroy\n respond_to do |format|\n format.html { redirect_to variences_url }\n format.json { head :no_content }\n end\n end", "def delete(path)\n request 'DELETE', path\n end", "def destroy\n @distro = Distro.find(params[:id])\n @distro.destroy\n\n respond_to do |format|\n format.html { redirect_to distros_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @gethotelstaticdatagd = Gethotelstaticdatagd.find(params[:id])\n @gethotelstaticdatagd.destroy\n\n respond_to do |format|\n format.html { redirect_to gethotelstaticdatagds_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @cephalopod.destroy\n respond_to do |format|\n format.html { redirect_to cephalopods_url }\n format.json { head :no_content }\n end\n end", "def delete(path, params)\n headers = {:Authorization => \"token #{token}\", :content_type => :json, :accept => :json}\n res = RestClient.delete(\"#{github_api_uri}/#{path}\", params.to_json, headers)\n Yajl.load(res)\n end", "def destroy\n @server1 = Server1.find(params[:id])\n @server1.destroy\n\n respond_to do |format|\n format.html { redirect_to server1s_url }\n format.json { head :no_content }\n end\n end", "def delete(options={})\n connection.delete(\"/\", @name)\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 @distro.destroy\n respond_to do |format|\n format.html { redirect_to distros_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @dataload_ga = DataloadGa.find(params[:id])\n @dataload_ga.destroy\n\n respond_to do |format|\n format.html { redirect_to dataload_gas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @hdfs_path = HdfsPath.find(params[:id])\n @hdfs_path.destroy\n\n respond_to do |format|\n format.html { redirect_to hdfs_paths_url }\n format.json { head :ok }\n end\n end", "def delete(path)\n request(:delete, path)\n end", "def destroy\n @node = Node.find_key(params[:id] || params[:name])\n @node.destroy\n respond_to do |format|\n format.html { redirect_to deployment_path(@node.deployment_id) }\n format.json { render api_delete @node }\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 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 debug(\"#{self.class}::destroy\")\n\n #Retrieval of key\n if ((defined? $key) && !(($key.nil?) || ($key.empty?)))\n Puppet.debug('INFO: key already provided as a command parameter ' + $key)\n\n elsif (!($name.to_s.empty?) )\n\n #Retrieve key\n uriAttributeMap1 = {}\n uriAttributeMap1[:name] = $name\n resourceType = \"storage-service-levels\"\n $key = self.retrieveKeyOfObjectType('/api/1.0/slo/storage-service-levels', resourceType, uriAttributeMap1)\n\n end\n\n\n apiUri = '/api/1.0/slo/storage-service-levels/'+$key\n resourceType = \"storageservicelevel\"\n\n if(transport.http_delete_request(apiUri ,resourceType))\n if(resource[:name] != null)\n puts \"#{resourceType} : #{resource[:name]} successfully deleted\"\n\t\t\telse\n\t\t\t puts \" #{resourceType} successfully deleted\"\n\t\t\tend\n else\n if(resource[:name] != null)\n puts \" #{resourceType} : #{resource[:name]} deletion failed\"\n\t\t else\n\t\t\t puts \" #{resourceType} deletion failed\"\n\t\t end\n end\n\nend", "def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end", "def destroy\n @datoscontacto = Datoscontacto.find(params[:id])\n @datoscontacto.destroy\n\n respond_to do |format|\n format.html { redirect_to datoscontactos_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 destroy\n @ink_varnish = InkVarnish.find(params[:id])\n @ink_varnish.destroy\n\n respond_to do |format|\n format.html { redirect_to ink_varnishes_url }\n format.json { head :ok }\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 delete(*args)\n request(:delete, *args)\n end", "def delete(url, headers = {})\n http :delete, \"#{url}.json\", headers\n end", "def destroy\n @my_visa.destroy\n respond_to do |format|\n format.html { redirect_to my_visas_url, notice: 'My visa was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @gpath = Gpath.find(params[:id])\n @gpath.destroy\n\n respond_to do |format|\n format.html { redirect_to gpaths_url }\n format.json { head :no_content }\n end\n end", "def destroy\r\n checar_egresso_super\r\n @egresso.destroy\r\n respond_to do |format|\r\n format.html { redirect_to egressos_url, notice: 'Egresso excluído com sucesso.' }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @prod_cli.destroy\n respond_to do |format|\n format.html { redirect_to prod_clis_url, notice: 'produto excluido com sucesso.' }\n format.json { head :no_content }\n end\n end", "def delete!\n request! :delete\n end", "def destroy\n @storage_lun = StorageLun.find(params[:id])\n @storage_lun.destroy\n\n respond_to do |format|\n format.html { redirect_to storage_luns_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ovode = Ovode.find_by_url(params[:id])\n @ovode.destroy\n\n respond_to do |format|\n format.html { redirect_to ovodes_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 delete\n delete_from_server single_url\n end", "def destroy\n @voc = Voc.find(params[:id])\n @voc.destroy\n\n respond_to do |format|\n format.html { redirect_to vocs_url }\n format.json { head :no_content }\n end\n end", "def delete(path)\n with_remote do |http|\n http.delete(path)\n end\n end", "def destroy\n compute.delete_flavor(params[:id])\n \n\n respond_to do |format|\n format.html { redirect_to flavors_path }\n format.json { head :ok }\n end\n end", "def destroy\n @safra_verdoso = SafraVerdoso.find(params[:id])\n @safra_verdoso.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/safra_produtos/#{@safra_verdoso.safra_produto_id}/descontos\"}\n format.json { head :no_content }\n end\n end", "def destroy; delete end", "def destroy\n @sistema = Sistema.find(params[:id])\n @sistema.destroy\n\n respond_to do |format|\n format.html { redirect_to sistemas_url }\n format.json { head :no_content }\n end\n end", "def delete\n execute_request('DELETE') do |uri, headers|\n HTTP.http_client.delete(uri, header: headers)\n end\n end", "def destroy\n @verb.destroy\n\n head :no_content\n end", "def destroy\n client=Client.find_by_id(params[:id])\n if client != nil\n if client.destroy\n head 204\n end\n else\n head 404\n end\n end", "def destroy\n @ruby.destroy\n respond_to do |format|\n format.html { redirect_to rubies_url }\n format.json { head :no_content }\n end\n end", "def delete(path, params = {})\n Chirpy.request params.merge({:path => path, :method => 'delete'}.merge(authentication))\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 @segundo.destroy\n respond_to do |format|\n format.html { redirect_to segundos_url, notice: 'Segundo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @kota_stone.destroy\n respond_to do |format|\n format.html { redirect_to kota_stones_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @visto.destroy\n respond_to do |format|\n format.html { redirect_to vistos_url, notice: 'Visto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete(path, params={})\n request(:delete, path, params)\n end", "def delete(path, params={})\n request(:delete, path, params)\n end", "def delete(path, params={})\n request(:delete, path, params)\n end", "def delete(path, params={})\n request(:delete, path, params)\n end", "def delete(path, params={})\n request(:delete, path, params)\n end", "def delete(path, params={})\n request(:delete, path, params)\n end", "def delete(path, params={})\n request(:delete, path, params)\n end", "def delete\n start { |connection| connection.request http :Delete }\n end", "def destroy\n @vano = Vano.find(params[:id])\n @vano.destroy\n\n respond_to do |format|\n format.html { redirect_to vanos_url }\n format.json { head :no_content }\n end\n end", "def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end", "def destroy\n @asignatura.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def delete(url, vars={})\n send_request url, vars, 'DELETE'\n end", "def delete\n \n end", "def delete(path, params = {})\n request(:delete, path, params)\n end", "def delete(path, params = {})\n request(:delete, path, params)\n end", "def delete(path, params = {})\n request(:delete, path, params)\n end", "def destroy\n @gato.destroy\n respond_to do |format|\n format.html { redirect_to gatos_url, notice: 'Gato was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n api(\"Delete\")\n end", "def delete(path, params = {})\n post(path, params.merge(\"_method\" => \"delete\"))\n end", "def delete\n super \"/templates/#{template_id}.json\", {}\n end", "def destroy\n @tipo_distribucion.destroy\n respond_to do |format|\n format.html { redirect_to tipos_distribuciones_url }\n format.json { head :no_content }\n end\n end", "def delete(vmname)\n uri = @uri + \"/#{vmname}?api-version=#{api_version}\"\n uri\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 destroy\n @ginasio = Ginasio.find(params[:id])\n @ginasio.destroy\n\n respond_to do |format|\n format.html { redirect_to ginasios_url, :flash => { :notice => 'Ginasio apagado.' } }\n format.json { head :ok }\n end\n end", "def destroy\n \n keystone.delete_tenant(keystone.get_tenant(params[:id])[:id])\n\n respond_to do |format|\n format.html { redirect_to tenants_url }\n format.json { head :ok }\n end\n end" ]
[ "0.7290173", "0.6924094", "0.691229", "0.6852584", "0.6816154", "0.68042594", "0.67901915", "0.6726434", "0.66569155", "0.6648823", "0.6609653", "0.6606347", "0.66030306", "0.6594429", "0.65860224", "0.6576126", "0.6555466", "0.6549432", "0.65465164", "0.6537066", "0.65230995", "0.65101475", "0.65101475", "0.65101475", "0.65101475", "0.65002835", "0.64857316", "0.6483262", "0.6455672", "0.6447668", "0.64384985", "0.64377093", "0.6435277", "0.6430259", "0.6430259", "0.6429169", "0.641644", "0.6413025", "0.64127237", "0.64118004", "0.64098626", "0.64046264", "0.6397364", "0.63956374", "0.6390936", "0.638755", "0.638755", "0.6372793", "0.6368811", "0.63640213", "0.635983", "0.63557494", "0.6354255", "0.6352564", "0.63515645", "0.63478434", "0.6344504", "0.63426036", "0.6341908", "0.6336119", "0.63338935", "0.63308895", "0.63302577", "0.6330165", "0.63260233", "0.6323912", "0.6319937", "0.6315982", "0.6314062", "0.63113046", "0.630661", "0.62994504", "0.6297997", "0.62959105", "0.6295714", "0.62956303", "0.62956303", "0.62956303", "0.62956303", "0.62956303", "0.62956303", "0.62956303", "0.6293918", "0.62908953", "0.62878597", "0.6287018", "0.62853354", "0.62846553", "0.62799203", "0.62799203", "0.62799203", "0.6279495", "0.6276592", "0.6275361", "0.62711495", "0.6269409", "0.62661463", "0.6265218", "0.6263724", "0.6262343" ]
0.66861373
8
Use callbacks to share common setup or constraints between actions.
def set_vargesso @vargesso = Vargesso.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 set_actions\n actions :all\n end", "def define_action_helpers?; 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 revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def workflow\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def setup\n # override and do something appropriate\n end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def 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 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 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\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def setup(&block)\n define_method(:setup, &block)\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 init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\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 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 setup(easy)\n super\n easy.customrequest = @verb\n end", "def save_action; end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def 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 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", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def duas1(action)\n action.call\n action.call\nend", "def _handle_action_missing(*args); end" ]
[ "0.6164095", "0.6046031", "0.5945298", "0.59179014", "0.58890367", "0.58341795", "0.5776118", "0.5700777", "0.5700777", "0.5656277", "0.56218207", "0.5423995", "0.5411516", "0.5411516", "0.5411516", "0.5395004", "0.53783494", "0.53593004", "0.53412604", "0.534078", "0.5332865", "0.53135896", "0.52999926", "0.5297309", "0.5296569", "0.5261449", "0.5247048", "0.52376497", "0.52376497", "0.52376497", "0.52376497", "0.52376497", "0.52323204", "0.52310973", "0.523081", "0.5225785", "0.5219039", "0.52136266", "0.5208033", "0.520763", "0.5177365", "0.5175224", "0.5173357", "0.5166104", "0.5162502", "0.51573396", "0.5154547", "0.5153531", "0.51502854", "0.51436496", "0.5142863", "0.51330835", "0.5115634", "0.5115634", "0.511527", "0.5109693", "0.51076853", "0.5093146", "0.5090683", "0.50829846", "0.50819314", "0.50670373", "0.5055505", "0.5053398", "0.50504035", "0.50504035", "0.5037765", "0.5027292", "0.5024484", "0.50150335", "0.5014069", "0.50022113", "0.5001542", "0.49981874", "0.49915564", "0.49915564", "0.49880967", "0.4982312", "0.49787375", "0.49786067", "0.49687737", "0.49676532", "0.49602765", "0.49565676", "0.49550772", "0.495342", "0.49522525", "0.49463704", "0.49447197", "0.49362713", "0.49328062", "0.49280638", "0.49272856", "0.4927058", "0.49221697", "0.4919526", "0.49185994", "0.49184805", "0.49170163", "0.49168405", "0.49167764" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def vargesso_params params.require(:vargesso).permit(:user_id, :ano, :profundidade, :areaAplicacao, :teorCalcio) 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
slices this one works
def new_hq_slice_attributes=(hq_slice_attributes) hq_slice_attributes.each do |attributes| hq_slices.build(attributes) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def slice *args\n b, l = get_beginning_and_length *args\n if l.nil?\n self.at b\n else\n e = b + l - 1\n r = self.to_avi\n r.frames.each_with_index do |f, i|\n unless i >= b && i <= e\n f.data = nil\n end\n end\n r.frames\n end\n end", "def slice(p0, *rest) end", "def slice(*rest) end", "def slice(start, length)\n end", "def slice! *args\n b, l = get_beginning_and_length *args\n head, sliced, tail = ()\n sliced = l.nil? ? self.slice(b) : self.slice(b, l)\n head = self.slice(0, b)\n l = 1 if l.nil?\n tail = self.slice((b + l)..-1)\n self.clear\n self.concat head + tail\n sliced\n end", "def slice(*args)\n dup.slice!(*args)\n end", "def slice!(p0, *rest) end", "def slice!(p0, *rest) end", "def slice!(*args)\n offset, limit = extract_slice_arguments(*args)\n\n if self.limit || self.offset > 0\n offset, limit = get_relative_position(offset, limit)\n end\n\n update(:offset => offset, :limit => limit)\n end", "def main\n array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]\n array.each_slice(4) { |item| p item}\nend", "def slice(table)\n head, body, array_h, array_b = 4.times.map { [] }\n index = 0\n first_column = 0\n second_column = 1\n\n (0...table.original_columns * table.original_rows).each do |col_index|\n row = table.rows[index]\n array_h += [row[first_column]]\n array_b += [row[second_column]]\n\n if col_index % table.original_columns == 2\n head << array_h\n body << array_b\n array_h, array_b = [], []\n end\n index += 1\n end\n [head, body]\n end", "def test_slice01\n a1 = [\"a\", \"\\n\\n\\n\", \"b\", \"\\n\\n\\n\", \"c\", \"\\n\\n\"]\n a11 = [\"a\", \"\\n\\n\\n\", \"b\", \"\\n\\n\\n\", \"c\", \"\\n\\n\"] # a1.clone\n pt1 = Pt.new(a1.clone)\n pt2 = Pt.new(a11.clone)\n\n assert_equal pt1.to_a[0], pt1[0]\n # negative or too-big out-of-bound begin\n assert_nil a1.slice!( -98, 2)\n assert_nil pt1.slice!(-98, 2)\n assert_nil a1.slice!( 98, 2)\n assert_nil pt1.slice!(98, 2)\n assert_equal a11, a1\n assert_equal pt2, pt1\n\n assert_equal a11[4, 2], a1.slice!(4, 2)\n ptp = pt1.slice!(4, 2)\n assert_equal pt1.class, ptp.class\n assert_equal a11[4, 2], ptp.to_a\n assert_operator a11[4, 2], :!=, ptp # PlainText::Part != Array\n assert_equal a11[0..3], a1\n assert_equal a11[0..3], pt1.to_a\n assert_equal pt2[0..3], pt1\n\n # Negative size (Index, Size)\n a1 = a11.clone\n pt1 = Pt.new(a11.clone)\n assert_nil a1.slice!(4, -1)\n ptp = pt1.slice!(4, -1)\n assert_nil ptp\n assert_equal a11, a1\n assert_equal a11, pt1.to_a\n\n # Range exceeding (Index, Size)\n a1 = a11.clone\n pt1 = Pt.new(a11.clone)\n assert_equal a11[4, 6], a1.slice!(4, 6)\n ptp = pt1.slice!(4, 6)\n assert_equal pt1.class, ptp.class # PlainText::Part\n assert_equal a11[4, 2], ptp.to_a\n assert_operator a11[4, 2], :!=, ptp # PlainText::Part != Array\n assert_equal a11[0..3], a1\n\n # Range exceeding (Range)\n a1 = a11.clone\n pt1 = Pt.new(a11.clone)\n assert_equal a11[4..9], a1.slice!(4..9)\n ptp = pt1.slice!(4..9)\n assert_equal pt1.class, ptp.class # PlainText::Part\n assert_equal a11[4..-1],ptp.to_a\n assert_equal a11[4..9], ptp.to_a\n assert_operator a11[4..9], :!=, ptp # PlainText::Part != Array\n assert_equal a11[0..3], a1\n assert_equal a11[0..3], pt1.to_a\n\n # Null Range (Range)\n a1 = a11.clone\n pt1 = Pt.new(a11.clone)\n assert_equal [], a1.slice!(4..0)\n ptp = pt1.slice!(4..0)\n # assert_equal pt1.class, ptp.class # PlainText::Part -- No! In Ruby's specification (2.5), ptp is Array, not its subClass.\n assert_equal [], ptp.to_a\n # assert_operator [], :!=, ptp # PlainText::Part != Array -- The same\n assert_equal a11, a1\n assert_equal a11, pt1.to_a\n\n # Negative index (Index, size)\n a1 = a11.clone\n pt1 = Pt.new(a11.clone)\n assert_equal a11[-6, 2], a1.slice!(-6, 2)\n ptp = pt1.slice!(-6, 2)\n assert_equal pt1.class, ptp.class # PlainText::Part\n assert_equal a11[0..1], ptp.to_a\n assert_operator a11[0..1], :!=, ptp # PlainText::Part != Array\n assert_equal a11[2..-1], a1\n assert_equal a11[2..-1], pt1.to_a\n\n # Negative index (Range)\n a1 = a11.clone\n pt1 = Pt.new(a11.clone)\n assert_equal a11[-6..-5], a1.slice!(-6..-5)\n ptp = pt1.slice!(-6..-5)\n assert_equal pt1.class, ptp.class # PlainText::Part\n assert_equal a11[0..1], ptp.to_a\n assert_operator a11[0..1], :!=, ptp # PlainText::Part != Array\n assert_equal a11[2..-1], a1\n assert_equal a11[2..-1], pt1.to_a\n\n # Exception (Error)\n a1 = a11.clone\n pt1 = Pt.new(a11.clone)\n assert_raises(TypeError){ pt1['abc'] }\n assert_raises(TypeError){ a1[ (?a)..(?c)] }\n assert_raises(TypeError){ pt1[(?a)..(?c)] }\n assert_raises(ArgumentError){ pt1.slice!(0) } # Single element forbidden.\n assert_raises(ArgumentError){ pt1.slice!(0, 3) } # Odd-number elements forbidden.\n assert_raises(ArgumentError){ pt1.slice!(-1, 2) } # Odd-number elements forbidden.\n assert_raises(ArgumentError){ pt1.slice!(1, 2) } # Odd starting index.\n assert_raises(ArgumentError){ pt1.slice!(1..2) } # Odd starting index.\n end", "def chunk(array, slice)\n sliced_array = []\n array.each_slice(slice) do |num|\n sliced_array.push(num)\n end\n p sliced_array\nend", "def sub_slice(start = self.start, stop = self.stop)\r\n \treturn self.class.new(self.seq_region, start, stop, self.strand)\r\n end", "def __slices(n)\n\t\tbytes = Array.new\n\t\ti = 0\n\t\twhile i < size do\n\t\t\tbytes.push(__slice(i, n))\n\t\t\ti += n\n\t\tend\n\t\treturn bytes\n\tend", "def slices(num_slices)\n array_of_slices = []\n each_slice(length / num_slices) { |s| array_of_slices << s }\n array_of_slices\n end", "def slice(list, s, e)\n list[s..e]\nend", "def sub_slice(start = self.start, stop = self.stop)\n \treturn self.class.new(self.seq_region, start, stop, self.strand)\n end", "def slice(input, start, size, name: nil)\n _op(:slice, input, start, size: size, name: name)\n end", "def slice(input, start, size, name: nil)\n _op(:slice, input, start, size: size, name: name)\n end", "def test_slicing_arrays\n array = [:peanut, :butter, :and, :jelly]\n\n assert_equal [:peanut], array[0,1]\n assert_equal [:peanut, :butter], array[0,2]\n assert_equal [:and, :jelly], array[2,2]\n assert_equal [:and, :jelly], array[2,20]\n assert_equal [], array[4,0]\n assert_equal [], array[4,100]\n assert_equal nil, array[5,0]\n end", "def split(max_size = 100000, overlap = 0)\n \tsub_slices = Array.new\n i = 0\n \tself.start.step(self.length, max_size - overlap - 1) do |i|\n sub_slices.push(self.sub_slice(i, i + max_size - 1))\n end\n \ti -= (overlap + 1)\n sub_slices.push(self.sub_slice(i + max_size))\n \treturn sub_slices\n end", "def arraySlicePrint(a)\nputs \"Iterate over an array using 'each_slice'.\"\na.each_slice(4) {|value| puts value.join(',') }\n\nend", "def slice_from_start_and_length(start, length)\n result = []\n stop = start + length\n index = 0\n each do |item|\n break if index >= stop\n result << item if index >= start\n index += 1\n end\n result if index >= start\n end", "def test_0940_slice_before\n @@log.debug \"test_0940_slice_before starts\" if @@log.debug?\n assert_respond_to(@list, :slice_before, \"test_0940_slice_before_respond\")\n # Type check\n enum = @list.slice_before {|pers| pers.last[0] == \"B\"}\n type_check = enum.is_a? Enumerator\n assert(type_check,\"test_0940_slice_before_class\")\n # :TODO: Realistic example(s).\n @@log.debug \"test_0940_slice_before ends\" if @@log.debug?\n end", "def split(max_size = 100000, overlap = 0)\r\n \tsub_slices = Array.new\r\n i = 0\r\n \tself.start.step(self.length, max_size - overlap - 1) do |i|\r\n sub_slices.push(self.sub_slice(i, i + max_size - 1))\r\n end\r\n \ti -= (overlap + 1)\r\n sub_slices.push(self.sub_slice(i + max_size))\r\n \treturn sub_slices\r\n end", "def slice_without_hooks!( index_start_or_range, length = nil )\n\n @without_hooks = true\n\n slice = slice!( index_start_or_range, length )\n \n @without_hooks = false\n \n return slice\n \n end", "def slice_rows(x,y,w,h)\n\t\t(y..y+h-1).each do |i|\n\t\t\tyield @data[i][x..x+w-1]\n\t\tend\n\tend", "def each_slice(slice_width, &block)\n max = size\n p = 0\n while p < max\n yield self[p...p+slice_width]\n p += slice_width\n end\n end", "def slice(result_array, max_length=10)\n return result_array[0...max_length]\n end", "def slice(*args)\n case argc = args.size\n when 2 then slice_with_start_and_length(*args)\n when 1 then (arg = args.first).is_a?(Range) ? slice_with_range(arg) : at(arg)\n when 0 then raise ArgumentError, \"wrong number of arguments (0 for 1)\"\n else raise ArgumentError, \"wrong number of arguments (#{argc} for 2)\"\n end\n end", "def my_rotate(arr, offset=1)\n offset = offset % 4\n arr_take = arr.take(offset)\n arr_drop = arr.drop(offset)\n arr_drop + arr_take\nend", "def slice start, length\n if length == 1\n synchronize do\n decode @redis.lindex @redis_name, start\n end\n else\n synchronize do\n Array(@redis.lrange(@redis_name, start, start + length - 1)).map do |item|\n decode item\n end\n end\n end\n end", "def slice_range(limit_and_offset = limit_and_offset())\n limit, offset = limit_and_offset\n if limit || offset\n (offset||0)..(limit ? (offset||0)+limit-1 : -1)\n end\n end", "def slice(*args)\n self.class.new super\n end", "def slice!(*args)\n # lazy load the collection, and remove the matching entries\n orphaned = orphan_resources(super)\n\n # Workaround for Ruby <= 1.8.6\n compact! if RUBY_VERSION <= '1.8.6'\n\n unless orphaned.kind_of?(Enumerable)\n return orphaned\n end\n\n offset, limit = extract_slice_arguments(*args)\n\n query = if offset >= 0\n scoped_query(:offset => offset, :limit => limit)\n else\n query = scoped_query(:offset => (limit + offset).abs, :limit => limit).reverse\n\n # tell the Query to prepend each result from the adapter\n query.update(:add_reversed => !query.add_reversed?)\n end\n\n new_collection(query, orphaned)\n end", "def slice(text)\n text[from...to]\n end", "def slice!(*keys); end", "def slice(*args)\n check_corrupted\n\n if args[0].is_a?(Range) && !args[1]\n need_eles = args[0].begin + args[0].end\n elsif args[0] && !args[1]\n need_eles = args[0]\n elsif args[0] && args[1] && args[0] > 0 && args[1] > 0\n need_eles = args[0] + args[1]\n elsif args[0] < 0 || args[1] < 0\n raise ArgumentError, \"Slice cant take negative arguments.\"\n else\n raise ArgumentError, \"Dont now what to do with args: '#{args}'.\"\n end\n\n @eles ||= []\n cache_eles = need_eles - @eles.length if need_eles\n cache_ele(cache_eles) if need_eles && cache_eles > 0\n return @eles.slice(*args)\n end", "def slice(array, m, n)\n # Returns ALL the elements of an array from index m to index n, as a new array.\n # Returns nil if the indexes are invalid. \n\n if array.class != Array or m<0 or n<0 or m > array.size-1 or m > n or n > array.size-1\n return nil\n end\n \n return array[m..n]\nend", "def __slice(i, n)\n\t\tif i < 0 || i >= size then\n\t\t\traise IndexError\n\t\tend\n\t\treturn Buffer.__new__(@bytes[i, [i + n, size - 1].min])\n\tend", "def slice(start=nil,_end=nil)\n if !block_given? && start == nil && _end == nil\n return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:slice, []).call(),::Vertx::Buffer)\n elsif start.class == Fixnum && _end.class == Fixnum && !block_given?\n return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:slice, [Java::int.java_class,Java::int.java_class]).call(start,_end),::Vertx::Buffer)\n end\n raise ArgumentError, \"Invalid arguments when calling slice(start,_end)\"\n end", "def slices(n = nix)\n\t\tif n.nix?\n\t\t\tn = 16\n\t\telse\n\t\t\tBuffer.__assert_positive(n)\n\t\tend\n\t\treturn __slices(n)\n\tend", "def preslice_filter filter\n slices = []\n steps = filter.shape[0] / 2\n steps.times do |i|\n f_start = steps-i\n f_end = -1-i\n if filter.rank == 2\n slices << filter[f_start..f_end, true]\n else\n slices << filter[f_start..f_end]\n end\n end\n slices\n end", "def slice *keys\n dup.slice!(*keys)\n end", "def divide_to_slices(array, slice_count)\n slice_size = ((array.length.to_f / slice_count).ceil).to_i\n return array.each_slice(slice_size)\n end", "def [](slice)\n slice.respond_to?(:each) ? slice.map{|i| recover_at(i) } : recover_at(slice)\n end", "def slice(i, n = nix)\n\t\tif n.nix?\n\t\t\tn = 16\n\t\telse\n\t\t\tBuffer.__assert_positive(n)\n\t\tend\n\t\treturn __slice(i, n)\n\tend", "def test_0650_each_slice\n @@log.debug \"test_0650_each_slice starts\" if @@log.debug?\n assert_respond_to(@list, :each_slice, \"test_0650_each_slice_respond\")\n # Type check.\n enum = @list.each_slice(2)\n result = enum.is_a? Enumerator\n assert(result,\"test_0650_each_slice_class\") \n # Check each array slice.\n pass = 0\n @list.each_slice(2) {|suba|\n pass += 1\n case pass\n when 1\n assert_equal([@aen, @bsb], suba, \"test_0650_each_slice_p1\")\n when 2\n assert_equal([@cab, @dad], suba, \"test_0650_each_slice_p2\")\n else\n fail(\"test_0650_each_slice_invalid\")\n end\n }\n #\n pass = 0\n @list.each_slice(3) {|suba|\n pass += 1\n case pass\n when 1\n assert_equal([@aen, @bsb, @cab], suba, \"test_0650_each_slice_p1b\")\n when 2\n assert_equal([@dad], suba, \"test_0650_each_slice_p2b\")\n else\n fail(\"test_0650_each_slice_invalid_b\")\n end\n }\n @@log.debug \"test_0650_each_slice ends\" if @@log.debug?\n end", "def slice!(*keys)\n replace(slice(*keys))\n end", "def slice(*args)\n Vector[*to_a.slice(*args)]\n end", "def ari_slice(arr)\n start_diff=nil\n start_idx=nil\n rtn=[]\n idx=0\n until idx>arr.length-1\n if arr[idx+1] && arr[idx+2]\n if arr[idx]-arr[idx+1]==arr[idx+1]-arr[idx+2] &&start_diff.nil?\n start_diff=arr[idx]-arr[idx+1]\n start_idx=idx\n idx+=2\n elsif start_diff.nil?\n idx+=1\n elsif start_diff && start_diff==arr[idx]-arr[idx+1]\n idx+=1\n elsif start_diff\n rtn<< arr[start_idx..idx]\n start_idx=nil\n start_diff=nil\n idx+=1\n end\n elsif arr[idx+1]\n if start_diff && start_diff==arr[idx]-arr[idx+1]\n idx+=1\n elsif start_diff\n rtn<< arr[start_idx..idx]\n start_idx=nil\n start_diff=nil\n idx+=1\n else\n idx+=1\n end\n else\n if start_diff\n rtn<< arr[start_idx..idx]\n start_idx=nil\n start_diff=nil\n idx+=1\n else\n idx+=1\n end\n end\n end\n rtn\nend", "def my_rotate(arr, offset=1)\n # your code goes here\n drop(offset) + take(offset)\n\nend", "def slice_images(opts) \n slices = @slices\n output = \"\"\n\n slices.each do |name, slice|\n # If we modify the canvas, we'll place the modified canvas here.\n # Otherwise, consumers will use slice[:file] [:canvas] or [:contents]\n # to get the original data as needed.\n slice[:canvas] = nil\n \n # In any case, if there is one, we need to get the original file and canvas;\n # this process also tells us if the slice is 2x, etc.\n canvas = canvas_for slice, opts\n\n # Check if a canvas is required\n must_slice = (slice[:left] != 0 or slice[:right] != 0 or slice[:top] != 0 or slice[:bottom] != 0)\n if must_slice or slice[:x2]\n if canvas.nil?\n throw \"Chance could not load file '#{slice[:path]}'.\" +\n \"If it is not a PNG, RMagick is required to slice or use @2x mode.\"\n end\n\n f = slice[:proportion]\n\n # RMagick or ChunkyPNG? 'columns' is RMagick\n if canvas.respond_to?('columns')\n canvas_width = canvas.columns\n canvas_height = canvas.rows\n else\n canvas_width = canvas.width\n canvas_height = canvas.height\n end\n\n if must_slice\n rect = nil\n\n # The math that uses canvas_width and canvas_height needs to return numbers that,\n # when multiplied by f, are valid. So, divide by f first.\n rect = slice_rect(slice, canvas_width / f, canvas_height / f)\n\n if not rect.nil?\n \n ## CHECK CACHE ##\n file = file_for(slice, opts)\n cached_canvas = Chance::Instance::Slicing.get_canvas_from_cache(file, rect)\n if cached_canvas\n slice[:canvas] = cached_canvas\n else\n slice[:canvas] = canvas.crop(rect[:left] * f, rect[:top] * f, rect[:width] * f, rect[:height] * f)\n Chance::Instance::Slicing.add_canvas_to_cache(slice[:canvas], file, rect)\n end\n \n canvas_width = rect[:height] * f\n canvas_height = rect[:width] * f\n end\n end\n\n slice[:target_width] = canvas_width / f\n slice[:target_height] = canvas_height / f\n end\n \n \n\n end\n \n end", "def slice_row inimage, rowbeg, rowend, outimage\n m_begin \"slice_row\"\n img = get_image(inimage)\n slice = img.excerpt(0, rowbeg, img.columns, rowend-rowbeg)\n put_image(outimage, slice)\n m_end \"slice_row\"\n end", "def slice!(*keys)\r\n replace(slice(*keys))\r\n end", "def slice!(*keys)\r\n replace(slice(*keys))\r\n end", "def slice!(index, length = undefined)\n index += @length if index < 0\n\n return if index >= @length || index < 0\n\n if length\n `self.splice(index, index + length)`\n else\n `self.splice(index, 1)[0]`\n end\n end", "def slice!(slice = nil)\n raise(Exception, \"Slicing unavailable!\") unless sliced?\n if slice.present?\n if slice.to_i.in?(1..slice_number)\n @current_slice = slice.to_i\n else\n raise(ArgumentError, \"Slice number must be Integer in (1..#{slice_number}). #{slice.inspect} passed.\")\n end\n end\n self\n end", "def slice( range)\n ::Vector.elements( self.to_a.slice(range) )\n end", "def safe_slice(s, start)\n if start >= s.length\n []\n else\n s[start..-1]\n end\nend", "def offset(*) end", "def slice(*args, &block)\n sort_if_needed\n @rules.slice(*args, &block)\n end", "def slice!(*keys)\n replace(slice(*keys))\n end", "def slice!(*keys)\n replace(slice(*keys))\n end", "def slice!(*keys)\n replace(slice(*keys))\n end", "def padded_slices\n normalize_plaintext.chars.each_slice(size).to_a.tap do |*_, last|\n (size - last.size).times { last << nil } \n end\n end", "def sub(array)\n arr = []\n array.each_index do |i|\n (i...array.length).each do |j|\n arr << array[i..j]\n end\n end\n arr \nend", "def slice_records!\n @number_of_records ||= @records.length\n\n @records = @records.slice(0, per_page) if @number_of_records > per_page\n end", "def slices(length)\n last = length - 1\n\t\tfirst = 0\n\n if last > sequence.length - 1\n raise ArgumentError, \"Sub-sequence length must be <= given sequence\"\n end\n\n sub_sequences = []\n\t\twhile last < sequence.length\n sub_sequences << sequence.slice(first..last)\n first += 1\n last += 1\n end\n sub_sequences\n\n\tend", "def my_rotate(arr, offset=1)\n # your code goes here\n arr.drop(offset % arr.length) + arr.take(offset % arr.length)\nend", "def slice(string, marker1, marker2)\n i = marker1\n output = \"\"\n while i >= marker1 && i <= marker2 \n output += string[i]\n i += 1\n end\n return output\nend", "def my_rotate(arr, offset=1)\n split_idx = offset % arr.length\n arr.drop(split_idx) + arr.take(split_idx) \nend", "def slice(range, options = {})\n start, finish = range_pair(range)\n fetch_range :zrange, start, finish, options\n end", "def slice_column inimage, colbeg, colend, outimage\n m_begin \"slice_column\"\n img = get_image(inimage)\n slice = img.excerpt(colbeg, 0, colend-colbeg, img.rows)\n put_image(outimage, slice)\n m_end \"slice_column\"\n end", "def partial_slide(step)\n [start_pos[0] + move_dir[0] * step, start_pos[1] + move_dir[1] * step]\n end", "def shift; self.sections.each(&:shift); end", "def slice!(start, length = nil)\n result = case start\n when Range, Array\n trim *range_pair(start)\n else\n trim(start, start + length - 1)\n end\n Redis::Future === result ? result : to_a\n end", "def slice(index, length = undefined)\n index += @length if index < 0\n\n return if index >= @length || index < 0\n\n if length\n `self.slice(index, index + length)`\n else\n `self.slice(index, 1)[0]`\n end\n end", "def limit_and_offset\n r = super\n if r.first == 1\n r\n else\n [1, r[1]]\n end\n end", "def slices(count)\n raise ArgumentError, 'Argument given greater than original string' if count > @string_number.length\n numbers = @string_number.chars.map(&:to_i)\n\n numbers.each_index.with_object([]) do |index, slices|\n break slices if index > (numbers.size - count)\n slices << numbers[index, count]\n end\n end", "def each_row_slice(slice_size = 100, batch = ETL::Batch.new)\n slice = []\n each_row(batch) do |row_in|\n slice << row_in\n if slice.length >= slice_size\n yield slice\n slice = []\n end\n end\n yield slice if slice.length > 0\n end", "def my_rotate(arr, offset=1)\n # your code goes here\n shift = offset % arr.length\n arr.drop(shift) + arr.take(shift)\nend", "def slice(start=0,stop=self.length,strand=1) \n self.genome_db.connect_to_genome_new\n seq_region = Ensembl::Core::SeqRegion.find_by_name(self.name)\n return Ensembl::Core::Slice.new(seq_region, start, stop, strand) \n end", "def slice(arg, length = (missing_length = true))\n if missing_length\n if arg.is_a?(Range)\n from, to = arg.begin, arg.end\n from += size if from < 0\n return nil if from < 0\n to += size if to < 0\n to += 1 if !arg.exclude_end?\n length = to - from\n length = 0 if length < 0\n list = self\n while from > 0\n return nil if list.empty?\n list = list.tail\n from -= 1\n end\n list.take(length)\n else\n at(arg)\n end\n else\n return nil if length < 0\n arg += size if arg < 0\n return nil if arg < 0\n list = self\n while arg > 0\n return nil if list.empty?\n list = list.tail\n arg -= 1\n end\n list.take(length)\n end\n end", "def break(len)\n [self[0,len],self[len..-1]]\n end", "def sliced_nodes\n @sliced_nodes ||= begin\n items = object\n items[starting_offset..-1]\n end\n end", "def groupSlice(fireflies)\n \n unit_one = fireflies.shuffle.each_slice(4).to_a\n unit_one[0] << unit_one.pop\n unit_one[0].flatten!\n\n unit_two = fireflies.shuffle.each_slice(4).to_a\n unit_two[0] << unit_two.pop\n unit_two[0].flatten!\n \n unit_three = fireflies.shuffle.each_slice(4).to_a\n unit_three[0] << unit_three.pop\n unit_three[0].flatten!\nend", "def findSlice(linkedlist, k)\n return linkedlist.slice(-k)\nend", "def slice_from_B(arr, reduction)\n n = arr.length\n result = [[]]\n arr.each_with_index do |row, i|\n row.each_with_index do |cell, j|\n if j >= reduction and j < n and i >= 0 and i < (n - reduction)\n result << [] if result[i].nil?\n result[i] << cell\n end\n end\n end\n result\nend", "def together_slice(*args)\n if_not_contain_array_rails_type_error\n reduce([]) { |ret, list|ret << list.slice(*args) }\n end", "def slice_number\n sliced? ? slicing.slice_number : 1\n end", "def slice=(args)\n case args[1]\n when Range\n slice_set(args[0], args[1].begin, args[1].last)\n else\n slice_set(args[0], args[1], args[2])\n end\n end", "def new_slice\n pause(slice_delay) if slice_delay\n self[:index] = nil\n self[:value] = nil\n end", "def slice_of_css(start, stop)\n start == stop ? [start] : [start, *slice_of_css(start.next, stop)]\nend", "def slices\n @slices ||= SliceRegistrar.new(self)\n end", "def subsequence(start, stop)\n \treturn self.seq.slice(start - 1, (stop - start) + 1)\n end", "def split(position)\n end", "def split(position)\n end", "def my_rotate(arr, offset=1)\r\n # your code goes here\r\n # take first offset elements and append to end of array\r\n shift = offset % arr.length\r\n arr.drop(shift) + arr.take(shift)\r\nend", "def cut\n count = @cards.count\n rnd = Random.rand(count/3)\n cut_point = (count/3 + rnd)\n @cards = @cards.slice(cut_point, count - cut_point) + @cards.slice(0, cut_point)\n end" ]
[ "0.74878645", "0.7228833", "0.7188829", "0.71833205", "0.71593934", "0.68503594", "0.68153834", "0.68153834", "0.6719295", "0.66204065", "0.66171", "0.655352", "0.6506526", "0.64925563", "0.64602286", "0.6389715", "0.63872993", "0.6297073", "0.62925357", "0.62925357", "0.62690806", "0.62464297", "0.6202079", "0.61823744", "0.6149123", "0.6146435", "0.6142425", "0.6128568", "0.61250097", "0.6092503", "0.60854673", "0.60793275", "0.60749966", "0.6072378", "0.6063055", "0.6035612", "0.60341156", "0.6020432", "0.60050076", "0.60048324", "0.5999142", "0.5929843", "0.5927313", "0.5924203", "0.59147584", "0.5912001", "0.59079576", "0.59073263", "0.5906232", "0.58808535", "0.5860814", "0.58422405", "0.58357155", "0.57755333", "0.57603294", "0.57527655", "0.57527655", "0.5749322", "0.5741922", "0.57408416", "0.573557", "0.57103163", "0.5689847", "0.5682823", "0.5682823", "0.5682823", "0.56753933", "0.5669605", "0.5651105", "0.56467", "0.5646116", "0.56394404", "0.56371146", "0.5636018", "0.5605578", "0.5597805", "0.55897456", "0.5579761", "0.55790263", "0.5574248", "0.5564106", "0.5563291", "0.556058", "0.55516815", "0.55496323", "0.5543625", "0.5542338", "0.55300045", "0.55208284", "0.5508802", "0.55059004", "0.5501682", "0.5500488", "0.5495928", "0.5487617", "0.54855514", "0.54811114", "0.54785615", "0.54785615", "0.5473221", "0.5466192" ]
0.0
-1
diskarrays this one works
def new_hq_diskarray_attributes=(hq_diskarray_attributes) hq_diskarray_attributes.each do |attributes| hq_diskarrays.build(attributes) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handle_extent_array\n bytecounts, byteoffsets, startblocks, fileoffsets, partitions = [], [], [], [], []\n @extentinfo[:extent].each do |f|\n bytecounts << f[:bytecount]\n byteoffsets << f[:byteoffset]\n startblocks << f[:startblock]\n fileoffsets << f[:fileoffset]\n partitions << f[:partition]\n end\n @bytecount = bytecounts.join(',')\n @byteoffset = byteoffsets.join(',')\n @startblock = startblocks.join(',')\n @fileoffset = fileoffsets.join(',')\n @partition = partitions.join(',')\n end", "def keys\n @disk.keys\n end", "def list_partitions #by nelsongs\n\treturn `fdisk -l | grep /dev | grep -v Disk | awk '{print $1}'`.chomp.split\nend", "def attach_disks_specs\n attach_disk_array = []\n extraconfig = []\n attach_spod_array = []\n attach_spod_disk_info = {}\n\n pos = { :ide => 0, :scsi => 0 }\n disks_each(:no_exists?) do |disk|\n disk.one_item['TYPE'] == 'CDROM' ? k = :ide : k = :scsi\n\n if disk.storpod?\n spec = calculate_add_disk_spec(disk.one_item, pos[k])\n attach_spod_array << spec\n\n controller_key = spec[:device].controllerKey\n unit_number = spec[:device].unitNumber\n\n unit_ctrl = \"#{controller_key}-#{unit_number}\"\n attach_spod_disk_info[unit_ctrl] = disk.id\n else\n aspec = calculate_add_disk_spec(disk.one_item, pos[k])\n extra_key = \"opennebula.mdisk.#{disk.one_item['DISK_ID']}\"\n extra_value = aspec[:device].key.to_s\n\n attach_disk_array << aspec\n extraconfig << { :key => extra_key, :value => extra_value }\n end\n\n pos[k]+=1\n end\n\n { :disks => attach_disk_array,\n :spods => attach_spod_array,\n :spod_info => attach_spod_disk_info,\n :extraconfig => extraconfig }\n end", "def build_ftk_disk_items(coll_pid, disk_image_files_dir, computer_media_photos_dir)\n assembler = FtkDiskImageItemAssembler.new(:collection_pid => coll_pid, :disk_image_files_dir => disk_image_files_dir, :computer_media_photos_dir => computer_media_photos_dir)\n assembler.process\nend", "def data_files\n bag.bag_files.map {|f| Pathname.new(f) }\n end", "def objects\n # array to hold objects being backed up\n objects = []\n result = veeamconfig('job', 'info', '--name', \"#{@resource[:name]}\").lines\n\n # loop through every line of output\n result.each do |line|\n # the Include Disk lines are what we need\n if line.include? 'Include Disk:'\n # tease out the disk/volume being backed up\n object = line.split(': ')[1].strip\n # append the disk/volume to the array\n objects << object\n end\n end\n\n # return the disks/volumes being backed up, sorted properly\n return objects.sort_by(&:downcase)\n end", "def ocs_storages_disk_only\n disks = []\n for o in ocs_storages\n if o.TYPE == 'disk'\n disks << o\n end\n end\n disks\n end", "def backing_store\n \tbs = {}\n\tnoko_details.xpath('/domainsnapshot/domain/devices/disk').map do |ddsk|\n\t next if ddsk.xpath('@device').text != \"disk\"\n\t next if ddsk.xpath('@snapshot').text == \"external\"\n\t sf = ddsk.xpath('source/@file').text\n\t td = ddsk.xpath('target/@dev').text\n\t bs[td] = sf\n\tend\n\tbs\n end", "def disks\n \tbs = {}\n\tnoko_details.xpath('/domain/devices/disk').map do |ddsk|\n\t next if ddsk.xpath('@device').text != \"disk\"\n\t next if ddsk.xpath('@snapshot').text == \"external\"\n\t sf = ddsk.xpath('source/@dev','source/@file').text\n\t td = ddsk.xpath('target/@dev').text\n\t bs[td] = sf\n\tend\n\tbs\n end", "def all_disks\n DB[\"select distinct d.path, d.id from dirs d\n join files f on d.id = f.dir_id\n where f.is_music = 't'\"]\nend", "def add_instance_disk(array, instance, disk)\n if instance.managed_disk?\n disk_type = 'managed'\n disk_location = disk.managed_disk.id\n managed_disk = @managed_disks.find { |d| d.id.casecmp(disk_location).zero? }\n\n if managed_disk\n disk_size = managed_disk.properties.disk_size_gb.gigabytes\n mode = managed_disk.try(:sku).try(:name)\n else\n _log.warn(\"Unable to find disk information for #{instance.name}/#{instance.resource_group}\")\n disk_size = nil\n mode = nil\n end\n else\n disk_type = 'unmanaged'\n disk_location = disk.try(:vhd).try(:uri)\n disk_size = disk.try(:disk_size_gb).try(:gigabytes)\n\n if disk_location\n uri = Addressable::URI.parse(disk_location)\n storage_name = uri.host.split('.').first\n container_name = File.dirname(uri.path)\n blob_name = uri.basename\n\n storage_acct = @storage_accounts.find { |s| s.name.casecmp(storage_name).zero? }\n mode = storage_acct.try(:sku).try(:name)\n\n if @options.get_unmanaged_disk_space && disk_size.nil?\n storage_keys = @sas.list_account_keys(storage_acct.name, storage_acct.resource_group)\n storage_key = storage_keys['key1'] || storage_keys['key2']\n blob_props = storage_acct.blob_properties(container_name, blob_name, storage_key)\n disk_size = blob_props.content_length.to_i\n end\n end\n end\n\n disk_record = {\n :device_type => 'disk',\n :controller_type => 'azure',\n :device_name => disk.name,\n :location => disk_location,\n :size => disk_size,\n :disk_type => disk_type,\n :mode => mode\n }\n\n array << disk_record\n end", "def list_nix_partitions # nelsongs\n\treturn `fdisk -l | grep /dev | grep -v Disk | awk '{if ($2==\"*\" && $6==\"83\") print $1;else {if ($5==\"83\") print $1}}'`.chomp.split\nend", "def path_array\n a = []\n each_filename { |ea| a << ea }\n a\n end", "def list_nix_partitions_with_size_and_type # nelsongs\n\t`fdisk -l | grep /dev | grep -v Disk | awk '{if ($2==\"*\" && ($6==\"83\" || $6==\"82\")) print $1\":\"$5\":\"$6;else {if ($5==\"83\" || $5==\"82\") print $1\":\"$4\":\"$5}}' | sed s/+//g`.split\nend", "def readDataset\n entries = Array.new\n Dir.entries(DATASET_DIR).sort.each do |x|\n if x != \".\" and x != \"..\"\n entries << DatasetEntry.new(File.join(DATASET_DIR, x))\n end\n end\n entries\nend", "def create_from_disk(*filenames); end", "def setup_attached_raid_array(system_arch, devices, raid_device = '/dev/md0', raid_type = 0, clone = false)\n partitions = devices.collect {|device| \"#{device}1\" }\n\n unless clone\n partition_devices(devices)\n initialize_raid_array(system_arch, devices, raid_device, raid_type)\n else\n assemble_raid_array(partitions, raid_device, raid_type)\n end\n `echo DEVICE #{partitions.join(' ')} |tee -a /etc/mdadm.conf`\n\n # RAID device name can be a symlink on occasion, so we\n # want to de-reference the symlink to keep everything clear.\n raid_info = \"/dev/md0\"\n raid_scan_info = `/sbin/mdadm --detail --scan 2>&1`\n puts \"RAID Scan Info: #{raid_scan_info}\"\n if raid_scan_info =~ /cannot open/\n # This happens occasionally on CentOS 6:\n # $ /sbin/mdadm --detail --scan\n # mdadm: cannot open /dev/md/0_0: No such file or directory\n # mdadm: cannot open /dev/md/1_0: No such file or directory\n #\n # This is tied to how the raid array was created, especially if the array was created with an older version of mdadm. \n # See https://bugzilla.redhat.com/show_bug.cgi?id=606481 for a lengthy discussion. We should really be naming RAID \n # arrays correctly and using the HOMEHOST setting to re-assemble it.\n #\n # As a stop-gap, try to use the specified raid_device name passed into this method.\n raid_info = raid_device\n\n # We need to manually retrieve the UUID of the array\n array_uuid = `mdadm --detail #{raid_device}|grep UUID|awk '// { print $3; }'`.strip\n\n # We have to manually update mdadm.conf as well\n #`echo ARRAY #{raid_device} level=raid#{raid_type.to_s} num-devices=#{devices.count.to_s} meta-data=0.90 UUID=#{array_uuid} |tee -a /etc/mdadm.conf`\n `echo ARRAY #{raid_device} level=raid#{raid_type.to_s} num-devices=#{devices.count.to_s} UUID=#{array_uuid} |tee -a /etc/mdadm.conf`\n else\n raid_info = raid_scan_info.split(\"\\n\")[-1].split()[1]\n end\n raid_device_real_path = Pathname.new(raid_info).realpath.to_s\n puts \"Using raid device: #{raid_info}. Real path: #{raid_device_real_path}\"\n \n raid_device_real_path\n end", "def disk_all(cfg)\n ignored = cfg['ignore_fs'] || 'tmpfs'\n ignore_fs = \"fstype!~\\\"#{ignored}\\\"\"\n query = @client.percent_query_free(\n \"node_filesystem_files{#{ignore_fs}}\",\n \"node_filesystem_files_free{#{ignore_fs}}\"\n )\n prepare_metrics('disk_all', @client.query(query))\n end", "def splitDirectory(directory, array, hash)\n array.each do |num|\n splitData(directory, hash[num])\n end\nend", "def disk_specs(path)\n specs = []\n unit = 0\n if resource[:virtual_disks]\n resource[:virtual_disks].each do |vd|\n size = vd[\"size\"].to_i * 1024 * 1024\n specs << disk_spec(path, size, unit)\n unit += 1\n end\n else\n specs << disk_spec(path, resource[:disk_size], unit)\n end\n\n specs\n end", "def data_files\n data_file_names.map! do |filename|\n Bitcask::DataFile.new filename\n end\n end", "def memos; end", "def memos; end", "def 500_files(input)\n # naive solution is to flatten and sort\n\n \nend", "def cluster_ordinations_files\n clustering_files.to_a\n end", "def list_nix_partitions_with_size # nelsongs \n\treturn `fdisk -l | grep /dev | grep -v Disk | awk '{if ($2==\"*\" && $6==\"83\") print $1\":\"$5;else {if ($5==\"83\") print $1\":\"$4}}' | sed s/+//g`.chomp.split\nend", "def files; end", "def files; end", "def files; end", "def files; end", "def files; end", "def files; end", "def list_swap_partitions_with_type_and_size # nelsongs\n\treturn `fdisk -l | grep /dev | grep -v Disk | awk '{if ($2==\"*\" && $6==\"82\") print $1\":\"$5\":\"$6;else {if ($5==\"82\") print $1\":\"$4\":\"$5}}' | sed s/+//g`.chomp.split\nend", "def file_list\n end", "def initialize_raid_array(system_arch, device_list, raid_device = '/dev/md0', raid_type = 0)\n partitions = device_list.collect {|device| \"#{device}1\" }\n\n puts \"Creating RAID-#{raid_type.to_s} array #{raid_device} ...\"\n command = \"/sbin/mdadm --create #{raid_device} --level #{raid_type.to_s} --raid-devices #{partitions.length} #{partitions.join(' ')}\"\n puts command\n puts `#{command}`\n\n format_filesystem(system_arch, raid_device)\n end", "def split_pdfs!(list, density=300, format=:jpg)\n\n #Process each of the command-line arguments;\n #potentially transforming them into lists of split files.\n list.map! { |pdf| split_pdf(pdf, density, format) }\n\n #Flatten the list of files.\n list.flatten!\n\nend", "def sub_bytes\n # map{|i|i.sbox}\n map(&:sbox)\n end", "def files_500(files)\n prc = Proc.new { |x, y| x[0] <=> y[0] }\n heap = BinaryMinHeap.new()\n result = []\n\n files.length.time do |i|\n heap.push([files[i][0], i, 0])\n end\n\n while heap.count > 0\n min = heap.extract\n result << min[0]\n\n next_arr_i = min[1]\n next_idx = min[2] + 1\n next_el = files[next_arr_i][next_idx]\n\n heap.push([next_el, next_arr_i, next_idx]) if next_el\n end\n result\nend", "def detach_disks_specs\n detach_disk_array = []\n extra_config = []\n keys = disk_keys.invert\n\n ipool = VCenterDriver::VIHelper.one_pool(OpenNebula::ImagePool)\n disks_each(:detached?) do |d|\n key = d.key.to_s\n source = VCenterDriver::FileHelper.escape_path(d.path)\n persistent =\n VCenterDriver::VIHelper\n .find_persistent_image_by_source(\n source, ipool\n )\n\n op = { :operation => :remove, :device => d.device }\n if !persistent && d.type != 'CDROM'\n op[:fileOperation] = :destroy\n end\n detach_disk_array << op\n\n # Remove reference opennebula.disk if exist from vmx and cache\n extra_config << d.config(:delete) if keys[key]\n end\n\n [detach_disk_array, extra_config]\n end", "def store_images #:nodoc:\n record = 0x00EC # Record identifier\n length = 0x0000 # Bytes to follow\n\n ids = @object_ids.dup\n spid = ids.shift\n\n images = @images_array\n num_images = images.size\n\n num_filters = @filter_count\n num_comments = @comments_array.size\n num_charts = @charts_array.size\n\n # Skip this if there aren't any images.\n return if num_images == 0\n\n (0 .. num_images-1).each do |i|\n row = images[i][0]\n col = images[i][1]\n name = images[i][2]\n x_offset = images[i][3]\n y_offset = images[i][4]\n scale_x = images[i][5]\n scale_y = images[i][6]\n image_id = images[i][7]\n type = images[i][8]\n width = images[i][9]\n height = images[i][10]\n\n width = width * scale_x unless scale_x == 0\n height = height * scale_y unless scale_y == 0\n\n # Calculate the positions of image object.\n vertices = position_object(col,row,x_offset,y_offset,width,height)\n\n if (i == 0)\n # Write the parent MSODRAWIING record.\n dg_length = 156 + 84*(num_images -1)\n spgr_length = 132 + 84*(num_images -1)\n\n dg_length += 120 * num_charts\n spgr_length += 120 * num_charts\n\n dg_length += 96 * num_filters\n spgr_length += 96 * num_filters\n\n dg_length += 128 * num_comments\n spgr_length += 128 * num_comments\n\n data = store_mso_dg_container(dg_length) +\n store_mso_dg(*ids) +\n store_mso_spgr_container(spgr_length) +\n store_mso_sp_container(40) +\n store_mso_spgr() +\n store_mso_sp(0x0, spid, 0x0005)\n spid = spid + 1\n data = data +\n store_mso_sp_container(76) +\n store_mso_sp(75, spid, 0x0A00)\n spid = spid + 1\n data = data +\n store_mso_opt_image(image_id) +\n store_mso_client_anchor(2, *vertices) +\n store_mso_client_data()\n else\n # Write the child MSODRAWIING record.\n data = store_mso_sp_container(76) +\n store_mso_sp(75, spid, 0x0A00)\n spid = spid + 1\n data = data +\n store_mso_opt_image(image_id) +\n store_mso_client_anchor(2, *vertices) +\n store_mso_client_data\n end\n length = data.length\n header = [record, length].pack(\"vv\")\n append(header, data)\n\n store_obj_image(i+1)\n end\n\n @object_ids[0] = spid\n end", "def retrieve_cloud_files(files); end", "def cat(disk, path)\n inode_num = find_inode_num(disk, path)\n disk.seek(find_inode_offset(inode_num))\n inode = MinixInode.read(disk)\n data = \"\"\n size = inode.i_size\n zones = get_zones(disk, inode.i_zone)\n for zone in zones do\n disk.seek(zone * 1024)\n if size <= 1024 then\n data << disk.read(size)\n break\n else\n data << disk.read(1024)\n end\n size -= 1024\n end\n puts data\nend", "def file_list(hash)\n\nend", "def file_list(hash)\n\nend", "def __slices(n)\n\t\tbytes = Array.new\n\t\ti = 0\n\t\twhile i < size do\n\t\t\tbytes.push(__slice(i, n))\n\t\t\ti += n\n\t\tend\n\t\treturn bytes\n\tend", "def get_disk_util\n used_info = query_data(params[:host], 'df.1kblocks.used', params[:from_ts], params[:to_ts])\n total_info = query_data(params[:host], 'df.1kblocks.total', params[:from_ts], params[:to_ts])\n\n used_info.delete_if { |k, v|\n k.index(\"fstype=tmpfs\")\n }\n total_info.delete_if { |k, v|\n k.index(\"fstype=tmpfs\")\n }\n \n results = {}\n used_info.each { |k, v|\n matcher = /mount=([\\/\\w]+) /.match(k)\n if matcher\n path = matcher[1]\n\n if total_info.has_key?(k)\n total_v = total_info[k]\n total_v_map = Hash[total_v]\n results[path] = v.collect { |point|\n ts = point[0]\n if (total_v_map.has_key?(ts))\n [ts, format(\"%.2f\", point[1] * 100.0 / total_v_map[ts]).to_f]\n end\n }.keep_if { |v| v }\n end\n end\n }\n\n render json: results\n end", "def converted_arrays; end", "def list_size_nix_partitions # nelsongs\n\treturn `fdisk -l | grep /dev | grep -v Disk | awk '{if ($2==\"*\" && $6==\"83\") print $5;else {if ($5==\"83\") print $4}}' | sed s/+//g`.chomp.split\nend", "def pos_inode_array\n pos_list_entry + size_list_entry\n end", "def files\n @file_ids.collect { |idx| BFile.store[idx] }\n end", "def list_blobs(blobs)\n blobs.each do |blob|\n puts blob.name\n end\nend", "def q1_read_to_array(data_file_name)\r\n array2d = []\r\n \r\n read_file(\"data/\"+data_file_name).each{ |line|\r\n array1d = line.split(\",\").map(&:strip).map(&:to_s)\r\n array2d << array1d\r\n }\r\n return array2d\r\nend", "def calculate_disk_space(data)\n sum_sizes = 0\n\n data.each do |disk_name, disk|\n\n unless disk_name =~ %r{^sr}\n if disk.has_key?('size_bytes')\n sum_sizes = sum_sizes + disk['size_bytes']\n end\n end\n end\n\n sum_sizes = sum_sizes / 1024 / 1024 / 1024\n\n sum_sizes\n end", "def assemble_raid_array(partition_list, raid_device = '/dev/md0', raid_type = 0)\n puts \"Assembling cloned RAID-#{raid_type.to_s} array #{raid_device} ...\"\n command = \"/sbin/mdadm --assemble #{raid_device} #{partition_list.join(' ')}\"\n puts command\n puts `#{command}`\n end", "def one_disks_list\n one_item.info if one_item.instance_of?(OpenNebula::VirtualMachine)\n one_item.retrieve_xmlelements('TEMPLATE/DISK')\n end", "def entries_in_xdes_array\n size / space.pages_per_extent\n end", "def new_files\n db = Database::Mysql.default\n table = Database::GenericTable.new(db,$table)\n # generate the hash structure\n files = Util.folders($type).inject({}) {|col,f| col[f] = []; col}\n puts files.inspect\n db.connect do\n select = [\"*\"]\n where = { processed: 0 }\n res = table.search_and select,where \n res.each_hash do |row|\n files[row[\"switch\"]] << row[\"file_name\"]\n end\n puts \"Found #{res.num_rows} new files to process in #{$table}...\" if $opts[:v]\n end\n files\nend", "def test_to_volumes\n v = CI::Container::DirectBindingArray.to_volumes(['/', '/tmp'])\n assert_equal({ '/' => {}, '/tmp' => {} }, v)\n end", "def q3_read_to_array(data_file_name)\r\n orders = []\r\n \r\n h = q3_read_to_hash(data_file_name)\r\n h.each_pair { |k,v| orders << v }\r\n \r\n return orders\r\nend", "def create_band_array\n band = (0...BandDisplay::FILES.size).to_a.shuffle\n return band + band[0, 3]\n end", "def list_partitions_with_size_and_type # by nelsongs. => list: partition size type\n\treturn `fdisk -l | grep /dev | grep -v Disk | awk '{if ($2==\"*\") print $1\":\"$5\":\"$6;else print $1\":\"$4\":\"$5}' | sed s/+//g`.split\nend", "def disk_space()\n\n instructions = 'df -h'\n r = @ssh ? @ssh.exec!(instructions) : `#{instructions}`\n\n @results[:disk_usage] = {}\n\n a = r.lines.grep(/\\/dev\\/root/)\n\n puts ('a: ' + a.inspect).debug if @debug\n\n if a.any? then\n size, used, avail = a[0].split(/ +/).values_at(1,2,3)\n\n @results[:disk_usage][:root] = {size: size, used: used, \n avail: avail}\n end\n\n a2 = r.lines.grep(/\\/dev\\/sda1/)\n\n puts ('a2: ' + a2.inspect).debug if @debug\n\n if a2.any? then\n size, used, avail = a2[0].split(/ +/).values_at(1,2,3)\n\n @results[:disk_usage][:sda1] = {size: size, used: used, \n avail: avail}\n end\n\n end", "def test_datasets(mountpoints)\n if (mounted_datasets.keys & mountpoints).empty?\n create_test_datasets(mountpoints)\n else\n mounted_datasets.slice(*mountpoints)\n end\n end", "def list_extents(path, options = { })\n command_line = [ '-e' ]\n command_line << '-b' if options[:blocks]\n\n stripe_group = options[:stripe_group]\n command_line << '-G' << stripe_group if stripe_group\n\n affinity_key = options[:affinity_key]\n command_line << '-K' << affinity_key if affinity_key\n\n command_line << '-r' if options[:recursive]\n\n command_line << '-t' if options[:totals]\n\n command_line << path\n raw_response = execute(command_line)\n return raw_response if options.fetch(:return_raw_response, return_raw_response)\n\n file_extents = { }\n file_path = nil\n headers = nil\n extents_data = [ ]\n raw_response.each_line do |line|\n l = line.strip\n if l.empty?\n unless extents_data.empty?\n file_extents[file_path] = extents_data.map { |e| Hash[ headers.zip(e) ] }\n end\n file_path = nil\n headers = nil\n extents_data = [ ]\n next\n elsif file_path.nil?\n file_path = l.strip.chop\n elsif headers.nil?\n headers = l.strip.squeeze(' ').split(' ')\n else\n extents_data << l.strip.squeeze(' ').split(' ')\n end\n end\n file_extents[file_path] = extents_data.map { |e| Hash[ headers.zip(e) ] } unless file_path.nil? or extents_data.empty?\n\n file_extents\n end", "def files\n entries.map(&:filepath)\n end", "def uri_data_disk(id)\n {\n project: GoogleTests::Constants::D_PROJECT_DATA[(id - 1) \\\n % GoogleTests::Constants::D_PROJECT_DATA.size],\n zone: GoogleTests::Constants::D_ZONE_DATA[(id - 1) \\\n % GoogleTests::Constants::D_ZONE_DATA.size],\n name: GoogleTests::Constants::D_NAME_DATA[(id - 1) \\\n % GoogleTests::Constants::D_NAME_DATA.size]\n }\n end", "def volumes\n @volumes.to_a.freeze\n end", "def path_arr()\n return @paths\n end", "def file_hash_and_extension_to_array( h, ext = nil )\n\t\tr = self.class.file_hash_to_split_array( h, self.storage_folder_max_depth, self.storage_folder_max_name_length )\n\t\tr[r.size - 1] = r.last + '.' + ext unless ext.nil?\n\t\tr\n\tend", "def info_disks\n @disks = {}\n\n keys = disk_keys\n vc_disks = vcenter_disks_get\n one_disks = one_disks_list\n\n one_disks.each do |one_disk|\n index = one_disk['DISK_ID']\n\n disk = query_disk(one_disk, keys, vc_disks)\n\n vc_dev = vc_disks.delete(disk) if disk\n\n if vc_dev\n @disks[index] = Disk.new(index.to_i, one_disk, vc_dev)\n else\n @disks[index] = Disk.one_disk(index.to_i, one_disk)\n end\n end\n\n vc_disks.each {|d| @disks[d[:path_wo_ds]] = Disk.vc_disk(d) }\n\n @disks\n end", "def get_disks(token, disks_url)\n disk_ids = Array.new \n endpoint = disks_url.scan(/\\/organizations.*disks/)\n resp_hash = get_url(token, endpoint[0], {})\n resp_hash[:embedded][:disks].each do |disk|\n disk_ids.push extract_id(disk[:_links][:self][:href], 'disks')\n end\n return [disk_ids, resp_hash]\nend", "def patharray\n return @pathArray\n end", "def bysize results, maxsize=100*1024\r\n\tfiles = []\r\n\t\r\n\tnext_file=1\r\n\tfrgm=[]\r\n\tlen=0\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\tunless images.empty?\r\n\t\t\tfrgm << \"* [[#{name}]]\"\r\n\t\t\tlen += frgm.last.length\r\n\t\t\timages.to_a.each{|img, langs| \r\n\t\t\t\tfrgm << \"** [[:commons:File:#{img}|]] na #{langs.uniq.map{|l| \"[[:#{l}:#{interwikimap[l.to_s]}|#{l}]]\"}.join ','}\"\r\n\t\t\t\tlen += frgm.last.length\r\n\t\t\t}\r\n\t\tend\r\n\t\t\r\n\t\tif len >= maxsize\r\n\t\t\tfname = \"#{next_file}.txt\"\r\n\t\t\tfiles << fname\r\n\t\t\t\r\n\t\t\tFile.open(fname,'w'){|f| f.puts frgm}\r\n\t\t\tputs next_file\r\n\t\t\t\r\n\t\t\tfrgm=[]\r\n\t\t\tlen=0\r\n\t\t\tnext_file+=1\r\n\t\tend\r\n\tend\r\n\t\r\n\tunless frgm.empty?\r\n\t\tfname = \"#{next_file}.txt\"\r\n\t\tfiles << fname\r\n\t\t\r\n\t\tFile.open(fname,'w'){|f| f.puts frgm}\r\n\t\tputs next_file\r\n\tend\r\n\t\r\n\treturn files\r\nend", "def dd_map(arr)\n\n end", "def initialize(file_bytes=\"\\0\"*DSK_FILE_LENGTH,sector_order=:physical)\n\t\t#file must be a multiple of (16 sectors * 256 bytes) = 4096\n\t\t#some dsks on Asimov appear to have an extra byte at the end so allow for 1 extra byte\r\n\t\tif (file_bytes.length%4096>1) then\r\n\t\t\traise \"DSK files must be #{DSK_FILE_LENGTH} bytes long (was #{file_bytes.length} bytes)\"\r\n\t\tend\r\n\t\t@file_bytes=file_bytes\r\n\t\t@files=FileContainer.new\n\t\t@sector_order=sector_order\n\t\t@track_count=file_bytes.length/4096\r\n @source_filename=\"(unknown)\"\n\tend", "def create_fat_stream\n mfs = []\n @storages.select{ |s| s.type == Storage::TYPES[:stream] && s.size >= MINI_CUTOFF}.each_with_index do |stream, index|\n mfs.concat stream.data\n mfs.concat Array.new(512 - (mfs.size % 512), 0) if mfs.size % 512 > 0 \n end\n mfs.pack 'c*'\n end", "def disks\n return @disks unless @disks.empty?\n\n info_disks\n end", "def process_subset (volume_ids)\n tot_vol = 0; # Sum of copies\n tot_acc = 0; # Sum of access\n cm = 0; # Count members holding\n cv = 0; # Count volumes\n\n data_subset = {}; # Return hash.\n\n slice_count = 0;\n max_slice_size = 1000;\n conn = $db.get_conn();\n\n noof_slices = (volume_ids.length / max_slice_size) + 1;\n\n volume_ids.each_slice(max_slice_size) do |slice|\n slice_count += 1;\n $log.d(\"Slice #{slice_count} / #{noof_slices} for this segment.\");\n\n q = %Q!\n SELECT \n SUM(copy_count) AS tot_vol, \n SUM(access_count) AS tot_acc, \n COUNT(member_id) AS cm, \n COUNT(DISTINCT volume_id) AS cv \n FROM \n holdings_htitem_htmember_jn \n WHERE\n volume_id IN (#{slice.map{|v| \"'#{v}'\"}.join(',')})\n !;\n\n conn.query(q) do |res|\n tot_vol += res[:tot_vol].to_i;\n tot_acc += res[:tot_acc].to_i;\n cm += res[:cm].to_i;\n cv += res[:cv].to_i;\n end\n\n if (slice_count % 100 == 0) then\n $log.d(\"So far:\");\n puts \"tot_vol : #{tot_vol}\";\n puts \"tot_acc : #{tot_acc}\";\n puts \"Avg members holding a volume : #{cm.to_f / cv}\";\n # break;\n sleep 0.25;\n end\n end\n conn.close();\n\n data_subset['tot_vol'] = tot_vol;\n data_subset['tot_acc'] = tot_acc;\n data_subset['m_per_v'] = cm.to_f / cv;\n\n return data_subset;\nend", "def disk_hash_tree\n tree_size = SpStore::Merkle::HashTreeHelper.full_tree_node_count @blocks\n node_hashes = Array.new(tree_size+1)\n File.open(disk_hash_file, 'rb') do |file|\n file.seek(hash_byte_size, IO::SEEK_SET)\n (1..tree_size).each do |idx|\n node_hashes[idx] = file.read(hash_byte_size)\n end\n end\n node_hashes\n end", "def datasets\n datasets = []\n dataset.each do |d|\n if d[:data].first.is_a?(Array)\n datasets += d[:data]\n else\n datasets << d[:data]\n end\n end\n datasets\n end", "def disk_at(minpos, maxpos)\n @file.seek(minpos)\n s = \"\"\n for i in 0..(maxpos - minpos)\n b = @file.read 1\n bs = b[0].ord.to_s(16)\n s += (bs.length == 1 ? \"0\" + bs : bs)\n end\n s\n end", "def image_data\n return @image_data unless @image_data.empty?\n\n validate_spreadsheet_file_list\n\n spreadsheet_data.map do |row_hash|\n sequence = Integer row_hash[PAGE_SEQUENCE].to_s.strip\n filename = row_hash[FILENAME]\n image = File.basename filename, File.extname(filename)\n toc = (row_hash[TOC_ENTRY] || '').split(%r{\\s*\\|\\s*}).map(&:strip)\n ill = (row_hash[ILL_ENTRY] || '').split(%r{\\s*\\|\\s*}).map(&:strip)\n data = {\n number: sequence,\n seq: sequence,\n image_defaultscale: 3,\n display: true,\n side: (sequence.odd? ? RECTO : VERSO),\n image_id: image,\n image: image,\n visiblepage: row_hash[VISIBLE_PAGE],\n toc: toc,\n ill: ill\n }\n @image_data << OpenStruct.new(data)\n end\n\n files_on_disk.reject {|f| spreadsheet_files.include? f }.each do |extra|\n sequence = @image_data.last.seq + 1\n image = File.basename extra, File.extname(extra)\n data = {\n number: sequence,\n seq: sequence,\n id: image,\n image_defaultscale: 3,\n side: (sequence.odd? ? RECTO : VERSO),\n image_id: image,\n image: image,\n visiblepage: nil,\n display: false,\n toc: [],\n ill: []\n }\n @image_data << OpenStruct.new(data)\n end\n\n @image_data\n end", "def all_data_files(path)\n each_data_file(path).to_a\n end", "def contents\n\tRails.logger.debug {\"getting gridfs content #{@id}\"}\n f=self.class.mongo_client.database.fs.find_one(:_id=>BSON::ObjectId.from_string(@id))\n # read f into buffer, array of chunks is reduced to single buffer and returned to caller.\n # this is how file is broken apart and put together and assembled. Buffer is sent back to browser\n # to disaply on the screen\n if f \n buffer = \"\"\n f.chunks.reduce([]) do |x,chunk| \n buffer << chunk.data.data \n end\n return buffer\n end \n\nend", "def each_blob\n each_pair do |key, value|\n next unless value.kind_of?(Array)\n yield(key, value)\n end\n end", "def create_mini_fat\n v_mf = []\n @storages.select{ |s| s.type == Storage::TYPES[:stream] && s.size < MINI_CUTOFF}.each do |stream|\n allocate_stream(v_mf, stream, 64)\n end\n v_mf.concat Array.new(128 - v_mf.size, -1)\n v_mf.pack 'l*'\n end", "def list_swap_partitions_with_size # nelsongs\n\treturn `fdisk -l | grep /dev | grep -v Disk | awk '{if ($2==\"*\" && $6==\"82\") print $1\":\"$5;else {if ($5==\"82\") print $1\":\"$4}}' | sed s/+//g`.chomp.split\nend", "def files\n array = []\n @list.each do |k,v|\n array += v.filename\n end\n array\n end", "def contents(&blk)\n tapes = self.tapes\n contents = []\n each do |tape|\n file = open(tape)\n if file.type == :frozen\n file.shard_count.times do |i|\n contents << \"#{tape}[#{file.shard_name(i)}]\"\n end\n else\n contents << tape\n end\n end\n if block_given?\n contents.each(&blk)\n end\n contents\n end", "def getmountedvolumes\n # only support Linux for now\n return {} unless Facter['kernel'] && Facter['kernel'].value == 'Linux'\n\n dir = \"/etc\"\n mounted = {}\n\n # AUTOFS - gather only files named auto[._]*\n Dir.glob(File.join(dir, \"*\")).each do |file|\n next if file !~ /^auto[._].*/\n\n # AUTOFS - match only lines that look like nfs syntax such as host:/path\n IO.foreach(file) do |line|\n if line =~ /\\w:\\S/ && line !~ /^\\s*#/\n # Parse it, Example : \" nventory_backup -noatime,intr irvnetappbk:/vol/nventory_backup \"\n if line =~ /^(\\w[\\w\\S]+)\\s+\\S+\\s+(\\w[\\w\\S]+):(\\S+)/\n mnt = $1\n host = $2\n vol = $3\n mounted[\"volumes[mounted][/mnt/#{mnt}][config]\"] = file\n mounted[\"volumes[mounted][/mnt/#{mnt}][volume_server]\"] = host\n mounted[\"volumes[mounted][/mnt/#{mnt}][volume]\"] = vol\n mounted[\"volumes[mounted][/mnt/#{mnt}][type]\"] = 'nfs'\n end\n end\n end # IO.foreach\n end # Dir.glob\n\n # FSTAB - has diff syntax than AUTOFS. Example: \"server:/usr/local/pub /pub nfs rsize=8192,wsize=8192,timeo=14,intr\"\n IO.foreach(\"/etc/fstab\") do |line|\n if line =~ /^(\\w[\\w\\S]+):(\\S+)\\s+(\\S+)\\s+nfs/\n host = $1\n vol = $2\n mnt = $3\n mounted[\"volumes[mounted][#{mnt}][config]\"] = \"/etc/fstab\"\n mounted[\"volumes[mounted][#{mnt}][volume_server]\"] = host\n mounted[\"volumes[mounted][#{mnt}][volume]\"] = vol\n mounted[\"volumes[mounted][#{mnt}][type]\"] = 'nfs'\n end\n end # IO.foreach\n return mounted\n end", "def storage_adapter\n Valkyrie::StorageAdapter.find(:disk_via_copy)\n end", "def add data, offset\n next_frag = 0\n $LOG.debug \"Setting partition at offset \" + offset.to_s + \" To \" + data\n len = data.length\n\n # can we fit it in??\n # lets say no. so we have to create a ????? and use that as\n # an enumerator\n #\n\n \n\n dary = [data].pack(\"a*\").unpack(\"C*\")\n @part[offset, dary.length] = dary\n\n @part[(offset + dary.length), 2] = [next_frag].pack(\"n\").unpack(\"C2\")\n \n @rem -= (dary.length + FileSystem::get_link_size)\n end", "def five_hundred_files(arr_of_arrs)\n prc = Proc.new { |el1, el2| el1[0] <=> el2[0] }\n heap = BinaryMinHeap.new(&prc)\n result = []\n\n # populate with first elements\n arr_of_arrs.length.times do |i|\n heap.push([arr_of_arrs[i][0], i, 0])\n end\n\n # Extract the minimum element and use the meta-data to select the\n # next element \n while heap.count > 0\n min = heap.extract\n result << min[0]\n\n next_arr_i = min[1]\n next_idx = min[2] + 1\n next_el = arr_of_arrs[next_arr_i][next_idx]\n\n heap.push([next_el, next_arr_i, next_indx]) if next_el\n end\n result\nend", "def create_storages\n @storages = []\n @encryption_info = @ms_off_crypto.encryption_info\n @encrypted_package = @ms_off_crypto.encrypted_package\n\n @storages << Storage.new('EncryptionInfo', :data=>encryption_info, :left=>3, :right=>11) # example shows right child. do we need the summary info????\n @storages << Storage.new('EncryptedPackage', :data=>encrypted_package, :color=>Storage::COLORS[:red])\n @storages << Storage.new([6].pack(\"c\")+\"DataSpaces\", :child=>5, :modified =>129685612740945580, :created=>129685612740819979)\n @storages << version\n @storages << data_space_map\n @storages << Storage.new('DataSpaceInfo', :right=>8, :child=>7, :created=>129685612740828880,:modified=>129685612740831800)\n @storages << strong_encryption_data_space\n @storages << Storage.new('TransformInfo', :color => Storage::COLORS[:red], :child=>9, :created=>129685612740834130, :modified=>129685612740943959)\n @storages << Storage.new('StrongEncryptionTransform', :child=>10, :created=>129685612740834169, :modified=>129685612740942280)\n @storages << primary \n # @storages << summary_information\n # @storages << document_summary_information\n\n # we do this at the end as we need to build the minifat stream to determine the size. #HOWEVER - it looks like the size should not include the padding?\n @storages.unshift Storage.new('Root Entry', :type=>Storage::TYPES[:root], :color=>Storage::COLORS[:red], :child=>1, :data => mini_fat_stream)\n\n end", "def disk_attached_to_vm(disk, unmanaged_keys, vc_disks)\n img_name = ''\n device_found = nil\n disk_id = disk['DISK_ID']\n unmanaged_key = unmanaged_keys[\"opennebula.disk.#{disk_id}\"]\n\n img_name_escaped = VCenterDriver::FileHelper.get_img_name(\n disk,\n one_item['ID'],\n self['name'],\n instantiated_as_persistent?\n )\n\n img_name = VCenterDriver::FileHelper.unescape_path(img_name_escaped)\n\n vc_disks.each do |d|\n key_matches = (unmanaged_key && d[:key] == unmanaged_key.to_i)\n path_matches = (d[:path_wo_ds] == img_name)\n\n if key_matches || path_matches\n device_found = d\n break\n end\n end\n\n device_found\n end", "def disks\n self.config.hardware.device.grep(RbVmomi::VIM::VirtualDisk)\n end", "def allocate(parts); end", "def select_taguchi_array\n closest = 0\n [8, 16, 32, 64, 128, 256, 512, 1024].each do |n|\n if @num_genes <= n - 1\n closest = n\n break\n end\n end\n file_name = \"L#{closest}\"\n load_array_from_file file_name\n end", "def format ary\n #buff = Array.new\n buff = Array.new(ary.size)\n return buff if ary.nil? || ary.size == 0\n\n # determine width based on number of files to show\n # if less than sz then 1 col and full width\n #\n # ix refers to the index in the complete file list, wherease we only show 60 at a time\n ix=0\n ctr=0\n ary.each do |f|\n ## ctr refers to the index in the column\n #ind=$IDX[ix]\n ind = get_shortcut(ix)\n mark=\" \"\n mark=\" * \" if $selected_files.index(ary[ix])\n\n if $long_listing\n begin\n unless File.exist? f\n last = f[-1]\n if last == \" \" || last == \"@\" || last == '*'\n stat = File.stat(f.chop)\n end\n else\n stat = File.stat(f)\n end\n f = \"%10s %s %s\" % [readable_file_size(stat.size,1), date_format(stat.mtime), f]\n rescue Exception => e\n f = \"%10s %s %s\" % [\"?\", \"??????????\", f]\n end\n end\n\n s = \"#{ind}#{mark}#{f}\"\n\n buff[ctr] = s\n\n ctr+=1\n ix+=1\n end\n return buff\nend" ]
[ "0.6114302", "0.60259414", "0.581991", "0.5775413", "0.5759602", "0.57086027", "0.5656369", "0.56306446", "0.56300986", "0.56208915", "0.56053364", "0.5593654", "0.5578444", "0.55697817", "0.5535661", "0.5496106", "0.54666495", "0.5466595", "0.5462477", "0.5461333", "0.5443761", "0.5437446", "0.5434558", "0.5434558", "0.54047155", "0.53712636", "0.53364056", "0.5335852", "0.5335852", "0.5335852", "0.5335852", "0.5335852", "0.5335852", "0.5328526", "0.53137946", "0.5302906", "0.5299717", "0.5293131", "0.5273522", "0.5272064", "0.5268037", "0.5259047", "0.5250468", "0.5248176", "0.5248176", "0.5236866", "0.5225314", "0.522045", "0.52141047", "0.520235", "0.5196466", "0.5192774", "0.51901317", "0.51867545", "0.5166241", "0.51563984", "0.5146034", "0.514336", "0.5134106", "0.5132017", "0.5115733", "0.51152366", "0.51059216", "0.5104917", "0.50934917", "0.50926214", "0.50896823", "0.50807893", "0.5079432", "0.5076458", "0.50758046", "0.50731385", "0.5072107", "0.5071536", "0.5060627", "0.5047268", "0.5042654", "0.5040018", "0.5038963", "0.50376093", "0.5028221", "0.50162107", "0.5009039", "0.5007965", "0.50051284", "0.4997533", "0.49927235", "0.4988967", "0.49881822", "0.49823418", "0.49823317", "0.49823222", "0.49819255", "0.4975813", "0.4972819", "0.49686614", "0.49639845", "0.49604225", "0.49536625", "0.49534318" ]
0.5432909
24
First method will use an iterator and second will use recursive principle
def fibs(n) arr = [0, 1] (n-1).times do arr << arr[-1] + arr[-2] end return arr end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recursive => nil", "def traverse; end", "def deep_each\n \n end", "def recursive_solution\n\n end", "def iterate(itr)\n itr.call(@leaf)\n end", "def iterate(itr)\n @left.iterate(itr)\n @right.iterate(itr)\n end", "def run_recursive_loop &block\n results = yield\n return results\nend", "def test_recursive_methods\n assert_equal 0, find_node(1).ancestors_r.size\n assert_equal 8, find_node(1).descendants_r.size\n assert_equal 4, find_node('1_1_2_1_1').ancestors_r.size\n end", "def each_child\n \n end", "def traverse(&block); end", "def traverse(&block); end", "def recurse_trade(node, route, items, visited={})\n \tif node == route[0]\n \t\troute << node\n \t\treturn route\n \telsif visited[node]\n \t\treturn\n \telse\n \t\tvisited[node] = true\n \t\troute << node\n \t\titems_children(node, items).each do |child|\n if child.new_owner\n next\n end\n \t\t\tresult = recurse_trade(child, route, items, visited)\n if result and result.count > 1\n # puts \"RESULT is #{result.count}\"\n # puts \"Result first is #{result.first}\"\n # puts \"Result last is #{result.last}\"\n return result\n else\n end\n \t\t\t# return result if result\n \t\tend\n \tend\t\t\n end", "def my_find(collection)\n i = 0 \n while i < collection.length \n return collection[i] if\n yield(collection[i])\n i = i += 1 #i can put += if its easier to remember\n end\nend", "def process_self_and_descendants\n yield self\n descendants.each { |item| yield(item) }\n end", "def recursiveTreeTraversal(element)\n if StereotypesHelper.hasStereotype(element, $veStereotype)\n findOrCreateRefinedParameters(element)\n end\n for child in element.getOwnedElement()\n recursiveTreeTraversal(child)\n end\nend", "def solution(t)\n # write your code in Ruby 2.2\n depth = 0\n childs = []\n\n childs << t.l if t.l\n childs << t.r if t.r\n\n while not childs.empty? do\n depth += 1\n\n cc = []\n childs.each do |t|\n cc << t.l if t.l\n cc << t.r if t.r\n end\n\n childs = cc\n end\n\n depth\nend", "def nested_set_recurse(set, &block)\n block.call self, lambda{\n index = set.index(self) + 1\n while set[index].parent_id == self.id\n set[index].nested_set_recurse(set, &block)\n index += 1\n end\n }\n end", "def traverse\n link = @remaining_links.first\n if link\n @remaining_links.shift\n yield link\n @links[link]\n else\n @father\n end\n end", "def recursiveTreeTraversal(element)\n if StereotypesHelper.hasStereotype(element, $veStereotype)\n findRefinedParameters(element)\n end\n for child in element.getOwnedElement()\n recursiveTreeTraversal(child)\n end\nend", "def each_recursive(&block)\n tree.each_recursive(&block)\n end", "def each\n aux = @head\n while aux!=nil\n yield aux.value\n aux=aux.nest\n end\n end", "def recurse(curr, k, nums, res, start)\n# add, recurse, undo\n # basically forcing a base case\n if k == 0\n res << curr[0..-1] \n return\n end\n # start elims duplicates (like [3, 2] [2, 3])\n i = start\n while i < nums.length\n curr << nums[i]\n recurse(curr, k - 1, nums, res, i + 1)\n curr.pop\n i+=1\n end\n \n end", "def get_iterator\n\t\tend", "def each # And define each on top of next\n loop {yield self.next }\n end", "def traverse(&block)\n\t\t\t\treturn to_enum(:traverse) unless block_given?\n\t\t\t\t\n\t\t\t\ttraverse_recurse(@order-1, 0, 0, self.origin, self.size, &block)\n\t\t\tend", "def throughout_nest do_this_to, parent\n parent.map!{|child| child.is_a?(String) ? do_this_to.call(child) : throughout_nest(do_this_to, child)}\nend", "def process_descendants_and_self\n descendants.reverse.each { |item| yield(item) }\n yield self\n end", "def make_recursive_call\n offset = 0\n p_args = set_pagination(offset, page_size, args)\n api_caller.verbosity(conn, method, *p_args)\n\n return if api_caller.opts[:noop]\n\n ret = api_caller.respond(conn.public_send(method, *p_args))\n\n return ret unless ret.more_items?\n\n loop do\n offset += page_size\n p_args = set_pagination(offset, page_size, p_args)\n api_caller.verbosity(conn, method, *p_args)\n resp = api_caller.respond(conn.public_send(method, *p_args))\n raise StopIteration unless resp.ok?\n\n ret.response.items += resp.response.items\n return finalize_response(ret) unless resp.more_items?\n end\n end", "def next() end", "def next() end", "def breadth_first_scan_old(root, &block)\n if root.file?\n yield root\n return\n end\n\n children = Pathname(root).children.sort\n begin\n children.each { |child| yield child } # breadth\n children.each { |child| breadth_first_scan(child, &block) if child.directory? }\n rescue Errno::EACCES, Errno::EPERM => e\n STDERR.puts(\"Error: #{e}\".red)\n end\nend", "def each\n return enum_for(__method__) unless block_given?\n return if @head.nil?\n\n traverser = @head\n\n until traverser.nil?\n yield traverser\n traverser = traverser.next_node\n end\n end", "def each\n return enum_for(__method__) unless block_given?\n return if @head.nil?\n\n traverser = @head\n\n until traverser.nil?\n yield traverser\n traverser = traverser.next_node\n end\n end", "def esxlRecurse i, j\n esxlStraightRecurse(i, j) + esxlDiagonalRecurse(i, j)\nend", "def my_controlled_flatten(n=1)\n #here\n return self if n < 1\n\n results = []\n self.each do |el|\n if el.class == Array\n #here\n results += el.my_controlled_flatten(n-1)\n else\n results << el\n end\n end\n\n results\n\n end", "def find_it(seq)\r\n\r\nend", "def traverse(person)\n loop = false\n queue = []\n queue << tree\n\n until loop || queue.size <= 0\n current = queue.pop()\n found = current.generation.compact.map(&:name).include?(person)\n\n if found\n loop = true\n return current unless block_given?\n\n yield(current)\n else\n children = current.children\n (children || []).each do |child|\n queue << child\n end\n end\n end\n end", "def sum_recurse(num)\n return 0 if num == 0\n num[0] + sum_recurse(num.delete(1))\nend", "def nested_set_recurse(&block)\n self.each do |x| \n x.nested_set_recurse(self, &block)\n end\n end", "def each\n @children.each {|child| yield child}\n end", "def recursiveTreeTraversal(element)\n begin\n requirementsTree = findRequirementsTree(element)\n unless requirementsTree == nil\n checkForDuplicateRoots(requirementsTree)\n end\n for child in element.getOwnedElement()\n recursiveTreeTraversal(child)\n end\n rescue SystemStackError\n $logger.log(\"Recursive Issue1: \" + element.getName())\n end\nend", "def recurse_result_set(result, options = {}, &block)\n return result unless block_given? \n inner_recursion = options.delete(:inner_recursion)\n result_set = inner_recursion ? result : result.dup\n \n parent_id = (options.delete(:parent_id) || result_set.first[result_set.first.parent_col_name]) rescue nil\n options[:level] ||= 0\n options[:nested] = true unless options.key?(:nested)\n \n siblings = options[:nested] ? result_set.select { |s| s.parent_id == parent_id } : result_set \n siblings.sort! {|a,b| a.send(options[:sort_on]) <=> b.send(options[:sort_on])} if options[:sort_on]\n siblings.each do |sibling|\n result_set.delete(sibling) \n block.call(sibling, options[:level])\n opts = { :parent_id => sibling.id, :level => options[:level] + 1, :inner_recursion => true, :sort_on => options[:sort_on]} \n recurse_result_set(result_set, opts, &block) if options[:nested]\n end\n result_set.each { |orphan| block.call(orphan, options[:level]) } unless inner_recursion\n end", "def traverse_recurse(order, mask, value, origin, size, &block)\n\t\t\t\thalf_size = size.collect{|value| value * 0.5}.freeze\n\t\t\t\tprefix_mask = (1 << order) | mask\n\t\t\t\t\n\t\t\t\t(2**bit_width).times do |prefix|\n\t\t\t\t\t# These both do the same thing, not sure which one is faster:\n\t\t\t\t\tchild_value = (value << @dimensions.count) | prefix\n\t\t\t\t\tprefix = child_value << (order*bit_width)\n\t\t\t\t\t\n\t\t\t\t\tindex = HilbertIndex.from_integral(prefix, bit_width, @order).to_ordinal\n\t\t\t\t\t\n\t\t\t\t\tindex = index & prefix_mask\n\t\t\t\t\t\n\t\t\t\t\tchild_origin = @dimensions.unmap(index.axes).freeze\n\t\t\t\t\t\n\t\t\t\t\t# puts \"yield(#{child_origin}, #{half_size}, #{prefix}, #{order})\"\n\t\t\t\t\t# We avoid calling traverse_recurse simply to hit the callback on the leaf nodes:\n\t\t\t\t\tresult = yield child_origin, half_size, prefix, order\n\t\t\t\t\t\n\t\t\t\t\tif order > 0 and result != :skip\n\t\t\t\t\t\tself.traverse_recurse(order - 1, prefix_mask, child_value, child_origin, half_size, &block)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend", "def iterate\n return unless block_given?\n\n current_node = @head\n\n until current_node.nil?\n yield current_node\n\n current_node = current_node.next\n end\n end", "def iterator?() end", "def findCicle(nodes, idInicio, passed)\n if(!passed.any?{|id| id == nodes.operationId})\n passed.push(nodes.operationId)\n nodes.entradas.each { \n |node|\n if(node.operationId != idInicio)\n return findCicle(node, idInicio, passed)\n else\n return true\n end \n }\n else \n return true\n end\n return false\nend", "def walk; end", "def depth_first(value)\n\tend", "def next_in_chain\n @_next_in_chain ||= nil\n @_next_in_chain\n end", "def traverse(flag=nil,&op)\n\t\top.call(self)\n\t\tall_children_deep(flag).each do |c|\n\t\t\top.call(c)\n\t\tend\n\tend", "def find_beeper()\n while not next_to_a_beeper?()\n move_toward_beeper()\n end\n end", "def iterate root_child_itr\t\t\t#to iterate over the nodes\t\t\n\t \n\t ## Collect root_child_itr.children in a variable since it being used twice\n\t ## Can you try using some other conditional construct other than loop and break?\n\t\twhile true\n\t\t ###### Use an intuitive variable name\n\t\t\tchild = root_child_itr.children\n\t\t\t\n\t\t\t##### if temp.children[0]\n\t\t\tif child.children[0] == nil\t\t\t#checking if the node is innermost as innermost node will not be having any childnode\n\t\t\t\t@@arr.push child\n break\n\t\t\telse\n\t\t\t\tscan root_child_itr\t\t# iterate over the childnodes if it is not the parent of the innermost node\n break\n\t\t\tend\t\t\n\t\tend\n\tend", "def iterator()\n raise NotImplementedError\n end", "def recursive_iterate( arr, indent=0 )\n\n # remove the first element from the array and print it\n # - if there are any elements left in the array\n # call ourselves again with the shorter array\n\n # first = arr.shift # mutates the arg (a)\n\n # first = arr.first\n # rest = arr[1..-1]\n\n first, *rest = arr # JS: const [first, ...rest] = arr;\n\n spaces = \" \" * indent\n\n puts \"#{ spaces } recursive_iterate( #{ arr.to_s })\"\n puts \"#{ spaces } first: #{ first }\"\n puts \"#{ spaces } rest: #{ rest.to_s }\"\n # puts first\n\n if rest.any?\n recursive_iterate( rest, indent+1 )\n end\n\n puts \"#{ spaces } --- returning from recursive_iterate( #{ arr.to_s} ), first: #{ first }\"\n\nend", "def recursive_search(path,current_depth)\n # If we haven't hit our max depth\n if current_depth < @depth \n sub_hash = @wiki\n # Follow our path down the hash\n path.each do |node|\n sub_hash = sub_hash[node]\n end\n\n # Expand this node of the sub-tree\n sub_hash.keys.each do |link|\n sub_hash[link] = get_links(\"http://en.wikipedia.org#{link}\")\n # Here's our magic recursion, add this node to the\n # path, increment our depth, and traverse that\n recursive_search(path+[link],current_depth+1)\n end\n\n end\nend", "def each_child_with_index\n end", "def my_find (collection) # collection is the array described above, passed to the method my_find\n i = 0 # setting up a counter\n while i < collection.length #while the counter is less than the length of the array do something\n return collection[i] if yield(collection[i]) #this is the \"do something\": send an ellement ([i]) to a block and if\n # it is returned to the method as 'true' then make it the return value of the method\n i+=1 # if the condition above is not met then add one to the counter and cycle through the next element in collection\n end #ends the while statement\nend", "def use_breadth_first(item, graph, logic_function = ->(x){graph[x].empty?} , returned = \"steps\" )\r\n search_queue = []\r\n steps = {}\r\n search_queue = search_queue.concat(graph[item])\r\n searched = []\r\n #Setting up initial steps \r\n if !search_queue.empty?\r\n search_queue.each do |term|\r\n steps[term] = 1\r\n end\r\n end\r\n #Here goes the graph algorithm\r\n while !search_queue.empty?\r\n person = search_queue.shift()\r\n if !( searched.include?(person) )\r\n\r\n if logic_function.call(person)\r\n if returned == \"steps\"\r\n return steps[person]\r\n end\r\n if returned == \"found\"\r\n return true\r\n end\r\n else\r\n if !(graph[person].nil?) \r\n graph[person].each do |related|\r\n steps[related] = steps[person] + 1 #Setting up the steps of parents of the current element in the queue\r\n end\r\n search_queue = search_queue.concat(graph[person])\r\n end\r\n end\r\n\r\n end\r\n end\r\n return false\r\nend", "def next\r\n # if the path is empty attempt create the first path element \r\n if @path.empty?\r\n ords = get_data @base\r\n if ords.empty?\r\n # if the base ordering has no related orderings to traverse\r\n # return false \r\n return nil\r\n else\r\n #otherwise create the path element \r\n @path << IteratorPathElement.new(ords[0])\r\n return ords[0] \r\n end \r\n else\r\n # The path is not empty, we have to advance to the next element\r\n cur_elem = @path[-1]\r\n # We use the depth-first algorithm, check whether we can deepen first\r\n ords = get_data(cur_elem.cur_ordering)\r\n unless ords.empty?\r\n # deepen the path\r\n @path << IteratorPathElement.new(ords[0])\r\n return ords[0]\r\n else\r\n # move to next element\r\n \r\n # remove path elements which have enumerated already all their children \r\n until cur_elem.has_more?\r\n @path.pop\r\n if @path.empty?\r\n return nil\r\n end\r\n cur_elem = @path[-1]\r\n end\r\n \r\n #actually move to the next sibling element\r\n return cur_element.next\r\n end\r\n end\r\n end", "def next\n return @tree_iterator.next\n end", "def traverse\n nodes = [self]\n until nodes.empty?\n node = nodes.pop\n yield node\n nodes += node.children.reverse unless node.children.empty?\n end\n end", "def crawl(&blk)\r\n while crawlNext(&blk)\r\n end\r\n end", "def each\n self.traverse_down { |node| yield(node) }\n end", "def find_subsequent()\n curr = self\n while !curr.next.nil?\n curr = curr.next \n return curr if yield curr\n end\n\n return nil\n end", "def each # And define each on top of next\n loop { yield self.next }\n end", "def each\n# And define each on top of next\nloop { yield self.next }\nend", "def each\n# And define each on top of next\nloop { yield self.next }\nend", "def iterate\n current_node = self.head\n i = 0\n\n while current_node != nil\n yield(current_node, i)\n current_node = current_node.next\n i += 1\n end\n end", "def iterate(iterator)\n\tloop do\n\t\tyield iterator.next\n\tend\nend", "def each_ancestor # :nodoc:\n end", "def each()\n @path.each do |node_id|\n unless (node_id == @path.last or node_id == path[-2])\n yield node_id \n end\n end\n end", "def traverse_tree(idea=self, depth=1, &blk)\n if idea.has_citations?\n blk.call(idea, depth)\n depth += 1\n idea.citations.each { |citation| traverse_tree(citation, depth, &blk) }\n else\n blk.call(idea, depth)\n end\n end", "def makeIter(stuff, changing_params, param_to_change)\n # if syntax provides enumeration\n if stuff.has_key?('values') then\n if stuff['values'].class == String\n stuff['values'].split(' ').each do |value|\n changing_params[param_to_change] = value.to_s\n deepestFork(stuff, changing_params)\n end\n else\n changing_params[param_to_change] = stuff['values'].to_s\n deepestFork(stuff, changing_params)\n end\n # on the other case do enumeration manually\n else\n # if range is linear\n if stuff['type'] == 'line' then\n bndrs = stuff['range'].split('..')\n bndrs[0].to_s.match(/\\.|e/) ? bndrs[0] = bndrs[0].to_f : bndrs[0] = bndrs[0].to_i\n bndrs[1].to_s.match(/\\.|e/) ? bndrs[1] = bndrs[1].to_f : bndrs[1] = bndrs[1].to_i\n stuff['step'].to_s.match(/\\.|e/) ? step = stuff['step'].to_f : step = stuff['step'].to_i\n if step.to_f < 0 then\n bndrs[0], bndrs[1] = bndrs[1], bndrs[0]\n step = - step\n end\n (bndrs[0]..bndrs[1]).step(step) do |value|\n changing_params[param_to_change] = value.to_s\n deepestFork(stuff, changing_params)\n end\n # if range is exponetial\n else\n bndrs = []\n step = stuff['step']\n stuff['range'].split('..').each_with_index do |value, i|\n bndrs[i] = value.split('e')\n end\n if step < 0 then\n bndrs[0], bndrs[1] = bndrs[1], bndrs[0]\n step = - step\n end\n (bndrs[0][1]..bndrs[1][1]).step(step) do |exp|\n changing_params[param_to_change] = bndrs[0][0] + 'e' + exp.to_s\n deepestFork(stuff, changing_params)\n end\n end\n end\n\n changing_params.delete(param_to_change)\n end", "def nesting() end", "def better_inject_recursion(initial = nil,n=nil,&block)\n\t\tresult = 0\n\t\tn ||= 0\n\t\treturn result if n == self.length\n\t\tcurrent_element = initial.nil? ? self[n] : initial\n\t\tn+=1\n\t\tresult = yield(better_inject_recursion(nil,n,&block),current_element)\n\t\tend", "def deep_cur\n self.cur.deep_cur\n end", "def traverse(parent, &block)\n\n end", "def deep_find\n ([self] + all_subtrees.to_a).each do |node|\n return node if yield(node)\n end\n nil\n end", "def each\n\n rewind\n\n n,f,q,c=next_seq\n\n while (!n.nil?)\n yield(n,f,q,c)\n n,f,q,c=next_seq\n end\n\n rewind\n\n end", "def next()\n \n end", "def next()\n \n end", "def recursive_traverse(node, current_state)\n Log.debug \"visiting #{node.name}\"\n current_state.timelines.first << node.name\n if node.downstream.empty?\n Log.debug \"#{node.name} has no downstream nodes. Reached end of timeline\"\n return current_state\n elsif node.downstream.size == 1\n Log.debug \"#{node.name} only one downstream node. Moving to it now.\"\n return recursive_traverse node.downstream.first, current_state\n else\n Log.debug \"#{node.name} has #{node.downstream.size} downstream nodes. Investigating merge options.\"\n\n timeline_forks = node.downstream.collect { |down|\n downstream_fork_states = recursive_traverse(down, TimelineState.new).timelines\n raise \"Downstream partial merge detected. This type of merge is not yet supported\" unless downstream_fork_states.size == 1\n downstream_fork_states.first\n }\n common_elems = timeline_forks.inject { |sum, nex| sum & nex }\n\n common_elem = common_elems.first\n base_forks = timeline_forks.select { |f| f.first.equal? common_elem }\n if common_elem.nil?\n current_state.state = 'No merge is possible'\n\n timelines = timeline_forks.collect { |f|\n (current_state.timelines + f).flatten\n }\n\n current_state.timelines = timelines\n\n elsif base_forks.empty?\n current_state.state = 'Partial merge is possible'\n\n common_elem_index = timeline_forks.first.find_index common_elem\n agreed_tail_arry = timeline_forks.first.slice(common_elem_index, timeline_forks.first.size - 1)\n\n disputed_events_array = timeline_forks.collect { |f|\n term = f.find_index common_elem\n f.slice(0, term)\n }\n\n # could iterate over permuations of parallel events here to list all possible timelines, but outside of problem description\n possible_timelines = disputed_events_array.collect { |p|\n (current_state.timelines + p + agreed_tail_arry).flatten\n }\n\n current_state.timelines = possible_timelines\n\n elsif base_forks.size == 1\n current_state.state = 'Merge is possible'\n Log.debug 'Full merge possible'\n\n longest_merge_array = timeline_forks.sort_by(&:size).last\n current_state.timelines = [(current_state.timelines + longest_merge_array).flatten]\n else\n raise 'Only one base fork should be found!'\n end\n\n end\n current_state\n end", "def bitonic_recurse(arr, low, count, direction)\n return if count <= 1\n\n mid = count / 2\n bitonic_recurse(arr, low, mid, 1)\n bitonic_recurse(arr, low + mid, mid, -1)\n bitonic_merge(arr, low, count, direction)\n arr\nend", "def find_breadth_traversal_tree(in_order,post_order,level, h)\n # level => 0F 0T 1F 1T etc\n if in_order.size == nil || in_order.size == 0\n puts \"finish\"\n elsif in_order.size == 1\n # finish\n yield(level, in_order[0])\n puts \"#{level} \\t #{in_order[0]}\"\n else \n # this is not finished yet\n max_index_in_post = 0\n max_index_in_in = 0\n in_order.each_with_index do |in_ele,in_index|\n post_index = post_order.index(in_ele)\n\n if post_index > max_index_in_post\n max_index_in_post = post_index\n max_index_in_in = in_index\n end\n\n end\n current_root = in_order[max_index_in_in]\n yield(level, current_root)\n puts \"#{level} \\t #{current_root}\"\n\n level[0] = (Integer(level[0])+1).to_s\n next_level_f = level+\"F\"\n next_level_t = level+\"T\"\n front_of_in = in_order[0...max_index_in_in]\n tail_of_in = in_order[(max_index_in_in+1)...in_order.size]\n \n #\n find_breadth_traversal_tree(front_of_in,post_order,next_level_f, h) {|level,ele| h[level] = ele}\n find_breadth_traversal_tree(tail_of_in,post_order,next_level_t, h) {|level,ele| h[level] = ele}\n\n #\n end # end of else\n\n\nend", "def each(&proc)\n @subtrees.each(&proc)\n end", "def search_recursive(root,target_value)\n\n return root if root.payload == target_value\n\n root.children.each do |child|\n node = search_recursive(child,target_value)\n return node if node\n end\n\n return nil\n\nend", "def find_trade(item, items)\n \troute = [item]\n \titems_children(item, items).each do |child|\n if child.new_owner\n next\n end\n \t\tresult = recurse_trade(child, route, items)\n #not confident with the next line\n if result and result.count > 0\n puts \"ACTUAL RESULT? FIND_TRADE RESULT COUNT = #{result.count}\"\n puts \"RESULT FIRST IS #{result.first.name}\"\n puts \"RESULT LAST IS #{result.last.name}\"\n return result\n end\n \t\t# return result if result\n \tend\n end", "def next_in_chain\n @_next_in_chain ||= nil\n @_next_in_chain\n end", "def each_with_level(objects, &block)\n Iterator.new(objects).each_with_level(&block)\n end", "def traverse\n @result.clear\n @queue.clear\n\n @queue.enqueue(@node)\n @result.push @node\n\n\n while not @queue.empty?\n node = @queue.dequeue\n return @result unless node\n # puts \"Visiting node: #{node}\"\n return node if (@search and node==@search)\n node && node.children.each do |node|\n unless @result.include?(node)\n @result.push(node)\n @queue.enqueue(node)\n end\n end\n end\n return result\n end", "def recurse_proc(result, &proc)\n case result\n when Array\n result.each { |x| recurse_proc x, &proc }\n proc.call result\n when Hash\n result.each { |x, y| recurse_proc x, &proc; recurse_proc y, &proc }\n proc.call result\n else\n proc.call result\n end\n end", "def each_leaf!\n raise \"Method not yet written.\"\n\n self.each do |leaf|\n yield(leaf)\n end\n end", "def each\n Directory.all.each do |node_id|\n yield find node_id\n end\n end", "def sum_recur(array)\n#for array = []\n return 0 if array == []\n\n first_el = array.shift\n recursive_call = sum_recur(array)\n first_el + recursive_call\n\nend", "def each\n return if @head.nil?\n curr = @head\n until curr.nil?\n yield curr.data\n curr = curr.nxt\n end\n end", "def recurse_proc(result, &proc)\n case result\n when Array\n result.each { |x| recurse_proc x, &proc }\n proc.call result\n when Hash\n result.each do |x, y|\n recurse_proc x, &proc\n recurse_proc y, &proc\n end\n proc.call result\n else\n proc.call result\n end\n end", "def my_find(collection)\n i = 0\n while i < collection.length\n return collection[i] if yield(collection[i]) #returns the collection element if return is true\n i += 1\n end\n\nend", "def each(&prc)\n link = first\n until link == self.tail\n prc.call(link)\n link = link.next\n end\n\n end", "def in_order_traverse(tree, array)\n if !tree.nil?\n in_order_traverse(tree.left, array)\n array.append(tree.value)\n in_order_traverse(tree.right, array)\n end\n return array\n\n\nend", "def each\n current_result = self\n begin \n last_result = current_result\n current_result.elements[:results].each do |result|\n\t# The collection of refs we are holding onto could grow without bounds, so dup\n\t# the ref\n\tyield result.dup\n end\n current_result = current_result.next_page if current_result.more_pages?\n end while !last_result.equal? current_result\n end", "def each\n \n nodo = @head\n while nodo != nil\n \n yield nodo.value\n nodo = nodo.next\n \n end\n \n end" ]
[ "0.69737864", "0.6534821", "0.6504392", "0.61961937", "0.612035", "0.6006995", "0.6003524", "0.59709257", "0.58989525", "0.5882559", "0.5882559", "0.58632016", "0.57267874", "0.5722852", "0.5702235", "0.5698411", "0.5694388", "0.56870574", "0.5681679", "0.5676611", "0.5675688", "0.5671687", "0.5657951", "0.56374454", "0.563198", "0.563083", "0.56306624", "0.5627689", "0.55825186", "0.55825186", "0.55775493", "0.55769324", "0.55769324", "0.55425686", "0.5522313", "0.5520164", "0.55195266", "0.55037284", "0.55024236", "0.55018145", "0.54985315", "0.54906553", "0.5486759", "0.54785204", "0.54770696", "0.5474342", "0.5471144", "0.5466572", "0.54663295", "0.5464759", "0.5459778", "0.54552925", "0.5454089", "0.54521745", "0.5444194", "0.54401433", "0.5438024", "0.5436062", "0.5428769", "0.54270566", "0.54258233", "0.5419719", "0.5417079", "0.54166764", "0.54054075", "0.54021084", "0.54021084", "0.53727496", "0.536632", "0.53598064", "0.53569806", "0.5350045", "0.534659", "0.5343263", "0.5341738", "0.5337844", "0.53315204", "0.5331191", "0.5323495", "0.5318809", "0.5318809", "0.5318528", "0.53031915", "0.53001237", "0.52820516", "0.52800363", "0.526828", "0.5254843", "0.52514774", "0.5249501", "0.5247116", "0.5242087", "0.5241372", "0.5238996", "0.5238798", "0.52385855", "0.5237734", "0.52372366", "0.52351534", "0.5231808", "0.5226509" ]
0.0
-1
If you want to just display the nth value in the sequence
def show_fib(n) return 0 if n == 0 return 1 if n == 1 show_fib(n-1) + show_fib(n-2) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def seq(i)\n\t\tif (i % 2 == 0)\n\t\t\treturn i / 2\n\t\telse\n\t\t\treturn i * 3 + 1\n\t\tend\n\tend", "def nthterm(first, n, c)\n #first is an array\n # first = first num in array\n # n = index value we want\n # c = constant add between terms\n sequence = [] \n sequence.push(first)\n #puts \"#{sequence}\"\n next_number = 0\n counter = 0\n\n loop do \n next_number = first - 1 + c\n #puts \"nextnum #{next_number}\"\n sequence.push(next_number)\n\n first = next_number\n counter += 1\n #puts \"first #{first}\"\n \n #puts \"#{sequence}\"\n break if n == counter\n end\n #puts\"coutn #{counter}\"\n #puts \"n #{n}\"\n #puts \"#{sequence}\"\n return sequence[n]\n\n\nend", "def [](n)\n nth(n) ;\n end", "def nth(n) \n\tif n <0 \n\t\treturn 0 \n\tend \n\tif n == 1\n\t\treturn 2 \n\telse \n\t\treturn nth(n-1) + 3 \n\tend\nend", "def values(n)\n n.times.map.with_index { |n|\n print \"Enter value ##{ 1 + n }: \"\n gets.chomp.to_i \n }\nend", "def series_up(num)\n size = num*(num+1)/2\n list = [1, 1, 2, 1, 2, 3, 1, 2, 3, 4]\n string = list[0..size-1]\n print string\nend", "def n_values(n)\n s = 'values('\n (1..n).each { |i| s += \"$#{i}, \" }\n s[0..-3] + ')'\nend", "def nth(n)\n if n > 9 and n.to_s[-2..-1].to_i.between?(10,19)\n \"#{n}th\"\n elsif n.to_s[-1].to_i == 1\n \"#{n}st\"\n elsif n.to_s[-1].to_i == 2\n \"#{n}nd\"\n elsif n.to_s[-1].to_i == 3\n \"#{n}rd\"\n else\n \"#{n}th\"\n end \n end", "def sequence(n)\n results = []\n 1.upto(n) {|num| results << num}\n results\nend", "def number_counting_seq(n)\r\n\r\nend", "def nth(n)\n\tif n <= 0 \n\t\treturn 0 \n\tend \n\tif n == 1\n\t\treturn 17 \n\telse \n\t\treturn nth(n-1) + 5 \n\tend \nend", "def next_number\n Sequence.next_val\n end", "def next_number(n)\n\t\t(n).map{|n|n+2}\n\tend", "def fourth\n at(3)\n end", "def sequence(count, first_nb)\n result = []\n count.times { |loop| result << (first_nb * (loop + 1)) }\n result\nend", "def sequence(n)\n return 0 if n == 0\n return 1 if n == 1\n\n first = @result[n - 1] || sequence(n - 1)\n second = @result[n - 2] || sequence(n - 2)\n\n first + second\n end", "def lineal_sequence(n)\n invoked!\n\n n.times do |index|\n yield index + 1\n end\n end", "def f(n)\n sum = (\"1\"*n).to_i # the last number of the sequence is n 1's\n # start with single digit if possible\n sum += n if n.to_s.length == 1\n # 2 digits next\n x = 2\n puts terms_of_n_with_length_x(n,x).inspect\n puts \"got here\"\n puts n-1\n (1..(n-1)).to_a.reverse.each do |x|\n puts x\n puts eat_2s(x)\n end\n return sum\nend", "def display(n)\n\n @numerals[n].each.with_index {|x,i| @segments[i].method(x).call}\n\n end", "def sequence(count, first_num)\n multiples = []\n count.times {|index| multiples[index] = first_num * (index +1) }\n multiples\nend", "def range_print_10\n (0..9).step(1) do |n| \n puts n \n end \n \nend", "def sequence(count, first)\n (1..count).map { |value| value * first }\nend", "def sequence3(number)\n array = []\n 1.upto(number) { |num| array << num }\n array\nend", "def sequence_number; end", "def example\n display [1, 3, 2, 4, 3, 4, 2 , 4, 1]\n end", "def print_numbers_divisible_by_three\n index = 1\n while index <= 1000\n if index % 3 == 0\n puts index\n end\n index += 1\n end\nend", "def sequence(num)\n\n results = []\n\n 1.upto(num) { |num| results << num }\n\n results\n\nend", "def sequence(number)\n result = []\n 1.upto(number) {|e| result << e}\n result\nend", "def print_three_times(name)\n idx = 0\n while idx < 3\n puts(name)\n idx = idx + 1\n end\nend", "def sixth\n at(5)\n end", "def number(nth)\n if nth <= 0\n 0\n elsif nth == 1\n 1\n else\n number(nth - 1) + number(nth - 2)\n end\n end", "def sequence(count, first)\n (1..count).map { |idx| idx * first }\nend", "def [](i)\n seq[i]\n end", "def repeatNum( v, n )\n\treturn (1..n).inject( \"\" ){ |s| s.to_s + v.to_s }\nend", "def pattern(n)\n # take an array from 1 to n and print each element\n # the amount of times of the value of that element\n # join the output elements with newline characters\n (1..n).map { |num| num.to_s * num }.join(\"\\n\")\nend", "def sequence(count, first)\n sequence = []\n number = first\n\n count.times do\n sequence << number\n number += first\n end\n sequence\nend", "def fifth\n at(4)\n end", "def nthterm(first, n, c)\n array = [] # [ ]\n array[0] = first # [1]\n 1.upto(10) do |i| # i = 1\n array << array[i - 1] + c \n end\n return array\nend", "def printi(text, n = 1)\n print idt(n) + text\n end", "def print_output(series)\n\tputs \"nth Fibonacci number is:#{series.at(series.length-1)}\"\n\tprint \"Fibonacci series for n = #{series.length-1} is \"\n\tseries.each do |i|\n\t\tprint \"\t#{i}\"\n\tend\nend", "def sequence(count, first_num)\n result = []\n multiple = 1\n\n count.times do \n result << first_num * multiple\n multiple += 1\n end\n result\nend", "def nthterm(first, n, c)\n n.times{ first += c }\n first\nend", "def display(number)\n display_each([number])\n end", "def five_it(item)\n 5.times do |count|\n p item + count.to_s\n end\nend", "def nthterm(first, n, c)\n first + n * c\nend", "def sequence(number)\n result = []\n 1.upto(number) do |num|\n result << num\n end\n \n result\nend", "def nth_expansion(n)\n n==0 ? \"2\" : \"2+ 1/#{nest(n-1)}\"\nend", "def basic_2\n x_range = (1..255)\n x_range.step(1) { |n| print \"#{n} \" if n % 2 != 0 }\n puts\nend", "def sequential(value)\n index = index_variable_for(value)\n index = (index ? index + 1 : 0)\n index = 0 if index == value.length\n set_index_variable(value, index)\n value[index]\n end", "def print_items(elective_array)\n elective_array.each_with_index do |value, i|\n puts \"#{i+1}. #{value}\"\n end\nend", "def cell(i)\n printf ' %3d ', i\n end", "def print_thrice(number)\n 3.times do\n puts number\n end\n end", "def list(nth)\n result = []\n if nth > 0\n (1..nth).each do |i|\n if i > 2 \n result << result[-1] + result[-2]\n else\n result << number(i) \n end\n end\n end\n result\n end", "def nth\n num = self.class.all_in_current_meeting.index(self)\n num ? num.ordinalize : nil\n end", "def nth\n loop do\n value = search( @ord )\n return value unless value.nil?\n build_out_prime_list\n end\n end", "def sequence(count = 3)\n render @phrases.sample(count).join(\" \")\n end", "def nth(n)\n proc {|*args|args[n]}\n end", "def next\r\n next_values[0]\r\n end", "def ninth\n at(8)\n end", "def basic_1\n x_range = (1..255)\n x_range.step(1) { |n| print \"#{n} \" }\n puts\nend", "def print_names_n_times(first, middle, last, n)\n # Don't worry about the syntax here for now.\n Range.new(0, n).each { puts \"#{first} #{middle} #{last}\" }\nend", "def test_get_number_by_idx\n assert_equal(@sequence[0], 5)\n \tassert_equal(@sequence[2], 13)\n assert_equal(@sequence[4], 34)\n assert_equal(@sequence[-33], nil)\n end", "def print_names_n_times(n, first, middle, last)\n # Don't worry about the syntax here for now.\n Range.new(0, n).each { puts \"#{first} #{middle} #{last}\" }\nend", "def at(n)\n return nil if n >= count\n first(n+1).pop\n end", "def sequence(num)\n (1..num).map { |n| n }\nend", "def number_counting_seq(n)\n count = 0\n result = ''\n while count < n\n if count == 0\n result = '1'\n else\n result = translate(result)\n end\n count += 1\n end\n result\nend", "def pattern(n)\n if n.odd?\n \t(2...n).step(2).map { |i| i.to_s * i }.join(\"\\n\")\n else\n \t(2..n).step(2).map { |i| i.to_s * i }.join(\"\\n\")\n end\nend", "def sequence(count, start_num)\n (1..count).map { |idx| start_num * idx }\nend", "def series_up(n)\n #nlist is the list that will be the output of the code\n nlist = []\n #i changed from an if statement to a loop.\n (n*(n+1)/2+1).times do |i|\n i.times do |x|\n nlist.push(x+1)\n end\n end\n #I use three dots to only get the information i need from the code\n return nlist[0...(n*(n+1)/2)].to_a\nend", "def print_items(electives)\n electives.each_with_index do |course, index| #each with index number\n puts \"#{index + 1}. #{course}\" #+1 b/c counting starts at 0\n end\nend", "def print_nth_last_node(number)\n head, result = @head, @head\n puts \"head is #{head.value if head} and result is #{result.value if result}\"\n number.times do \n if head.next != nil\n head = head.next\n else\n break \n end\n end\n \n puts \"after nth number head is #{head.value}\"\n \n until head.next == nil\n result = result.next\n head = head.next\n end \n \n return result\n end", "def tail(idx)\n (idx - 1) % 3 > 0 ? 1\n : (idx + 2) / 3 * 2\nend", "def sequence(quantity, number)\n sequence = []\n counter = 1\n quantity.times do \n sequence << number * counter\n counter += 1\n end\n sequence\nend", "def sequence\n @sequence\n end", "def many_results(n)\r\n\treturn 1, n /2, n\r\nend", "def print\r\n temp = @first\r\n while !temp.nil?\r\n printf \"#{temp.value} \"\r\n temp = temp.next\r\n end\r\n end", "def how_much_i_love_you(n)\nf = [\"I love you\",\n \"a little\",\n \"a lot\",\n \"passionately\",\n \"madly\",\n \"not at all\"]*n\nf[n-n+n-1]\nend", "def sequence(count, num)\n multiples = []\n count.times { |i| multiples.push(num * (i + 1)) }\n multiples\n # (1..count).map { |idx| idx * num }\nend", "def p14_sequence(number)\n return [1] if number == 1\n [number].concat(number % 2 == 0 ? p14_sequence(number/2) : p14_sequence((3*number) + 1))\n end", "def seq(n)\n return n if n <= 1\n seq(n-1) + seq(n-2)\nend", "def print_changing_numbers\n\t\ti = 1\n\t\t#zolang i kleiner is dan 11\n\t\twhile i < 11\n\t\t\t#print de string met het nummer variabele en verhoog het daarna met 1\n\t\t\tputs \"This sentence is number #{i}\"\n\t\t\ti = i+1\n\t\tend\n\tend", "def how_many_times(n)\r\n case n\r\n when 1 then 'once'\r\n when 2 then 'twice'\r\n else \"#{n} times\"\r\n end\r\n end", "def sequence(num)\n result = [1]\n times_number = num > 0 ? num - 1 : -(num) + 1\n times_number.times{num > 0 ? result << result.last + 1 : result << result.last - 1}\n result\nend", "def nextLooping(number)\n for i in 1..10\n if i * number % 5 == 0\n next\n else\n puts i * number\n end\n end\n end", "def pattern(n)\n if n <= 1 # number is 1 or lower\n return ''\n else # number is 2 or higher\n # for each number from 1 up to n, select only the even numbers\n # and print that number the amount of times equal to the number\n # and follow up with a new line for each unique even number\n (1..n).select(&:even?).map do |x|\n x.times { print \"#{x}\" }\n print \"\\n\"\n # return output\n # print \"\\n\"\n # return x\n # if n > 3\n # return \"#{x}\" * x\n # else\n # return \"#{x}\" * x + \"\\n\"\n # end\n end\n end\nend", "def rings\n my_list = [6, 5, 3, 1]\n 3.times do\n index = 0\n my_list.length.times do\n print my_list[index].to_s + \" \"\n index += 1\n end\n end\nend", "def sequence(num)\n 1.upto(num).map do |char|\n char\n end\nend", "def next_step(n)\n if n.even?\n n/2.to_i\n else\n 3*n+1\n end\nend", "def letra_x(n)\n result = \"\" \n t = n-1\n (n).times do |i| \n n.times do |b| \n if t == b \n result += \"*\"\n elsif i == b\n result += \"*\"\n else\n result += \" \"\n end\n end \n t -= 1 \n result += \"\\n\"\n end\n result\nend", "def last_four_display\n last_four.present? ? 'xx' + last_four.to_s : nil\n end", "def in_value(number, i = 1)\n if i <= number\n print \"#{i} \"\n i += 1\n in_value(number, i)\n end\n end", "def row(n = nil)\n CSI + \"#{n || 1}d\"\n end", "def print\n temp = @first\n while !temp.nil?\n printf \" #{temp.value}\"\n temp = temp.next\n end\n end", "def sequence(number)\n (1..number).to_a\nend", "def sequence(number)\n (1..number).to_a\nend", "def top(number)\n 1.upto(number) { |count| puts ('*' * count).center(number) if count.odd? }\nend", "def pattern(n)\n str = \"\"\n for i in 1..n do\n \n i.times do\n str += i.to_s\n # str += \"#{i}\"\n end\n str += \"\\n\"\n end\n \n puts str\nend", "def next_value_for_sequence(sequence_name)\n %{#{sequence_name}.nextval}\n end", "def third\n at(2)\n end", "def sequence(num)\n 1.downto(num).to_a\nend", "def print_odd_numbers_r(bound=99, n=3)\n if iteration <= bound\n puts n\n print_odd_numbers_r(bound, n+2)\n end\n\nend" ]
[ "0.6761991", "0.6681942", "0.65907806", "0.65312386", "0.64764225", "0.6361793", "0.63517886", "0.63505083", "0.6341358", "0.63384783", "0.6262007", "0.6247587", "0.62230974", "0.6211305", "0.62003475", "0.617645", "0.61654043", "0.6161797", "0.61507535", "0.61402637", "0.61042744", "0.61025953", "0.6097395", "0.6092218", "0.60887337", "0.60737133", "0.606425", "0.6063359", "0.60467076", "0.60443455", "0.6043994", "0.6043894", "0.6033324", "0.6032398", "0.6030779", "0.602872", "0.6027706", "0.60226786", "0.60069144", "0.60067475", "0.59998274", "0.5990553", "0.5983597", "0.59788054", "0.597758", "0.59771454", "0.5975417", "0.59508073", "0.59457546", "0.59389246", "0.5923737", "0.5922016", "0.5919973", "0.59148157", "0.5908204", "0.5907775", "0.5891288", "0.5881695", "0.5881274", "0.5874389", "0.58543277", "0.5853664", "0.5853507", "0.5853154", "0.5837434", "0.5835909", "0.5832132", "0.582878", "0.5819695", "0.5817552", "0.58134586", "0.5794894", "0.57921654", "0.57921624", "0.5784727", "0.57802725", "0.5778478", "0.57759404", "0.57726866", "0.5771189", "0.5766175", "0.57519996", "0.5745918", "0.5745911", "0.5728336", "0.5723726", "0.57201844", "0.5707793", "0.57023525", "0.56967914", "0.56930465", "0.56896234", "0.5685467", "0.56829685", "0.56829685", "0.5679674", "0.56756514", "0.56705755", "0.5670272", "0.56660306", "0.566556" ]
0.0
-1
GET /grant_rounds/1 GET /grant_rounds/1.json
def show @grant_round = GrantRound.find(params[:id]) render json: @grant_round end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @grant_round = GrantRound.new(grant_round_params(params[:grant_round]))\n\n if @grant_round.save\n render json: @grant_round, status: :created, location: @grant_round\n else\n render json: @grant_round.errors, status: :unprocessable_entity\n end\n end", "def update\n @grant_round = GrantRound.find(params[:id])\n\n if @grant_round.update(grant_round_params (params[:grant_round]))\n head :no_content\n else\n render json: @grant_round.errors, status: :unprocessable_entity\n end\n end", "def show_rounds\n\t\t@rounds = @participant.rounds\n\t\trender json: @rounds\n\tend", "def show\n @game = Game.where(user_id: current_user.id).find(params[:game_id])\n @round = @game.rounds.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @round }\n end\n end", "def index\n @game_rounds = current_user.game_rounds\n end", "def round(round_number)\n response = JSON.parse( self.class.get(\"#{BASE_URL}/contest/#{@api_key}/round/#{round_number}\") )\n end", "def request_round\n return auth_err unless auth?\n log \"#{@color} requested a round\"\n return wait_err unless wait_round\n get_map_render\n return game_terminated_msg if game_terminated?\n return {plain: \"continue.\\n\" + @map_render} if plain?\n return {json: {message: \"It's your turn\", map: @map_render, points: @map.took_hash}}\n end", "def rounds\n @title = \"My Rounds\"\n\n puts '====================== rounds'\n\n @user = User.find(params[:id])\n #@rounds = @user.rounds.where(complete: 'Y').paginate(page: params[:page], :per_page => 50)\n #@rounds = @user.rounds.paginate(page: params[:page], :per_page => 50)\n @rounds = @user.rounds\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json=> { \n :rounds=>@rounds.as_json(\n :include => { \n :holes => { },\n :scorecard => { },\n :event => { \n :include => { \n :course => {\n :include => {\n :facility => { :only => [:id, :facility_code, :facility_name, :address, :city, :state, :longitude, :latitude], \n :include => { \n :courses => { :only => [:id, :course_code, :facility_code, :course_name, :hol, :par] }\n }\n }\n } \n } \n }\n }\n }\n )\n } }\n end\n end", "def get(\n id,\n deadline: nil\n )\n req = V1::AccountGrantGetRequest.new()\n if not @parent.snapshot_time.nil?\n req.meta = V1::GetRequestMetadata.new()\n req.meta.snapshot_at = @parent.snapshot_time\n end\n\n req.id = (id)\n tries = 0\n plumbing_response = nil\n loop do\n begin\n plumbing_response = @stub.get(req, metadata: @parent.get_metadata(\"AccountGrants.Get\", req), deadline: deadline)\n rescue => exception\n if (@parent.shouldRetry(tries, exception))\n tries + [email protected](tries)\n next\n end\n raise Plumbing::convert_error_to_porcelain(exception)\n end\n break\n end\n\n resp = AccountGrantGetResponse.new()\n resp.account_grant = Plumbing::convert_account_grant_to_porcelain(plumbing_response.account_grant)\n resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)\n resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)\n resp\n end", "def create_rounds\n\t\t@rounds = []\n\t\tcase @participant.league.type\n\t\twhen \"Fantasy\"\n\t\t\t@rounds = [\"fantasy\"]\n\t\twhen \"Elimination\"\n\t\t\t@rounds = [\"elimination\"]\n\t\tend\n\t\trender json: @rounds\n\tend", "def current_round\n response = JSON.parse( self.class.get(\"#{BASE_URL}/contest/#{@api_key}/round\") )\n end", "def get_round_id\n round_id = @@curr_round[public_user.difficulty_level_id]\n end", "def show\n @grant = Grant.find(params[:id])\n @owner = User.find(@grant.owner)\n respond_to do |format|\n format.html { render :layout => false }# show.html.erb\n format.json { render json: @grant }\n end\n end", "def set_grant\n @grant = Grant.find(params[:id])\n end", "def set_grant\n @grant = Grant.find(params[:id])\n end", "def destroy\n @grant_round = GrantRound.find(params[:id])\n @grant_round.destroy\n\n head :no_content\n end", "def get_rounds\n puts \"How many rounds?\"\n @rounds = gets.chomp.to_i\n end", "def index\n @tournament = Tournament.find(params[:tournament_id])\n @rounds = @tournament.rounds\n end", "def show\n @grant_record = GrantRecord.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @grant_record }\n end\n end", "def get_account_id(summoner_name)\n # Given the summoner's name, make an API request for account information.\n url = \"https://#{REGION}.api.riotgames.com/lol/summoner/v4/summoners/by-name/#{summoner_name}?api_key=#{API_KEY}\"\n response_string = RestClient.get(url)\n #sleep(1)\n # The JSON object contains summoner account information. Return the accountId.\n summoner_account_info = JSON.parse(response_string)\n account_id = summoner_account_info[\"accountId\"]\nend", "def new\n @game = Game.where(user_id: current_user.id).find(params[:game_id])\n # @new_round = @game.rounds.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @round }\n end\n end", "def round_result\n @round = Round.find(params[:id])\n end", "def show\n @conference_grant = ConferenceGrant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conference_grant }\n end\n end", "def update\n respond_to do |format|\n if @grant.update(grant_params)\n format.html { redirect_to @grant, notice: \"Grant was successfully updated.\" }\n format.json { render :show, status: :ok, location: @grant }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @grant.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @player_round_loan = PlayerRoundLoan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player_round_loan }\n end\n end", "def update\n respond_to do |format|\n if @grant.update(grant_params)\n format.html { redirect_to grants_url, notice: 'Grant was successfully updated.' }\n format.json { render :index, status: :ok, location: @grant }\n else\n format.html { render :edit }\n format.json { render json: @grant.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_grant\n @grant = Grant.find(params[:id])\n rescue\n @grant = Grant.find(params[:grant_id])\n end", "def test_canvas_api_gsilver_profile\n refute_nil @w\n request_url = \"/users/sis_login_id:gsilver/profile\"\n result_as_json = run_and_get_json_result(request_url)\n assert_equal \"gsilver\", result_as_json['sis_login_id'], \"find tl gsilver\"\n end", "def show\n @round = Round.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @round }\n end\n end", "def round( num )\n h = get_matches\n matches = h[ 'rounds' ][ num-1 ] ## note: rounds hash starts with zero (not 1)\n matches\n end", "def show\n @round = Round.find(params[:id])\n @player_rounds = PlayerRound.select(\"id, amount, betValue, player_id, round_id\").where(:round_id => params[:id])\n end", "def grant_params\n params.require(:grant).permit(:user_id, :entry_id, :status)\n end", "def rounds(n)\n\t\tm1 = self.s1.next(nil)\n\t\tn.times do\n\t\t\tm1 = game(m1)\n\t\tend\n\t\tnumbers = self.scores << self.rp\n\t\tnames = self.hash.keys << :Rounds\n\t\treturn Hash[names.zip(numbers)] \n\tend", "def create\n @grant = Grant.new(grant_params)\n\n respond_to do |format|\n if @grant.save\n format.html { redirect_to grants_url, notice: 'Grant was successfully created.' }\n format.json { render :index, status: :created, location: @grant }\n else\n format.html { render :new }\n format.json { render json: @grant.errors, status: :unprocessable_entity }\n end\n end\n end", "def round_params\n params.require(:round).permit(:game_id)\n end", "def retrieve_attempted\n\t\trender json: @@contests_attempted_shared\n\tend", "def create\n @grant = current_user.grants.new(grant_params)\n authorize(@grant)\n\n respond_to do |format|\n if @grant.save\n format.html { redirect_to @grant, notice: \"Grant was successfully created.\" }\n format.json { render :show, status: :created, location: @grant }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @grant.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @military_battle_round = Military::BattleRound.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @military_battle_round }\n end\n end", "def get_match_ids(account_id)\n # Given a summoner's accountId, make an API request for their match history.\n url = \"https://#{REGION}.api.riotgames.com/lol/match/v4/matchlists/by-account/#{account_id}?api_key=#{API_KEY}\"\n response_string = RestClient.get(url)\n #sleep(1)\n match_history = JSON.parse(response_string)\n match_ids = match_history[\"matches\"].map {|match| match['gameId']}.uniq\nend", "def get_races(seasonid, raceweek)\n res = $client.post('/memberstats/member/GetSeriesRaceResults',\n \"seasonid=#{seasonid}&raceweek=#{raceweek}&invokedBy=SeriesRaceResults\",\n $headers)\n JSON.parse res.body\nend", "def get_league_standings_by_league(league_id)\n response = parse_api_request(\"#{BASE_URL}standings/#{league_id}\")[\"standings\"]\nend", "def show\n @round = Round.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @round }\n end\n end", "def grantor\n @data['grantor']\n end", "def show\n @user = current_user\n @round = Round.find(params[:id])\n @fighter = Fighter.find(@round.fighter_id)\n @score = Score.find_by_user_id(@user.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @round }\n end\n end", "def get_match_data(match_id)\n # Given a matchId, make an API request for the match data.\n url = \"https://#{REGION}.api.riotgames.com/lol/match/v4/matches/#{match_id}?api_key=#{API_KEY}\"\n response_string = RestClient.get(url)\n sleep(1)\n match_data = JSON.parse(response_string)\nend", "def index\n @rounds = Round.all\n end", "def index\n @rounds = Round.all\n end", "def index\n @rounds = Round.all\n end", "def index\n @rounds = Round.all\n end", "def index\n @rounds = Round.all\n end", "def index\n @rounds = Round.all\n end", "def index\n @rounds = Round.all\n end", "def show\n @slam = Slam.find(params[:id])\n @round1 = Round.create(round_number: 1, slam_id: @slam.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @slam }\n end\n end", "def get_new_token\n binding.pry \n auth = 'Basic ' + Base64.strict_encode64( session[:client_id] +\":\"+session[:client_secret]).chomp\n \n rcResultJson = RestClient.post(\n session[:token_url],\n {\n grant_type: 'refresh_token', \n refresh_token: session[:refresh_token], \n },\n {\n :Authorization => auth\n }\n )\n rcResult = JSON.parse(rcResultJson)\n\n session[:patient_id] = rcResult[\"patient\"]\n session[:access_token] = rcResult[\"access_token\"]\n session[:refresh_token] = rcResult[\"refresh_token\"]\n session[:token_expiration] = Time.now.to_i + rcResult[\"expires_in\"].to_i \n rescue => exception\n binding.pry \n err = \"Failed to refresh token\"\n redirect_to root_path, flash: { error: err }\n end", "def current_round\r\n self.rounds.last\r\n end", "def body\n {:refresh_token => atoken.refresh_token,\n :grant_type => \"refresh_token\",\n :client_id => client_id}\n end", "def update\n respond_to do |format|\n if @grant.update(grant_params)\n format.html { redirect_to grants_path, notice: 'تمّ تعديل منحة بنجاح' }\n format.json { render :show, status: :ok, location: @grant }\n else\n format.html { render :edit }\n format.json { render json: @grant.errors, status: :unprocessable_entity }\n end\n end\n end", "def next_round\n unless current_round == num_rounds\n update_attributes(current_round: current_round + 1)\n round.start_response_timer\n else\n max_points = game_players_by_points.first.points\n if max_points == 0\n game_players.each{|game_player| game_player.set_lose}\n else\n has_winner = game_players.select{|game_player| game_player.points == max_points}.count == 1\n if has_winner\n game_players_by_points.first.set_win\n else\n game_players.select{|game_player| game_player.points == max_points}.each{|game_player| game_player.set_tie}\n end\n game_players.reject{|game_player| game_player.points == max_points}.each{|game_player| game_player.set_lose}\n end\n update_attributes(current_state: 3)\n end\n end", "def guild_perks\r\n BnetApi::make_request('/wow/data/guild/perks')\r\n end", "def index\n @pmrounds = Pmround.all\n end", "def body\n {:client_id => client_id, :grant_type => :password}\n end", "def index\n @military_battle_rounds = Military::BattleRound.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @military_battle_rounds }\n end\n end", "def all_rounds\n generate(User.all)\n render :template => 'chart/index'\n end", "def test_canvas_api_self_profile\n skip(\"verify tl poweruse id number\")\n refute_nil @w\n request_url = \"/users/self/profile\"\n result_as_json = run_and_get_ruby_result(request_url)\n #logger.debug \"#{self.class.to_s}:#{__method__}:#{__LINE__}: result_as_json: #{result_as_json}\"\n assert_equal 330485, result_as_json['id'], \"found tl poweruser\"\n end", "def create\n\n @grant = Grant.new(params[:grant])\n @grant.owner = current_user.id unless current_user.nil?\n\n respond_to do |format|\n if @grant.save\n\n cookies.delete :grant_image unless cookies[:grant_image].nil?\n\n format.html { render json: true }\n format.json { render json: @grant, status: :created, location: @grant }\n else\n format.html { render json: @grant.errors }\n format.json { render json: @grant.errors, status: :unprocessable_entity }\n end\n end\n end", "def test_canvas_api_gsilver_profile\n skip(\"verify that have valid uniqname\")\n refute_nil @w\n request_url = \"/users/sis_login_id:gsilver/profile\"\n result_as_json = run_and_get_ruby_result(request_url)\n assert_equal \"gsilver\", result_as_json['sis_login_id'], \"find tl gsilver\"\n end", "def simulate_rounds\n League.current_seasons.each(&:simulate_round_actual!)\n\n respond_to do |format|\n flash[:notice] = t('defaults.simulate_rounds_success')\n format.html{ redirect_to leagues_path}\n end\n end", "def get_conversation(url)\n response = RestClient::Request.execute method: :get,\n url: url,\n user: USERNAME,\n password: PASSWORD,\n :content_type => :json,\n :accept => :json\n\n if response.headers[:x_ratelimit_remaining].to_i < 3\n reset_time = Time.at(response.headers[:x_ratelimit_reset].to_i)\n delay = (reset_time - Time.now) + 5\n puts 'SLEEPING FOR: '+ delay.to_s\n sleep delay\n end\n\n JSON(response)\n end", "def create_rounds\n Round.create_rounds(id)\n\n\n end", "def create_rounds\n Round.create_rounds(id)\n\n\n end", "def update\n @game = Game.where(user_id: current_user.id).find(params[:game_id])\n @round = @game.rounds.find(params[:id])\n\n respond_to do |format|\n if @round.update_attributes(params[:round])\n format.html { redirect_to @round, notice: 'Round was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @round.errors, status: :unprocessable_entity }\n end\n end\n end", "def grant_params\n params.require(:grant).permit(:fiscal_year, :grant_type, :organization, :project, :amount, :location, :strategic_priority, :strategic_results, :total_served, :nh_served, :grantStatusID)\n end", "def round_params\n params.permit(:id, round:\n [:roundtype_id, :round_number, :matches, :match_number]\n )\n end", "def round_params\n params.require(:round).permit(:deck_id, :username, :score)\n end", "def update\n @grant = Grant.find(params[:id])\n\n respond_to do |format|\n if @grant.update_attributes(params[:grant])\n format.html { redirect_to @grant, :notice => 'Grant was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @grant.errors, :status => :unprocessable_entity }\n end\n end\n end", "def index\n championship = Championship.find_by_desc($current_championship)\n unless championship == nil?\n @rounds = Round.get_all_rounds_by_championship_id(championship.id, params[:page])\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @rounds }\n end\n end", "def update\n @grant = Grant.find(params[:id])\n\n respond_to do |format|\n if @grant.update_attributes(params[:grant])\n format.html { redirect_to root_url, notice: 'Training was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @grant.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @grant = Grant.new\n\n respond_to do |format|\n format.html { render :layout => false } # new.html.erb\n format.json { render json: @grant }\n end\n end", "def index\n unless @level.present?\n redirect_to @user.highest_repetition_level_unlocked.path\n return\n end\n @formatted_round_times = current_user&.round_times_for_level_id(@level.id) || []\n if current_user&.completed_repetition_level?(@level)\n @high_scores = @level.high_scores\n else\n @high_scores = []\n end\n render \"game_modes/repetition\"\n end", "def new\n @grant_record = GrantRecord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @grant_record }\n end\n end", "def stats\n result = UserReservation.stats params[:id_list]\n render json: {revenue:result[:totalRevenue]}\n end", "def complete_lap\n if user_signed_in?\n current_user.completed_repetition_rounds.create!(\n repetition_round_params.merge(repetition_level_id: @level.id)\n )\n end\n render json: {}\n end", "def get_new_token\n auth = 'Basic ' + Base64.strict_encode64( session[:client_id] + \":\" + session[:client_secret]).chomp\n \n rcResultJson = RestClient.post(\n session[:token_url],\n {\n grant_type: 'refresh_token', \n refresh_token: session[:refresh_token], \n },\n {\n :Authorization => auth\n }\n )\n rcResult = JSON.parse(rcResultJson)\n\n session[:patient_id] = rcResult[\"patient\"]\n session[:access_token] = rcResult[\"access_token\"]\n session[:refresh_token] = rcResult[\"refresh_token\"]\n session[:token_expiration] = (Time.now.to_i + rcResult[\"expires_in\"].to_i )\n rescue StandardError => exception\n # binding.pry \n err = \"Failed to refresh token: \" + exception.message\n redirect_to root_path, alert: err\n end", "def renew_token\n body_params = token_request_body\n body_params << [\"refresh_token\", current_user.refresh_token]\n body_params << [\"grant_type\", \"refresh_token\"]\n\n get_token(body_params)\n redirect_to sage_accounting_data_path\n end", "def new\n @conference_grant = ConferenceGrant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @conference_grant }\n end\n end", "def show\n @user_rank = UserRanks.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_rank }\n end\n end", "def get(\n id,\n deadline: nil\n )\n return @account_grants.get(\n id,\n deadline: deadline,\n )\n end", "def next_rounds\n League.current_seasons.each(&:next_round!)\n\n respond_to do |format|\n flash[:notice] = t('defaults.next_rounds_success')\n format.html{ redirect_to leagues_path}\n end\n end", "def show\n @winning_number = WinningNumber.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @winning_number }\n end\n end", "def total_rewards\n total_paid_rewards = @current_user.rewards.where(reward_status_id: 12)\n total_investment = total_paid_rewards.where(reward_type_id: 11).inject(0){|sum, r| sum + r.value }\n total_binary = total_paid_rewards.where(reward_type_id: 13).inject(0){|sum, r| sum + r.value }\n total_ten_first = total_paid_rewards.where(reward_type_id: 14).inject(0){|sum, r| sum + r.value }\n render json: {investment: total_investment, binary: total_binary, ten_first: total_ten_first}, status: :ok\n end", "def grant_type\n \"refresh_token\"\n end", "def get_locks\n HTTParty.get(\"#{$base_url}/partners/#{$partner_id}/locks\", {headers: $headers}).parsed_response['locks']\nend", "def show\n @game = Game.find(params[:id])\n winner = @game.who_won\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: {money: current_user.money.to_i, lost: @game.winner && @game.winner != current_user, won: winner == current_user, my_round: @game.last_player != current_user, blocks:@game.blocks.map{|b| {id: b.id, owner: b.owner ? b.owner.login : nil , left: b.left, right: b.right, up: b.up, down: b.down}} }}\n end\n end", "def retrieve_token\n puts \"Picking up new token.\"\n parsed_json = {}\n until parsed_json[\"access_token\"]\n results = `curl -X -vvv -d 'client_id=MY_CLIENT_KEY&client_secret=MY_CLIENT_SECRET&grant_type=client_credentials' -X POST 'https://connect.gettyimages.com/oauth2/token/'`\n parsed_json = JSON.parse results\n end\n @token = parsed_json[\"access_token\"]\n end", "def get_user_id_harvest\n harvest_uri = URI(\"https://api.harvestapp.com/v2/users/me\")\n\n Net::HTTP.start(harvest_uri.host, harvest_uri.port, use_ssl: true) do |http|\n harvest_request = Net::HTTP::Get.new harvest_uri\n\n harvest_request[\"Authorization\"] = \"Bearer #{harvest_access_token}\"\n harvest_request[\"Harvest-Account-ID\"] = harvest_account_id\n harvest_request[\"User-Agent\"] = harvest_user_agent\n \n harvest_response = http.request harvest_request\n json_response = JSON.parse(harvest_response.body)\n return json_response[\"id\"]\n end\n end", "def game_params\n params.require(:game).permit(:rounds_count)\n end", "def recent_10_games(account_id, api_key_master)\n client = RestClient.get(\"https://na1.api.riotgames.com/lol/match/v4/matchlists/by-account/#{account_id}?endIndex=10&beginIndex=0&api_key=#{api_key_master}\")\n client_parsed = JSON.parse(client)\n end", "def get_team_years_participated ( team_key )\n get_api_resource \"#{@@api_base_url}team/#{team_key}/years_participated\"\n end", "def index\n if params[:event_id]\n @event = Event.find(params[:event_id])\n @rounds = Round.where(\"event_id = ?\", params[:event_id])\n else\n @rounds = Round.all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rounds }\n end\n end", "def show\n @round_robin_promo = RoundRobinPromo.find(params[:id])\n \n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @round_robin_promo }\n end\n end" ]
[ "0.6574804", "0.6303521", "0.6297159", "0.59546804", "0.5684905", "0.5604054", "0.55961215", "0.5567295", "0.55013156", "0.54587185", "0.5404429", "0.53626806", "0.5357462", "0.53246164", "0.53246164", "0.53016365", "0.52994055", "0.52834517", "0.5273851", "0.5202888", "0.51902497", "0.5185729", "0.5184178", "0.5172962", "0.51242566", "0.5121541", "0.5092907", "0.5088045", "0.5084609", "0.50823087", "0.50773096", "0.5071644", "0.5066575", "0.504725", "0.50428414", "0.50377756", "0.50294787", "0.50189316", "0.50119257", "0.5000088", "0.4998751", "0.49938756", "0.4987636", "0.4984445", "0.49796292", "0.49632862", "0.49632862", "0.49632862", "0.49632862", "0.49632862", "0.49632862", "0.49632862", "0.4951133", "0.49473342", "0.49438933", "0.4943571", "0.4939552", "0.4938657", "0.49273318", "0.49232158", "0.49119577", "0.49112698", "0.49076676", "0.49016023", "0.48983428", "0.4891677", "0.48798501", "0.48609188", "0.48580918", "0.48580918", "0.48579228", "0.48514566", "0.48509902", "0.4841071", "0.4840625", "0.48351327", "0.4834251", "0.48276687", "0.482645", "0.4826263", "0.48235098", "0.48218453", "0.482011", "0.48108247", "0.48003274", "0.47989702", "0.47956994", "0.4794662", "0.4794578", "0.47823668", "0.47806177", "0.4773386", "0.4761363", "0.4759925", "0.47568825", "0.47490394", "0.47348186", "0.4731861", "0.4728181", "0.47230732" ]
0.7232588
0
POST /grant_rounds POST /grant_rounds.json
def create @grant_round = GrantRound.new(grant_round_params(params[:grant_round])) if @grant_round.save render json: @grant_round, status: :created, location: @grant_round else render json: @grant_round.errors, status: :unprocessable_entity end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @grant_round = GrantRound.find(params[:id])\n\n if @grant_round.update(grant_round_params (params[:grant_round]))\n head :no_content\n else\n render json: @grant_round.errors, status: :unprocessable_entity\n end\n end", "def create_rounds\n Round.create_rounds(id)\n\n\n end", "def create_rounds\n Round.create_rounds(id)\n\n\n end", "def grant_params\n params.require(:grant).permit(:user_id, :entry_id, :status)\n end", "def round_params\n params.permit(:id, round:\n [:roundtype_id, :round_number, :matches, :match_number]\n )\n end", "def create_rounds\n\t\t@rounds = []\n\t\tcase @participant.league.type\n\t\twhen \"Fantasy\"\n\t\t\t@rounds = [\"fantasy\"]\n\t\twhen \"Elimination\"\n\t\t\t@rounds = [\"elimination\"]\n\t\tend\n\t\trender json: @rounds\n\tend", "def runTokenRenewalPost\n msg = Thread.current.to_s\n renew = Stopwatch.new(msg)\n renew.start\n payload = \"grant_type=#{@grant_type}&scope=#{@scope}&client_id=#{@key}&client_secret=#{@secret}\"\n response = RestClient.post @token_server,\n payload,\n {\n :content_type => \"application/x-www-form-urlencoded\"\n }\n ensure\n # make sure to print the elapsed time for the renewal.\n renew.stop\n logger.info(\"WAPI: renew token post: stopwatch: \"+renew.pretty_summary)\n end", "def round_params\n params.require(:round).permit(:debate_id, :round_number, :start_time, :end_time, :status)\n end", "def create\n @grant = current_user.grants.new(grant_params)\n authorize(@grant)\n\n respond_to do |format|\n if @grant.save\n format.html { redirect_to @grant, notice: \"Grant was successfully created.\" }\n format.json { render :show, status: :created, location: @grant }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @grant.errors, status: :unprocessable_entity }\n end\n end\n end", "def round_params\n params.require(:round).permit(:deck_id, :username, :score)\n end", "def round_params\n params.require(:round).permit(:date, :number, :tournament_id)\n end", "def grant_params\n params.require(:grant).permit(:fiscal_year, :grant_type, :organization, :project, :amount, :location, :strategic_priority, :strategic_results, :total_served, :nh_served, :grantStatusID)\n end", "def round_params\n params.require(:round).permit(:game_id)\n end", "def create\n @grant = Grant.new(grant_params)\n\n respond_to do |format|\n if @grant.save\n format.html { redirect_to grants_url, notice: 'Grant was successfully created.' }\n format.json { render :index, status: :created, location: @grant }\n else\n format.html { render :new }\n format.json { render json: @grant.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @grant_round = GrantRound.find(params[:id])\n\n render json: @grant_round\n end", "def create\n @round = @tournament.rounds.build(round_params)\n\n respond_to do |format|\n if @round.save\n format.html do redirect_to @round, notice: 'Round was successfully created.' end\n format.json { render :show, status: :created, location: @round }\n else\n @form_for = [@tournament, @round]\n format.html do render :new end\n format.json { render json: @round.errors, status: :unprocessable_entity }\n end\n end\n end", "def test_18_createandclose_challengegrant()\n\t\t\n\t\tputs \"---------------------- START OF SCENARIO 18 ----------------------\"\n\t\tcreateChallengeGrant($mgcreator_name, $mg_email, $mg_totalamount, $mg_date)\n\t\tdonateUsingSavedCard($donation_amount, $tip_amount)\n\t\tcloseChallengeGrant($mg_donationamount)\n\t\tputs \"---------------------- END OF SCENARIO 18 ----------------------\"\n\t\n\tend", "def game_params\n params.require(:game).permit(:rounds_count)\n end", "def complete_lap\n if user_signed_in?\n current_user.completed_repetition_rounds.create!(\n repetition_round_params.merge(repetition_level_id: @level.id)\n )\n end\n render json: {}\n end", "def grant_params\n params.require(:grant).permit(:description, :is_active, :budget, :closing_at, :starting_at, :closed_at, :is_selection_done)\n end", "def create\n @round = Round.new(round_params)\n\n respond_to do |format|\n if @round.save\n format.html { redirect_to @round.debate }\n format.json { render :show, status: :created, location: @round }\n else\n format.html { render :new }\n format.json { render json: @round.errors, status: :unprocessable_entity }\n end\n end\n end", "def round_params\n params.require(:round).permit(:number, :start_time, :tournament_id,\n :notification_message)\n end", "def request_grant_params\n params.require(:request_grant).permit(:user_id, :status, :comment)\n end", "def create\n @round = Round.new()\n \n\n @dateTime = Time.new\n @conservative = isConservative\n @result = resultRulleteBet\n\n @round.dateTime = @dateTime\n @round.conservative = @conservative\n @round.result = @result\n\n \n if @round.save \n addPlayerRound(@round.id)\n else\n format.html { render :new }\n format.json { render json: @round.errors, status: :unprocessable_entity }\n end\n end", "def round_params\n params.require(:round).permit(:game_id, :score1, :score2, :score3, :score4, :roundtype)\n end", "def create\n @tournament = Tournament.new(tournament_params)\n\n @tournament.current_round = 0\n @tournament.state = false\n\n respond_to do |format|\n if @tournament.save\n format.html { redirect_to @tournament, notice: 'Tournament was successfully created.' }\n format.json { render action: 'show', status: :created, location: @tournament }\n\n # Create all rounds when tournament is created\n @tournament.round_no.times do |x|\n @round = Round.new\n @round.round_no = x + 1\n @round.tournament_id = @tournament.id\n @round.name = @tournament.name + \" round \" + (x + 1).to_s \n @round.turn_duration = 7\n @round.save\n end\n else\n format.html { render action: 'new' }\n format.json { render json: @tournament.errors, status: :unprocessable_entity }\n end\n end\n end", "def post_round(round, post_content)\n response = HTTParty.post(\"#{BASE_URL}/contest/#{@api_key}/round/#{round}\", :body => {\"data\" => post_content} )\n end", "def pmround_params\n params.require(:pmround).permit(:round)\n end", "def create\n\n @grant = Grant.new(params[:grant])\n @grant.owner = current_user.id unless current_user.nil?\n\n respond_to do |format|\n if @grant.save\n\n cookies.delete :grant_image unless cookies[:grant_image].nil?\n\n format.html { render json: true }\n format.json { render json: @grant, status: :created, location: @grant }\n else\n format.html { render json: @grant.errors }\n format.json { render json: @grant.errors, status: :unprocessable_entity }\n end\n end\n end", "def round_params\n params.require(:round).permit(:round_no, :name, :about, :turn_duration, :start_date, :vote_date, :calc_date)\n end", "def create\n if Grant.active_grant_id==-1\n @grant = Grant.new(grant_params)\n respond_to do |format|\n if @grant.save\n [email protected]\n sectors=Sector.all.order(:id)\n sectors.each do |sector|\n @grant_sector=GrantSector.new\n @grant_sector.grant_id=grant_id\n @grant_sector.sector_id=sector.id\n @grant_sector.percentage=sector.percentage\n @grant_sector.save\n end \n format.html { redirect_to @grant, notice: 'تمّ إضافة منحة جديدة بنجاح' }\n format.json { render :show, status: :created, location: @grant }\n else\n format.html { render :new }\n format.json { render json: @grant.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to grants_path, alert: 'توجد منحة فعالة!! .. لا يمكن إضافة منحة جديدة'\n end \n end", "def create\n @tournament = Tournament.find(params[:tournament_id])\n @round = Round.new(round_params)\n @round.tournament_id = @tournament.id\n\n respond_to do |format|\n if @round.save\n format.html { redirect_to tournament_path(@tournament), notice: \"Round was successfully created.\" }\n format.json { render :show, status: :created, location: @round }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @round.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @aggregation_round = AggregationRound.new(aggregation_round_params)\n\n respond_to do |format|\n if @aggregation_round.save\n format.html { redirect_to @aggregation_round, notice: 'Aggregation round was successfully created.' }\n format.json { render :show, status: :created, location: @aggregation_round }\n else\n format.html { render :new }\n format.json { render json: @aggregation_round.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @round = Round.new(round_params)\n \n respond_to do |format|\n if @round.save\n format.html { redirect_to @round }\n format.json { render :show, status: :created, location: @round }\n else\n format.html { render :new }\n format.json { render json: @round.errors, status: :unprocessable_entity }\n end\n end\n end", "def simulate_rounds\n League.current_seasons.each(&:simulate_round_actual!)\n\n respond_to do |format|\n flash[:notice] = t('defaults.simulate_rounds_success')\n format.html{ redirect_to leagues_path}\n end\n end", "def round_params\n params.require(:round).permit(:judge_id, :status)\n end", "def round_params\n params.require(:round).permit(:judge_id)\n end", "def create\n @round = Round.new(round_params['round'])\n\n respond_to do |format|\n if @round.save\n @round.create_matches\n update_parents(@round)\n format.html { redirect_to @round, notice: 'Round was successfully created.' }\n format.json { render :show, status: :created, location: @round }\n else\n format.html { render :new }\n format.json { render json: @round.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @round = Round.new(round_params)\n\n respond_to do |format|\n if @round.save\n format.html { redirect_to game_round_path(@game, @round), notice: 'Round was successfully started!' }\n format.json { render :show, status: :created, location: @round }\n else\n format.html { render :new }\n format.json { render json: @round.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @game_round = GameRound.new(game_round_params)\n\n respond_to do |format|\n if @game_round.save\n format.html { redirect_to @game_round, notice: 'Game round was successfully created.' }\n format.json { render :show, status: :created, location: @game_round }\n else\n format.html { render :new }\n format.json { render json: @game_round.errors, status: :unprocessable_entity }\n end\n end\n end", "def round_params\n params.require(:round).permit(:number)\n end", "def create\n @game = Game.where(user_id: current_user.id).find(params[:game_id])\n @round = @game.rounds.build(params[:round])\n\n @round.determine_scores\n @game.rounds << @round unless @round.invalid?\n\n @game.determine_winner @round\n\n respond_to do |format|\n if @game.save\n\n url = if @game.completed?\n finish_game_url(@game)\n else\n game_rounds_url(@game)\n end\n\n\n format.html { redirect_to url, notice: 'Round was successfully created.' }\n format.json { render json: @round, status: :created, location: @round }\n else\n #if the round failed to create, we want to render the index with the failed round\n @rounds = @game.rounds\n format.html { render action: \"index\" }\n format.json { render json: @round.errors, status: :unprocessable_entity }\n end\n end\n end", "def round_params\n params.require(:round).permit(:delphiEstimation_id, :count, :closed)\n end", "def new\n @game = Game.where(user_id: current_user.id).find(params[:game_id])\n # @new_round = @game.rounds.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @round }\n end\n end", "def create\n @round = Round.new(params[:round])\n\n respond_to do |format|\n if @round.save\n format.html { redirect_to @round, notice: 'Round was successfully created.' }\n format.json { render json: @round, status: :created, location: @round }\n else\n format.html { render action: \"new\" }\n format.json { render json: @round.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @round = Round.new(round_params)\n @game = Game.find(@round.game_id)\n if @game.rounds.where(round_count: @round.round_count).not(player_id: current_user.id).take.exists?\n o_round = @game.rounds.where(round_count: @round.round_count).not(player_id: current_user.id).take\n @round.character = o_round.character\n else\n @round.character = CHARS[rand(26)]\n end\n respond_to do |format|\n if @round.save\n format.html { redirect_to @round, notice: 'Round was successfully created.' }\n format.json { render :show, status: :created, location: @round }\n else\n format.html { render :new }\n format.json { render json: @round.errors, status: :unprocessable_entity }\n end\n end\n end", "def round_params\n params.require(:round).permit(:name, :expiration_date, :tournament_id,\n games_attributes: [\n :id, :description, :team1,\n :team2, :start_time,\n :bet_points, :result, :_destroy\n ],\n multi_choices_attributes: [\n :id, :description, { options: [] },\n :bet_points, :result, :_destroy\n ] )\n \n end", "def destroy\n @grant_round = GrantRound.find(params[:id])\n @grant_round.destroy\n\n head :no_content\n end", "def advance_round\n @prevrnd = Round.find(params[:id])\n \n if params[:advance_round]\n @poets = []\n @slam = @prevrnd.slam\n @newrnd = @slam.rounds.create(round_number: @prevrnd.round_number.to_i + 1)\n @newrnd.assign_poets(params[:round][:poet])\n \n @newrnd.performances.each do |p|\n @poets << p.poet\n end\n redirect_to score_path(@newrnd.id)\n elsif params[:end_slam]\n @slam = @prevrnd.slam\n @slam.update_attributes(slam_complete: true)\n redirect_to slam_final_path(@prevrnd.slam_id)\n end\n end", "def test_17_createandclose_matchinggrant()\n\t\t\n\t\tputs \"---------------------- START OF SCENARIO 17 ----------------------\"\n\t\tsearchProject($pro_name)\n\t\tcreateMatchingGrant($mgcreator_name, $mg_email, $mg_totalamount, $mg_date)\n\t\tdonateUsingNewCard($mg_donationamount, $normal1_nameoncard, $street, $state, \n\t\t\t\t\t$city, $pin_code, $visacard_number, $visa_seccode, $normal1don_emailId)\n\t\tcloseMatchingGrant($mg_donationamount)\n\t\tputs \"---------------------- END OF SCENARIO 17 ----------------------\"\n\t\n\tend", "def settle\n \n\n if params[\"code\"]\n auth_code = params[\"code\"]\n end \n url = \"https://api.venmo.com/v1/oauth/access_token\"\n @response = HTTParty.post(url, :query => {:client_id => '1916', :client_secret => 'eGcyNHaysfbFGZ6xkMffUw3gGrKFzksG', :code => auth_code})\n user = @response[\"user\"]\n @access_token = @response[\"access_token\"]\n @refresh_token = @response[\"refresh_token\"]\n @email = params[:email]\n @amount = params[:amount]\n \n url = \"https://api.venmo.com/v1/payments\"\n @amount = HTTParty.post(url, :query => { \"access_token\" => @access_token, :email => @email, :amount => @amount, :note => 'PayUp'})\n redirect_to bets_path\n end", "def round_params\n params.require(:round).permit(:character, :points, :round_count, :city, :country, :river)\n end", "def set_grant\n @grant = Grant.find(params[:id])\n end", "def set_grant\n @grant = Grant.find(params[:id])\n end", "def run_params\n params.require(:run).permit(:total_coins, :steps, :calories, :user_id, :total_mushrooms, :total_turtles, :start_time, :end_time)\n end", "def update\n respond_to do |format|\n if @grant.update(grant_params)\n format.html { redirect_to @grant, notice: \"Grant was successfully updated.\" }\n format.json { render :show, status: :ok, location: @grant }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @grant.errors, status: :unprocessable_entity }\n end\n end\n end", "def workout_params\n params.require(:workout).permit(:name, :private, :rounds)\n end", "def build_rounds\n round_builder.build\n end", "def round_params\r\n params.require(:round).permit(\r\n :title,\r\n :started_at,\r\n :ended_at,\r\n :plan_id,\r\n :scenario_id,\r\n :project_id,\r\n :issue_id\r\n )\r\n end", "def game_params\n params.require(:game).permit(\n :stories,\n :draw_urls,\n :num_rounds)\n end", "def round_player_params\n params.require(:round_player).permit(:user_id, :round_id, :bet)\n end", "def create\n @conference_grant = ConferenceGrant.new(params[:conference_grant])\n\n respond_to do |format|\n if @conference_grant.save\n format.html { redirect_to @conference_grant, notice: 'Conference grant was successfully created.' }\n format.json { render json: @conference_grant, status: :created, location: @conference_grant }\n else\n format.html { render action: \"new\" }\n format.json { render json: @conference_grant.errors, status: :unprocessable_entity }\n end\n end\n end", "def next_round\n unless current_round == num_rounds\n update_attributes(current_round: current_round + 1)\n round.start_response_timer\n else\n max_points = game_players_by_points.first.points\n if max_points == 0\n game_players.each{|game_player| game_player.set_lose}\n else\n has_winner = game_players.select{|game_player| game_player.points == max_points}.count == 1\n if has_winner\n game_players_by_points.first.set_win\n else\n game_players.select{|game_player| game_player.points == max_points}.each{|game_player| game_player.set_tie}\n end\n game_players.reject{|game_player| game_player.points == max_points}.each{|game_player| game_player.set_lose}\n end\n update_attributes(current_state: 3)\n end\n end", "def show_rounds\n\t\t@rounds = @participant.rounds\n\t\trender json: @rounds\n\tend", "def create\n @player_round_loans = params[:player_round_loans].values.collect { |player_round_loan| PlayerRoundLoan.new(player_round_loan) }\n\n @player_round_loans.each do |player_round_loan|\n player_round_loan.save!\n end\n\n# @player_round_loan = PlayerRoundLoan.new(params[:player_round_loan])\n\n respond_to do |format|\n if @player_round_loans.all?(&:valid?)\n @round=Round.find(@player_round_loans[0].round_id)\n @round.played=true\n @round.save!\n # format.html { redirect_to new_player_round_investment_path(:player_id=>@player_round_loans[0].player_id, :round_id=>@player_round_loans[0].round_id, :brand_id=>@player_round_loans[0].brand_id) }\n format.html {redirect_to root_path}\n #format.html { redirect_to @player_round_loan, notice: 'Player round loan was successfully created.' }\n format.json { render json: @player_round_loan, status: :created, location: @player_round_loan }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player_round_loan.errors, status: :unprocessable_entity }\n end\n end\n end", "def request_round\n return auth_err unless auth?\n log \"#{@color} requested a round\"\n return wait_err unless wait_round\n get_map_render\n return game_terminated_msg if game_terminated?\n return {plain: \"continue.\\n\" + @map_render} if plain?\n return {json: {message: \"It's your turn\", map: @map_render, points: @map.took_hash}}\n end", "def create_rounds(game_ids)\n rounds = [[game_ids[game_ids.length - 4],\n game_ids[game_ids.length - 3],\n game_ids[game_ids.length - 2],\n game_ids[game_ids.length - 1]]]\n\n current_game_index = 0\n num_games_in_round = Bracket::NUM_TEAMS / 2\n final_game_index = current_game_index + (num_games_in_round - 1)\n while num_games_in_round >= 1\n rounds.push([])\n current_game_index.upto(final_game_index) do |game_index|\n rounds.last.push(game_ids[game_index])\n end\n num_games_in_round /= 2\n current_game_index = final_game_index + 1\n final_game_index = current_game_index + (num_games_in_round - 1)\n end\n\n rounds\n end", "def body\n {:client_id => client_id, :grant_type => :password}\n end", "def create\n @league = League.new(league_params)\n\n respond_to do |format|\n if @league.save\n\n (0..(@league.size-1)).each_with_index do |i|\n fantasy_team = @league.fantasy_teams.create(owner: \"Team #{i+1}\", pick_number: i+1)\n picks = []\n\n ([email protected]_size).each do |round|\n offset = round % 2 == 1 ? i + 1: @league.size - i\n pick = (round-1)*@league.size + offset\n @league.draft_picks.create(number: pick, fantasy_team: fantasy_team)\n end\n\n puts \"Team #{i} gets picks #{fantasy_team.draft_picks.map(&:number)}\\n\"\n end\n\n format.html { redirect_to @league, notice: 'League was successfully created.' }\n format.json { render :show, status: :created, location: @league }\n else\n format.html { render :new }\n format.json { render json: @league.errors, status: :unprocessable_entity }\n end\n end\n end", "def user_rumour_params\n params.require(:user_rumour).permit(:credible, :user_id, :rumour_id)\n end", "def create \n num_days = (Date.parse(params['rent_info']['end_date']).mjd - Date.parse(params['rent_info']['start_date']).mjd) \n total = num_days * params['rent_info']['price_per_day']\n # byebug\n if User.find(params['rent_info']['owner_id'])\n user = User.find(params['rent_info']['owner_id'])\n user.money_made += total \n user.save\n end\n\n renter_post = RenterPost.create(\n renter_id: params['rent_info']['renter_id'],\n post_id: params['rent_info'][\"post_id\"],\n start_date: params['rent_info'][\"start_date\"],\n end_date: params['rent_info'][\"end_date\"],\n status: params['rent_info'][\"status\"]\n )\n if renter_post \n render json: renter_post\n else\n render json: {error: \"Could not create Renter Post\"}\n end\n end", "def new_round \n\t\tself.remaining_players.each do |player|\n\t\t\tplayer.hands.create\n\t\tend\n\t\tself.update_attributes(:flowing_right => !self.flowing_right, :round => self.round + 1)\n\tend", "def create\n @grant_record = GrantRecord.new(params[:grant_record])\n\n respond_to do |format|\n if @grant_record.save\n format.html { redirect_to @grant_record, :notice => 'Grant record was successfully created.' }\n format.json { render :json => @grant_record, :status => :created, :location => @grant_record }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @grant_record.errors, :status => :unprocessable_entity }\n end\n end\n end", "def round_params\n params.require(:round).permit(:commit, :title, :number_of_questions, questions_attributes: [:id, :question, :answer])\n end", "def renew_token\n body_params = token_request_body\n body_params << [\"refresh_token\", current_user.refresh_token]\n body_params << [\"grant_type\", \"refresh_token\"]\n\n get_token(body_params)\n redirect_to sage_accounting_data_path\n end", "def run_round\n\t\t\tm, random_end = set_up_round\n\t\t\tactive_players = @players.select { |id, player| player[:food] > 0 }\n\t\t\t\n\t\t\tall_choices = Hash.new\n\t\t\ttotal_hunt_choices = 0\n\t\t\tactive_players.each do |id, player|\n\t\t\t\topponents = active_players.keys.shuffle\n\t\t\t\treps = opponents.map {|opp_id| @players[opp_id][:reputation]}\n\t\t\t\tchoices = player[:player].hunt_choices(@round, player[:food], player[:reputation], m, reps)\n\t\t\t\tall_choices[id] = Hash.new\n\t\t\t\topponents.each_with_index do |opp_id, index|\n\t\t\t\t\tall_choices[id][opp_id] = choices[index]\n\t\t\t\t\tif choices[index] == 'h'\n\t\t\t\t\t\t@players[id][:hunts] += 1\n\t\t\t\t\t\t@players[id][:food] -= 6\n\t\t\t\t\t\ttotal_hunt_choices += 1\n\t\t\t\t\telse\n\t\t\t\t\t\t@players[id][:slacks] += 1\n\t\t\t\t\t\t@players[id][:food] -= 2\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\n\t\t\treward_hunt_bounties(all_choices)\n\t\t\treward_extra_bounty(active_players, m, total_hunt_choices)\n\t\t\tset_players_remaining\n\t\t\tupdate_reputations\t\n\n\t\t\t@players_remaining < 2 || random_end\n\t\tend", "def game_params\n params.require(:game).permit(:players_num, :rounds_num, :currently_scored, :joined_players, :creator_id, :round_number)\n end", "def end_round_and_save\n args = request_params\n end_timing_for_round(args[:map_id], args[:round])\n save_and_remove_all(args[:map_id], args[:round])\n head :ok\n end", "def create\n @pmround = Pmround.new(pmround_params)\n\n respond_to do |format|\n if @pmround.save\n format.html { redirect_to @pmround, notice: 'Pmround was successfully created.' }\n format.json { render :show, status: :created, location: @pmround }\n else\n format.html { render :new }\n format.json { render json: @pmround.errors, status: :unprocessable_entity }\n end\n end\n end", "def gift_gold(months: 1)\n @client.post(\"/api/v1/gold/give/#{get_attribute(:name)}\", months: months)\n end", "def create\n @round = Round.new(params[:round])\n params[:round][:start_date] = Date.strptime(params[:round][:start_date], '%d/%m/%Y').strftime.to_s\n params[:round][:end_date] = Date.strptime(params[:round][:end_date], '%d/%m/%Y').strftime.to_s\n\n if params[:championship][:championship_id] == \"\"\n respond_to do |format|\n flash[:error] = \"Voce deve selecionar o campeonato\"\n format.html { render :action => \"new\" }\n end\n else\n @championship = Championship.find(params[:championship][:championship_id])\n @last_round4_championship = Round.find_by_championship_id(@championship.id)\n @round.championship = @championship\n num_round = (@last_round4_championship == nil)? 1 : Round.maximum(:num_round) +1\n @round.num_round = num_round\n\n\n respond_to do |format|\n if @round.save\n format.html { redirect_to @round, :notice => 'Round was successfully created.' }\n format.json { render :json => @round, :status => :created, :location => @round }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @round.errors, :status => :unprocessable_entity }\n end\n end\n end\n end", "def gift_gold(months: 1)\n client.post(\"/api/v1/gold/give/#{read_attribute(:name)}\", months: months)\n end", "def rent_params\n params.require(:rent).permit(:token, :pay_state, :total, :payment_method, :house_name, :room_name, :receipt_num)\n end", "def party_time(options)\n self.class.post(\"/open311/v2/requests.json\", query: options, headers: {'api_key' => ENV['API_KEY']})\n end", "def update\n respond_to do |format|\n if @grant.update(grant_params)\n format.html { redirect_to grants_url, notice: 'Grant was successfully updated.' }\n format.json { render :index, status: :ok, location: @grant }\n else\n format.html { render :edit }\n format.json { render json: @grant.errors, status: :unprocessable_entity }\n end\n end\n end", "def turn_params\n params.require(:turn).permit(:garage_num, :total_parking_number)\n end", "def rental_params\n params.require(:rental).permit(:bike_id, :user_id, :start_time, :end_time, :start_stand_id, :end_stand_id, :cost)\n end", "def enter_100k(num_rosters=1)\n contest_type = self.contest_types.where(\"name = '100k'\").first\n raise \"no 100k contest\" if contest_type.nil?\n system_user = User.where(:name => 'SYSTEM USER').first\n raise \"could not find system user\" if system_user.nil?\n num_rosters.times { Roster.generate(system_user, contest_type).fill_randomly.submit! }\n end", "def create\n @military_battle_round = Military::BattleRound.new(params[:military_battle_round])\n\n respond_to do |format|\n if @military_battle_round.save\n format.html { redirect_to @military_battle_round, notice: 'Battle round was successfully created.' }\n format.json { render json: @military_battle_round, status: :created, location: @military_battle_round }\n else\n format.html { render action: \"new\" }\n format.json { render json: @military_battle_round.errors, status: :unprocessable_entity }\n end\n end\n end", "def game_round_params\n params.require(:game_round).permit(:instrument_code, :start_at, :end_at, :period, :custom_highlow )\n end", "def next_rounds\n League.current_seasons.each(&:next_round!)\n\n respond_to do |format|\n flash[:notice] = t('defaults.next_rounds_success')\n format.html{ redirect_to leagues_path}\n end\n end", "def create\n if params.has_key?(:unbound_contributions)\n user = User.find_by(id: params[:user_id])\n ride = Ride.find_by(id: params[:ride_id])\n price = ride[:price]\n distance = user.rides.find_by(id: params[:ride_id])[:realtime_km]\n project_id = ride.project[:id]\n\n contribution_amount = price*distance\n user.update_attribute(:unbound_contributions, contribution_amount)\n user.contributions.update_attributes(amount: contribution_amount, project_id: project_id)\n user.rides.find_by(id: ride.id).update_attribute(:is_paid, true)\n render json: {:status => 200}\n else\n ride = Ride.find_by(id: params[:ride_id])\n new_ride = ride.requests.create!(passenger_id: params[:user_id], requested_from: params[:requested_from],\n request_to: params[:requested_to])\n unless new_ride.nil?\n respond_with ride: new_ride, anfrage: true, status: :created\n else\n respond_with ride: new_ride, anfrage: false, status: :bad_request\n end\n end\n end", "def create\n @round = Round.new(round_params)\n @round.started = false\n\n respond_to do |format|\n if @round.save\n format.html { redirect_to @round, notice: 'Round was successfully created.' }\n format.json { render action: 'show', status: :created, location: @round }\n else\n format.html { render action: 'new' }\n format.json { render json: @round.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @grant.update(grant_params)\n format.html { redirect_to grants_path, notice: 'تمّ تعديل منحة بنجاح' }\n format.json { render :show, status: :ok, location: @grant }\n else\n format.html { render :edit }\n format.json { render json: @grant.errors, status: :unprocessable_entity }\n end\n end\n end", "def assignment_round\n AssignmentQueue.assignment_round\n\n respond_to do |format|\n format.html do\n flash[:notice] = 'New assignment round generated'\n redirect_to action: :index\n end\n format.json { redirect_to action: :index, status: :ok }\n end\n end", "def seed_rounds(round_no, circuit_id, qly_datetime, race_datetime, qly_results_id, race_results_id)\n Round.create(round_number: round_no,\n circuit_id: circuit_id,\n qly_datetime: qly_datetime,\n race_datetime: race_datetime )\n end", "def create\n \n #timestamp={{FellAsleepAt}}&total_sleep={{TotalTimeSleptInSeconds}}&deep={{TimeInDeepSleepSeconds}}&light={{TimeInLightSleepSeconds}}&awake={{TimeAwakeSeconds}}\n \n json_hash = Hash.new\n \n description = params[:description]\n \n timestamp = params[:timestamp]\n total_sleep_seconds = params[:total_sleep]\n deep_sleep_seconds = params[:deep]\n light_sleep_seconds = params[:light]\n awake_seconds = params[:awake]\n \n if timestamp.nil? || total_sleep_seconds.nil?\n \n puts 'timestamp is nil or total_sleep_seconds is nil :('\n \n else\n \n total_sleep = total_sleep_seconds / 60.0\n deep = deep_sleep_seconds / 60.0\n light = light_sleep_seconds / 60.0\n awake = awake_seconds / 60.0\n \n post_to_twitter = false\n post_to_facebook = false\n \n # FellAsleepAt is formatted: August 23, 2013 at 11:01PM\n # Convert to Runkeeper's preferred format: Sat, 1 Jan 2011 00:00:00\n timestamp_datetime = DateTime.parse(timestamp)\n formatted_timestamp = timestamp_datetime.strftime(\"%a, %d %b %Y %H:%M:%S\")\n \n json_hash['timestamp'] = formatted_timestamp\n json_hash['total_sleep'] = deep\n json_hash['deep'] = deep\n json_hash['light'] = light\n json_hash['awake'] = awake\n json_hash['post_to_twitter'] = post_to_twitter\n json_hash['post_to_facebook'] = post_to_facebook\n \n url = 'https://api.runkeeper.com/sleep'\n \n uri = URI.parse(url)\n \n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n request = Net::HTTP::Post.new(uri.request_uri)\n request[\"Authorization\"] = \"Bearer \" + RUNKEEPER_ACCESS_TOKEN\n request[\"Content-Type\"] = \"application/vnd.com.runkeeper.NewSleep+json\"\n request.body = json_hash.to_json\n \n response = http.request(request)\n \n puts response.body\n \n end\n \n @sleep = json_hash\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sleep }\n end\n \n end", "def start_rounds\n League.current_seasons.each(&:start_round_actual!)\n\n respond_to do |format|\n flash[:notice] = t('defaults.start_rounds_success')\n format.html{ redirect_to leagues_path}\n end\n end", "def create_next_round(bracket_id, entrants_array)\n # Of a given array of game_sets, create next round (next_round)\n # with the entrants provided\n\n next_round = Round.create(\n bracket_id: bracket_id,\n round_number: self.round_number - 1\n )\n\n prev_rnd_games = self.game_sets\n copy_games = prev_rnd_games.clone\n\n # Must determine if round is final or not\n if next_round.round_number == 1 # next_round is last round, Base Case\n ## make limited-amount-to-all game_sets\n amount_of_prev_games = prev_rnd_games.length\n # entrants_array = self.bracket.tournament.teams\n amount_of_games_to_make = (entrants_array.length/2.to_f).ceil - amount_of_prev_games\n\n # Check if below halfway to prev_rnd_games amount\n if (amount_of_prev_games/2.to_f).ceil > amount_of_games_to_make\n incrementer = (amount_of_prev_games/amount_of_games_to_make.to_f).ceil\n index = 0\n while amount_of_games_to_make > 0\n # add children\n one_game_set = prev_rnd_games[index]\n # puts entrants_array.length\n if amount_of_games_to_make == 1 && entrants_array.length.odd?\n left_node = GameSet.create(parent_id: one_game_set.id, round_id: next_round.id)\n # byebug\n ent_array = entrants_array.to_a.shuffle\n one_game_set.update(team_2_id: ent_array.shift()[\"id\"])\n\n copy_games = copy_games.map { |game_set| game_set.id == one_game_set.id ? left_node : game_set }\n else\n left_node = GameSet.create(parent_id: one_game_set.id, round_id: next_round.id)\n right_node = GameSet.create(parent_id: one_game_set.id, round_id: next_round.id)\n copy_games = copy_games.flat_map { |game_set| game_set.id == one_game_set.id ? [left_node, right_node] : game_set }\n end\n amount_of_games_to_make -= 1\n index += incrementer\n end\n else # above half\n incrementer = 2\n index = 0\n while index <= amount_of_prev_games - 1\n # add children\n one_game_set = prev_rnd_games[index]\n if amount_of_games_to_make == 1 && entrants_array.length.odd?\n left_node = GameSet.create(parent_id: one_game_set.id, round_id: next_round.id)\n # byebug\n ent_array = entrants_array.to_a.shuffle\n one_game_set.update(team_2_id: ent_array.shift()[\"id\"])\n\n copy_games = copy_games.map { |game_set| game_set.id == one_game_set.id ? left_node : game_set }\n else\n left_node = GameSet.create(parent_id: one_game_set.id, round_id: next_round.id)\n right_node = GameSet.create(parent_id: one_game_set.id, round_id: next_round.id)\n copy_games = copy_games.flat_map { |game_set| game_set.id == one_game_set.id ? [left_node, right_node] : game_set }\n end\n amount_of_games_to_make -= 1\n index += incrementer\n end\n # Go back and add the remaining games\n index = 1\n while amount_of_games_to_make > 0\n # add children\n one_game_set = prev_rnd_games[index]\n if amount_of_games_to_make == 1 && entrants_array.length.odd?\n left_node = GameSet.create(parent_id: one_game_set.id, round_id: next_round.id)\n # byebug\n ent_array = entrants_array.to_a.shuffle\n one_game_set.update(team_2_id: ent_array.shift()[\"id\"])\n\n copy_games = copy_games.map { |game_set| game_set.id == one_game_set.id ? left_node : game_set }\n else\n left_node = GameSet.create(parent_id: one_game_set.id, round_id: next_round.id)\n right_node = GameSet.create(parent_id: one_game_set.id, round_id: next_round.id)\n copy_games = copy_games.flat_map { |game_set| game_set.id == one_game_set.id ? [left_node, right_node] : game_set }\n end\n\n amount_of_games_to_make -= 1\n index += incrementer\n end\n end\n puts copy_games\n # return copy_games\n shuffled_entrants = ((ent_array && ent_array.shuffle) || entrants_array.shuffle)\n copy_games.each do |game_set|\n # puts shuffled_entrants.length\n game_set.update(\n team_1_id: shuffled_entrants.shift()[\"id\"],\n team_2_id: shuffled_entrants.shift()[\"id\"]\n )\n end\n puts \"worked\"\n\n\n else\n ## fill all next_round's game_sets with children\n prev_rnd_games.each do |game_set|\n left_node = GameSet.create(parent_id: game_set.id, round_id: next_round.id)\n right_node = GameSet.create(parent_id: game_set.id, round_id: next_round.id)\n end\n ## recursive call\n return next_round.create_next_round(bracket_id, entrants_array)\n end\n\n end", "def game_params\n params.require(:game).permit(:date, :numplay, :description, :league, :backwards, :notrump, \n rounds_attributes: [:score, :place, :correct, :asterisk, :player_id, :id])\n end" ]
[ "0.6264875", "0.5942781", "0.5942781", "0.5720064", "0.57191443", "0.57124346", "0.5698458", "0.5643997", "0.5638932", "0.5637804", "0.55844456", "0.55760145", "0.557147", "0.54831064", "0.54622304", "0.5449626", "0.54019666", "0.53975177", "0.53915256", "0.5386423", "0.5379041", "0.5377491", "0.5361124", "0.5361056", "0.5343552", "0.5326056", "0.53219146", "0.5315095", "0.5307431", "0.5295399", "0.52938056", "0.5292942", "0.52855694", "0.5249309", "0.5239894", "0.5232121", "0.52221835", "0.5202039", "0.51977706", "0.51911", "0.51838064", "0.51661867", "0.51631784", "0.5159447", "0.5127032", "0.51216274", "0.5116664", "0.5115489", "0.51147634", "0.51129085", "0.51065475", "0.50398344", "0.50381255", "0.50381255", "0.50311804", "0.5029773", "0.5025739", "0.50180876", "0.5016627", "0.50106674", "0.500924", "0.5006318", "0.49995202", "0.49772373", "0.4932766", "0.49253878", "0.49186233", "0.49179834", "0.49146643", "0.49097112", "0.49078134", "0.49009478", "0.48987284", "0.4894897", "0.48883733", "0.48820788", "0.4879108", "0.4875689", "0.48664638", "0.48663068", "0.48542234", "0.48485184", "0.4839822", "0.48294368", "0.48293218", "0.48250815", "0.48125842", "0.4809797", "0.48091504", "0.48057672", "0.4803717", "0.4799998", "0.47931686", "0.47891062", "0.47877568", "0.47877106", "0.47835308", "0.477854", "0.47710925", "0.47710615" ]
0.74327177
0
PATCH/PUT /grant_rounds/1 PATCH/PUT /grant_rounds/1.json
def update @grant_round = GrantRound.find(params[:id]) if @grant_round.update(grant_round_params (params[:grant_round])) head :no_content else render json: @grant_round.errors, status: :unprocessable_entity end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @grant = Grant.find(params[:id])\n\n respond_to do |format|\n if @grant.update_attributes(params[:grant])\n format.html { redirect_to root_url, notice: 'Training was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @grant.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @grant.update(grant_params)\n format.html { redirect_to @grant, notice: \"Grant was successfully updated.\" }\n format.json { render :show, status: :ok, location: @grant }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @grant.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @grant = Grant.find(params[:id])\n\n respond_to do |format|\n if @grant.update_attributes(params[:grant])\n format.html { redirect_to @grant, :notice => 'Grant was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @grant.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @grant.update(grant_params)\n format.html { redirect_to grants_url, notice: 'Grant was successfully updated.' }\n format.json { render :index, status: :ok, location: @grant }\n else\n format.html { render :edit }\n format.json { render json: @grant.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @grant.update(grant_params)\n format.html { redirect_to grants_path, notice: 'تمّ تعديل منحة بنجاح' }\n format.json { render :show, status: :ok, location: @grant }\n else\n format.html { render :edit }\n format.json { render json: @grant.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @game = Game.where(user_id: current_user.id).find(params[:game_id])\n @round = @game.rounds.find(params[:id])\n\n respond_to do |format|\n if @round.update_attributes(params[:round])\n format.html { redirect_to @round, notice: 'Round was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @round.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @conference_grant = ConferenceGrant.find(params[:id])\n\n respond_to do |format|\n if @conference_grant.update_attributes(params[:conference_grant])\n format.html { redirect_to @conference_grant, notice: 'Conference grant was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @conference_grant.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @grant_record = GrantRecord.find(params[:id])\n\n respond_to do |format|\n if @grant_record.update_attributes(params[:grant_record])\n format.html { redirect_to @grant_record, :notice => 'Grant record was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @grant_record.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @grant_round = GrantRound.new(grant_round_params(params[:grant_round]))\n\n if @grant_round.save\n render json: @grant_round, status: :created, location: @grant_round\n else\n render json: @grant_round.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @grant_sector.update(grant_sector_params)\n format.html { redirect_to @grant_sector, notice: 'Grant sector was successfully updated.' }\n format.json { render :show, status: :ok, location: @grant_sector }\n else\n format.html { render :edit }\n format.json { render json: @grant_sector.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @round = Round.find(params[:id])\n\n respond_to do |format|\n if @round.update_attributes(params[:round])\n format.html { redirect_to @round, notice: 'Round was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @round.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @round.update(round_params)\n format.html { redirect_to :back, notice: 'Round was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @round.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @round.update(round_params)\n format.html { redirect_to :root }\n format.json { render :show, status: :ok, location: @round }\n else\n format.html { render :edit }\n format.json { render json: @round.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize! :update, @gf_travel_request\n respond_to do |format|\n if @gf_travel_request.update(grant_funded_travel_request_params)\n format.html { redirect_to @gf_travel_request, notice: 'Grant funded travel request was successfully updated.' }\n format.json { render :show, status: :ok, location: @gf_travel_request }\n else\n format.html { render :edit }\n format.json { render json: @gf_travel_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @round.update(round_params)\n format.html { redirect_to @round, notice: 'Round was successfully updated.' }\n format.json { render :show, status: :ok, location: @round }\n else\n format.html { render :edit }\n format.json { render json: @round.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @round.update(round_params)\n format.html { redirect_to @round, notice: 'Round was successfully updated.' }\n format.json { render :show, status: :ok, location: @round }\n else\n format.html { render :edit }\n format.json { render json: @round.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @round.update(round_params)\n format.html { redirect_to @round, notice: \"Round was successfully updated.\" }\n format.json { render :show, status: :ok, location: @round }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @round.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def update\n @player_round_loan = PlayerRoundLoan.find(params[:id])\n\n respond_to do |format|\n if @player_round_loan.update_attributes(params[:player_round_loan])\n format.html { redirect_to @player_round_loan, notice: 'Player round loan was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @player_round_loan.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @round.update_from_json(round_params['round'])\n update_parents(@round)\n format.html { redirect_to @round, notice: 'Round was successfully updated.' }\n format.json { render json: @round.errors, status: :unprocessable_entity }\n else\n format.html { render :edit }\n format.json { render json: @round.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @round.update(round_params)\n format.html do redirect_to @round, notice: 'Round was successfully updated.' end\n format.json { render :show, status: :ok, location: @round }\n else\n @form_for = @round\n format.html do render :edit end\n format.json { render json: @round.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_grant\n @grant = Grant.find(params[:id])\n end", "def set_grant\n @grant = Grant.find(params[:id])\n end", "def update\n @round_robin_promo = RoundRobinPromo.find(params[:id])\n\n respond_to do |format|\n if @round_robin_promo.update_attributes(params[:round_robin_promo])\n format.html { redirect_to @round_robin_promo, notice: 'Round robin promo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @round_robin_promo.errors, status: :unprocessable_entity }\n end\n end\n end", "def grant_params\n params.require(:grant).permit(:user_id, :entry_id, :status)\n end", "def update\n respond_to do |format|\n if @mystock.update(mystock_params)\n format.html { redirect_to @mystock, notice: 'mystock was successfully updated.' }\n format.json { render :show, status: :ok, location: @mystock }\n else\n format.html { render :edit }\n format.json { render json: @mystock.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @game_round.update(game_round_params)\n\n if @game_round.started? && @game_round.previous_changes.key?( 'custom_highlow')\n RedisService.custom_game_ground_winlose @game_round\n end\n\n format.html { redirect_to action: :index, notice: 'Game round was successfully updated.' }\n format.json { render :show, status: :ok, location: @game_round }\n else\n format.html { render :edit }\n format.json { render json: @game_round.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n mk = connect_mikrotik\n respond_to do |format|\n\n \n @plan_old = @plan.as_json # Guarda os parâmetros antigos do registro para retornar caso não consiga mudar no mikrotik\n \n id = mk.get_reply(\"/ppp/profile/print\", \"?name=#{@plan.profile_name}\")[0][\".id\"]\n puts \"Id do registro a ser mudado\"\n puts id\n\n if @plan.update(plan_params)\n \n result = mk.get_reply(\"/ppp/profile/set\",\n \"=name=#{plan_params[\"profile_name\"]}\",\n \"=rate-limit=#{plan_params[\"rate_limit\"]}\",\n \"=.id=#{id}\")[0][\"message\"]\n\n @notice = 'Plan was successfully updated.'\n if result != nil\n @notice = \"It wasn't possible to update mikrotik\"\n @plan.update(@plan_old)\n end\n\n format.html { redirect_to @plan, notice: @notice }\n format.json { render :show, status: :ok, location: @plan }\n else\n format.html { render :edit }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n #@user = User.find(params[:id])\n \n if @trainer.update(trainer_params)\n render json: @trainer\n else\n render json: @trainer.errors, status: :unprocessable_entity\n end\nend", "def update\n if @round.update(round_params)\n render :show, status: :ok\n else\n render json: @round.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @game_round.update(game_round_params)\n format.html { redirect_to case_game_rounds_path , notice: 'Game instance was successfully updated.' }\n format.json { render :show, status: :ok, location: @game_round }\n else\n format.html { render :edit }\n format.json { render json: @game_round.errors, status: :unprocessable_entity }\n end\n end\n end", "def request_grant_params\n params.require(:request_grant).permit(:user_id, :status, :comment)\n end", "def update\n Rails.logger.debug \"GOT TO matches -> update\"\n match = Match.find(params[:match_id].to_i)\n requestor = match.user_for_id(params[:requestor_id].to_i)\n recipient = match.user_for_id(params[:requested_id].to_i)\n match.ask_for_cards(requestor: requestor, recipient: recipient, card_rank: params['rank'].upcase)\n match.save!\n render json: nil, status: :ok\n end", "def update\n @shooting_round = ShootingRound.find(params[:id])\n\n respond_to do |format|\n if @shooting_round.update_attributes(params[:shooting_round])\n format.html { redirect_to(shooting_back() , :notice => 'Shooting round was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @shooting_round.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update number, routes\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 << \"/tns/{number}\"\r\n\r\n # process optional query parameters\r\n query_builder = APIHelper.append_url_with_template_parameters query_builder, {\r\n \"number\" => number,\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\" => \"Flowroute SDK 1.0\",\r\n \"content-type\" => \"application/json; charset=utf-8\"\r\n }\r\n\r\n response = CustomAuthUtility.append_custom_auth_params method:'PATCH',\r\n query_url:query_url,\r\n body:\"{\\\"routes\\\": #{routes.to_json}}\",\r\n headers:headers\r\n\r\n # Error handling using HTTP status codes\r\n if response.code == 401\r\n raise APIException.new \"NOT AUTHORIZED\", 401, response.raw_body\r\n elsif response.code == 500\r\n raise APIException.new \"APPLICATION/SERVER ERROR\", 500, response.raw_body\r\n elsif !(response.code.between?(200,206)) # [200,206] = HTTP OK\r\n raise APIException.new \"HTTP Response Not OK\", response.code, response.raw_body\r\n end\r\n\r\n response.body\r\n end", "def update!(**args)\n @grant_type = args[:grant_type] if args.key?(:grant_type)\n @options = args[:options] if args.key?(:options)\n @requested_token_type = args[:requested_token_type] if args.key?(:requested_token_type)\n @subject_token = args[:subject_token] if args.key?(:subject_token)\n @subject_token_type = args[:subject_token_type] if args.key?(:subject_token_type)\n end", "def updatePendingPay\n if !(Integer(params[:id]) rescue false)\n renderError(\"Not Acceptable (Invalid Params)\", 406, \"The parameter id is not an integer\")\n return -1\n end\n options = {\n :body => params.to_json,\n :headers => {\n 'Content-Type' => 'application/json'\n }\n }\n resul = HTTParty.get(\"http://192.168.99.101:4055/lists/\"+params[:id])\n user = resul[\"user_id\"]\n if user == (@current_user[\"id\"]).to_i\n results = HTTParty.put(\"http://192.168.99.101:4055/lists/\"+params[:id], options)\n if results.code == 201\n head 201\n else\n render json: results.parsed_response, status: results.code\n end\n else\n renderError(\"Not Acceptable (Invalid Params)\", 403, \"The user does not have permmision\")\n end\n end", "def update\n @military_battle_round = Military::BattleRound.find(params[:id])\n\n respond_to do |format|\n if @military_battle_round.update_attributes(params[:military_battle_round])\n format.html { redirect_to @military_battle_round, notice: 'Battle round was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @military_battle_round.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @aggregation_round.update(aggregation_round_params)\n format.html { redirect_to @aggregation_round, notice: 'Aggregation round was successfully updated.' }\n format.json { render :show, status: :ok, location: @aggregation_round }\n else\n format.html { render :edit }\n format.json { render json: @aggregation_round.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n ct = ClientToken.where(\n id: @client_token_id,\n status: GlobalConstant::ClientToken.active_status\n ).first\n\n return validation_error(\n 'e_p_2',\n 'invalid_api_params',\n ['invalid_client_token_id'],\n GlobalConstant::ErrorAction.default\n ) unless ct.present?\n\n ctp = ClientTokenPlanner.find_or_initialize_by(client_token_id: @client_token_id)\n ctp.token_worth_in_usd = @token_worth_in_usd\n\n if ctp.changed?\n\n if ctp.token_worth_in_usd_changed? && !ct.send(\"#{GlobalConstant::ClientToken.token_worth_in_usd_setup_step}?\")\n\n bit_value = ClientToken.setup_steps_config[GlobalConstant::ClientToken.token_worth_in_usd_setup_step]\n\n # We are firing this extra update query to ensure that even\n # if multiple requests are fired from FE, we enqueue job onlu once\n updated_row_cnt = ClientToken.where(id: @client_token_id).\n where(\"setup_steps is NULL OR (setup_steps & #{bit_value} = 0)\").update_all(\"setup_steps = setup_steps | #{bit_value}\")\n\n @is_first_time_set = (updated_row_cnt == 1)\n\n CacheManagement::ClientToken.new([ct.id]).clear if @is_first_time_set\n\n end\n\n ctp.save!\n CacheManagement::ClientTokenPlanner.new([ct.id]).clear\n\n end\n\n success\n\n end", "def update\n @round = Round.find(params[:id])\n\n respond_to do |format|\n if @round.update_attributes(params[:round])\n format.html { redirect_to(@round, :notice => 'Round was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @round.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n (kick and return) if not is_god?\n if (params[:team].has_key? :pass_hash) and (params.has_key? :do_hash)\n clear_pass = params[:team][:pass_hash]\n hash = Digest::SHA1.base64digest clear_pass\n params[:team][:pass_hash] = hash\n end\n @team = Team.find(params[:id])\n points_adjust = params[:points_adjust].to_i\n @team.points = @team.points + points_adjust\n\n pref = 'has_solved_'\n puzzles_to_set_solved = params.keys.select do |k| \n k.start_with? pref\n end.map do |k|\n k.sub(pref, '').to_i\n end\n actual_solved_ids = @team.puzzles.map{|p| p.id}\n # puts actual_solved_ids.inspect\n # puts puzzles_to_set_solved.inspect\n\n puzzles_to_set_solved.each do |pid|\n if not actual_solved_ids.include? pid\n s = Solve.new(:puzzle_id => pid, :team_id => @team.id, :time_solved => Time.now)\n s.save\n end\n end\n actual_solved_ids.each do |pid|\n if not puzzles_to_set_solved.include? pid\n Solve.where(:puzzle_id => pid, :team_id => @team.id).destroy_all\n Callin.where(:puzzle_id => pid, :team_id => @team.id).destroy_all\n end\n end\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_grant\n @grant = Grant.find(params[:id])\n rescue\n @grant = Grant.find(params[:grant_id])\n end", "def show\n @grant_round = GrantRound.find(params[:id])\n\n render json: @grant_round\n end", "def update\n @round = Round.find(params[:id])\n\n respond_to do |format|\n if @round.update_attributes(params[:round])\n format.html { redirect_to(@round, :notice => 'Round was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @round.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @round = Round.find(params[:id])\n\n respond_to do |format|\n if @round.update_attributes(params[:round])\n format.html { redirect_to(@round, :notice => 'Round was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @round.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @pmround.update(pmround_params)\n format.html { redirect_to @pmround, notice: 'Pmround was successfully updated.' }\n format.json { render :show, status: :ok, location: @pmround }\n else\n format.html { render :edit }\n format.json { render json: @pmround.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n begin\n ## Can't review an already reviewed request.\n if @permission_request.reviewed\n respond_with_error 'This request has already been reviewed.', \n permission_request_path(@permission_request)\n else\n granted = (params.require(:permission_request).require(:action) == 'grant')\n \n ## Update the request with the review.\n @permission_request.update!({\n reviewed: true,\n granted: granted,\n reviewed_by: current_user,\n reviewed_on: Time.now\n })\n \n ## Update the user's permission level.\n if granted\n @permission_request.user.update!({\n permission_level: @permission_request.level_requested,\n permission_level_granted_on: @permission_request.reviewed_on,\n permission_level_granted_by: current_user\n })\n @user = @permission_request.user\n @user.send_permissions_changed_email\n end\n \n respond_to do |format|\n format.json { render json: {\n success: true, \n permission_request: {\n granted: @permission_request.granted,\n reviewed_by_username: current_user.username,\n reviewed_on: @permission_request.reviewed_on\n }\n } }\n format.html { redirect_to path }\n end\n end\n rescue => e \n respond_with_error 'There was a problem saving changes to this request.', \n permission_request_path(@permission_request)\n end\n end", "def update\n @round = Round.find(params[:id])\n @fight = Fight.find(@round.fight_id)\n\n respond_to do |format|\n if @round.update_attributes(params[:round])\n format.html { redirect_to @fight, notice: 'Round was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @round.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize @powder\n respond_to do |format|\n if @powder.update(powder_params)\n format.html { redirect_to @powder, notice: \"Powder was successfully updated.\" }\n format.json { render :show, status: :ok, location: @powder }\n else\n format.html { render :edit }\n format.json { render json: @powder.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if User.update(current_user.id, :game_id => params[:id])\n format.json { head :no_content }\n end\n end\n end", "def update_users_password(args = {}) \n put(\"/users.json/backoffice/#{args[:userId]}/password/#{args[:password]}\", args)\nend", "def update_users_password(args = {}) \n put(\"/users.json/backoffice/#{args[:userId]}/password/#{args[:password]}\", args)\nend", "def update\n @round = @season.rounds.find(params[:id])\n\n respond_to do |format|\n if @round.update_attributes(params[:round])\n flash[:notice] = 'Round was successfully updated.'\n format.html { redirect_to season_round_path(@round.season, @round) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @round.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n expose Challenge.update(@oauth_token, params[:challenge_id].strip,\n params[:data])\n end", "def update\n @round_expense = RoundExpense.find(params[:id])\n\n respond_to do |format|\n if @round_expense.update_attributes(params[:round_expense])\n format.html { redirect_to(@round_expense, :notice => 'Round expense was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @round_expense.errors, :status => :unprocessable_entity }\n end\n end\n end", "def renew_token\n body_params = token_request_body\n body_params << [\"refresh_token\", current_user.refresh_token]\n body_params << [\"grant_type\", \"refresh_token\"]\n\n get_token(body_params)\n redirect_to sage_accounting_data_path\n end", "def update\n authorize @trip\n\n\n @trip.estimated_expenses.each do |exp|\n exp.requests.each do |req|\n req.amount_from_total = req.percentrequested * exp.total\n req.destination = @trip.destination\n req.expense_type = 'estimated'\n end\n end\n\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @round.update(round_params) && @round.debate.rounds.count >= 3\n format.html { redirect_to @round.debate, notice: 'Your debate is now over. Share with friends and check back later for results.' }\n format.json { render :show, status: :ok, location: @round }\n elsif @round.update(round_params) && @round.debate.rounds.count < 3\n format.html { redirect_to @round.debate, notice: 'The previous round is now complete.' }\n format.json { render :show, status: :ok, location: @round }\n else\n format.html { redirect_to @round.debate, notice: @round.errors.full_messages.first[7..100]}\n format.json { render json: @round.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_request_grant\n @request_grant = RequestGrant.find(params[:id])\n end", "def update\n @time_clock = TimeClock.find(params[:id])\n respond_to do |format|\n if @time_clock.update(time_clock_params)\n format.html { redirect_to @time_clock.user }\n format.json { render :show, status: :ok, location: @time_clock }\n else\n format.html { render :edit }\n format.json { render json: @time_clock.errors, status: :unprocessable_entity }\n end\n @time_clock.billed = 0\n @time_clock.hours = time_diff(@time_clock.clock_in, @time_clock.clock_out)\n @time_clock.save!\n end\n end", "def update\n @sundry_grn = SundryGrn.find(params[:id])\n\n respond_to do |format|\n if @sundry_grn.update_attributes(params[:sundry_grn])\n format.html { redirect_to @sundry_grn, :notice => 'Sundry grn was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @sundry_grn.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @review.update(review_params) && @review.revoke_approval!\n format.json { render :show, status: :ok, location: @review }\n else\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @workout_session = WorkoutSession.find(params[:id])\n if !user_is_allowed?(@workout_session)\n redirect_to workout_sessions_path\n return\n end\n\n @workout_session = WorkoutSession.find(params[:id])\n\n @workout_session.date = params[:session][:date]\n\n params[:exercises].each_value do |e|\n e.each_value do |thrill|\n exercise = Exercise.find(thrill[:id])\n ewt = ExercisesWorkoutThrill.find(thrill[:thrill_id])\n ewt.multiplier = thrill[:multiplier]\n ewt.value = thrill[:value]\n\n ewt.save!\n # TODO: recalculate points...\n #award_points_by_thrill(ewt)\n #end\n end\n\n end\n @workout_session.save!\n\n respond_to do |format|\n if @workout_session.save!\n format.html { redirect_to @workout_session, notice: 'Workout session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @workout_session.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @round.make_guess(params[\"round\"][\"guessed_letter\"])\n update_current_player\n format.html { redirect_to game_round_path(@game, @round) }\n format.json { render :show, status: :created, location: @round }\n else\n format.html { redirect_to game_round_path(@game, @round), notice: 'Invalid guess' }\n format.json { render :show, status: :created, location: @round }\n end\n end\n end", "def update!\n @authorize = nil\n update_plan! &&\n resp = put(\"/users/#{username}.xml\", {\n :user_key => apikey,\n \"user[first_name]\" => first_name,\n \"user[last_name]\" => last_name\n })\n end", "def round_params\n params.permit(:id, round:\n [:roundtype_id, :round_number, :matches, :match_number]\n )\n end", "def update\n if @gift.user == @current_user\n if @gift.update(gift_params)\n render json: @gift, include: :ages\n else\n render json: @gift.errors, status: :unprocessable_entity\n end\n else\n render json: { errors: \"not authorized\" }, status: :unauthorized\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 @teams = Team.order(:name)\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to \"/retrospectives\", notice: \"Your profile was succesfully updated!\" }\n else\n format.html { render action: \"edit\" }\n end\n end\n end", "def update\n @rum = Rum.find(params[:id])\n\n respond_to do |format|\n if @rum.update_attributes(params[:rum])\n format.html { redirect_to @rum, notice: 'Rum was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rum.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if (admin_priveledge? == false) && (myself?(params[:id]) == false)\n redirect_to teammates_path, :notice => \"Die noetigen Rechte fehlen.\"\n return\n end\n\n @teammate = Teammate.find(params[:id])\n\n respond_to do |format|\n if @teammate.update_attributes(params[:teammate])\n format.html { redirect_to @teammate, :notice => 'Teammate was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @teammate.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n # @user_trick = UserTrick.find(params[:id])\n @user_trick.update(user_trick_params)\n render json: UserTrickSerializer.new(@user_trick).serialized_json\n end", "def update_current_logged_in_users_password(args = {}) \n put(\"/users.json/current/password\", args)\nend", "def update\n respond_to do |format|\n if @user_replay_rate.update(user_replay_rate_params)\n format.html { redirect_to @user_replay_rate, notice: 'User replay rate was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_replay_rate }\n else\n format.html { render :edit }\n format.json { render json: @user_replay_rate.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n appointment_request = current_user.pending_requests.find(\n params[:request_id]\n )\n\n case params[:answer]\n when 'accept'\n if appointment_request.accept!\n redirect_to root_path\n else\n render status: 500\n end\n when 'reject'\n if appointment_request.reject!\n redirect_to root_path\n else\n render status: 500\n end\n else\n render json: { appointment_request: appointment_request, status: 200 }\n end\n end", "def update!(**args)\n @id_token = args[:id_token] if args.key?(:id_token)\n @refresh_token = args[:refresh_token] if args.key?(:refresh_token)\n end", "def update\n @winning_number = WinningNumber.find(params[:id])\n\n respond_to do |format|\n if @winning_number.update_attributes(params[:winning_number])\n format.html { redirect_to @winning_number, notice: 'Winning number was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @winning_number.errors, status: :unprocessable_entity }\n end\n end\n end", "def reset_password\n id = params[:data]\n @user = User.find(id)\n respond_to do |format|\n if @user.update_attributes(password: \"1qazxsw2\", password_confirmation: \"1qazxsw2\")\n format.json { render json: @user }\n end\n end\n end", "def update\n @user_livestock = UserLivestock.find(params[:id])\n\n respond_to do |format|\n if @user_livestock.update_attributes(params[:user_livestock])\n format.html { redirect_to @user_livestock, notice: 'User livestock was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_livestock.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @trustees_minute.update(trustees_minute_params)\n format.html { redirect_to @trustees_minute, notice: 'Trustees minute was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trustees_minute.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @globus_token.update(globus_token_params)\n format.html { redirect_to globus_token_url(@globus_token), notice: \"Globus token was successfully updated.\" }\n format.json { render :show, status: :ok, location: @globus_token }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @globus_token.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @time_clock.update(time_clock_params)\n format.html { redirect_to time_sheet_index_path(@time_clock), notice: 'Time clock entry was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @time_clock.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @pmr = Combined::Pmr.from_param!(params[:id], signon_user)\n render :json => \"#{@pmr.problem}\"\n end", "def update\n @replay = Replay.find(params[:id])\n @replay.level_id = params[:replay][:level_id]\n @replay.score = params[:replay][:score]\n @replay.player = params[:replay][:player]\n @replay.data = params[:replay][:data].read\n\n respond_to do |format|\n\n format.html { redirect_to replays_path, :notice => 'Replay was successfully updated.' }\n format.json { head :no_content }\n\n end\n end", "def update\n respond_to do |format|\n if @opt10075.update(opt10075_params)\n format.html { redirect_to @opt10075, notice: 'Opt10075 was successfully updated.' }\n format.json { render :show, status: :ok, location: @opt10075 }\n else\n format.html { render :edit }\n format.json { render json: @opt10075.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @rally.update(rally_params)\n format.html { redirect_to @rally, notice: 'Rally was successfully updated.' }\n format.json { render :show, status: :ok, location: @rally }\n else\n format.html { render :edit }\n format.json { render json: @rally.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @grant_round = GrantRound.find(params[:id])\n @grant_round.destroy\n\n head :no_content\n end", "def update\n @scratcher = Scratcher.find(params[:id])\n\n if @scratcher.update(permitted_params)\n head :no_content\n else\n render json: @scratcher.errors, status: :unprocessable_entity\n end\n end", "def update_profile(body={})\n perform_post(\"/account/update_profile.json\", :body => body)\nend", "def update\n #@auth_assign_permit = Auth::AssignPermit.find(params[:id])\n if current_user.admin_group?\n @admin_user = current_user\n @owner_user = User.find(params[:id])\n\n respond_to do |format|\n if @owner_user.update_attributes(params[:user])\n format.html { redirect_to auth_assign_permit_path(@owner_user), notice: 'Assign permit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @auth_assign_permit.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "def update\n respond_to do |format|\n if @api_v1_reward.update(api_v1_reward_params)\n format.html { redirect_to @api_v1_reward, notice: 'Reward was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_reward }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_reward.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @chicken_run.update(chicken_run_params)\n format.html { redirect_to @chicken_run, notice: 'Chicken run was successfully updated.' }\n format.json { render :show, status: :ok, location: @chicken_run }\n else\n format.html { render :edit }\n format.json { render json: @chicken_run.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @boxscore = @game.boxscores.find(params[:id])\n \n\n respond_to do |format|\n if @boxscore.update_attributes(params[:boxscore])\n format.html { redirect_to game_boxscores_url(@game), notice: 'Boxscore was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @boxscore.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @granted_scope = GrantedScope.find(params[:id])\n\n respond_to do |format|\n if @granted_scope.update_attributes(params[:granted_scope])\n format.html { redirect_to @granted_scope, notice: 'Granted scope was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @granted_scope.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @feat = @person.feats.find(params[:id])\n level_old = @person.level\n\n if params[:feat][:completed] == '1'\n @feat.complete\n else\n @feat.uncomplete\n end\n sign = params[:feat][:completed] == '1' ? '+': '-'\n \n has_leveled = @person.level > level_old\n\n respond_to do |format|\n format.json { render :json => {\n :xpGained => \"#{sign}#{@feat.xp}\",\n :xpTotal => @person.xp,\n :next_level_ratio => @person.next_level_ratio,\n :extra_life => @person.level_to_string,\n :has_leveled => has_leveled,\n :completed => @feat.completed,\n :streak => @feat.calculate_streak}}\n \n end\n\n end", "def patch!\n request! :patch\n end", "def update\n authorize! :update, @theorem\n if @theorem.update(theorem_params)\n render json: @theorem, status: :ok, location: @theorem\n else\n render json: @theorem.errors, status: :unprocessable_entity\n end\n end", "def update\n unless User.admin_by_token?(request.cookies[\"token\"])\n render json: { error: \"invalid_token\" }, status: :unauthorized\n return\n end\n\n if @resource.update(resource_params)\n render json: @resource, status: :ok\n else\n render json: @resource.errors, status: :unprocessable_entity\n end\n end", "def update\n @round = Round.find(params[:id])\n params[:round][:start_date] = Date.strptime(params[:round][:start_date], '%d/%m/%Y').strftime.to_s\n params[:round][:end_date] = Date.strptime(params[:round][:end_date], '%d/%m/%Y').strftime.to_s\n\n respond_to do |format|\n if @round.update_attributes(params[:round])\n format.html { redirect_to @round, :notice => 'Round was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @round.errors, :status => :unprocessable_entity }\n end\n end\n end" ]
[ "0.66332", "0.66036344", "0.658247", "0.6530699", "0.63430417", "0.6190109", "0.6128842", "0.59954906", "0.59816784", "0.5768203", "0.5750233", "0.5738519", "0.57231826", "0.569101", "0.5661459", "0.5661459", "0.563101", "0.56114036", "0.5599562", "0.5571986", "0.55699646", "0.5518964", "0.5518964", "0.55108005", "0.55088824", "0.5493828", "0.54763585", "0.54651326", "0.546508", "0.54473925", "0.5444879", "0.54321444", "0.54225224", "0.5421522", "0.54198277", "0.5416343", "0.53981984", "0.5393412", "0.53923553", "0.5384243", "0.53826874", "0.53805447", "0.5363574", "0.53633106", "0.5357651", "0.5357651", "0.53575873", "0.5351854", "0.53459495", "0.5341262", "0.53128606", "0.5304801", "0.5304801", "0.5294587", "0.52761346", "0.5252126", "0.5248627", "0.52485234", "0.5245097", "0.5242928", "0.52403253", "0.52316755", "0.52298886", "0.52267855", "0.5207445", "0.52043825", "0.5204359", "0.520097", "0.51978844", "0.5196959", "0.51945925", "0.5192923", "0.5192611", "0.5190157", "0.51868147", "0.5166443", "0.5163823", "0.51572037", "0.5156543", "0.51546896", "0.51452225", "0.5136718", "0.51351523", "0.51323843", "0.51231664", "0.5122879", "0.51224864", "0.5120511", "0.5120397", "0.5110742", "0.5109586", "0.51019084", "0.5095212", "0.5093228", "0.50924194", "0.50923884", "0.5079805", "0.5078353", "0.50749815", "0.50736743" ]
0.77392834
0
DELETE /grant_rounds/1 DELETE /grant_rounds/1.json
def destroy @grant_round = GrantRound.find(params[:id]) @grant_round.destroy head :no_content end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @grant = Grant.find(params[:id])\n @grant.destroy\n\n respond_to do |format|\n format.html { redirect_to grants_url }\n format.json { head :ok }\n end\n end", "def destroy\n @grant.destroy\n respond_to do |format|\n format.html { redirect_to grants_url, notice: \"Grant was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @grant.destroy\n respond_to do |format|\n format.html { redirect_to grants_url, notice: 'Grant was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @grant_record = GrantRecord.find(params[:id])\n @grant_record.destroy\n\n respond_to do |format|\n format.html { redirect_to grant_records_url }\n format.json { head :no_content }\n end\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 destroy\n @game = Game.where(user_id: current_user.id).find(params[:game_id])\n @round = @game.rounds.find(params[:id])\n @round.destroy\n\n respond_to do |format|\n format.html { redirect_to game_rounds_url(@game), notice: 'Round was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def delete_grant(id, user_id)\n raise Auth0::InvalidParameter, 'Must specify a grant id as id' if id.to_s.empty?\n raise Auth0::InvalidParameter, 'Must specify a user id' if user_id.to_s.empty?\n path = \"#{grants_path}/#{id}\"\n delete(path, user_id: user_id)\n end", "def destroy\n @grant.destroy\n respond_to do |format|\n format.html { redirect_to grants_url, notice: 'تمّ حذف منحة بنجاح' }\n format.json { head :no_content }\n end\n end", "def destroy\n @conference_grant = ConferenceGrant.find(params[:id])\n @conference_grant.destroy\n\n respond_to do |format|\n format.html { redirect_to conference_grants_url }\n format.json { head :no_content }\n end\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n @round = Round.find(params[:id])\n @round.destroy\n\n respond_to do |format|\n format.html { redirect_to rounds_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @round = Round.find(params[:id])\n @round.destroy\n\n respond_to do |format|\n format.html { redirect_to rounds_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @round = Round.find(params[:id])\n @round.destroy\n\n respond_to do |format|\n format.html { redirect_to rounds_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @military_battle_round = Military::BattleRound.find(params[:id])\n @military_battle_round.destroy\n\n respond_to do |format|\n format.html { redirect_to military_battle_rounds_url }\n format.json { head :ok }\n end\n end", "def destroy\n @player_round_loan = PlayerRoundLoan.find(params[:id])\n @player_round_loan.destroy\n\n respond_to do |format|\n format.html { redirect_to player_round_loans_url }\n format.json { head :ok }\n end\n end", "def delete_retry_test id\n uri = URI(HOST + \"/retry_test/#{id}\")\n http = Net::HTTP.new(uri.host, uri.port)\n req = Net::HTTP::Delete.new(uri.path)\n http.request(req)\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @sundry_grn = SundryGrn.find(params[:id])\n @sundry_grn.destroy\n\n respond_to do |format|\n format.html { redirect_to sundry_grns_url }\n format.json { head :ok }\n end\n end", "def destroy\n @round = Round.find(params[:id])\n @round.destroy\n\n respond_to do |format|\n format.html { redirect_to(rounds_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @round = Round.find(params[:id])\n @round.destroy\n\n respond_to do |format|\n format.html { redirect_to(rounds_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @round = Round.find(params[:id])\n @round.destroy\n\n respond_to do |format|\n format.html { redirect_to(rounds_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @round_robin_promo = RoundRobinPromo.find(params[:id])\n @round_robin_promo.destroy\n\n respond_to do |format|\n format.html { redirect_to round_robin_promos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @shooting_round = ShootingRound.find(params[:id])\n @shooting_round.destroy\n\n respond_to do |format|\n format.html { redirect_to(shooting_back() ) }\n format.xml { head :ok }\n end\n end", "def destroy\n @aggregation_round.destroy\n respond_to do |format|\n format.html { redirect_to aggregation_rounds_url, notice: 'Aggregation round was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @round.destroy\n respond_to do |format|\n format.html { redirect_to rounds_url, notice: 'Round was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @round.destroy\n respond_to do |format|\n format.html { redirect_to rounds_url, notice: 'Round was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @round.destroy\n respond_to do |format|\n format.html { redirect_to rounds_url, notice: 'Round was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @round.destroy\n respond_to do |format|\n format.html { redirect_to rounds_url, notice: 'Round was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @round_expense = RoundExpense.find(params[:id])\n @round_expense.destroy\n\n respond_to do |format|\n format.html { redirect_to(round_expenses_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @round.destroy\n respond_to do |format|\n format.html { redirect_to rounds_url, notice: \"Round was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @grant_sector.destroy\n respond_to do |format|\n format.html { redirect_to grant_sectors_url, notice: 'Grant sector was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @round.destroy\n respond_to do |format|\n format.html { redirect_to rounds_url, notice: 'round was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete(project_token = @project_token, id = @id, user = @@default_user)\n @attributes = send_request(\"test_plans/#{id}\", :delete) do |req|\n req.body = {\n token: project_token,\n auth_token: user.auth_token\n }\n end\n end", "def delete(\n id,\n deadline: nil\n )\n req = V1::AccountGrantDeleteRequest.new()\n\n req.id = (id)\n tries = 0\n plumbing_response = nil\n loop do\n begin\n plumbing_response = @stub.delete(req, metadata: @parent.get_metadata(\"AccountGrants.Delete\", req), deadline: deadline)\n rescue => exception\n if (@parent.shouldRetry(tries, exception))\n tries + [email protected](tries)\n next\n end\n raise Plumbing::convert_error_to_porcelain(exception)\n end\n break\n end\n\n resp = AccountGrantDeleteResponse.new()\n resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)\n resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)\n resp\n end", "def destroy\n @round.destroy\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end", "def destroy\n @round.destroy\n respond_to do |format|\n format.html { redirect_to DelphiEstimation.find_by_id(@round.delphiEstimation_id), notice: 'Round wurde erfolgreich gelöscht' }\n format.json { head :no_content }\n end\n end", "def destroy\n @round.destroy\n respond_to do |format|\n format.html { redirect_to root_url, notice: 'Round was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_workset (token, workset_name)\n Rails.logger.debug \"delete_workset #{workset_name}\"\n\n url = URI.parse(\"#{APP_CONFIG['registry_url']}/worksets/#{workset_name}\")\n http = Net::HTTP.new(url.host, url.port)\n if Rails.env.development?\n http.set_debug_output($stdout)\n end\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Delete.new(url.request_uri)\n request.add_field(\"Authorization\", \"Bearer #{token}\")\n request.add_field(\"Accept\", \"application/vnd.htrc-workset+xml\")\n response = http.request(request)\n\n case response\n when Net::HTTPUnauthorized then\n raise Exceptions::SessionExpiredError.new(\"Session expired. Please login again\")\n when Net::HTTPSuccess then\n # Do nothing\n else\n raise Exceptions::SystemError.new(\"Error deleting workset (HTTP #{response.code})\")\n end\n\n end", "def destroy\n @withdrawal_request = WithdrawalRequest.find(params[:id])\n @withdrawal_request.destroy\n\n respond_to do |format|\n format.html { redirect_to withdrawal_requests_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @moresmalltrial = Moresmalltrial.find(params[:id])\n @moresmalltrial.destroy\n\n respond_to do |format|\n format.html { redirect_to moresmalltrials_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @goldmeasure.destroy\n respond_to do |format|\n format.html { redirect_to goldmeasures_url }\n format.json { head :no_content }\n end\n end", "def destroy\n # @game.rounds.destroy_all\n # raise @game.inspect\n @game.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @much_withdraw.destroy\n respond_to do |format|\n format.html { redirect_to much_withdraws_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @rally.destroy\n respond_to do |format|\n format.html { redirect_to rallies_url, notice: 'Rally was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @pmround.destroy\n respond_to do |format|\n format.html { redirect_to pmrounds_url, notice: 'Pmround was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def cancelReservation(lease_uuid)\n broker_url = APP_CONFIG['broker_ip'] + ':' + APP_CONFIG['broker_port'].to_s \n cert_path = APP_CONFIG['cert_path']\n \n header = {\"Content-Type\" => \"application/json\"}\n options = {uuid: lease_uuid}\n\n #puts options.to_json \n uri = URI.parse(broker_url+\"/resources/leases\")\n pem = File.read(cert_path)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.cert = OpenSSL::X509::Certificate.new(pem)\n http.key = OpenSSL::PKey::RSA.new(pem)\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Delete.new(uri.request_uri, header)\n request.body = options.to_json\n\n response = http.request(request)\n puts response\n if response.header.code != '200'\n puts \"Something went wrong\"\n puts response\n end\n end", "def delete_user_for_tenant(args = {}) \n delete(\"/tenants.json/#{args[:tenantId]}/users/#{args[:userId]}\", args)\nend", "def destroy\n @graveyard.destroy\n respond_to do |format|\n format.html { redirect_to graveyards_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @graveyard.destroy\n respond_to do |format|\n format.html { redirect_to graveyards_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trustees_minute.destroy\n respond_to do |format|\n format.html { redirect_to trustees_minutes_url }\n format.json { head :no_content }\n end\n end", "def delete(client_id)\n id = client_id.to_s\n Client.collection.filter(:id => id).delete\n AuthRequest.collection.filter(:client_id => id).delete\n AccessGrant.collection.filter(:client_id => id).delete\n AccessToken.collection.filter(:client_id => id).delete\n end", "def destroy\n @nightclub = Nightclub.find(params[:id])\n @nightclub.destroy\n\n respond_to do |format|\n format.html { redirect_to nightclubs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @nightclub.destroy\n respond_to do |format|\n format.html { redirect_to nightclubs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n tournament = @round.tournament\n @round.destroy\n respond_to do |format|\n format.html do\n redirect_to tournament_path(tournament), notice: 'Round was successfully destroyed.'\n end\n format.json { head :no_content }\n end\n end", "def destroy\n @tx_land_grants_efn.destroy\n respond_to do |format|\n format.html { redirect_to tx_land_grants_efns_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @withdraw.destroy\n respond_to do |format|\n format.html { redirect_to withdraws_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @api_v1_reward.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_rewards_url, notice: 'Reward was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @reward_rule = RewardRule.find(params[:id])\n @reward_rule.destroy\n\n respond_to do |format|\n format.html { redirect_to reward_rules_url }\n format.json { head :no_content }\n end\n end", "def delete!\n Recliner.delete(uri)\n end", "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end", "def delete\n token = existing_payload[:token]\n\n checkin_params = { token: token, return_to: cdl_checkin_success_iiif_auth_api_url(params[:id]) }\n redirect_to \"#{Settings.cdl.url}/checkin?#{checkin_params.to_param}\"\n end", "def delete\n conn = @client.authorized_connection(url: @client.object_api_url)\n res = conn.delete do |req|\n req.url resource_uri\n end\n if res.success?\n data = JSON.parse(res.body)\n reload\n else\n nil\n end\n end", "def test_delete_plan\n response=@root_key_api.change_plan(\"[email protected]\",\"password\",@account_id, \"Bronze\")\n response=@root_key_api.delete_plan(\"[email protected]\",\"password\",@account_id)\n #test it's free after delete\n response=@root_key_api.describe_plan(\"[email protected]\",\"password\",@account_id)\n assert_equal Hash, response.class\n assert_include response, 'type'\n assert_equal 'Free', response['type']\n end", "def destroy\n @rink_league = RinkLeague.find(params[:id])\n @rink_league.destroy\n\n respond_to do |format|\n format.html { redirect_to rink_leagues_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @grm = Grm.find(params[:id])\n @grm.destroy\n\n respond_to do |format|\n format.html { redirect_to grms_url }\n format.json { head :no_content }\n end\n end", "def destroy\n\n api_key = ApiKey.where(access_token: token).first\n\n api_key.access_token = ''\n api_key.expires_at = Time.now\n\n if api_key.save\n render json: {}, status: 200\n else\n render json: {}, status: 422\n end\n end", "def delete\n url = prefix + \"delete\" + id_param\n return response(url)\n end", "def destroy\n @mystock.destroy\n respond_to do |format|\n format.html { redirect_to mystocks_path, notice: 'mystock was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @withdrawal_request.destroy\n respond_to do |format|\n format.html { redirect_to withdrawal_requests_url, notice: 'Withdrawal request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete(user)\n Rails.logger.debug \"Call to poll.delete\"\n reqUrl = \"/api/poll/#{self.id}\" #Set the request url\n rest_response = MwHttpRequest.http_delete_request(reqUrl,user['email'],user['password']) #Make the DELETE request to the server with the required parameters\n Rails.logger.debug \"Response from server: #{rest_response.code} #{rest_response.message}: #{rest_response.body}\"\n if rest_response.code == \"200\" #Validate if the response from the server is 200, which means OK\n return true, rest_response #Return success\n else\n return false, \"#{rest_response.code}\", \"#{rest_response.message}\" #Return error\n end\n end", "def destroy\n @runway_ap = RunwayAp.find(params[:id])\n @runway_ap.destroy\n\n respond_to do |format|\n format.html { redirect_to runway_aps_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @reward_and_level.destroy\n respond_to do |format|\n format.html { redirect_to reward_and_levels_url }\n format.json { head :no_content }\n end\n end", "def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end", "def destroy\n @rum = Rum.find(params[:id])\n @rum.destroy\n\n respond_to do |format|\n format.html { redirect_to rums_url }\n format.json { head :ok }\n end\n end", "def destroy\n @open_shoot = OpenShoot.find(params[:id])\n @open_shoot.destroy\n\n respond_to do |format|\n format.html { redirect_to open_shoots_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @expense = Expense.find(params[:id])\n @expense.destroy\n\n respond_to do |format|\n format.html { redirect_to account_statement_url(params[:account_id],params[:statement_id]) }\n format.json { head :no_content }\n end\n end", "def destroy\n @game_round.destroy\n respond_to do |format|\n format.html { redirect_to game_rounds_url, notice: 'Game round was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def soccer_delete\n base_delete(params, \"Soccer\")\n end", "def destroy\n @globus_token.destroy\n\n respond_to do |format|\n format.html { redirect_to globus_tokens_url, notice: \"Globus token was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @sslplan = Sslplan.find(params[:id])\n @sslplan.destroy\n\n respond_to do |format|\n format.html { redirect_to sslplans_url }\n format.json { head :ok }\n end\n end", "def destroy\n @goal_reward = GoalReward.find(params[:id])\n @goal_reward.destroy\n\n respond_to do |format|\n format.html { redirect_to goal_rewards_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @otg_sess.destroy\n respond_to do |format|\n format.html { redirect_to otg_sesses_url, notice: 'Otg sess was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n decoded_access_token = JWT.decode(params[:accessToken], 's3cr3t', true, algorithm: 'HS256')\n decoded_refresh_token = JWT.decode(params[:refreshToken], 's3cr3t', true, algorithm: 'HS256')\n # Check if token was decoded\n if decoded_access_token && decoded_refresh_token\n @user = User.find_by(id: decoded_access_token[0]['user_id'])\n if @user # user exists\n Blacklist.find_by(jwt: params[:accessToken]).delete\n Blacklist.find_by(jwt: params[:refreshToken]).delete\n User.find_by(id: @user.id).delete\n render json: {status: \"User was succesfully deleted\"}\n else\n render json: {error: \"Invalid User\"}\n end\n else # token is null\n render json: {error: \"Invalid Tokens\"}\n end\n end", "def destroy\n \n keystone.delete_tenant(keystone.get_tenant(params[:id])[:id])\n\n respond_to do |format|\n format.html { redirect_to tenants_url }\n format.json { head :ok }\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 id = params[:id]\n unless is_number? id\n token = id\n decode_t = decode_link token\n id = decode_t[0]['id']\n end\n @opinion_poll = OpinionPoll.find(id)\n @opinion_poll.destroy\n\n return deleted_request\n\n rescue ActiveRecord::RecordNotFound\n r = {opinion_poll: 'Record Not Found'}\n return not_found r\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def destroy\n @my_time_trial = MyTimeTrial.find(params[:id])\n @my_time_trial.destroy\n\n respond_to do |format|\n format.html { redirect_to my_time_trials_url }\n format.json { head :no_content }\n end\n end", "def delete\n api_client.delete(url)\n end", "def destroy\n @run_at_rate = RunAtRate.find(params[:id])\n @run_at_rate.destroy\n\n respond_to do |format|\n format.html { redirect_to run_at_rates_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @oauth_client = OauthClient.find(params[:id])\n @oauth_client.destroy\n\n respond_to do |format|\n format.html { redirect_to oauth_clients_url }\n format.json { head :no_content }\n format.xml { head :no_content }\n end\n end", "def destroy\n @operations_check = OperationsCheck.find(params[:id])\n @operations_check.destroy\n\n respond_to do |format|\n format.html { redirect_to operations_checks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @match_stat = MatchStat.find(params[:id])\n @match_stat.destroy\n\n respond_to do |format|\n format.html { redirect_to match_stats_url }\n format.json { head :no_content }\n end\n end", "def destroy\n check_admin\n @time_balance = TimeBalance.find(params[:id])\n @time_balance.destroy\n\n respond_to do |format|\n format.html { redirect_to time_balances_url }\n format.json { head :ok }\n end\n end", "def destroy\n @test_run = TestRun.accessible_by(current_ability).find(params[:id])\n @test_run.destroy\n\n respond_to do |format|\n format.html { redirect_to test_runs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @shuttle_run.destroy\n respond_to do |format|\n format.html { redirect_to shuttle_runs_url }\n format.json { head :no_content }\n end\n end", "def deleteLogin( login_id)\n params = Hash.new\n params['login_id'] = login_id\n return doCurl(\"delete\",\"/login\",params)\n end" ]
[ "0.6785335", "0.66401356", "0.66355854", "0.65101945", "0.6417004", "0.6381775", "0.6332533", "0.6302542", "0.6267824", "0.6246247", "0.62305", "0.62305", "0.62305", "0.60873616", "0.59931564", "0.5984523", "0.5981868", "0.59775776", "0.5960169", "0.594473", "0.594473", "0.5921928", "0.5912613", "0.5910413", "0.59048766", "0.59048766", "0.59048766", "0.59048766", "0.5899037", "0.58988816", "0.58901155", "0.58880484", "0.5870236", "0.58654916", "0.58624077", "0.58591086", "0.5843873", "0.58317924", "0.5830973", "0.5824808", "0.58152187", "0.58024514", "0.57906973", "0.5779589", "0.5766239", "0.5764924", "0.57593626", "0.5754426", "0.5754426", "0.57496035", "0.5745904", "0.57428366", "0.5742428", "0.573952", "0.5733705", "0.57246995", "0.5721163", "0.56954694", "0.5692193", "0.56910723", "0.56738114", "0.5671858", "0.56522644", "0.56503904", "0.56493473", "0.5648724", "0.5647129", "0.5639027", "0.5638834", "0.56354755", "0.56323177", "0.56282353", "0.56282306", "0.5619566", "0.5614944", "0.56109786", "0.56095076", "0.56061655", "0.5605606", "0.5604483", "0.5603525", "0.5603176", "0.560208", "0.5601821", "0.56016225", "0.56016225", "0.56016225", "0.56016225", "0.56006396", "0.5598176", "0.5592189", "0.55880994", "0.55788726", "0.557762", "0.5575957", "0.5575234", "0.55685", "0.556817", "0.5564976", "0.55615354" ]
0.76820797
0
This is the method that Swing will call to ask what size to attempt to set for this window.
def getPreferredSize # use the default size calculation; this would of course also be accomplished # by not implementing the method at all. super # Or, you can override it with specific pixel sizes (width, height) # Dimension.new(700, 560) # Or, use the line below to make it the full screen size: # Toolkit.get_default_toolkit.screen_size end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_size(w=nil, h=nil)\n @window_width = w if w.is_a?(Numeric) && w > 0 # TODO: > min_width\n @window_height = h if h.is_a?(Numeric) && h > 0 # TODO: > min_height\n super(@window_width, @window_height)\nend", "def size_default\n start_time = 0\n xdotool \"windowsize #{@id} #{@default.join(\" \")}\"\n while @default != get_geometry(@id)\n abort(\"*** #{File.basename(__FILE__)}: Window #{@id} did not resize - are you running a tiling window manager? Exiting...\") if Time.now - start_time > 2\n end\n end", "def update_local_window_size(size); end", "def set_size(width = nil, height = nil)\n @window_width = if ptrue?(width)\n # Convert to twips at 96 dpi.\n width.to_i * 1440 / 96\n else\n 16095\n end\n\n @window_height = if ptrue?(height)\n # Convert to twips at 96 dpi.\n height.to_i * 1440 / 96\n else\n 9660\n end\n end", "def build_window\n max = @choices.size\n max = MaxChoice if max > MaxChoice\n self.height = max * default_line_height + window_builder[5] + window_builder[-1]\n refresh\n end", "def window_size()\n\[email protected]_to(x, y)\nend", "def set_size(w,h)\n @width = w\n @height = h\n end", "def window_size\n manage.window.size\n end", "def window_size\n manage.window.size\n end", "def window_size\n manage.window.size\n end", "def setSize(width, height)\n setWidth(width)\n setHeight(height)\n end", "def set_client_size\n if self.visible?\n self.execute_script(\"AE.Dialog.adjustSize();\")\n else\n self.on_show{\n self.execute_script(\"AE.Dialog.adjustSize();\")\n }\n end\nend", "def remote_window_size; end", "def updateSize(x,y)\n x = (@panel.getWidth() > x) ? @panel.getWidth : x\n y = (@panel.getHeight() > y) ? @panel.getHeight : y\n @panel.setPreferredSize(Dimension.new(x,y))\n end", "def size(x, y)\n start_time = Time.now\n xdotool \"windowsize #{@id} #{x} #{y}\"\n while [x, y] != get_geometry(@id)\n abort(\"*** #{File.basename(__FILE__)}: Window #{@id} did not react - are you running a tiling window manager? Exiting...\") if Time.now - start_time > 2\n end\n end", "def local_window_size; end", "def size w = DEFAULT_SCREEN_WIDTH, h = DEFAULT_SCREEN_HEIGHT\n width w\n height h\n end", "def resize new_width, new_height\n win.resize new_width, new_height\n end", "def window_width\n @width_overwrite || default_width\n end", "def setDimension(width = 1035, height = 768)\n\n begin\n @driverList.each do |b|\n target_size = Selenium::WebDriver::Dimension.new(width, height)\n b[:drv].manage.window.size = target_size\n end\n rescue => ex\n @logger.warn __FILE__ + (__LINE__).to_s + \" #{ex.class}\"\n @logger.warn \"Error during processing: #{$!}\"\n @logger.warn \"Backtrace:\\n\\t#{ex.backtrace.join(\"\\n\\t\")}\"\n end\n end", "def size\n @options[:layout_size]\n end", "def remake_window\n self.width = window_width\n self.height = window_height\n create_contents\n end", "def set_window_size(screen_width, screen_height)\n # Set screen_width and screen_height if defined\n screen_width ? screen_width : screen_width = 1280\n screen_height ? screen_height : screen_height = 1024\n\n @log.info('Setting the screen window size to: ' + screen_width.to_s + 'x' + screen_height.to_s)\n # @note this is currently supported in Chrome and FF\n @driver.manage.window.resize_to(screen_width, screen_height)\n end", "def set_window_size(screen_width, screen_height)\n # Set screen_width and screen_height if defined\n screen_width ? screen_width : screen_width = 1280\n screen_height ? screen_height : screen_height = 1024\n\n @log.info('Setting the screen window size to: ' + screen_width.to_s + 'x' + screen_height.to_s)\n # @note this is currently supported in Chrome and FF\n @driver.manage.window.resize_to(screen_width, screen_height)\n end", "def size\n console.winsize\n end", "def resizable?; true; end", "def with_window_size(window_size)\n reconfigure(configuration.with(window_size: window_size))\n end", "def setCanvasSize\n if @intTargetX.to_s.to_i > 20 and @intTargetY.to_s.to_i > 20\n puts('setting new dimetions')\n @canvasRefrance.resizeCanvas(@intTargetY.to_s.to_i,@intTargetX.to_s.to_i)\n else \n puts('setting defult dimentions')\n @canvasRefrance.resizeCanvas(@minDimensions,@minDimensions)\n end\n end", "def size\n prompt_size + text_size\n end", "def window_width() Graphics.width - 128 end", "def window_width\r\n @options[:window_width]\r\n end", "def window_width\n MARW_CONFIGURATION[:window_width] == -1 ? Graphics.width : MARW_CONFIGURATION[:window_width]\n end", "def set_visible_size(width:, height:)\n {\n method: \"Emulation.setVisibleSize\",\n params: { width: width, height: height }.compact\n }\n end", "def setSize(szX,szY,scale,centerp=FALSE)\n @device.setSize(szX,szY,scale,centerp) ;\n end", "def size=(width, height)\n end", "def winsize; IO.console.winsize end", "def resize_async(width, height, use_hints = false)\n flags = use_hints ? XDo::FFILib::Consts::SIZE_U : 0\n XDo::FFILib.xdo_window_setsize @_xdo_pointer, @_window, width, height, flags\n end", "def test_new_override\n JFrame.new(:size => \"500 x 400\") do |f|\n assert_equal(JFrame.const_get(:EXIT_ON_CLOSE), f.default_close_operation)\n assert_equal(500, f.size.width)\n assert_equal(400, f.size.height)\n end\n end", "def setwindow(*)\n super\n end", "def resize width, height\n @widgets[@index].width = width\n @widgets[@index].height = height\n @widgets[@index].repaint\n end", "def window_width\n end", "def _init_layout\n # when user gives a negative value, we recalc and overwrite so the need to save, for a redraw.\n @saved_width ||= @width\n @saved_height ||= @height\n\n lines = Ncurses.LINES - 1\n columns = Ncurses.COLS - 1\n if @height_pc\n @height = ((lines - @top_margin - @bottom_margin) * @height_pc).floor\n elsif @saved_height <= 0\n @height = lines - @saved_height - @top_margin - @bottom_margin\n end\n $log.debug \" layout height = #{@height} \"\n if @width_pc\n @width = ((columns - @left_margin - @right_margin) * width_pc).floor\n elsif @saved_width <= 0\n # if width was -1 we have overwritten it so now we cannot recalc it. it remains the same\n @width = columns - @saved_width - @left_margin - @right_margin\n end\n $log.debug \" layout wid = #{@width} \"\n # if user has not specified, then get all the objects\n @components ||= @form.widgets.select do |w| w.visible != false && !@ignore_list.include?(w.class.to_s.downcase); end\n $log.debug \" components #{@components.count} \"\n end", "def size(width, height)\n self.width = width\n self.height = height\n end", "def window_width\n return WINDOW_WIDTH\n end", "def window_width\n return WINDOW_WIDTH\n end", "def window_width\n return WINDOW_WIDTH\n end", "def window_width\n return WINDOW_WIDTH\n end", "def window_width\n return WINDOW_WIDTH\n end", "def before_show()\n $ENV = VR::load_yaml(SavableSettings, \"settings.yaml\")\n @builder[:window1].resize $ENV.width, $ENV.height\n refresh()\n end", "def resize width = max_width, height = max_height\n @form.resize width, height\n self.write Mine::Key.RESIZE\n end", "def set_dimensions(*dims)\n if dims[0].is_a?(Rect)\n rect = dims[0]\n elsif dims[0].is_a?(Integer) && dims[1].is_a?(Integer) && dims[2].is_a?(Integer) && dims[3].is_a?(Integer)\n rect = Rect.new(dims[0],dims[1],dims[2],dims[3])\n else\n raise ArgumentError, 'invalid dimension(s) for ApplicationWindow: ' + dims.inspect\n end\n self.x = rect.x\n self.y = rect.y\n self.width = rect.width\n self.height = rect.height\n end", "def window_width\n return COMMAND_WINDOW_WIDTH\n end", "def maximize_to_screen\n size = execute_script(%(\n return { width: window.screen.width, height: window.screen.height };\n ))\n\n move_window_to(0, 0)\n resize_window_to(size['width'], size['height'])\n end", "def screen_size\n compatible_call :screen_size\n end", "def resize_mix_window_yea_abe\n return unless $imported[\"YEA-BattleEngine\"]\n @mix_window.height = @skill_window.height\n @mix_window.width = @skill_window.width\n @mix_window.y = Graphics.height - @item_window.height\n end", "def maximize_window(win=nil)\n # noop\n end", "def init_vars\n self.resize(200,250)\n @new_btn = Gtk::Button.new('')\n @default_size_btn = Gtk::Button.new('')\n @quit_btn = Gtk::Button.new('')\n end", "def _window_size\n unless @window_size\n rows = `tput lines`\n cols = `tput cols`\n @window_size = [cols.chomp.to_i, rows.chomp.to_i]\n end\n @window_size\n end", "def remote_maximum_window_size; 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 resize\n # We need to nuke ncurses to pick up the new dimensions\n Curses.def_prog_mode\n Curses.close_screen\n Curses.reset_prog_mode\n height, width = Curses.dimensions\n \n # Resize tabs \n @tabs.resize(\n :width => width,\n :height => height\n )\n @tabs.render\n end", "def set_windows\n set_title \"R-Bloggyn::#{@usuario.alias}\" #nombre de la ventana\n set_default_size 640, 480 #tamaño de la ventana\n set_skip_taskbar_hint true\n set_window_position Gtk::Window::POS_CENTER #posicion de la ventana\n self.set_attributes\n add @hbox\n show_all #muestra todo\n end", "def window_width\n return CONTROL_WINDOW_WIDTH \n end", "def create_help_window\n super\n @help_window.y = @blacksmith_window.height\n end", "def setwsviewport(*)\n super\n end", "def size(width, height)\n if !width.nil? && (width.to_i > 0) && !height.nil? && (height.to_i > 0)\n @width = width\n @height = height\n @chart_size = nil\n end\n self\n end", "def settings\n size 400, 300\nend", "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 window_width\n Graphics.width / 2\n end", "def initialize(rows, cols, row, col, title_prefix)\n @win = Window.new(rows, cols, row, col)\n super(@win)\n @title_prefix = title_prefix\n set_max_contents_len(cols)\n end", "def window_size_message\n WINDOW_SIZE_MAGIC_COOKIE + [@rows, @columns, @pixel_x, @pixel_y].pack(\"nnnn\")\n end", "def size\n $stdout.winsize.reverse rescue [80,25]\n end", "def resize(w, h, animate=false)\n b = current_bounds\n w = absolutize_size(w, :width)\n h = absolutize_size(h, :height)\n app.windows[0].bounds.set([ b[0], b[1] + height, b[0] + w, b[1] + h + height ])\n end", "def resize_to(width, height)\n Selenium::WebDriver::Dimension.new(Integer(width), Integer(height)).tap do |dimension|\n use { @driver.manage.window.size = dimension }\n end\n end", "def visual_size(value)\n @ole.VisualSize = value\n nil\n end", "def set_size(params = {})\n @width = params[:width] if params[:width]\n @height = params[:height] if params[:height]\n @x_scale = params[:x_scale] if params[:x_scale]\n @y_scale = params[:y_scale] if params[:y_scale]\n @x_offset = params[:x_offset] if params[:x_offset]\n @y_offset = params[:y_offset] if params[:y_offset]\n end", "def display_w(*val)\n if val.empty?\n return @display_w\n else\n #raise ArgumentError \"display_h should be ... \" if val[0] ...\n oldvalue = @display_w\n @display_w = val[0]\n @display_w = [@display_w, @target_window.width - 2].min unless @target_window.width == 0\n $log.debug \"XXX:set display_w to #{@display_w} \"\n #fire_property_handler(:display_h, oldvalue, @display_h)\n end\n self\n end", "def send_window_adjust( size )\n msg = @buffers.writer\n msg.write_byte CHANNEL_WINDOW_ADJUST\n msg.write_long @remote_id\n msg.write_long size\n @connection.send_message msg\n end", "def with_you(window, position, width, height)\n\n initialize_config\n width = UserConfig[:with_you_width] unless width\n position = UserConfig[:with_you_position] unless position\n height = UserConfig[:with_you_height] unless height\n\n if UserConfig[:with_you_stick]\n window.stick(); end\n\n if UserConfig[:with_you_skip_taskbar]\n window.skip_taskbar_hint = true; end\n\n if UserConfig[:with_you_side] then\n notice \"[with_you] Dock mode:config=#{UserConfig[:with_you_side]}\"\n window.resizable = false\n window.set_default_size(width, height)\n window.set_size_request(width, height)\n window.gravity = Gdk::Window::GRAVITY_STATIC\n win_top = 0\n win_left = 0\n if position == LEFT_SIDE\n win_left = WORK_AREA[0]\n win_top = WORK_AREA[1]\n else\n win_left = WORK_AREA[0] + WORK_AREA[2] - width\n win_top = WORK_AREA[1]; end\n \n window.window.type_hint = Gdk::Window::TYPE_HINT_DOCK\n window.can_focus = true\n window.accept_focus = true\n window.move(win_left , win_top)\n\n # 左側\n if position == LEFT_SIDE\n NetWmStrutPartial::set(window.window, win_left + width, 0, 0, 0, win_top, win_top + height, 0, 0,\n 0, 0, 0, 0)\n # 右側\n else\n NetWmStrutPartial::set(window.window, 0, width, 0, 0, 0, 0, win_top, win_top + height,\n 0, 0, 0, 0); end\n\n else\n notice \"[with_you] NORMAL window mode:config=#{UserConfig[:with_you_side]}\"\n NetWmStrutPartial::set(window.window, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0)\n window.resizable = true\n window.window.type_hint = Gdk::Window::TYPE_HINT_NORMAL\n window.decorated = true\n window.set_default_size(0, 0)\n end\n end", "def ensure_browser_size(width = 1280, height = 1280)\n Capybara.current_session.driver.browser.manage.window.resize_to(width, height)\n end", "def maximize_ish(x = 64, y = 64, w = -128, h = -128)\n if is_headless\n x = 0; y = 0; w = -2; h = -2\n end\n width = w\n height = h\n width = \"window.screen.availWidth - #{-w}\" if w <= 0\n height = \"window.screen.availHeight - #{-h}\" if h <= 0\n if is_headless\n @driver.manage.window.position= Selenium::WebDriver::Point.new(0,0)\n max_width, max_height = @driver.execute_script(\"return [window.screen.availWidth, window.screen.availHeight];\")\n @driver.manage.window.resize_to(max_width, max_height)\n else\n @driver.manage.window.position= Selenium::WebDriver::Point.new(40,30)\n max_width, max_height = @driver.execute_script(\"return [window.screen.availWidth, window.screen.availHeight];\")\n @driver.manage.window.resize_to(max_width-90, max_height-100)\n end\n @driver.execute_script %[\n if (window.screen) {\n window.moveTo(#{x}, #{y});\n window.resizeTo(#{width}, #{height});\n };\n ]\n end", "def set_selenium_window_size(width, height)\n window = Capybara.current_session.driver.browser.manage.window\n window.resize_to(width, height)\nend", "def maximize\n wait_for_stable_size { @driver.maximize_window(handle) }\n end", "def picker_frame_with_size(size)\n height = size.height\n width = size.width\n\n if size.height < OPTIMUM_PICKER_HEIGHT\n # if in landscape, the picker height can be sized too small, so use a optimum height\n height = OPTIMUM_PICKER_HEIGHT\n end\n\n if (size.width > OPTIMUM_PICKER_WIDTH)\n # keep the width an optimum size as well\n width = OPTIMUM_PICKER_WIDTH\n end\n\n result_frame = CGRectMake(0.0, -1.0, width, height)\n end", "def fit_width; end", "def window_width\n w = ($game_system.quest_categories.size > 1 || QuestData::SHOW_CATEGORY_LABEL) ? \n Graphics.width - QuestData::LIST_WINDOW_WIDTH : QuestData::LIST_WINDOW_WIDTH\n end", "def win_width\n Curses.cols - win_padding\n end", "def local_maximum_window_size; end", "def windows_width\n Graphics.width / 2 + 10 # + 64\n end", "def size(w,h)\n @size = \"#{w}x#{h}\"\n end", "def set_defaults\n self.width ||= 0.20\n self.height ||= 0.20\n end", "def set_layout(layout)\n case layout\n when Array\n $log.error \"NIL in window constructor\" if layout.include? nil\n raise ArgumentError, \"Nil in window constructor\" if layout.include? nil\n # NOTE this is just setting, and not replacing zero with max values\n @height, @width, @top, @left = *layout\n raise ArgumentError, \"Nil in window constructor\" if @top.nil? || @left.nil?\n\n @layout = { :height => @height, :width => @width, :top => @top, :left => @left }\n when Hash\n @layout = layout\n\n [:height, :width, :top, :left].each do |name|\n instance_variable_set(\"@#{name}\", @layout[name])\n end\n end\n end", "def width(new_width, options = {})\n fill_window(false, options)\n width_str = \"width: #{new_width};\"\n\n add_style(width_str, options[:screen])\n end", "def size\n size_dependencies = [calculated_width, calculated_height]\n if size_dependencies != @size_dependencies\n # avoid repeating calculations\n calculated_width, calculated_height = @size_dependencies = size_dependencies\n @size = org.eclipse.swt.graphics.Point.new(calculated_width, calculated_height)\n end\n @size\n end", "def fullscreen_size\n [modal, fullscreen, @options[:size], down].compact.join('-')\n end", "def size=(size)\n self.width = self.height = @size = size\n end", "def reposition_window\n config = MARW_CONFIGURATION\n self.x = config[:window_x] == -1 ? (Graphics.width - window_width) / 2 : config[:window_x]\n self.y = 0\n end", "def resize(ht = 0, w = 0)\n # update sheight and swidth even if reduced, so that pad doesn't overwrite.\n @sheight = ht if ht > 0\n @swidth = w if w > 0\n return if ht < @padheight and w < @padwidth\n @padheight = ht if ht > @padheight\n @padwidth = w if w > @padwidth\n destroy\n $log.debug \" L502 resize, creating newpad with #{@padheight} and #{@padwidth} \"\n @window = Ncurses.newpad(@padheight, @padwidth)\n $log.debug \" L502 resize created #{@window} \"\n return @window\n end", "def inqwindow\n inquiry %i[double double double double] do |*pts|\n super(*pts)\n end\n end", "def initialize(rows, cols, row, col, title_prefix)\n @win = Window.new(rows, cols, row, col)\n @title_prefix = title_prefix\n @max_contents_len = @win.maxx - 3 # 2 for borders\n end" ]
[ "0.7536047", "0.68291473", "0.67819756", "0.6737219", "0.63471746", "0.61729044", "0.6090852", "0.60902685", "0.60902685", "0.60902685", "0.6060795", "0.6048206", "0.60143214", "0.60114455", "0.59960634", "0.5987764", "0.59475785", "0.59235406", "0.5893958", "0.58632255", "0.5852385", "0.5851661", "0.5837355", "0.5833092", "0.5828424", "0.58165765", "0.5796597", "0.5785085", "0.57784057", "0.5777978", "0.57297385", "0.5683529", "0.5651775", "0.5640547", "0.5624686", "0.5618844", "0.5617221", "0.5611535", "0.5584793", "0.557725", "0.5574416", "0.5572218", "0.55441386", "0.5536628", "0.5536628", "0.5536628", "0.5536628", "0.5536628", "0.55169576", "0.5508437", "0.5497972", "0.5494697", "0.54806054", "0.5472373", "0.5471279", "0.546353", "0.544282", "0.5440139", "0.54399335", "0.54342085", "0.54158694", "0.5398613", "0.53670734", "0.53668165", "0.53585094", "0.5357831", "0.53569424", "0.53525394", "0.5344907", "0.53269136", "0.5320601", "0.530934", "0.5301271", "0.52981913", "0.52782834", "0.5269015", "0.5247223", "0.5231202", "0.5230793", "0.5222817", "0.52203315", "0.5217371", "0.52126145", "0.52062947", "0.5198692", "0.5192309", "0.5190171", "0.51821524", "0.5169661", "0.5165309", "0.51575714", "0.5157296", "0.5143716", "0.51427615", "0.5140681", "0.5125582", "0.5121494", "0.5115415", "0.510572", "0.5102529" ]
0.6719571
4
Creates an empty FIFO.
def initialize; @ary = []; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mkfifo(name)\n File.unlink name rescue nil\n system \"mkfifo -m 600 #{name}\"\n end", "def fifo()\n if ! File.pipe?(FIFO_PATH)\n # there's no native ruby way to do this?\n %x{#{mkfifo()} #{FIFO_PATH}}\n end\n return FIFO_PATH\n end", "def mkfifo( path )\n %x[mkfifo \"#{path}\"]\n end", "def initialize size, opts = {}\n \n opts = { :fifo => true, :override_when_full => true }.merge opts\n \n @buffer = Array.new(size)\n @oldest = 0;\n @newest = 0;\n @fill_count = 0;\n\n @fifo = opts[:fifo]\n @override_when_full = opts[:override_when_full]\n end", "def initialize(queue, fd, type, low_water, callback)\n if fd.is_a?(IO)\n @io = fd\n fd = fd.fileno\n end\n\n @fd = fd\n @type = type\n\n if low_water\n fflags = [:lowat]\n data = low_water\n else\n fflags = []\n data = nil\n end\n\n super(queue, @fd, type, fflags, data, callback)\n end", "def create\n profile = calc_profile\n entries = @resource[:entries].join '\", \"'\n raise 'Array of entries can not be empty' if entries.empty?\n entries = format('[\"%s\"]', entries)\n durable = ToBooleanConverter.new(@resource[:durable]).to_bool\n ensure_default_hornetq\n cmd = \"jms-queue #{profile} add --queue-address=#{@resource[:name]} \" \\\n \"--entries=#{entries} --durable=#{durable}\"\n bring_up 'JMS Queue', cmd\n end", "def initialize\n @queue = []\n end", "def initialize\n @queue = Queue.new \n @state = :free\n @producers = []\n @consumers = []\n end", "def test_isEmptyOnNonEmptyQueue\n @queue.enqueue(100)\n assert_equal( false , @queue.empty? )\n end", "def initialize list\n @queue = Queue.new # *sigh*... the Queue api sucks sooo much...\n\n list.each { |i| @queue << i }\n N.times { @queue << nil }\n end", "def initialize(data=nil)\n @first = QueueNode.new data unless data.nil?\n @first ||= nil\n @last = @first\n end", "def create_io_tmp(*args)\n path = File.join(storage_directory, args.join('-'))\n FileUtils.mkdir_p(File.dirname(path))\n t_file = File.open(path, 'w+')\n t_file.sync\n t_file\n end", "def test_dequeueOnEmptyStack\n assert_equal( nil , @queue.dequeue )\n end", "def init_push\n ## empty\n end", "def initialize\n empty!\n end", "def initialize\n empty!\n end", "def cons(x)\n queue(Stream.cons(->{x}, ->{@front}), @front_len + 1,\n exec1(@front_schedule),\n @rear, @rear_len, exec1(@rear_schedule))\n end", "def empty\n Dropio::Resource.client.empty_drop(self)\n end", "def create_queues\n queue\n exchange\n end", "def initialize(limit = nil)\n @mutex = Mutex.new\n @waiting = Set.new\n @num_waiting = Concurrent::AtomicFixnum.new\n @closed = Concurrent::AtomicBoolean.new\n @raise_exception = Concurrent::AtomicBoolean.new(false)\n\n if limit\n @queue = SizedQueue.new(Integer(limit))\n else\n @queue = Queue.new\n end\n end", "def setfifo(conf)\n @fifo=true\n if !conf.elements(name: directionLabel).empty?\n directionset = conf[directionLabel].upercase\n\n # if the direction is set to LIFO switch the flag\n if directionset.eql? LIFOdirection\n @fifo=false\n elsif !(directionset.eql? FIFOdirection)\n @fifo=false\n log.warn directionLabel, \" value not recognized \", directionset, \" defaulting to \", FIFOdirection\n end\n end \n return @fifo \n end", "def queue_declare(name = \"\", passive: false, durable: true, exclusive: false, auto_delete: false, arguments: {})\n durable = false if name.empty?\n exclusive = true if name.empty?\n auto_delete = true if name.empty?\n\n write_bytes FrameBytes.queue_declare(@id, name, passive, durable, exclusive, auto_delete, arguments)\n name, message_count, consumer_count = expect(:queue_declare_ok)\n\n QueueOk.new(name, message_count, consumer_count)\n end", "def create\n if is_runasdomain\n profile = \"--profile=#{@resource[:profile]}\"\n else\n profile = ''\n end\n entries = @resource[:entries].join '\", \"'\n if not entries.empty?\n entries = '[\"%s\"]' % entries\n else\n raise \"Array of entries can not be empty\"\n end\n durable = ToBooleanConverter.new(@resource[:durable]).to_bool\n extcmd = \"/extension=org.jboss.as.messaging\"\n if not execute(\"#{extcmd}:read-resource()\")[:result]\n bringUp \"Extension - messaging\", \"#{extcmd}:add()\"\n end\n syscmd = compilecmd \"/subsystem=messaging\"\n if not execute(\"#{syscmd}:read-resource()\")[:result]\n bringUp \"Subsystem - messaging\", \"#{syscmd}:add()\"\n end\n hornetcmd = compilecmd \"/subsystem=messaging/hornetq-server=default\"\n if not execute(\"#{hornetcmd}:read-resource()\")[:result]\n bringUp \"Default HornetQ\", \"#{hornetcmd}:add()\"\n end\n cmd = \"jms-queue #{profile} add --queue-address=#{@resource[:name]} --entries=#{entries} --durable=#{durable.to_s}\"\n bringUp \"JMS Queue\", cmd\n end", "def test_dequeueOnNonEmptyStack\n @queue.enqueue(100)\n assert_equal( 100 , @queue.dequeue )\n end", "def chan(len = 1)\n SizedQueue.new(len)\n end", "def initialize()\n @queue = Queue.new\n end", "def initialize\n @queue = []\n @current_action = nil\n end", "def empty\n @empty ||= new\n end", "def empty()\n @queue.empty?\n end", "def test_peekOnEmptyQueue\n assert_equal( nil, @queue.peek )\n end", "def empty()\n @queue.size == 0\n end", "def prepare_pipe_server!\n _log :prepare_pipe_server!\n unless ::File.exist? file\n system(cmd = \"mkfifo #{file.inspect}\") or raise \"cannot run #{cmd.inspect}\"\n end\n end", "def create_empty_data_set\n open_for_write\n close\n end", "def queue\n @queue ||= Queue.new\n end", "def initialize\n @queue = []\n @waiting = []\n @mutex = Mutex.new\n end", "def initialize\n self.buffer_file = Tempfile.new(\"proton_stream.\")\n self.current_track = Track.next_track\n self.already_read = 0 \n self.head = 0\n self.tail = 0\n \n # Fill the buffer to start off with\n append_queue\n \n # Periodically append more music to the queue \n EM.add_periodic_timer(3) do\n append_queue\n end\n \n # Every second, read a chunk from the head of the queue\n # so that listening clients can get at it and share the same data\n EM.add_periodic_timer(1) do\n read_chunk\n end\n \n puts \"Initialised queue: buffer max #{MAX_BUFFER_SIZE} #{BIT_RATE}kbs\"\n end", "def test_peekOnNonEmptyQueue\n @queue.enqueue(100)\n assert_equal( 100 , @queue.peek )\n end", "def tmpio\n fp = begin\n TmpIO.open(\"#{Dir::tmpdir}/#{rand}\",\n File::RDWR|File::CREAT|File::EXCL, 0600)\n rescue Errno::EEXIST\n retry\n end\n File.unlink(fp.path)\n fp.binmode\n fp.sync = true\n fp\n end", "def mock_queue(name=nil)\n MockQueue.new(name || \"anonymous-#{rand(2**32).to_s(16)}\")\n end", "def to_s\n \"FIFO#{@ary.inspect}\"\n end", "def new_trick\n put(:trick, Hamster::Deque.empty)\n end", "def queue\n @queue ||= channel.queue(generate_queue_name, exclusive: true)\n end", "def queue() = @queue ||= CommandQueue.new", "def make_queue\n # Create EventQueue with new-style events (added in Rubygame 2.4)\n @queue = EventQueue.new()\n @queue.enable_new_style_events\n end", "def creat_empty_history\n new_history = {\n \"Records\": []\n }\n @history = new_history\n @history\n end", "def empty!\n @head = @tail = nil\n @size = 0\n end", "def initialize(poller = CZTop::Poller.new)\n @readables = []\n @writables = []\n @poller = poller\n end", "def queue_out\n @channel.queue('out', durable: true)\n end", "def queue_out\n @channel.queue('out', durable: true)\n end", "def initialize\n @size = 0\n @head = nil\n @tail = nil\n end", "def empty\n Empty.new\n end", "def queue\n @queue ||= produce_queue\n end", "def empty!\r\n\t\t@items = []\r\n\tend", "def test_isEmptyOnEmptyQueue\n assert_equal( true , @queue.empty? )\n end", "def initialize\n @queue_for_storage = []\n @queue_for_removal = []\n @stored = []\n @removed = []\n end", "def reset_queue(force = false)\n return {} if !force && !should_flush?\n data = queue\n @queue = {}\n @count = 0\n data\n end", "def queue\n @queue ||= []\n end", "def enqueue(value)\n @count += 1\n new_element = RubyDS::StackQueue::Element.new(value)\n\n # If this is the first element, just assign the head and tail.\n if @head.nil?\n @head = new_element\n @tail = @head\n\n # Add the element as a new tail.\n else\n @tail.next = new_element\n @tail = @tail.next \n end\n end", "def empty!; end", "def reset!\n @queue = []\n @consumers = []\n end", "def initialize\n\t\tself.head = nil\n\t\tself.tail = nil\n\t\tself.length = 0\n\tend", "def initialize\n @store = Array.new(MAX_BUFFER, nil) # circular buffer\n @front = @back = -1 # track index of front/back\n end", "def is_empty()\n @queue.size == 0\n end", "def queue\n @queue ||= SizedQueue.new @queue_size\n end", "def blackhole\n file('/dev/null')\n end", "def create\n if @resource[:grow_fs] == :true\n fstabentry\n growfs\n mountfs\n else\n createfs()\n fstabentry\n mountfs\n end\n end", "def initialize(n)\n @queue = []\n @size = n\n @ptr = 1\n end", "def dequeue\n @items.delete_at(0)\n end", "def initialize\n\t\t@head = nil\n\t\t@tail = nil\n\t\t@size = 0\n\tend", "def create_queue_ignore_exists(address, queue, durable)\n begin\n create_queue(address, queue, durable)\n rescue Java::org.hornetq.api.core.HornetQException => e\n raise unless e.cause.code == Java::org.hornetq.api.core.HornetQException::QUEUE_EXISTS\n end\n end", "def isEmpty()\n if @head == nil\n puts \"This Queue is empty.\"\n else\n puts \"This Queue has data.\"\n end\n end", "def setup(*)\n super\n @queue = Array.new\n end", "def configure(conf)\n super\n setfifo(conf)\n end", "def empty?\n # @head and @tail are equal to what they were when the Queue was created\n @head == -1 and @tail == 0\n end", "def create_buffer!\n @buffer = Hash.new { |h, k| h[k] = Array.new }\n end", "def initialize\n @queue = Queue.new\n @workers = []\n @workers_count = 5\n end", "def empty_task(label=\"(Empty)\", &block)\n #:: clear @_empty_task.\n @_empty_task = nil\n #: prints section title if not printed yet.\n #: creates empty task object and returns it.\n t = _new_task(label, &block)\n #: saves empty task object.\n #:: don't add empty task to @tasks.\n @_empty_task = t\n t\n end", "def initialize\n @logger = VWO::Logger.get_instance\n @queue = []\n end", "def push_front(nodo)\n\t\tif @head == nil\n\t\t\t@head = Node.new(nodo,nil,nil)\n\t\t\t@tail = @head\n\t\telse\n\t\t\taux = @head\n\t\t\t@head = Node.new(nodo, aux, nil)\n\t\t\taux.prev = @head\n\t\tend\n\tend", "def nullsink(input=nil)\n inout \"nullsink\", input, nil\n end", "def create_order(order)\n @queue.enqueue(order)\n end", "def initialize_buffered_io; end", "def temporary_queue(&block)\n q = create_temporary_queue\n if block\n begin\n block.call(q)\n ensure\n # Delete Temporary queue on completion of block\n q.delete if q\n q = nil\n end\n end\n q\n end", "def queue\n\n @queue ||= channel.queue(*(opt('queue') || [ '' ]))\n end", "def initialize\n @size = 0\n @head = nil\n end", "def reset\n writeln('reset')\n clearQueue()\n end", "def empty()\n @push_queue.empty? and @pop_queue.empty?\n end", "def initialize\n self.head = nil\n self.tail = nil\n\t\tself.length = 0\n\tend", "def initialize\r\n @head = nil\r\n @tail = nil\r\n @size = 0\r\n end", "def initialize\n @head = nil\n @tail = nil\n @size = 0\n end", "def initialize\n @queue_options = {}\n @queue_configs = []\n end", "def enqueue(data)\n node = QueueNode.new data\n unless last.nil?\n @last.next = node\n @last = node\n end\n @first = node if @first.nil?\n end", "def initialize\n @size = 0\n clear\n end", "def empty?\n @queue.empty?\n end", "def initialize(enumerable = [])\n @sem = Mutex.new\n @store = Tempfile.new(\"obuf\")\n @store.binmode\n @size = 0\n \n @lens = Obuf::ProtectedLens.new(@store)\n \n # Store everything from the enumerable in self\n enumerable.each { |e| push(e) }\n \n # ...and yield self for any configuration\n yield self if block_given?\n end", "def initialize(work_items = [])\n\t\traise ArgumentError.new \"expected array\" unless work_items.is_a? Array\n\n\t\twork_items.each { |work_item| WorkItemQueue.enqueue work_item }\n\tend", "def create_empty\n EadGenerator.generate_empty\n end", "def initialize\n self.head = nil\n self.tail = nil\n self.length = 0\n end", "def make_queue\n # Create EventQueue with new-style events (added in Rubygame 2.4)\n @queue = EventQueue.new()\n @queue.enable_new_style_events\n \n # Don't care about mouse movement, so let's ignore it.\n @queue.ignore = [MouseMoved]\n end", "def create_queue(messenger, priority, options)\n name = create_queue_name(@logical_queue_name, priority)\n unless channel = AMQP::Channel.new(messenger.connection,\n DEFAULT_CHANNEL_OPTS.\n merge({prefetch: DEFAULT_PREFETCH}))\n raise AgniError,\n \"Unable to obtain a channel from AMQP instance at #{amqp_url}\"\n end\n # Get a handle to the default exchange. The default exchange\n # automatically binds messages with a given routing key to a\n # queue with the same name, eliminating the need to create\n # specific direct bindings for each queue.\n queue = channel.queue(name, DEFAULT_QUEUE_OPTS.\n merge(options))\n\n exchange = channel.default_exchange\n # Each 'queue' in the queue array is a hash. Here's how each\n # hash is laid out:\n {\n priority: priority,\n name: name,\n channel: channel,\n queue: queue,\n exchange: exchange\n }\n end", "def begin_create\n create_stack.push(true)\n end" ]
[ "0.6769331", "0.6616947", "0.6538363", "0.5831242", "0.5532893", "0.53430146", "0.5334373", "0.5232786", "0.50861233", "0.5081206", "0.501582", "0.5014214", "0.4997289", "0.49876356", "0.49809304", "0.49809304", "0.4966918", "0.4959901", "0.49589083", "0.49412322", "0.49163955", "0.4906671", "0.490473", "0.4896181", "0.4889025", "0.48827362", "0.4878494", "0.48760888", "0.4850487", "0.48449826", "0.48332557", "0.48278633", "0.48182824", "0.47782168", "0.4774427", "0.4772135", "0.47682014", "0.47641534", "0.47542527", "0.47347176", "0.47117367", "0.4706632", "0.47039717", "0.46837273", "0.4678574", "0.46712154", "0.46643206", "0.46618804", "0.46618804", "0.46615964", "0.46597138", "0.46586645", "0.46299842", "0.46284565", "0.46214345", "0.46003675", "0.45965883", "0.4593503", "0.4580738", "0.4571956", "0.4559739", "0.45493984", "0.45409578", "0.45399013", "0.45167166", "0.4511674", "0.4511306", "0.45080885", "0.45044822", "0.44978318", "0.44972554", "0.44922984", "0.44897237", "0.44784516", "0.44744393", "0.44731233", "0.4472248", "0.4470663", "0.4469239", "0.44686782", "0.4467008", "0.4465588", "0.44642338", "0.4460267", "0.4458807", "0.4455486", "0.44529897", "0.44514", "0.44504315", "0.44460028", "0.44425526", "0.4439748", "0.4438639", "0.44364193", "0.44349694", "0.4430704", "0.4423442", "0.44211748", "0.44183296", "0.4411714", "0.441114" ]
0.0
-1
Appends _objects_ to the end of this FIFO. Returns self.
def push(*objects) @ary.push(*objects) self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def push!(obj)\n @objs << obj\n end", "def << (obj)\n @objects << obj if obj\n end", "def add(*objects)\n objects.each do |object|\n @objects << object\n end\n self\n end", "def <<(anObject)\n queue << anObject\n if queue.size >= max_queue_size()\n client << queue.pop()\n end\n end", "def push(*obj)\n obj.each {|obj| self << obj }\n self\n end", "def add obj\n\t\t\t@objs2 += [obj] \n\t\tend", "def add(object)\n @objects << object\n end", "def enqueue(obj)\n node = Node.new(obj)\n if @first.nil?\n @first = @last = node\n else\n @last.next = node\n @last = node\n end\n return self\n end", "def append_queue\n if free_space > 0 \n free_blocks.times { \n if already_read < current_track.file.size\n buffer_block current_track\n else\n # We've finished this track, on to the next one\n load_next_track\n return\n end\n }\n else\n #puts \"Buffer full\" \n end\n end", "def push(*elements)\n @buffer.push(*elements)\n @buffer = @buffer[-@size, @size] if(@buffer.size > @size)\n end", "def add_objects(objects, with_permissions: {})\n objects.each do |object|\n add_object object, with_permissions: with_permissions\n end\n self\n end", "def <<(item)\n @buffer << item\n trim_buffer\n self\n end", "def enqueue(object_)\n result_ = true\n if @push_ptr\n if @pop_ptr == @push_ptr\n if @drop_oldest\n @pop_ptr += 1\n @pop_ptr = 0 if @pop_ptr == @buffer.size\n result_ = false\n else\n return false\n end\n elsif @pop_ptr.nil?\n @pop_ptr = @push_ptr\n end\n @buffer[@push_ptr] = object_\n @push_ptr += 1\n @push_ptr = 0 if @push_ptr == @buffer.size\n else\n @buffer.push(object_)\n end\n result_\n end", "def <<(obj)\n stack << obj\n self\n end", "def <<( obj )\n\n write( obj ) do |target, object|\n if object.respond_to?( :new? ) && object.new?\n @delayed_writes.push( object )\n else\n\n link = { 'rel' => rel_for_object( object ), 'href' => id_for_object( object ) }\n target.push( link ) unless target.include?( link )\n end\n end\n end", "def push_all(enumerable)\n enumerable.each do |item|\n push(item)\n end\n self\n end", "def concatinate(other_obj)\n TstLog(\"Sequence concatinate: #{other_obj}\")\n @elements += other_obj.elements\n @length += other_obj.length\n self\n end", "def <<( object )\n\t\t\tself.payload << object\n\t\t\treturn self\n\t\tend", "def enqueue *args\n a = args.reverse.take(size)\n self.data = a + data[0, size - a.size]\n self\n end", "def objects\n @objects ||= []\n end", "def enqueue_message(obj)\n output_queue << obj\n end", "def push(val)\n self.concat([val])\n shift if size > @max_size\n end", "def concat(elements)\n if empty?\n if elements.kind_of?(PQueue)\n initialize_copy(elements)\n else\n replace(elements)\n end\n else\n if elements.kind_of?(PQueue)\n @que.concat(elements.que)\n sort!\n else\n @que.concat(elements.to_a)\n sort!\n end\n end\n self\n end", "def push_objects(objects)\n @source.lock(:md) do |s|\n doc = @source.get_data(:md)\n objects.each do |id,obj|\n doc[id] ||= {}\n doc[id].merge!(obj)\n end \n @source.put_data(:md,doc)\n @source.update_count(:md_size,doc.size)\n end \n end", "def add(rc)\n # iterate over given rc and store each item in this Bag's list\n rc.items.each do |item|\n # use the Bag's store method to ensure items are reset\n self.store(item)\n end\n # empty the given rc using its own empty method\n rc.items = []\n end", "def push(obj)\n @q << obj\n @mutex.synchronize { @cv.signal }\n end", "def push *items\n @items.concat items\n end", "def add_objects!(objects, request_options = {})\n res = add_objects(objects, request_options)\n wait_task(res['taskID'], WAIT_TASK_DEFAULT_TIME_BEFORE_RETRY, request_options)\n res\n end", "def append_records\n # counter is a array type container hold numbers of AxOrder instance.\n # current AxOrder instance by manipulate is last member of container.\n counter = []\n begin\n if counter.empty?\n counter << new(:ax_order_number => next_ax_order_number)\n else\n counter << new(:ax_order_number => next_ax_order_number(counter.last.ax_order_number))\n end\n\n order, items = counter.last.fetch_data\n counter.last.attributes = order\n items.each do |item|\n counter.last.ax_order_line_items << AxOrderLineItem.new(item)\n end\n counter.each {|o| o.save }\n append_records # recursive invoke method self\n rescue => ex\n puts ex.message if AppConfig.DEBUG_MODE\n retry unless counter.size == MAX_COUNTER\n end\n end", "def objects\n @objects ||= []\n end", "def push (*args)\n\n args.each { |a| self << a }\n\n self\n end", "def add_to_buffer(records)\n @records_buffer.push(*records)\n end", "def << data\n buffer << data if data\n parse_loop!\n end", "def push *parts\n self.parts.concat parts\n end", "def push(obj)\n node = Node.new(nil, nil, obj)\n if @tail\n @tail.to = node\n node.from = @tail\n @tail = node\n else\n @head = @tail = node\n end\n @size += 1\n node.obj\n end", "def objects\n @objects ||= []\n end", "def add_objects(objects, request_options = {})\n batch(build_batch('addObject', objects, false), request_options)\n end", "def enqueue(data)\n output.append(data)\n end", "def push *items\n @components ||= []\n @components.push items\n self\n end", "def insert_tail(*objects)\n objects.each{ |x|\n if(self.empty)\n aux = Node.new(x, @tail, nil)\n @tail = aux\n @head = aux\n else\n aux = Node.new(x, @tail, nil)\n @tail[:prev] = aux\n @tail = aux\n end\n }\n end", "def push(obj)\n @queue.put(obj)\n end", "def push(obj)\n @mutex.synchronize{\n while true\n break if @que.length < @max\n @queue_wait.push Thread.current\n @mutex.sleep\n end\n\n @que.push obj\n begin\n t = @waiting.shift\n t.wakeup if t\n rescue ThreadError\n retry\n end\n }\n end", "def enqueue(item)\n\t\t@queue << item\n\tend", "def add_current_batch_to_out_queue(from)\n if from == :scheduled && (Time.now - @last_batch_time) * 1000 < @buffer_duration\n return\n end\n if @in_batch.size == 0\n @last_batch_time = Time.now\n return\n end\n @logger.debug(\"Added batch with #{in_count} items in #{in_size} by #{from}\") if @logger\n @out_queue.enq(@in_batch)\n @in_batch = Array.new\n @in_count = 0\n @in_size = 0\n @last_batch_time = Time.now\n end", "def concat(other)\n other.each do |obj|\n add obj\n end\n self\n end", "def <<(obj)\n if obj.is_a?(Integer)\n push_int(obj)\n elsif obj.is_a?(String)\n append_data(obj)\n elsif obj.is_a?(Array)\n obj.each { |o| self.<< o }\n self\n end\n end", "def push(x)\n self << x\nend", "def append(other)\n other.concat_head(self)\n end", "def push *parts\n @parts.concat parts\n end", "def enqueue! data\n @q << data\n self\n end", "def enqueue(obj)\n if @first.nil?\n @last = Node.new(obj)\n @first = @last\n else\n @last.next = Node.new(obj)\n @last = @last.next\n end\n end", "def append\n return [] if files.empty?\n if file_set?(parent)\n file_set_append\n else\n resource_append\n end\n end", "def all_redis_objects\n Base.redis_objects.merge(self.redis_objects)\n end", "def cycle!\n type = self.class.name.split(\"::\").last\n storage_object = Backup::Storage::Object.new(type)\n objects = [self] + storage_object.load\n if keep.is_a?(Integer) and keep > 0 and objects.count > keep\n objects_to_remove = objects[keep..-1]\n objects_to_remove.each do |object|\n Logger.message \"#{ self.class } started removing (cycling) files from #{ object.class.name.split(\"::\").last }\"\n object.send(:remove!)\n end\n objects = objects - objects_to_remove\n end\n storage_object.write(objects)\n end", "def queue( object, tier_index )\n ensure_tiers( tier_index ) if @extend\n \n @length += 1\n @tiers[tier_index] << object\n end", "def push(obj)\n @mutex.synchronize{\n @que.push obj\n begin\n t = @waiting.shift\n t.wakeup if t\n rescue ThreadError\n retry\n end\n }\n end", "def enqueue(items)\n @in_stack = []\n items.each { |item| @in_stack << item }\nend", "def add(obj, width)\n @objs << obj\n @width += width\n end", "def flush\n []\n end", "def +(object)\n if object.is_a?(Pattern)\n Pattern.new(self, size: size + object.size) { |y, d|\n each { |v| y << v }\n object.each { |v| y << v }\n }\n else\n map { |v| v.respond_to?(:+) ? v + object : v }\n end\n end", "def <<( object )\n\t\t\tself.frame << object\n\t\t\treturn self\n\t\tend", "def wrap(*objects)\n objects.each do |object|\n @handlers.each do |handler|\n next unless handler.handles?(object)\n item = handler.wrap(object)\n @archive.push(item) unless item.nil?\n end\n end\n @archive\n end", "def push(obj)\n if @blocked\n raise \"Nothing can be added to queue. Queue is blocked.\"\n else\n super(obj)\n end\n end", "def merge!\n\t\t\twhile handle = @queue.pop\n\t\t\t\tnext if handle.cancelled?\n\t\t\t\t\n\t\t\t\[email protected](handle)\n\t\t\tend\n\t\tend", "def __push\n @_undies_io.current.push\n end", "def queue(&b)\n @queue << b\n end", "def dequeue\n @items.shift\n end", "def queue_all( objects, tier_index = nil )\n objects.each do |object|\n if tier_index.nil? then\n calculated_tier_index = yield( object )\n queue( object, calculated_tier_index )\n else\n queue( object, tier_index )\n end\n end\n end", "def flush\n if @carry_over\n @contents['info']['pieces'] << Digest::SHA1.digest( @carry_over )\n end\n unless @contents['creation date']\n @contents['creation date'] = Time.now.tv_sec\n end\n @io << @contents.bencode\n @io.flush\n self\n end", "def enqueue(el)\n self.queue_var = [el] + self.queue_var \n end", "def append!\n self.operation = :append\n end", "def call(objects, _options)\n if cache.respond_to?(:write_multi)\n write_multi(objects)\n else\n write_each(objects)\n end\n\n objects\n end", "def add(data)\n case data\n when Buffer\n @data.concat(data.data)\n else\n data = data.to_s.dup\n return if data.empty?\n\n @data << data\n end\n @size += data.size\n self\n end", "def append! other\n if other.is_a?(Array)\n @data = @data.concat other\n elsif other.is_a?(Signal)\n @data = @data.concat other.data\n end\n return self\n end", "def add(o); addObject o end", "def deliver\n @queue << self\n end", "def push(obj)\n @mutex.synchronize do\n @queue.push obj\n begin\n t = @waiting.shift\n t.wakeup if t\n rescue ThreadError\n retry\n end\n end\n end", "def push(p)\n @obj << p\n end", "def <<(blob)\n @buf << blob\n buf_flush if @buf.size > BUFFER_SIZE\n self\n end", "def push(object)\n if @callbacks[:push]\n @callbacks[:push].call(object)\n else\n if $DEBUG\n warn \"Pushed object onto a PBXObjectList that does not have a :push callback from: #{caller.first}\"\n end\n end\n self\n end", "def <<(obj)\n @content << obj\n end", "def chunk(*chunks)\n @queue += chunks\n schedule_dequeue\n end", "def queued_messages\r\n @buffer.slice(@pointer, @buffer.length - @pointer)\r\n end", "def queued_messages\n @buffer.slice(@pointer, @buffer.length - @pointer)\n end", "def push_without_hooks( *objects )\n\n @without_hooks = true\n\n push( *objects )\n \n @without_hooks = false\n\n return objects\n\n end", "def +(other)\n raise ArgumentError, '+ requires another Enumerable!' unless other.class < Enumerable\n\n merged_thimble = ThimbleQueue.new(length + other.length, @name)\n each { |item| merged_thimble.push(item) }\n other.each { |item| merged_thimble.push(item) }\n merged_thimble\n end", "def <<( object )\n case object\n when Network\n add_network( object )\n when Tree\n add_tree( object )\n end\n self\n end", "def enqueue(element)\n if element.class.name == \"RealQueue\"\n require 'pry'\n binding.pry\n end\n @store.unshift(element)\n self\n end", "def synchronizeObjectsAdd _obj, _args\n \"_obj synchronizeObjectsAdd _args;\" \n end", "def <<(values)\n values = prepare_relation(values) if values.is_a?(Relation)\n self.set(objects.to_a | Array.wrap(values))\n end", "def queue\n @queue ||= []\n end", "def queue(*items)\n\t\t\t# insert @ tail\n\t\t\t# increment size (if able)\n\t\t\t# check size\n\t\t\t\t# move head if necessary\n\t\t\t# move tail\n\t\t\t\n\t\t\titems.each do |i|\n\t\t\t\t# puts \"head #{@head_index} tail #{@tail_index}\"\n\t\t\t\t\n\t\t\t\t@queue[@tail_index] = i\n\t\t\t\t\n\t\t\t\t@size += 1 unless @size == @queue.size\n\t\t\t\t\n\t\t\t\tif @size == @queue.size\n\t\t\t\t\tadvance_head\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tadvance_tail\n\t\t\tend\n\t\tend", "def add_item value\n\n @queue << value.to_f\n @queue.shift if @buffer.size > @period\n\n @buffer << @queue.sum / @queue.size # @queue.sum is always a float. \n\n current # return the last buffer value\n end", "def push\n end", "def enqueue(record)\n @queue << record.representation\n end", "def to(queue)\n queue.push(pack)\n end", "def << item\n @items << item\n end", "def <<(obj)\n self[length] = obj\n self\n end", "def batch\n ::Syncano::BatchQueueElement.new(self)\n end", "def push element\n if full?\n raise ArgumentError, \"buffer is full, and override_when_full is false\" unless @override_when_full\n \n @buffer[@newest] = element;\n @newest += 1\n @oldest += 1\n else\n @buffer[@newest] = element;\n @newest += 1\n @fill_count += 1 \n end\n\n if @oldest >= @buffer.count\n @oldest = 0\n end\n\n if @newest >= @buffer.count\n @newest = 0\n end\n end" ]
[ "0.6320862", "0.62817246", "0.62074196", "0.6152586", "0.61006445", "0.5869479", "0.58627766", "0.5720471", "0.57008475", "0.5683603", "0.568056", "0.5676982", "0.56663656", "0.56356883", "0.5605854", "0.5587203", "0.5580768", "0.55575544", "0.5496139", "0.5481302", "0.54699033", "0.546119", "0.5459204", "0.5452284", "0.5449342", "0.54342914", "0.5427396", "0.54258245", "0.5415917", "0.5402964", "0.5383989", "0.53832465", "0.5358152", "0.53469324", "0.53359896", "0.52897066", "0.52828246", "0.5266239", "0.52659434", "0.5262657", "0.5261888", "0.5225728", "0.5216691", "0.5205872", "0.5183559", "0.51819056", "0.517972", "0.51735795", "0.5160724", "0.5154224", "0.5151836", "0.51473206", "0.5146955", "0.51383156", "0.51313525", "0.5106105", "0.5095499", "0.50947624", "0.5089349", "0.50833684", "0.507665", "0.50687844", "0.5067256", "0.50565225", "0.5050292", "0.5049299", "0.50431186", "0.50395584", "0.5019133", "0.50173205", "0.50028723", "0.49986887", "0.49958465", "0.49948546", "0.499234", "0.49816784", "0.49777752", "0.49742258", "0.4970743", "0.49647883", "0.49560645", "0.4954787", "0.49476463", "0.49475852", "0.49456495", "0.49438635", "0.493339", "0.49291414", "0.49226382", "0.49047577", "0.489754", "0.48964292", "0.48955947", "0.489264", "0.48875383", "0.48790216", "0.48781466", "0.4877805", "0.48748744", "0.4872783" ]
0.64497536
0
Converts this FIFO to a String.
def to_s "FIFO#{@ary.inspect}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_s\n @stringio.string\n end", "def to_s\n to_io.read(nil)\n end", "def to_s\n rv = ''\n write rv\n rv\n end", "def to_string\n io.string\n end", "def to_s\n to_buffer.to_s\n end", "def to_s\n\t\t\treturn @buffer.to_s\n\t\tend", "def to_s\n @to_s ||= \"#{hostname}:#{Process.pid}-#{Thread.current.object_id}:#{@queues.join(',')}\"\n end", "def to_s\n io = StringIO.new\n write(io)\n io.rewind\n io.read\n end", "def to_s()\n flush\n @stream.is_an?(Array) ? @stream.join() : nil\n end", "def to_s\n @string\n end", "def to_s\n @string\n end", "def to_s\n @string\n end", "def to_s\n @string\n end", "def to_s\n @string || @object.to_s('F')\n end", "def to_s\n @string || @object.to_s('F')\n end", "def to_s\n stringify\n end", "def to_s\n @string\n end", "def to_s\n @string\n end", "def to_s\n @string\n end", "def to_s\n @string\n end", "def to_s\n return \"{ channel_order: #{self.channel_order}, channel_data_type: #{self.channel_data_type} }\"\n end", "def to_s() @out.to_s end", "def to_s\n io = StringIO.new\n write io\n io.string\n end", "def to_s\n\t\t\t@string\n\t\tend", "def to_s\n string\n end", "def to_s()\n serialize.to_s()\n end", "def to_s()\n serialize.to_s()\n end", "def to_s\n toString()\n end", "def to_str\n str = \"Id: \" + @id.to_s + \"\\nName: \" + @name.to_s + \"\\nItem(s): \\n\"\n @items.each do |item|\n str += \">\" + item.to_s + \" \\n\"\n end\n str\n end", "def to_s\n toString\n end", "def to_s\n data.to_s\n end", "def to_s\n return @data.to_s\n end", "def to_s\n @to_s || \"#{hostname}(#{local_ip}):#{Process.pid}:#{Thread.current.object_id}:#{Thread.current[:queues]}\"\n end", "def to_s\n @string ||= Builder::ToString.new(self).string\n end", "def to_str\n value.to_s\n end", "def to_s\n @to_s || \"#{hostname}(#{local_ip}):#{Process.pid}:#{Thread.current.object_id}:#{Thread.current[:path]}:#{Thread.current[:queues]}\"\n end", "def to_s\r\n string = IOP.allocate_string(@size)\r\n @data.each {|x| string << x}\r\n string\r\n end", "def to_s\n # Update length of the stream.\n @content[pn(:Length)] = @stream.length\n # Convert to String.\n out = []\n out << \"#{@element_id} #{@revision} obj\"\n out << @content.to_s\n out << @stream.to_s\n out << \"endobj\"\n return out.join(LF)\n end", "def to_str\n to_s\n end", "def to_s\n @items.join( _separator )\n end", "def to_s\n self.inspect\n end", "def to_s\n \"[#{@name}]\"\n end", "def to_s\n @str\n end", "def to_s\n @str\n end", "def to_s\n @streams.last.to_s\n end", "def to_str\n @value.to_s\n end", "def to_s\n to_a.to_s\n end", "def to_str\n @value\n end", "def to_s\n self.join('')\n end", "def to_s\n self.join('')\n end", "def to_s\n return serialize.to_s\n end", "def to_s\n self\n end", "def to_s\r\n dump\r\n end", "def to_s\n value.to_s\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\n @out.join\n end", "def to_s\n str\n end", "def to_s\n @payload ? @payload.to_s : self\n end", "def to_str() end", "def to_str() end", "def to_s\n buffer = StringIO.new\n buffer << \"[#{name}]\\n\" unless name.nil?\n key_value_pairs.each do |pair|\n buffer << pair.to_s\n end\n buffer.string\n end", "def to_s\n \"\"\n end", "def to_str() @value.to_s end", "def to_s\n to_symbol.to_s\n end", "def to_s\n object.to_s\n end", "def to_s\n @file.to_s\n end", "def to_s\n @string || @object.strftime(FORMAT).sub(\"+00:00\", 'Z').sub('.000', '')\n end", "def to_s\n @string || @object.strftime(FORMAT).sub(\"+00:00\", 'Z').sub('.000', '')\n end", "def to_s\n @data\n end", "def to_s\n res = \"\"\n self.each {|current| res << \" ( #{current.data} ) -> \" }\n res << \"nil\"\n end", "def string\n element().to_s\n end", "def to_s\n @object.to_s\n end", "def to_string; end", "def to_s\n val.to_s\n end", "def to_string\r\n @card_list.to_string\r\n end", "def to_string\r\n @card_list.to_string\r\n end", "def to_s\n @trace.to_s\n end", "def to_s\n to_data.map(&:to_s).join(\"\\n\")\n end", "def to_s\n @value.to_s\n end", "def to_s\n @value.to_s\n end", "def to_s()\n {\n 'type' => @type,\n 'destination' => @destination,\n 'tag' => @tag,\n 'data' => @data,\n 'timeout' => @timeout\n }.to_s()\n end", "def string\n @io.string\n end", "def to_s\n data\n end" ]
[ "0.6886889", "0.6866942", "0.67954445", "0.6778762", "0.67405695", "0.67217714", "0.6693904", "0.66509056", "0.66491234", "0.66053265", "0.66053265", "0.66053265", "0.66053265", "0.6582136", "0.6582136", "0.65703416", "0.6527835", "0.6527835", "0.6527835", "0.6527835", "0.65253896", "0.65016645", "0.64925295", "0.64713305", "0.6434036", "0.6374655", "0.6374655", "0.63639873", "0.636018", "0.635667", "0.6347408", "0.6328406", "0.6324569", "0.63200873", "0.6295878", "0.6291331", "0.6281541", "0.6277962", "0.62778574", "0.6275455", "0.6266552", "0.6263128", "0.6248904", "0.6248904", "0.6246306", "0.6215801", "0.6207842", "0.620281", "0.6201235", "0.6201235", "0.6200911", "0.61961627", "0.6193468", "0.61885315", "0.6161146", "0.6161146", "0.6161146", "0.6161146", "0.6161146", "0.6161146", "0.6161146", "0.6161146", "0.6161146", "0.6161146", "0.6161146", "0.6161146", "0.6161146", "0.6161146", "0.6161146", "0.6161146", "0.6161146", "0.6161146", "0.61474895", "0.6144409", "0.61391616", "0.6137818", "0.6137818", "0.61355436", "0.6134163", "0.6126481", "0.6123636", "0.6121392", "0.6115259", "0.6114391", "0.6114391", "0.6113973", "0.611083", "0.61075306", "0.6103929", "0.6103025", "0.6101496", "0.6100789", "0.6100789", "0.60976565", "0.6097029", "0.60863775", "0.60863775", "0.60856867", "0.6085561", "0.6083925" ]
0.7736053
0
if you are logged_in and tried to edit someone's profile show specific user depending on the id
def show @user = User.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n unless @user==User.find(params[:id])\n flash[:notice]= \"You can only see your own profile.\"\n redirect_to root_path\n end\n @user=User.find(params[:id])\n end", "def show\n if current_user.is_normal?\n @user = User.find( params[:id] )\n render :profile\n else\n redirect_to user_profile_path\n end\n end", "def profile_edit\n @user = User.find(current_user.id)\n end", "def edit\n id = params[:id]\n @user = User.find(id)\n if current_user\n # have to do this, or wil get nil:nil class\n if current_user.is_admin || current_user.id == @user.id\n render :edit\n end\n else\n redirect_to \"/\"\n end\n end", "def profile\r\n if params[:id] && User.exists?(params[:id])\r\n @prof = User.find(params[:id])\r\n else\r\n redirect_to_info_page t(:redir)\r\n return\r\n end\r\n end", "def edit\n @user = User.find_by_id(params[:id])\n logged_in_user = session[:user_hash][\"username\"]\n if logged_in_user != @user.sunet and not \n User.is_power_user(logged_in_user)\n # permission denied\n flash[:error] = \"Your privileges don't allow you to edit profiles other than your own.\"\n redirect_to \"/users#/users/\"\n end\n @photos = Photo.find_all_by_user_id(params[:id])\n end", "def edit\n @user = User.find_by_id(params[:id])\n logged_in_user = session[:user_hash][\"username\"]\n if logged_in_user != @user.sunet and not \n User.is_power_user(logged_in_user)\n # permission denied\n flash[:error] = \"Your privileges don't allow you to edit profiles other than your own.\"\n redirect_to \"/users#/users/\"\n end\n @photos = Photo.find_all_by_user_id(params[:id])\n end", "def edit\n # @user = User.find(params[:id])\n # already in correct_user\n end", "def edit\n @user = User.find(params[:user_id])\n @profile = @user.profile\n \n end", "def show_your_profile\n if params[:id] != session[:user_id].to_s\n redirect_to user_path\n end\n end", "def show\n respond_to do |format|\n if (current_user.is_admin?)\n @user = current_org.users.find(params[:id])\n format.html\n else\n if (current_user.id != params[:id].to_i)\n format.html { redirect_to user_path(current_user.id) }\n else\n @user = current_user\n format.html\n end\n end\n end\n end", "def edit\n\t\t@user = User.find( params[:user_id] )\n\t\t@profile = @user.profile\n\tend", "def show\n @profile = Profile.find(params[:id]) || current_user.profile\n end", "def show\n @use = User.find(@profile.my_id)\n if @profile.user_id then\n @target = User.find(@profile.user_id)\n end\n if ((@use.id == 1) && (@use.id == @profile.my_id) && ([email protected]_id)) then\n do_it\n end\n end", "def edit\n user = User.find(params[:user_id])\n @profile = user.profile\n end", "def edit\n\t\t# admin is able to edit any user's page\n if current_user.is_admin?\n @user = User.find(params[:id])\n else\n @user = current_user\n end\n end", "def edit\n @user = User.find (params[:user_id])\n @profile = @user.profile\n end", "def edit\n\n #Make sure only logged in admins can manipulate users\n\n if @loggedinuser && @loggedinuser.authorizationlevel >= 4\n \t@user = User.find(params[:id])\n else \n redirect_to '/'\n end\n end", "def edit_profile\n @user = User.find params[:id]\n end", "def edit\n @user = User.friendly.find(params[:id])\n if not_owner_check(@user)\n redirect_to current_user\n end\n end", "def edit\n @profile = User.find(params[:id])\n end", "def edit\n if (session[:user_id] != nil)\n @user = User.find_by(id: session[:user_id])\n else\n redirect_to login_path\n end\n end", "def edit\n @user = current_user\n @profile = current_user.profile\n end", "def edit\n\t\tif !current_user || !is_this_user\n\t\t\tredirect_to user_path(params[:id])\n\t\tend\n\tend", "def edit\n user_store_url\n @user = current_user\n if params[:id] && params[:id] != \"current\" && @user.admin?\n @user = User.find(params[:id])\n end\n end", "def edit\n @user = User.find(params[:id])\n\n deny_wrong_user if !current_user?(@user)\n end", "def show\n if current_user\n @user = User.find(params[:id])\n @user = current_user\n render :show\n else\n flash[:error] = \"Must be signed in to see your profile!!\"\n redirect_to \"/\"\n end\n end", "def edit_profile\n \t@user = current_user\n end", "def edit\n # @user = User.find(params[:id]) -- not needed bc of correct_user\n end", "def show\n get_user_for_edit\n end", "def edit\n \n # Pass through the specified user, making sure that it exists\n @user = User.find_by_login(params[:user_login])\n \n # Check that the current user is the specified user, or an\n # administrator\n unless @user == current_user or admin_logged_in?\n flash[:error] = 'You cannot edit the profile of another user.'\n redirect_to :controller => 'sessions', :action => 'new'\n else\n render :layout => 'dialog'\n end\n end", "def edit\n if params[:id].present?\n @user = User.find_by_uuid(params[:id])\n else\n @user = current_user\n end\n end", "def edit\n\t @user = User.find(params[:id])\n\t redirect_to root_path unless current_user.is_admin? or @user == current_user\n\tend", "def show\n if params[:id]\n @user = User.find(params[:id])\n else\n @user = current_user\n end\n \n if @user == current_user\n render :show_full\n else\n render :show\n end\n end", "def user_profile\n @current_user = current_user\n\n if params[:id] == 'me'\n @user = @current_user\n else\n @user = User.find_by_id(params[:id])\n end\n end", "def show\n if Profile.find(params[:id].to_i).public_profile == 1 || params[:id].to_i == current_user.profile.id\n @profile = Profile.find(params[:id])\n @session_id = params[:id].to_i\n else\n redirect_to '/'\n end\n end", "def show\n op = present User::Show\n redirect_to edit_user_profile_path(current_user, op.model.profile) && return if op.new_profile?\n redirect_to user_profile_path(current_user, op.model.profile)\n end", "def edit\n if params[:id].present?\n @user = User.find(params[:id])\n else\n super\n end\n end", "def show\n user_id = params.require(:id).to_i\n\n if user_id != current_user.id\n bad_request\n else\n @user = User.find(user_id)\n if @user\n success(body: @user)\n else\n not_found\n end\n end\n end", "def edit\n @profile = Profile.find(current_user.id)\n end", "def edit\n @user = User.all.deep.find(current_user.id)\n authorize! :edit, @user\n\n render 'users/settings'\n end", "def show\n unless params[:id].blank?\n @user = User.find_by_id(params[:id])\n else\n if logged_in?\n @user = current_user\n else\n require_login and return\n end\n end\n \n if @user.blank?\n flash[:error] = \"User not found\"\n redirect_to root_path and return\n end\n\n @own_profile = (logged_in? && (@user.id == current_user.id))\n\n @page_title = @own_profile ? \"My profile\" : \"View profile\"\n\n @memberships = @user.liga_users.approved.map(&:league)\n end", "def show\n \t@person = Person.find(params[:id])\n \t@is_admin = false\n \tactive_person = Person.find(session[:user_id])\n \troles = active_person.roles.collect {|role| role.name}\n if roles == [\"DirectCareProvider\"] && session[:user_id] != params[:id]\n flash[:notice] = \"You can only access your own profile.\"\n @person = active_person\n elsif roles.member?(\"Supervisor\") || roles.member?(\"Administrator\")\n \t@is_admin = true\n end\n end", "def edit\n\t\tthe_user_id = params[\"id\"]\n \t@user = User.find_by(:id => the_user_id)\n\tend", "def update\n @id = params[:id].to_s\n new_user = find_user_by_id_login_or_email(@id)\n if new_user.blank? && @id.present?\n flash_error(\"Couldn't find \\\"#{@id}\\\". Play again?\")\n render(action: :edit)\n # Allow non-admin that's already in \"switch user mode\" to switch to\n # another user. This is a weird case which only comes up if you switch to\n # another admin user. But if you do so the Switch User mechanism should\n # behave in a reasonable way, and this seems the most appropriate way.\n elsif !@user&.admin && session[:real_user_id].blank?\n redirect_back_or_default(\"/\")\n elsif new_user.present?\n switch_to_user_if_verified(new_user)\n render(action: :edit)\n end\n end", "def correct_user\n @user = User.find(params[:id])\n unless current_user?(@user)\n flash.now[:danger] = \"You can only change your own profile.\"\n redirect_to signin_url\n end\n end", "def show\n if @user.admin?\n @user = User.find(params[:id])\n end\n end", "def edit\n @user= User.find_by_id(current_user.id)\n end", "def correct_user_for_profile\n @user = User.find(params[:id])\n unless current_user?(@user)\n flash[:danger] = \"Log in as correct user.\"\n redirect_to(root_url)\n end \n end", "def edit\n # Listing 9.14: Finding the correct user is now handled by the correct_user before_action.\n end", "def show\n #here e find the user by its id to display its information. However, we need to impede users without\n # admin privileges to see other users information.\n #so first we check if someone is logged.\n unless current_user.nil?\n #if someone is logged we need to check if the logged user if admin.\n if current_user.admin?\n #if the user is admin we allow finding a user by its id.\n @user = User.find(params[:id])\n #if the logged user is not admin we add the current user in the variable @user, so the show view\n # will display only the current user information.\n else\n @user = current_user\n end\n end\n end", "def show\n @user = User.find(params[:id])\n if $current_user.nil? or $current_user.id != @user.id\n redirect_to signin_path\n else\n @title = \"#{@user.userName}'s profile\"\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end\n end", "def edit\n # this finds the current user\n @user = User.find params[:id]\n end", "def show\n self.current_user\n \n if not @current_user\n redirect_to login_path\n else\n render :action => 'edit'\n end\n end", "def profile\n @user = @current_user\n\n render :show\n\n end", "def edit\n \n @user = User.find(params[:id])\n \n end", "def edit\n # @user = User.find(params[:id]) <-- not needed; @user defined in correct_user\n end", "def edit\n if current_user && current_user.role == \"admin\"\n @user = User.find(params[:id])\n else\n redirect_to new_user_session_path\n end \n end", "def edit\n @user = User.find(session[:user_id])\n end", "def edit\n redirect_to root_url and return unless current_user\n @user = current_user\n end", "def show\n\n #Make sure only logged in admins can manipulate users\n\n if @loggedinuser && @loggedinuser.authorizationlevel >= 4\n \t@user = User.find(params[:id])\n else \n redirect_to '/'\n end\n end", "def profile\n \t@user = UsersService.findUserById(params[:id])\n end", "def show\n\n @user = User.get(params[:id])\n \n if signed_in? && @user.id == current_user.id\n @menu = \"home\"\n @board = \"user\"\n @section = \"show\"\n \n render 'user'\n else\n redirect_to '/'\n end\n end", "def edit\n if current_profile!=@profile\n redirect_to root_url, notice: 'Permission denied'\n end\n end", "def edit\n get_user_for_edit\n end", "def show\n @user = User.find(params[:id])\n can_edit_hash = Permissions.currentLoggedInOrHasMorePermissions(@current_user,@user)\n @can_edit = can_edit_hash[:has_permission]\n\n #max needs\n @can_see_pref= Permissions.is_at_least_manager(@current_user)\n\n profile_attrs = [:first_name,:last_name, :email,:phone_number]\n @first_name = @user.first_name\n @last_name = @user.last_name\n @email = @user.email\n @phone_number = @user.phone_number\n @role = @user.role\n end", "def edit\n if current_user.access == 2\n redirect_to \"/users/indexU\"\n end\n end", "def profile\n @user = User.find(params[:id])\n end", "def show\n @user = User.find(params[:id])\n \n # A user cant edit or access another users page\n unless session[:user_id] == @user.id && [email protected]\n flash[:danger] = \"You don't have access to that page!\"\n redirect_to root_url\n end\n end", "def edit\n @user.build_user_profile unless @user.user_profile\n end", "def edit\n # finds user with id of params[:id]\n @user = User.find params[:id]\n end", "def show\n\n\t\t@current_profile = Profile.get_profile params[:id], \"asdf\"\n\n\t\tpretty_render \"api/public_user\"\t\n\n\tend", "def show\n # Can only view page if you are an admin or the logged in user\n if current_user && (current_user.admin || current_user.id.to_f == params[:id].to_f)\n else\n redirect_to current_user\n end\n end", "def show\n @user = get_user_or_current_user(params[:id])\n @is_current_user = (@user.id == current_user.id)\n end", "def show\n\t\tthe_user_id = params[\"id\"]\n \t@user = User.find_by :id => the_user_id\n\tend", "def show\n id = params[:id]\n if current_user.id == params[:id].to_i \n @user = current_user\n else\n @user = current_user.find(id)\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end", "def edit(id)\n @user = User.get(id)\n if not @user == session.user\n \n else\n redirect \"/\",\n :message =>\n {:error => \"Hey, that isn't you! Stop trying to be naughty!\"}\n end\n end", "def show\n \t# get particular user here\n \t@user = User.find_by_id(params[:id])\n \t# if not @user\n \t# \tredirect_to \"/users\"\n \t# end\n end", "def edit\n @userToEdit = User.find(params[:id])\n end", "def edit \t\t\t\t\t\t\t #render user page \n \t@user = User.find(session[:user_id])\n end", "def show\n @profile = Profile.find(:first, :conditions => {:user_id => params[:user_id]})\n end", "def set_profile\n @profile = if params[:id]\n Profile.find_by!(user_id: params[:id])\n else\n Profile.find_by(user: current_user)\n end\n end", "def edit\n user = User.find_by username: params[:username]\n if !user || user.id != session[:user_id]\n flash[:error] = \"You are not authorized to edit this user's profile.\"\n redirect_to user_path params[:username]\n else\n @user = User.find_by username: params[:username]\n end\n end", "def show\n if (is_signed_in)\n @preview=true; #the same user is viewing the profile.\n puts(\"------- DEBUG ------------\" + session[:user].to_s)\n else\n @preview = false;\n end\n\n if params[:id]== (\"sign_in\")\n redirect_to :controller => 'authentication',:action => 'show'\n end\n if params[:id]== (\"sign_out\")\n redirect_to :controller => 'authentication',:action => 'destroy'\n end\n if params[:id]== (\"uploads\")\n redirect_to :controller => 'users',:action => 'uploads'\n\n end\n\n end", "def show\n @user = User.find(params[:id])\n if current_user != @user\n redirect_to @user\n end\n end", "def edit\n #similar to the NEW action, but instead of create a empty user, we will find a user by its id and than\n # send its params to the partial form, so the params can be edited. Please note the partial form\n # for details, as the column admin can be edited only buy logged users with admin privileges.\n #@user variable will be used in the partial form, when submitted goes to UPDATE action.\n @user = User.find(params[:id])\n #only admin can edit other users information, so we first check if the user is admin.\n unless current_user.admin?\n #if the user is not admin it can edit only its own information, so we redirect to edit its own information\n unless @user.id == current_user.id\n redirect_to edit_user_path (current_user)\n end\n end\n end", "def show\n if params[:id].to_i.to_s == params[:id]\n @user = User.find(params[:id])\n else\n @user = User.find_by(username: params[:id])\n end\n end", "def show\n if current_user.try(:admin?)\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n else\n redirect_to :permission_error\n end\n end", "def show\n\n @user = User.get(params[:id])\n \n if admin_signed_in?\n @menu = \"home\"\n @board = \"user\"\n @section = \"show\"\n \n render 'admin/users/user'\n else\n redirect_to '/'\n end\n end", "def correct_user\n @user = User.find(params[:id]) if User.exists?(params[:id])\n redirect_to(edit_user_path(current_user)) unless current_user == @user\n end", "def show\n @user = @current_user \n @user = User.find( params[:id] ) \n end", "def show\n\t\tif current_user.is_admin\n\t\t\t@user = User.find(params[:id])\n\t\t\trespond_to do |format|\n\t\t\t\tformat.html # show.html.erb\n\t\t\t\tformat.xml { render :xml => @user }\n\t\t\tend\n\t\telse\n\t\t\t\n\t\t\tif(current_user.id.to_i != params[:id].to_i)\n\t\t\t\tflash.now[:notice] = \"I privilegi da te posseduti non sono sufficienti a visualizzare altri utenti\"\n\t\t\tend\n\t\t\t@user = current_user\n\t\t\t\n\t\t\trespond_to do |format|\n\t\t\t\tformat.html\n\t\t\t\tformat.xml { render :xml => @user }\n\t\t\tend\n\t\tend\n\n\tend", "def edit\n @owner = Owner.includes(:owner_profile).find(session[:user_id])\n @owner.build_owner_profile unless @owner.owner_profile\n end", "def edit\n __log_activity\n __debug_route\n id = identifier_list.first\n if id.is_a?(Integer)\n @item = User.find_record(id) or raise \"invalid selection #{id.inspect}\"\n else\n @item = current_user\n end\n super\n end", "def edit\n \t@user = User.find params[:id]\n end", "def edit\n # @user は編集対象のユーザー\n # current_user はログインしているユーザー \n @user = User.find(params[:id])\n if (current_user != @user)\n redirect_to root_path\n end\n end", "def manage_profile\n begin\n @has_link_access = true\n if @actor.is_fan? # in case of fan profile login\n @user = @actor\n @additional_info = current_user.additional_info\n get_user_associated_objects\n render :template =>\"/fan/manage_profile\" and return\n elsif @actor.is_artist? # in case of artist profile login\n @user = current_user\n @artist = @actor\n @artist_user = ArtistUser.for_user_and_artist(current_user, @artist).first || ArtistUser.new\n get_artist_objects_for_right_column(@artist)\n render :template =>\"/artist/edit\" and return\n elsif @actor.is_venue? # in case of venue profile login\n @user = current_user\n @venue = @actor\n @venue_user = VenueUser.for_user_and_venue(current_user, @venue).first || VenueUser.new\n get_venue_objects_for_right_column(@venue)\n render :template =>\"/venue/edit\" and return\n end\n rescue =>exp\n logger.error \"Error in User#ManageProfile :=> #{exp.message}\"\n render :nothing => true and return\n end\n respond_to do |format|\n format.js\n format.html\n end\n end", "def show?\n user.id == record.id || user.administrator?\n end", "def edit\n @user = User.shod(params[:id])\n authorize! :update, @user\n end", "def edit\n\t\t\t@user = User.find(params[:id])\n\t\t\t@jobseeker1 = Jobseeker.find_by(:user_id => @user.id)\n\n\t\tif @jobseeker1\n\t\t\t@jobseeker = @jobseeker1\n\t\t\t@title = \"Edit Profile\"\n\t\telse\n\t\t\tflash[:notice] = \"we don't have your profile yet, create one!\"\n\t\t\t#don't use render 'new' because it refers to @jobseeker from this action(and in this section of action, its nil.)\n\t\t\tredirect_to new_jobseeker_path\n\t\tend\n\t\t\n\tend", "def show\n if @oeuser.id.to_i == params[:id].to_i\n @user = User.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n else\n flash[:error] = \"Restricted Access, You need to be Admin\"\n redirect_to root_url\n end\n end" ]
[ "0.7691571", "0.76914155", "0.76810485", "0.75788087", "0.7497994", "0.74894613", "0.74894613", "0.74157786", "0.7413152", "0.7386759", "0.7357521", "0.73476136", "0.7347583", "0.7347067", "0.7337377", "0.7335653", "0.7312651", "0.72957754", "0.7288409", "0.7280811", "0.72766924", "0.7224457", "0.7214624", "0.72076553", "0.71988434", "0.71910614", "0.71894103", "0.7176998", "0.71764004", "0.7168321", "0.7168029", "0.716208", "0.7154173", "0.7148024", "0.71377575", "0.71374136", "0.7134568", "0.7129068", "0.7069598", "0.7043914", "0.70387095", "0.70371884", "0.7024448", "0.70232433", "0.7007822", "0.70064", "0.7002071", "0.6996154", "0.699392", "0.6984337", "0.6982266", "0.6977178", "0.6972496", "0.69541276", "0.6950348", "0.69423443", "0.6935865", "0.6933379", "0.69287837", "0.69272256", "0.69185185", "0.69171256", "0.6908338", "0.6908121", "0.6906379", "0.69038177", "0.6902513", "0.6894991", "0.68878794", "0.6883285", "0.68785536", "0.68679625", "0.6866893", "0.6865404", "0.6852185", "0.6847335", "0.6846942", "0.68431985", "0.68430245", "0.6835803", "0.683553", "0.6834794", "0.683095", "0.6827118", "0.68150216", "0.6814583", "0.6807898", "0.6806393", "0.6796848", "0.67951304", "0.67730784", "0.67730623", "0.6772475", "0.67707616", "0.6770488", "0.6763561", "0.6758255", "0.6758095", "0.67566836", "0.6754231", "0.6751145" ]
0.0
-1
init' a new user
def new @user = User.new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user() @user = DiggUser.new end", "def setup_user\n User.new( \n age: 5,\n bio: \"My test bio\",\n password: SecureRandom.hex(6),\n email: SecureRandom.hex(4) + \"@example.com\",\n picture: \"blah.jpg\",\n sex: \"M\",\n username: SecureRandom.hex(4)\n )\n end", "def set_user\n \t@user = User.new\n end", "def new_user\n\t\t@resource = User.new\n\t\t@resource_name = 'user'\n\tend", "def new_user\n\t @user = User.new\t \n\tend", "def new\n \t#declare user variabel with assign new user\n \t@user=User.new\n end", "def init_by_user(user)\n return self unless user\n self.user = user\n self.name = user.name\n self.email = user.email\n self\n end", "def new_user\n User.new({\n email: 'hoge@hoge',\n password: 'hoge',\n password_confirmation: 'hoge'\n })\n end", "def new\n @sys_user = Sys::User.new\n end", "def uid_init(userid, password, profile, guest = 'y')\r\n\t\t\t@userid = userid\r\n\t\t\t@password = password\r\n\t\t\t@profile = profile\r\n\t\t\t@guest = guest\r\n\t\t\treturn self\r\n\t\tend", "def user_new(opts = {})\n call(\"user\", \"new\", opts)\n end", "def user_init; end", "def set_user\n @form_user = User.new(:email => self.user_email, :first_name => self.user_first_name,\n :last_name => self.user_last_name)\n @user = User.where(:email => self.user_email).first\n @new_user = false\n if @user.nil?\n @new_user = true\n @user = @form_user\n end\n end", "def main\n @user = User.new\n end", "def new()\n @user = User.new()\n end", "def new_user options = {}\n User.where(@default_user_credentials.merge(options)).delete_all\n user = User.new @default_user_credentials.merge(options)\n user.login = options['login'] || 'cool_user'\n user\n end", "def create\n fname = \"#{self.class.name}.#{__method__}\"\n super\n user=User.find_by_email(reg_params[:email])\n pars={}\n unless user.nil?\n pars[:name]=params[:user][:name]\n pars[:role]=params[:user][:role]\n user.update(pars) \n else\n user=User.new(params[:user])\n end\n LOG.debug(fname) {\"************************ current_user=#{user.inspect}\"}\n end", "def set_user\n return @user = User.find(params[:id || :username]) unless params[:id].nil?\n new\n end", "def new \n\t\t@user = User.new\n\tend", "def set_user\n @user = User.find_by_external_id(params[:id])\n @user = User.create!(name: params[:name], email: params[:email], external_id: params[:external_id]) unless @user\n end", "def new_user\n account_make = self\n # assign storing of information to a variable\n account_store = YAML::Store.new 'users.store'\n # store the object into a file\n account_store.transaction do\n account_store[username.to_s] = account_make\n end\n end", "def new_user\n @user = User.new\n end", "def user_instance(username)\n User.new(new_username: username, forename: 'forename', surname: 'surname',\n email_address: '[email protected]', email_address_confirmation: '[email protected]',\n new_password: 'P@ssword001', new_password_confirmation: 'P@ssword001',\n user_is_current: 'Y')\n end", "def set_user\n @user = User.find(params[:id])\n @user.initialize_users(@user)\n end", "def make_user\n end", "def create_new_user\n session[:user_id] = nil\n user = User.create_new(:remote_ip => request.remote_ip)\n user.language_abbr= session[:language] if session[:language] # Recalls language from previous session.\n user\n end", "def cria_user\n return if user.present?\n User.create(email: self.end_email, password: '123123', password_confirmation: '123123',\n tb_empregado_id: self.id, e_admin: self.e_admin || false).encrypted_password\n end", "def new\n\t @user = User.new\n end", "def new\n @user = User.new()\n end", "def set_new_user\n @new_user = NewUser.find(params[:id])\n end", "def create_user\n command = compile_command(\"useradd\") do |useradd|\n useradd << universal_options\n useradd << useradd_options\n end\n\n run_command(:command => command)\n\n # SmartOS locks new users by default until password is set\n # unlock the account by default because password is set by chef\n if check_lock\n unlock_user\n end\n end", "def new\n\t\t@unregistered_user = IncompleteUser.find(session[:tmp_checked])\n\t\t@user = User.new\n\t\[email protected]_list = '0123'\n\tend", "def new\n\t\t@super_user = SuperUser.new\n\tend", "def add_initial_user\n initial_user = Member.where(:email => \"[email protected]\").first\n \n unless initial_user\n # Create an initial position.\n position = Position.new\n position.name = \"Administrator\"\n position.pos_type = \"Administrator\"\n position.save\n \n # Create an initial division.\n division = Division.new\n division.name = \"Administrator\"\n division.save\n \n # Find initial position and division created.\n # Id´s will be used to crete initial user.\n position = Position.where(:name => \"Administrator\").first\n division = Division.where(:name => \"Administrator\").first\n \n # Create an initial user with position and divison created above.\n member = Member.new\n member.name = \"Administrator\"\n member.email = \"[email protected]\"\n member.password = \"administrator\"\n member.major = \"NONE\"\n member.grad_year = 9999\n member.member_since = 9999\n member.hometown = \"NONE\"\n member.position_id = position.id\n member.division_id = division.id\n member.save\n end\n end", "def create_user(struct)\n struct.remapkeys!\n if struct.has_key? :user and struct.has_key? :pass\n rt = RT_Client.new(:user => struct[:user], :pass => struct[:pass])\n struct.delete(:user)\n struct.delete(:pass)\n else\n rt = RT_Client.new\n end\n val = rt.create_user(struct)\n rt = nil\n val\n end", "def initialize(name,password,age)\n #though is looks funny (@something = something) the @ symbol makes it an instance variable so that the argument given is attached to that specific User and not mixed up with other Users\n @name = name\n @password = password \n @age = age\n end", "def new_user_record_from(user_data)\n user = User.new(email: user_data[:email], name: user_data[:name], password: \"temporal_password\")\n user\n end", "def create_user(**data)\n create_object(type: 'User', data: { enabled: true }.merge(data))\n end", "def new\n @user = EemsUser.load_from_session(session)\n end", "def call\n context.user = User.find_by_telegram_id(context.telegram_user.id)\n return if context.user\n\n context.is_new_user = true\n context.user = User.create(\n telegram_id: context.telegram_user.id,\n )\n end", "def newUser\n end", "def new\n add_breadcrumb I18n.t('integral.breadcrumbs.new'), :new_backend_user_path\n @user = User.new\n end", "def create_user_and_login(userinfo)\n nickname = userinfo[:nickname]\n user = User.new(\n name: nickname.nil? ? userinfo[:name] : nickname,\n email: @email,\n auth0_id: @auth0_id\n )\n user.save\n login_and_redirect user\n end", "def createUser(nickname) \n usr = User.new(nickname)\n backend_addUser(usr) \n end", "def initialize(fullname = \"New User\", address = \"\", city = \"\", state = \"\", zip = \"\", country = \"\", email = \"\", phone = \"\", userid, password)\n @fullname = fullname\n @address = address\n @city = city\n @state = state\n @zip = zip\n @country = country\n @email = email\n @phone = phone\n @userid = userid\n @password = password\n end", "def new\n\t\t@user = User.new\n\tend", "def new\n\t\t@user = User.new\n\tend", "def new\n\t\t@user = User.new\n\tend", "def new\n\t\t@user = User.new\n\tend", "def new\n\t\t@user = User.new\n\tend", "def new\n\t\t@user = User.new\n\tend", "def new\n\t\t@user = User.new\n\tend", "def new\n\t\t@user = User.new\n\tend", "def new\n\t\t@user = User.new\n\tend", "def new\n\t\t@user = User.new\n\tend", "def new\n\t\t@user = User.new\n\tend", "def new\n\t\t@user = User.new\n\tend", "def init_user\r\n #logger.info session.inspect\r\n @store_user = session[:web_user]\r\n @store_user.request_path = request.path + \"?\" + request.query_string\r\n @customer = ERP::Customer.find_by_account_num @store_user.erp_account_number\r\n \r\n if @customer.nil?\r\n render :partial => \"unaccessible\", :layout => false\r\n return false\r\n end\r\n \r\n @user = @customer.contact_people.find_by_email @store_user.email_address\r\n if @user.nil?\r\n @user = ERP::ContactPerson.new\r\n @user.attributes = {\r\n :erp_customer_id => @customer.id,\r\n :first_name => @store_user[:name],\r\n :last_name => @store_user[:name],\r\n :name => @store_user[:name],\r\n :email => @store_user[:email_address]\r\n }\r\n end\r\n end", "def create!\n self.save\n self.set_lookup(:login) if self.is_a?(User)\n :ok\n end", "def create_user\n # provide the interface asking for name, destination and duration\n # then, create and store the User object\n end", "def setup_user\n user = create(:user)\n login_as(user, scope: :user)\n end", "def new\n @user = User.new()\n end", "def new\n @user = User.new()\n end", "def new\n\t\t@user = User.new\n\n\tend", "def new\n\t@user = User.new\n end", "def createNewUser(userName, initialGroup, userEmail, fname, lname, password)\n\n password = password.encrypt\n user = {\"login\" => userName,\n \"group0\" => initialGroup,\n \"email\" => userEmail,\n \"fname\" => fname,\n \"lname\" => lname,\n \"password\" => password,\n \"orga\" => \"0\"}\n saveUser(userName, user)\n end", "def set_user\n @user = User.find_by(auth0_id: auth_token[0]['sub'])\n end", "def create_user\n params = {\n :client_id => Swiftype.platform_client_id,\n :client_secret => Swiftype.platform_client_secret\n }\n post(\"users.json\", params)\n end", "def create_user\n User.create name: \"test\", email: \"[email protected]\", password: \"123456\"\n end", "def set_user\n @user = params[:id] ? User.find(params[:id]) : User.new(user_params)\n end", "def new_user(name)\n User.create(name: name)\nend", "def create_patron_user\n\t branch = Nimbos::Branch.where(patron_id: self.id).first\n\t role = Nimbos::Role.find_or_create_by(name: \"admin\")\n\t user = self.users.new\n\t user.name = self.contact_name\n\t user.surname = self.contact_surname\n\t user.email = self.email\n\t user.language = self.language\n\t user.locale = self.locale\n\t user.mail_encoding = self.mail_encoding\n\t user.time_zone = self.time_zone\n\t user.branch_id = branch.id\n\t user.password = self.password\n\t user.password_confirmation = self.password\n\t user.firstuser = true\n\t user.role_ids = [role.id]\n\t user.save!\n\t #user.add_role :admin\n\t end", "def new_user(attributes = {})\n User.new({password: \"foobar\"}.merge(attributes))\n end", "def create_user\n puts \"Whats your name?\"\n name = gets.chomp\n puts \"Where would you like to go?\"\n destination = gets.chomp\n puts \"How long would you like to stay?\"\n duration = gets.chomp.to_i\n @user = User.new(name, destination, duration)\n # provide the interface asking for name, destination and duration\n # then, create and store the User object\n end", "def new\n # binding.irb\n super\n # @user = User.new\n end", "def new\n puts \"******* new *******\"\n @user = User.new\n end", "def set_create_user(opts)\n opts = check_params(opts,[:user_info])\n super(opts)\n end", "def create_user(resource)\n session = Puppet::NetDev::CE::Device.session\n\n set_user_xml = '<rpc><edit-config><target><running/></target><default-operation>merge</default-operation><error-option>rollback-on-error</error-option><config><aaa xmlns=\"http://www.huawei.com/netconf/vrp\" content-version=\"1.0\" format-version=\"1.0\"><lam><users><user operation=\"merge\"><userName>' + (resource[:name]).to_s + '</userName>'\n\n if resource[:password]\n set_user_xml += '<password>' + (resource[:password]).to_s + '</password>'\n end\n\n set_user_xml += '</user></users></lam></aaa></config></edit-config></rpc>'\n\n session.rpc.do_config(set_user_xml)\n end", "def new\n @user = User.new()\n\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 create_user\n User.create name: 'test', email: '[email protected]', password: '123456'\n end", "def new\n @user = MinimalistAuthentication.configuration.user_model.new\n end", "def set_user; end", "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_user(obj, type)\n @logger.info(\"Creating user for #{type} #{obj.name}\")\n user = SugarCRM::User.new\n user.user_name = (type == 'agent') ? obj.emerchantpay_agent_id : obj.emerchantpay_iso_id\n user.user_name ||= \"EMP\"\n user.last_name = obj.name\n user.type_c = type\n #user.email1 = obj.email_address || \"[email protected]\"\n user.email1 = '[email protected]'\n user.status = 'Inactive'\n user.system_generated_password = false\n user.save!\n obj.assigned_user_id = user.id\n obj.save!\n \n populate_user_pool(user, type)\n end", "def set_user\n # @user = User.find_by_name create_params[:user_name]\n @user = User.find_by_name session_params[:user_name]\n end", "def new\n @user = User.new\n end", "def new\n @user = User.new\n end", "def new\n # creates new user object\n @user = User.new\n end", "def create_user\n # first insert into user_secrets and use it's id in users table\n @user_secret = UserSecret.using_client_shard(client: @client).create!(login_salt: @login_salt_hash[:ciphertext_blob])\n\n password_e = User.using_client_shard(client: @client).get_encrypted_password(@password, @login_salt_hash[:plaintext])\n\n @user = User.using_client_shard(client: @client).new(\n client_id: @client_id,\n email: @email,\n password: password_e,\n user_secret_id: @user_secret.id,\n status: GlobalConstant::User.active_status,\n last_logged_in_at: Time.now.to_i\n )\n\n @user.send(\"set_\" + GlobalConstant::User.doptin_mail_sent_property) if @client.is_verify_page_active_for_client?\n @user.save!\n end", "def initialize\n @id = -1\n @login = \"anonymous\"\n @name = \"Some User\"\n end", "def user_create(name='admin', is_admin=true)\n key = \"#{name}:#{is_admin}\"\n UserCache.instance[key] ||= User.find_or_create_by_name(name) do |u|\n u.email_address = \"#{u.name}@concord.org\"\n u.password = u.password_confirmation = \"#{u.name}pAsS\"\n u.state = 'active'\n u.administrator = is_admin\n end\nend", "def initialize\n @user = UserUtility.new\n end", "def create_new_user\r\n touch(\"* id:'#{add}'\")\r\n end", "def set_user\n puts \"STAN THE MANNNNNNNNNNN\"\n @user = User.find(params[:id])\n end", "def bind\n\t\t@user = User.new\n\t\t@auth = Authentication.find(params[:id])\n\t\tif @auth.user_name == params[:name]\n\t\t\[email protected] = params[:name]\n\t\t\[email protected] = @auth.email\n\t\tend\n\t\t@is_new_active = true\n\tend" ]
[ "0.7594177", "0.75789756", "0.75123674", "0.748089", "0.74646574", "0.74579114", "0.7421897", "0.7412031", "0.7401792", "0.738168", "0.73175555", "0.725899", "0.72542506", "0.72282207", "0.72000694", "0.71547115", "0.71502346", "0.7140887", "0.7137462", "0.71234393", "0.7110581", "0.7108652", "0.70912814", "0.70850635", "0.7075231", "0.7068581", "0.70527095", "0.7016766", "0.70128536", "0.7010703", "0.70008636", "0.69814205", "0.6979001", "0.69720167", "0.69692034", "0.6956592", "0.69551337", "0.6946286", "0.6909099", "0.6904361", "0.68969727", "0.6891128", "0.68853426", "0.6884735", "0.6876704", "0.68761426", "0.68761426", "0.68761426", "0.68761426", "0.68761426", "0.68761426", "0.68761426", "0.68761426", "0.68761426", "0.68761426", "0.68761426", "0.68761426", "0.6873821", "0.6873074", "0.68705565", "0.68674797", "0.68613476", "0.68613476", "0.6859067", "0.6853541", "0.6852954", "0.6844632", "0.68436927", "0.6838333", "0.6833184", "0.68323326", "0.6831468", "0.6828119", "0.6827757", "0.68270123", "0.68260837", "0.6825163", "0.6817166", "0.68162626", "0.6811606", "0.68114805", "0.68067664", "0.68067616", "0.6795599", "0.67955124", "0.67891675", "0.67863584", "0.67863584", "0.6782698", "0.6774377", "0.67564523", "0.67499685", "0.6749524", "0.6746003", "0.67375296", "0.6737126" ]
0.69009143
43
Registering a new user when he signup and he/she will automatically get log in
def create @user = User.new(user_params) if @user.save log_in @user flash[:success] = "Prof-Folio welcomes you onboard!" redirect_back_or #redirect_to @user else render 'new' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register()\n\tentry = {\"userid\" => @userid, \"username\" => @username, \"email\" => @email, \"password\" => @password}\n\tDATABASE.newEntry(\"users\", entry)\n\tend", "def sign_up\n @user = User.new\n end", "def register!(user)\n raise \"Already registred\" if user and not user.guest?\n self.user = user and save!\n end", "def register\n @user = User.new\n end", "def register\n if @user.blank? || ([email protected]_registered && @user.tips.count == 0 && @user.votes.count == 0)\n redirect_to :profile, alert: \"Registration Impossible. There is nothing to register\"\n elsif @user.is_registered\n redirect_to :profile, alert: \"Registration Impossible. Account already registered\"\n else\n if @user.register(user_registration_params.to_h)\n #cookies.delete(\"user_id\") #don't delete the cookie, just in case I'm logging in on someone else's device.\n sign_in @user\n redirect_to :profile, notice: \"Account successfully registered. You can now login from anywhere !\"\n else\n redirect_to :profile, alert: \"Registration failed. #{@user.errors.full_messages.to_sentence}\"\n end\n end\n end", "def registration\n \t@user = User.new\n end", "def register\n @user = User.new(user_id: params[:user_id], password: params[:password])\n @user.save\n end", "def signup\n @user = User.new\n end", "def signup\n @user = User.new\n end", "def signup\n return set_session_user_id!(nil, 'Введите данные.') { render :signup_new } if params_valid?(:signup)\n LdapService.mutex.synchronize do\n ldap_result = LdapService.new.add(\n email: params[:email],\n password: params[:password],\n name: params[:name],\n surname: params[:surname],\n role: 'painter'\n )\n return set_session_user_id!(nil, 'Невозможно зарегистрироваться.') { render :signup_new } if ldap_result.blank?\n user = User.find_by(ldap_id: ldap_result[:ldap_id])\n return set_session_user_id!(user.id, 'Вы вошли!') { redirect_to root_url } if user.present?\n user = User.new(ldap_result)\n return set_session_user_id!(user.id, 'Вы вошли!') { redirect_to root_url } if user.save\n set_session_user_id!(nil, 'Возникли проблемы. Попробуйте еще раз.') { render :signup_new }\n end\n end", "def signup!(params)\n self.login = params[:user][:login]\n self.email = params[:user][:email]\n generate_temporary_password!\n save_without_session_maintenance\n end", "def register\n @user = User.new(user_params)\n\n if @user.valid?\n @user.save\n session[:email] = @user.email\n flash[:notice] = 'Welcome.'\n redirect_to :root\n else\n render :action => \"new_user\"\n end\n end", "def register\n if request.post?\n @user.update_attributes params['user']\n if @user.valid?\n after_register\n redirect_to welcome_path and return\n else\n if @user.errors[:email].include?(\"Already Taken\")\n # Look up the already-existing user, set the current tracker to that user, and send them along\n right_user = User.where(:email => @user.email).first\n @tracker.user_id = right_user.id\n cookies[:user_id] = right_user.id\n session[:email_pwd] = params['user']['email_password']\n @user = right_user\n @tracker.log(:existing_user_returned, \"Existing user #{@user.email} got into the landing path again.\")\n increment_page\n redirect_to welcome_path and return\n else\n @tracker.log(:failed_register, \"User creation failed with message: #{@user.errors.full_messages.join(\", \")}\")\n end\n end\n end\n render_path_page\n end", "def signup\n end", "def signup\n end", "def register\n if request.get? then\n @user = User.new\n end\n # Запрос на создание нового пользователя\n if request.post? then\n @user = User.new(params[:user])\n # Если включена регистрация по инвайтам - проверяем правильность введённого кода\n if SiteGlobal.invite_reg && !Invite.valid?(params[:invite]) then\n @user.errors[:base] << \"Invalid invation code\"\n render :register and return\n end\n # Пользователь может создать только аккаунт студента или преподавателя\n render_403 and return unless User.in_user_group?(@user)\n # Если запись успешно создана\n if @user.save then\n # Создание записи в дополнительной таблице\n if @user.student? then\n Student.create(user_id: @user.id)\n elsif @user.lecturer? then\n Lecturer.create(user_id: @user.id, confirm_level: Lecturer::CONFIRM_LEVELS[:unconfirmed])\n end\n if SiteGlobal.invite_reg\n Invite.use(params[:invite])\n end\n login, password = params[:user][:login], params[:user][:password]\n session[:user_id] = User.authenticate(login, password).id\n if @user.lecturer? then\n redirect_to settings_lecturer_path(reg: 1)\n elsif @user.student? then\n redirect_to settings_student_path(reg: 1)\n else\n redirect_to :root\n end\n else\n render :register\n end\n end\n end", "def signup\n @user= User.new\n end", "def sign_up(useremail, password)\n if new_user_available(useremail)\n query = \"INSERT INTO Users (useremail, password) VALUES('#{useremail}', '#{password}')\"\n @connection.exec(query)\n end\n end", "def register\n user = User.new\n if user.save\n @user = user\n else\n @error = 1\n @errors = user.errors\n end\n end", "def sign_up(resource_name, resource)\n # sign_in(resource_name, resource)\n end", "def sign_up\n @user = User.new(user_params)\n if @user.save\n sign_in(@user)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "def signup!(params)\n self.email = params[:user][:email]\n self.name = params[:user][:name]\n self.password = params[:user][:password]\n #save_without_session_maintenance\n end", "def registrar\n if session[:login]\n redirect_to root_path\n else\n @user = User.new\n end\n end", "def signup\n if params[:user]\n if User.exists?(id: params[:user_id])\n #check if the user already exists in database\n flash[:notice] = \"User already exists. Please log in\"\n redirect_to root_path()\n else\n auth_user\n end\n else\n auth_user\n end\n \n end", "def register\n # User inicialized with entry params.\n @user = User.new(params[:user])\n\n # if the user is succesfully saved, authenticate it, and redirect back to /Account.\n respond_to do |format|\n if @user.save\n user = User.authenticate(@user.email, @user.password)\n if user\n format.html { redirect_to account_page_path, notice: 'Account successfully created' }\n session[:user_id] = user.id\n end\n format.html { redirect_to root_path }\n else\n format.html { render action: \"new\" }\n end\n end\n end", "def register_with_password\n pu = params[:user]\n if user = User.find_by_email(pu[:email]) \n # Go ahead and sign the user in if he mistakenly used the signup form to login. But dont bother updating any attributes\n # that area different from the last time he used the sign up screen. \n if pu[:password] == user.password\n set_and_cookie_current_user user\n render :json => {:success => {:user => user}}\n else\n render :json => {:fail => {:email => user.email}}\n end\n else user = User.create!( pu.merge(:status => :active,:app_version => params[:v]) )\n set_and_cookie_current_user user\n render :json => {:success => {:user => user}}\n end \n end", "def signup!(params)\n self.login = params[:user][:login]\n self.email = params[:user][:email]\n save_without_session_maintenance\n end", "def signup!(params)\n self.username = params[:user][:username]\n self.email = params[:user][:email]\n save_without_session_maintenance\n end", "def signup!(params)\n self.username = params[:user][:username]\n self.email = params[:user][:email]\n save_without_session_maintenance\n end", "def attemp_signup\n\n end", "def register!\n raise 'User is already registered!' if registered_at.present?\n self.registered_at = Time.now\n save!\n end", "def registration\n \tif request.post?\n user = User.new(user_params)\n if user.valid?\n user.save\n flash[:notice] = \"Registration Successful. Please Sign In!\"\n redirect_to root_url\n else\n flash[:alert] = user.errors.first[1]\n redirect_to users_registration_url\n end\n \tend\t\n end", "def create\n @user = User.create(params[:user]) \n \n if @user.save\n sign_in @user\n flash[:succeess] = \"Sign up successfully\" \n redirect_to @user\n else\n render 'new'\n end\n \n end", "def register\n # running successfully\n # class_name = params[:user_type].camelize\n # registration_stuff = params[\"#{params[:user_type].to_sym}\"]\n # template = \"#{params[:user_type].pluralize}/new\"\n # save_credentials(class_name, registration_stuff, template)\n\n if(params[:user_type] == 'job_seeker')\n class_name = \"JobSeeker\"\n registration_stuff = params[:job_seeker]\n template = \"job_seekers/new\"\n save_credentials(class_name, registration_stuff, template)\n else\n class_name = \"Employer\"\n registration_stuff = params[:employer]\n template = \"employers/new\"\n save_credentials(class_name, registration_stuff, template)\n end\n end", "def register_user(attributes)\n user = User.new(attributes)\n user.save\n user\n end", "def devise_create_new_rails_user\n build_resource(sign_up_params)\n\n resource.save\n\n yield resource if block_given?\n if resource.persisted?\n if resource.active_for_authentication?\n set_flash_message :notice, :signed_up if is_flashing_format?\n sign_up(resource_name, resource)\n respond_with resource, location: after_sign_up_path_for(resource)\n else\n set_flash_message :notice, :\"signed_up_but_#{resource.inactive_message}\" if is_flashing_format?\n expire_data_after_sign_in!\n respond_with resource, location: after_inactive_sign_up_path_for(resource)\n end\n else\n clean_up_passwords resource\n set_minimum_password_length\n respond_with resource\n end\n end", "def create\n if Feedbunch::Application.config.signups_enabled\n super\n else\n Rails.logger.warn \"Creation of new user attempted, but signups are disabled\"\n redirect_to root_path\n end\n end", "def create\n\t\t@user = User.new(user_params)\n\t if @user.save\n\t sign_in @user\n\t flash[:success] = \"Congratulations! You are now registered and can start playing Lightcycles.\"\n\t redirect_to root_path\n\t end\n\tend", "def sign_up(resource_name, resource)\n redirect_to users_url\n end", "def register(email, password)\n user = User.new\n puts user.register email, password\n end", "def create\n @user = User.new(user_params)\n if @user.save\n flash[:success] = \"Registration was successful!\"\n sign_in @user\n redirect_to root_path\n else\n render 'new'\n end\n end", "def register\n\t\t@user = User.new(user_params)\n\n\t\trespond_to do |format|\n\t\t\tif @user.save\n\n\t\t\t\tformat.html { redirect_to login_path, notice: \"Account created successfully!\" }\n\t\t\telse\n\t\t\t\tformat.html { render action: :create_account }\n\t\t\tend\n\t\tend\n\tend", "def client_sign_up\n\n end", "def signup\n @user = User.new(params[:user])\n return unless request.post?\n if @user.save\n flash[:notice] = \"New user added!\"\n redirect_to :action=>'show', :id=>@user\n end\n end", "def signup\n client.signup(\n params[:user],\n params[:password]\n )\n end", "def new\n @user = User.new\n @is_signup = true\n end", "def sign_up(resource_name, resource)\n # DO NOT sign_in(resource_name, resource)\n end", "def register user\n user_state[user] ||= :idle\n end", "def sign_up(user)\n visit '/users/new'\n # expect(page.status_code).to eq 200\n fill_in :email, with: user.email\n fill_in :username, with: user.username\n fill_in :password, with: user.password\n fill_in :password_confirmation, with: user.password_confirmation\n click_button 'Sign up'\n end", "def create\n @user = User.new(user_params)\n @user.save\n if @user.save\n redirect_to root_path, :notice => \"Signed up!\"\n else\n redirect_to signup_path\n end\n end", "def authenticate_user_with_sign_up!\n unless user_signed_in?\n store_location_for(:user, request.fullpath)\n redirect_to new_user_registration_path, alert: t(\"create_an_account_first\")\n end\n end", "def registrar_usuario\n business_user = User.new\n business_user.email = self.email\n business_user.password = business_user.generar_password\n business_user.client_type = 'empresa'\n business_user.save\n update(user_id: business_user.id, user_created_id: business_user.id)\n #luego de registrar al usuario se almacena la contraseña en la tabla Historypassword\n #donde se almacenaran las 3 ultimas usadas\n password_business = HistoryPassword.new\n password_business.password = business_user.password\n password_business.user_id = business_user.id\n password_business.save\n end", "def registrar_usuario\n employee_user = User.new\n employee_user.email = self.email\n employee_user.password = employee_user.generar_password\n employee_user.username = asignar_username_con_opciones\n if asignar_username_con_opciones.present?\n employee_user.username = asignar_username_con_opciones\n else\n employee_user.username = self.usuario.downcase\n end\n employee_user.client_type = 'empleado'\n employee_user.save\n update(user_id: employee_user.id, user_created_id: employee_user.id) \n #luego de registrar al usuario se almacena la contraseña en la tabla Historypassword\n #donde se almacenaran las 3 ultimas usadas\n password_employee = HistoryPassword.new\n password_employee.password = employee_user.password\n password_employee.user_id = employee_user.id\n password_employee.save\n end", "def sign_up(resource_name, resource)\r\n # Create an account for this user.\r\n account = Account.create(name: \"#{resource.email}'s account\")\r\n \r\n # Sign in the user (from the original Devise::RegistrationsController).\r\n sign_in(resource_name, resource)\r\n end", "def register\r\n @user = User.new\r\n @visit_register = \"true\"\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @user }\r\n end\r\n end", "def new\n @user_signup = User.new\n @is_signup = true\n end", "def registration\n @saas = SETTINGS['saas_registration_mode']\n @user = User.new\n initialize_registration_form\n @errors = {\n :general => [],\n :subjects => [],\n :policies => [],\n :purchase => []\n }\n end", "def sign_up(resource_name, resource)\n true\n end", "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "def sign_up(resource_name, resource)\n end", "def create #sign up button\n @user = User.new(user_params)\n if @user.save\n login(@user)\n redirect_to user_url(@user)\n else\n flash.now[:errors] = @user.errors.full_messages\n render :new\n end\n end", "def sign_up(resource_name, resource)\n true\n end", "def sign_up(resource_name, resource)\n true\n end", "def create\n @user = User.new(user_params)\n\n if @user.create_first\n flash[:message] = t('welcome', scope: 'refinery.authentication.devise.users.create', who: @user)\n sign_in(@user)\n redirect_back_or_default(Refinery::Core.backend_path)\n else\n render :new\n end\n end", "def create\n \t@user = User.new(user_params)\n if @user.save\n redirect_to login_path, notice: \"The registration success, you can login now.\"\n else\n render 'new'\n end\n end", "def create\n @user = User.new(params[:user])\n @user.set_the_password = true\n #@update_pass = 0\n if @user.save\n sign_in @user\n flash[:success] = \"Bienvenido al gestor de usuarios\"\n redirect_to @user\n else\n @title = \"Sign up\"\n render 'new'\n end\n end", "def create\n @user = User.new(params[:user])\n if @user.save\n # we log him in and we redirect to root path\n log_user_in(@user)\n redirect_to root_path, :notice => \"You have successfully signed up.\"\n else\n flash.now[:alert] = \"Cannot sign you up. Sorry for that.\"\n render :new, :status => :unprocessable_entity\n end\n end", "def register(attributes = {})\n user = PublicEarth::Db::User.new(attributes)\n \n if attributes[:username].blank?\n user.errors.add(:username, \"A username is required.\") \n elsif attributes[:username] =~ /[^\\w\\-\\_\\!\\@\\$\\?]/\n user.errors.add(:username, \"A username may only contain letters, numbers or the following characters: -_!@$?\") \n elsif PublicEarth::Db::User.find_by_username(attributes[:username])\n user.errors.add(:username, \"The username #{attributes[:username]} is already taken.\") \n end\n \n if attributes[:email].blank?\n user.errors.add(:email, \"An email address is required.\") \n elsif PublicEarth::Db::User.find_by_email(attributes[:email])\n user.errors.add(:email, \"The email address #{attributes[:email]} is already taken.\") \n end\n\n if attributes[:email] !~ /^[a-zA-Z0-9._%+-]+@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,4}$/ \n user.errors.add(:email, \"A valid email address is required (eg, [email protected]).\")\n end\n \n if attributes[:password].blank?\n user.errors.add(:password, \"A password is required.\") \n elsif attributes[:password] != attributes[:password_confirmation]\n user.errors.add(:password, \"The password and its confirmation don't match.\")\n end\n\n if user.errors.empty?\n begin\n user.attributes = one.create(attributes[:username], attributes[:email], attributes[:password], generate_token)\n rescue\n logger.error(\"Failed to create user account for #{attributes.inspect}: #{$!}\")\n user.errors.add_to_base(\"Unable to create a user account for #{attributes[:username]}.\")\n end\n end\n\n user\n end", "def registration(login, pass, first_name, last_name)\n visit(HomePage)\n on(HomePage).register_element.when_visible($WT).click\n on(RegisterPage).user_login_element.when_visible($WT).send_keys login\n on(RegisterPage).user_password = pass\n on(RegisterPage).user_password_confirmation = pass\n on(RegisterPage).user_firstname = first_name\n on(RegisterPage).user_lastname = last_name\n on(RegisterPage).user_language = 'English'\n on(RegisterPage).user_mail = login + '@dd.dd'\n on(RegisterPage).submit\n end", "def register\n @title=\"Register\"\n if param_posted?(:user)\n \n #output goes to log file (log/development.log in development mode)\n #logger.info params[:user].inspect\n \n #output goes to browser\n #raise params[:user].inspect\n \n @user=User.new(params[:user])\n if @user.save\n @user.login!(session)\n flash[:notice] = \"User #{@user.screen_name} created!\"\n redirect_to_forwarding_url\n else\n @user.clear_password!\n end\n end\n end", "def register\n\t\tif User.where(username: user_params[:username]).present?\n\t\t\trender json: { status: 'error', code: 400, data: @user,\n message: 'User already exists'} \n\t\telse\n\t\t\t@user = User.new(user_params)\n\t\t\tpassword = Digest::SHA1.hexdigest(params[:user][:password])\n\t\t\[email protected]_password = password\n\t\t\[email protected]\n\t\t\trender json: { status: 'success', code: 200, data: @user,\n message: 'User registered successfully'} \n\t\tend\n\tend", "def create\n @user = User.new(user_params)\n if @user.save\n\t sign_in @user unless signed_in?\n\t flash[:success] = \"Signup successful\"\n redirect_to @user\n else\n render 'new'\n end\n end", "def sign_up(resource_name, resource)\n sign_in(resource_name, resource) unless current_user_is_admin?\n end", "def signup\n\n\t\temail = params[:email] # Extract the email from the params of the signup form\n\t\ttimezone = params[:timezone] # Extract the timezone from the params of the signup form\n\n\t\t@url = uniqueUrlKeyGenerator # Generate a unique url key\n\t\told_user = User.find_by_email(email)\n\n\t\t# If user exists\n\t\tif !old_user.nil?\n\t\t # If user is not registered\n\t\t if !old_user.registered?\n\t\t # Send welcome email again and save him\n\t\t old_user.sendWelcomeEmail\n\t\t old_user.save\n\t\t end\n\t\tend\n\n\t\t# Find the user in the user db with the same email as extracted in the params\n\t\tcheck_users = User.find_by_email(email)\n\n\t\t#create a new PotentialUser object with the extarcted email, timezone and url key\n\t\tuser = User.new(email: email, url: @url, timezone: timezone, day: 1, registered: false)\n\n\t\t# If no such user exists\n\t\tif check_users.nil?\n\n\t\t#If the new user is valid and can be saved\n\t\t if user.save\n\t\t user.sendWelcomeEmail\n\t\t @title = \"Thank you for signing up\"\n\t\t @result = \"A confirmation email with instructions has been sent to you\"\n\t\t @result2 = \"Your unique access key is: \" + @url\n\n\t\t#If not valid\n\t\t else\n\t\t #Set @result as the error message\n\t\t @title = \"Looks like something went wrong ...\"\n\t\t @result = \"Email #{user.errors[:email][0]}.\".html_safe\n\t\t end\n\n\t\t#User by this email already exists\n\t\telse\n\n\t\t if !check_users.registered?\n\t\t\t # Result instance variable for the view\n\t\t\t @title = \"Looks like something went wrong ...\"\n\t\t\t @result = \"User by this email already exists, but we sent another confirmation email just in case\"\n\t\t\t else\n\t\t\t @title = \"Looks like something went wrong ...\"\n\t\t\t @result = \"User by this email already exists\"\n\t\t end\n\n\tend\n\n\t\t# Respond to only javascript, set for AJAX\n\t\trespond_to do |format|\n\t\t\tformat.js\n\t\tend\n\tend", "def signup\n @user = User.new(params[:user])\n if @user.save\n redirect_to :controller => 'sessions', :action => 'new'\n else\n render'index'\n flash.now[:error]= \"Sign up failure, please try again.\"\n end\n end", "def create\n @user = User.new(user_params) # Instantiate a new user\n\n if @user.save # If user saves log them in by adding their id to the session hash\n session[:user_id] = @user.id\n redirect_to user_path(@user)\n else\n render 'new', layout: 'welcome' # If user does not save re-render sign up form with errors\n end\n\n end", "def create\n @user = User.new(user_params)\n if @user.save\n sign_in @user, false\n redirect_to users_dash_path, notice: 'User was successfully registered'\n else\n flash[:errors] = @user.errors.full_messages\n redirect_to new_user_path\n end\n end", "def register\n @user = User.new\n @newclient = Client.new\n end", "def create_user_action\r\n user = User.new\r\n response = user.register_user(params[:username], params[:password], params[:password2])\r\n redirect_to controller: 'user', action: 'user_register', message: response\r\n end", "def register_automatically(user, &block)\n # Automatic activation\n user.activate\n user.last_login_on = Time.now\n if user.save\n self.logged_user = user\n flash[:notice] = l(:notice_account_activated)\n redirect_to my_account_path\n else\n yield if block_given?\n end\n end", "def create \n\t\t@user=User.new\n\t\[email protected]=\"native\"\n\t\[email protected]_attributes(signup_params)\n\t\[email protected]!\n\t\tflash[:success]=\"Thanks for joining SPACEF!T, #{@user.name ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\[email protected](\"@\").first }. \"\n\t\tsign_in!(@user, true)\n\t\tredirect_to root_path\n\trescue ActiveRecord::RecordInvalid,\n\t\t\t\t\tActiveRecord::RecordNotUnique => e\n\t\tflash.now[:error]=\"We were not able to sign you up, please correct the following fields\"\n\t\[email protected]\n\t\trender 'new'\n\tend", "def signup\n puts 'signup is happening here'\n permitted = params.require('signup').permit(['email', 'password', 'password_confirmation'])\n @newUser = User.new(permitted)\n if @newUser.save\n head :ok\n else\n render json:{\"reason\": \"could not create user\"}, status: 422\n end\n end", "def create\n @user = User.new(signup_params)\n if @user.save\n session[:user_email][email protected]\n render 'homepage'\n else\n render 'index'\n end\n\n end", "def sign_up(resource_name, resource)\r\n sign_in(resource_name, resource)\r\n end", "def create\n @user = User.new(params[:user])\n if @user.save\n redirect_to root_url, :notice => \"Signed up!\"\n else\n render \"new\"\n end\n end", "def create\n if params[:guest]\n @user = User.create(name_family: \"\", name_first: \"\", name_family_kana: \"\", name_first_kana: \"\", phone_number: \"\",\n handle_name: \"guest#{ SecureRandom.random_number(9999) }\",\n user_status: \"guest\",\n password: SecureRandom.alphanumeric(6), confirmed_at: DateTime.now)\n @user.update(email: \"#{ @user.handle_name }@guest.com\")\n sign_in @user\n flash[:notice] = 'ゲスト会員でログインしました。'\n redirect_to root_path\n return\n end\n @user = User.new(sign_up_params)\n render :new and return if params[:back]\n super\n end", "def create\n cookies.delete :auth_token\n @user = User.new(params[:user])\n @user.save\n if @user.errors.empty?\n self.current_user = @user\n flash[:notice] = \"Thanks for signing up!\"\n redirect_back_or_default root_path\n else\n flash[:error] = \"There was an error during signup\"\n render :action => 'new', :layout => 'login'\n end\n end", "def create\n @user = User.new(user_params)\n # return msg: render json: @user, status: :created\n if @user.save\n reset_session\n log_in @user\n flash[:success] = \"Signup Success, Welcome to Fyber Connect!\"\n redirect_to @user\n else\n render 'new'\n end\n end", "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end" ]
[ "0.76221", "0.7562729", "0.7551277", "0.749038", "0.74826884", "0.7475711", "0.7456268", "0.7438572", "0.7438572", "0.7433637", "0.73860645", "0.73499537", "0.7344879", "0.72918165", "0.72918165", "0.7283061", "0.7279171", "0.72720927", "0.72385484", "0.7196148", "0.71638364", "0.7131554", "0.7123253", "0.7122316", "0.7120067", "0.7109257", "0.7105515", "0.71000004", "0.71000004", "0.70912147", "0.7084377", "0.7073899", "0.7070935", "0.7068138", "0.70671993", "0.70646477", "0.70476586", "0.7046282", "0.70445436", "0.703462", "0.70321304", "0.7029407", "0.7029159", "0.7027965", "0.7023153", "0.70158964", "0.70079803", "0.70042014", "0.6994075", "0.6991868", "0.6986828", "0.6983264", "0.6974467", "0.6973796", "0.697357", "0.69729304", "0.6970531", "0.69610786", "0.69547725", "0.69507194", "0.6946315", "0.69301444", "0.69301444", "0.6927096", "0.6926907", "0.6924506", "0.6921437", "0.6910115", "0.69033533", "0.69020206", "0.68944126", "0.68855196", "0.6879948", "0.6875238", "0.68717134", "0.686528", "0.6861534", "0.6850043", "0.68469584", "0.6845054", "0.68415594", "0.6828923", "0.6827407", "0.682731", "0.68261486", "0.6822429", "0.68209827", "0.68205655", "0.6816013", "0.6816013", "0.6816013", "0.6816013", "0.6816013", "0.6816013", "0.6816013", "0.6816013", "0.6816013", "0.6816013", "0.6816013", "0.6816013", "0.6816013" ]
0.0
-1
when a user wants to edit his/her profile, this method is called
def edit @user = User.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_profile_edit\n\n\n end", "def edit_profile\n end", "def edit_profile\n \t@user = current_user\n end", "def profile_edit\n @user = User.find(current_user.id)\n end", "def edit\n @user = current_user\n @profile = current_user.profile\n end", "def edit\n\t\t@user = User.find( params[:user_id] )\n\t\t@profile = @user.profile\n\tend", "def edit\n @user.profile ||= Profile.new\n @profile = @user.profile\n end", "def edit\n @profile = Profile.find(current_user.id)\n end", "def edit\n @user = User.find(params[:user_id])\n @profile = @user.profile\n \n end", "def edit\n if current_profile!=@profile\n redirect_to root_url, notice: 'Permission denied'\n end\n end", "def edit\n @title = \"Edit Profile\"\n @user = current_user\n @user.profile ||= Profile.new\n @profile = @user.profile\n if param_posted?(:profile)\n if @user.profile.update_attributes(params[:profile])\n flash[:notice] = \"Changes saved.\"\n # redirect_to :controller => \"profile\", :action => \"index\"\n end\n end\n end", "def edit\n @user = User.find (params[:user_id])\n @profile = @user.profile\n end", "def edit\n\t\t#Find the Particular Profile\n\t\t@surgeon_profile = @profile\n\tend", "def edit\n @help = PageContent.find_by_name(\"profile-help\") # \"What to include in profile\" Content\n @presenter = find_presenter\n @presenter_profile = @presenter.presenter_profile\n if @presenter_profile.nil?\n redirect_to new_presenter_profile_path(@presenter)\n end\n #displays current profile information for editing \n if !@presenter_profile.bio_edit.nil?\n if @presenter_profile.approved? && @presenter_profile.bio_edit.empty?\n @presenter_profile.bio_edit = @presenter_profile.bio\n end\n else\n if @presenter_profile.approved?\n @presenter_profile.bio_edit = @presenter_profile.bio\n end\n end\n end", "def edit\n set_user\n end", "def edit\n authorize! :edit, @profile\n end", "def edit\n user = User.find(params[:user_id])\n @profile = user.profile\n end", "def edit\n @user.build_user_profile unless @user.user_profile\n end", "def edit_profile\n @user = User.find params[:id]\n end", "def edit\n @profile = User.find(params[:id])\n end", "def edit_current_user\n end", "def edit\r\n jump_to(\"/profiles/#{session[:account_id]}/basic\")\r\n end", "def edit\n @profile = @author.profile\n end", "def edit\n #set @profile to the current profile, which was linked from the home index view\n @profile = Profile.find(params[:id]) \n end", "def edit_profile\n \t@user = UsersService.findUserById(params[:id])\n \tuser = UsersService.findUserById(params[:id])\n \t@user_profile_form = UserProfileForm.new(UserProfileForm.attributes(user, :edit_profile))\n end", "def edit\n\t\t\t@user = User.find(params[:id])\n\t\t\t@jobseeker1 = Jobseeker.find_by(:user_id => @user.id)\n\n\t\tif @jobseeker1\n\t\t\t@jobseeker = @jobseeker1\n\t\t\t@title = \"Edit Profile\"\n\t\telse\n\t\t\tflash[:notice] = \"we don't have your profile yet, create one!\"\n\t\t\t#don't use render 'new' because it refers to @jobseeker from this action(and in this section of action, its nil.)\n\t\t\tredirect_to new_jobseeker_path\n\t\tend\n\t\t\n\tend", "def edit\n redirect_to action: 'edit_profile'\n end", "def edit\r\n \t@user = current_user\r\n end", "def edit\n require_user\n end", "def edit\n get_user_for_edit\n end", "def update\n if conditionally_update\n handle_successful_update\n redirect_to hyrax.dashboard_profile_path(@user.to_param), notice: \"Your profile has been updated\"\n else\n redirect_to hyrax.edit_dashboard_profile_path(@user.to_param), alert: @user.errors.full_messages\n end\n end", "def edit\n # Listing 9.14: Finding the correct user is now handled by the correct_user before_action.\n end", "def edit\n redirect_to root_url and return unless current_user\n @user = current_user\n end", "def edit\n @user.build_profile if @user.profile.blank?\n end", "def edit\n \t@user = current_user\n end", "def confirm!\n # add if else here in case user already existed and is updating/changing data (email etc),\n # shouldn't add_profile again if profile already exists. can determine with a user db 'nil' value...\n unless self.profile\n add_profile\n end\n super\n end", "def update\n if current_user.user_profile\n @user_profile=UserProfile.find(params[:id])\n @user_profile.update_attributes(params[:user_profile])\n flash[:notice]= t(:edit_profile)\n else\n @user_profile = UserProfile.new(params[:user_profile])\n @user_profile.user_id = current_user.id if !current_user.is_admin?\n @user_profile.save\n flash[:notice]= t(:new_profile)\n end\n redirect_to(:action=>\"edit\") \n end", "def update\n # Button press on edit page\n\n # Read the user and update the attributes (don't save at this point)\n @user = User.find(params[:id])\n render_error h \"Der Spezialbenutzer #{@user.username} kann nicht editiert werden.\" and return if @user.special?\n @user.attributes=params[:user] if params[:user]\n\n # Subpages\n select_person and return if params['select_person']\n\n if params['commit']\n # 'Save' button\n render 'edit' and return if [email protected]\n\n flash[:notice] = \"Der Benutzer #{@user.username} wurde gespeichert.\"\n redirect_to_origin(default=@user)\n return\n end\n\n render 'edit'\n end", "def edit\n # @user = User.find(params[:id])\n # already in correct_user\n end", "def update\n @user = User.find( params[:user_id] ) #establish which user profile we are editing \n @profile = @user.profile #store user profile data in @profile variable \n if @profile.update_attributes(profile_params) # checking in db if data is updated\n flash[:success] = \"Profile Updated!\"\n redirect_to user_path( params[:user_id] ) # display the edited profile\n else\n render action: :edit #redirecting user to edit page\n end\nend", "def edit\n @user = current_user\n end", "def edit\n @page_title = \"Edit Translation\"\n @nav = 'user/profile'\n \n end", "def update\n @user = User.find(current_user.id)\n @profile = @user.profile\n \n if @profile = params[:profile]\n redirect_to user_profile_path(current_user.name)\n else\n redirect_to edit_user_profile_path\n end\n end", "def update_user_profile(profile_form)\n isUpdateProfile = UserService.updateProfile(profile_form)\n if isUpdateProfile\n redirect_to users_path\n else\n asdasd\n render :edit_profile\n end\n end", "def edit\n\t\tif !current_user || !is_this_user\n\t\t\tredirect_to user_path(params[:id])\n\t\tend\n\tend", "def update\n @profile = Profile.find(params[:id])\n\t\t\n\t\t# Check to see if this user matches the profile, if not don't let them do anything\n\t\tif @profile.id != Profile.find_by_user_id(current_user.id).id\n \tredirect_to :permission_error\n end\n\t\t\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n flash[:notice] = 'Your profile was successfully updated'\n format.html { render action: 'edit', notice: 'Profile was successfully updated' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def person_profile_edit\n @category = EventCategoryMaster.find_category\n show_interest_data();\n @state1 = State.find_state(@location.country_id)\n respond_to do |format|\n format.html {render :editing_user_profile}\n format.xml { render :xml => @user }\n end\n end", "def edit\n # @user = User.find(params[:id]) -- not needed bc of correct_user\n end", "def authorize_user\n @profile = current_user.profile\n return if @profile\n flash[:alert] = \"You can only edit your own profile\"\n redirect_to profile_path\n end", "def edit\n \n # Pass through the specified user, making sure that it exists\n @user = User.find_by_login(params[:user_login])\n \n # Check that the current user is the specified user, or an\n # administrator\n unless @user == current_user or admin_logged_in?\n flash[:error] = 'You cannot edit the profile of another user.'\n redirect_to :controller => 'sessions', :action => 'new'\n else\n render :layout => 'dialog'\n end\n end", "def edit\n @title = \"sipbib: edit profile\"\n @user = User.find(session[:user_id])\n @user.spec ||= Spec.new\n @spec = @user.spec\n \n if param_posted?(:spec)\n if @user.spec.update_attributes(params[:spec])\n flash[:notice] = \"Changes saved.\"\n redirect_to :controller => \"user\", :action => \"index\"\n end\n end\n end", "def update\n # Retrieve user from the database\n @user = User.find(params[:user_id])\n # Assign user profile to an instance variable\n @profile = @user.profile\n # Mass assign edited profile attributes and save. \n if @profile.update_attributes(profile_params)\n flash[:success] = \"Profile updated!\"\n # Redirect to profile page. \n redirect_to user_path(id: params[:user_id])\n else\n # TODO: don't dump the user's inputs if save to database fails. \n render action: :edit\n end\n end", "def update\n if current_user.update(user_params)\n redirect_to current_user, notice: t(\"profile.updated\")\n else\n render \"edit\"\n end\n end", "def update\n unless current_user == @user.user\n respond_to do |format|\n format.html { redirect_to profiles_path, alert: 'You have improper permissions to edit this profile.' }\n format.json { head :no_content }\n end\n return\n end\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to profile_path, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def edit\n @user = current_user\n end", "def edit\n @user = current_user\n end", "def edit\n @user = current_user\n end", "def edit\n @user = current_user\n end", "def edit\n @user = current_user\n end", "def edit\n @user = current_user\n end", "def edit\n @user = current_user\n end", "def edit\n @user = current_user\n end", "def edit\n @user = current_user\n end", "def edit\n @user = current_user\n end", "def edit\n @user = current_user\n end", "def user_edits\n redirect_to home_path if current_user != User.find(params[:id])\n end", "def set_profile\n @profile = current_user\n end", "def edit\n @user = User.all.deep.find(current_user.id)\n authorize! :edit, @user\n\n render 'users/settings'\n end", "def set_profile\n @user = current_user\n @profile = @user.profile\n end", "def edit_profile\n @user = UserService.getUserById(params[:id])\n @profile_form = ProfileForm.new(ProfileForm.initialize(@user, :new_profile))\n end", "def edit\n enforce_update_permission(@user)\n end", "def edit_user\n redirect_to(root_url) unless current_user.edit?\n end", "def update\n if current_user.update(user_params)\n redirect_to user_path(current_user), notice: 'Your profile was successfully updated.'\n else\n render :edit\n end\n end", "def edit\n @update_welcome = 'You have accessed the update page'\n @user = User.find(params[:id])\n\n end", "def update\n @profile = Profile.find_by_user_id params[:user_id]\n\n if @profile.update_attributes(params[:profile])\n redirect_to user_profile_path(params[:user_id])\n else\n flash[:alert] = @profile.errors.full_messages.join(\",\")\n render :template => \"profiles/edit\"\n end\n\n end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit\n @user = @current_user\n end", "def edit\n \n end", "def update\n if @current_user.id == params[:id].to_i && \\\n @current_user.update_attributes(params[:user])\n flash[:success] = \"profile was successfully updated\"\n redirect_to individual_path(@current_user.id)\n else\n flash[:error] = \"update error, please try again\"\n @user = @current_user\n render(:action => \"edit\")\n end\n end", "def edit\n @user = User.find_by_id(params[:id])\n logged_in_user = session[:user_hash][\"username\"]\n if logged_in_user != @user.sunet and not \n User.is_power_user(logged_in_user)\n # permission denied\n flash[:error] = \"Your privileges don't allow you to edit profiles other than your own.\"\n redirect_to \"/users#/users/\"\n end\n @photos = Photo.find_all_by_user_id(params[:id])\n end", "def edit\n @user = User.find_by_id(params[:id])\n logged_in_user = session[:user_hash][\"username\"]\n if logged_in_user != @user.sunet and not \n User.is_power_user(logged_in_user)\n # permission denied\n flash[:error] = \"Your privileges don't allow you to edit profiles other than your own.\"\n redirect_to \"/users#/users/\"\n end\n @photos = Photo.find_all_by_user_id(params[:id])\n end" ]
[ "0.8617056", "0.86120033", "0.82008135", "0.8016178", "0.7738562", "0.7729312", "0.77285355", "0.7679579", "0.7618866", "0.76187533", "0.761339", "0.75926447", "0.7590888", "0.7582732", "0.75766", "0.7575096", "0.75680983", "0.7422893", "0.73935074", "0.7380267", "0.73668516", "0.73475206", "0.7345474", "0.73436373", "0.73237777", "0.73181844", "0.7278226", "0.7248688", "0.7240323", "0.72124994", "0.7176538", "0.71471775", "0.7139018", "0.7118088", "0.71172154", "0.7090794", "0.7085405", "0.7076283", "0.70663524", "0.7059191", "0.70547473", "0.70528513", "0.7042939", "0.70166165", "0.7009042", "0.7008499", "0.69963473", "0.698424", "0.6982366", "0.6961185", "0.6955506", "0.695199", "0.6941904", "0.69369787", "0.6934001", "0.6934001", "0.6934001", "0.6934001", "0.6934001", "0.6934001", "0.6934001", "0.6934001", "0.6934001", "0.6934001", "0.6934001", "0.69299996", "0.6928081", "0.69236404", "0.6913411", "0.69096357", "0.6907372", "0.69029236", "0.69007987", "0.68993765", "0.68979174", "0.6890433", "0.6890433", "0.6890433", "0.6890433", "0.6890433", "0.6890433", "0.6890433", "0.6890433", "0.6890433", "0.6890433", "0.6890433", "0.6890433", "0.6890433", "0.6890433", "0.6890433", "0.6890433", "0.6890433", "0.6890433", "0.6890433", "0.6890433", "0.6890433", "0.68878675", "0.6886978", "0.6886071", "0.68858683", "0.68858683" ]
0.0
-1
before filters comfirms a logged in user for security
def logged_in_user unless logged_in? store_location flash[:danger] = "Please log in." redirect_to login_url end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_filters\n set_user\n authorize\n end", "def before_filter\n if current_user\n true\n end\n end", "def current_user_required\n\t\t# Have to add \".filter(self)\" when not in before_filter line.\n\t\tCASClient::Frameworks::Rails::Filter.filter(self)\n\tend", "def before_filter; end", "def signed_in_user_filter\n if signed_in?\n redirect_to root_path, notice: \"Already logged in\"\n end\n end", "def login_filter\n\t\tif not protect?( action_name )\n\t\t\treturn true \n\t\tend\n\n\t\tif not session[:user_id]\n\t\t\t# user isn't logged in\n\t\t\tstore_location\n\t\t\tredirect_to :controller=>\"account\", :action=>\"login\"\n\t\t\treturn false\n\t\tend\n\n\t\t# initialize the @user variable\n\t\t@user = User.find( session[:user_id] )\n\t\t\n\t\tif not @user.validated?\n\t\t\t# user is logged in, but they haven't been validated\n\t\t\tredirect_to :controller=>\"account\", :action=>\"not_activated\"\n\t\t\treturn false\n\t\telsif not authorized?( @user, action_name )\n\t\t\t# user is logged in and validated, but not authorized\n\t\t\tredirect_to :controller=>\"account\", :action =>\"denied\"\n\t\t\treturn false\n\t\telse\n\t\t\t# user is logged in AND validated AND authorized! let 'em in!\n\t\t\treturn true\t\n\t\tend\n\n\t\t# we shouldn't get here\n\t\traise \"Serious malfunction in 'login_filter' -- please contact manufacturer ([email protected])...\"\n\tend", "def set_user\n\n if params[:id] == current_user.object_key\n @user = User.find_by(:object_key => params[:id])\n elsif FILTERS_IGNORED\n @user = User.unscoped.find_by(:object_key => params[:id])\n\n if @user.nil?\n redirect_to '/404'\n end\n else\n @user = User.unscoped.find_by(:object_key => params[:id], :organization_id => @organization_list)\n\n if @user.nil?\n if User.find_by(:object_key => params[:id], :organization_id => current_user.user_organization_filters.system_filters.first.get_organizations.map{|x| x.id}).nil?\n redirect_to '/404'\n else\n notify_user(:warning, 'This record is outside your filter. Change your filter if you want to access it.')\n redirect_to users_path\n end\n end\n\n end\n\n return\n end", "def reset_filter!\n skip_before_action(:filter_access_filter) if method_defined?(:filter_access_filter)\n before_action :filter_access_filter\n end", "def filters_for_user(user)\n user.present? ? filters_with_external : public_filters\n end", "def filter_user_is_registered\n unless( user_is_registered)\n redirect_to_login\n end\n end", "def before_filter(&block)\n @before_filter = block\n end", "def check_user_before_action\n @blog = Blog.find(params[:id])\n if (current_user != @blog.user) and (@blog.global == false)\n redirect_to({ action: \"index\" }, notice: \"You don't have sufficient permissions\")\n\n end\n end", "def set_filters\n @filters = @user.user_filters\n @filter = UserFilter.new\n @parent = @user\n end", "def filtered_list\n if !(current_user.belongs_to_common_pool || current_user.belongs_to_back_office)\n @lawfirms = []\n @assigned_lawfirm_users.each do |lawyer|\n @lawfirms << lawyer.company if lawyer.company\n end\n @lawfirms.uniq!\n @logged_by_users = [[\"----livians----\",\"\"]]\n @logged_by_users += @cluster_livian_users.collect{|livian|[livian.full_name,livian.id]}\n @logged_by_users << [\"----lawyers----\",\"\"]\n @logged_by_users += @assigned_lawfirm_users.collect{|lowyer|[lowyer.full_name,lowyer.id]}\n @lawyers = (params[:search].present? && params[:search][:company_id].present?) ? get_company_lawyers(current_user,params[:search][:company_id],\"communications\") : @assigned_lawfirm_users\n else\n filtere_list_for_cp_or_bo\n end\n end", "def before_filter(&block)\n @before_filter = block\n end", "def user_params\n admin_access? && admin_user_filter || normal_user_filter\n end", "def force_auth\n\t\tlogger.debug \" Callback: force_auth\"\n\t\tsession[:last_ts] = nil\n\t\tCASClient::Frameworks::Rails::Filter.filter self unless @current_user\n\tend", "def filter_request(request)\n @token.authenticate(request)\n end", "def owner_required\n ## before filter for owner of channel. \n if logged_in? && current_user.login == THUMBWEBS_AUTHORIZED_USER\n return true\n else\n flash[:error] = \"Unauthorized Access-Must be logged-in as owner.\"\n redirect_to thumbwebs_root_path\n end\nend", "def after_filter; end", "def add_filter\n @filter = true \n end", "def filter_access!\n treat_as get_current_role\n end", "def authenticate\n CASClient::Frameworks::Rails::Filter.before(self)\n update_current_user(User.eager_load(*eager_loads).find_by(cas_directory_id: session[:cas_user]))\n\n return unless session[:cas_user] && !allow_access\n render(file: File.join(Rails.root, 'public/403.html'), status: :forbidden, layout: false)\n end", "def data_context_filter_1\r\n\r\n ckie = (RUBY_VERSION =~ /^1.8/) ? Iconv.new('UTF-8//IGNORE', 'latin1').iconv(cookies[:active_filters] || \"\") : (cookies[:active_filters] || \"\").force_encoding(Encoding::ISO_8859_1).encode!(Encoding::UTF_8)\r\n if !ckie.blank?\r\n find_hash = User.named_scope_active_filter_method(ActiveSupport::JSON.decode(ckie))\r\n conds = find_hash[:conditions]\r\n @joins_fields = find_hash[:joins]\r\n\r\n User.send(:with_scope, {:find => {:conditions => conds, :joins => (@joins_fields || [])}}) {\r\n yield\r\n }\r\n\r\n else\r\n yield\r\n end\r\n end", "def global_filter; end", "def filter_users\n allowed_keys=[\"email\", \"admin\"]\n filtering_keys=allowed_keys & params.keys\n filtering_keys.each {|key| filter_by_key(key)}\n end", "def before(*args, &block)\n add_filter :before, &(args.empty? ? block : construct_filter(*args, &block))\n end", "def before filter\n @station.before filter\n end", "def filter_redirect; end", "def filter_redirect; end", "def authorize!(current_user)\n RailsMiniProfiler::User.current_user = current_user\n end", "def before(handler = nil, *guards, &block)\n client.register_filter :before, handler, *guards, &block\n end", "def pre_authorize_cb; end", "def pre_authorize_cb=(_arg0); end", "def filter_by_schedule()\n return if authorise_for_web(program_name?,'read') == false\n render_filter_by_schedule\n end", "def filter\n super\n end", "def filter_object\n # redirect_to(root_url, :notice => \"Do not have permission\") and return\n end", "def apply_filter\n end", "def filter_self\n if @user && !current_user.can_edit?(@user)\n respond_to do |format|\n format.html {\n render :nothing => true, :status => 403\n }\n format.json {\n render :json => {:status => 'failure'}, :status => 403\n }\n end\n end\n end", "def before_dispatch(env); end", "def before_filter(filter_name, options)\n [options[:only]].flatten.each do |action|\n add_filter(filter_name, action)\n end\n end", "def before method_or_filter, options={}, &block\n _add_filter(:before, method_or_filter, options, block)\n end", "def before_request\n self.login if require_login? && !@authenticating\n end", "def process_before_filter name\n filter = find_method name, @current_class\n\n if filter.nil?\n Brakeman.debug \"[Notice] Could not find filter #{name}\"\n return\n end\n\n method = filter[:method]\n\n if ivars = @tracker.filter_cache[[filter[:controller], name]]\n ivars.each do |variable, value|\n env[variable] = value\n end\n else\n processor = Brakeman::AliasProcessor.new @tracker\n processor.process_safely(method.body_list, only_ivars(:include_request_vars))\n\n ivars = processor.only_ivars(:include_request_vars).all\n\n @tracker.filter_cache[[filter[:controller], name]] = ivars\n\n ivars.each do |variable, value|\n env[variable] = value\n end\n end\n end", "def filter\n\tfilter_disabled\n\tfilter_repeated\n\tfilter_silenced\n\tfilter_dependencies\n end", "def filters\n end", "def scope\n return super if spree_current_user.present?\n\n super(skip_cancancan: true)\n end", "def filters; end", "def filters; end", "def restrict_users\n \t\tif user_signed_in?\n \t\t\tif current_user.has_role? :client\n \t\t\t\tif current_user.profile.agreed == nil\n \t\t\t\t\tredirect_to edit_profile_path(current_user.profile)\n \t\t\t\tend\n \t\t\tend\n\n \t\tend\n\n \tend", "def parametrizr_user\n current_user\n end", "def authenticate_scope!\n \n \n do_before_request \n\n end", "def check_if_user_access\n if current_user && current_user.admin?\n @all_orders = Order.all\n @orders = @all_orders.paginate(page: params[:page])\n elsif current_user && current_user.role == \"Partner\"\n redirect_to root_path\n flash[:danger] = I18n.t 'flash.your_company_not_verified'\n elsif current_user && current_user.role == \"Client\"\n @all_orders = @user_company.orders\n @orders = @all_orders.paginate(page: params[:page])\n else\n end\n end", "def set_user_filter(user_url, filter_url)\n user_filter = {\n \"userFilters\" => {\n \"items\" => [\n {\n \"user\" => user_url,\n \"userFilters\" => [ filter_url ]\n }\n ]\n }\n }\n GoodData.post \"/gdc/md/#{@project_id}/userfilters\", user_filter\n end", "def user_actions(user)\n can_act_as_logged_in_user(user) unless Revs::Application.config.restricted_beta # also have logged in privileges if we are not in beta\n end", "def index\n @user_filter = UserFilter.new(UserFilter.params(params))\n @users, @pagination_collection = current_user.list_users(params[:page], @user_filter)\n # Determines when the find functionality is executed in index page of financial transactions\n @on_filter_find = !params[:user_filter].nil?\n end", "def users_only\n deny_access(\"Necesitas crear una cuenta para entrar a esta sección\") unless signed_in?\n end", "def require_no_user(options = {})\n self.before_filter options do |controller|\n controller.send(:require_no_user)\n end\n end", "def filter\n end", "def before_each(req)\n if dealership(req).nil? then not_found\n elsif !authenticated?(req) then unauthenticated\n elsif !authorized?(role(req), session_user(req)) then unauthorized\n else super\n end\n end", "def filtered_list\n if !(current_user.belongs_to_common_pool || current_user.belongs_to_back_office)\n @lawfirms = []\n company_ids = @assigned_lawfirm_users.map(&:company_id).uniq\n @lawfirms = Company.find(company_ids)\n @lawyers = (params[:search].present? && params[:search][:company_id].present?) ? get_company_lawyers(current_user,params[:search][:company_id],\"user_tasks\") : @assigned_lawfirm_users\n else\n filtered_list_for_cp_or_bo\n end\n end", "def authorize\n \t\t#teste http://localhost:3000/products/2/who_bought.atom\n \t\t#ou curl --silent --user dave:secret http://localhost:3000/products/2/who_bought.atom \n \t\treturn if User.count.zero?\n\n \t\tif request.format == Mime[:html]\n \t\t\tuser = User.find_by(id: session[:user_id])\n \t\telse\n \t\t\tuser = authenticate_or_request_with_http_basic do |u,p|\n \t\t\t\tUser.find_by_name(u).try(:authenticate, p)\n \t\t\tend\n \t\tend\n\n \t\tredirect_to login_url, notice: \"Please log in\" unless user\n \t\t\n \tend", "def set_logged_in_user_in_audit_module\r\n\t AuditModule.set_current_user=(current_user)\r\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 before(&b)\n filter :before, &b\n end", "def apply_user_filter\n return if params[:author].blank?\n User.find(params[:author]).tap do |user|\n @posts = @posts.where author: user\n add_breadcrumb \"by author \\\"#{user.humanize}\\\"\"\n end\n end", "def authorize\n if !logged_in? || current_user.nil?\n redirect '/login'\n else\n @user = current_user\n @user_chores = current_user.chores\n @user_gadgets = current_user.gadgets\n end\n end", "def index\n params['filters'] ||= 'volunteers'\n @users = case params['filters']\n when 'all'\n User.all.order(created_at: :asc)\n when 'team'\n User.where(admin: true).order(created_at: :asc)\n when 'volunteers'\n User.where(active: true, admin: nil, organization_id: nil).order(created_at: :asc)\n when 'org'\n User.where(active: true).where.not(organization_id: nil).order(created_at: :asc)\n when 'inactive'\n User.where(active: false).order(created_at: :asc)\n end\n authorize @users\n end", "def login_required\n # Skip this filter if the requested action is not protected\n return true unless protect?(action_name)\n\n # Check if user is logged in and authorized\n return true if logged_in? and authorized?(current_user)\n\n # Store current location so that we can redirect back after login\n store_location\n\n # Call access_denied for an appropriate redirect and stop the filter\n # chain here\n access_denied and return false\n end", "def authorize_user\n # simple authorization: kick out anonymous users from backend actions\n=begin\n if !current_user\n redirect_back_or_default(home_page) and return if action_name =~ /index|edit|update|destroy/\n \n # skip checking permission if user is an admin\n elsif !current_user.has_role?('Admin')\n unless current_user.has_permission?(controller_name, action_name, params)\n flash[:warning] = 'Access Denied'\n redirect_back_or_default(home_page) and return\n end\n end\n=end\n end", "def castle_filter\n return unless resource_class.castle_hooks[:before_registration]\n\n response = CastleDevise.sdk_facade.filter(\n event: \"$registration\",\n context: CastleDevise::Context.from_rack_env(request.env, resource_name)\n )\n\n return if CastleDevise.monitoring_mode?\n\n case response.dig(:policy, :action)\n when \"deny\"\n set_flash_message!(:alert, \"blocked_by_castle\")\n flash.alert = \"Account cannot be created at this moment. Please try again later.\"\n redirect_to new_session_path(resource_name)\n false\n else\n # everything fine, continue\n end\n rescue Castle::InvalidParametersError\n # TODO: We should act differently if the error is about missing/invalid request token\n # compared to any other validation errors. However, we can't do this with the\n # current Castle SDK as it doesn't give us any way to differentiate these two cases.\n CastleDevise.logger.warn(\n \"[CastleDevise] /v1/filter request contained invalid parameters.\" \\\n \" This might mean that either you didn't configure Castle's Javascript properly, or\" \\\n \" a request has been made without Javascript (eg. cURL/bot).\" \\\n \" Such a request is treated as if Castle responded with a 'deny' action in\" \\\n \" non-monitoring mode.\"\n )\n\n unless CastleDevise.monitoring_mode?\n set_flash_message!(:alert, \"blocked_by_castle\")\n redirect_to new_session_path(resource_name)\n false\n end\n rescue Castle::Error => e\n # log API errors and allow\n CastleDevise.logger.error(\"[CastleDevise] filter($registration): #{e}\")\n end", "def add_terms_filters\n add_work_type_filter\n add_user_filter\n add_pseud_filter\n add_collection_filter\n end", "def filtere_list_for_cp_or_bo\n @lawyers,@lawfirms=[],[]\n if is_secretary?\n created_by_user_ids=@assigned_lawfirm_users.map(&:id)\n created_by_user_ids << current_user.id\n notes = Communication.notes_for_secretary(created_by_user_ids,current_user.id)\n else\n livian_ids = @cluster_livian_users.map(&:id)\n livian_ids = [0] if livian_ids.blank?\n lawyer_ids = @assigned_lawfirm_users.map(&:id)\n lawyer_ids = [0] if lawyer_ids.blank?\n notes = Communication.notes_for_manager(lawyer_ids,livian_ids)\n end\n company_ids = notes.map(&:company_id).uniq\n @lawfirms = Company.find(company_ids)\n if params[:search].present? && params[:search][:company_id].present?\n @lawyers = get_company_lawyers(current_user,params[:search][:company_id],\"communications\")\n else\n user_ids = notes.map(&:assigned_by_employee_user_id).uniq\n @lawyers = User.find(user_ids)\n end\n \n if is_team_manager\n @logged_by_users = [[\"----livians----\",\"\"]]\n @logged_by_users += @cluster_livian_users.collect{|livian|[livian.full_name,livian.id]}\n @logged_by_users << [\"----lawyers----\",\"\"]\n @logged_by_users += @lawyers.collect{|lowyer|[lowyer.full_name,lowyer.id]}\n end\n end", "def songs_filter\n\t\treturn unless self.controller_name == \"songs\"\n\t\tif !current_user.is_admin\n\t\t\tflash[:notice] = \"Sorry, you can't visit this page unless you're an administrator.\"\n\t\t\tredirect_to user_home_path(current_user)\n\t\telse\n\t\t\treturn\n\t\tend\n\tend", "def limit_by_user_if_personal(solr_params)\n if(@type == 'personal')\n solr_params[:fq] ||= []\n solr_params[:fq] << \"depositor_tesim:\\\"#{current_user.username}\\\"\"\n end\n end", "def authorize_author\n redirect_to '/login' unless self.user_access > 1 || current_user.access == 3\n end", "def set_user_and_verify #TODO: Make this common to both items and tags\n @user = User.find_by(id: params[:user_id])\n if @user.blank?\n head :forbidden\n end\n end", "def show_only_resources_deposited_by_current_user(solr_parameters)\n user_id = ::User.where(uid: current_user_key).first.id\n usergroup = Role.select('name').joins(:roles_users).where('roles_users.user_id = ?', user_id)\n solr_parameters[:fq] ||= []\n unless usergroup.map { |role| role.name }.include? 'admin'\n solr_parameters[:fq] += [\n ActiveFedora::SolrQueryBuilder.construct_query_for_rel(depositor: current_user_key)\n ]\n end\n end", "def before_action \n end", "def conditions_for_collection\n ['frms.usr_id = ?', [session[:usr_id]]]\n end", "def destroy_filter\n not actuale?\n end", "def list_filter_authorized?\n authorized_for?(:action => :read)\n end", "def before_dispatch(_env)\n end", "def context; { user: current_user } end", "def check_if_user_access_transactions\n if current_user && current_user.admin?\n @transactions = Transaction.paginate(page: params[:page])\n elsif current_user && current_user.role == \"Partner\"\n redirect_to root_path\n flash[:danger] = I18n.t 'flash.your_company_not_verified'\n end\n end", "def authorize_user\n unless current_user.id == @profile.user_id\n flash[:unauthorized] = \"Not authorized\"\n redirect_to listings_path\n end \n end", "def filtering_ids\n return nil unless current_user\n\n return @filtering_ids if @filtering_ids\n\n @filtering_ids = Rails.cache.read cache_ids_key\n end", "def authorized_by(user)\n user.id == self.id\n end", "def data_context_filter_1\r\n\r\n ckie = (RUBY_VERSION =~ /^1.8/) ? Iconv.new('UTF-8//IGNORE', 'latin1').iconv(cookies[:active_filters] || \"\") : (cookies[:active_filters] || \"\").force_encoding(Encoding::ISO_8859_1).encode!(Encoding::UTF_8)\r\n if !ckie.blank?\r\n find_hash = DevFeedback.named_scope_active_filter_method(ActiveSupport::JSON.decode(ckie))\r\n conds = find_hash[:conditions]\r\n @joins_fields = find_hash[:joins]\r\n\r\n DevFeedback.send(:with_scope, {:find => {:conditions => conds, :joins => (@joins_fields || [])}}) {\r\n yield\r\n }\r\n\r\n else\r\n yield\r\n end\r\n end", "def show \n #if current_user.company_id == @user.company_id \n authorize @user \n end", "def check_user_before_membership\n if current_user\n ncm_membership = current_user.get_membership(@mother)\n epicenter = Epicenter.find_by_slug(params['epicenter_id'])\n\n if epicenter != @mother and not ncm_membership\n session[:new_ncm_membership] = { \n :epicenter_id => params['epicenter_id'], \n :membership_id => params['membership_id'],\n :t => Time.now\n }\n #\n redirect_to new_epicenter_subscription_path(@mother)\n end\n else\n # it's possible that we can put the logic from \"authenticate\" method below here\n redirect_to epicenters_path\n end\n end", "def filter_parameters; end", "def filter_parameters; end", "def index\n if current_user && current_user.is_admin? && params_user_id\n @events = User.find(params_user_id).events.where(is_validated:true)\n elsif params_user_id && params_user_id.to_i == current_user.id\n @events = current_user.events.where(is_validated:true)\n elsif params_user_id && params_user_id.to_i != current_user.id \n redirect_to root_path\n else\n @events= Event.where(is_validated:true)\n end\n end", "def username_with_filter\n\t\treturn @unf\n\tend", "def before\n\t\t\ttrue\n\t\tend", "def unauthorized_request user:current_user,filter:nil\n\t\t\tputs \"\\n\\nNo filter matches the given http method, controller, or controller method, rerouting...\" if filter.blank?\n\t\t\tputs \"\\n\\nUser #{user.email} is not authorized to #{filter.http_method.upcase}::>#{filter.controller || 'all'}.#{filter.action_name || 'all'}, rerouting...\\n\\n\" unless filter.blank?\n\t\t\trender json: \"Unauthorized Request\"\n\t\tend", "def user_permissions\n if user_signed_in? && (current_user.is_logistics? || current_user.is_clerical? || current_user.is_vendor? || current_user.is_customer?)\n authorize! :edit, Element\n end\n end", "def prevent_user\n if session[:is_admin] != true and params[:user_id].to_i != @current_user.id\n redirect_to products_path\n end\n end", "def register_filter(mod); end", "def before_tours; end" ]
[ "0.78171587", "0.7538971", "0.7245296", "0.68182003", "0.6793294", "0.6589802", "0.6471281", "0.64641947", "0.64495635", "0.64275473", "0.6406224", "0.64031744", "0.64028394", "0.6379794", "0.6376574", "0.63620895", "0.6333597", "0.62232643", "0.62226796", "0.6216757", "0.62162626", "0.6178185", "0.6177074", "0.61708784", "0.61584014", "0.6151275", "0.614929", "0.614641", "0.61012506", "0.61012506", "0.60975766", "0.6094061", "0.609145", "0.6041089", "0.6039746", "0.6030541", "0.6022636", "0.5995029", "0.5953861", "0.5953244", "0.5941981", "0.59274393", "0.59161204", "0.59129333", "0.5908494", "0.5889454", "0.58864594", "0.58832014", "0.58832014", "0.58828825", "0.5866623", "0.5858504", "0.5858133", "0.5854411", "0.58316076", "0.58267474", "0.58190256", "0.58128744", "0.57785374", "0.57768714", "0.576965", "0.5755961", "0.5752254", "0.574939", "0.57493", "0.57477176", "0.5747579", "0.5745238", "0.5741292", "0.5735098", "0.5733124", "0.5703474", "0.57009804", "0.56968844", "0.5691715", "0.56692916", "0.5669154", "0.56556267", "0.5649703", "0.5644593", "0.5644375", "0.5642147", "0.5642063", "0.56325924", "0.5631181", "0.5626744", "0.5626551", "0.56250286", "0.5619517", "0.5604205", "0.55969995", "0.5595489", "0.5595489", "0.5593659", "0.5587779", "0.5585722", "0.5580463", "0.55801153", "0.556595", "0.55614173", "0.55552423" ]
0.0
-1
Comfirms the correct user
def correct_user @user = User.find(params[:id]) redirect_to(root_url) unless current_user?(@user) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def correct_user\n\t\tunless current_user == @univers.user\n\t\t\tflash[:danger] = \"You have no power there\"\n\t\t\tredirect_to universes_path\n end\n end", "def correct_user(user)\n user == current_user\n end", "def corrent_user\n\t@user = User.find(params[:id])\n\tredirect_to(root_url) unless @user == current_user\n\t\t\n\tend", "def correct_user\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user # sauf si\n end", "def correct_user\n\t\t\tif !current_user?(@user) && !current_user.orgadmin?\n\t\t\t\tredirect_to(users_path)\n\t\t\tend\n\t\tend", "def require_same_user\n if params[:id].to_i != current_actor.id\n flash[:error] = \"Unable to complete withdrawal. Invalid user.\".t\n redirect_to money_path(current_actor) and return\n end\n end", "def correct_user\n #to define the correct user and omit it when edit and update\n @user=User.find(params[:id])\n redirect_to(root_path) unless current_user?(@user)\n end", "def correct_user\n\t\t\t#checks params hash for the user id storing that user into a variable\n\t\t\t@user = User.find(params[:id])\n\t\t\t#compares that user created above to the currently logged in user\n\t\t\tunless current_user?(@user) || is_admin?(current_user) #|| is_doctor?(current_user)\n\t\t\t\tredirect_to(root_url) \n\t\t\tend\n\t\tend", "def correct_user\n @user = HoacUser.find(params[:id])\n redirect_to(edit_hoac_user_path) unless current_user?(@user)\n end", "def correct_user\n unless @user == current_user\n redirect_to user_notes_path(current_user)\n end\n end", "def correct_user\n @user = Border.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n \n redirect_to(login_path) unless current_user?(@user)\n end", "def correct_user\n @jogtime = Jogtime.find(params[:id])\n redirect_to(root_url) unless (current_user.id == @jogtime.user_id) || current_user.admin?\n end", "def correct_user\n set_user\n unless current_user?(@user)\n flash[:danger] = 'This action is not permitted for this account since you are not the owner'\n redirect_to overview_user_path(current_user)\n end\n end", "def correct_user\n @user ||= (@character ? @character.user : @clutch.user)\n redirect_to user_path(current_user), alert: \"That does not belong to you!\" unless is_current_user?(@user) || is_admin?\n end", "def require_same_user\n if current_user != @user && !current_user.admin?\n flash[:alert] = \"you dont have access to do anything with #{@user.username}'s account\"\n redirect_to user_path(@user)\n \n end\n \n end", "def correct_user\n unless Presenter.find_by(user_id: current_user) == find_presenter\n if current_user.admin?\n redirect_to edit_presenter_profile_path\n else\n flash[:danger] = \"Unauthorized Access\"\n redirect_to root_url\n end \n end\n end", "def correct_user\n\t\t\t@user = User.find(params[:id])\n\t\t\tredirect_to(root_url) unless @user == current_user\n\t\tend", "def correct_user\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n unless @user == current_user\n flash[:danger] = 'You are not authorized to do that.'\n redirect_to(root_url)\n end\n end", "def correct_user\n\t\tunless current_user.id == Deck.find(params[:id]).user_id or Deck.find(params[:id]).share == true\n\t\t\tflash[:error] = \"You do not have permission to look at this deck\"\n\t\t\tredirect_to root_path\n\t\tend\n\tend", "def correct_user\n\t\t@user = User.find(params[:id])\n\t\tredirect_to root_path unless @user == current_user\n\tend", "def correct_user\n @course = Course.find(params[:id])\n @user = @course.users\n unless current_user == @user\n redirect_to(root_url) \n flash[:danger] = \"You are not the authorised user\"\n end\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to \"/anuncios\" unless current_user\n end", "def correct_user\n \t@user = User.where(id: params[:id]).to_a[0]\n\tunless current_user?(@user) or current_user.admin?\n\t\tredirect_to root_path, notice: \"You are not allowed to do that.\"\n\tend\n end", "def correct_user\n @user = User.find(params[:id])\n #redirect_to root_url unless @user == current_user\n redirect_to root_url unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:user_id])\n redirect_to root_url, notice: \"Can't access others' Decks\" unless current_user?(@user)\n end", "def correct_user\n unless helpers.current_user?(@user)\n flash[:danger] = \"You don't have permission to do that\"\n redirect_to root_path\n end\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_path) unless (current_user.id == @user.id)\n end", "def require_same_user\n if current_user != @user\n flash[:error] = \"You do not have permisions to edit a user other than yourself\"\n redirect_to root_path\n end \n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(user_root_path,:notice => 'You cannot access this page') unless current_user == @user\n end", "def correct_user\n# user = User.find_by_id(params[:id])\n# redirect_to(root_url) unless user && current_user?(user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = Customer.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to current_user unless current_user == @user\n end", "def convidar\n @compra = Compra.find(params[:compra_id])\n\n if params[:user_select]\n user_select = params[:user_select]\n\n user = User.find_by_nome(user_select.split(\" - \").first)\n\n if(current_user != user && [email protected](:id => user.id).present?)\n @compra.users << user\n\n redirect_to compra_produtos_path(@compra), notice: \"#{user.nome.upcase} adicionado a sua lista de compras com sucesso!!\"\n else\n redirect_to compra_produtos_path(@compra), alert: \"#{user.nome.upcase} você já pertence a essa lista.\"\n end\n end\n end", "def correct_user\n @user = User.find(params[:id])\n # redirect_to root_path, notice: \"You do not have permission.\" unless @user == \"Admin\" || @user == \"Member\"\n end", "def correct_user\n msg = \"You do not have permission to update another user's information\"\n require_correct_user(@user, msg)\n end", "def correct_user\n reservation = Reservation.find(params[:id])\n return if current_user?(reservation.space.user)\n\n redirect_to root_url\n flash[:danger] = 'You are not authorised.'\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n \n end", "def correct_user\n redirect_to(root_url) unless current_user?(@user)\n end", "def requestee_user\n unless @friendship.requested == current_user\n flash[:warning] = \"You are not authorized.\"\n redirect_to root_path\n end\n end", "def correct_user\n @user = User.find(params[:id])\n # redirect_to(root_url) unless @user == current_user\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to root_path unless @user == current_user\n end", "def correct_user\n\t\t@user = User.find(params[ :id])\n\t\tredirect_to(root_url) unless current_user?(@user)\n\tend", "def match_user\n unless admin?\n user = User.find(current_user)\n\n unless user.id == set_user.id\n redirect_to user_path(current_user), notice: 'You do not have any permission to grant this page !'\n end\n end\n end", "def correct_user\n# user = User.find(params[:id])\n user = User.fetch_user(params[:id])\n redirect_to(root_url) unless current_user?(user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to root_path, alert: \"You do not have access to that page\" unless current_user == @user\n end", "def correct_user\n \t@user = User.find(params[:id])\n \tredirect_to current_user unless current_user?(@user) \n end", "def masquerade\n @user = User.find(params[:id])\n if @user\n switch_user(@user)\n redirect_to root_url\n else\n redirect_to :action => :list\n end\n end", "def correct_user\n \t\t@user = User.find(params[:id])\n \t\tredirect_to(root_url) unless current_user?(@user) || current_user.admin?\n \tend", "def correct_user\n @user = User.find(params[:id]) if User.exists?(params[:id])\n redirect_to(edit_user_path(current_user)) unless current_user == @user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user_help?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_path) unless (current_user.admin? == true || current_user?(@user)) \n end", "def correct_user(id)\n @user = User.find(id)\n unless current_user? @user\n flash[:danger] = \"Azione non autorizzata\"\n redirect_to groups_path\n end\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:user_id])\n redirect_to('/unauthorized') unless current_user?(@user)\n end", "def same_user_required\n unless @current_user == User.find(params[:id])\n flash[:error] = \"Non puoi modificare un utente diverso dal tuo\"\n redirect_to timetables_url\n end\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\nend", "def correct_user\n\t @user = User.find(params[:user_id])\n\t redirect_to(root_url) unless current_user?(@user)\n\t end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user === current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user) #checks if current_user == @user\n #current_user? defined in session helper\n end", "def correct_user\n @question = Question.find(params[:id])\n redirect_to(root_url) unless current_user == @question.user\n end", "def correct_user\n @user = User.find(params[:user_id])\n unless current_user?(@user) || current_user.admin?\n flash[:danger] = \"It is not possible to access other users diaries\"\n redirect_to(root_url) \n end \n \n end", "def authorize_user!\n user = Circle.find(params[:id]).user\n if current_user != user\n flash[:notices] = \"Unathorized action\"\n redirect_to user_url(user.id)\n end\n end", "def check_eligibility\n if params[:user_id].to_i == current_user.id\n redirect_to root_path, alert: \"Error: Owner can't collaborate\"\n end\n end", "def correct_user\n @user = User.find(params[:id])\n\n if @user != current_user\n redirect_to(root_path)\n else\n # nothing to do\n end\n end", "def correct_user\n\t\t\t@user = User.find(params[:id])\n\t\t\tredirect_to(root_path) unless current_user?(@user)\n\t\tend", "def correct_user\n @user = User.find(params[:user_id])\n unless current_user?(@user) || current_user.admin?\n flash[:danger] = \"It is not possible to access other users diaries\"\n redirect_to(root_url) \n end \n \n end", "def correct_user\n @user = User.find(params[:id])\n unless current_user?(@user) || current_user.admin?\n flash[:danger] = \"It is not possible to access other users diaries\"\n redirect_to(root_url) \n end \n \n end", "def correct_user\n\t @user = User.find(params[:id])\n\t unless current_user?(@user)\n\t flash[:danger] = \"You don't have rights\"\n\t\t\tredirect_back_or(root_url)\n\t end\n\tend", "def correct_user\n\t\t\t@user = User.find(params[:id])\n\t\t\tif current_user != @user\n\t\t\t\tredirect_back(fallback_location: root_path)\n\t\t\tend\n\t\tend", "def correct_user\n\t\t\t@user = User.find(params[:id])\n\t\t\tredirect_to(root_url) unless current_user?(@user) || current_user.admin?\n\t end", "def correсt_user\n @user = User.find(params[:id])\n redirect_to(root_path) unless (current_user?(@user) or is_admin?)\n\n end", "def correct_user\n \t\t@user=User.find(params[:id])\n \t\t#redirect_to(root_path) unless @user ==current_user\n \t\tredirect_to(root_path) unless current_user?(@user)\n \tend", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless @user == current_user\n end", "def correct_user\n @user = User.find(params[:id])\n redirect_to root_url, notice: \"You do not have permission to view or edit this information because it isn't yours.\" unless current_user?(@user)\n end", "def correct_user\n @user = User.find_by_user_name(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:user_id])\n redirect_to(current_user) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:user_id])\n redirect_to(current_user) unless current_user?(@user)\n end", "def correct_user\n @user = User.find(params[:id])\n unless current_user?(@user)\n flash[:danger] = \"Please don't mess with others' profiles!\"\n # redirect_to root_url\n redirect_to @user\n end\n end", "def set_user; end", "def authorized_for_conflicts\n conflict_user = User.find(params[:user_id].to_i);\n redirect_to root_path unless ((conflict_user.id == current_user.id) || (current_user.in_tab_room_of?(conflict_user)))\n end", "def authorized_by(user)\n user.id == self.sender_id\n end", "def correct_user\n\t\t@user = User.find(params[:id])\n\t\tredirect_to(root_url) unless current_user?(@user)\n\tend", "def correct_user\n\t\t@user = User.find(params[:id])\n\t\tredirect_to(root_url) unless current_user?(@user)\n\tend", "def correct_user\n\t\t@user = User.find(params[:id])\n\t\tredirect_to(root_url) unless current_user?(@user)\n\tend", "def correct_user\r\n @user = User.find(params[:id])\r\n redirect_to(root_url) unless current_user?(@user)\r\n end", "def call \n user\n end" ]
[ "0.69294626", "0.68347377", "0.6795285", "0.663792", "0.662208", "0.6613541", "0.6608377", "0.6606488", "0.660191", "0.6594039", "0.6574713", "0.6572459", "0.6571981", "0.6571284", "0.6553836", "0.6546742", "0.646462", "0.6462291", "0.64492965", "0.64402705", "0.64194137", "0.6417692", "0.64162374", "0.641031", "0.640982", "0.64095926", "0.64018077", "0.63960785", "0.6390406", "0.6390123", "0.63899994", "0.6389744", "0.6389305", "0.63881516", "0.63829076", "0.63800466", "0.6377412", "0.6369769", "0.63659865", "0.635777", "0.6354449", "0.6354131", "0.6354131", "0.6354131", "0.6354131", "0.6354131", "0.6354131", "0.6354131", "0.6354131", "0.6354131", "0.6350998", "0.6343532", "0.63404155", "0.63397783", "0.633604", "0.6335909", "0.63310736", "0.63289666", "0.6324539", "0.63232356", "0.6307185", "0.63068795", "0.6306166", "0.6306017", "0.6302748", "0.63006145", "0.6298585", "0.62968653", "0.62955135", "0.6294771", "0.62920934", "0.62881345", "0.62872523", "0.6286123", "0.6285622", "0.62850493", "0.62818366", "0.62770975", "0.6276934", "0.6272287", "0.6269882", "0.6266656", "0.6265412", "0.62626636", "0.62623864", "0.62595576", "0.6257872", "0.6257872", "0.6256642", "0.62563246", "0.6254454", "0.6254454", "0.62522125", "0.6250242", "0.624563", "0.6243524", "0.624227", "0.624227", "0.624227", "0.623971", "0.6238663" ]
0.0
-1
form validation, prevent mass assignment vulnerability
def user_params params.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_valid; end", "def validation; end", "def validation; end", "def sanitized_allowed_attributes=(attributes); end", "def sanitized_allowed_attributes=(attributes); end", "def validated?; end", "def your_attributes_valid\n do_validate_attributes('your')\n end", "def validated; end", "def validate; end", "def validate; end", "def validate; end", "def validate; end", "def validate_fields\n %w[email author].each do |field|\n value = self.send(field)\n abort \"Hoe #{field} value not set. aborting\" if value.nil? or value.empty?\n end\n end", "def validate!; end", "def validate!; end", "def validate!; end", "def valid_attributes\n { }\n end", "def is_valid\n\tend", "def is_valid\n\tend", "def subclass_validations ; true ; end", "def validate\n super \n end", "def valid_attributes\n { }\n end", "def valid_attributes\n { }\n end", "def validate\r\n\r\n end", "def valid_attributes?\n true\n end", "def valid_attributes\n {}\n end", "def valid_attributes\n {}\n end", "def valid_attributes\n {}\n end", "def valid_attributes\n {}\n end", "def valid_attributes\n {}\n end", "def valid_attributes\n {}\n end", "def valid_attributes\n {}\n end", "def valid_attributes\n {}\n end", "def valid_attributes\n {\n :title => 'Test Title',\n :user_id => 1\n }\n end", "def valid?; end", "def valid?; end", "def valid?; end", "def valid?; end", "def valid?; end", "def is_valid?\n end", "def sanitize_attributes!\n remove_invalid_subjects!\n remove_invalid_audiences!\n remove_invalid_levels!\n set_prices!\n nil\n end", "def validate\n \n \n end", "def valid_params?; end", "def validate\r\n @invalid=false\r\n end", "def form_data?; end", "def valid; end", "def validate_instance\n super\n # @wfd_show/edit_paramaeters must be arrays of symbols\n @wfd_show_parameters.each_with_index do |sp,i|\n unless sp.kind_of? Symbol then\n raise ArgumentError.new( \"permitted show parameter at [ #{ i } ] = #{ sp.to_s } is not a Symbol\" )\n end\n end\n @wfd_edit_parameters.each_with_index do |ep,i|\n unless ep.kind_of? Symbol then\n raise ArgumentError.new( \"permitted edit parameter at [ #{ i } ] = #{ ep.to_s } is not a Symbol\" )\n end\n end\n # @wfd_show/edit_parameters must not have duplicates\n dup_param1 = @wfd_show_parameters.detect {|e| @wfd_show_parameters.rindex(e) != @wfd_show_parameters.index(e) }\n unless dup_param1.nil? then\n raise ArgumentError.new( \"permitted show parameter #{ dup_param1 } occurs more than once.\")\n end\n dup_param1 = @wfd_edit_parameters.detect {|e| @wfd_edit_parameters.rindex(e) != @wfd_edit_parameters.index(e) }\n unless dup_param1.nil? then\n raise ArgumentError.new( \"permitted edit parameter #{ dup_param1 } occurs more than once.\")\n end\n # intersection of both arrays should be empty because at any time\n # a parameter can only be shown or editable...\n dup_params = @wfd_show_parameters & @wfd_edit_parameters\n unless dup_params.length == 0\n raise ArgumentError.new( \"parameters #{ dup_params.to_s } are defined to both show and edit\" )\n end\n end", "def validate_create_params!(params); end", "def valid?\n validate_field_types\n # only do a database query if you have good enough data to check the database\n if @errors.length == 0\n if duplicate_user_assignment?\n @errors << \n {message: \n \"The database already has this user and assignment combination. It is record \n #{this_user_and_assignment.id}. Change this assignment or user or the assignment or user of that record.\", \n variabe: \"assignment_id, user_id\"}\n end\n end \n @errors.length == 0\n end", "def valid_attributes\n {\n :name => \"my dashboard\",\n :data => 'new data',\n :scale => false,\n :is_public => false\n }\n end", "def validate!\n\t\t\t\treturn true\n\t\t\tend", "def validator=(_); end", "def mass_assignment_authorizer\n super + Field.valid_options\n end", "def validate\n super\n errors.add(:name, \"can't be empty\") if name.blank?\n errors.add(:category_id, \"can't be empty\") if category_id.blank?\n errors.add(:price, \"can't be empty\") if price.blank?\n end", "def valid_attributes\n { name: \"Expert\" }\n end", "def validate!\n true\n end", "def is_valid\n return true\n end", "def validate\n end", "def validate\n validate_string_attributes\n end", "def form_enter type, valid_attributes\r\n valid_attributes.each { |field,value| form.send(\"#{type}[#{field}]=\",value)}\r\nend", "def valid_attributes\n attributes_for :post\n end", "def model_valid?\n true\n end", "def model_valid?\n true\n end", "def validate\n end", "def validate\n end", "def validate\n end", "def validate\n @invalid=false\n end", "def validate!\n # pass\n end", "def valid_attributes\n {title: \"atitle\"}\n end", "def skip_validations\n true\n end", "def extra_validations\n success\n end", "def validate_on_save(fields)\n raise ActsAsIcontact::ValidationError, \"privateName cannot contain spaces, quotes, slashes or brackets\" if fields[\"privateName\"] =~ /[\\s\\\"\\'\\/\\\\\\[\\]]/\n raise ActsAsIcontact::ValidationError, \"fieldType must be 'text' or 'checkbox'\" unless fields[\"fieldType\"] =~ /^(text|checkbox)$/\n end", "def literal_validation; end", "def literal_validation; end", "def validator; end", "def valid_attributes\n { judge_type_id: 1,\n user_id: @user.id }\n end", "def valid_attributes\n {\n :content => 'test content',\n :author_id => 1,\n :page_id => 1\n }\n end", "def pre_validation\n\n\n end", "def validate\n super\n end", "def model_attributes(params)\n clean_params = super #hydra-editor/app/forms/hydra_editor/form.rb:54\n # model expects these as multi-value; cast them back\n clean_params[:rights] = Array(params[:rights]) if params[:rights]\n clean_params[:title] = Array(params[:title]) if params[:title]\n if params[:description]\n clean_params[:description] = Array(params[:description])\n clean_params[:description].map! do |description|\n ::DescriptionSanitizer.new.sanitize(description)\n end\n end\n # Model expects provenance as single-value.\n if params[:provenance]\n clean_params[:provenance] = ::DescriptionSanitizer.\n new.sanitize(params[:provenance])\n end\n\n # Oops; we're blanking out these values when changing permissions and probably versions, too\n # -- they don't have these fields in the form at all so they don't get repopulated.\n clean_params = encode_physical_container(params, clean_params)\n clean_params = encode_external_id(params, clean_params)\n\n clean_params.keys.each do |key|\n # strip ALL the things!\n if clean_params[key].is_a?(Array)\n clean_params[key].map!(&:strip)\n elsif clean_params[key].is_a?(String)\n clean_params[key] = clean_params[key].strip\n end\n end\n\n clean_params\n end", "def validate\n true\n end", "def valid_attributes\n { name: 'do this' }\n end", "def validate!\n super()\n self\n end", "def save\n valid?\n end", "def validate(variables)\n form\tif @_content.empty? # password fields might write hints to the validator...\n clear\n @form_errors = {}\n p = variables\n p.delete(@submit_name)\n \n if @model.new_record? then \n @disabled_on_create.each { |d| p.delete(d) }\n @hidden_on_create.each { |d| p.delete(d) }\n else \n @disabled_on_update.each { |d| p.delete(d) }\n @hidden_on_update.each { |d| p.delete(d) }\n end\n\n # don't save empty passwords!!\n @password_fields ||= []\n @password_fields.each do |pwf|\n p.delete(pwf) if p[pwf].chomp.empty?\n end\n\n # remove possible additional data that model doesn't support to\n# p.delete_if { |k,v| [email protected]_to?(\"#{k}=\") }\n\n column_names = @model.class.columns.map { |c| c.name }\n p.each do |k,v|\n @model.send(\"#{k}=\".intern, v) if (column_names.include?(k) && @model.respond_to?(\"#{k}=\")) || @save_attribs.include?(k)\n end\n # @model.attributes = p\n \n return true if @model.valid?\n\n @model.errors.each do |k,v|\n @form_errors[k] = v\n end\n end", "def validate\r\n validate! rescue false\r\n end", "def validate_and_sanitize\n super\n end", "def _before_validation\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 valid_attributes\n { \"username\" => \"MyString\" }\n end", "def validate!\n validate_patches!\n validate_new_branch_name! if new_branch?\n validate_permissions!\n end", "def valid_attributes\n { \"name\" => \"MyString\" }\n end", "def valid_attributes\n { \"name\" => \"MyString\" }\n end", "def sanitize_for_mass_assignment(attrs)\n return attrs\n end", "def product_attributes_must_not_be_empty\n\n\t\t# Instance\n\t\tproduct = Product.new\n\n\t\tassert product.invalid?\n\t\tassert product.errors[:title].any?\n\t\tassert product.errors[:description].any?\n\t\tassert product.errors[:price].any?\n\t\tassert product.errors[:image_url].any?\n\tend", "def valid?(_) true end", "def valid?(_) true end", "def valid_attributes\n {:name => 'Test it!', \n :deck_id => 1}\n end", "def validate_essential_attributes #:nodoc:\n if @month.to_i.zero? || @year.to_i.zero?\n errors.add :month, \"is required\" if @month.to_i.zero?\n errors.add :year, \"is required\" if @year.to_i.zero?\n else\n errors.add :month, \"is not a valid month\" unless valid_month?(@month)\n errors.add 'card', \"has expired\" if expired?\n errors.add :year, \"is not a valid year\" unless valid_expiry_year?(@year)\n end\n end", "def validate\n end", "def validate\n end" ]
[ "0.6511301", "0.64580774", "0.64580774", "0.642856", "0.642856", "0.63675255", "0.6333226", "0.62426376", "0.62318015", "0.62318015", "0.62318015", "0.62318015", "0.6229757", "0.6225109", "0.6225109", "0.6225109", "0.62125534", "0.6206692", "0.6206692", "0.6163483", "0.6154277", "0.61446553", "0.61446553", "0.61332774", "0.6112683", "0.6093094", "0.6093094", "0.6093094", "0.6093094", "0.6093094", "0.6093094", "0.6093094", "0.6093094", "0.60614824", "0.6053917", "0.6053917", "0.6053917", "0.6053917", "0.6053917", "0.6046815", "0.6013468", "0.60121053", "0.6006889", "0.60033464", "0.5990151", "0.5966988", "0.5962162", "0.5961671", "0.593953", "0.59301966", "0.59238493", "0.5923248", "0.59105444", "0.5908141", "0.59076893", "0.59004617", "0.5895535", "0.5891475", "0.58902264", "0.58901894", "0.58879054", "0.5886679", "0.5886679", "0.58654517", "0.58654517", "0.58654517", "0.58625865", "0.5860822", "0.5860534", "0.58601606", "0.58593154", "0.58486885", "0.5847274", "0.5847274", "0.5845685", "0.58378625", "0.5834163", "0.5829797", "0.58284837", "0.58228964", "0.5816273", "0.5799086", "0.5796781", "0.5788671", "0.5787808", "0.5786041", "0.57817084", "0.57809776", "0.578005", "0.5770502", "0.5768361", "0.57664204", "0.57664204", "0.57586384", "0.5755236", "0.57513857", "0.57513857", "0.5749533", "0.5746879", "0.574543", "0.574543" ]
0.0
-1
redirects to stored location (or to the default).
def redirect_back_or(default) redirect_to(session[:forwarding_url] || default) session.delete(:forwarding_url) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def redirect_to_stored(default='/')\n return_to = session[:return_to] || default\n session[:return_to] = nil\n redirect return_to\n end", "def redirect_to_stored_location_or(default)\n redirect_to(session[:forward_url] || default)\n session.delete(:forward_url)\n end", "def redirect_back_or_default(default)\n redirect_to(pop_stored_location || default)\n end", "def redirect_back_or_default(default)\n redirect_to(pop_stored_location || default)\n end", "def redirect_back_or_default(default)\n redirect_to(location_stored? ? session[:return_to] : default)\n session[:return_to] = nil\n end", "def restore_location_or(default)\n redirect_to(session[:return_to] || default)\n session.delete(:return_to)\n end", "def redirect_to_stored_or_default(default)\n if session['return-to'].nil?\n redirect_to default\n else\n redirect_to_url session['return-to']\n session['return-to'] = nil\n end\nend", "def redirect(options = {})\r\n end", "def redirect(location, status = '302'); request.redirect(location, status); end", "def store_location!\n session[\"return_to\"] = request.env[\"warden.options\"][:attempted_path] if request.get?\n end", "def redirect_back_or_default(default)\n redirect_to url_for_redirect(default)\n end", "def redirect_back_or(default)\n #send back to what was stored in\n #\"session[:return_to] or default location\n redirect_to(session[:return_to] || default)\n #deletes saved return location\n session.delete(:return_to)\n end", "def redirect_back_or(default)\n redirect_to(session[:forwarding_url] || default)\n session.delete(:forwarding_url) # Delete the stored URL for next log in\n end", "def redirect_back_or(default)\n\n\t\t# redirects user to page stored in session symbol or the\n\t\t# dafault location if return_ to is not set.\n\t\tredirect_to(session[:return_to] || default)\n\n\t\t# Deletes the session symbol return_to\n\t\tsession.delete(:return_to)\n\tend", "def redirect_back_or_default(default)\n loc = session[:return_to] || default\n session[:return_to] = nil\n redirect loc\n end", "def redirect_back_or(default)\n redirect_to(session[:forwarding_url] || default)\n # The following deletion happens even though the redirect stastement is written first.\n # This is because the redirect doesn't actually happen until an explicit\n # return statement or until the end of a method.\n session.delete(:forwarding_url)\n end", "def redirect_to_target(default=nil)\n \n goto_url=params[:return_to] || session[:return_to] || default || \"/\"\n \n session[:return_to] = nil\n redirect_to(goto_url)\n end", "def store_location\n session[:redirect] = request.url\n end", "def redirect_back_or(default)\n redirect_to(session[:forwarding_url] || default)\n session.delete(:forwarding_url) #delete what is stored.\n end", "def store_and_redirect_location\n #session[:return_to] = \"/\"\n redirect_to \"/welcome/new\",:status => 401\n end", "def redirect_back_or_to(default)\n redirect_to(session[:forwarding_url] || default)\n session.delete(:forwarding_url)\n end", "def redirect_back_or( default )\n\t\tredirect_to( session[:forwarding_url] || default )\n\t\tsession.delete( :forwarding_url )\n\tend", "def store_location(url = url_for(:controller => controller_name, :action => action_name))\n # It's possible to create a redirection attack with a redirect to data: protocol... and possibly others, so:\n # Whitelisting redirection to our own site and relative paths.\n url = nil unless url =~ /\\A([%2F\\/]|#{root_url})/\n session[:return_to] = url\n end", "def redirect?; end", "def store_location\n session[:redirect_path] = request.path\n end", "def redirect_back_or(default)\n redirect_to(session[:forwarding_url] || default )\n session.delete(:forwarding_url)\n end", "def redirect_back_or(default)\n redirect_to(session[:forwarding_url] || default)\n session.delete(:forwarind_url)\n end", "def redirect_back_or(default)\n # Redirects don’t happen until an explicit return or the end of the method, \n # so any code appearing after the redirect is still executed.\n redirect_to(session[:forwarding_url] || default)\n session.delete(:forwarding_url)\n end", "def redirect_back_or_default(default)\n redirect_to(default)\n end", "def store_location!\n session[:\"#{scope}_return_to\"] = attempted_path if request.get? && !http_auth?\n end", "def redirect_back_or(default)\n redirect_to(session[:forwarding_url] || default)\n session.delete(:forwarding_url)\n end", "def redirect_back_or(default)\n redirect_to(session[:forwarding_url] || default)\n session.delete(:forwarding_url)\n end", "def redirect_back_or_default(default=nil)\n default = self.default_route\n redirect_to(session[:return_to] || default)\n session[:return_to] = nil\n end", "def redirect_back_or(default)\n redirect_to(session[:forwarding_url] || default)\n session.delete(:forwarding_url)\n end", "def redirect_back_or(default)\n\t\tredirect_to(session[:forwarding_url]||default)\n\t\tsession.delete(:forwarding_url)\n\tend", "def redirect_back_or_default(default)\n redirect_to(session[:return_to] || default)\n session[:return_to] = nil\n end", "def redirect_back_or_default(default)\n redirect_to(session[:return_to] || default)\n session[:return_to] = nil\n end", "def redirect_back_or_default(default)\n redirect_to(session[:return_to] || default)\n session[:return_to] = nil\n end", "def redirect_back_or_default(default)\n redirect_to(session[:return_to] || default)\n session[:return_to] = nil\n end", "def redirect_back_or_default(default)\n redirect_to(session[:return_to] || default)\n session[:return_to] = nil\n end", "def redirect_back_or_default(default)\n redirect_to(session[:return_to] || default)\n session[:return_to] = nil\n end", "def redirect_back_or(default)\n redirect_to session[:forwarding_url] || default\n session.delete(:forwarding_url)\n end", "def redirect_back_or(default)\n\t\tredirect_to(session[:return_to] || default)\n\t\tclear_return_to\n\tend", "def redirect_back_or(default)\n\t\tredirect_to(session[:return_to] || default)\n\t\tclear_return_to\n\tend", "def redirect_back_or(default)\n \tredirect_to(session[:forwarding_url] || default)\n\t session.delete(:forwarding_url)\n\tend", "def redirect_back_or(default)\n redirect_to(session[:forwarding_url] || root_path)\n session.delete(:forwarding_url)\n end", "def redirect_back_or(default)\n\t\tredirect_to(session[:forwarding_url] || default )\n\t\tsession.delete(:forwarding_url)\n\tend", "def store_location\n\t\t\tsession[:return_to] = request.fullpath\n\t\tend", "def redirect_back_or(default)\n\t\tredirect_to(session[:forwarding_url] || default)\n\t\tsession.delete(:forwarding_url)\n\tend", "def redirect_back_or(default)\n\t\tredirect_to(session[:forwarding_url] || default)\n\t\tsession.delete(:forwarding_url)\n\tend", "def redirect_back_or(default)\n\t\tredirect_to(session[:forwarding_url] || default)\n\t\tsession.delete(:forwarding_url)\n\tend", "def redirect_back_or(default)\n\t\tredirect_to(session[:forwarding_url] || default)\n\t\tsession.delete(:forwarding_url)\n\tend", "def redirect_back_or(default)\n\t\tredirect_to(session[:forwarding_url] || default)\n\t\tsession.delete(:forwarding_url)\n\tend", "def redirect_back_or(default)\n\t\tredirect_to(session[:forwarding_url] || default)\n\t\tsession.delete(:forwarding_url)\n\tend", "def redirect_back_or(default)\n\t\tredirect_to(session[:forwarding_url] || default)\n\t\tsession.delete(:forwarding_url)\n\tend", "def redirect_back(default)\n redirect_to(session[:forwarding_url] || default)\n session.delete :forwarding_url\n end", "def redirect_back_or(default)\n redirect_to(session[:forwarding_url] || default)\n session.delete(:forwarding_url)\n end", "def redirect_back_or(default)\n redirect_to(session[:forwarding_url] || default)\n session.delete(:forwarding_url)\n # Delete after the redirect so that the user will not be forwarded to the\n # same URL upon each login attempt.\n # Redirects always wait for the rest of the code block to return before\n # actually redirecting.\n end", "def redirect_back_or(default)\n redirect_to(session[:forwarding_url] || default )\n session.delete(:forwarding_url)\n end", "def redirect_back_or(default)\n\t redirect_to(session[:forwarding_url] || default)\n\t session.delete(:forwarding_url)\n\tend", "def redirect_back_or_default(default)\n loc = session[:return_to] || default\n session[:return_to] = nil\n redirect_to loc\n end", "def redirect_back_or( default )\n redirect_to( session[ :return_to ] || default )\n session.delete( :return_to )\n end", "def redirect_back_or_default(default, options = {})\n target = url_to_store(session[:return_to])\n (target = logged_in? ? home_url(current_user) : nil) if target == '{home}'\n #target = nil if target == APP_CONFIG.hostname || target == APP_CONFIG.hostname + '/'\n target = default unless target\n target = safe_redirect(target)\n session[:return_to] = nil\n return target if options[:find_target_only]\n redirect_to(target)\n end" ]
[ "0.8107985", "0.8034801", "0.7636486", "0.76222956", "0.7412404", "0.7341673", "0.7290278", "0.7163519", "0.7152072", "0.7131469", "0.7069455", "0.704326", "0.7033379", "0.70246804", "0.70125157", "0.7009527", "0.7002724", "0.69978774", "0.698725", "0.6977732", "0.69768393", "0.6961483", "0.6947591", "0.6941651", "0.6927124", "0.6914349", "0.69109035", "0.6910548", "0.6910426", "0.6907633", "0.6904025", "0.6904025", "0.69007826", "0.6889475", "0.68854254", "0.688269", "0.6875821", "0.6875821", "0.6875821", "0.6875821", "0.6875821", "0.6874416", "0.68728924", "0.68728924", "0.6872263", "0.686965", "0.6865262", "0.68568575", "0.68527114", "0.68527114", "0.68527114", "0.68527114", "0.68527114", "0.68527114", "0.68527114", "0.685107", "0.68505585", "0.68467766", "0.68432915", "0.68413043", "0.68366575", "0.68302536", "0.6829449" ]
0.0
-1
Stores the url trying to be accessed.
def store_location session[:forwarding_url] = request.original_url if request.get? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def store_location\n # store last url as long as it isn't a /users path\n\tsession[:previous_url] = request.fullpath unless request.fullpath =~ /\\/users/ or request.fullpath =~ /\\/json/ or request.fullpath =~ /\\/static/\n\t\n end", "def store_location\n\t\tif request.get?\n\t\t\tcookies[:previous_url] = request.url\n\t\tend\n\tend", "def store_location\n # store last url as long as it isn't a /users path\n session[:previous_url] = request.fullpath unless request.fullpath =~ /\\/users/\n end", "def store_location\n # store last url as long as it isn't a /users path\n session[:previous_url] = request.fullpath unless request.fullpath =~ /\\/users/\n end", "def store_location\n # store last url as long as it isn't a /users path\n session[:previous_url] = request.fullpath unless request.fullpath =~ /\\/users/\n end", "def store_location\n # store last url as long as it isn't a /users path\n session[:previous_url] = request.fullpath unless request.fullpath =~ /\\/users/\n end", "def store_location\n # store last url as long as it isn't a /users path\n session[:previous_url] = request.fullpath unless request.fullpath =~ /\\/users/\n end", "def store_location\n # store last url as long as it isn't a /users path\n session[:previous_url] = request.fullpath unless request.fullpath =~ /\\/users/\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n # Makes sure that the URL is saved only for a GET request because submitting\n # DELETE, PATCH or POST will raise errors when the URL is expecting\n # a GET request.\n end", "def store_location!\n session[:\"#{scope}_return_to\"] = attempted_path if request.get? && !http_auth?\n end", "def store_location\n # Store the URL only when the reqest was GET\n session[:forwarding_url] = request.original_url if request.get?\n end", "def url= new_url\n new_url = self.class.standardized_url new_url\n return if new_url == url\n super new_url # Heading for trouble if url wasn't unique\n @indexing_url = nil # Clear the memoized indexing_url\n self.http_status = nil # Reset the http_status\n # We do NOT build the associated site here, because we may be BUILDING the page_ref for a site, in\n # which case that site will assign itself to us. Instead, the site attribute is memoized, and if it\n # hasn't been built by the time that it is accessed, THEN we find or build an appropriate site\n self.site = SiteServices.find_or_build_for self\n self.kind = :site if site&.page_ref == self # Site may have failed to build\n # We trigger the site-adoption process if the existing site doesn't serve the new url\n # self.site = nil if site&.persisted? && (SiteServices.find_for(url) != site) # Gonna have to find another site\n request_attributes :url # Trigger gleaning and mercury_result to validate/modify url\n attrib_ready! :url # Has been requested but is currently ready\n end", "def url=(_); end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n # store last url - this is needed for post-login redirect to whatever the user last visited.\n return unless request.get? \n if (!request.fullpath.match(\"/users\") &&\n !request.xhr?) # don't store ajax calls\n session[\"user_return_to\"] = request.fullpath\n end\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n\t\tsession[:forwarding_url] = request.url if request.get?\n\tend", "def store_location\n\t\tsession[:forwarding_url] = request.url if request.get?\n\tend", "def store_location\n\t\tsession[:forwarding_url] = request.url if request.get?\n\tend", "def store_location\n\t\tsession[:forwarding_url] = request.url if request.get?\n\tend", "def store_url\n session[:forwarding_url] = request.original_url if request.get?\n end", "def store_location\n\t # store last url - this is needed for post-login redirect to whatever the user last visited.\n\t if !devise_controller? && !request.xhr? # don't store ajax calls\n\t session[:previous_url] = request.fullpath \n\t end\n\tend", "def store_location\n\t\t# store last url - this is needed for post-login redirect to whatever the user last visited.\n\t\tif (request.fullpath != \"/users/sign_in\" &&\n\t\t\t\trequest.fullpath != \"/users/sign_up\" &&\n\t\t\t\trequest.fullpath != \"/users/password\" &&\n\t\t\t\trequest.fullpath != \"/users/sign_out\" &&\n\t\t\t\trequest.fullpath !~ /\\/users\\/confirmation/i &&\n\t\t\t\t!request.xhr?) # don't store ajax calls\n\t\t\tsession[:previous_url] = request.fullpath\n\t\tend\n\tend", "def set_url\n @url = Url.find_by(key: params[:key])\n end", "def store_location\n\t\tsession[:forwarding_url]=request.original_url if request.get?\n\tend", "def store_URL\n session[:forwarding_url] = request.original_url if request.get?\n end", "def store_location!\n store_location_for(scope, attempted_path) if request.get? && !http_auth?\n end", "def store_location\n session[:forward_url] = request.url if request.get?\n end", "def url_server\n\t\t\tunless @links_to_visit.empty?\n\t\t\t\t@url = @links_to_visit.pop\n\t\t\tend\n\t\tend", "def store_location\n if ((!request.fullpath.match(\"/users\") && !request.fullpath.match(\"/admin\") && !request.fullpath.match(\"/admin/login\")) &&\n !request.xhr?) # don't store ajax calls\n# puts \"----------------------------\"\n# puts \"--not store--\"\n session[:previous_url] = request.fullpath\n else\n# puts \"----------------------------\"\n# puts \"--store--\"\n end\n end", "def store_location \n\t\tsession[:forwarding_url] = request.url if request.get?\n\tend", "def store_location\n # store last url - this is needed for post-login redirect to whatever the user last visited.\n if (request.path != \"/users/sign_in\" &&\n request.path != \"/users/sign_up\" &&\n request.path != \"/users/password/new\" &&\n request.path != \"/users/password/edit\" &&\n request.path != \"/users/confirmation\" &&\n request.path != \"/users/sign_out\" &&\n !request.fullpath.match(/\\/users\\/auth\\//) &&\n !request.xhr?) # don't store ajax calls\n session[:previous_url] = request.fullpath\n end\n end", "def store_location\n \tsession[:forwarding_url] = request.url if request.get?\n end", "def store_location\n\t\tsession[ :forwarding_url ] = request.original_url if request.get?\n\tend", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.url? if request.get?\n end", "def store_location\n session[:forwarding_url] = request.original_url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.original_url if request.get?\n end", "def store_location\n if request.get?\n session[:forwarding_url] = request.original_url\n end\n end", "def store_location\n session[ :return_to ] = request.url if request.get?\n end", "def store_location\n\t\tsession[:return_to] = request.url if request.get?\n\tend", "def store_location\n\t\tsession[:return_to] = request.url if request.get?\n\tend", "def store_location\n\t\tsession[:return_to] = request.url if request.get?\n\tend", "def store_location(url = url_for(:controller => controller_name, :action => action_name))\n # It's possible to create a redirection attack with a redirect to data: protocol... and possibly others, so:\n # Whitelisting redirection to our own site and relative paths.\n url = nil unless url =~ /\\A([%2F\\/]|#{root_url})/\n session[:return_to] = url\n end", "def url=(url)\n @@url = url\n end", "def store_location\n \t\tsession[:forwarding_url] = request.original_url if request.get?\n \tend", "def store_location\n\t\tsession[:forwarding_url] = request.original_url if request.get?\n\tend", "def store_location\n\t\tsession[:forwarding_url] = request.original_url if request.get?\n\tend", "def store_location\n\t\tsession[:forwarding_url] = request.original_url if request.get?\n\tend", "def store_location\n\t\tsession[:forwarding_url] = request.original_url if request.get?\n\tend", "def store_location\n session[:forwarding_url] = request.url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.original_fullpath if request.get?\n end", "def store_location\n session[:forwarding_url]=request.fullpath if request.get?\n end", "def store_location\n # session[:forwarding_url] = request.url if request.get?\n user_session[:forwarding_url] = request.referer if request.get? && request.referer\n end", "def store_location\n\t\tsession[:last_page] = @request.request_uri\n\tend", "def store_location\n\t\t#Store target location (only if request=get). (For example, if user request a page but\n\t\t# it's not signed in. It remembers the request)\n\t\tsession[:return_to] = request.url if request.get?\n\tend", "def guardar_URL\n\t\tsession[:url_deseada] = request.original_url if request.get?\n\tend", "def url=(url)\n @@url = url\n end", "def save_previous_url\n\t\t\tunless request.referer.include?('likes')\n\t\t\t\tsession[:previous_url] = URI(request.referrer).path\n\t\t\tend\n\t\tend", "def store_location\n \tsession[:forwarding_url] = request.original_url if request.get?\n\tend", "def store_location\n if request.get?\n session[:return_to] = request.url\n end\n end", "def store_location\n if request.get?\n session[:return_to] = request.url\n end\n end", "def store_location\n if request.get?\n session[:return_to] = request.url\n end\n end", "def store_location\n if request.get?\n session[:return_to] = request.url\n end\n end", "def store_location\n\t session[:forwarding_url] = request.original_url if request.get?\n\tend", "def store_location_url(url)\n session[:forwarding_url] = url\n end", "def store_location\n session[:forwarding_url] = request.url if request.get? # only for get requests. A user could technically delete their cookie then submit a form\n end", "def store_location\n\n\t\t# Stores the requested page in a session symbol return_to\n\t\tsession[:return_to] = request.url\n\tend" ]
[ "0.70334125", "0.68873394", "0.6857498", "0.6857498", "0.6857498", "0.6857498", "0.6857498", "0.6857498", "0.6855729", "0.6693769", "0.66616243", "0.6638029", "0.66331434", "0.66216826", "0.6618288", "0.6601687", "0.65920895", "0.65920895", "0.65920895", "0.65920895", "0.65683967", "0.65654534", "0.6558883", "0.6552439", "0.6540537", "0.6539499", "0.65383834", "0.65332437", "0.6510533", "0.6494976", "0.6491023", "0.64757746", "0.6464987", "0.6459744", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.64581376", "0.6454845", "0.64510506", "0.64510506", "0.6436951", "0.64284354", "0.6411558", "0.6411558", "0.6411558", "0.6408736", "0.64082515", "0.6406365", "0.6397746", "0.6397746", "0.6397746", "0.6397746", "0.6386459", "0.63765365", "0.6373724", "0.6366008", "0.6357706", "0.63565177", "0.63530964", "0.6349562", "0.63492554", "0.63466215", "0.6345595", "0.6345595", "0.6345595", "0.6345595", "0.6326873", "0.63254905", "0.6305872", "0.6278067" ]
0.0
-1
Options: url (required), content_type, access_level, key (destination on s3)
def store_on_s3(options) # Deleting :url from options because we don't want it in the options that we pass to s3 # and removing some characters that aren't allowed in urls url = options.delete(:url).gsub(/ /, '%20').gsub(/\^/, '%5E') file = open(url) key = options.delete(:key) AWS::S3::S3Object.store(key, file, @bucket, options) # Return location on s3 "http://s3.amazonaws.com/" + @bucket + "/" + key end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def aws_S3_bucket_url_get(opts)\n if opts[:method] == :write\n opts[:obj].url_for(opts[:method], expires: 30.days, content_type: 'text/plain')\n else\n opts[:obj].url_for(opts[:method], expires: 30.days)\n end\n end", "def aws_post_url\n \"#{AWS_S3_ACCESS_URL}/#{self.class.media_bucket}\"\n end", "def s3_url\n establish_s3_connection\n bucket = s3keys[\"bucket\"]\n key = self.datastreams[\"s3\"].key_values.first\n s3 = AWS::S3.new\n s3.buckets[bucket].objects[key].url_for(:read, :expires => 60 * 60 * 1.5)\n end", "def download_link\n s3 = Aws::S3::Client.new\n signer = Aws::S3::Presigner.new(client: s3)\n signer.presigned_url(\n :get_object,\n bucket: ENV['SEATSHARE_S3_BUCKET'],\n key: path,\n expires_in: 86_400\n )\n end", "def s3_url\n establish_s3_connection\n bucket = self.datastreams[\"s3\"].bucket_values.first\n key = self.datastreams[\"s3\"].key_values.first\n AWS::S3::S3Object.url_for(key, bucket, :expires_in => 60 * 60 * 1.5)\n end", "def url\n if @attributes[:filename] =~ /^http:\\/\\//\n @attributes[:filename]\n elsif $cloudfront && $cloudfront[s3_bucket]\n \"#{$cloudfront[s3_bucket]}/#{s3_key}\"\n else\n \"http://#{s3_bucket}.s3.amazonaws.com/#{s3_key}\"\n end\n end", "def download_url(style = nil, expires_in = 90.minutes)\n \n s3 = Aws::S3::Resource.new\n\n secure_url = self.mp3\n \n unless Rails.env.test?\n begin\n if self.mp3.include?(\"https://s3-us-west-1.amazonaws.com/digiramp/\")\n secure_url = self.mp3.gsub('https://s3-us-west-1.amazonaws.com/digiramp/', '')\n else\n secure_url = self.mp3.gsub('https://digiramp.s3.amazonaws.com/', '')\n end\n \n bucket = s3.bucket(Rails.application.secrets.aws_s3_bucket)\n s3_obj = bucket.object(secure_url)\n secure_url = s3_obj.presigned_url(:get, expires_in: 600)\n rescue => e\n\n secure_url = self.mp3\n end\n end\n secure_url\n end", "def do_bucket_key(bucket_name, object_name, options)\n access_key_id, secret_access_key, security_token = if ENV.has_key? \"AWS_SESSION_TOKEN\"\n get_temporary_keys_from_environment\n else\n get_temporary_keys_via_sts\n end\n\n expiration = options[:expires].to_i\n\n string_to_sign = \"GET\\n\\n\\n#{expiration}\\nx-amz-security-token:#{security_token}\\n/#{bucket_name}/#{object_name}\"\n\n signature = CGI.escape(\n Base64.encode64(\n OpenSSL::HMAC.digest(\n OpenSSL::Digest.new('sha1'),\n secret_access_key,\n string_to_sign,\n )\n ).gsub(\"\\n\",\"\")\n )\n\n object_url = if options[:path_style]\n \"https://s3.amazonaws.com/#{bucket_name}/#{object_name}\"\n elsif options[:insecure]\n \"http://#{bucket_name}.s3.amazonaws.com/#{object_name}\"\n else\n \"https://#{bucket_name}.s3.amazonaws.com/#{object_name}\"\n end\n\n url = object_url + \"?AWSAccessKeyId=#{access_key_id}&Expires=#{expiration}&Signature=#{signature}&x-amz-security-token=#{CGI.escape(security_token)}\"\n\n puts url\nend", "def generate_url(bucket, file)\n\n connect_to_s3()\n signer = Aws::S3::Presigner.new\n url = signer.presigned_url(:get_object, bucket: bucket, key: file)\n\nend", "def presigned_url(bucket_name:, key:, expires_in:, response_content_type:)\n signer = Aws::S3::Presigner.new(client: @s3_client)\n signer.presigned_url(:get_object, {\n bucket: bucket_name,\n key: key,\n expires_in: expires_in,\n response_content_type: response_content_type\n })\n end", "def get_presigned_put_url_for(s3_name, bucket, content_type)\n params = {\n bucket: bucket,\n key: s3_name\n }\n\n options={\n content_type: content_type,\n server_side_encryption: 'aws:kms',\n ssekms_key_id: key_id\n }\n\n presigner = Aws::S3::Presigner.new({client: client})\n u = presigner.presigned_url(:put_object, params.merge(options))\n # uri = URI.parse(u)\n # uri\n # r = Net::HTTP.start(uri.host, :use_ssl => true) do |http|\n # http.send_request(\"PUT\", uri.request_uri, File.read(file_path), {\n # # This is required, or Net::HTTP will add a default unsigned content-type.\n # \"content-type\" => content_type\n # })\n #\n # end\n end", "def cdn_url(opts={})\n S3Buckets::MediaBucket.url(s3_key, opts) if s3_key\n end", "def s3_url\n return self.authenticated_s3_url(:expires_in => 24.hours, :use_ssl => true)\n end", "def aws_put_file(bucket, key, content, **opt)\n meth = opt.delete(:meth) || calling_method\n client = opt.delete(:client)\n client ||= (bucket.client if bucket.is_a?(Aws::S3::Bucket))\n client ||= s3_client(**opt)\n params = { bucket: bucket, key: key }\n # @type [Types::CopyObjectOutput, Types::PutObjectOutput] response\n response =\n if content.is_a?(Aws::S3::Object)\n params[:copy_source] = \"#{content.bucket_name}/#{content.key}\"\n client.copy_object(params, opt)\n else\n # noinspection RubyMismatchedArgumentType\n params[:body] = content.is_a?(String) ? StringIO.new(content) : content\n client.put_object(params, opt)\n end\n Log.debug { \"#{meth}: AWS S3 response: #{response.inspect} \" }\n key\n rescue => error\n set_error(error)\n # noinspection RubyScope\n Log.warn { \"#{meth}: AWS S3 failure: #{error.class}: #{error.message}\" }\n end", "def url\n @url ||= s3_bucket.object(key_path).presigned_url(:get,\n expires_in: 7.days.to_i,\n response_content_disposition: ApplicationHelper.encoding_safe_content_disposition(\n ImageServiceHelper.download_name(@model.work_presenter, suffix: @suffix)\n )\n )\n end", "def quick_s3_upload\n end", "def direct_s3_presigned_url\n Stash::Aws::S3.presigned_download_url(s3_key: \"#{resource.s3_dir_name(type: 'supplemental')}/#{upload_file_name}\")\n end", "def aws_instance_S3_object_create(bucket, name, attribute, url_method)\n name = aws_S3_object_name(name)\n log \"AWS: creating S3 Object '#{name}'\"\n obj = aws_call('aws_S3_obj_create', bucket: bucket, name: name)\n \n log \"AWS: getting S3Object url for '#{obj.key}'\"\n url = aws_call('aws_S3_bucket_url_get', obj: obj, method: url_method)\n self.update_attribute(attribute, url.to_s)\n\n obj\n end", "def url(opts = {})\n if bucket.mode == :private\n bucket.private_get_url(@path, opts)\n else\n bucket.path_to_url(@path, opts)\n end\n end", "def s3_url\n \"https://s3.amazonaws.com/#{ENV['S3_BUCKET']}\"\n end", "def s3_url\n return self.authenticated_s3_url(:expires_in => current_user.admin? ? 1.week : 24.hours, :use_ssl => true)\n end", "def url(protocol = \"https\")\n if protocol.present?\n \"#{protocol}:#{S3.base_uri}/#{s3_key}\"\n else\n \"#{S3.base_uri}/#{s3_key}\"\n end\n end", "def connect_to_s3()\n\n Aws::S3::Client.new(\n access_key_id: ENV['S3_KEY'],\n secret_access_key: ENV['S3_SECRET'],\n region: ENV['AWS_REGION'],\n force_path_style: ENV['PATH_STYLE']\n )\n \nend", "def get_signed_put_url(upload, duration)\n # use Fog config\n storage = Fog::Storage.new(Rails.configuration.x.fog_configuration)\n \n # set request attributes\n headers = { \"Content-Type\" => upload.content_type }\n options = { \"path_style\" => \"true\" }\n \n # generate signed url\n return storage.put_object_url(\n ENV['S3_BUCKET_NAME'],\n upload.path,\n duration.from_now.to_time.to_i,\n headers,\n options\n )\n end", "def generate_url(folder, file)\n\n bucket = \"prototype-jv\"\n s3_file_path = \"#{folder}/#{file}\"\n\n connect_to_s3()\n signer = Aws::S3::Presigner.new\n url = signer.presigned_url(:get_object, bucket: bucket, key: s3_file_path)\n\nend", "def upload(file)\n # Upload the given file\n AWS::S3::S3Object.store( file,\n open( file ),\n BUCKET,\n :access => :public_read )\n\n # display the URL of the file just uploaded\n puts AWS::S3::S3Object.url_for((file), BUCKET)[/[^?]+/]\nend", "def url(options = {})\n if options[:virtual_host]\n scheme = options.fetch(:secure, true) ? 'https' : 'http'\n \"#{scheme}://#{name}\"\n else\n # Taken from Aws::S3::Endpoints module\n unless client.config.regional_endpoint\n endpoint = client.config.endpoint.to_s\n end\n params = Aws::S3::EndpointParameters.new(\n bucket: name,\n region: client.config.region,\n use_fips: client.config.use_fips_endpoint,\n use_dual_stack: client.config.use_dualstack_endpoint,\n endpoint: endpoint,\n force_path_style: client.config.force_path_style,\n accelerate: client.config.use_accelerate_endpoint,\n use_global_endpoint: client.config.s3_us_east_1_regional_endpoint == 'legacy',\n use_object_lambda_endpoint: nil,\n disable_access_points: nil,\n disable_multi_region_access_points: client.config.s3_disable_multiregion_access_points,\n use_arn_region: client.config.s3_use_arn_region,\n )\n endpoint = Aws::S3::EndpointProvider.new.resolve_endpoint(params)\n endpoint.url\n end\n end", "def url(options = {})\n self.class.url_for(key, bucket.name, options)\n end", "def create_object(bucket_name, key, data, headers = {}, meta_headers = {}, acl = :private)\n headers = headers.dup\n meta_headers.each do |k,v|\n headers[k =~ /^x-amz-meta-/i ? k : \"x-amz-meta-#{k}\"] = v\n end\n headers['x-amz-acl'] = acl.to_s.gsub(/_/, '-')\n\n response = send_s3_request('PUT', :bucket => bucket_name, :key => key, :headers => headers, :data => data)\n response.is_a?(Net::HTTPSuccess)\n end", "def put(bucket, key, object=nil, headers={})\n object = S3Object.new(object) if not object.instance_of? S3Object\n return generate_url('PUT', bucket, CGI::escape(key), {}, merge_meta(headers, object))\n end", "def do_manual_signing(bucket_name, object_name, options)\n sts = AWS::STS.new\n\n policy = AWS::STS::Policy.new\n policy.allow(:actions => [\"s3:GetObject\"], :resources => \"arn:aws:s3:::#{bucket_name}/#{object_name}\")\n duration = options[:expires] - Time.now\n session = sts.new_federated_session(\"TemporaryUser\", :policy => policy, :duration => duration.to_i)\n\n access_key_id=session.credentials[:access_key_id]\n secret_access_key = session.credentials[:secret_access_key]\n security_token = session.credentials[:session_token]\n expiration = options[:expires].to_i\n\n string_to_sign = \"GET\\n\\n\\n#{expiration}\\nx-amz-security-token:#{security_token}\\n/#{bucket_name}/#{object_name}\"\n\n signature = CGI.escape(\n Base64.encode64(\n OpenSSL::HMAC.digest(\n OpenSSL::Digest::Digest.new('sha1'),\n secret_access_key, string_to_sign)).gsub(\"\\n\",\"\"))\n\n scheme = if options[:secure] == false\n \"http\"\n else\n \"https\"\n end\n\n url = \"https://s3.amazonaws.com/#{bucket_name}/#{object_name}?AWSAccessKeyId=#{access_key_id}&Expires=#{expiration}&Signature=#{signature}&x-amz-security-token=#{CGI.escape(security_token)}\"\n url = \"#{scheme}://#{bucket_name}.s3.amazonaws.com/#{object_name}?AWSAccessKeyId=#{access_key_id}&Expires=#{expiration}&Signature=#{signature}&x-amz-security-token=#{CGI.escape(security_token)}\"\n puts url\nend", "def s3_upload( file_name, destination_name )\n #log(\"Uploading #{file_name} to S3 as #{destination_name} ...\")\n #load keys\n json = File.read(S3KEYS)\n ak = JSON.parse(json)\n aws_access_key_id = ak['aws_access_key_id'] \n aws_secret_access_key = ak['aws_secret_access_key']\n\n #establish S3 connection \n s3 = RightAws::S3.new(aws_access_key_id, aws_secret_access_key, {:logger =>Logger.new( File.open( LOG_FILE, 'a' ) )})\n bucket = s3.bucket(IOS_BUILDS_BUCKET)\n #upload file \n file = File.open( file_name )\n bucket.put( destination_name, file ) \nend", "def s3_resource(**opt)\n client = opt[:client] || s3_client(**opt)\n Aws::S3::Resource.new(client: client)\n end", "def download_url\n s3 = AWS::S3.new\n bucket = s3.buckets[ENV[\"S3_BUCKET\"]]\n object = bucket.objects[self.aws_root_to_self_path]\n object.url_for(:get, { \n expires: 10.minutes,\n response_content_disposition: 'attachment;'\n }).to_s\n end", "def public_url(bucket_name:, key:)\n \"https://#{bucket_name}.s3.amazonaws.com/#{key}\"\n end", "def public_url(options = {})\n url = URI.parse(bucket.url(options))\n url.path += '/' unless url.path[-1] == '/'\n url.path += key.gsub(/[^\\/]+/) { |s| Seahorse::Util.uri_escape(s) }\n url.to_s\n end", "def initialize(data_source, *opts)\n @data_source = data_source\n @s3_bucket = AWS::S3.new.buckets[@data_source.s3_path[/s3:\\/\\/([\\w-]+)\\//,1]]\n @s3_obj = @s3_bucket.objects[@data_source.s3_path[/s3:\\/\\/[\\w-]+\\/(.*)/,1]]\n end", "def copy_s3_to_server(filename, config)\n puts \"Copying #{filename} from S3 to server...\"\n\n s3 = Aws::S3::Client.new\n signer = Aws::S3::Presigner.new(client: s3)\n url = signer.presigned_url(:get_object,\n { expires_in: 3600,\n bucket: config['s3_bucket'],\n key: filename,\n secure: true\n }\n )\n\n remote_directory = \"#{config['remote_directory']}/audio\"\n remote_path = \"#{remote_directory}/#{filename}\"\n `ssh #{config['server']} \"mkdir -p #{remote_directory} && curl '#{url}' > #{remote_path}\"`\nend", "def store(s3_path, body, bucket, options = {})\n params = {\n key: s3_path,\n body: body,\n bucket: bucket\n }\n options.merge!({server_side_encryption: 'aws:kms',\n ssekms_key_id: key_id,\n acl: \"private\"\n })\n\n client.put_object(params.merge(options))\n\n end", "def save(opts)\n puts \"Storing #{opts[:bucket]}/#{opts[:name]}...\"\n AWS::S3::S3Object.store(opts[:name], opts[:blob], opts[:bucket], {\n :cache_control => 'max-age=315360000, public',\n :expires => (Time.now + 315360000).httpdate,\n :access => opts[:access]\n })\n end", "def get_presigned_url(bucket, object_key)\n url = bucket.object(object_key).presigned_url(:put)\n puts \"Created presigned URL: #{url}\"\n URI(url)\nrescue Aws::Errors::ServiceError => e\n puts \"Couldn't create presigned URL for #{bucket.name}:#{object_key}. Here's why: #{e.message}\"\nend", "def passport_url\n S3.object_url(self.passport_s3_key)\n end", "def retrieve_from_s3(node, source_file, destination_file)\n begin\n require 'aws-sdk'\n config = data_bag_config_for(node.chef_environment, DATA_BAG_AWS)\n s3_endpoint, bucket_name, object_name = parse_s3_url(source_file)\n\n if config.empty?\n AWS.config(:s3 => { :endpoint => s3_endpoint })\n else\n AWS.config(:access_key_id => config['access_key_id'],\n :secret_access_key => config['secret_access_key'],\n :s3 => { :endpoint => s3_endpoint })\n end\n\n object = get_s3_object(bucket_name, object_name)\n\n Chef::Log.debug(\"Downloading #{object_name} from S3 bucket #{bucket_name}\")\n ::File.open(destination_file, 'wb') do |file|\n object.read do |chunk|\n file.write(chunk)\n end\n Chef::Log.debug(\"File #{destination_file} is #{file.size} bytes on disk\")\n end\n rescue URI::InvalidURIError\n Chef::Log.warn(\"Expected an S3 URL but found #{source_file}\")\n raise\n end\n end", "def get_presigned_post_url_for(content_type, s3_path, bucket, options = {})\n post_policy = {\n key: s3_path,\n content_type: content_type,\n signature_expiration: Time.now + 900,\n server_side_encryption: 'aws:kms',\n server_side_encryption_aws_kms_key_id: key_id,\n content_length_range: min_file_size..max_file_size # allow max 20 MB and min 200 kb\n }\n\n post = Aws::S3::PresignedPost.new(\n credentials_obj,\n region,\n bucket,\n post_policy\n )\n end", "def s3_object(path)\n @task.s3_object(\"asgroup/#{@name}/#{path}\")\n end", "def store_s3_object(filename, contents, content_type = 'text/html')\n if Vaalit::AWS.connect?\n Rails.logger.info \"Store to S3, bucket: '#{bucket_name}', dir: '#{directory}', filename: '#{filename}'\"\n AWS::S3::S3Object.store(\"#{directory}/#{filename}\", contents, bucket_name, :content_type => \"#{content_type}; charset=utf-8\")\n else\n Rails.logger.debug \"Development mode. Not storing to S3: #{filename}\"\n end\n end", "def pull_from_s3\n FileUtils.mkdir_p File.dirname local_path\n file = open(local_path, \"wb\") {|f| f << open(s3_url(:orig=>true)).read }\n end", "def presigned_url(key)\n bucket = ENV['DEFAULT_BUCKET']\n signer = Aws::S3::Presigner.new(client: @s3_client)\n signer.presigned_url(:get_object, bucket: bucket, key: key)\n end", "def s3_url(thumbnail = nil)\n if attachment_options[:cname]\n [\"#{s3_protocol}#{bucket.name}\", full_filename(thumbnail)].join(\"/\")\n else\n [\"#{s3_protocol}#{s3_hostname}#{bucket.path_prefix}\", full_filename(thumbnail)].join(\"/\")\n end\n end", "def s3_delete object_url\n begin\n key = URI.decode object_url.sub(/^.*\\/\\/.+?\\//,'')\n AWS.s3.buckets[ENV['AWS_S3_BUCKET']].objects[key].delete\n rescue Exception => e\n logger.error \"S3 Error: #{e.inspect}\"\n return false\n end\n end", "def send_to_s3(img, name)\n s3_directory.files.create({\n key: \"#{name}.jpg\",\n body: img,\n public: true\n })\nend", "def upload(bucket, key)\n connect_to_s3\n AWS::S3::S3Object.store(key, File.open(temp_file_path, 'r'), bucket, :access => :public_read)\n AWS::S3::S3Object.url_for(key, bucket, :authenticated => false)\n end", "def s3_url\n if $current_user.present?\n object.get_s3_secure_url\n else\n nil\n end\n end", "def url(key, expires_in:, disposition:, filename:, content_type:)\n service(key)\n .url(key, expires_in: expires_in, disposition: disposition, filename: filename, content_type: content_type)\n end", "def download_s3_file\n run_callbacks :download_s3_file do\n @s3_local_object = download(@directory, @key)\n end\n end", "def uploadS3(name, file, prefz)\n return [false, \"S3 misconfigured\"] if prefz[:user].empty? && prefz[:host].empty? && prefz[:path].empty? && prefz[:url].empty? && prefz[:pass].empty?\n s3 = AFAmazonS3Client.alloc.initWithAccessKeyID(prefz[:user].strip, secret: prefz[:pass].strip)\n puts \"#{prefz[:user].strip.inspect} #{prefz[:pass].strip.inspect}\"\n bucket, path = prefz[:path].gsub(/^\\//, '').split('/', 2)\n s3.bucket = bucket\n NSLog(\"S3 bucket #{bucket}\")\n url = path.nil? ? \"https://#{prefz[:host]}/#{bucket}/\" : \"https://#{prefz[:host]}/#{bucket}/#{path}/#{name}\"\n NSLog(\"S3 destinationPath #{url}\")\n params = { \"Content-Type\" => \"image/png\", \"acl\" => \"public-read\" }\n s3.postObjectWithFile(file, destinationPath: \"/\", parameters: params,\n progress: lambda do |bytesWritten, totalBytesWritten, totalBytesExpectedToWrite|\n stats = (totalBytesWritten / (totalBytesExpectedToWrite * 1.0) * 100)\n NSLog(\"S3: #{file} uploaded #{stats}\")\n end,\n success: lambda do |response|\n NSLog(\"S3: #{file} uploaded successfully.\")\n uploadSuccess(url + \"/#{name}\")\n end,\n failure: lambda do |error|\n NSLog(\"S3: #{file} upload error: #{error.localizedDescription}\")\n uploadFailure(\"S3 Error: #{error.localizedDescription}\")\n end\n )\n nil\n end", "def s3_uri\n File.join(settings[:bucket] =~ %r{^s3://}i ? settings[:bucket].to_s : \"s3://#{settings[:bucket]}\", \"\") # always use a traling '/' with s3cmd\n end", "def url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:, custom_metadata: {})\n raise NotImplementedError\n end", "def s3(s3_bucket, artifact_path)\n @url = \"https://s3.amazonaws.com/#{s3_bucket}/#{artifact_path}\"\n parse_url\n self\n end", "def put(io_streams, as=io_streams.map{|file| File.basename(file)})\n batch(io_streams) do |stream, i|\n dest = as[i]\n yield(stream, dest) if block_given?\n begin\n s3.buckets[@bucket_name].objects[dest].write(stream, :acl => :public_read)\n rescue AWS::S3::Errors::NoSuchBucket\n s3.buckets.create(@bucket_name, :acl => :public_read)\n stream.rewind\n retry\n end #begin\n file_to_url(dest)\n end #batch\n end", "def run_me\n bucket_name = \"doc-example-bucket\"\n object_key = \"my-file.txt\"\n region = \"us-west-2\"\n private_key_file = \"my-private-key.pem\"\n private_key = OpenSSL::PKey::RSA.new(File.read(private_key_file))\n\n # When initializing this Amazon S3 encryption client, note:\n # - For key_wrap_schema, use rsa_oaep_sha1 for asymmetric keys.\n # - For security_profile, for reading or decrypting objects encrypted\n # by the v1 encryption client, use :v2_and_legacy instead.\n s3_encryption_client = Aws::S3::EncryptionV2::Client.new(\n encryption_key: private_key,\n key_wrap_schema: :rsa_oaep_sha1,\n content_encryption_schema: :aes_gcm_no_padding,\n security_profile: :v2,\n region: region\n )\n puts \"The content of '#{object_key}' in bucket '#{bucket_name}' is:\"\n puts download_object_with_private_key_encryption(\n s3_encryption_client,\n bucket_name,\n object_key\n )\nend", "def connect(options)\n o = options.slice(:access_key_id, :secret_access_key, :server, :port, :use_ssl, :persistent, :proxy)\n AWS::S3::Base.establish_connection!(o.dup) # establish_connection! modifies the hash\n @connection_options = o\n end", "def generate_url(method, bucket=\"\", key=\"\", path_args={}, headers={})\n expires = 0\n if not @expires_in.nil?\n expires = Time.now.to_i + @expires_in\n elsif not @expires.nil?\n expires = @expires\n else\n raise \"invalid expires state\"\n end\n\n canonical_string =\n S3::canonical_string(method, bucket, key, path_args, headers, expires)\n encoded_canonical =\n S3::encode(@aws_secret_access_key, canonical_string)\n \n url = CallingFormat.build_url_base(@protocol, @server, @port, bucket, @calling_format)\n \n path_args[\"Signature\"] = encoded_canonical.to_s\n path_args[\"Expires\"] = expires.to_s\n path_args[\"AWSAccessKeyId\"] = @aws_access_key_id.to_s\n arg_string = S3.path_args_hash_to_string(path_args) \n\n return \"#{url}/#{key}?#{arg_string}\"\n end", "def store(data)\n establish_s3_connection\n bucket = s3keys[\"bucket\"]\n ensure_bucket_exists(bucket)\n \n conn = AWS::S3.new\n obj = conn.buckets[bucket].objects[key]\n obj.write(data)\n end", "def object(key)\n AWS::S3::S3Object.new(bucket, \"#{@path}#{key}\")\n end", "def connect_to_s3\n config = {\n provider: 'AWS',\n aws_access_key_id: ENV['IMAGO_S3_KEY'],\n aws_secret_access_key: ENV['IMAGO_S3_SECRET'],\n path_style: true\n }\n Fog::Storage.new(config)\nend", "def url(id, **options)\n if options.key? :expires\n signed_url = storage.signed_url(@bucket, object_name(id), **options)\n signed_url.gsub!(/storage.googleapis.com\\/#{@bucket}/, @host) if @host\n signed_url\n else\n host = @host || \"storage.googleapis.com/#{@bucket}\"\n \"https://#{host}/#{Addressable::URI.encode_component(object_name(id), Addressable::URI::CharacterClasses::PATH)}\"\n end\n end", "def s3_updatefile(filename, filedata)\n s3_deletefile filename\n #AWS::S3::S3Object.store filename, filedata, QBUCKET.to_s, :access => :public_read\n AWS::S3::S3Object.store filename, filedata, IMAGES_BUCKET.to_s, :access => :public_read\n end", "def run_me\r\n bucket_name = 'doc-example-bucket'\r\n object_key = 'my-file.txt'\r\n local_path = \"./#{object_key}\"\r\n region = 'us-west-2'\r\n s3_client = Aws::S3::Client.new(region: region)\r\n\r\n if object_downloaded?(s3_client, bucket_name, object_key, local_path)\r\n puts \"Object '#{object_key}' in bucket '#{bucket_name}' \" \\\r\n \"downloaded to '#{local_path}'.\"\r\n else\r\n puts \"Object '#{object_key}' in bucket '#{bucket_name}' not downloaded.\"\r\n end\r\nend", "def s3_write(key, value)\n @s3.put_object(bucket: ENV.fetch(\"AWS_BUCKET\"), key: key, body: value,\n content_type: \"text/plain; charset=utf-8\")\n end", "def s3_protocol\n attachment_options[:use_ssl] ? \"https://\" : \"http://\"\n end", "def bucket; ::AWS::S3.new( { :secure => false } ).buckets[DC::SECRETS['bucket']]; end", "def url_for(software)\n \"http://#{Config.s3_bucket}.s3.amazonaws.com/#{S3Cache.key_for(software)}\"\n end", "def aws_S3_bucket_get(opts)\n AWS::S3.new.buckets[opts[:name]]\n end", "def aws_call\n s3_object = AMAZON_S3_CLIENT.bucket(bucket_name).object(renamed_filename)\n s3_object.upload_file(\n file,\n metadata: file_metadata,\n content_type: 'text/csv'\n )\n end", "def parse_s3_url(source_url)\n protocol, s3_endpoint, bucket_and_object = URI.split(source_url).compact\n path_parts = bucket_and_object[1..-1].split('/')\n bucket_name = path_parts[0]\n object_name = path_parts[1..-1].join('/')\n [s3_endpoint, bucket_name, object_name]\n end", "def request_params(params)\n headers = params[:headers] || {}\n\n if params[:scheme]\n scheme = params[:scheme]\n port = params[:port] || DEFAULT_SCHEME_PORT[scheme]\n else\n scheme = @scheme\n port = @port\n end\n if DEFAULT_SCHEME_PORT[scheme] == port\n port = nil\n end\n\n if params[:region]\n region = params[:region]\n host = params[:host] || region_to_host(region)\n else\n region = @region || DEFAULT_REGION\n host = params[:host] || @host || region_to_host(region)\n end\n\n path = params[:path] || object_to_path(params[:object_name])\n path = '/' + path if path[0..0] != '/'\n\n if params[:bucket_name]\n bucket_name = params[:bucket_name]\n\n if params[:bucket_cname]\n host = bucket_name\n else\n path_style = params.fetch(:path_style, @path_style)\n if !path_style\n if COMPLIANT_BUCKET_NAMES !~ bucket_name\n Fog::Logger.warning(\"fog: the specified s3 bucket name(#{bucket_name}) is not a valid dns name, which will negatively impact performance. For details see: https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html\")\n path_style = true\n elsif scheme == 'https' && !path_style && bucket_name =~ /\\./\n Fog::Logger.warning(\"fog: the specified s3 bucket name(#{bucket_name}) contains a '.' so is not accessible over https as a virtual hosted bucket, which will negatively impact performance. For details see: https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html\")\n path_style = true\n end\n end\n\n # uses the bucket name as host if `virtual_host: true`, you can also\n # manually specify the cname if required.\n if params[:virtual_host]\n host = params.fetch(:cname, bucket_name)\n elsif path_style\n path = bucket_to_path bucket_name, path\n elsif host.start_with?(\"#{bucket_name}.\")\n # no-op\n else\n host = [bucket_name, host].join('.')\n end\n end\n end\n\n ret = params.merge({\n :scheme => scheme,\n :host => host,\n :port => port,\n :path => path,\n :headers => headers\n })\n\n #\n ret.delete(:path_style)\n ret.delete(:bucket_name)\n ret.delete(:object_name)\n ret.delete(:region)\n\n ret\n end", "def url(key, public: @default_public, **options)\n if public\n public_url(key)\n else\n presigned_url(key, **options)\n end\n end", "def s3\n @s3 ||= storage.directories.get(remote).tap do |bucket|\n if setup_website == true\n bucket.public = true\n bucket.save\n storage.put_bucket_website(remote, 'index.html', key: 'error.html')\n end\n\n if redirect == true\n log \"Should be creating a redirect bucket\"\n end\n end\n end", "def handle_s3_options(options) # :nodoc:\n options = options[GLI::Command::PARENT] until options.key?(:destination)\n options[:destination] = nil if options[:destination] == :default\n\n s3_config = cartage.config(for_plugin: :s3)\n destination = (options[:destination] || s3_config.destination || :default).to_sym\n\n unless s3_config.dig(:destinations, destination)\n message = if options[:destination] || s3_config.destination\n \"Destination '#{destination}' does not exist.\"\n else\n 'Default destination does not exist.'\n end\n fail ArgumentError, message\n end\n\n s3_config.destination = destination\n end", "def download_s3_file(image_info, *sightings_count)\n\n folder = image_info[0]\n filename = image_info[1]\n bucket = \"prototype-jv\"\n s3_file_path = \"#{folder}/#{filename}\"\n\n if sightings_count\n sightings_count = sightings_count[0]\n subdirectory = folder.split(\"/\")[1]\n sightings_dir = create_directory(subdirectory, sightings_count)\n swap_file = \"#{sightings_dir}/#{filename}\"\n else\n swap_file = \"./public/swap/#{filename}\" # use when running via app.rb\n # swap_file = \"../public/swap/#{file}\" # use when running locally from /lib/s3_bucket.rb\n end\n\n s3 = connect_to_s3()\n file = File.new(swap_file, 'wb')\n s3.get_object({ bucket:bucket, key:s3_file_path }, target: swap_file)\n file.close if file\n\nend", "def download_file(bucket_name:, key:, local_path:)\n s3_resource.bucket(bucket_name).object(key).download_file(local_path)\n end", "def upload_bucket\n ::AWS::S3.new( { :secure => false } ).buckets['s3.documentcloud.org']\n end", "def configure_s3_bucket\n connection = Fog::Storage.new(:provider => 'AWS',\n :aws_access_key_id => Constants::S3_ACCESS_KEY_ID,\n :aws_secret_access_key => Constants::S3_SECRET_ACCESS_KEY)\n\n connection.directories.create(:key => Constants::S3_BUCKET_NAME,\n :public => true)\n end", "def bucket; ::AWS::S3.new({ secure: true }).buckets[DC::SECRETS['bucket']]; end", "def upload_to_s3(info, file_name)\n bucket_name = 'techops-tests'\n\n to_json_file(info, file_name)\n\n s3 = Aws::S3::Resource.new(\n region: 'ap-southeast-2',\n access_key_id: $options[:s3_key],\n secret_access_key: $options[:s3_secret]\n )\n\n file = File.basename file_name\n obj = s3.bucket(bucket_name).object(file)\n\n if obj.upload_file(file)\n puts \"Uploaded #{file} to bucket #{bucket_name}\"\n File.delete(file_name)\n else\n puts \"Could not upload #{file} to bucket #{bucket_name}!\"\n end\nend", "def s3_upload(item)\n filepath = item.zip_file_path\n s3_key = item.s3_path\n s3_path = \"s3://#{s3_bucket}/#{s3_key}\"\n message = \"Uploading: #{filepath} to #{s3_path}\".color(:green)\n message = \"NOOP: #{message}\" if @options[:noop]\n puts message\n return if @options[:noop]\n\n s3.put_object(\n body: IO.read(filepath),\n bucket: s3_bucket,\n key: s3_key,\n )\n end", "def s3_presigned_url(template_output_path)\n template_path = template_output_path.sub('output/templates/','')\n key = \"#{@prefix}/#{template_path}\"\n s3_presigner.presigned_url(:get_object, bucket: s3_bucket, key: key)\n end", "def object_copied_with_additional_properties?(\r\n s3_client,\r\n source_object_path,\r\n target_bucket_name,\r\n target_object_path,\r\n canned_acl = 'private',\r\n storage_class = 'STANDARD'\r\n)\r\n s3_client.copy_object(\r\n bucket: target_bucket_name,\r\n copy_source: source_object_path,\r\n key: target_object_path,\r\n acl: canned_acl,\r\n storage_class: storage_class\r\n )\r\n return true\r\nrescue StandardError => e\r\n puts \"Error copying object: #{e.message}\"\r\n return false\r\nend", "def copy_object(source_bucket_name, source_key, destination_bucket_name = nil, destination_key= nil, headers = nil, meta_headers = nil)\n raise ArgumentError.new('You must include one of destination_bucket_name, destination_key or headers to be replaced') if destination_bucket_name.nil? && destination_key.nil? && headers.nil? && meta_headers.nil?\n\n headers = {\n 'x-amz-copy-source' => \"/#{source_bucket_name}/#{source_key}\",\n 'x-amz-metadata-directive' => (((destination_bucket_name.nil? && destination_key.nil?) || !(headers.nil? || meta_headers.nil?)) ? 'REPLACE' : 'COPY')\n }.merge(headers||{})\n meta_headers.each do |k,v|\n headers[k =~ /^x-amz-meta-/i ? k : \"x-amz-meta-#{k}\"] = v\n end unless meta_headers.nil?\n\n destination_bucket_name ||= source_bucket_name\n destination_key ||= source_key\n\n response = send_s3_request('PUT', :bucket => destination_bucket_name, :key => destination_key, :headers => headers, :data => nil)\n if response.is_a?(Net::HTTPSuccess)\n #Check for delayed error (See http://docs.amazonwebservices.com/AmazonS3/2006-03-01/RESTObjectCOPY.html#RESTObjectCOPY_Response)\n response_body = response.body\n if response_body =~ /<Error>/i\n raise Awsum::Error.new(response)\n else\n true\n end\n end\n end", "def run_me\r\n source_object_path = 'doc-example-bucket/my-file.txt'\r\n target_bucket_name = 'doc-example-bucket1'\r\n target_object_path = 'copied-files/my-copied-file.txt'\r\n canned_acl = 'bucket-owner-read'\r\n storage_class = 'STANDARD_IA'\r\n region = 'us-west-2'\r\n s3_client = Aws::S3::Client.new(region: region)\r\n\r\n if object_copied_with_additional_properties?(\r\n s3_client,\r\n source_object_path,\r\n target_bucket_name,\r\n target_object_path,\r\n canned_acl,\r\n storage_class\r\n )\r\n puts \"Object copied from '#{source_object_path}' to \" \\\r\n \"'#{target_bucket_name}/#{target_object_path}'.\"\r\n else\r\n puts \"Object '#{source_object_path}' not copied to \" \\\r\n \"'#{target_bucket_name}/#{target_object_path}'.\"\r\n end\r\nend", "def uribase\n \"http://#{ENV['S3_BUCKET']}.#{ENV[\"S3_HOST\"]}/\"\n end", "def store!(file)\n file_path = file.is_a?(String) ? file : file.path\n basename = file.is_a?(String) ? File.basename(file) : file.original_filename\n\n # Upload the file\n o = s3_bucket.objects[\"#{asset_path}#{basename}\"]\n o.write(Pathname.new(file_path), {\n acl: :public_read,\n content_type: MIME::Types.type_for(file_path).first.to_s\n })\n\n # Set the public_url attribute\n remote_url = o.public_url.to_s\n self.set(public_url: remote_url)\n self.this.update(public_url: remote_url)\n end", "def s3_client(**opt)\n opt.slice!(*client_params) if opt.present?\n Aws::S3::Client.new(S3_OPTIONS.merge(opt))\n end", "def upload_file(bucket_key,file_location,file_name,access_token)\n file_uploaded = File.new(file_location, 'rb')\n response = RestClient.put(\"#{API_URL}/oss/v2/buckets/#{bucket_key}/objects/#{file_name}\",\n file_uploaded,\n { Authorization: \"Bearer #{access_token}\", content_type:'application/octet-stream'})\n return response\nend", "def url_for(attachment, thumbnail = nil, options = nil)\n options = options ? @options.merge(options) : @options\n if options.key?(:expires_in) || options.key?(:auth) || options.key?(:authenticated)\n S3Object.url_for(attachment.s3.path(thumbnail), options[:bucket_name], options.slice(:expires_in, :use_ssl))\n else\n File.join(protocol(options) + hostname(options) + port_string(options), bucket_name(options), attachment.s3.path(thumbnail))\n end\n end", "def download(bucket, key)\n connect_to_s3\n @temp_file_path = File.join(Dir.tmpdir, key.gsub('/', '-'))\n File.open(temp_file_path, 'w+') do |f|\n f.puts AWS::S3::S3Object.value(key,bucket)\n end\n end", "def download(aFilename,aBucketName,aObjectName=nil)\n\t\taObjectName ||= File.basename(aFilename)\n\t\t#AWS::S3::S3Object.store(aObjectName, MiscUtils.string_from_file(aFilename), aBucketName)\n\t\tMiscUtils.string_to_file(get_content(aObjectName,aBucketName),aFilename)\n\tend", "def punch\n s3 = Aws::S3::Resource.new(region: ENV['S3_REGION'])\n obj = s3.bucket(ENV['S3_BUCKET']).object(@name)\n \n begin\n # Upload the file\n obj.upload_file(\n @file.path,\n content_type: MimeMagic.by_path(@file.path).type,\n acl:'public-read'\n )\n rescue => e\n Rails.logger.error { \"#{e.message} #{e.backtrace.join(\"\\n\")}\" }\n return false\n end\n \n # Create an object for the upload\n return upload = {\n file_name: obj.key,\n file_url: obj.public_url,\n file_type: obj.content_type,\n file_size: obj.size\n }\n \n end", "def url(key, expires_in:, disposition:, filename:, content_type:)\n instrument :url, key: key do |payload|\n payload[:url] = storage.temporary_url(\n key,\n 'GET',\n expires_in: expires_in,\n disposition: disposition,\n filename: filename\n )\n payload.fetch(:url)\n end\n end" ]
[ "0.7616379", "0.70911175", "0.70848083", "0.6966969", "0.69305545", "0.69188815", "0.6884549", "0.684006", "0.67821604", "0.6776867", "0.6675158", "0.6628062", "0.65868205", "0.65844613", "0.65805537", "0.6515453", "0.65040946", "0.6438879", "0.6428283", "0.6386645", "0.6381093", "0.63778687", "0.63627595", "0.6338802", "0.6334986", "0.63316405", "0.6331568", "0.6322835", "0.62913996", "0.6280252", "0.6272341", "0.6260618", "0.6254263", "0.6235748", "0.62130475", "0.61961734", "0.6176996", "0.61564434", "0.6146765", "0.6143994", "0.6123496", "0.60966074", "0.6093017", "0.60904396", "0.6066717", "0.60595363", "0.60568136", "0.6042259", "0.6039623", "0.6020774", "0.6020514", "0.60187286", "0.60135245", "0.5974729", "0.5968116", "0.59640306", "0.5947026", "0.5946433", "0.59381956", "0.59246904", "0.5910101", "0.59087914", "0.5908087", "0.5903989", "0.59031844", "0.58905554", "0.5886905", "0.587908", "0.5877377", "0.5874047", "0.5871142", "0.5869878", "0.58694386", "0.58665985", "0.5865138", "0.5853066", "0.5846019", "0.5844748", "0.584359", "0.584168", "0.5818455", "0.5811857", "0.5810811", "0.5808065", "0.58076334", "0.58068943", "0.5797001", "0.57951677", "0.5793299", "0.57878494", "0.57751346", "0.5774209", "0.57675594", "0.5767258", "0.57590014", "0.5756469", "0.5754113", "0.57528985", "0.57400644", "0.5735843" ]
0.76563823
0
In controller actions, use this private method to access sea params from forms.
def sea_params params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def params() request.params end", "def form_fields\n params\n end", "def form_params\n params[:form]\n end", "def params\n controller.params\n end", "def params\n @controller.params\n end", "def params\n @controller.params\n end", "def controller_params\n @controller.params\n end", "def get_params\n @set_params\n end", "def request_params; end", "def params\n @_params ||= ActionController::ManagebleParameters.new(request.parameters)\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 form_params\n @form_params ||= FormParamsController.new config\n end", "def params\n request.params\n end", "def params\n request.params\n end", "def form_params\n params.fetch(:form, {})\n end", "def params\n @params\n end", "def params\n @params\n end", "def params\n @params\n end", "def params\n @params\n end", "def params\n @request.params\n end", "def user_params\n end", "def student_params\n params[:student]\n end", "def user_params\r\n end", "def params\n _params\n end", "def params\n @_params\n end", "def site_admin_params\n params[:site_admin]\n end", "def params\n return @params\n end", "def params\n @request.params\n end", "def model_params\n request.params[model.params_name]\n end", "def form_field_params\n params[:form_field]\n end", "def form_params\n location_args.merge(units: @units, appid: @api_key)\n end", "def get_form_vars\n @sm = @edit[:sm_id] ? StorageManager.find_by_id(@edit[:sm_id]) : StorageManager.new\n\n @edit[:new][:name] = params[:name] if params[:name]\n @edit[:new][:hostname] = params[:hostname] if params[:hostname]\n @edit[:new][:ipaddress] = params[:ipaddress] if params[:ipaddress]\n @edit[:new][:port] = params[:port] if params[:port]\n @edit[:new][:sm_type] = params[:sm_type] if params[:sm_type]\n # @edit[:new][:agent_type] = params[:agent_typ] if params[:agent_typ]\n @edit[:new][:zone] = params[:server_zone] if params[:server_zone]\n\n @edit[:new][:userid] = params[:userid] if params[:userid]\n @edit[:new][:password] = params[:password] if params[:password]\n @edit[:new][:verify] = params[:verify] if params[:verify]\n restore_password if params[:restore_password]\n set_verify_status\n end", "def input_params\n self.params.input_param\n end", "def valid_params_request?; end", "def coolstuff_params\n params[:coolstuff]\n end", "def params\n @@params\n end", "def inicio_params\n params.fetch(:inicio, {})\n end", "def home_params\n end", "def usuario_params\n \n end", "def student_params\n params[:student]\n end", "def student_params\n params[:student]\n end", "def form_params\n params.require(:form).permit(:name, :alias, :type, :active, :structure_id, :user_id)\n end", "def m_site_params\n #params.fetch(:m_site, {})\n end", "def setting_params\n params[:setting]\n end", "def content_form_params\n params.require(form_param_key).permit!\n end", "def home_params\n params.fetch(:nyse, {})\n end", "def settings_params\n params[:settings]\n end", "def user_params\nend", "def informacao_params\n params[:informacao]\n end", "def system_control_params\r\n # params.fetch(:system_control, {})\r\n permitted_params.system_control\r\n end", "def request_params\n @request.params\n rescue\n {}\n end", "def form_params\n params.fetch(:form, {}).permit(:key, :name)\n end", "def anatomic_site_params\n params[:anatomic_site]\n end", "def extra_params\n params.except(:controller,:action,:id, :perform)\n end", "def jquery_form_params\n params[:jquery_form]\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 show_params\n params[:show]\n end", "def params_to_pass\n settings\n end", "def update_params\n raise 'Sovrascrivi in figli'\n end", "def form; end", "def admin_params\n params[:admin]\n end", "def admin_params\n params[:admin]\n end", "def user_params\n params[:user]\n end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def admin_craftsman_params\n params.fetch(:admin_craftsman, {})\n end", "def especie_region_params\n params[:especie_region]\n end", "def user_params\n params[:user]\n end", "def user_params\n params[:user]\n end", "def estate_params\n params[:estate]\n end", "def estate_params\n params[:estate]\n end", "def form_data\n session[\"form_data\"].nil? ? params : JSON.parse(session[\"form_data\"])\n end", "def params\n @params ||= {}\n end", "def params\n @params ||= {}\n end", "def params\n RequestStore.store[:params]\n end", "def submitted_exam_regis_form_params\n params.fetch(:submitted_exam_regis_form, {})\n end", "def query ; @request.params ; end", "def user_params\r\n params[:user]\r\n end", "def form_params\n params.require(:form).permit(:name, :user_id, :search, :description, :parent_id,\n :status, :version_independent_id, :control_number)\n end", "def dashboard_params\n end", "def params\n return FormArray.new(@cobj.cur.clop.to_form)\n end", "def silla_params\n params[:silla]\n end", "def restaurant_params\n params[:restaurant]\n end", "def form\n end", "def all_params; end", "def params\n @params ||= {}\n end" ]
[ "0.70820314", "0.7014796", "0.69446135", "0.69291383", "0.6849251", "0.6849251", "0.6613801", "0.6535867", "0.6535169", "0.6525966", "0.64968646", "0.64948964", "0.6487594", "0.6487594", "0.647657", "0.64127517", "0.64103043", "0.64103043", "0.64103043", "0.63878864", "0.638628", "0.6353219", "0.63508797", "0.63112795", "0.6310343", "0.6277677", "0.6272706", "0.6264746", "0.625707", "0.62540275", "0.6250731", "0.62497044", "0.6248444", "0.6230795", "0.62307596", "0.6196199", "0.6192858", "0.6184328", "0.61687577", "0.6151056", "0.6151056", "0.6144648", "0.6139611", "0.6135172", "0.6130871", "0.61277294", "0.6122272", "0.611811", "0.6115796", "0.6115493", "0.6104542", "0.61025286", "0.610132", "0.60813737", "0.6078871", "0.6072053", "0.60677385", "0.6056118", "0.6053795", "0.60535336", "0.60534364", "0.60534364", "0.6051095", "0.6023614", "0.6023614", "0.6023614", "0.6023614", "0.6023614", "0.6023614", "0.6023614", "0.6023614", "0.6023614", "0.6023614", "0.6023614", "0.6023614", "0.6023614", "0.6023614", "0.6023614", "0.6023614", "0.6023614", "0.60181665", "0.6011278", "0.60102594", "0.60102594", "0.60060406", "0.60060406", "0.6003794", "0.6003389", "0.6003389", "0.59941596", "0.5991329", "0.59892", "0.59852374", "0.59836245", "0.59828997", "0.59796566", "0.5976213", "0.59659904", "0.5961859", "0.59547096", "0.5949398" ]
0.0
-1
Handles week dates of selected week
def call if second_week_selected == false handle_first_week elsif second_week_selected handle_second_week elsif second_week_selected.nil? clear_back_button_dates end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_week_of date\n monday = date - date.wday + 1\n friday = monday + 4\n select_range(monday, friday)\n end", "def week; end", "def select_current_week\n select_week_of Date.today\n end", "def change_week\n @tasks = @company.tasks\n @timesheet = Timesheet.new\n @timesheet.timesheet_line_items.build\n\n cur_week = params[:date].to_date\n @week = cur_week.beginning_of_week\n if params[:cur_week]== \"next_week\"\n @week = @week+ 7.days\n else\n @week = @week- 7.days\n end\n respond_to do |format|\n format.js\n end\n end", "def set_days_of_week\n @days_of_week = Date::DAYNAMES.each_with_index\n end", "def week\n self.range('week')\n end", "def week\n first_day_of_week = @date.monday\n \n days_of_week = []\n 7.times do |time|\n days_of_week << day_and_types(first_day_of_week + time.days)\n end \n \n days_of_week\n end", "def current_week\n\t\t#TODO\n\tend", "def week\n\t\t@@week\n\tend", "def reporthelp_week_selection( form, method )\n start_or_end = ( method == :range_week_start ) ? :start : :end\n\n form.grouped_collection_select(\n method,\n get_year_array(), # Use years for groups\n :weeks, # A years's \"weeks\" method returns its week list\n :title, # Use the year 'title' for the group labels\n :id, # A week's \"id\" method returns the value for an option tag\n start_or_end, # A week's \"start\" or \"end\" method is used for the option contents\n {\n :include_blank => '-'\n }\n )\n end", "def week\n @year = params[:year].to_i\n @month = params[:month].to_i\n @day = params[:day].to_i\n @date = Date.new(@year, @month, @day)\n @work_times = WorkTime.find_by_start_date(@date)\n end", "def set_week\n self.week = time_out.nil? ? time_in.beginning_of_week : time_out.beginning_of_week\n end", "def week\n @todoas = Todoa.where(user_id: current_user.id,done: false).where('due BETWEEN ? AND ?', Date.today, Date.today + 7.day)\n end", "def week\n @week ||= (((date-start_of_month)+1)/7.0).ceil\n end", "def week(date = Date.today)\n day = monday(date)\n (day..day + 6)\n end", "def week_index\n @week_index ||= date.wday\n end", "def weekday_options_for_select(selected = T.unsafe(nil), index_as_value: T.unsafe(nil), day_format: T.unsafe(nil), beginning_of_week: T.unsafe(nil)); end", "def week\n @date.cweek\n end", "def week\n @obj.date.strftime(\"%V\")\n end", "def ops_calendar\n # setup calendar cells\n @today = Date.today - 3\n if @today.strftime(\"%a\") == \"Mon\"\n @start_date = @today\n else\n @start_date = @today\n until @start_date.strftime(\"%a\") == \"Mon\"\n @start_date -= 1\n end\n end\n @end_date = @start_date+21\n @date_range = (@start_date..@end_date)\n @weeks = @date_range.to_a.in_groups_of(3)\n\n\n end", "def beginning_of_week; end", "def beginning_of_week; end", "def start_of_week; self - wday.days end", "def week_starting(selected_date = Date.today, branch_ids = @my_ys, class_sel = 'VINYASA YOGA',\n sched_type_ids = ['Group Exercise Schedule'], page_no = 0)\n\n branch_ids.map do |branch_id|\n if class_sel.is_a? Array\n class_sel.map do |c|\n post(URI(BASE_URL + 'fillscheduler'),\n {sched_type_ids: sched_type_ids.join(?,),\n branch_ids: branch_id,\n year: selected_date.year,\n month: selected_date.month,\n classSel: c,\n day: selected_date.day})\n end.flatten\n else\n post(URI(BASE_URL + 'fillscheduler'),\n {sched_type_ids: sched_type_ids.join(?,),\n branch_ids: branch_id,\n year: selected_date.year,\n month: selected_date.month,\n classSel: class_sel,\n day: selected_date.day})\n end\n end\n end", "def check_day_of_week\n if (selected_days.size - 1) > 0 && !selected_days.nil?\n d = Date.today\n weekday = Date::DAYNAMES[d.wday]\n selected_days.include?(weekday)\n else\n return true\n end\n end", "def week\n working_date = DateTime.new(self.year, 1, 1)\n working_date.week_day_start = self.week_day_start\n working_date = (working_date-working_date.send(\"wday_offset\"))\n week_num = 0\n working_date.step(self) { |a_day| \n if a_day.wday == _week_day_numbers.first\n week_num += 1\n end\n }\n week_num\n end", "def weeks() 7 * days end", "def betweenDates(index,week)\n if (index <= week[4].to_i)\n return week\n end\n return []\nend", "def setup_weeks(week_start)\n a_date = self.first\n the_last = self.last\n @weeks = []\n\n while (a_date < the_last)\n @weeks << Koyomi::Week.new(a_date, week_start)\n a_date += WEEK_DAYS\n end\n @weeks\n end", "def cweek\n end", "def day_of_week(date)\n 7 - date.cwday\n end", "def week_days(options={}, &block)\n start_date = self\n result = []\n (start_date-wday_offset).step 7 do |a_day|\n a_day.week_day_start = self.week_day_start\n if block_given?\n yield a_day\n else\n result.push(a_day)\n end\n end\n result\n end", "def week\n self.date ? self.date.strftime('%Y-%W') : ('0000-00')\n end", "def week_date_ranges\n (1..ReportWeeks).map do |week|\n begin_date = @start_date + (7*(week-1))\n begin_date .. (begin_date + 6)\n end\n end", "def week_from_today\n ::Date.today + 7\n end", "def week_days\n {\n \"1\" => 'mon',\n \"2\" => 'tue',\n \"3\" => 'wed',\n \"4\" => 'thu',\n \"5\" => 'fri',\n \"6\" => 'sat',\n \"7\" => 'sun'\n }\n end", "def set_week_variables(employee)\n start_date = params[:start_of_week] || Date.today.at_beginning_of_week\n @start_of_week = Date.parse(start_date.to_s)\n @end_of_week = @start_of_week + 6.days\n @week = @start_of_week..(@start_of_week + 6)\n\n @check_in_out_times = employee.check_in_out_times(@week)\n end", "def work_week=(days)\n config[:work_week] = days\n self._weekdays = nil\n end", "def start_week\n start_date.strftime('%W').to_i\n end", "def day_of_week\n\tif @current_time.wday == 0 || @current_time.wday == 6\n\t\tweek_period = \"Weekends\"\n\telse\n\t\tweek_period = \"Weekdays\"\n\tend\nend", "def editable_week( nextweek )\n discover_week( nextweek ) do | timesheet |\n ( timesheet.nil? or not timesheet.committed )\n end\n end", "def _week_day_numbers\n week_day_start = self.week_day_start\n week_day_start.capitalize if week_day_start.is_a? String\n [0, 1, 2, 3, 4, 5, 6].partition {|on| on >= day_names.index(week_day_start)%7 }.flatten\n end", "def quality_driven_software_export\n @from = Time.zone.now - 1.week\n @to = Time.zone.now\n end", "def choose_dates\n # Not multiple dates - just return the From date.\n return [@from] unless @multiple_dates\n\n # Multiple dates - return the array, adjusted as per input\n all_days = (@from..@to).to_a\n\n case @select\n when 'days'\n days = @dates.gsub(/\\s/, '').split(',')\n all_days.select { |date| days.include?(date.mday.to_s) }\n when 'specific_days'\n days = @specific_dates.gsub(/\\s/, '').split(',')\n days.map(&:to_date)\n when 'weekdays'\n raise DateChooserException, 'No days of the week selected' if @weekdays.weekdays.empty?\n raise DateChooserException, 'No weekly interval selected' if @interval&.empty?\n\n all_days.select do |date|\n next unless @weekdays.has_day?(date.wday)\n\n case @interval[:unit]\n when 'week'\n # 0 = first week, 1 = second week, 2 = third week, etc.\n nth_week = (date - @from).to_i / 7\n # true every 2nd week (0, 2, 4, 6, etc.)\n (nth_week % @interval[:level].to_i).zero?\n when 'week_of_month'\n week = @interval[:level].to_i\n (date.mday > (week - 1) * 7 && date.mday <= week * 7)\n end\n end\n else\n all_days\n end\n end", "def set_day_week\n @day_week = DayWeek.find(params[:id])\n end", "def set_week_day\n @week_day = WeekDay.find(params[:id])\n end", "def current_week\n week_split.select { |c| c.include?(day) }.flatten\n end", "def set_week_datum\n @week_datum = WeekDatum.find(params[:id])\n end", "def set_day_of_week\n @day_of_week = DayOfWeek.find(params[:id])\n end", "def mweek; (5 - wday + day) / 7 end", "def set_days_of_the_week\n days_of_the_week = DaysOfTheWeek.find(params[:id])\n end", "def current_week\n self.week.to_i\n end", "def week_datum_params\n params.require(:week_datum).permit(:week, :fan_duel, :yahoo, :dvoa, :fftoday)\n end", "def move_to_week_and_year!(week, year)\n wday = cwday\n wday = 7 if wday == 0 # sunday. bloody sunday\n\n *saved_hours = start_hour, end_hour\n *saved_minutes = start_minute, end_minute\n\n @date = Date.commercial(year, week, wday).in_time_zone.beginning_of_day\n self.starts_at = self.ends_at = self.week = self.year = nil\n self.start_hour, self.end_hour = *saved_hours\n self.start_minute, self.end_minute = *saved_minutes\n save!\n self\n end", "def showable_week( nextweek )\n discover_week( nextweek ) do | timesheet |\n ( not timesheet.nil? )\n end\n end", "def set_week\n @week = Week.find(params[:id])\n end", "def set_week\n @week = Week.find(params[:id])\n end", "def each_days_of_week(*wdays)\n if wdays.empty?\n each_days\n else\n each_days.except {|dt| !wdays.include?(dt.wday) }\n end\n end", "def index\n @day_of_weeks = DayOfWeek.all\n end", "def days_in_week(*days)\n @test_time = @time if @test_time.nil?\n x_in_list_of_y(@test_time.wday, Configuration.parse_range(days,0...7).flatten)\n end", "def display_week_chooser(current_week, selected_week)\n week_chooser_html = \"<label>Select week:</label>&nbsp&nbsp\n <select class='input-large' id='week_chooser'>\"\n 1.upto(current_week) { |week|\n week_chooser_html << \"<option value=\" + week.to_s\n week_chooser_html << \" selected\" if week == selected_week\n week_chooser_html << \">Week \" + week.to_s + \"</option>\"\n }\n week_chooser_html << \"</select>\"\n return week_chooser_html.html_safe\n end", "def select_wday(day = nil)\n day = Date.today.wday if day.nil?\n\n wday_symbol = if day.kind_of?(Integer)\n wday_symbol = case day\n when 0\n 'Su'\n when 1\n 'M'\n when 2\n 'T'\n when 3\n 'W'\n when 4\n 'R'\n when 5\n 'F'\n when 6\n 'Sa'\n end\n else\n day\n end\n\n @config['comics'].select {|c| c['update_schedule'].include?(wday_symbol)}\n end", "def test_start_of_week(p_date)\n if p_date.wday == 0 #sundays count as end of week for vehicle app\n return p_date - 6\n else\n (p_date - p_date.wday.days) + 1 #start on monday\n end\n end", "def date_in_week_param\n date_param(:scheduling_request, :date_in_week)\n end", "def index\n @day_of_week = event_days\n end", "def calendar_wdays(starting_day = 0)\n start_week = Date.today.beginning_of_week + (starting_day - 1).days # In rails week start in monday and monday.wday is 1\n (start_week...start_week+7.days).collect { |day| I18n.l(day, :format => '%A') }\n end", "def load_weekly_chart\n if params[:date]\n @e_date_str = params[:date]\n e_date = Date.parse(@e_date_str)\n @week_number = e_date.cweek-0\n else\n @week_number = params[:week].to_i\n# if params[:week] then\n# @week_number = params[:week].to_i\n# else\n# @week_number = (Date.today.cweek - 0)\n# end\n end\n\n if @week_number < 0 then\n @week_number = 1\n end\n if @week_number >52 then\n @week_number = @week_number - 52\n end\n\n logger.debug \"load weekly chart called\"\n @date_range_start = Date.commercial(Date.today.cwyear, @week_number, 1).strftime \"%m/%d/%y\" # 1/19/09 (Monday)\n @date_range_end = Date.commercial(Date.today.cwyear, @week_number, 7).strftime \"%m/%d/%y\" # 1/25/09 (Sunday)\n\n reports = EffortLog.find_by_sql([\"SELECT task_types.name, users.human_name, effort_log_line_items.sum FROM effort_log_line_items inner join effort_logs on effort_log_line_items.effort_log_id = effort_logs.id inner join users on users.id = person_id inner join task_types on task_type_id = task_types.id where course_id = ? and effort_logs.week_number = ? order by name, human_name\", params[:id], @week_number])\n\n @labels_array = []\n labels_index_hash = {}\n\n reports.each do |line|\n l_human_name = line.human_name\n if !labels_index_hash.has_key?(l_human_name)\n @labels_array << l_human_name\n labels_index_hash[l_human_name] = @labels_array.size\n end\n end\n\n #unless the user is a student, move them to be the first column of data\n unless current_user && (!current_user.is_staff? && !current_user.is_admin?) then\n @labels_array.each_index do |i|\n if @labels_array[i] == current_user.human_name then\n labels_index_hash[@labels_array[0]] = i+1\n labels_index_hash[current_user.human_name] = 1\n @labels_array[i] = @labels_array[0]\n @labels_array[0] = current_user.human_name\n end\n end\n @labels_array.each_index do |i|\n if @labels_array[i] != current_user.login then\n @labels_array[i] = 'anonymous'\n end\n end\n end\n\n if request.env[\"Anonymous\"] then\n @labels_array.each_index do |i|\n @labels_array[i] = 'anonymous'\n end\n end\n\n row_width = @labels_array.size + 1 #Plus one is the for an additional first column, the \"type\" label.\n current_task = \"\"\n current_task_chart_data_row = Array.new(row_width) { |i| \"0.0\" }\n @chart_data = []\n reports.each do |line|\n if line.name == current_task\n current_task_chart_data_row[labels_index_hash[line.human_name]] = line.sum\n else\n if current_task != \"\" then\n @chart_data << current_task_chart_data_row\n current_task_chart_data_row = Array.new(row_width) { |i| \"0.0\" }\n end\n current_task = line.name\n current_task_chart_data_row[0] = line.name\n current_task_chart_data_row[labels_index_hash[line.human_name]] = line.sum\n end\n end\n @chart_data << current_task_chart_data_row\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :layout => false }\n end\n end", "def picker_weekday\n screenshot_and_raise \"weekday is not applicable to this mode\" if picker_is_in_time_mode or picker_is_in_countdown_mode\n res = query(\"datePickerWeekMonthDayView\", :weekdayLabel, :text)[2]\n # need to guard against Today showing\n res == nil ? Date.today.strftime('%a') : res\nend", "def weekday()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::Weekday::WeekdayRequestBuilder.new(@path_parameters, @request_adapter)\n end", "def all_week(start_day = Date.beginning_of_week)\n beginning_of_week(start_day)..end_of_week(start_day)\n end", "def parse_week\n @week = @@doc.xpath(\"//fixVersion\")[0].content\n end", "def week_calculations\n\t\t@first_of_month = @beg_range.to_date.beginning_of_month \n\t\t@last_of_month = @beg_range.to_date.beginning_of_month.next_month-1 \n\t\tif (@end_range+7).between?(@first_of_month, @last_of_month) \n\t\t\tif @beg_range.between?(@beg_range.prev_month.end_of_month, @beg_range.beginning_of_month+1) \n\t\t\t\t# <!--1st Week-->\n\t\t\t\t @prev_beg_range = @beg_range.prev_month.beginning_of_month + 4.weeks \n\t\t\t\t @prev_end_range = @end_range.prev_month.end_of_month \n\t\t\t\t\n\t\t\t\t @next_beg_range = @beg_range+7.days \n\t\t\t\t @next_end_range = @end_range+7.days \n\t\t\telse \n\t\t\t\t# <!--Middle Weeks-->\n\t\t\t\t @prev_beg_range = @beg_range-7.days \n\t\t\t\t @prev_end_range = @end_range-7.days \n\t\t\t\t\n\t\t\t\t @next_beg_range = @beg_range+7.days \n\t\t\t\t @next_end_range = @end_range+7.days \n\t\t\tend \n\t\telsif \n\t\t\tif @beg_range.next_week.beginning_of_week.between?(@first_of_month, @last_of_month) \n\t\t\t\t# <!--4th Week-->\n\t\t\t\t @prev_beg_range = @beg_range-7.days \n\t\t\t\t @prev_end_range = @end_range-7.days \n\t\t\t\t\n\t\t\t\t @next_beg_range = @beg_range+7.days \n\t\t\t\t @next_end_range = @end_range.end_of_month \t\t\n\t\t\telse \n\t\t\t\t# <!--5th Week-->\n\t\t\t\t @prev_beg_range = @beg_range-7.days \n\t\t\t\t @prev_end_range = @end_range-2.days \n\t\t\t\t\n\t\t\t\t @next_beg_range = @beg_range.next_month.beginning_of_month \n\t\t\t\t @next_end_range = @end_range.next_week.beginning_of_month+6.days \n\t\t\tend \n\t\tend \n\tend", "def dateselection\nend", "def convertDailyToWeeklyData()\n aggregateData(ChartDirector::ArrayMath.new(@timeStamps).selectStartOfWeek())\n end", "def cutoff_date\n case date.wday\n when 0\n date + (weeks.to_i * 7)\n when 1\n date + (weeks.to_i * 7) - 1\n when 2\n date + (weeks.to_i * 7) - 2\n when 3\n date + (weeks.to_i * 7) - 3\n when 4\n date + (weeks.to_i * 7) - 4\n when 5\n date + (weeks.to_i * 7) - 5\n when 6\n date + (weeks.to_i * 7) + 1\n end\n end", "def set_admin_week\n @week = Week.current_or_number(nil)\n end", "def weeks\n @weeks ||= days.slice_when do |day|\n Date::DAYNAMES[day.wday] == LAST_DAY_OF_THE_WEEK\n end.to_a\n end", "def weeks ; self * 7.days ; end", "def select_weekly_meeting_for_weekly_payment\n setup_for_select_weekly_meeting\n \n # select_weekly_meeting_for_weekly_payment_url(group_loan)\n \n add_breadcrumb \"#{t 'process.select_group_loan'}\", 'select_group_loan_for_weekly_payment_path'\n set_breadcrumb_for @group_loan, 'select_weekly_meeting_for_weekly_payment_url' + \"(#{@group_loan.id})\", \n \"#{t 'process.select_week'}\"\n end", "def weekly(options = {})\n branch options.merge(every: :week)\n end", "def weekly(options = {})\n branch options.merge(every: :week)\n end", "def w_day; end", "def week\n stamp = params[:stamp].to_i\n interval = (params[:interval] || 10).to_i\n plus_weeks = (params[:plus_weeks] || 0).to_i\n context = (params[:context] || 0).to_i == 1 ? true : false\n time = Time.at(stamp).utc\n\n # Calculate monday from given date\n wday = time.wday\n # Adjust for sunday when we want to start on a monday\n wday = 7 if wday == 0\n\n date = time - (wday.days - 1.days)\n\n date = date + plus_weeks.weeks\n\n # Number of days in week range if we add context, we add the surrounding weeks as well\n days = context ? (7 * 3) - 1 : 6\n\n # If context we'll start at the monday before\n if context\n date -= 7.days\n end\n\n\n\n week_data = []\n week_dates = []\n\n buckets = 0.step((60 * 24) - 1, interval).to_a\n\n (0..days).each do |day|\n interval_data = Hash.new { |h, k| h[k] = [] }\n\n data = GlucoseSensorData.by_day(date.to_date, :field => :timestamp)\n\n data.each do |datum|\n minutes = datum.timestamp.min + (datum.timestamp.hour * 60)\n # At first seems like a no op but this actually buckets minutes into intervals\n bucket = (minutes / interval) * interval\n\n interval_data[bucket] << datum\n end\n\n week_context = nil\n\n if context\n week_number = day / 7\n if week_number == 0\n week_context = \"before\"\n elsif week_number == 1\n week_context = \"current\"\n else\n week_context = \"after\"\n end\n else\n week_context = \"current\"\n end\n\n buckets.each do |bucket|\n datum = {}\n\n datums = interval_data[bucket]\n # Averages glucose values if there are more than one datum for that bucket\n if datums.length > 0\n datum[:glucose] = datums.inject(0.0) { |sum, d| sum + d.glucose } / datums.size\n #datum[:timestamp] = datums[0].timestamp.to_i\n end\n datum[:timestamp] = (date + bucket.minutes).to_i\n datum[:week_context] = week_context\n\n\n datum[:time] = bucket\n datum[:day] = date.strftime(\"%A\").downcase\n datum[:date] = date.to_i\n week_data << datum\n end\n\n week_dates.push({ :week_context => week_context, :day => date.strftime(\"%A\").downcase, :date => date.to_i })\n date += 1.days\n end\n\n render :json => { :data => week_data, :interval => interval, :week_dates => week_dates }\n end", "def send_on_date(n_weeks)\n today = category.user.today\n send_on_date = today + n_weeks * 7 + (send_on - today.wday % 7)\n send_on_date += 7 if today.wday > send_on\n send_on_date\n end", "def weekend_selection(chosen_weekend_activity)\n if chosen_weekend_activity <= 10\n puts \"\\n#{weekend_activities[chosen_weekend_activity-1][:description]}\"\n @selected_activity << weekend_activities[chosen_weekend_activity-1][:title] \n \n today_return_menu\n else\n if chosen_weekend_activity == 11\n welcome_header\n main_menu\n end\n end\n \n end", "def day_of_week\n start_on.strftime(WEEKDAY_NAME)\n end", "def beginning_of_week=(_arg0); end", "def beginning_of_week=(_arg0); end", "def day_week(date)\n day_week = \"--\"\n unless date.blank?\n case date.strftime(\"%A\")\n when \"Monday\"\n day_week = \"月\"\n when \"Tuesday\"\n day_week = \"火\"\n when \"Wednesday\"\n day_week = \"水\"\n when \"Thursday\"\n day_week = \"木\"\n when \"Friday\"\n day_week = \"金\"\n when \"Saturday\"\n day_week = \"土\"\n when \"Sunday\"\n day_week = \"日\"\n end\n else\n end\n return day_week\n end", "def get_week\n\t week = Time.now.strftime(\"%W\").to_i\n\t wday = Time.now.wday\n\t week = wday <= 3 ? week - 1 : week\n\t \t\n\t # registro = ActivityReport.find(:all, :conditions => {:volunteer_id => self.volunteer_id, :semana => week})\n\t registro = ActivityReport.where(volunteer_id: self.volunteer_id, semana: week)\n\t unless registro.empty?\n\t # DEPRECATION WARNING: ActiveModel::Errors#[]= is deprecated and will be removed in Rails 5.1. Use model.errors.add(:semana, \": Ya existe un registro de esta Semana\") instead. (called from get_week at /vagrant_data/hadronapp/app/models/activity_report.rb:35)\n\t errors[:semana] = \": Ya existe un registro de esta Semana\"\n\t return false\n \tend\n\tend", "def get_start_of_week(d)\n d -= DAY until d.monday?\n d\n end", "def wday() end", "def day_of_week(day)\n query_filters << \"day_of_week:#{day}\"\n self\n end", "def week_of_year(*weeks)\n merge(week: weeks)\n end", "def day_of_week\n # Date.wday returns 0-6 for Sunday,...Saturday\n return @day.wday\n end", "def day_of_week\n dnum = day\n dnum -= 10 if dnum > 20\n dnum -= 10 if dnum > 10\n dnum -= 1\n dnum\n end", "def weeks\n\t\tk = offset( first_day.cwday )\n\n [ first_week( k ) ] + middle_weeks( DPW - k )\n end", "def each_week(&block)\n each_day.each_slice 7, &block\n end", "def by_week(value, options = {})\n year = work_out_year(options[:year] || Time.now.year)\n # Dodgy!\n # Surely there's a method in Rails to do this.\n start_time = if value.class == Time || value.class == Date\n (value.strftime(\"%U\").to_i - 1).weeks\n year = value.year\n elsif value.to_i.class == Fixnum && value < 52\n Time.utc(year, 1, 1) + (value.to_i - 1).weeks\n else\n raise ParseError, \"by_week takes only a Time object, or a Fixnum (less than 52).\"\n end\n end_time = start_time + 1.week\n \n by_star(start_time, end_time, options)\n end", "def next_week\n if self.class == Date\n self + 7\n elsif self.class == Time\n self + (60 * 60 * 24 * 7)\n end\n end" ]
[ "0.7161699", "0.71419305", "0.7090581", "0.68558514", "0.6768556", "0.6749568", "0.6727322", "0.66664743", "0.6568979", "0.6563157", "0.6559211", "0.6544042", "0.65303725", "0.6510937", "0.64698166", "0.645941", "0.645748", "0.64471656", "0.6442897", "0.6440571", "0.6386128", "0.6386128", "0.6353492", "0.6352654", "0.63525647", "0.6338373", "0.6322697", "0.6311652", "0.63058496", "0.6265255", "0.62586194", "0.62515366", "0.6243803", "0.6227765", "0.62185013", "0.61995596", "0.61964077", "0.6158065", "0.61558884", "0.6152", "0.6142162", "0.61375", "0.6127727", "0.610739", "0.6101747", "0.6086443", "0.608453", "0.6054132", "0.60537803", "0.6033186", "0.603167", "0.60219723", "0.60180163", "0.60132223", "0.6011013", "0.59793454", "0.59793454", "0.5971852", "0.59685785", "0.596063", "0.5960244", "0.5957551", "0.5949205", "0.5946738", "0.5946727", "0.5943472", "0.5937778", "0.59367144", "0.5916079", "0.5911219", "0.5902992", "0.58986384", "0.58975106", "0.58884764", "0.58838695", "0.58831406", "0.58827794", "0.58822703", "0.58772177", "0.5873165", "0.5873165", "0.58685803", "0.58663005", "0.584145", "0.5840901", "0.5839571", "0.5839405", "0.5839405", "0.583898", "0.5833735", "0.58318764", "0.58312094", "0.5825384", "0.58173466", "0.5786391", "0.5785731", "0.5779828", "0.577965", "0.5778953", "0.57735926" ]
0.6847053
4
Stores first week back button date Removes all selected dates from session
def handle_first_week session[:first_week_back_button] = session[:first_week_start_date] session[:first_week_start_date] = nil session[:vehicle_details]['dates'] = [] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_back_button_dates\n session[:first_week_back_button] = nil\n session[:second_week_back_button] = nil\n end", "def handle_second_week\n session[:second_week_back_button] = session[:second_week_start_date]\n session[:second_week_start_date] = nil\n session[:vehicle_details]['dates'] = disable_week(session[:first_week_start_date])\n end", "def previous_week\n first_day = params[:beginning_of_current_week].to_date\n prev_week = first_day.prev_week\n\n @week_dates = (\n prev_week.at_beginning_of_week..prev_week.at_end_of_week\n ).to_a\n\n @availabilities_slots = AvailabilitiesConstant::AVAILABILITIES_SLOTS\n @expert = Expert.find(params[:expert_id])\n @month = Date::MONTHNAMES[prev_week.at_beginning_of_week.month]\n @year = params[:year] || prev_week.at_beginning_of_week.year\n # TODO: Pass the date selected to the next previous of the calendar\n # @dates_selected = params[:date_selected] || []\n # @package_option = params[:package_option] || 5\n @appointment_pack = AppointmentPack.new\n\n # Preserve dates_selected in sessions\n session[:dates_selected] = params[:dates_selected]\n end", "def remove_fixed_date\n session[:date] = nil\n flash[:success] = t('activerecord.operations.category.fix_date_ok') + \" #{l(Date.today).to_s}\"\n end", "def call\n if second_week_selected == false\n handle_first_week\n elsif second_week_selected\n handle_second_week\n elsif second_week_selected.nil?\n clear_back_button_dates\n end\n end", "def previous\n frm.button(:name=>\"eventSubmit_doPrev\").click\n Calendar.new(@browser)\n end", "def display_back_start_day\n display_start_day_of_week(period)\n end", "def set_user_today\n @day_of_week=Date.today.strftime('%A')\n # Variables for showing the pop-ups if they don't exist\n @userDailyQuestionnaireToday = UserDailyQuestionnaire.where(user: current_user, questionnaire_date: Date.today).first\n @userData = UserDatum.where(user: current_user).first\n end", "def select_current_week\n select_week_of Date.today\n end", "def set_defaults\n @start_date = Date.today - 2.weeks\n @end_date = Date.today\n end", "def set_defaults\n\t\tself.start_date ||= (Date.today - 6.days)\n\tend", "def previous_week\n if self.class == Date\n self - 7\n elsif self.class == Time\n self - (60 * 60 * 24 * 7)\n end\n end", "def previous_week\n if self.class == Date\n self - 7\n elsif self.class == Time\n self - (60 * 60 * 24 * 7)\n end\n end", "def adjust_current_date\n session[:date] = Date.today\n return true\n end", "def prev_working_date(date)\n cwday = date.cwday\n days = 0\n while true\n days -= 1\n cwday -= 1\n if cwday == 0\n cwday = 7\n end\n break unless non_working_week_days.include?(cwday) || days < -7\n end\n date + days\n end", "def choose_dates\n authorize! :choose_dates, :Reservation\n\n if(session[:rental_category_id].nil?)\n redirect_to shopping_path\n end\n\n @start_date = Date.today.next_month.beginning_of_month\n\n # pick_up_dates is the first full week of next month starting from the first weekday\n @pick_up_start_date = @start_date\n @pick_up_start_date += 1.days until @pick_up_start_date.wday == 1 # wday 1 is monday, etc.\n @pick_up_dates = @pick_up_start_date..(@pick_up_start_date + 5.days)\n\n # return_dates is the last full week of next month ending on the last weekday\n @return_end_date = Date.today.next_month.end_of_month\n @return_end_date -= 1.days until @return_end_date.wday == 1 # wday 1 is monday, etc.\n @return_dates = (@return_end_date)..(@return_end_date + 5.days)\n @end_date = @return_dates.last\n end", "def store_previous\n end", "def generate_current_wm\n currentDate = Date.today.at_beginning_of_week\n CalendarHelper.create_wm(currentDate)\n\n redirect_to(:action => 'show_menu')\n end", "def prev(day)\n (dayindex == day) ? dup : x_weeks_from_day(-1, day)\n end", "def set_initial_date\n unless date_requested\n self.date_requested = Date.today\n end\n end", "def state_minus_3_days\n return state unless state['sessions']\n state.merge(\n 'sessions' => DateTime.parse(state['sessions']).prev_day(3).iso8601\n )\n end", "def setAvailableFrom(date)\n EnziUIUtility.wait(@driver, :id, 'Available_From__c', 60)\n @driver.find_element(:name, 'Available_From__c').click\n arr_date = date.split('-')\n year_to_select = arr_date[0]\n @driver.find_element(:class, 'year').find_elements(:tag_name, \"option\").each do |option|\n if option.text == year_to_select\n option.click\n break\n end\n end\n\n next_button = nil\n prev_button = nil\n @driver.find_elements(:tag_name, 'button').each do |button|\n if button.attribute('title') == 'Next Month'\n next_button = button\n elsif button.attribute('title') == 'Previous Month'\n prev_button = button\n end\n end\n\n hash_month = {\"January\" => 1, \"February\" => 2, \"March\" => 3, \"April\" => 4, \"May\" => 5, \"June\" => 6, \"July\" => 7, \"August\" => 8, \"September\" => 9, \"October\" => 10, \"November\" => 11, \"December\" => 12}\n month_to_select = arr_date[1].to_i\n\n while true do\n if hash_month[@driver.find_element(:id, 'month').text] == month_to_select\n break\n elsif hash_month[@driver.find_element(:id, 'month').text] > month_to_select\n prev_button.click\n else\n next_button.click\n end\n end\n\n day_to_select = arr_date[2]\n @driver.find_element(:class, 'slds-datepicker__month').find_elements(:class, 'slds-day').each do |day|\n if day.text == day_to_select then\n #submitButtonEnability = @driver.find_element(:id, \"btnSubmit\").enabled?\n #puts \"day.Id is: #{day.attribute('id')}\"\n if day.attribute('id').empty? != true then\n puts \"Day id empty?: #{day.attribute('id').empty?}\"\n day.click\n return true\n else\n #puts \"Day id empty?: #{day.attribute('id').empty?}\"\n @driver.find_element(:link, 'Close').click\n return false\n end\n end\n end\n end", "def set_day_if_discarded; end", "def set_today_time\n @day_of_week=Date.today.strftime('%A')\n end", "def go_to_today\n frm.button(:value=>\"Go to Today\").click\n Calendar.new(@browser)\n end", "def set_admin_week\n @week = Week.current_or_number(nil)\n end", "def beginning_of_week; end", "def beginning_of_week; end", "def today\n frm.button(:value=>\"Today\").click\n Calendar.new(@browser)\n end", "def clear_calendar\n end", "def remember_me\n remember_me_for (Merb::Const::WEEK * 2)\n end", "def change_days(day_week)\n day_week.unshift(day_week.pop)\nend", "def quality_driven_software_export\n @from = Time.zone.now - 1.week\n @to = Time.zone.now\n end", "def set_week\n self.week = time_out.nil? ? time_in.beginning_of_week : time_out.beginning_of_week\n end", "def reset_date_for_time_now\n reset_date_for_time Time.now\n end", "def last_week\n Date.week(Date.today - 7)\n end", "def est05_toggle_dates #needs more debugging\n\t\t$browser.goto($patch_event_landing)\n\t\t\n\t\tcurrent_day = Time.now.strftime(\"%w\").to_i #grab day of the week as a number, 0 = Sunday\n puts current_day\n\t sleep 3\n\t\t$events_day_5.click #toggle date to fifth entry\n\t\tsleep 3\n\t\t@end_date = $events_date_header.text #grab date displayed on the header \n puts @end_date\n\t\t#parse out day of the week and convert to number\n\t\tnew_date = Date.parse(@end_date.split(\",\").first.to_s).strftime(\"%w\").to_i \n\t\tputs new_date\n\t\tassert current_day <= new_date #compare current day number to toggled date number\n\n\tend", "def date_of_last_week\n current = Time.current\n current -= 1.week\n current.strftime('%Y-%V')\n end", "def set_previous_action\n session[:typus_previous] = nil\n if params[:bta] && params[:btm]\n previous = Hash.new\n previous[:btm], previous[:bta], previous[:bti] = params[:btm], params[:bta], params[:bti]\n session[:typus_previous] = previous\n end\n end", "def set_session\n if !session[:month_number] then\n session[:month_number] = 0\n end\n \tif session[:month_number] then\n \t if(params[:month] == \"prev\") then\n \t session[:month_number] -= 1\n \t elsif(params[:month] == \"next\") then\n \t session[:month_number] += 1\n \t else\n \t \tsession[:month_number] = 0\n \t end\n \tend\n end", "def current_week\n\t\t#TODO\n\tend", "def prev_weekday\n if prev_day.on_weekend?\n copy_time_to(beginning_of_week(:friday))\n else\n prev_day\n end\n end", "def prev_weekday\n if prev_day.on_weekend?\n copy_time_to(beginning_of_week(:friday))\n else\n prev_day\n end\n end", "def week_from_today\n ::Date.today + 7\n end", "def change_calendar\n session[:cal_time] = (params[:id] == 'back' ?\n\t\t\t session[:cal_time].last_month :\n\t\t\t session[:cal_time].next_month)\n render :update do |page|\n page.replace_html('calendar', :partial => 'calendar')\n end\n end", "def move_to_previous_month\n self.date = self.date - 1.month\n self.save!\n end", "def weekend_menu\n active = 2\n if @alive == true\n weekend_header\n else\n offline_header\n end\n @selected_activity = []\n chosen_weekend_activity = @prompt.select(\"\\nSelect an activity to find out more\\n\".blue, @processed_weekend.push({name: \"--Back to Menu--\", value: 11}).uniq) \n weekend_selection(chosen_weekend_activity) \n end", "def beginning_of_week=(_arg0); end", "def beginning_of_week=(_arg0); end", "def set_fixed_date\n session[:date] = Date.new(params[:year].to_i, params[:month].to_i, params[:day].to_i)\n flash[:success] = t('activerecord.operations.category.fix_date_ok') + \" #{l(session[:date]).to_s}\" \n end", "def dateselection\nend", "def today_menu\n @active = 1\n if @alive ==true\n today_header\n else\n offline_header\n end\n @selected_activity = []\n @chosen_today_activity = @prompt.select(\"\\nSelect an activity to find out more\\n\".blue, @processed_today.push({name: \"--Back to Menu--\", value: 11}).uniq) \n today_selection(chosen_today_activity) \n end", "def reset_called_flag\n now = Date.today\n day_num = now.cwday\n case day_num\n when 0\n day_text = 'SUNDAY'\n when 1\n day_text = 'MONDAY'\n when 2\n day_text = 'TUESDAY'\n when 3\n day_text = 'WEDNESDAY'\n when 4\n day_text = 'THURSDAY'\n when 5\n day_text = 'FRIDAY'\n else\n day_text = 'SATURDAY'\n end\n calllists = Calllist.all\n calllists.each do |c|\n if c.called && ((c.calllists_day == day_text && (c.called_date.blank? || c.called_date < now)) || c.called_date.blank? || c.called_date < now-6.days)\n c.called = false\n c.ordered = false\n c.callback_day = ''\n c.save\n end\n end\n end", "def user_selected_earliest_start\n if (\n flash[:filters].length.positive? &&\n flash[:filters][:earliest_start.to_s] &&\n # https://stackoverflow.com/questions/15989329/what-is-good-if-an-empty-string-is-truthy\n flash[:filters][:earliest_start.to_s].length.positive?\n )\n date_object = Date.strptime(flash[:filters][:earliest_start.to_s], \"%Y-%m-%d\")\n else\n date_object = Date.today.prev_month\n end\n return date_object\n end", "def shiftsignup2\n if current_member.can_admin_calendar?\n @today = Date.today\n oldestdate = @today - 3.days\n formdate = params[:received].nil? ? @today : params[:received].to_date\n shiftdate = params[:shiftdate].nil? ? nil : params[:shiftdate].to_date\n if shiftdate && formdate >= oldestdate && shiftdate >= oldestdate\n @caldate = shiftdate\n @shifts = Shift.find_all_in_day(@caldate, false)\n check_and_change_shift(1, params[:s1_emt1], params[:s1_emt2], params[:s1_d])\n check_and_change_shift(2, params[:s2_emt1], params[:s2_emt2], params[:s2_d])\n check_and_change_shift(3, params[:s3_emt1], params[:s3_emt2], params[:s3_d])\n check_and_change_shift(4, params[:s4_emt1], params[:s4_emt2], params[:s4_d])\n end\n redirect_to :action => 'index', :thedate => shiftdate.to_s\n else\n render_forbidden\n end\n end", "def change_week\n @tasks = @company.tasks\n @timesheet = Timesheet.new\n @timesheet.timesheet_line_items.build\n\n cur_week = params[:date].to_date\n @week = cur_week.beginning_of_week\n if params[:cur_week]== \"next_week\"\n @week = @week+ 7.days\n else\n @week = @week- 7.days\n end\n respond_to do |format|\n format.js\n end\n end", "def after_initialize\n @date = Date.today \n end", "def previous!\n if @date.month - 1 == 0\n @date = Date.new(@date.year-1,12,1)\n else\n @date = Date.new(@date.year,@date.month-1,1)\n end\n end", "def filter_events\n frm.button(:name=>\"eventSubmit_doCustomdate\").click\n Calendar.new(@browser)\n end", "def need_last_day\n self.last_day_fetch = nil\n self.save!\n end", "def set_ClosingDate(value)\n set_input(\"ClosingDate\", value)\n end", "def index \n db_date_format = \"%Y-%m-%d\"\n\n if params[:from_date_picker].nil?\n session[:from_date_picker] ||= (Date.today - 7).strftime(db_date_format)\n session[:to_date_picker] ||= Date.today.strftime(db_date_format)\n\n params[:from_date_picker] = session[:from_date_picker]\n params[:to_date_picker] = session[:to_date_picker]\n end \n \n session[:from_date_picker] = params[:from_date_picker]\n session[:to_date_picker] = params[:to_date_picker]\n\n @stay_nights = StayNight.where([\"today >= ? and today <= ?\", params[:from_date_picker], params[:to_date_picker]]).order(today: :asc)\n @stay_night = StayNight.new\n\n end", "def reset_called_flag\n now = Date.today\n a_week_ago = now - 6\n call_days = CallDay.all\n call_days.each do |c|\n if ((c.called && c.called == 'YES') || (c.ordered && c.ordered == 'YES')) && ((c.date_called && c.date_called < a_week_ago) || (c.date_called && c.date_called < a_week_ago))\n c.called = 'NO'\n c.ordered = ' '\n c.callback = ' '\n c.alt_contact = ' '\n c.save\n end\n end\n end", "def clear_back_office_data\n @flbt_type = nil\n @version = nil\n @submitted_date = nil\n @effective_date = nil\n @filing_date = nil\n @ads_included = nil\n @ads_amount = nil\n @number_of_buyers = nil\n end", "def set_days_of_week\n @days_of_week = Date::DAYNAMES.each_with_index\n end", "def yesterday\n advance(days: -1)\n end", "def select_specify_dates\n frm.radio(:id=>\"hidden_specify\").set\n end", "def save_previous_page\n session[:return_to] = request.fullpath\n end", "def check_dates\n if(self.d_publish.nil?) && (self.d_remove.nil?)\n self.d_remove = \"2094-03-25\"\n self.d_publish = Time.zone.today\n elsif(self.d_publish?)\n self.d_remove = \"2094-03-25\"\n elsif(self.d_remove?)\n self.d_publish = Time.zone.today\n end\n end", "def prev_occurring(day_of_week)\n ago = wday - DAYS_INTO_WEEK.fetch(day_of_week)\n ago += 7 unless ago > 0\n advance(days: -ago)\n end", "def release_notification\n @has_data = Settings.has_user_data\n @data = Settings.getSavedData\n \n #reset date. otherwise it's being shown all the time, once it's been set \n $choosed['1'] = nil\n end", "def set_dates \n if self.date_entered.nil?\n self.date_entered = Date.current\n end \n if self.shopping_date.nil?\n self.shopping_date = self.date_entered\n end\n return true\n end", "def destroy\n self.current_checkin.touch :checked_out_at\n redirect_to :root\n end", "def adicionar_data\n self.date = Date.today\n end", "def cutoff_date\n case date.wday\n when 0\n date + (weeks.to_i * 7)\n when 1\n date + (weeks.to_i * 7) - 1\n when 2\n date + (weeks.to_i * 7) - 2\n when 3\n date + (weeks.to_i * 7) - 3\n when 4\n date + (weeks.to_i * 7) - 4\n when 5\n date + (weeks.to_i * 7) - 5\n when 6\n date + (weeks.to_i * 7) + 1\n end\n end", "def today_return_menu\n today_return_selection = @prompt.select(\"\\nSave to your favourites list or go back\\n\".blue) do |menu|\n menu.choice \"Save to favourites\", 1\n menu.choice \"Go back\", 2\n end \n today_return_selection(today_return_selection) \n end", "def set_initial_state\n self.check_in_current = false\n self.days_completed = 0\n self.days_remaining = self.days_to_complete \n self.current_day = 1\n self.active = true\n self.save\n end", "def back_order_date\n hash[\"BackOrderDate\"]\n end", "def reset_period_point\n\t\t\t\t@post_data[\"PeriodPoint\"] = get_period_time_of_today\n\t\t\tend", "def do_before_save\n self.display_on = Date.today unless self.display_on\n end", "def assign_trial_end_date\n self.trial_end_date = 2.weeks.from_now\n save!\n end", "def reset\n session[:emirate_id] = nil\n session[:emirate_name] = nil\n session[:neighborhood_id] = nil\n session[:neighborhood_name] = nil\n session[:project_id] = nil\n session[:project_name] = nil\n session[:building_id] = nil\n session[:building_name] = nil\n flash[:notice] = \"Selected value for Emirate has been reseted.\"\n redirect_to(request.env['HTTP_REFERR'] || emirates_url)\n end", "def save_advance_rank_safety(actual, clicked, date)\n if actual.to_i == 1 \n case clicked.to_i\n when 2\n session[:aforo] = 0\n else\n session[:aforo] = date\n end\n end\n end", "def browse_by_day\n # Checkeo de parametros. El parametro date contiene la fecha seleccionada, pero puede venir tambien star_date,\n # con el mismo uso. Hay dos, porque el weekly_viewer usa start_date, pero habria que unificarlo.\n # Si hay algo en esos parametros se usa eso, y si no se usa la fecha de hoy.\n if params[:date].nil?\n if params[:start_date].nil?\n @search_by_date = Date.today\n else\n @search_by_date = params[:start_date].to_date\n end\n else\n if @search_by_date.nil?\n begin\n @search_by_date = Date.parse(params[:date][:year] + '-' + params[:date][:month] + '-' + params[:date][:day])\n rescue => e\n @search_by_date = Date.today\n end\n end\n end\n\n @events = []\n if params.include? :business_hours\n @business_hours = params[:business_hours]\n end\n if not params[:carrera].nil?\n @carrera_selected = params[:carrera][:carrera_id]\n end\n\n # busqueda de los eventos por año, los del año \"0\" son los eventos no recurrentes en este momento, pero eso esta mal, deberian ser los que no estan\n # asignados a una materia. Lo de que sean recurrentes o no recurrentes, ya no es tan asi en esta busqueda y debemos cambiarlo, pero me termino de avivar recien\n # y ya es tarde\n @free_spaces = Espacio.all\n 6.times do |an|\n @calendar = nil\n @calendar = get_calendar :date => @search_by_date, :career => (params.include? :carrera) ? params[:carrera][:carrera_id] : nil, :year => an\n @calendar.events.each do |event|\n\n temp = SimpEvent.new\n temp.starts_at = event.dtstart\n temp.ends_at = event.dtend\n temp.name = event.description + ' - ' + Espacio.find(:first, :conditions => {:id => event.location.to_i}).codigo\n temp.original_id = event.comment[0].to_i\n temp.anio = an\n @events.push temp\n\n @free_spaces.delete(Espacio.find_by_id event.location.to_i) if DateTime.now.strftime('%H%M').to_i.between? event.dtstart.strftime('%H%M').to_i, event.dtend.strftime('%H%M').to_i\n end\n end\n @ver_horas = params[:ver_horas] == \"1\" ? false : true\n redirect_to \"/eventos/browse_by_day?business_hours=#{@ver_horas}&start_date=#{@search_by_date}\" unless params[:ver_horas].nil?\n end", "def previous_day\r\n if @previous_day.nil?\r\n @previous_day = convert_day_to_date(current_day).yesterday.strftime('%Y%m%d')\r\n end\r\n return @previous_day\r\n end", "def disable_dates\n @expression = load_expression_instance_from_session\n @expression.expression_start = nil\n @expression.expression_finish = nil\n save_expression_instance_in_session\n end", "def start_date\n @start_date ||= Date.today - Date.today.wday - 7 * 52\nend", "def select_week_to_view_payment_history\n setup_for_select_weekly_meeting\n \n \n add_breadcrumb \"#{t 'process.select_group_loan'}\", 'select_group_loan_to_view_payment_history_url'\n set_breadcrumb_for @group_loan, 'select_week_to_view_payment_history_url' + \"(#{@group_loan.id})\", \n \"#{t 'process.select_week'}\"\n \n end", "def start_of_this_week\n now = Date.today\n sunday = now - now.wday\nend", "def today\n MerchWeek.from_date Date.today\n end", "def set_date\n @current_date = Time.now\n end", "def remove_due_date\n self.due_at = nil\n \tif ! self.reminder_at.nil?\n\t self.reminder_at = nil\n end\n end", "def back\n driver.navigate.back\n end", "def back\n driver.navigate.back\n end", "def back\n @driver.navigate.back\n @after_hooks.run\n end", "def lp_back_button\n find_element(:xpath, \"//UIAApplication[1]/UIAWindow[1]/UIANavigationBar[1]/UIAButton[1]\")\n end", "def beginning_of_week\n Thread.current[:beginning_of_week] || beginning_of_week_default || :monday\n end", "def first_calendar_day\n @date.beginning_of_month.beginning_of_week(:sunday)\n end", "def weekend_selection(chosen_weekend_activity)\n if chosen_weekend_activity <= 10\n puts \"\\n#{weekend_activities[chosen_weekend_activity-1][:description]}\"\n @selected_activity << weekend_activities[chosen_weekend_activity-1][:title] \n \n today_return_menu\n else\n if chosen_weekend_activity == 11\n welcome_header\n main_menu\n end\n end\n \n end", "def set_search_date\n latest_done_workout_date = current_user.latest_done_workout.try(:occurred_on)\n this_workout_date = @workout.scheduled_on\n @search_date = if latest_done_workout_date.nil?\n this_workout_date\n else\n (Date.current - latest_done_workout_date) >= 10 ? this_workout_date : latest_done_workout_date\n end\n end" ]
[ "0.85574585", "0.70094407", "0.6878741", "0.62005025", "0.6184343", "0.60150886", "0.5949783", "0.5796058", "0.5649616", "0.5598964", "0.5587097", "0.5512408", "0.55109024", "0.5476496", "0.54602516", "0.5423918", "0.5394549", "0.537574", "0.53741366", "0.5340379", "0.5340259", "0.5314012", "0.528294", "0.5280123", "0.52792305", "0.5276894", "0.5271323", "0.5271323", "0.52546376", "0.52399737", "0.52264625", "0.52260315", "0.52103317", "0.52062607", "0.52043074", "0.51931864", "0.5187931", "0.5178633", "0.5177898", "0.51630694", "0.5160566", "0.5148203", "0.5148203", "0.514343", "0.5129992", "0.51275945", "0.51122266", "0.5100157", "0.5100157", "0.5093037", "0.5090862", "0.50900406", "0.50704783", "0.5069806", "0.50545794", "0.5053952", "0.504864", "0.5045264", "0.504501", "0.5035085", "0.5023449", "0.5016367", "0.5015158", "0.5012252", "0.5010908", "0.50047356", "0.4990542", "0.4989091", "0.49726602", "0.49663636", "0.49653363", "0.4957122", "0.4944551", "0.49388096", "0.4928937", "0.49285683", "0.49275553", "0.491991", "0.49156153", "0.49045178", "0.49040613", "0.48834604", "0.48793536", "0.48791534", "0.4878185", "0.48776954", "0.48771906", "0.48724785", "0.48705915", "0.48692057", "0.4868878", "0.4847094", "0.48410258", "0.48410258", "0.48347786", "0.48314062", "0.48200217", "0.48167026", "0.480554", "0.48045993" ]
0.8166558
1
Stores second week back button date Removes second week dates from session
def handle_second_week session[:second_week_back_button] = session[:second_week_start_date] session[:second_week_start_date] = nil session[:vehicle_details]['dates'] = disable_week(session[:first_week_start_date]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_back_button_dates\n session[:first_week_back_button] = nil\n session[:second_week_back_button] = nil\n end", "def handle_first_week\n session[:first_week_back_button] = session[:first_week_start_date]\n session[:first_week_start_date] = nil\n session[:vehicle_details]['dates'] = []\n end", "def remove_fixed_date\n session[:date] = nil\n flash[:success] = t('activerecord.operations.category.fix_date_ok') + \" #{l(Date.today).to_s}\"\n end", "def previous_week\n first_day = params[:beginning_of_current_week].to_date\n prev_week = first_day.prev_week\n\n @week_dates = (\n prev_week.at_beginning_of_week..prev_week.at_end_of_week\n ).to_a\n\n @availabilities_slots = AvailabilitiesConstant::AVAILABILITIES_SLOTS\n @expert = Expert.find(params[:expert_id])\n @month = Date::MONTHNAMES[prev_week.at_beginning_of_week.month]\n @year = params[:year] || prev_week.at_beginning_of_week.year\n # TODO: Pass the date selected to the next previous of the calendar\n # @dates_selected = params[:date_selected] || []\n # @package_option = params[:package_option] || 5\n @appointment_pack = AppointmentPack.new\n\n # Preserve dates_selected in sessions\n session[:dates_selected] = params[:dates_selected]\n end", "def remember_me\n remember_me_for (Merb::Const::WEEK * 2)\n end", "def back_url\n @back_marked ? session[:back_url] : session[:prev_url]\n end", "def state_minus_3_days\n return state unless state['sessions']\n state.merge(\n 'sessions' => DateTime.parse(state['sessions']).prev_day(3).iso8601\n )\n end", "def previous\n frm.button(:name=>\"eventSubmit_doPrev\").click\n Calendar.new(@browser)\n end", "def display_back_start_day\n display_start_day_of_week(period)\n end", "def call\n if second_week_selected == false\n handle_first_week\n elsif second_week_selected\n handle_second_week\n elsif second_week_selected.nil?\n clear_back_button_dates\n end\n end", "def previous_week\n if self.class == Date\n self - 7\n elsif self.class == Time\n self - (60 * 60 * 24 * 7)\n end\n end", "def store_previous\n end", "def previous_week\n if self.class == Date\n self - 7\n elsif self.class == Time\n self - (60 * 60 * 24 * 7)\n end\n end", "def adjust_current_date\n session[:date] = Date.today\n return true\n end", "def set_previous_action\n session[:typus_previous] = nil\n if params[:bta] && params[:btm]\n previous = Hash.new\n previous[:btm], previous[:bta], previous[:bti] = params[:btm], params[:bta], params[:bti]\n session[:typus_previous] = previous\n end\n end", "def date_of_last_week\n current = Time.current\n current -= 1.week\n current.strftime('%Y-%V')\n end", "def back_label\n @back_marked ? session[:back_label] : session[:prev_label]\n end", "def set_session\n if !session[:month_number] then\n session[:month_number] = 0\n end\n \tif session[:month_number] then\n \t if(params[:month] == \"prev\") then\n \t session[:month_number] -= 1\n \t elsif(params[:month] == \"next\") then\n \t session[:month_number] += 1\n \t else\n \t \tsession[:month_number] = 0\n \t end\n \tend\n end", "def back_order_date\n hash[\"BackOrderDate\"]\n end", "def save_previous_page\n session[:return_to] = request.fullpath\n end", "def shiftsignup2\n if current_member.can_admin_calendar?\n @today = Date.today\n oldestdate = @today - 3.days\n formdate = params[:received].nil? ? @today : params[:received].to_date\n shiftdate = params[:shiftdate].nil? ? nil : params[:shiftdate].to_date\n if shiftdate && formdate >= oldestdate && shiftdate >= oldestdate\n @caldate = shiftdate\n @shifts = Shift.find_all_in_day(@caldate, false)\n check_and_change_shift(1, params[:s1_emt1], params[:s1_emt2], params[:s1_d])\n check_and_change_shift(2, params[:s2_emt1], params[:s2_emt2], params[:s2_d])\n check_and_change_shift(3, params[:s3_emt1], params[:s3_emt2], params[:s3_d])\n check_and_change_shift(4, params[:s4_emt1], params[:s4_emt2], params[:s4_d])\n end\n redirect_to :action => 'index', :thedate => shiftdate.to_s\n else\n render_forbidden\n end\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def change_calendar\n session[:cal_time] = (params[:id] == 'back' ?\n\t\t\t session[:cal_time].last_month :\n\t\t\t session[:cal_time].next_month)\n render :update do |page|\n page.replace_html('calendar', :partial => 'calendar')\n end\n end", "def last_week\n Date.week(Date.today - 7)\n end", "def refresh_back_or_default(default)\r\n refresh_to(session[:return_to] || default)\r\n session[:return_to] = nil\r\n end", "def generate_current_wm\n currentDate = Date.today.at_beginning_of_week\n CalendarHelper.create_wm(currentDate)\n\n redirect_to(:action => 'show_menu')\n end", "def back\n driver.navigate.back\n end", "def back\n driver.navigate.back\n end", "def back\n @driver.navigate.back\n @after_hooks.run\n end", "def remember_me\r\n remember_me_for 2.weeks\r\n end", "def prev_weekday\n if prev_day.on_weekend?\n copy_time_to(beginning_of_week(:friday))\n else\n prev_day\n end\n end", "def prev_weekday\n if prev_day.on_weekend?\n copy_time_to(beginning_of_week(:friday))\n else\n prev_day\n end\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def save_advance_rank_safety(actual, clicked, date)\n if actual.to_i == 1 \n case clicked.to_i\n when 2\n session[:aforo] = 0\n else\n session[:aforo] = date\n end\n end\n end", "def prev_working_date(date)\n cwday = date.cwday\n days = 0\n while true\n days -= 1\n cwday -= 1\n if cwday == 0\n cwday = 7\n end\n break unless non_working_week_days.include?(cwday) || days < -7\n end\n date + days\n end", "def back_click\n back\nend", "def quality_driven_software_export\n @from = Time.zone.now - 1.week\n @to = Time.zone.now\n end", "def lp_back_button\n find_element(:xpath, \"//UIAApplication[1]/UIAWindow[1]/UIANavigationBar[1]/UIAButton[1]\")\n end", "def release_notification\n @has_data = Settings.has_user_data\n @data = Settings.getSavedData\n \n #reset date. otherwise it's being shown all the time, once it's been set \n $choosed['1'] = nil\n end", "def est05_toggle_dates #needs more debugging\n\t\t$browser.goto($patch_event_landing)\n\t\t\n\t\tcurrent_day = Time.now.strftime(\"%w\").to_i #grab day of the week as a number, 0 = Sunday\n puts current_day\n\t sleep 3\n\t\t$events_day_5.click #toggle date to fifth entry\n\t\tsleep 3\n\t\t@end_date = $events_date_header.text #grab date displayed on the header \n puts @end_date\n\t\t#parse out day of the week and convert to number\n\t\tnew_date = Date.parse(@end_date.split(\",\").first.to_s).strftime(\"%w\").to_i \n\t\tputs new_date\n\t\tassert current_day <= new_date #compare current day number to toggled date number\n\n\tend", "def prev(day)\n (dayindex == day) ? dup : x_weeks_from_day(-1, day)\n end", "def remember_me\n remember_me_until 2.weeks.from_now\n end", "def end_date\n (created_at - 1.week).sunday - 1.day\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def switch_back\n original_user_id = session[:original_user_id]\n if original_user_id\n switch_to = User.find(original_user_id)\n sign_out self.current_visitor\n sign_in switch_to\n end\n redirect_to home_path\n end", "def go_back\n redirect_to '/account/property-syndication'\n end", "def restore_last_user\n return @last_user if @last_user\n if session[:last_user_id].present?\n @last_user = User.find_by_id(session[:last_user_id])\n message = translate(\"users.sign_in_back\", user: @last_user.name)\n set_flash_message(message, :success, false)\n session.destroy()\n session[:id] = @last_user.id if @last_user.present?\n return @last_user\n end\n end", "def click_on_back_button\n\n click_button BACK_BUTTON\n sleep(THREAD_SLEEP_1)\n\n end", "def back\r\n @browser.navigate.back\r\n end", "def link_to_back\n link_to \"Back\", session[:prev_page]\n end", "def back\n history_navigate(delta: -1)\n end", "def set_week\n self.week = time_out.nil? ? time_in.beginning_of_week : time_out.beginning_of_week\n end", "def set_day_if_discarded; end", "def destroy\n self.current_checkin.touch :checked_out_at\n redirect_to :root\n end", "def prev_occurring(day_of_week)\n ago = wday - DAYS_INTO_WEEK.fetch(day_of_week)\n ago += 7 unless ago > 0\n advance(days: -ago)\n end", "def yesterday\n advance(days: -1)\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end" ]
[ "0.846894", "0.7645675", "0.61061215", "0.6059644", "0.59826857", "0.5731077", "0.5707717", "0.570693", "0.56867516", "0.5674106", "0.5627197", "0.562717", "0.56258404", "0.5551381", "0.5524808", "0.55210835", "0.5473964", "0.54698145", "0.545434", "0.542528", "0.5419363", "0.5406145", "0.53723544", "0.5368422", "0.53474927", "0.53430086", "0.5302163", "0.5302163", "0.5288521", "0.5283813", "0.52477634", "0.52477634", "0.5247609", "0.5247609", "0.5246259", "0.52393025", "0.5235027", "0.52144206", "0.5210782", "0.5187773", "0.51866615", "0.5180673", "0.51750904", "0.5166632", "0.5161819", "0.5160374", "0.51591486", "0.51586854", "0.51489323", "0.5131419", "0.51250356", "0.51214665", "0.5116356", "0.5106682", "0.51047945", "0.51046395", "0.5100098", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358", "0.5082358" ]
0.79072785
1
Clears both weeks back button dates
def clear_back_button_dates session[:first_week_back_button] = nil session[:second_week_back_button] = nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_calendar\n end", "def handle_first_week\n session[:first_week_back_button] = session[:first_week_start_date]\n session[:first_week_start_date] = nil\n session[:vehicle_details]['dates'] = []\n end", "def display_back_start_day\n display_start_day_of_week(period)\n end", "def remove_due_date\n self.due_at = nil\n \tif ! self.reminder_at.nil?\n\t self.reminder_at = nil\n end\n end", "def remove_fixed_date\n session[:date] = nil\n flash[:success] = t('activerecord.operations.category.fix_date_ok') + \" #{l(Date.today).to_s}\"\n end", "def call\n if second_week_selected == false\n handle_first_week\n elsif second_week_selected\n handle_second_week\n elsif second_week_selected.nil?\n clear_back_button_dates\n end\n end", "def reset_date_for_time_now\n reset_date_for_time Time.now\n end", "def handle_second_week\n session[:second_week_back_button] = session[:second_week_start_date]\n session[:second_week_start_date] = nil\n session[:vehicle_details]['dates'] = disable_week(session[:first_week_start_date])\n end", "def beginning_of_week; end", "def beginning_of_week; end", "def set_defaults\n @start_date = Date.today - 2.weeks\n @end_date = Date.today\n end", "def clear_back_office_data\n @flbt_type = nil\n @version = nil\n @submitted_date = nil\n @effective_date = nil\n @filing_date = nil\n @ads_included = nil\n @ads_amount = nil\n @number_of_buyers = nil\n end", "def previous_week\n first_day = params[:beginning_of_current_week].to_date\n prev_week = first_day.prev_week\n\n @week_dates = (\n prev_week.at_beginning_of_week..prev_week.at_end_of_week\n ).to_a\n\n @availabilities_slots = AvailabilitiesConstant::AVAILABILITIES_SLOTS\n @expert = Expert.find(params[:expert_id])\n @month = Date::MONTHNAMES[prev_week.at_beginning_of_week.month]\n @year = params[:year] || prev_week.at_beginning_of_week.year\n # TODO: Pass the date selected to the next previous of the calendar\n # @dates_selected = params[:date_selected] || []\n # @package_option = params[:package_option] || 5\n @appointment_pack = AppointmentPack.new\n\n # Preserve dates_selected in sessions\n session[:dates_selected] = params[:dates_selected]\n end", "def reset_called_flag\n now = Date.today\n a_week_ago = now - 6\n call_days = CallDay.all\n call_days.each do |c|\n if ((c.called && c.called == 'YES') || (c.ordered && c.ordered == 'YES')) && ((c.date_called && c.date_called < a_week_ago) || (c.date_called && c.date_called < a_week_ago))\n c.called = 'NO'\n c.ordered = ' '\n c.callback = ' '\n c.alt_contact = ' '\n c.save\n end\n end\n end", "def previous_week\n if self.class == Date\n self - 7\n elsif self.class == Time\n self - (60 * 60 * 24 * 7)\n end\n end", "def previous_week\n if self.class == Date\n self - 7\n elsif self.class == Time\n self - (60 * 60 * 24 * 7)\n end\n end", "def set_day_if_discarded; end", "def quality_driven_software_export\n @from = Time.zone.now - 1.week\n @to = Time.zone.now\n end", "def reset_called_flag\n now = Date.today\n day_num = now.cwday\n case day_num\n when 0\n day_text = 'SUNDAY'\n when 1\n day_text = 'MONDAY'\n when 2\n day_text = 'TUESDAY'\n when 3\n day_text = 'WEDNESDAY'\n when 4\n day_text = 'THURSDAY'\n when 5\n day_text = 'FRIDAY'\n else\n day_text = 'SATURDAY'\n end\n calllists = Calllist.all\n calllists.each do |c|\n if c.called && ((c.calllists_day == day_text && (c.called_date.blank? || c.called_date < now)) || c.called_date.blank? || c.called_date < now-6.days)\n c.called = false\n c.ordered = false\n c.callback_day = ''\n c.save\n end\n end\n end", "def date_of_last_week\n current = Time.current\n current -= 1.week\n current.strftime('%Y-%V')\n end", "def change_days(day_week)\n day_week.unshift(day_week.pop)\nend", "def check_dates\n if(self.d_publish.nil?) && (self.d_remove.nil?)\n self.d_remove = \"2094-03-25\"\n self.d_publish = Time.zone.today\n elsif(self.d_publish?)\n self.d_remove = \"2094-03-25\"\n elsif(self.d_remove?)\n self.d_publish = Time.zone.today\n end\n end", "def cleanup\n @period = :monthly\n @ranged = nil\n @range_start_date = nil\n @range_end_date = nil\n @one_time_date = nil\n @increment = nil\n end", "def check_dates\r\n self.start_time -= 8.hours\r\n self.end_time -= 8.hours\r\n end", "def clear_rolled_back_versions\n versions.reset\n end", "def clear_rolled_back_versions\n versions.reset\n end", "def clear_backlinks\n @backlinks = []\n end", "def check_out(due_date)\n\n if @due_date == nil\n @due_date = 0\n end\n\n @due_date += 7\n\n end", "def reset_period_point\n\t\t\t\t@post_data[\"PeriodPoint\"] = get_period_time_of_today\n\t\t\tend", "def prev_working_date(date)\n cwday = date.cwday\n days = 0\n while true\n days -= 1\n cwday -= 1\n if cwday == 0\n cwday = 7\n end\n break unless non_working_week_days.include?(cwday) || days < -7\n end\n date + days\n end", "def clear_history\n #TODO: Use Delete Private Data Dialog?\n opera_desktop_action(\"Clear visited history\")\n opera_desktop_action(\"Clear typed in history\")\n end", "def clear_history\n #TODO: Use Delete Private Data Dialog?\n opera_desktop_action(\"Clear visited history\")\n opera_desktop_action(\"Clear typed in history\")\n end", "def cutoff_date\n case date.wday\n when 0\n date + (weeks.to_i * 7)\n when 1\n date + (weeks.to_i * 7) - 1\n when 2\n date + (weeks.to_i * 7) - 2\n when 3\n date + (weeks.to_i * 7) - 3\n when 4\n date + (weeks.to_i * 7) - 4\n when 5\n date + (weeks.to_i * 7) - 5\n when 6\n date + (weeks.to_i * 7) + 1\n end\n end", "def beginning_of_week=(_arg0); end", "def beginning_of_week=(_arg0); end", "def previous!\n if @date.month - 1 == 0\n @date = Date.new(@date.year-1,12,1)\n else\n @date = Date.new(@date.year,@date.month-1,1)\n end\n end", "def clear_period\n @period = nil\n self\n end", "def clear\n @now.clear\n @next.clear\n end", "def set_today_time\n @day_of_week=Date.today.strftime('%A')\n end", "def end_date\n (created_at - 1.week).sunday - 1.day\n end", "def ops_calendar\n # setup calendar cells\n @today = Date.today - 3\n if @today.strftime(\"%a\") == \"Mon\"\n @start_date = @today\n else\n @start_date = @today\n until @start_date.strftime(\"%a\") == \"Mon\"\n @start_date -= 1\n end\n end\n @end_date = @start_date+21\n @date_range = (@start_date..@end_date)\n @weeks = @date_range.to_a.in_groups_of(3)\n\n\n end", "def update_times\n\t\t@today = Time.now\n\t\t@current_start_day = @today - MONTH\n\t\t@previous_start_day = @current_start_day - MONTH\n\tend", "def\n check_out(due_date)\n\n if @due_date == nil\n @due_date = 0\n end\n\n @due_date += 7\n\n end", "def cweek\n end", "def previous\n frm.button(:name=>\"eventSubmit_doPrev\").click\n Calendar.new(@browser)\n end", "def reset\n self.update_attribute(:refresh_at, 1.years.ago)\n end", "def yesterday\n advance(days: -1)\n end", "def set_week\n self.week = time_out.nil? ? time_in.beginning_of_week : time_out.beginning_of_week\n end", "def reset\n set_last_update_at\n end", "def set_defaults\n\t\tself.start_date ||= (Date.today - 6.days)\n\tend", "def reset_button(floor)\n\t\t@buttons[floor] = false\n\tend", "def prev(day)\n (dayindex == day) ? dup : x_weeks_from_day(-1, day)\n end", "def workdays(calendar = Spok.default_calendar)\n (@start_date..@end_date).to_a.delete_if{ |date| Workday.restday?(date, calendar: calendar) }\n end", "def date_end # originally date_start\n\tdate = Date.today\n\t(1..7).each do |n|\n\t\tdate = Date.today - n#.days\n\t\tbreak if date.wday == 6 # 0 = Sun, 1 = Mon ... 6 = Sat\n\tend\n\tdate\nend", "def reset\n timeline.clear\n end", "def est05_toggle_dates #needs more debugging\n\t\t$browser.goto($patch_event_landing)\n\t\t\n\t\tcurrent_day = Time.now.strftime(\"%w\").to_i #grab day of the week as a number, 0 = Sunday\n puts current_day\n\t sleep 3\n\t\t$events_day_5.click #toggle date to fifth entry\n\t\tsleep 3\n\t\t@end_date = $events_date_header.text #grab date displayed on the header \n puts @end_date\n\t\t#parse out day of the week and convert to number\n\t\tnew_date = Date.parse(@end_date.split(\",\").first.to_s).strftime(\"%w\").to_i \n\t\tputs new_date\n\t\tassert current_day <= new_date #compare current day number to toggled date number\n\n\tend", "def resets; end", "def last_week\n Date.week(Date.today - 7)\n end", "def week_from_today\n ::Date.today + 7\n end", "def week; end", "def move_to_previous_month\n self.date = self.date - 1.month\n self.save!\n end", "def reset\n self.time_step = DEFAULT_TIME_STEP\n self.availiable_days = DEFAULT_AVAILIABLE_DAYS\n self.availiable_steps = DEFAULT_AVAILIABLE_STEPS\n self.steps_day_shift = DEFAULT_STEPS_DAY_SHIFT\n end", "def last_week\n (Time.zone.today - 7.days).strftime('%d-%b-%Y')\n end", "def previous_changes_clean\n excluded_params = [:updated_at]\n excluded_params << :reset_at unless previous_changes[:reset_amount]\n previous_changes.except(*excluded_params)\n end", "def display_past_history(current_user, date)\n puts `clear`\n puts \"************ \".blue + \"Your Drinks From\" + \" ************\".blue\n puts \"************ \".blue + \"#{date.strftime(\"%a, %d %b %Y\")} - 8:00 AM\" + \" ************\".blue\n puts \"************ \".blue + \"until\" + \" ************\".blue\n puts \"************ \".blue + \"#{(date+1).strftime(\"%a, %d %b %Y\")} - 7:59 AM\" + \" ************\".blue\n puts \"\"\n display_drinks_on_date(current_user, date)\n puts \"\"\n puts \"*****************************************************\".blue\nend", "def resets\n @resets ||= buttons.select { |f| f.class == Reset }\n end", "def today\n MerchWeek.from_date Date.today\n end", "def remove_depricated\n self.articles.each do |a|\n unless ((a.created_at + 3.days) > Date.today) \n self.articles.delete(a)\n end\n end\n\tend", "def current_week\n\t\t#TODO\n\tend", "def usage_reset_day\n self.upload_limit_resets_at.strftime(\"%A, %B %e, %Y\")\n end", "def _backdate(date, range)\n (date - (range-1).days)\n end", "def reset\n end", "def reset\n end", "def clear_unused_steps\n log_action('Clearing future steps from the back link history')\n current_step_keys = history.select { |k, _v| k <= previous_step }.keys\n session[:back_link_history] = history.slice(*current_step_keys)\n end", "def clear\n view.subviews.each {|sv| sv.removeFromSuperview}\n @buttons = []\n end", "def clear_baicheng_event\n BaichengEvent.find_by_design(self.id).try(:destroy_all)\n end", "def reset\n @values = {\n 'loading_bar' => 'true',\n 'date_format' => 'relative',\n 'theme' => 'bootstrap',\n 'auto_fill' => 'true'\n }\n end", "def relevant_dispatch_date\n dispatch_date || Date.yesterday\n end", "def select_current_week\n select_week_of Date.today\n end", "def previous_date( rounded_date )\n rounded_date - 1\n end", "def backward(days: 365)\n from = ::Date.today - days\n to = ::Date.today - 1\n\n between(from: from, to: to).to_date\n end", "def change_dates start_date, finish_date\n set_dates start_date, finish_date\n\n set_calendar\n end", "def reset\n end", "def reset\n end", "def reset\n end", "def reset\n end", "def reset\n\n end", "def need_last_day\n self.last_day_fetch = nil\n self.save!\n end", "def last_week( remaining_days )\n pad = DPW - remaining_days.length\n\t\tremaining_days + Array.new( pad )\n end", "def closing_stock\n closing_stock_on_date(Time.zone.now.to_date, nil)\n end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end" ]
[ "0.6943014", "0.6627319", "0.6220352", "0.60315514", "0.60257804", "0.60128903", "0.5999674", "0.5975555", "0.5864189", "0.5864189", "0.58210766", "0.57930595", "0.57829565", "0.5721126", "0.5692927", "0.56921566", "0.5655046", "0.5640556", "0.56382567", "0.5630907", "0.5581994", "0.5560383", "0.5539956", "0.55364877", "0.5528904", "0.5528904", "0.5477373", "0.54326403", "0.54274976", "0.5418059", "0.5411586", "0.5411586", "0.5401578", "0.5396037", "0.5396037", "0.5388592", "0.5375116", "0.5347131", "0.53456986", "0.5345163", "0.53349453", "0.5334293", "0.5333305", "0.53274983", "0.53183275", "0.5295064", "0.5281406", "0.5281261", "0.5271089", "0.5249761", "0.5249204", "0.52487385", "0.5240959", "0.52285707", "0.5215734", "0.52121997", "0.5210221", "0.5203714", "0.5201568", "0.5200214", "0.5175264", "0.5173094", "0.51629215", "0.51512", "0.5139196", "0.51356256", "0.51165", "0.5116177", "0.51130015", "0.5106056", "0.51033413", "0.5081714", "0.5081714", "0.5079774", "0.5077924", "0.5073051", "0.50680053", "0.5061475", "0.5059456", "0.50520945", "0.5046817", "0.50426185", "0.5040138", "0.5040138", "0.5040138", "0.5040138", "0.5039734", "0.50294787", "0.5029395", "0.5028065", "0.50162154", "0.50162154", "0.50162154", "0.50162154", "0.50162154", "0.50162154", "0.50162154", "0.50162154", "0.50162154", "0.50162154" ]
0.8693099
0
Move the first letter of each word to the end of it, then add "ay" to the end of the word. Leave punctuation marks untouched. Iterate over the words in the given string, and transform each into their pig latin equivalent Input: a string containing one or more words Punctuation is not included in the words Output: a string containing the pig latin values of the given words Move first letter of the word to the end of the word Add 'ay' to the end of the word Make sure I don't move any punctuation Maintain the case of all characters Examples pig_it('Pig latin is cool') igPay atinlay siay oolcay Pig => igP => igPay latin => atinl => atinlay pig_it('Hello world !') elloHay orldway ! Algorithm: Split up the input string into an array of words Iterate over the words, transforming as follows Next iteration if punctuation Move first character to the end of the word Append ay Join with ' ' delimiter and return string result
def pig_it(sentence) sentence.split.map do |word| if ('a'..'z').cover?(word.downcase) word[1..-1] + word[0] + 'ay' else word end end.join(' ') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pig_it text\n\n # split string into array of words\n text_array = text.split(\" \")\n \n #for each word take first character from index [0] and move to last character index [-1] + 'ay', remove first character\n latin_array = text_array.map do |word|\n new_word = word + word[0] + \"ay\" \n new_word[1..-1]\n end\n \n #join together to single string\n latin_string = latin_array.join(\" \")\n \n #delete 'ay' from endings of sentences with punctuation - kind of cheating \n latin_string.sub! '!ay', '!' \n latin_string.sub! '?ay', '?'\n\n latin_string\n\nend", "def pig_it(string)\n words = string.split\n\n words.map do |word|\n if word.match(/[a-z]/i)\n word[1..word.size] << word[0] << 'ay'\n else\n word\n end\n end.join(' ')\nend", "def pig_it(str)\n \twords_from_sentence = str.split\n \twords_from_sentence.map! do |word|\n \t\tif word.length == 1\n \t\t\tif word.match? (/[^\\w]/)\n \t\t\t\tword\n \t\t\telse\n \t\t\t\tword << 'ay'\n \t\t\tend\n \t\telsif word[-1].match? (/[^\\w]/)\n \t\t\tlast_letter = word.slice!(-1)\n \t\t\tword << word.slice!(0) << 'ay' << last_letter\n \t\telse\n \t\t\tword << word.slice!(0) << 'ay'\n \t\tend\n \tend\n \twords_from_sentence.join(' ')\nend", "def piglatinize(string)\n string.split(\" \").each do |word|\n m = word.match(/^[^aeiou]+/i)\n if m\n word.delete_prefix!(m[0])\n word << m[0]\n word << \"ay\"\n else\n word << \"way\"\n end\n end.join(\" \")\n end", "def pig_it(string)\n arr = string.split(\" \")\n result = \"\"\n arr.each do |word|\n # Check if word is containing only letters and not special characters\n if word.match? /\\A[a-zA-Z']*\\z/\n result += (word[1..-1] + word[0] + \"ay \")\n else\n result += (word + \" \")\n end\n end\n result[0...-1]\nend", "def pig_latin(string)\n words_array = string.split(\" \")\n modified_words_array = \"\"\n words_array.map do |word|\n \n if word =~ /\\A[aeiou]/\n word += \"ay\"\n modified_words_array << word + \" \"\n \n # regex to grab three consonants took from http://stackoverflow.com/questions/18406509/using-regexp-to-check-whether-a-string-starts-with-a-consonant\n # word starts with three consonants or \"[const.]qu\" ie. \"square\", \"squat\"\n elsif ( word =~ /\\A(?i:(?![aeiou])[a-z]){3}/ ) || ( word =~ (/\\b[^aeiou]+qu/) ) # word =~ /\\A[^aeiou]+qu{3}/ )\n without_first_three = word[3..-1]\n without_first_three += word[0..2] + \"ay\"\n if word[0] == word[0].upcase\n without_first_three.capitalize!\n end\n modified_words_array << without_first_three + \" \"\n \n # word starts with two consonants or \"qu\" ie. \"quake\", \"quart\" \n elsif ( word =~ /\\A(?i:(?![aeiou])[a-z]){2}/ ) || ( word =~ /\\A[qu]{2}/ )\n without_first_two = word[2..-1]\n without_first_two += word[0..1] + \"ay\"\n if word[0] == word[0].upcase\n without_first_two.capitalize!\n end\n modified_words_array << without_first_two + \" \"\n \n # word starts with consonant \n elsif word =~ /\\A[^aeiou]/\n without_first = word[1..-1]\n without_first += word[0] + \"ay\"\n if word[0] == word[0].upcase\n without_first.capitalize!\n end\n modified_words_array << without_first + \" \"\n end\n \n end\n modified_words_array.chomp(\" \")\nend", "def pig_it(str)\n words = str.split\n pigified = []\n words.each do |word|\n if word =~ /\\w/\n word += \"#{word.chr}ay\"\n word[0] = ''\n pigified << word\n else pigified << word\n end\n end\n pigified.join(' ')\nend", "def translate(str)\n words = str.split\n pig_words = []\n words.each do |word|\n pig_words << latinize(word)\n end\n\n pig_words.join(\" \")\nend", "def pig_sentence(string)\n pig_latin = \"\"\n string.split().each do |word|\n pig_latin += pig_word(word).downcase + \" \"\n end\n pig_latin.strip!\nend", "def pig_latinify(wordstring)\n\t\tstr = wordstring.downcase.gsub(/\\s+/, \"\") #gsub.replaces\n\t\tif str.start_with?(\"a\") || str.start_with?(\"e\") || str.start_with?(\"i\") || str.start_with?(\"o\") || str.start_with?(\"u\")\n\t\t\treturn str + \"way\"\n\t\telsif str == \"shit\" || str == \"fuck\" || str == \"arse\" || str == \"munter\" || str == \"cock\" || str == \"pussy\" || str == \"asshole\" || str == \"motherfucker\" |\n\t\t\treturn str.gsub(\"a\", \"*\").gsub(\"e\", \"*\").gsub(\"i\", \"*\").gsub(\"o\", \"*\").gsub(\"u\", \"*\")\n\t\telse\n\t\t\tsuffix = str[0]\n\t\t\tstr[0] = \"\"\n\t\t\treturn str + suffix + \"ay\"\n\t\tend\n\tend", "def piglatinize(words)\n \n # \"flat iron\"\n # change the words in to an arry of words\n # words = \"Flat iron\"\n # expecting \"atFlay ironway\"\n splited_words = words.split(\" \")\n # vowels = [\"a\", \"e\",\"i\",\"o\"]\n sentence = []\n splited_words.each do |word|\n # .map do |word|\n changed_word = []\n beginning =[]\n i = 0\n while i < word.length do\n if word[i].downcase != \"a\" && word[i].downcase != \"e\" && word[i].downcase != \"i\" && word[i].downcase != \"o\" && word[i].downcase != \"u\"\n \n changed_word << word[i] \n else\n break\n end\n i += 1\n end\n \n beginning << word[i, word.length]\n if word[0].downcase != \"a\" && word[0].downcase != \"e\" && word[0].downcase != \"i\" && word[0].downcase != \"o\" && word[0].downcase != \"u\"\n\n latinized = beginning.join + changed_word.join + \"ay\" \n sentence << latinized \n else\n latinized = beginning.join + changed_word.join + \"way\" \n sentence << latinized\n end\n end \n sentence.join(\" \")\n end", "def convert_pig_latin(sentence)\n translated = []\n\n sentence.split(' ').each do |word|\n if word.length > 2\n translated << pig_latin(word)\n else\n translated << word\n end\n end\n translated.join(' ')\nend", "def pig_it(str)\r\n str.split.map { |w| w =~ /[a-z]/i ? w[1..-1] + w[0] + 'ay' : w }.join(' ')\r\nend", "def piglatinize(word)\n vowels = ['a','e','o','u','i','A','E','O','U','I']\n split_word = word.split('')\n\n if vowels.include?(split_word[0])\n split_word << \"way\"\n else\n until vowels.include?(split_word[0])\n split_word.rotate!(1)\n end\n split_word << \"ay\"\n end\n split_word.join\n end", "def convert_pig_latin(sent)\n vowels = \"aeiou\"\n latin = []\n\n sent = sent.split(\" \")\n sent.each_with_index do |word,idx|\n uppercase = false\n if word.length < 3\n latin << word\n elsif vowels.include?(word[0].downcase)\n latin << (word + \"yay\")\n else\n temp_str = \"\"\n i = 0\n while i < word.length\n uppercase = true if i == 0 && word[i] == word[i].upcase\n if !vowels.include?(word[i].downcase)\n temp_str += word[i]\n else \n new_word = (word[i..-1] + temp_str.downcase + \"ay\")\n uppercase ? ( latin << (new_word[0].upcase + new_word[1..-1]) ) : ( latin << new_word )\n break\n end\n i += 1\n end\n end\n end\n latin.join(\" \")\nend", "def piglatinizer(str)\n plstr = \"\"\n arr = str.split\n\n arr.each do |pig|\n if (pig.size <= 2) && (pig.slice(0) =~ /[aeiou]/)\n plstr << pig\n plstr << \"ay \"\n else\n l = pig.slice!(0)\n plstr << pig\n plstr << l\n plstr << \"ay \"\n end\n end\n plstr.downcase.capitalize\nend", "def pig_latin_sentence(sentence)\r\n\tnew_sentence = \"\"\r\n\tsentence.split.each do |word|\r\n\t\tif word[0].downcase =~ /[aeiou]/\r\n\t\t\tword << \"way\" \r\n\t\telse\r\n\t\t\tn = /[aeiou]/.match word.downcase\r\n\t\t\tword = n.to_s + n.post_match + n.pre_match + \"ay\"\r\n\t\tend\r\n\t\tnew_sentence << word\r\n\tend\r\n\tnew_sentence\r\nend", "def pigLatin(sentence)\n\n #declare var to hold the split string\n splitSentence = sentence.split()\n #empty array to hold split strings\n result = \"\"\n #split the word into letters\n for word in splitSentence\n letters = word.split(//)\n first_letter = letters[0]\n letters.shift()\n letters.push(first_letter)\n letters.push(\"ay \")\n\n result += letters.join()\n\n end\n\n result.capitalize!.chop!()\n return result\nend", "def translate(sentence)\r\n words = sentence.split(\" \")\r\n words.collect! do |a|\r\n if(a =~ /\\w\\.\\.\\.\\w/) #matching e.g \"yes...no\"\r\n morewords = a.split(\"...\")\r\n ##\r\n #alternative: allows for recursion, but loses accuracy since \"a...b\" becomes \"a ... b\"\r\n #probably some non-messy way to make it work, and be less redundant too\r\n #\r\n #morewords.insert(1, \"...\")\r\n #translate(morewords.join(\" \"))\r\n pig(morewords[0], 1) + \"...\" + pig(morewords[1], 1)\r\n elsif(a =~ /\\w\\W\\w/ and !(a =~ /'/)) #matching e.g. \"steins;gate\", \"ninety-nine\", but not \"it's\"\r\n nonletter = a.scan(/\\W/)[0]\r\n morewords = a.split(/\\W/)\r\n #morewords.insert(1, nonletter)\r\n #translate(morewords.join(\" \"))\r\n pig(morewords[0], 1) + nonletter + pig(morewords[1], 1)\r\n elsif(a[0..1].match(/qu/)) #quiet = ietquay\r\n pig(a, 2)\r\n elsif(a[0..2].match(/sch|.qu/)) #school = oolschay, square = aresquay\r\n pig(a, 3)\r\n else\r\n x = a.index(/[AaEeIiOoUu]/) #starts with other consonant(s) or a vowel; find the first vowel\r\n if(!(x.nil?)) #found at least one vowel\r\n pig(a, x) \r\n else #x is nil, no vowels found\r\n a.index(/[[:alpha:]]/) ? pig(a, 1) : a #if it contains letters, attempt to process; otherwise, do nothing\r\n end\r\n end\r\n end\r\n return words.join(\" \")\r\nend", "def pig_latin_sentence(sentence)\n words = sentence.split(\" \")\n new_words = []\n words.each do |word|\n new_words << pig_latin(word)\n end\n new_words.join(\" \")\nend", "def pig_latin_sentence(string)\n array_of_word = string.split(\" \")\n new_array_of_word = []\n\n array_of_word.each do |word|\n new_array_of_word.push(pig_latin_word(word))\n end\n\n return new_array_of_word.join(\" \")\n\nend", "def piglatinize_word(word)\r\n # vowel at the start\r\n # 3 consonants\r\n # 2 consonants\r\n # 1 consonant\r\n # count consonants\r\n count = 0\r\n # check if word starts with a vowel\r\n if !consonant?(word[0])\r\n word += \"w\"\r\n else\r\n count += 1\r\n end\r\n \r\n # check if word starts with 3 consonants\r\n if count == 1 && consonant?(word[1]) && consonant?(word[2])\r\n count += 2\r\n word = word.slice(3..-1) + word.slice(0,3)\r\n # check if word starts with 2 consonants if it isn't 3\r\n elsif count == 1 && consonant?(word[1])\r\n word = word.slice(2..-1) + word.slice(0,2)\r\n # check if word starts with 1 consonant if it isn't 3 or 2\r\n elsif count == 1 \r\n word = word.slice(1..-1) + word.slice(0)\r\n end\r\n\r\n # finally add the \"ay\" using += or <<\r\n word+= \"ay\"\r\n end", "def pig_latin_name(word)\n# and returns a new string (pig latinified)\n# need to define vowels (can be an array?)\n vowels_list = vowels\n# break word into letters\n letters = word.split(\"\")\n# iterate through each letter of the word\n# until we hit a vowel\n letters.each do |letter|\n\n # check if first letter is vowel or consonant\n if is_consonant?(letter)\n # move it to the end\n removed_consonant = letters.shift\n letters = letters + removed_consonant.split\n #\n else\n letters.push(\"ay\")\n return letters.join\n end\n\n # then add \"ay\" at the end and return\n end\n\nend", "def pig_latinize_string(text)\n a = text.split(' ')\n b= a.map {|word| pig_latinize_word(word)}\n b.join(' ')\n end", "def convert_sentence_to_pig_latin(sentence)\n\tpig_sentence = ''\n\twords = sentence.split(/\\W+/)\n\trubbish = sentence.split(/\\w+/)\n\tfor i in (0..words.length)\n\t\tpig_sentence += rubbish[i].to_s + convert_word_to_pig_latin(words[i]) \n\t\t#put rubbish at first because it has empty string\n\tend\n\treturn pig_sentence\nend", "def pig_latin_sentence(sentence)\n y = sentence\n x = sentence.split\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n t = \"t\"\n h = \"h\"\n qu = \"qu\"\n\n x.map do |word|\n first_letter = word[0]\n if vowels.include?(first_letter)\n word << \"way\"\n elsif word.include?(t && h)\n word << t\n word << h\n word.slice!(0..1)\n word << \"ay\"\n elsif word.include?(qu)\n word << qu\n word.slice!(0..1)\n word << \"ay\"\n else\n word << first_letter\n word.slice!(0)\n word << \"ay\"\n end\n x[0].capitalize!\n end\n\n x.join(\" \")\nend", "def pig_it text\n arr = []\n text.split.map do |x|\n split_word = x.split('')\n unless /[[:punct:]]/.match(x)\n first_letter = split_word.first\n split_word.shift\n split_word << \"#{first_letter + 'ay'}\"\n end\n arr << split_word.join\n end\n arr.join(' ')\nend", "def pig_latinify(sentence)\n translated_words = sentence.split(\" \").map do |word|\n translate_word(word)\n end\n translated_words.join(\" \")\nend", "def pig(word, howmany = 0)\r\n chars = word.split(//)\r\n lastletter_index = word.rindex(/\\w/)\r\n puncs = {}\r\n \r\n #grab punctuation, store info in hash\r\n chars.each_index { |x| puncs[x] = chars.at(x) if chars.at(x) =~ /\\W/ }\r\n\r\n #delete punctuation so we only deal with letters, does nothing if no punc \r\n chars.delete_if {|x| puncs.values.include?(x)} \r\n\r\n #not the most elegant for dealing with starts-with-vowel words, but more modular this way\r\n #skip this swapping stuff if it's a vowel for first letter\r\n if(howmany > 0) \r\n first = chars.slice!(0, howmany) #grab the first n chars, delete grabbed\r\n\r\n if(first[0] == first[0].upcase) #word was capitalized, swap order\r\n chars[0].upcase!\r\n first[0].downcase!\r\n end\r\n\r\n chars += first\r\n end\r\n\r\n #add back punctuation if it existed, does nothing if no punc\r\n puncs.keys.each { |key| chars.insert(key, puncs[key]) }\r\n \r\n #length == 1 means we got a single vowel like \"I\"; different rule\r\n chars.length == 1 ? chars << \"way\" : chars.insert(lastletter_index + 1, \"ay\") \r\n return chars.join(\"\")\r\nend", "def pigatize\n # Declare the output string\n piglatin = ''\n # Split the input text into words and loop with .each,\n # and 'word' as the iterator variable.\n split(' ').each do |word|\n # Check to see if the first letter is a vowel, else it's a consonant.\n if starts_with_vowel(word[0])\n # Add onto the output string with += and add an extra space.\n piglatin += word + 'way'\n else\n piglatin += word[1..-1] + word[0] + 'ay' + ' '\n end\n end\n # Added a .chomp here to get rid of any trailing space.\n piglatin.chomp\n end", "def pig_it text\n text.split(' ').map do |word|\n if word == \"?\" || word == \"!\" || word == \".\" || word == \",\"\n word\n else\n (word[1..(word.length-1)] + word[0] + \"ay\")\n end\n end.join(' ')\nend", "def pig_latin(string)\n # Your code goes here\n arr = string.split(\" \")\n\n pig_latin = []\n arr.map do |x|\n if arr.length == 1\n return x[0] + \"ay\"\n else\n \n word = x[1..-1] + x[0] + \"ay\"\n pig_latin.push(word)\n end\n \n end\n return pig_latin.join(\" \")\nend", "def pig_latin(word)\n vowels = ['a', 'e', 'i', 'o', 'u']\n suffix = 'ay'\n position = 0\n word = word.split(//)\n\n word.any? do |character|\n if vowels.include?(character)\n position = word.find_index(character)\n end\n end\n\n word = word.join.downcase\n punctuation = punctuation?(word) ? word.chars.last : ''\n word_start = punctuation?(word) ? word[position..-2] : word[position..-1]\n\n if position > 0\n word = word_start + word[0...position] + suffix + punctuation \n return word\n end\n\n word = word + suffix\nend", "def pig_latin_word(word)\n vowels = \"aeiou\"\n pigArr = []\n wordArr = word.split(\"\")\n \n if vowels.include?(word[0]) == true\n return word << \"yay\"\n else\n\n word.each_char.with_index do |ele, idx|\n\n if vowels.include?(ele) == true\n wordArr << pigArr\n return wordArr.join(\"\") + \"ay\"\n else\n wordArr[idx] = \"\"\n pigArr << ele\n end\n \n end\n\n end\nend", "def to_pig_latin(words)\n words.split(\" \").collect{|word| piglatinize(word)}.join(\" \")\n\nend", "def english_translate\n pig_latin_arr = []\n pig_latin = []\n print \"What word would you like to translate? \"\n input = gets.chomp!.downcase\n \n pig_latin_word_to_translate = input.split(/ /)\n\n pig_latin_word_to_translate.each do |word|\n pig_latin_arr = word.split(//)\n\n first_letter = pig_latin_word_to_translate.delete_at(0)\n new_letters = english_word_to_translate.join\n\n word = new_letters + first_letter + \"ay\"\n\n pig_latin << word\n end\n \n puts pig_latin.join(' ').capitalize\nend", "def pig_latinify(sentence)\n results = []\n sentence.split(' ').each do |word|\n results << pig_word(word)\n end\n results.join(' ')\nend", "def sentence_to_pig_latin(sentence)\n sentence = sentence.split(' ')\n sentence.map! do |word|\n punctuation = get_punctuation(word)\n word = remove_punctuation(word.downcase)\n pig_latin(word) + punctuation\n end\n sentence.join(' ')\nend", "def pig_latin(str)\n new_str = str.downcase.scan(/\\w+/)\n output = []\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n new_str.each do |element|\n first = []\n last = []\n temp = element.split(\"\")\n temp.each_with_index do |letter, index|\n if vowels.include?(letter)\n last = temp[0...index]\n last.push(\"ay\");\n first = temp[index..-1]\n break\n end\n end\n output.push(first.join(\"\").concat(\"-\"+last.join(\"\")))\n end\n output.join(\" \")\nend", "def pig_latin_word(word)\n\tvowels = \"a,e,i,o,u\"\n \tif ( vowels.include?(word[0]) )\n return word + \"yay\"\n end\n \tfor i in (0...word.length)\n if (vowels.include?(word[i]))\n return word[i..-1] + word[0...i] + \"ay\"\n end\n end\nend", "def pig_latin(word)\n word_array = word.split(\"\")\n if word.start_with?(\"a\",\"e\",\"i\",\"o\",\"u\")\n return \"#{word}way\"\n else\n until word_array[0].start_with?(\"a\",\"e\",\"i\",\"o\",\"u\")\n word_array = word_array.rotate(1)\n end\n return \"#{word_array.join}ay\"\n end\nend", "def pig_it text\n answer = text.split(' ')\n answer.each_with_index do |str, index|\n if (!str.match(/[-!$%^&*()_+|~=`{}\\[\\]:\";'<>?,.\\/]/))\n firstLetter = str[0]\n str[0] = str[0].delete(str[0])\n answer[index] = str.concat(firstLetter) + \"ay\"\n end\n end \n answer.join(' ')\nend", "def pig_latin_word(word)\n pigLatin = \"\"\n str1 = \"\"\n str2 = \"\"\n\n if is_vowel(word[0])\n pigLatin = word + \"yay\"\n return pigLatin\n end\n\n word.each_char.with_index do |char, i|\n if is_vowel(char)\n return word[i..-1] + word[0...i] + \"ay\"\n end\n end\nend", "def pig_latin_word(word)\n vowels = \"aeiou\" # vowel string to reference to contain all vowels\n \n # abcdefghijklmnopqrstuvwxyz\n\n # check if the word starts with a vowel, then add yay\n if vowels.include?(word[0]) # word is a string and check if starts with first position if its a vowel - check this character\n return word + \"yay\" # return + add string yay\n end \n\n # iterate through every letter of each word\n word.each_char.with_index do |char, idx| # iterate and grab every character\n if vowels.include?(char) # we know the behavior of each char is to iterate from left to right\n before_vowel = word[0...idx] # up to but not including vowel -- gives you `tr`\n after_vowel = word[idx..-1] # very last position, inclusive -- gives you `ash`\n return after_vowel + before_vowel + \"ay\"\n end\n end\n\nend", "def pig_latinify(sentence)\n sentence.split(\" \").map { |word| pig_process(word) }.join(\" \")\nend", "def pig_latin(word)\n\nif word[0..0] =~ /[A-Z]/\n is_cap = true\nelse\n is_cap = false\nend\n\n if word.slice(0) == \"a\" ||\n word.slice(0) == \"e\" ||\n word.slice(0) == \"i\" ||\n word.slice(0) == \"o\" ||\n word.slice(0) == \"u\"\n word += \"way\"\n\n elsif word.slice(0..1) == \"qu\"\n word = word.slice(2..word.length) + word.slice(0..1) + \"ay\"\n\n elsif word.slice(1) == \"a\" ||\n word.slice(1) == \"e\" ||\n word.slice(1) == \"i\" ||\n word.slice(1) == \"o\" ||\n word.slice(1) == \"u\"\n word = word.slice(1..word.length) + word.slice(0) + \"ay\"\n\n elsif word.slice(2) == \"a\" ||\n word.slice(2) == \"e\" ||\n word.slice(2) == \"i\" ||\n word.slice(2) == \"o\" ||\n word.slice(2) == \"u\"\n word = word.slice(2..word.length) + word.slice(0..1) + \"ay\"\n\n elsif word.slice(3) == \"a\" ||\n word.slice(3) == \"e\" ||\n word.slice(3) == \"i\" ||\n word.slice(3) == \"o\" ||\n word.slice(3) == \"u\"\n word = word.slice(3..word.length) + word.slice(0..2) + \"ay\"\n\n end\n if is_cap == true\n return word.capitalize\n else\n return word\n end\nend", "def pig_latin_sentence(sentence)\n word_array = sentence.split\n\n new_array = word_array.map {|each_word| pig_latin(each_word)}.join(\" \")\nend", "def pig_latin_sentence_reverse(sentence)\n sentence.downcase!\n\n x = sentence.split\n\n t = \"t\"\n h = \"h\"\n q = \"q\"\n u = \"u\"\n\n # this removes the \"ay\"\n x.map do |word|\n word.slice!(\"way\")\n word.slice!(\"ay\")\n end\n\n # this removes the \"th\" and \"qu\" from the end of the words and add it to the front\n x.map do |word|\n last_letter = word[-1]\n if word.include?(t && h)\n word.insert(0, h)\n word.insert(0, t)\n word.chop!\n if last_letter == t || h\n word.chop!\n end\n end\n # else\n if word.include?(u && q)\n word.insert(0, u)\n word.insert(0, q)\n word.chop!\n if last_letter == u || q\n word.chop!\n end\n end\n end\n\n # this changes the selected elements\n [x[2], x[3], x[6], x[7]].map do |word|\n word.insert(0, word[-1])\n if word[0] == word[-1]\n word.chop!\n word == word[0..-2]\n end\n x[0].capitalize!\n end\n\n x.join(\" \")\nend", "def pig_latin_translate\n english_word_arr = []\n vowel_array = %w(a e i o u)\n \n print \"What word would you like to translate? \"\n input = gets.chomp!.downcase\n \n english_word_to_translate = input.split(/ /)\n \n english_word_to_translate.each do |word|\n english_word_arr = word.split(//)\n\n\n\n #split by words\n #split by character\n #Take first letter move to end\n #add 'Ay'\n #join and return word\n end\nend", "def pig_latin_word(string)\n array_of_char = string.downcase.split(//)\n\n if [\"a\",\"e\",\"i\",\"o\",\"u\",\"y\"].include?(array_of_char[0])\n array_of_char.push(\"ay\")\n elsif !([\"a\",\"e\",\"i\",\"o\",\"u\",\"y\"].include?(array_of_char[0]))\n consonant = array_of_char.delete_at(0)\n array_of_char.push(consonant, \"ay\")\n end\n\n return array_of_char.join\n\nend", "def piglatinize(input)\n\t\t#splits the input to capture multiple words\n\t\tif input.split(\" \").length == 1\n\t\t\tpiglatinize_single_word(input)\n\t\telse piglatinize_sentence(input)\n end\n\tend", "def pig_latin_word(word)\n word_array = word.split('')\n vowels = 'aeiou'\n if vowels.include?(word_array.first)\n return \"#{word_array.join}yay\"\n end\n\n until vowels.include?(word_array.first)\n char = word_array.shift\n word_array.push(char)\n end\n\n \"#{word_array.join}ay\"\nend", "def pig_latin(word)\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n ind = word.index(/[aeiou]/)\n\n if vowels.include?(word[0])\n word.delete(\" \") << \"ay\"\n else\n if ind == nil\n word << \"ay\"\n else\n final_word = word.chars.drop(ind) << word.chars.slice(0..ind-1) << \"ay\"\n final_word.join\n end\n end\n end", "def pig_latin (string)\n if string.chr == \"a\" || string.chr == \"e\" || string.chr == \"i\" || string.chr == \"o\" || string.chr == \"u\" \n string + \"way\"\n else \n arr=[]\n arr = string.split(//) << string.split(//)[0]\n arr.delete_at(0)\n arr.join + 'ay'\n end\nend", "def pig_latin_word(word)\n vowels = ['a', 'e', 'i', 'o', 'u']\n new_word = \"\"\n if vowels.include?(word[0])\n return word + \"yay\"\n else\n word.each_char.with_index do |ch, i|\n if vowels.include?(ch)\n return word[i..-1] + word[0...i] + \"ay\"\n end\n end\n end\nend", "def piglatin(word)\n new_string = \"\"\n vowels = (\"aeiou\")\n word.split(\"\").each_with_index do |letter, index| \n if !vowels.include?(letter.downcase)\n next\n else\n if index == 0\n new_string += word + \"way\"\n return new_string\n else\n up_to_vowel = word.slice(0...index)\n after_vowel = word.slice(index..-1)\n new_string += after_vowel + up_to_vowel + \"ay\"\n return new_string\n end\n end\n end\n end", "def pig_latin_word(word)\r\n latin = word\r\n word.each_char.with_index do |char,idx|\r\n if isVowel(char)\r\n if idx == 0\r\n return latin + 'yay'\r\n else\r\n return latin + 'ay'\r\n end\r\n else\r\n letter = latin[0]\r\n latin[0] = \"\"\r\n latin += letter\r\n end\r\n end\r\nend", "def pig_latin_word(str)\n vowels = \"aeiou\"\n\n if vowels.include?(str[0])\n return str + \"yay\"\n else\n str.each_char.with_index do |char, index|\n if vowels.include?(char)\n return str[index..-1] + str[0...index] + \"ay\"\n end\n end\n end\nend", "def pig_latin_word(word)\n vowels = \"aeiou\"\n\n if vowels.include?(word[0])\n return word + \"yay\"\n end\n\n word.each_char.with_index do |char, i|\n if vowels.include?(char)\n return word[i..-1] + word[0...i] + \"ay\"\n end\n end\nend", "def pig_latin(sentence)\n sentence.split.map { |word| latinify(word) }.join(\" \")\nend", "def pig_latin_word(word)\n vowels = 'aeiou'\n\n if vowels.include?(word[0])\n return word + 'yay'\n end\n\n word.each_char.with_index do | char, i |\n if vowels.include?(char)\n return word[i..-1] + word[0...i] + 'ay'\n end\n end\nend", "def pig_latin(sentence)\n \n words = sentence.split\n result = words.map do |word|\n \tlatinize(word)\n end\n result.join(\" \")\nend", "def pig_latin_word(english)\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n \n if vowels.include?(english[0].downcase)\n english\n else\n vowel_index = english.index(/[aeiouy]/)\n front_half = english.slice!(vowel_index..-1)\n back_half = english\n punct = front_half.slice!(/\\W$/)\n punct = \"\" if punct == nil\n pig_word = front_half + back_half + \"ay\" + punct\n end\nend", "def pig_latin word\n vowels = %w(a e i o u)\n if vowels.include? word[0]\n word + 'yay'\n else\n vw = nil\n word.chars.each_with_index do |x,xi|\n vw = xi and break if vowels.include? x\n end\n pre = word[0...vw]\n suf = word[vw..-1]\n suf + pre + 'ay'\n end\nend", "def pig_it_ms_two(str)\n pig = []\n str.split.each do |w|\n pig << w.chars.rotate.join + \"ay\" if w =~ /\\w/\n pig << w if w =~ /\\W/\n end\n pig.join(\" \")\nend", "def pig_latin_word(word)\r\n\tif word[0].downcase =~ /[aeiou]/\r\n\t\tword << \"way\" \r\n\telse\r\n\t\tn = /[aeiou]/.match word.downcase\r\n\t\tn.to_s + n.post_match + n.pre_match + \"ay\"\r\n\tend\r\nend", "def translate string\n\n\t#This splits the string into an array of words\n\twords = string.split(\" \")\n\t\n\t#Goes through each word in array words\n\tfor i in 0...words.length\n\n\t\t#This splits each word into an array of characters\n\t\tcharacters = words[i].chars\n\n\t\t#If a word begins with a vowel, add \"ay\" to the end of the word\n\t\tif isVowel characters[0]\n\n\t\t\tcharacters.push(\"a\", \"y\")\n\t\t\twords[i] = characters.join(\"\")\n\n\t\t#If a word does not begin with a vowel...\n\t\telse\n\n\t\t\t#While the first character is not a vowel, move it to the back of the word\n\t\t\twhile !(isVowel characters[0])\n\n\t\t\t\t#If the first character is a \"q,\"\n\t\t\t\tif characters[0] == \"q\"\n\n\t\t\t\t\t#and the next character is a \"u,\" push both the \"qu\" to the end\n\t\t\t\t\tif characters[1] == \"u\"\n\n\t\t\t\t\t\tconsonant = characters.shift\n\t\t\t\t\t\tcharacters.push(consonant)\n\t\t\t\t\t\tu = characters.shift\n\t\t\t\t\t\tcharacters.push(u)\n\n\t\t\t\t\tend\n\n\t\t\t\t#Otherwise, just push the first letter to the end\n\t\t\t\telse\n\n\t\t\t\t\tconsonant = characters.shift\n\t\t\t\t\tcharacters.push(consonant)\n\n\t\t\t\tend\n\n\t\t\tend\n\n\t\t\t#Then add \"ay\" to the end of the word\n\t\t\tcharacters.push(\"a\", \"y\")\n\t\t\twords[i] = characters.join(\"\")\n\n\t\tend\n\t\t\n\tend\n\n\t#Joins together all the words with a space in between them and returns the modified string as an answer\n\tanswer = words.join(\" \")\n\treturn answer\n\nend", "def pig_it(string)\n string2 = string.split.map{|e|e == '!' || e == '?' ? e : e.to_s << (e[0]) }.join(' ')\n\n string3 = string2.split.map{|e|e == '!' || e == '?' ? e : e.to_s << 'ay'}.join(' ')\n\n string3.split.map{|e| e == '!' || e == '?' ? e : e = e[1..-1]}.join(' ')\nend", "def pig_latin(word)\n check_vowel = %w(a e i o u).include?(word[0])\n if check_vowel == true\n word + 'way'\n else\n word_array = word.chars.to_a\n until word_array[0].to_s == \"a\" || word_array[0].to_s == \"e\" || word_array[0].to_s == \"i\" || word_array[0].to_s == \"o\" || word_array[0].to_s == \"u\"\n word_array << word_array[0]\n word_array.shift\n end\n word_array.join + 'ay'\n end\nend", "def translate(phrase)\n #split phrase into words\n word_array = phrase.split ' '\n #to_pig each word\n answer_array = word_array.map {|word| to_pig(word)}\n #join words back together\n answer = answer_array.join ' '\nend", "def translate s\n \n words = s.split.map{|word|\n if %w(a e i o u).include?(word[0])\n word << \"ay\"\n elsif %w(thr sch squ).include?(word[0..2])\n word[3..-1] << (word[0..2] << \"ay\")\n elsif %w(ch qu br th).include?(word[0..1])\n word[2..-1] << word[0..1] << \"ay\" \n else\n word[1..-1] << (word[0] << \"ay\") \n end\n }\n words.join(\" \")\n\nend", "def pig(word)\n letters = word.split(\"\")\n letters.keep_if {|letter| letter != \".\"}\n if letters.size == 1 || vowel?(letters[0])\n letters << \"way\"\n elsif letters.size > 1\n until vowel?(letters[0])\n letters << letters.shift\n end\n letters << \"ay\"\n end\n letters.join\n end", "def pig_latin(word)\n if word.slice(0..1) == \"qu\"\n word = word.slice(1..word.length) + word.slice(0) + \"ay\" \n elsif word.slice(0) == \"a\" ||\n word.slice(0) == \"e\" ||\n word.slice(0) == \"i\" ||\n word.slice(0) == \"o\" ||\n word.slice(0) == \"u\"\n word += \"way\"\n elsif word.slice(1) == \"a\" ||\n word.slice(1) == \"e\" ||\n word.slice(1) == \"i\" ||\n word.slice(1) == \"o\" ||\n word.slice(1) == \"u\"\n word = word.slice(1..word.length) + word.slice(0) + \"ay\"\n elsif word.slice(2) == \"a\" ||\n word.slice(2) == \"e\" ||\n word.slice(2) == \"i\" ||\n word.slice(2) == \"o\" ||\n word.slice(2) == \"u\"\n word = word.slice(2..word.length) + word.slice(0..1) + \"ay\"\n else word.slice(3) == \"a\" ||\n word.slice(3) == \"e\" ||\n word.slice(3) == \"i\" ||\n word.slice(3) == \"o\" ||\n word.slice(3) == \"u\"\n word = word.slice(3..word.length) + word.slice(0..2) + \"ay\"\n end\n return word\nend", "def pig_latin(word)\n # Encrypts words into pig latin\n # if/else: catches the \"qu\" phoneme to treat it as a group\n # until: builds the word section to be shifted to the end\n i = 0\n shift = ''\n vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']\n if word.include?('qu') == true\n until \"u\".include? (word[i]) do\n shift += word[i]\n i += 1\n end\n shift += word[i]\n else \n until vowels.include? (word[i]) do \n shift += word[i]\n i += 1\n end\n end\n word.sub(shift, '') + shift.downcase + 'ay'\nend", "def pig_latin(word)\n if word.chr =~ /[aeiou]/\n word + \"way\"\n\n else while word =~ /\\A[^aeiou]/\n word = \"#{word[1..-1]}#{word[0..0]}\"\n if word.chr =~ /[aeiou]/\n end\n end\n word + \"ay\"\nend\nend", "def pig_latin_txt(string)\n arr=[]\n arr = string.split.map!{|x| pig_latin(x)}\n arr.join(' ')\nend", "def translate word\n\n\tsplit = word.split(\" \")\n\tlatin = \"\"\n\tvowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n\t\n\n\n\tsplit.each do |string|\n\n\t\ta = 0\n\t\tconsts = 0\n\n\t\twhile vowels.include?(string[a]) === false\n\t\t\tconsts = consts + 1\n\t\t\ta = a + 1\n\t\tend\n\n\t\tif string[consts -1] === \"q\"\n\t\t\tif string[consts] === \"u\"\n\t\t\t\tconsts = consts + 1\n\t\t\tend\n\t\tend\n\n\t\tb = string[0, consts]\n\n\t\t\n\t\tif consts === 1\n\t\t\tlatin = latin + string[consts, string.length-1] + string[0] + \"ay\"\n\t\telsif\tconsts > 1\n\t\t\tlatin = latin + string[consts, string.length-1] + b + \"ay\"\n\t\telse\n\t\t\tlatin = latin + string + \"ay\"\n\t\tend\n\n\tlatin = latin + \" \"\n\n\tend\n\n\tlatin.strip\n\t\nend", "def translate\n words\n words_array = []\n pig_latin_words_array = []\n @words_array.each do |word|\n if starts_with_vowel?(word)\n word += 'way'\n elsif !starts_with_vowel?(word[1..-1])\n word = word[2..-1] + word[0] + word[1] + 'ay'\n else\n word = word[1..-1] + word[0] + 'ay'\n end\n pig_latin_words_array << word\n end\n return pig_latin_words_array\n end", "def translate(str)\n\n\n\n # Vowels to consider\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n \n # Special cases to consider\n two_letter_consonants = [\"ch\", \"sh\", \"qu\", \"th\", \"br\"]\n three_letter_consonants = [\"thr\", \"sch\", \"squ\"]\n\n words = str.split(\" \")\n result = []\n\n words.each do |word|\n if vowels.include?(word[0])\n result.push word << \"ay\"\n else \n if three_letter_consonants.include? (word[0] + word[1] + word[2])\n first_three_letters = word.slice!(0,3)\n \n # Add letters to end of word with 'ay'\n result.push word << first_three_letters << 'ay'\n elsif two_letter_consonants.include?(word[0] + word[1])\n first_two_letters = word.slice!(0,2)\n result.push word << first_two_letters << \"ay\"\n else \n first_letter = word.slice!(0)\n \n # Add first letter to end of word with 'ay'\n result.push word << first_letter << 'ay'\n end #End of special consonant check\n end \n end \n return result.join(\" \")\nend", "def translate(your_string)\n words = your_string.split(/\\s+/)\n vowels = %w{a e i o u}\n th_ch = %q{th ch sh sc qu }\n three_letter = %q{sch}\n translated_words=[]\n words.each do |word|\n letters = word.scan(/\\w/)\n word_length = letters.length\n \n if vowels.include?(letters[0])\n #word begins with a vowel\n word += \"ay\"\n \n elsif th_ch.include?(letters[0]+letters[1]) && !vowels.include?(letters[2])\n # word begins with three consonants\n word = (letters[3..word_length-1]<<letters[0]<<letters[1]<<letters[2]).join.to_s+\"ay\"\n \n elsif th_ch.include?(letters[0]+letters[1]) && vowels.include?(letters[2])\n #word begins with two defined consonants followed by a vowel\n word = (letters[2..word_length-1]<<letters[0]<<letters[1]).join.to_s+\"ay\"\n \n elsif (letters[1]+letters[2]) == \"qu\"\n # word starts with a <consonant + \"qu\">\n word = (letters[3..word_length-1]<<letters[0]<<letters[1]<<letters[2]).join.to_s+\"ay\"\n \n elsif !vowels.include?(letters[0]) && !vowels.include?(letters[1])\n #word begins with two not_defined consonants followed by a vowel\n word = (letters[2..word_length-1]<<letters[0]<<letters[1]).join.to_s+\"ay\"\n \n else\n # only one consonant begins the word\n word = (letters[1..word_length-1]<<letters[0]).join.to_s+\"ay\"\n end\n translated_words << word\n end\n translated_words.join(\" \").to_s\nend", "def translate(str)\n\tvowel=%w[a e i o u]\n\tcons=[*'a'..'z']-vowel\n\n\ta_str=str.split(\" \")\n\n\tfor i in 0..a_str.length-1\n\t\tif vowel.include?a_str[i][0]\n\t\t\tpig_l = a_str[i] + \"ay\"\n\t\t\treturn pig_l.split(\",\").join(\"\")\n\t\telsif cons.include?a_str[i][0]\n\t\t\tif cons.include?a_str[i][1]\n\t\t\t\tz=a_str[i].slice!(0..1)\n\t\t\telse\n\t\t\t\tz=a_str[i].slice!(0)\n\t\t\tend\n\t\t\tpig_l=a_str[i] + z+ \"ay\"\n\t\t\treturn pig_l.split(\",\").join(\"\")\n\t\tend\n\tend\nend", "def pig_latin_chop(word)\n\t#split single word into characters\n\n\twordArray = word.split(\"\") \n\tvowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']\n\tuntil vowels.include?(wordArray[0])==true\n\t\tconsonant = wordArray.shift().downcase\n\t\twordArray = wordArray.push(consonant)\n\tend\n\tnewWord = wordArray.join()+ \"ay\"\nend", "def translate(string)\n\tsufix = ''\n\tres = ''\n\n\tword_a = string.split(' ')\n\n\tword_a.each do |word|\n\t\tsufix = ''\n\t\twhile !word.start_with?('a', 'e', 'i', 'o', 'u')\n\t\t\tif word[0..1] == 'qu'\n\t\t\t\tsufix += word[0..1]\n\t\t\t\tword[0..1] = ''\n\t\t\telse\n\t\t\t\tsufix += word[0]\n\t\t\t\tword[0] = ''\n\t\t\tend\n\t\tend\n\t\tres += word + sufix + 'ay '\n\tend\n\t\n\tres.rstrip\nend", "def translate(string)\n newArr = []\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n \n # * Split it into words\n words = string.split()\n\n # * For every word in the sentence...\n words.each do |word|\n # * If the word has 'qu'\n if word[1..2].downcase == \"qu\"\n newArr << word[3..-1] + word[0..2] + \"ay\"\n\n elsif word[0..1].downcase == \"qu\"\n newArr << word[2..-1] + word[0..1] + \"ay\"\n\n # * If it starts with a vowel\n elsif vowels.include?(word[0].downcase)\n newArr << word + \"ay\"\n\n # * If the first three consonants aren't vowels\n elsif not vowels.include?(word[0].downcase) and not vowels.include?(word[1]) and not vowels.include?(word[2])\n newArr << word[3..-1] + word[0..2] + \"ay\" \n # * ...or if the first two consonants aren't vowels\n elsif not vowels.include?(word[0].downcase) and not vowels.include?(word[1])\n newArr << word[2..-1] + word[0..1] + \"ay\" \n \n # * After all that, if it starts with one consonant\n else\n newArr << word[1..-1] + word[0] + \"ay\"\n end\n end\n\n newArr.join(\" \")\nend", "def pig_it(str)\n str.gsub(/(\\w)(\\w+)*/, '\\2\\1ay')\nend", "def pig_it text\n text.gsub(/(\\w)(\\w+)*/, '\\2\\1ay')\nend", "def pig_it text\n text.gsub(/(\\w)(\\w+)*/, '\\2\\1ay')\nend", "def translate(word)\n split_words = word.split(' ')\n words = []\n vowels = %w[a e i o u]\n split_words.each do |word|\n word = qu_in_word(word)\n if vowels.include?(word[0])\n words.push(word + 'ay')\n else\n count = 0\n word.length.times do |number|\n vowels.include?(word[number]) ? break : count += 1\n end\n words.push(word[count..-1] + word[0..(count - 1)] + 'ay')\n end\n end\n words.join(' ')\nend", "def pig_latinify(sentence)\nend", "def pig_latinify(sentence)\n\nend", "def piglatin(data)\n if data\n # + means space\n words = data.split(\"+\")\n piglatin_words = []\n\n words.each do |word|\n # vowel?\n if word[0].match(/[a,e,i,o,u]/)\n word = word + \"way\"\n # 'qu' at front?\n elsif word[0,2] == \"qu\"\n word = word[2..-1] + \"quay\"\n # consonant?\n elsif word[0].match(/[^a,e,i,o,u,0-9]/)\n word = word[1..-1] + word[0] + \"ay\"\n end\n\n piglatin_words.push(word)\n end\n\n piglatin_words.join(\" \")\n else\n \"Error: need input\"\n end\n end", "def convert (str)\r\n# REFERENCE : Using logic from this source https://stackoverflow.com/questions/13498688/pig-latin-method-translation\r\n alpha = ('a'..'z').to_a\r\n vowels = %w[a e i o u]\r\n consonants = alpha - vowels\r\n lstr = str.downcase\r\n if vowels.include?(lstr[0])\r\n str + 'way'\r\n elsif consonants.include?(lstr[0]) && consonants.include?(lstr[1]) && consonants.include?(lstr[2])\r\n str[3..-1] + str[0..2] + 'ay'\r\n elsif consonants.include?(lstr[0]) && consonants.include?(lstr[1])\r\n str[2..-1] + str[0..1] + 'ay'\r\n elsif consonants.include?(lstr[0])\r\n str[1..-1] + str[0] + 'ay'\r\n else\r\n str # return unchanged\r\n end\r\nend", "def pig_latin_name(word)\n \n letters = word.split(\"\")\n \n final_array = letters.clone\n letters.each do |letter| #[p, l, u, m]\n \n \n if is_consonants?(letter)\n final_array.rotate! \n # #puts \".........#{removed_consonant}\"\n # #letters.push(removed_consonant)\n # puts \".........#{final_array}..#{letters}\"\n else \n # puts \"*****#{final_array}.... #{letters}\"\n final_array.push(\"ay\")\n return final_array.join\n end\n end\nend", "def translate (sentence)\n\ttranslated = ''\n\twords = sentence.split(' ')\n\twords.each { |word|\n\t\tfound_vowels = word.scan(/^[aeiou]*/)\n\t\tfound_consonants = word.scan(/^[bcdfghjklmnpqrstvxzwy]*/)\n\t\tif !found_vowels[0].empty?\n\t\t\ttranslated << word << 'ay'\n\t\telsif !found_consonants[0].empty?\n\t\t\tword = word.tr(found_consonants[0], '')\n\t\t\ttranslated << word << found_consonants[0] << 'ay'\n\t\tend\n\t\tif words.length > 1\n\t\t\ttranslated << ' '\n\t\tend\n\t}\n\treturn translated.rstrip\nend", "def pig_latin(sentence)\n \n\nend", "def translate(word)\r\n vowels = \"aeio\".split('').to_a\r\n consonant = \"bcdfghjklmnpqrstuvwxyz\".split('').to_a \r\n answer = []\r\n \r\n while word.split(' ').length == 1 \r\n words = word.split('')\r\n until vowels.include?(words[0])\r\n words = words.rotate(1)\r\n end\r\n words << \"ay\"\r\n return words.join('')\r\n end # one word ^^\r\n \r\n if word.split(' ').length > 1 \r\n words = word.split(' ')\r\n end \r\n words.each do |i|\r\n if vowels.include?(i[0])\r\n i << \"ay\"\r\n answer << i\r\n #return answer\r\n end\r\n end\r\n \r\n words.each do |j|\r\n if consonant.include?(j[0])\r\n j = j.split('').rotate(1).join('') until vowels.include?(j[0])\r\n j = j + \"ay\"\r\n #return j\r\n #j << j #correct format for 1 consonant but it doesnt add to array\r\n answer << j\r\n end\r\n end\r\n \r\n return answer.join(' ')\r\n end", "def pig_latin word\n vowel = word =~ /[aeio]|(?<!q)u/\n word[vowel..-1]+word[0...vowel]+'ay'\nend", "def translate(words)\n split_words = words.split\n split_words.each_with_index do |word, i|\n # check if first letter is a vowel\n if word[0].include? VOWELS.join\n word = add_ay(word) # add ay to the back of the word\n split_words[i] = word\n\n elsif word[0].include? CONSONANTS\n find_phoneme(word)\n elsif (word[0].include? CONSONANTS) && (word[1].include? CONSONANTS)\n find_phoneme(word)\n elsif (word[0].include? CONSONANTS) && (word[1].include? CONSONANTS) && (word[2].include? CONSONANTS)\n\n # the word has a consonant at the beginning with\n # no special conditions\n else\n word = one_cons_at_beginning(word)\n word = add_ay(word)\n split_words[i] = word\n end\n end\n split_words.join\nend", "def to_pig_latin(text)\n\t\ttext.split(' ').map do |w|\n\t\t\tpiglatinize(w)\n\t\tend.join(' ')\n\tend", "def translate( word )\n #Practicing regular expressions. Main idea: If I can find the first vowel then take the index\n #where that vowel is and split the word. If word has no vowels or first letter is a vowel,\n #just put word in new_word variable.\n\n phrase = \"\"\n\n word.split.each do | word |\n\n #If first letter is a vowel or no vowels in the word, just give the word\n if ( /[aeiou]/ =~ word ) == 0 || ( /[aeiou]/ =~ word ) == nil\n new_word = word\n\n #If my word starts with a qu then we'll split the word with the qu together\n elsif word[ 0..1 ] == \"qu\"\n new_word = word[ 2..word.length ] + word[ 0..1 ]\n\n #Keeping below if I wanna find a word that has a vowel \n #if word.split.any? { |letter| /[aeiou]/ =~ letter }\n\n #If my word starts with an squ then we'll split this word with the squ together\n elsif word[ 0..2 ] == \"squ\"\n new_word = word[ 3..word.length ] + word[ 0..2 ]\n\n else\n new_word = word[ ( /[aeiou]/ =~ word )..word.length ] + word[ 0..( ( /[aeiou]/ =~ word ) - 1 ) ]\n end\n\n #Add ay if vowel is at the front of the new word\n new_word += \"ay\" if new_word.split.any? { | letter | /[aeiou]/ =~ letter }\n\n #Adding the words together to form the output with space\n phrase += \"#{ new_word } \"\n\n end\n\n puts phrase\n phrase.strip\n\nend" ]
[ "0.8572142", "0.8463625", "0.8369375", "0.83493626", "0.83162314", "0.8313072", "0.8233264", "0.8154935", "0.8076044", "0.80078864", "0.80078095", "0.7985065", "0.7983783", "0.7975871", "0.7956212", "0.79484385", "0.794035", "0.7914071", "0.7906031", "0.7902359", "0.7900232", "0.7894565", "0.7880714", "0.78748816", "0.7871855", "0.7864423", "0.7843172", "0.7822725", "0.781832", "0.7814111", "0.77839947", "0.77804136", "0.77638245", "0.776298", "0.7751331", "0.7746543", "0.7707982", "0.7689391", "0.7685353", "0.7678909", "0.7675514", "0.7675289", "0.766862", "0.7656275", "0.7656131", "0.7619476", "0.76175755", "0.7610009", "0.75819546", "0.7577285", "0.75771445", "0.757242", "0.75565565", "0.7547909", "0.75445366", "0.75098544", "0.75093776", "0.75005215", "0.74899083", "0.7471829", "0.746399", "0.7459119", "0.74588984", "0.7458252", "0.7451491", "0.7436135", "0.74347436", "0.74291587", "0.7421015", "0.741729", "0.74085546", "0.73981476", "0.7393579", "0.7365116", "0.7346311", "0.73368067", "0.7305872", "0.73049986", "0.73044425", "0.7231157", "0.72200847", "0.7211729", "0.72027755", "0.71980333", "0.7196493", "0.718571", "0.718571", "0.70952874", "0.7087704", "0.7070671", "0.7039806", "0.69943213", "0.6985127", "0.69721717", "0.6935949", "0.692755", "0.69178677", "0.69100803", "0.6906745", "0.6904134" ]
0.7883379
22
DELETE /vip_phones/1 DELETE /vip_phones/1.xml
def destroy @vip_phone.destroy respond_to do |format| format.html { redirect_to(admin_vip_phones_url) } format.xml { head :ok } end website.add_log(user: current_user, action: "Deleted a amx vip phone: #{@vip_phone.phone}") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @phone = Phone.find(params[:id])\n @phone.destroy\n\n respond_to do |format|\n format.html { redirect_to phones_url }\n format.xml { head :ok }\n end\n end", "def destroy\n @phone = Phone.find(params[:id])\n @phone.destroy\n\n respond_to do |format|\n format.html { redirect_to(phones_url) }\n #format.xml { head :ok }\n end\nend", "def destroy\n @phonecall = Phonecall.find(params[:id])\n @phonecall.destroy\n\n respond_to do |format|\n format.html { redirect_to(phonecalls_url) }\n format.xml { head :ok }\n end\n end", "def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end", "def destroy\n @phone = Phone.find(params[:id])\n @phone.destroy\n\n respond_to do |format|\n format.html { redirect_to(contacts_url) }\n format.xml { head :ok }\n end\n end", "def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end", "def destroy\n @tag_for_phone = TagForPhone.find(params[:id])\n @tag_for_phone.destroy\n\n respond_to do |format|\n format.html { redirect_to tag_for_phones_url }\n format.xml { head :ok }\n end\n end", "def destroy\n @phone_model = PhoneModel.find(params[:id])\n @phone_model.destroy\n\n respond_to do |format|\n format.html { redirect_to(phone_models_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n #@phone = Phone.find(params[:id])\n #@phone.destroy\n end", "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end", "def destroy\n @pphone = Pphone.find(params[:id])\n @pphone.destroy\n\n respond_to do |format|\n format.html { redirect_to(pphones_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @phone.destroy\n respond_to do |format|\n format.html { redirect_to(contact_info_admin_phones_url) }\n format.xml { head :ok }\n end\n add_log(user: current_user, action: \"Deleted phone: #{@phone.phone}\")\n end", "def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end", "def destroy\n @moto_user_phone = MotoUserPhone.find(params[:id])\n @moto_user_phone.destroy\n\n respond_to do |format|\n format.html { redirect_to(moto_user_phones_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @boat_user_phone = BoatUserPhone.find(params[:id])\n @boat_user_phone.destroy\n\n respond_to do |format|\n format.html { redirect_to(boat_user_phones_url) }\n format.xml { head :ok }\n end\n end", "def delete_sip_account(id)\n @cloudvox_api[\"/phones/#{id}.json\"].delete\n end", "def destroy\n @smartphone = Smartphone.find(params[:id])\n @smartphone.destroy\n\n respond_to do |format|\n format.html { redirect_to(smartphones_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @vip = Vip.find(params[:id])\n @vip.destroy\n\n respond_to do |format|\n format.html { redirect_to(vips_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @phone_number = PhoneNumber.find(params[:id])\n @phone_number.destroy\n\n respond_to do |format|\n format.html { redirect_to(phone_numbers_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @phone_number.destroy\n\n respond_to do |format|\n format.html { redirect_to(phone_numbers_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @phone = Phone.find(params[:id])\n @phone.destroy\n\n respond_to do |format|\n format.html { redirect_to phones_url }\n format.json { head :ok }\n end\n end", "def deleteEntityPhone( entity_id, gen_id)\n params = Hash.new\n params['entity_id'] = entity_id\n params['gen_id'] = gen_id\n return doCurl(\"delete\",\"/entity/phone\",params)\n end", "def deleteResource(doc, msg_from)\n \n \n begin\n\n puts \"Deleting\"\n\n path = \"\"\n params = {}\n headers = {}\n \n context, path = findContext(doc, path) \n \n # Deleting member from group\n if context == :user_group_member\n params = {}\n else\n raise Exception.new(\"No context given!\")\n end\n \n httpAndNotify(path, params, msg_from, :delete)\n \n rescue Exception => e\n puts \"Problem in parsing data (CREATE) from xml or sending http request to the VR server: \" + e\n puts \" -- line: #{e.backtrace[0].to_s}\"\n end\n \n end", "def destroy\n @phone = Phone.find(params[:id])\n @phone.destroy\n\n respond_to do |format|\n format.html { redirect_to phones_url }\n format.json { head :no_content }\n end\n end", "def delete\n @user = User.find(params[:id])\n @user.rvsps.delete_all()\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @mobile = Mobile.find(params[:id])\n #@mobile.destroy\n\n respond_to do |format|\n format.html { redirect_to(mobiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @phone.destroy\n respond_to do |format|\n format.html { redirect_to phones_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @phone.destroy\n respond_to do |format|\n format.html { redirect_to phones_url }\n format.json { head :no_content }\n end\n end", "def delete(contactname)\n\n end", "def destroy\n @phone_item.destroy\n respond_to do |format|\n format.html { redirect_to phone_items_url, notice: '删除成功.' }\n format.json { head :no_content }\n end\n end", "def destroy\n #@phone.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end", "def destroy\n @ip_addr = IpAddr.find(params[:id])\n @ip_addr.destroy\n\n respond_to do |format|\n format.html { redirect_to(ip_addrs_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @mobile = Mobile.find(params[:id])\n @mobile.destroy\n\n respond_to do |format|\n format.html { redirect_to(mobiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy_rest\n @instrument_version = InstrumentVersion.find(params[:id])\n @instrument_version.destroy\n\n respond_to do |format|\n format.html { redirect_to(instrument_versions_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @fax_document = FaxDocument.find(params[:id])\n @fax_document.destroy\n \n respond_to do |format|\n format.html { redirect_to(fax_documents_url) }\n format.xml { head :ok }\n end\n end", "def delete(vmname)\n uri = @uri + \"/#{vmname}?api-version=#{api_version}\"\n uri\n end", "def destroy\n @phone_use = PhoneUse.find(params[:id])\n @phone_use.destroy\n\n respond_to do |format|\n format.html { redirect_to(phone_uses_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @ministerios = Ministerios.find(params[:id])\n @ministerios.destroy\n\n respond_to do |format|\n format.html { redirect_to(ministerios_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @promos = Promos.find(params[:id])\n @promos.destroy\n\n respond_to do |format|\n format.html { redirect_to(promos_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @telefono = @persona.telefonos.find(params[:id])\n @telefono.destroy\n\n respond_to do |format|\n format.html { redirect_to(persona_telefonos_url(@persona)) }\n format.xml { head :ok }\n end\n end", "def destroy\n @reqinfo = Reqinfo.find(params[:id])\n @reqinfo.destroy\n\n respond_to do |format|\n format.html { redirect_to(reqinfos_url) }\n format.xml { head :ok }\n end\n end", "def destroy; delete end", "def destroy\n @phone.destroy\n respond_to do |format|\n format.html { redirect_to phones_url, notice: \"Номер #{@phone.number} был успешно удален\" }\n end\n\n end", "def destroy\n @child_dupa2 = ChildDupa2.find(params[:id])\n @child_dupa2.destroy\n\n respond_to do |format|\n format.html { redirect_to(child_dupa2s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @chirp = Chirp.find(params[:id])\n @chirp.destroy\n\n respond_to do |format|\n format.html { redirect_to(chirps_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n get_supplier\n @supplier_phone = @supplier.phones.find(params[:id])\n @supplier_phone.destroy\n end", "def destroy\n @patientappointmentinfo = Patientappointmentinfo.find(params[:id])\n @patientappointmentinfo.destroy\n\n respond_to do |format|\n format.html { redirect_to(patientappointmentinfos_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @visaapp = Visaapp.find(params[:id])\n @visaapp.destroy\n\n respond_to do |format|\n format.html { redirect_to(visaapps_url) }\n format.xml { head :ok }\n end\n end", "def delete\n request(:delete)\n end", "def delete(options={})\n connection.delete(\"/\", @name)\n end", "def destroy\n @phonenumber = Phonenumber.find(params[:id])\n @phonenumber.destroy\n\n head :no_content\n end", "def destroy\n @contactos = Contactos.find(params[:id])\n @contactos.destroy\n\n respond_to do |format|\n format.html { redirect_to(contactos_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @call = Call.find(params[:id])\n @call.destroy\n\n respond_to do |format|\n format.html { redirect_to(calls_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @call = Call.find(params[:id])\n @call.destroy\n\n respond_to do |format|\n format.html { redirect_to(calls_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @vip_service.destroy\n respond_to do |format|\n format.html { redirect_to(admin_vip_services_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted a amx vip service: #{@vip_service.name}\")\n end", "def destroy\n @xpto = Xpto.find(params[:id])\n @xpto.destroy\n\n respond_to do |format|\n format.html { redirect_to xptos_url }\n format.json { head :no_content }\n end\n end", "def delete(path)\n make_call(mk_conn(path), :delete)\n end", "def destroy\n @phone_number_type = PhoneNumberType.find(params[:id])\n @phone_number_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(phone_number_types_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @phone.destroy\n respond_to do |format|\n format.html { redirect_to phones_url, notice: 'Phone was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @phone.destroy\n respond_to do |format|\n format.html { redirect_to phones_url, notice: 'Phone was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def destroy\n name, type = resource[:name].split('/')\n case type\n when 'MX'\n @dnsres.each do |res|\n preference = res.preference\n target = res.to_rdata\n nsupdate(\"server #{server}\n update delete #{name} MX #{preference} #{target}.\n send\")\n end\n when 'SRV'\n @dnsres.each do |res|\n priority = res.priority\n weight = res.weight\n port = res.port\n target = res.to_rdata\n nsupdate(\"server #{server}\n update delete #{name} SRV #{priority} #{weight} #{port} #{target}\n send\")\n end\n else\n rdata = @dnsres.to_rdata\n nsupdate(\"server #{server}\n update delete #{name} #{type} #{rdata}\n send\")\n end\n end", "def destroy\n @vpn = Vpn.find(params[:id])\n checkaccountobject(\"vpns\",@vpn)\n @vpn.send_delete\n\n respond_to do |format|\n format.html { redirect_to vpns_url }\n format.json { head :ok }\n end\n end", "def destroy\n @sip_proxy = SipProxy.find(params[:id])\n @sip_proxy.destroy\n \n respond_to do |format|\n format.html { redirect_to(sip_proxies_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @phone_call.destroy\n respond_to do |format|\n format.html { redirect_to phone_calls_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @it_device = ItDevice.find(params[:id])\n @it_device.destroy\n\n respond_to do |format|\n format.html { redirect_to(it_devices_url) }\n format.xml { head :ok }\n end\n end", "def delete_data\n response = WebPay.client.delete([path, 'data'].join('/'))\n response['deleted']\n end", "def destroy\n @prov_contact_updates = ProvContactUpdates.find(params[:id])\n @prov_contact_updates.destroy\n\n respond_to do |format|\n format.html { redirect_to prov_contact_updates_url }\n format.xml { head :ok }\n end\n end", "def delete\n \n end", "def delete_demo(id)\n delete_record \"/demos/#{id}\"\n end", "def destroy\n @voip.destroy\n respond_to do |format|\n format.html { redirect_to voips_url, notice: 'Voip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_customer_phone(customer_id, phone_id)\n delete(\"customers/#{customer_id}/phones/#{phone_id}\")\n end", "def destroy\n @phone_detail = PhoneDetail.find(params[:id])\n @phone_detail.destroy\n respond_to do |format|\n format.html { redirect_to phone_details_path, notice: 'Phone detail was successfully destroyed.' }\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 delete\n\n end", "def delete\n execute_request('DELETE') do |uri, headers|\n HTTP.http_client.delete(uri, header: headers)\n end\n end", "def destroy\n @silicaship = Silicaship.find(params[:id])\n @silicaship.destroy\n\n respond_to do |format|\n format.html { redirect_to(silicaships_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @relatorios = Relatorio.find(params[:id])\n @relatorios.destroy\n\n respond_to do |format|\n format.html { redirect_to(homes_path) }\n format.xml { head :ok }\n end\n end", "def destroy\n @device = Device.find(params[:id])\n @device.destroy\n\n respond_to do |format|\n format.html { redirect_to(devices_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @device = Device.find(params[:id])\n @device.destroy\n\n respond_to do |format|\n format.html { redirect_to(devices_url) }\n format.xml { head :ok }\n end\n end", "def delete\n end", "def destroy\n @appointment_request = AppointmentRequest.find(params[:id])\n @appointment_request.destroy\n\n respond_to do |format|\n format.html { redirect_to(appointment_requests_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @qx = Qx.find(params[:id])\n @qx.destroy\n\n respond_to do |format|\n format.html { redirect_to(qxes_url) }\n format.xml { head :ok }\n end\n end", "def delete\n delete_from_server single_url\n end", "def delete\n \n end", "def destroy\n @domino = Domino.find(params[:id])\n @domino.destroy\n\n respond_to do |format|\n format.html { redirect_to(dominos_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post413 = Post413.find(params[:id])\n @post413.destroy\n\n respond_to do |format|\n format.html { redirect_to(post413s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @visarequest = Visarequest.find(params[:id])\n @visarequest.destroy\n\n respond_to do |format|\n format.html { redirect_to(visarequests_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @device.destroy\n\n respond_to do |format|\n format.html { redirect_to(devices_url) }\n format.xml { head :ok }\n end\n end", "def delete(id)\n request = Net::HTTP::Delete.new(\"#{@url}/#{id}.xml\")\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end", "def destroy\n @services_charger = ServicesCharger.find(params[:id])\n @services_charger.destroy\n\n respond_to do |format|\n format.html { redirect_to(services_chargers_url) }\n format.xml { head :ok }\n end\n end", "def delete(id)\r\n connection.delete(\"/#{@doctype}[@ino:id=#{id}]\")\r\n end", "def destroy\n @device = Device.find(params[:id]) #根据设备id值查找设备\n @[email protected]\n respond_to do |format|\n format.html { redirect_to(devices_url) }\n format.xml { head :ok }\n end\n end", "def delete\n client.delete(url)\n @deleted = true\nend", "def destroy\n @nom = Nom.find(params[:id])\n @nom.destroy\n\n respond_to do |format|\n format.html { redirect_to(noms_url) }\n format.xml { head :ok }\n end\n end" ]
[ "0.6860093", "0.6728651", "0.6727244", "0.6702415", "0.6698911", "0.66733325", "0.66554886", "0.66427493", "0.6622559", "0.6621793", "0.66081727", "0.65984875", "0.65856636", "0.65836096", "0.6459741", "0.64055115", "0.64036226", "0.635286", "0.6351725", "0.63440907", "0.6312093", "0.6292551", "0.6284373", "0.62825215", "0.6276027", "0.6262118", "0.6259172", "0.6259172", "0.6234933", "0.62346596", "0.622679", "0.6220641", "0.6220343", "0.61952555", "0.6182515", "0.6172482", "0.6162561", "0.6149703", "0.6145961", "0.61412066", "0.61265194", "0.6108262", "0.61081856", "0.61062557", "0.6093622", "0.60903674", "0.608772", "0.6081079", "0.60785425", "0.6074395", "0.607059", "0.60622835", "0.6053922", "0.60505164", "0.6038127", "0.6038127", "0.60306716", "0.60216165", "0.6021404", "0.6018027", "0.6017959", "0.6017959", "0.6012285", "0.60092384", "0.60071665", "0.59997666", "0.59990245", "0.5997835", "0.59922224", "0.5990486", "0.5982796", "0.59763473", "0.5972315", "0.5970994", "0.5966564", "0.59663224", "0.59663224", "0.59663224", "0.59663224", "0.5964209", "0.59589475", "0.5957736", "0.59572554", "0.59528214", "0.59528214", "0.5952759", "0.5949939", "0.594576", "0.59426475", "0.5934488", "0.59332985", "0.5932764", "0.59253913", "0.59253526", "0.5924053", "0.5917449", "0.59150827", "0.5914673", "0.59107804", "0.590319" ]
0.71718454
0
GET /standard_units GET /standard_units.json
def index @standard_units = StandardUnit.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def foods_units\n get('/foods/units.json')\n end", "def update\n if @standard_unit.update(standard_unit_params)\n render :show, status: :ok, location: @standard_unit\n else\n render json: @standard_unit.errors, status: :unprocessable_entity\n end\n end", "def index\n response = HTTParty.get(\"https://casa-core.herokuapp.com/api/units\", :headers => { \"Authorization\" => AUTH, \"Host\" => HOST})\n @units = JSON.parse(response.body)\n return @units\n end", "def show\n @unit_of_measure = UnitOfMeasure.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit_of_measure }\n end\n end", "def set_standard_unit\n @standard_unit = StandardUnit.find(params[:id])\n end", "def units\n @formulation = (params[:formulation] || '').upcase\n drug = Drug.find_by_name(@formulation) rescue nil\n render plain: \"per dose\" and return unless drug && !drug.units.blank?\n render plain: drug.units\n end", "def create\n @standard_unit = StandardUnit.new(standard_unit_params)\n\n if @standard_unit.save\n render :show, status: :created, location: @standard_unit\n else\n render json: @standard_unit.errors, status: :unprocessable_entity\n end\n end", "def standard_unit_params\n params.require(:standard_unit).permit(:name)\n end", "def units\n @units = Item.select(\"DISTINCT unit\").where(\"unit like ?\", \"%#{params[:q]}%\").limit(20).map(&:unit)\n @units += Detail.select(\"DISTINCT unit\").where(\"unit like ?\", \"%#{params[:q]}%\").limit(20).map(&:unit)\n @units = @units.uniq\n respond_to do |format|\n format.json { render json: @units }\n end\n end", "def show\n @standard_measurement = StandardMeasurement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @standard_measurement }\n end\n end", "def get_standard_size\n standard_size = StandardSize.where(fit_type: params[:fit_type]).where(neck: params[:neck])\n if standard_size.empty?\n response = { msg: \"No Standard size found\"}\n render json: response.to_json, status: \"200\"\n else\n render json: standard_size.first.to_json, status: \"200\"\n end\n\n end", "def index\n @units = Unit.all\n end", "def index\n @units = Unit.all\n end", "def index\n @units = Unit.all\n end", "def index\n @units = Unit.all\n end", "def index\n @units = Unit.all\n end", "def index\n @units = Unit.all\n end", "def units\n @units = SQF.units @this\n @units\n end", "def index\n @base_units = BaseUnit.all\n end", "def index\n @unit_measures = UnitMeasure.all\n end", "def all_units\n services.map{|el| el[:units]} \n end", "def show\n @unit = Unit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit }\n end\n end", "def show\n @unit = Unit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit }\n end\n end", "def show\n @unit = Unit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit }\n end\n end", "def unit_of_measurement_find_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UnitOfMeasurementApi.unit_of_measurement_find ...\"\n end\n # resource path\n local_var_path = \"/UnitsOfMeasurement\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<UnitOfMeasurement>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UnitOfMeasurementApi#unit_of_measurement_find\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @unit = Unit.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit }\n end\n end", "def normal_units_uri\n UrisAreEolTerms.new(self).uri(:normal_units_uri)\n end", "def index\n @unit_of_measures = UnitOfMeasure.all\n end", "def show\n query = {\n 'id' => unit_params[:id]\n }\n response = HTTParty.get(\"https://casa-core.herokuapp.com/api/units/?id\", :query => query, :headers => { \"Authorization\" => AUTH, \"Host\" => HOST})\n\n if response.code == 200\n @unit = JSON.parse(response.body)\n else\n redirect_to unit_path(params[:id]), notice: 'Hmm...thats strange...try that again.'\n end\n end", "def show\n @study_unit = StudyUnit.find(params[:id])\n @logical_products = @study_unit.logical_products\n @data_collections = @study_unit.data_collections\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @study_unit }\n end\n end", "def index\n @display_units = DisplayUnit.all\n end", "def units\n attribute('yweather:units')\n end", "def base_unit\n units[0]\n end", "def index\n @study_units = StudyUnit.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @study_units }\n end\n end", "def units\n\t\tret = []\n\t\[email protected]('sgt-structure:' + @id + ':units').each do |uid|\n\t\t\tret.push(getUnit(@db, uid))\n\t\tend\n\t\tret\n\tend", "def systemOfUnits \n \"systemOfUnits\" \n end", "def index\n @units = if params[:order] == 'updated'\n Unit.order('updated_at ' + params[:updated_direction])\n elsif params[:order] == 'created'\n Unit.order('created_at ' + params[:created_direction])\n elsif params[:order] == 'note_updated'\n Unit.order('note_updated_at ' + params[:note_updated_direction])\n elsif params[:order] == 'first_name'\n Unit.joins(:resident).order('residents.first_name ' + params[:first_name_direction])\n elsif params[:order] == 'last_name'\n Unit.joins(:resident).order('residents.last_name ' + params[:last_name_direction])\n elsif params[:order] == 'name'\n Unit.order('name ' + params[:name_direction])\n elsif params[:order] == 'address'\n Kaminari.paginate_array(Address.joins(:street, :units).order(\"streets.name #{params[:address_direction]}\").order(\"addresses.street_number #{params[:address_direction]}\").map(&:units).flatten)\n else\n Unit.order('created_at desc')\n end.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @units }\n end\n end", "def units\n return @units\n end", "def index\n @unit_type = UnitType.all\n\n respond_to do |format|\n format.json { render json: @unit_type }\n format.xml { render xml: @unit_type }\n end\n end", "def unit\n return @units[@index]\n end", "def unit\n return @units[@index]\n end", "def units(units=nil)\n cur_page.units(units)\n end", "def show\n @extent_unit = ExtentUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @extent_unit }\n end\n end", "def get_units\n @agency, @depts = params[:agency], params[:dept]\n render :layout => false\n end", "def units\n self.ListUnits.first.map { |u| map_unit(u) }\n end", "def user_units\n @user.units\n end", "def index\n get_data\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @unit_of_measures }\n format.js\n end\n end", "def show\n @item_unit = ItemUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item_unit }\n end\n end", "def unit_mappings\n {\n ApiUnitSystem.US => { :duration => \"milliseconds\", :distance => \"miles\", :elevation => \"feet\", :height => \"inches\", :weight => \"pounds\", :measurements => \"inches\", :liquids => \"fl oz\", :blood_glucose => \"mg/dL\" },\n ApiUnitSystem.UK => { :duration => \"milliseconds\", :distance => \"kilometers\", :elevation => \"meters\", :height => \"centimeters\", :weight => \"stone\", :measurements => \"centimeters\", :liquids => \"mL\", :blood_glucose => \"mmol/l\" },\n ApiUnitSystem.METRIC => { :duration => \"milliseconds\", :distance => \"kilometers\", :elevation => \"meters\", :height => \"centimeters\", :weight => \"kilograms\", :measurements => \"centimeters\", :liquids => \"mL\", :blood_glucose => \"mmol/l\" }\n }\n end", "def show\n @electoral_unit = ElectoralUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @electoral_unit }\n end\n end", "def index\n @handbook_structual_units = HandbookStructualUnit.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @handbook_structual_units }\n end\n end", "def display_unit_params\n params.require(:display_unit).permit(:standard_unit_id, :name, :display_ratio)\n end", "def index\n @org_units = OrgUnit.all\n end", "def show\n @unit_type = UnitType.find(params[:id])\n respond_to do |format|\n format.json { render json: @unit_type }\n format.xml { render xml: @unit_type }\n end\n end", "def index\n authorize Unit\n @units_version = Unit.version\n @units = Unit.all\n render\n end", "def units=(value)\n @units = value\n end", "def playableUnits \n \"playableUnits\" \n end", "def get_usage_rum_units_with_http_info(start_hr, opts = {})\n\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_rum_units ...'\n end\n # verify the required parameter 'start_hr' is set\n if @api_client.config.client_side_validation && start_hr.nil?\n fail ArgumentError, \"Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_rum_units\"\n end\n # resource path\n local_var_path = '/api/v1/usage/rum'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'start_hr'] = start_hr\n query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].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;datetime-format=rfc3339'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'UsageRumUnitsResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]\n\n new_options = opts.merge(\n :operation => :get_usage_rum_units,\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 :api_version => \"V1\"\n )\n\n data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsageMeteringAPI#get_usage_rum_units\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def new\n @unit_of_measure = UnitOfMeasure.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unit_of_measure }\n end\n end", "def si_unit\n return Unit.steridian if describe == 'solid angle'\n return Unit.radian if describe == 'plane angle'\n\n val = si_base_units\n return nil unless val\n return val[0] if val.length == 1\n val = val.inject(Unit.unity) do |compound,unit|\n compound * unit\n end\n val = val.or_equivalent unless val.acts_as_equivalent_unit\n end", "def find_single(scope) \n JSON[RestClient.get \"#{@site}/unit/#{scope}\", :accept=>'json'][0]\n end", "def unit_params\n params.fetch(:unit, {})\n end", "def index\n @police_units = PoliceUnit.all\n end", "def transfer_unit\n if !params[:ic_number].nil?\n user = User.find_by_ic_number(params[:ic_number])\n departments = user.units.active.collect(&:name)\n render :json=>[departments] if departments\n end\n end", "def metrics\n standard.unit.convert_to_metric imperials\n end", "def get_systems_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UniverseApi.get_systems ...\"\n end\n if opts[:'datasource'] && !['tranquility', 'singularity'].include?(opts[:'datasource'])\n fail ArgumentError, 'invalid value for \"datasource\", must be one of tranquility, singularity'\n end\n # resource path\n local_var_path = \"/universe/systems/\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'datasource'] = opts[:'datasource'] if !opts[:'datasource'].nil?\n query_params[:'user_agent'] = opts[:'user_agent'] if !opts[:'user_agent'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'X-User-Agent'] = opts[:'x_user_agent'] if !opts[:'x_user_agent'].nil?\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<Integer>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UniverseApi#get_systems\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @quotation_units = QuotationUnit.all\n end", "def unit_rules\n Rules.raw[\"units\"][type]\n end", "def index\n @storage_units = StorageUnit.all\n end", "def unit(unit_id=nil, opts = {})\n units = connection.get(connection.build_url(\"units\", opts.merge(:unitids => unit_id))).body\n units.map!{|hash| hash.values.first}\n units.each{|u| u.extend UnitMethods; u._cloud_connect = self;}\n units.first\n end", "def units _args\n \"units _args;\" \n end", "def destroy\n @standard_unit.destroy\n end", "def get_skus()\n\tputs \"Getting skus\"\n\tresponse = request_get(\"/api/sku\")\n\tputs response.body\nend", "def available_units\n # After manual set, duplicate map for form select lists\n all_units = ['gram', 'kg', 'lb', 'oz', 'liter', 'gal', 'qt', 'pt', 'us_fl_oz', 'tsp', 'tbsp', 'cup', 'each'].map { |unit| [unit, unit] }.sort\n return all_units\n\tend", "def getTotalIva10\n total = 0\n $details.each do |detail|\n total+=(detail.unit_price / 10)\n end\n respond_to do |format|\n format.html \n format.json { render json: total.to_i}\n end\n end", "def emission_units\n data['emission_units']\n end", "def index\n @army_units = ArmyUnit.all\n end", "def show\n @handbook_structual_unit = HandbookStructualUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @handbook_structual_unit }\n end\n end", "def index\n @german_units = GermanUnit.all\n end", "def show\n @unit = Unit.find(params[:id])\n @item = Item.find(@unit.item_id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit }\n end\n end", "def index\n if params[:q]\n @search = UnitOfMeasure.search(params[:q])\n @unit_of_measures = @search.result.page(params[:page]).per(current_user.list_page_size)\n else\n @search = UnitOfMeasure.search(params[:q]) \n @unit_of_measures = @search.result.where(validity: true).page(params[:page]).per(current_user.list_page_size)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @unit_of_measures }\n end\n end", "def standard_unit\n self.specimen_class ||= infer_specimen_class(self.class)\n SpecimenClass::UNIT_HASH[self.specimen_class]\n end", "def allowed_units\n @converter.list_units(true)\n end", "def show\n @units = @commercial_lead.units\n end", "def show\n @resource = Resource.find(params[:resource_id])\n @incident = Incident.find(@resource.incident_id)\n @demob = Demob.find(params[:id])\n @logistics_units = @demob.units[0..5]\n @finance_units = @demob.units[6..8]\n @other_units = @demob.units[9..10]\n @plans_units = @demob.units[11..13]\n end", "def unit_of_measurement_find_one_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UnitOfMeasurementApi.unit_of_measurement_find_one ...\"\n end\n # resource path\n local_var_path = \"/UnitsOfMeasurement/findOne\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'UnitOfMeasurement')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UnitOfMeasurementApi#unit_of_measurement_find_one\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def getuom\n @deliverable_type = DeliverableType.find(params[:id])\n respond_to do |format|\n format.json { render :json => @deliverable_type.uom}\n end\n end", "def new\n @standard_measurement = StandardMeasurement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @standard_measurement }\n end\n end", "def single_usage\r\n meter = get_meters[3]\r\n date_ranges = get_date_ranges\r\n dtps = Meter.get_daily_time_periods [meter]\r\n\r\n# usage = meter.usage_by_meter(date_ranges, dtps)\r\n# usage = meter.usage_by_time(date_ranges, dtps)\r\n usage = meter.detailed_usage_by_meter(date_ranges, dtps)\r\n# usage = meter.detailed_usage_by_time(date_ranges, dtps)\r\n\r\n render :json => usage\r\n\r\n# redirect_to action: 'index'\r\n end", "def set_unit_of_measure\n @unit_of_measure = UnitOfMeasure.find(params[:id])\n end", "def standard\n # lookup system unit of same kind and is base unit\n conv = type.conversions.find do |c|\n c.base? &&\n c.kind == kind &&\n c.system == Stick.default\n end\n #unit = Unit.register.find do |u|\n # u.base? &&\n # u.type == self.type &&\n # u.system == Stick.default\n #end\n # convert to univesral and from universal to standard\n #unit.from_universal(universal)\n conv.call(universal)\n end", "def index\n @standard_sizes = StandardSize.all\n end", "def show\n @cloth_measure = ClothMeasure.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cloth_measure }\n end\n end", "def show\n @steam_consumption = SteamConsumption.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @steam_consumption }\n end\n end", "def units\n game.squares.each_with_object([]) do |square, collection|\n square.units.each do |unit|\n collection << unit if unit.player_number == number\n end\n end\n end", "def show\n @retail_unit = RetailUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @retail_unit }\n end\n end", "def currency_unit\n @currency_unit\n end", "def get_measurements\n render json: @data_source.measurements\n end", "def total_units\n return @total_units\n end", "def getTotal\n total = 0\n $details.each do |detail|\n total+=(detail.unit_price * detail.amount)\n end\n respond_to do |format|\n format.html \n format.json { render json: total.to_i}\n end\n end" ]
[ "0.7401382", "0.6443082", "0.6424642", "0.6421105", "0.64155406", "0.62630224", "0.6217981", "0.62058634", "0.61837095", "0.61517185", "0.6119284", "0.60843855", "0.60843855", "0.60843855", "0.60843855", "0.60843855", "0.60843855", "0.6043516", "0.6013545", "0.6004442", "0.5974507", "0.5970582", "0.5970582", "0.5970582", "0.5957943", "0.5935447", "0.59349376", "0.58997476", "0.5852487", "0.58513397", "0.58435416", "0.5838634", "0.58187056", "0.5809134", "0.5807231", "0.5798126", "0.5740092", "0.57145697", "0.5713988", "0.5713609", "0.5713609", "0.5703033", "0.5702125", "0.57000375", "0.56861883", "0.5670901", "0.5655031", "0.56539756", "0.5649175", "0.56436723", "0.563874", "0.5619738", "0.5608051", "0.560309", "0.56012136", "0.5571989", "0.55674154", "0.5558982", "0.55527484", "0.55410606", "0.55400485", "0.5525943", "0.55241114", "0.5510775", "0.5508122", "0.550199", "0.54900473", "0.5478947", "0.54785997", "0.5466648", "0.54599684", "0.54523844", "0.5448771", "0.54450387", "0.54405737", "0.54401076", "0.5413652", "0.5412247", "0.540962", "0.5407504", "0.5403958", "0.5403095", "0.53986555", "0.53946364", "0.5388199", "0.5383191", "0.5382096", "0.53769857", "0.5371676", "0.5356436", "0.5355064", "0.5352202", "0.53497934", "0.53496665", "0.53389895", "0.5335447", "0.532956", "0.5323975", "0.5318459", "0.5305451" ]
0.7373037
1
GET /standard_units/1 GET /standard_units/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def foods_units\n get('/foods/units.json')\n end", "def index\n @standard_units = StandardUnit.all\n end", "def show\n @unit_of_measure = UnitOfMeasure.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit_of_measure }\n end\n end", "def set_standard_unit\n @standard_unit = StandardUnit.find(params[:id])\n end", "def update\n if @standard_unit.update(standard_unit_params)\n render :show, status: :ok, location: @standard_unit\n else\n render json: @standard_unit.errors, status: :unprocessable_entity\n end\n end", "def show\n @standard_measurement = StandardMeasurement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @standard_measurement }\n end\n end", "def index\n response = HTTParty.get(\"https://casa-core.herokuapp.com/api/units\", :headers => { \"Authorization\" => AUTH, \"Host\" => HOST})\n @units = JSON.parse(response.body)\n return @units\n end", "def show\n @unit = Unit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit }\n end\n end", "def show\n @unit = Unit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit }\n end\n end", "def show\n @unit = Unit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit }\n end\n end", "def create\n @standard_unit = StandardUnit.new(standard_unit_params)\n\n if @standard_unit.save\n render :show, status: :created, location: @standard_unit\n else\n render json: @standard_unit.errors, status: :unprocessable_entity\n end\n end", "def show\n @unit = Unit.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit }\n end\n end", "def units\n @units = Item.select(\"DISTINCT unit\").where(\"unit like ?\", \"%#{params[:q]}%\").limit(20).map(&:unit)\n @units += Detail.select(\"DISTINCT unit\").where(\"unit like ?\", \"%#{params[:q]}%\").limit(20).map(&:unit)\n @units = @units.uniq\n respond_to do |format|\n format.json { render json: @units }\n end\n end", "def show\n query = {\n 'id' => unit_params[:id]\n }\n response = HTTParty.get(\"https://casa-core.herokuapp.com/api/units/?id\", :query => query, :headers => { \"Authorization\" => AUTH, \"Host\" => HOST})\n\n if response.code == 200\n @unit = JSON.parse(response.body)\n else\n redirect_to unit_path(params[:id]), notice: 'Hmm...thats strange...try that again.'\n end\n end", "def find_single(scope) \n JSON[RestClient.get \"#{@site}/unit/#{scope}\", :accept=>'json'][0]\n end", "def get_standard_size\n standard_size = StandardSize.where(fit_type: params[:fit_type]).where(neck: params[:neck])\n if standard_size.empty?\n response = { msg: \"No Standard size found\"}\n render json: response.to_json, status: \"200\"\n else\n render json: standard_size.first.to_json, status: \"200\"\n end\n\n end", "def show\n @extent_unit = ExtentUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @extent_unit }\n end\n end", "def standard_unit_params\n params.require(:standard_unit).permit(:name)\n end", "def units\n @formulation = (params[:formulation] || '').upcase\n drug = Drug.find_by_name(@formulation) rescue nil\n render plain: \"per dose\" and return unless drug && !drug.units.blank?\n render plain: drug.units\n end", "def show\n @item_unit = ItemUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item_unit }\n end\n end", "def index\n @units = Unit.all\n end", "def index\n @units = Unit.all\n end", "def index\n @units = Unit.all\n end", "def index\n @units = Unit.all\n end", "def index\n @units = Unit.all\n end", "def index\n @units = Unit.all\n end", "def show\n @study_unit = StudyUnit.find(params[:id])\n @logical_products = @study_unit.logical_products\n @data_collections = @study_unit.data_collections\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @study_unit }\n end\n end", "def unit_of_measurement_find_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UnitOfMeasurementApi.unit_of_measurement_find ...\"\n end\n # resource path\n local_var_path = \"/UnitsOfMeasurement\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<UnitOfMeasurement>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UnitOfMeasurementApi#unit_of_measurement_find\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def base_unit\n units[0]\n end", "def index\n @base_units = BaseUnit.all\n end", "def show\n @electoral_unit = ElectoralUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @electoral_unit }\n end\n end", "def show\n @unit_type = UnitType.find(params[:id])\n respond_to do |format|\n format.json { render json: @unit_type }\n format.xml { render xml: @unit_type }\n end\n end", "def index\n @unit_measures = UnitMeasure.all\n end", "def new\n @unit_of_measure = UnitOfMeasure.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unit_of_measure }\n end\n end", "def unit_of_measurement_find_one_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UnitOfMeasurementApi.unit_of_measurement_find_one ...\"\n end\n # resource path\n local_var_path = \"/UnitsOfMeasurement/findOne\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'UnitOfMeasurement')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UnitOfMeasurementApi#unit_of_measurement_find_one\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @study_units = StudyUnit.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @study_units }\n end\n end", "def unit\n return @units[@index]\n end", "def unit\n return @units[@index]\n end", "def index\n @unit_of_measures = UnitOfMeasure.all\n end", "def show\n @unit = Unit.find(params[:id])\n @item = Item.find(@unit.item_id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit }\n end\n end", "def index\n @display_units = DisplayUnit.all\n end", "def index\n @unit_type = UnitType.all\n\n respond_to do |format|\n format.json { render json: @unit_type }\n format.xml { render xml: @unit_type }\n end\n end", "def index\n get_data\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @unit_of_measures }\n format.js\n end\n end", "def new\n @standard_measurement = StandardMeasurement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @standard_measurement }\n end\n end", "def show\n @retail_unit = RetailUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @retail_unit }\n end\n end", "def show\n @handbook_structual_unit = HandbookStructualUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @handbook_structual_unit }\n end\n end", "def getuom\n @deliverable_type = DeliverableType.find(params[:id])\n respond_to do |format|\n format.json { render :json => @deliverable_type.uom}\n end\n end", "def single_usage\r\n meter = get_meters[3]\r\n date_ranges = get_date_ranges\r\n dtps = Meter.get_daily_time_periods [meter]\r\n\r\n# usage = meter.usage_by_meter(date_ranges, dtps)\r\n# usage = meter.usage_by_time(date_ranges, dtps)\r\n usage = meter.detailed_usage_by_meter(date_ranges, dtps)\r\n# usage = meter.detailed_usage_by_time(date_ranges, dtps)\r\n\r\n render :json => usage\r\n\r\n# redirect_to action: 'index'\r\n end", "def units\n @units = SQF.units @this\n @units\n end", "def show\n @cloth_measure = ClothMeasure.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cloth_measure }\n end\n end", "def show\n @measure = Measure.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @measure }\n end\n end", "def index\n @handbook_structual_units = HandbookStructualUnit.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @handbook_structual_units }\n end\n end", "def systemOfUnits \n \"systemOfUnits\" \n end", "def index\n authorize Unit\n @units_version = Unit.version\n @units = Unit.all\n render\n end", "def unit(unit_id=nil, opts = {})\n units = connection.get(connection.build_url(\"units\", opts.merge(:unitids => unit_id))).body\n units.map!{|hash| hash.values.first}\n units.each{|u| u.extend UnitMethods; u._cloud_connect = self;}\n units.first\n end", "def set_unit_of_measure\n @unit_of_measure = UnitOfMeasure.find(params[:id])\n end", "def index\n @units = if params[:order] == 'updated'\n Unit.order('updated_at ' + params[:updated_direction])\n elsif params[:order] == 'created'\n Unit.order('created_at ' + params[:created_direction])\n elsif params[:order] == 'note_updated'\n Unit.order('note_updated_at ' + params[:note_updated_direction])\n elsif params[:order] == 'first_name'\n Unit.joins(:resident).order('residents.first_name ' + params[:first_name_direction])\n elsif params[:order] == 'last_name'\n Unit.joins(:resident).order('residents.last_name ' + params[:last_name_direction])\n elsif params[:order] == 'name'\n Unit.order('name ' + params[:name_direction])\n elsif params[:order] == 'address'\n Kaminari.paginate_array(Address.joins(:street, :units).order(\"streets.name #{params[:address_direction]}\").order(\"addresses.street_number #{params[:address_direction]}\").map(&:units).flatten)\n else\n Unit.order('created_at desc')\n end.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @units }\n end\n end", "def show\n @log_unit = LogUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @log_unit }\n end\n end", "def show\n @steam_consumption = SteamConsumption.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @steam_consumption }\n end\n end", "def new\n @unit = Unit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unit }\n end\n end", "def new\n @unit = Unit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unit }\n end\n end", "def new\n @unit = Unit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unit }\n end\n end", "def show\n @quantity_unit = QuantityUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @quantity_unit }\n end\n end", "def display_unit_params\n params.require(:display_unit).permit(:standard_unit_id, :name, :display_ratio)\n end", "def new\n @unit = Unit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unit}\n end\n end", "def show\n @storage_unit = StorageUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @storage_unit }\n end\n end", "def get_usage_rum_units_with_http_info(start_hr, opts = {})\n\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_rum_units ...'\n end\n # verify the required parameter 'start_hr' is set\n if @api_client.config.client_side_validation && start_hr.nil?\n fail ArgumentError, \"Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_rum_units\"\n end\n # resource path\n local_var_path = '/api/v1/usage/rum'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'start_hr'] = start_hr\n query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].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;datetime-format=rfc3339'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'UsageRumUnitsResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]\n\n new_options = opts.merge(\n :operation => :get_usage_rum_units,\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 :api_version => \"V1\"\n )\n\n data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsageMeteringAPI#get_usage_rum_units\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @machine_id_standard = MachineIdStandard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @machine_id_standard }\n end\n end", "def units\n attribute('yweather:units')\n end", "def set_unit_of_measure\n @unit_of_measure = UnitOfMeasure.find(params[:id])\n end", "def si_unit\n return Unit.steridian if describe == 'solid angle'\n return Unit.radian if describe == 'plane angle'\n\n val = si_base_units\n return nil unless val\n return val[0] if val.length == 1\n val = val.inject(Unit.unity) do |compound,unit|\n compound * unit\n end\n val = val.or_equivalent unless val.acts_as_equivalent_unit\n end", "def normal_units_uri\n UrisAreEolTerms.new(self).uri(:normal_units_uri)\n end", "def show\n @resource = Resource.find(params[:resource_id])\n @incident = Incident.find(@resource.incident_id)\n @demob = Demob.find(params[:id])\n @logistics_units = @demob.units[0..5]\n @finance_units = @demob.units[6..8]\n @other_units = @demob.units[9..10]\n @plans_units = @demob.units[11..13]\n end", "def all_units\n services.map{|el| el[:units]} \n end", "def show\n @title = \"Prima Lingua: #{@section.name}\"\n if params[:unit_id]\n @overview_unit = Unit.find(params[:unit_id])\n else\n @overview_unit = @section.lesson.unit\n end\n respond_to do |format|\n format.html { render_flex_layout }\n format.json { render :json => @section }\n end\n end", "def transfer_unit\n if !params[:ic_number].nil?\n user = User.find_by_ic_number(params[:ic_number])\n departments = user.units.active.collect(&:name)\n render :json=>[departments] if departments\n end\n end", "def getTotalIva10\n total = 0\n $details.each do |detail|\n total+=(detail.unit_price / 10)\n end\n respond_to do |format|\n format.html \n format.json { render json: total.to_i}\n end\n end", "def show\r\n @stats = Stat.all\r\n @statsu = Stat.where(calculation_id: params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @stat }\r\n end\r\n end", "def show\n @unit_subtitle = UnitSubtitle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit_subtitle }\n end\n end", "def show\n @unit = Unit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @unit }\n end\n end", "def get_skus()\n\tputs \"Getting skus\"\n\tresponse = request_get(\"/api/sku\")\n\tputs response.body\nend", "def show\n render json: @measure\n end", "def index\n @org_units = OrgUnit.all\n end", "def show\n @microposst = Microposst.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @microposst }\n end\n end", "def show\n @total_stock = TotalStock.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @total_stock }\n end\n end", "def set_unit_measure\n @unit_measure = UnitMeasure.find(params[:id])\n end", "def get_units\n @agency, @depts = params[:agency], params[:dept]\n render :layout => false\n end", "def units\n self.ListUnits.first.map { |u| map_unit(u) }\n end", "def index\n @police_units = PoliceUnit.all\n end", "def show\n @family_unit = FamilyUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family_unit }\n end\n end", "def index\n @storage_units = StorageUnit.all\n end", "def index\n if params[:q]\n @search = UnitOfMeasure.search(params[:q])\n @unit_of_measures = @search.result.page(params[:page]).per(current_user.list_page_size)\n else\n @search = UnitOfMeasure.search(params[:q]) \n @unit_of_measures = @search.result.where(validity: true).page(params[:page]).per(current_user.list_page_size)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @unit_of_measures }\n end\n end", "def show\n @units = @commercial_lead.units\n end", "def get_systems_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UniverseApi.get_systems ...\"\n end\n if opts[:'datasource'] && !['tranquility', 'singularity'].include?(opts[:'datasource'])\n fail ArgumentError, 'invalid value for \"datasource\", must be one of tranquility, singularity'\n end\n # resource path\n local_var_path = \"/universe/systems/\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'datasource'] = opts[:'datasource'] if !opts[:'datasource'].nil?\n query_params[:'user_agent'] = opts[:'user_agent'] if !opts[:'user_agent'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'X-User-Agent'] = opts[:'x_user_agent'] if !opts[:'x_user_agent'].nil?\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<Integer>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UniverseApi#get_systems\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def units\n\t\tret = []\n\t\[email protected]('sgt-structure:' + @id + ':units').each do |uid|\n\t\t\tret.push(getUnit(@db, uid))\n\t\tend\n\t\tret\n\tend", "def new\n @extent_unit = ExtentUnit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @extent_unit }\n end\n end", "def getTotal\n total = 0\n $details.each do |detail|\n total+=(detail.unit_price * detail.amount)\n end\n respond_to do |format|\n format.html \n format.json { render json: total.to_i}\n end\n end", "def index\n @cloth_measures = ClothMeasure.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cloth_measures }\n end\n end", "def destroy\n @standard_unit.destroy\n end", "def get_cloud_aws_organizational_unit_by_moid_with_http_info(moid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CloudApi.get_cloud_aws_organizational_unit_by_moid ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CloudApi.get_cloud_aws_organizational_unit_by_moid\"\n end\n # resource path\n local_var_path = '/api/v1/cloud/AwsOrganizationalUnits/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'CloudAwsOrganizationalUnit'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CloudApi.get_cloud_aws_organizational_unit_by_moid\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CloudApi#get_cloud_aws_organizational_unit_by_moid\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def unit_mappings\n {\n ApiUnitSystem.US => { :duration => \"milliseconds\", :distance => \"miles\", :elevation => \"feet\", :height => \"inches\", :weight => \"pounds\", :measurements => \"inches\", :liquids => \"fl oz\", :blood_glucose => \"mg/dL\" },\n ApiUnitSystem.UK => { :duration => \"milliseconds\", :distance => \"kilometers\", :elevation => \"meters\", :height => \"centimeters\", :weight => \"stone\", :measurements => \"centimeters\", :liquids => \"mL\", :blood_glucose => \"mmol/l\" },\n ApiUnitSystem.METRIC => { :duration => \"milliseconds\", :distance => \"kilometers\", :elevation => \"meters\", :height => \"centimeters\", :weight => \"kilograms\", :measurements => \"centimeters\", :liquids => \"mL\", :blood_glucose => \"mmol/l\" }\n }\n end" ]
[ "0.7284985", "0.72707283", "0.68480104", "0.670525", "0.66994977", "0.65994805", "0.64936334", "0.64402825", "0.64402825", "0.64402825", "0.64300317", "0.6391067", "0.6345283", "0.63443196", "0.6220063", "0.62035346", "0.6161095", "0.61558884", "0.6119678", "0.611051", "0.6109447", "0.6109447", "0.6109447", "0.6109447", "0.6109447", "0.6109447", "0.60861003", "0.60808307", "0.6079401", "0.6074898", "0.60430676", "0.6028907", "0.6006419", "0.6002363", "0.59884155", "0.5957829", "0.5936996", "0.5936996", "0.5884115", "0.5881046", "0.5877602", "0.5863927", "0.5852862", "0.58521736", "0.5831073", "0.5827972", "0.5804371", "0.57955503", "0.57900083", "0.57881165", "0.5778881", "0.5774591", "0.5747167", "0.5728979", "0.57248753", "0.5722485", "0.57184255", "0.5678532", "0.5674927", "0.56591064", "0.56591064", "0.56591064", "0.56473035", "0.56459695", "0.56392115", "0.56266", "0.56202996", "0.5612101", "0.5611784", "0.5610746", "0.55978554", "0.5596311", "0.55880743", "0.55863976", "0.5576691", "0.55765593", "0.55751044", "0.55640644", "0.5560032", "0.5556138", "0.5538631", "0.55381316", "0.5516447", "0.55136824", "0.55037826", "0.55025566", "0.550137", "0.5496449", "0.54871285", "0.5484042", "0.5473723", "0.54732305", "0.5471585", "0.54688084", "0.5468446", "0.54636574", "0.54580516", "0.54544634", "0.5452994", "0.5451293", "0.54458445" ]
0.0
-1
POST /standard_units POST /standard_units.json
def create @standard_unit = StandardUnit.new(standard_unit_params) if @standard_unit.save render :show, status: :created, location: @standard_unit else render json: @standard_unit.errors, status: :unprocessable_entity end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def standard_unit_params\n params.require(:standard_unit).permit(:name)\n end", "def update\n if @standard_unit.update(standard_unit_params)\n render :show, status: :ok, location: @standard_unit\n else\n render json: @standard_unit.errors, status: :unprocessable_entity\n end\n end", "def create\n @standard_measurement = StandardMeasurement.new(params[:standard_measurement])\n\n respond_to do |format|\n if @standard_measurement.save\n format.html { redirect_to @standard_measurement, notice: 'Standard measurement was successfully created.' }\n format.json { render json: @standard_measurement, status: :created, location: @standard_measurement }\n else\n format.html { render action: \"new\" }\n format.json { render json: @standard_measurement.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @unit_of_measure = UnitOfMeasure.new(params[:unit_of_measure])\n\n respond_to do |format|\n if @unit_of_measure.save\n format.html { redirect_to @unit_of_measure, notice: t(:unit_of_measure_created) }\n format.json { render json: @unit_of_measure, status: :created, location: @unit_of_measure }\n else\n format.html { render action: \"new\" }\n format.json { render json: @unit_of_measure.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @unit_measure = UnitMeasure.new(unit_measure_params)\n\n respond_to do |format|\n if @unit_measure.save\n format.html { redirect_to @unit_measure, notice: 'Unit measure was successfully created.' }\n format.json { render :show, status: :created, location: @unit_measure }\n else\n format.html { render :new }\n format.json { render json: @unit_measure.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @unit_of_measure = UnitOfMeasure.create(params[:unit_of_measure])\n get_data\n end", "def set_standard_unit\n @standard_unit = StandardUnit.find(params[:id])\n end", "def create\n @base_unit = BaseUnit.new(base_unit_params)\n\n respond_to do |format|\n if @base_unit.save\n format.html { redirect_to @base_unit, notice: 'Tray type was successfully created.' }\n format.json { render action: 'show', status: :created, location: @base_unit }\n else\n format.html { render action: 'new' }\n format.json { render json: @base_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def unit_of_measure_params\n params.require(:unit_of_measure).permit(:name, :description, :code, :uom_type, :ratio, :uom_category_id)\n end", "def unit_of_measure_params\n params.require(:unit_of_measure).permit(:unit_id, :unit_description, :unit_status, :created_by, :updated_by)\n end", "def unit_measure_params\n params.require(:unit_measure).permit(:nominal_reference, :unit_measure_id, :conversion_id, :metric_id)\n end", "def display_unit_params\n params.require(:display_unit).permit(:standard_unit_id, :name, :display_ratio)\n end", "def storage_unit_params\n params.require(:storage_unit).permit(:name, :description, :length, :width, :height, :renter_id, :annual_rate, :monthly_rate)\n end", "def unit_params\n params.require(:unit).permit(:date, :value)\n end", "def create\n @unit = Unit.new(params[:unit])\n\n respond_to do |format|\n if @unit.save\n format.html { redirect_to @unit, notice: 'Unit was successfully created.' }\n format.json { render json: @unit, status: :created, location: @unit }\n else\n format.html { render action: \"new\" }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @unit = Unit.new(params[:unit])\n\n respond_to do |format|\n if @unit.save\n format.html { redirect_to @unit, notice: 'Unit was successfully created.' }\n format.json { render json: @unit, status: :created, location: @unit }\n else\n format.html { render action: \"new\" }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @storage_unit = StorageUnit.new(storage_unit_params)\n\n respond_to do |format|\n if @storage_unit.save\n format.html { redirect_to @storage_unit, notice: 'Storage unit was successfully created.' }\n format.json { render :show, status: :created, location: @storage_unit }\n else\n format.html { render :new }\n format.json { render json: @storage_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def unit_params\n params.require(:unit).permit(:short_label, :long_label, :universe)\n end", "def unit_params\n params.require(:unit).permit(:user_id, :building_id, :floor_number, :side, :unit_number, :area, :resident_count)\n end", "def create\n @standard_size = StandardSize.new(standard_size_params)\n\n respond_to do |format|\n if @standard_size.save\n format.html { redirect_to @standard_size, notice: 'Standard size was successfully created.' }\n format.json { render :show, status: :created, location: @standard_size }\n else\n format.html { render :new }\n format.json { render json: @standard_size.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @standard_unit.destroy\n end", "def index\n @standard_units = StandardUnit.all\n end", "def create\n # I was not able to get this working. I suspected a change may have occurred in the API that hasn't been published to docs.\n # Used https://www.hurl.it/ to test requests to the API. Was getting a success response, but\n # never saw the newly created unit in either my SDK or in the stage environment. Could be in the DB but missing an attribute/flag that allows\n # association to the property and/or allows for display.\n puts 'test1'\n #@unit = Unit.new(params)\n puts 'XYZ'\n puts params[:name]\n puts 'ABC'\n end", "def create\n @extent_unit = ExtentUnit.new(params[:extent_unit])\n\n respond_to do |format|\n if @extent_unit.save\n format.html { redirect_to @extent_unit, notice: 'Extent unit was successfully created.' }\n format.json { render json: @extent_unit, status: :created, location: @extent_unit }\n else\n format.html { render action: \"new\" }\n format.json { render json: @extent_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @study_unit = StudyUnit.new(params[:study_unit])\n\n respond_to do |format|\n if @study_unit.save\n format.html { redirect_to @study_unit, notice: 'Study unit was successfully created.' }\n format.json { render json: @study_unit, status: :created, location: @study_unit }\n else\n format.html { render action: \"new\" }\n format.json { render json: @study_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def foods_units\n get('/foods/units.json')\n end", "def unit_params\n params.require(:unit).permit(:name, :weight, :package_dimensions)\n end", "def create\n @standard = Standard.new(standard_params)\n\n if @standard.save\n render :show, status: :created, location: @standard\n else\n render json: @standard.errors, status: :unprocessable_entity\n end\n end", "def create\n authorize Unit\n @unit = Unit.new(unit_params)\n\n if @unit.save\n render status: :created\n else\n render json: {errors: @unit.errors}, status: :unprocessable_entity\n end\n end", "def unit_params\n params.require(:unit).permit(:name)\n end", "def unit_params\n params.require(:unit).permit(:Unitcode, :name, :Unitaccuracy, :Roundingtype,:fbillstatus,:Creator,:CreateDate,:Approver,:ApproverDate)\n end", "def rented_unit_params\n params.require(:rented_unit).permit(:unit_no, :unit_model, :price, :bedrooms, :bathrooms, :half_baths, :square_footage, :leased, :appointment_id, :notes, :spanstart, :spanend)\n end", "def create\n @quotation_unit = QuotationUnit.new(quotation_unit_params)\n\n respond_to do |format|\n if @quotation_unit.save\n format.html { redirect_to @quotation_unit, notice: 'Quotation unit was successfully created.' }\n format.json { render :show, status: :created, location: @quotation_unit }\n else\n format.html { render :new }\n format.json { render json: @quotation_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def unit_params\n params.fetch(:unit, {})\n end", "def create\n @first_level_unit = FirstLevelUnit.new(first_level_unit_params)\n\n respond_to do |format|\n if @first_level_unit.save\n format.html { redirect_to admin_first_level_units_path, notice: 'First level unit was successfully created.' }\n format.json { render :show, status: :created, location: @first_level_unit }\n else\n format.html { render :new }\n format.json { render json: @first_level_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def unit_params\n params.require(:unit).permit(:title, :description, :use, :typology, :component_id, :ancestry, :parent_id)\n end", "def unit_params\n params.fetch(:unit, {}).permit(:name)\n end", "def create\n @unit = Unit.new(unit_params)\n @unit.name = @unit.name.downcase\n\n respond_to do |format|\n if @unit.save\n format.html { redirect_to new_food_path, notice: 'Unit was successfully created.' }\n format.json { render action: 'show', status: :created, location: @unit }\n else\n flash[:error] = \"Unit can't be an empty string.\"\n format.html { redirect_to new_food_path }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @electoral_unit = ElectoralUnit.new(params[:electoral_unit])\n\n respond_to do |format|\n if @electoral_unit.save\n format.html { redirect_to @electoral_unit, notice: 'Electoral unit was successfully created.' }\n format.json { render json: @electoral_unit, status: :created, location: @electoral_unit }\n else\n format.html { render action: \"new\" }\n format.json { render json: @electoral_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def unit_params\n params.require(:unit).permit(:name, :circle_id)\n end", "def create\n @storage_unit = StorageUnit.new(params[:storage_unit])\n\n respond_to do |format|\n if @storage_unit.save\n flash[:notice] = 'StorageUnit was successfully created.'\n format.html { redirect_to(@storage_unit) }\n format.xml { render :xml => @storage_unit, :status => :created, :location => @storage_unit }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @storage_unit.errors, :status => :unprocessable_entity }\n end\n end\n end", "def unit_params\n params.require(:unit).permit(:libe, :amount, :points, :weapon)\n end", "def new\n @unit_of_measure = UnitOfMeasure.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unit_of_measure }\n end\n end", "def base_unit_params\n params.require(:base_unit).permit(:name, :base_width, :base_length)\n end", "def create\n @item_unit = ItemUnit.new(params[:item_unit])\n\n respond_to do |format|\n if @item_unit.save\n format.html { redirect_to @item_unit, notice: 'Item unit was successfully created.' }\n format.json { render json: @item_unit, status: :created, location: @item_unit }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @standard_measurement = StandardMeasurement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @standard_measurement }\n end\n end", "def create\n post_params = {\n name: params[:name].downcase,\n units: params[:units] || 0\n }\n render json: Ingredient.create!(post_params), status: :created\n end", "def create\n @retail_unit = RetailUnit.new(params[:retail_unit])\n\n respond_to do |format|\n if @retail_unit.save\n format.html { redirect_to @retail_unit, notice: 'Retail unit was successfully created.' }\n format.json { render json: @retail_unit, status: :created, location: @retail_unit }\n else\n format.html { render action: \"new\" }\n format.json { render json: @retail_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @unit = Unit.new(unit_params)\n respond_to do |format|\n if @unit.save\n Unit.transaction do\n auth = Signet::Rails::Factory.create_from_env :google, request.env\n client = Google::APIClient.new\n client.authorization = auth\n plusDomain = client.discovered_api('plusDomains')\n @result = client.execute(:api_method => plusDomain.circles.insert,\n :parameters => {'userId' => 'me'},\n :body =>MultiJson.dump('displayName' => @unit.name),\n :headers => {'Content-Type' => 'application/json'}\n )\n @unit.update_column(:circle_id, @result.data.id)\n end\n format.html { redirect_to @unit, notice: 'Unit was successfully created.' }\n format.json { render action: 'show', status: :created, location: @unit }\n else\n format.html { render action: 'new' }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def unit_params\n params.\n require(:unit).\n permit(:user_building_id, :unit_number, :sqfootage, :number_bedrooms,\n :number_bathrooms, :number_rooms, :number_occupants)\n end", "def create\n @quantity_unit = QuantityUnit.new(params[:quantity_unit])\n\n respond_to do |format|\n if @quantity_unit.save\n flash[:notice] = 'QuantityUnit was successfully created.'\n format.html { redirect_to(@quantity_unit) }\n format.xml { render :xml => @quantity_unit, :status => :created, :location => @quantity_unit }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @quantity_unit.errors, :status => :unprocessable_entity }\n end\n end\n end", "def unit_params\n params.require(:unit).permit(:featured, :number, :avail_date, :category_id, :building_id, :title, :description, :bedrooms, :bathrooms, :price, :link, :image, :phoneNum)\n end", "def create\n @contract = Contract.new(params[:contract])\n @units = Unit.unsold(params[:tower_id])\n \n respond_to do |format|\n if @contract.save\n format.html { redirect_to tower_contracts_path(@tower), notice: 'Contract was successfully created.' }\n format.json { render json: @contract, status: :created, location: @contract }\n else\n format.html { render action: \"new\" }\n format.json { render json: @contract.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @unit_of_measure = UnitOfMeasure.new(unit_of_measure_params)\n @unit_of_measure.created_by = current_user.id\n\n respond_to do |format|\n if @unit_of_measure.save\n format.html { redirect_to unit_of_measures_path, notice: 'Unit of measure was successfully created.' }\n format.json { render :show, status: :created, location: @unit_of_measure }\n else\n format.html { render :new }\n format.json { render json: @unit_of_measure.errors, status: :unprocessable_entity }\n end\n end\n end", "def unit_params\n params.require(:unit).permit(:name, :subsystem_id)\n end", "def create\n @item = Item.find(params[:item_id])\n @unit = @item.units.create(params[:unit])\n \n redirect_to item_path(@item)\n end", "def quotation_unit_params\n params.require(:quotation_unit).permit(:quotation_unit_name)\n end", "def create\n @unit = Unit.new(unit_params)\n authorize @unit\n begin\n ActiveRecord::Base.transaction do\n @unit.save!\n end\n rescue => e\n render partial: \"shared/validation_messages\",\n locals: { object: @unit.errors.any? ? @unit : e },\n status: :bad_request\n else\n RefreshOpensearchJob.perform_later\n toast!(title: \"Unit created\",\n message: \"The unit \\\"#{@unit.title}\\\" has been created.\")\n render \"shared/reload\"\n end\n end", "def unit_params \n params.require(:unit).permit(:name, :unit, :create_user, :edit_user, :comment)\n end", "def unit_params\n\t params.require(:unit).permit(:name, :semester_id)\n\t end", "def create\n @article = Article.new(article_params)\n respond_to do |format|\n if @article.save\n @article_unit = ArticlesUnit.create(article: @article,\n unit_id: params[:articles_units][:unit_id],\n value: params[:articles_units][:value])\n format.html { redirect_to @article, notice: \"L'Article a été créé avec succès.\" }\n format.json { render :show, status: :created, location: @article }\n else\n format.html { render :new }\n format.json { render json: @article.errors, status: :unprocessable_entity }\n end\n end\n end", "def units\n @formulation = (params[:formulation] || '').upcase\n drug = Drug.find_by_name(@formulation) rescue nil\n render plain: \"per dose\" and return unless drug && !drug.units.blank?\n render plain: drug.units\n end", "def unit_params\n params.require(:unit).permit(:name, :type, :attack, :defence)\n end", "def dataunit_params\n params.require(:dataunit).permit(:geoValue, :dataValue, :dataset_id, :user_id)\n end", "def unit_params\n params.require(:unit).permit(:name, :role, :power, :movement, :shooting_skill, :strength, :combat_skill, :attacks, :wounds, :leadership, :armor_save, :invul_shooting, :invul_combat, :single_model_point_cost, :model_count_increment, :power_for_each_increment, :min_model_count, :max_model_count, :detachment_id)\n end", "def create\n @display_unit = DisplayUnit.new(display_unit_params)\n\n if @display_unit.save\n render :show, status: :created, location: @display_unit\n else\n render json: @display_unit.errors, status: :unprocessable_entity\n end\n end", "def create\n # @unit = Unit.new(params[:unit])\n @unit = current_user.units.build(params[:unit])\n\n respond_to do |format|\n if @unit.save\n # format.html { redirect_to @unit, notice: 'Unit was successfully created.' }\n format.html { redirect_to units_path, notice: 'Pomyślnie utworzono jednostkę.' }\n format.json { render json: @unit, status: :created, location: @unit }\n else\n # format.html { render action: \"new\" }\n format.html { redirect_to units_path, :flash => { :error => 'Nie udało się utworzyć jednostki' } }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def cat_uni_measure_unit_params\n params.require(:cat_uni_measure_unit).permit(:key, :description)\n end", "def update\n params.require(%i[id units])\n retrieve_and_validate_put.update!(units: params[:units])\n head :no_content\n end", "def create\n @workout_unit = WorkoutUnit.new(workout_unit_params)\n @workout_unit.user_id = current_user.id\n respond_to do |format|\n if @workout_unit.save\n format.html { redirect_to @workout_unit, notice: 'Workout unit was successfully created.' }\n format.json { \n render :json => @workout_unit.as_json(:include => :workout_unit_type), action: 'show', status: :created, location: @workout_unit \n }\n else\n format.html { render action: 'new' }\n format.json { render json: @workout_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @rent_unit = RentUnit.new(rent_unit_params)\n\n respond_to do |format|\n if @rent_unit.save\n format.html { redirect_to @rent_unit, notice: 'Rent unit was successfully created.' }\n format.json { render :show, status: :created, location: @rent_unit }\n else\n format.html { render :new }\n format.json { render json: @rent_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @unit_name = UnitName.new(unit_name_params)\n\n respond_to do |format|\n if @unit_name.save\n format.html { redirect_to @unit_name, notice: 'Unit name was successfully created.' }\n format.json { render action: 'show', status: :created, location: @unit_name }\n else\n format.html { render action: 'new' }\n format.json { render json: @unit_name.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @unit = Unit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unit }\n end\n end", "def new\n @unit = Unit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unit }\n end\n end", "def new\n @unit = Unit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unit }\n end\n end", "def create\n @property = @user.properties.new(params[:property])\n @number_of_units = params[:number_of_units].to_i\n \n respond_to do |format|\n if @property.save\n @number_of_units.times do |unit|\n @property.units.build(:name => unit.to_s, :bedrooms=>1, :bathrooms=>1, :square_feet => 1000, :base_rent=>1000)\n end\n if (@property.save)\n flash[:notice] = 'Property and units created!'\n else\n flash[:notice] = 'Property creted, but errors creating units.'\n end\n format.html { redirect_to(@property) }\n format.xml { render :xml => @property, :status => :created, :location => @property }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @property.errors, :status => :unprocessable_entity }\n end\n end\n end", "def common_expense_subunit_params\n params.require(:common_expense_subunit).permit(:subunit_id, :electricity_charge, :water_charge, :gas_charge, :salary_payments, :maintenance_payments, :total, :others_charge, :period, :receipt)\n end", "def new\n @unit = Unit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unit}\n end\n end", "def addstock_params\n params.require(:addstock).permit(:stock, :unit, :material_id)\n end", "def create\n @army_unit = ArmyUnit.new(army_unit_params)\n\n respond_to do |format|\n if @army_unit.save\n format.html { redirect_to @army_unit, notice: 'Army unit was successfully created.' }\n format.json { render action: 'show', status: :created, location: @army_unit }\n else\n format.html { render action: 'new' }\n format.json { render json: @army_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @timeunit = Timeunit.new(params[:timeunit])\n\n respond_to do |format|\n if @timeunit.save\n format.html { redirect_to(@timeunit, :notice => 'Timeunit was successfully created.') }\n format.xml { render :xml => @timeunit, :status => :created, :location => @timeunit }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @timeunit.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @machine_id_standard = MachineIdStandard.new(params[:machine_id_standard])\n\n respond_to do |format|\n if @machine_id_standard.save\n format.html { redirect_to @machine_id_standard, notice: 'Machine ID Standard was successfully created.' }\n format.json { render json: @machine_id_standard, status: :created, location: @machine_id_standard }\n else\n format.html { render action: \"new\" }\n format.json { render json: @machine_id_standard.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @handbook_structual_unit = HandbookStructualUnit.new(params[:handbook_structual_unit])\n\n respond_to do |format|\n if @handbook_structual_unit.save\n format.html { redirect_to @handbook_structual_unit, notice: 'Handbook structual unit was successfully created.' }\n format.json { render json: @handbook_structual_unit, status: :created, location: @handbook_structual_unit }\n else\n format.html { render action: \"new\" }\n format.json { render json: @handbook_structual_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def medical_unit_params\n params.permit(:name, :location, :speciality, :image)\n end", "def create\n @unit = Unit.new(params[:unit])\n if session[:resident_id]\n @unit.resident_id = session[:resident_id]\n session[:resident_id] = nil\n end\n\n respond_to do |format|\n if @unit.save\n format.html { redirect_to @unit, notice: 'Unit was successfully created.' }\n format.json { render json: @unit, status: :created, location: @unit }\n else\n format.html { render action: \"new\" }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @police_unit = PoliceUnit.new(police_unit_params)\n\n respond_to do |format|\n if @police_unit.save\n format.html { redirect_to @police_unit, notice: 'Police unit was successfully created.' }\n format.json { render :show, status: :created, location: @police_unit }\n else\n format.html { render :new }\n format.json { render json: @police_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @german_unit = GermanUnit.new(german_unit_params)\n\n respond_to do |format|\n if @german_unit.save\n format.html { redirect_to @german_unit, notice: 'German unit was successfully created.' }\n format.json { render :show, status: :created, location: @german_unit }\n else\n format.html { render :new }\n format.json { render json: @german_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @org_unit = OrgUnit.new(org_unit_params)\n\n respond_to do |format|\n if @org_unit.save\n format.html { redirect_to @org_unit, notice: 'Org unit was successfully created.' }\n format.json { render :show, status: :created, location: @org_unit }\n else\n format.html { render :new }\n format.json { render json: @org_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def police_unit_params\n params.require(:police_unit).permit(:name)\n end", "def unit_group_params\n params.require(:unit_group).permit(:guid, :price, :group_key, :name, :available_units_count, :total_units_count, :total_non_excluded_units_count, :size, :standard_rate, :floor, :reduced_price, :occupancy_percent, :area, :length, :width, :height, :due_at_move_in, :due_at_move_in_without_fees, :due_monthly, :attribute_description, :description, :average_rent, :active_rate_type, :channel_rate_id, :unit_type_id)\n end", "def create\n @unit = Unit.new(unit_params)\n @unit.organization = current_organization\n respond_to do |format|\n if @unit.save\n format.html { redirect_to units_url, notice: \"#{t(:unit)} #{t(:was_succfully_created)}\" }\n else\n flash.now[:danger] = \"#{t(:failed_to_create)} #{t(:unit)}\"\n format.html { render action: 'new' }\n end\n end\n end", "def unit_name_params\n params.require(:unit_name).permit(:title, :description)\n end", "def create\n @functional_unit = FunctionalUnit.new(params[:functional_unit])\n\n respond_to do |format|\n if @functional_unit.save\n format.html { redirect_to(@functional_unit, :notice => 'Functional unit was successfully created.') }\n format.xml { render :xml => @functional_unit, :status => :created, :location => @functional_unit }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @functional_unit.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @sampleunit = Sampleunit.new(params[:sampleunit])\n\n respond_to do |format|\n if @sampleunit.save\n format.html { redirect_to(@sampleunit, :notice => 'Sample Unit was successfully created.') }\n format.xml { render :xml => @sampleunit, :status => :created, :location => @sampleunit }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @sampleunit.errors, :status => :unprocessable_entity }\n end\n end\n end", "def units=(value)\n @units = value\n end", "def new\n @unit_type = UnitType.new\n respond_to do |format|\n format.json { render json: @unit_type }\n format.xml { render xml: @unit_type }\n end\n end", "def parameter_measure_params\n params.require(:parameter_measure).permit(:name, :unit, :comment)\n end", "def new\n @extent_unit = ExtentUnit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @extent_unit }\n end\n end", "def army_unit_params\n params.require(:army_unit).permit(:unit_id, :army_id)\n end", "def unit_params\n params.permit(:start_time, :end_time, :day,:start_time_2,:end_time_2,:day_2,:has_time_2,:has_exam_date)\n params.require(:unit).permit(:exam_date, :capacity, :code , :professor_id , :course_id , :term_id, :detail)\n end" ]
[ "0.71420324", "0.64748985", "0.63843375", "0.638204", "0.6314976", "0.6311011", "0.6265376", "0.62029266", "0.61535805", "0.6112119", "0.6037738", "0.6035721", "0.6020345", "0.6015021", "0.6002429", "0.6002429", "0.59995246", "0.59835476", "0.5904348", "0.5904226", "0.5883282", "0.58771145", "0.584988", "0.5841892", "0.5840892", "0.58155704", "0.5798642", "0.5791664", "0.5788977", "0.57824045", "0.57776815", "0.5768949", "0.5763032", "0.57385695", "0.5731549", "0.57301664", "0.5711501", "0.5702103", "0.5665271", "0.56580096", "0.565187", "0.56491566", "0.563741", "0.56292677", "0.5628592", "0.56147045", "0.5591896", "0.5586692", "0.55747896", "0.5573453", "0.5564914", "0.5541787", "0.5540206", "0.55350524", "0.5520014", "0.5517319", "0.55166817", "0.5514215", "0.5512356", "0.54735446", "0.54716825", "0.5458353", "0.54568917", "0.544244", "0.54403114", "0.54369116", "0.5435855", "0.5426088", "0.5403432", "0.5394168", "0.5391535", "0.53905815", "0.5387053", "0.5387053", "0.5387053", "0.53739744", "0.53696465", "0.5366512", "0.53633535", "0.5350185", "0.5348111", "0.53450596", "0.53318024", "0.53292346", "0.53233105", "0.5317936", "0.5303759", "0.5301833", "0.5296095", "0.52906114", "0.52759594", "0.5275233", "0.5271357", "0.5267538", "0.52608204", "0.5259651", "0.52494526", "0.5232519", "0.52303326", "0.5222228" ]
0.73122644
0
PATCH/PUT /standard_units/1 PATCH/PUT /standard_units/1.json
def update if @standard_unit.update(standard_unit_params) render :show, status: :ok, location: @standard_unit else render json: @standard_unit.errors, status: :unprocessable_entity end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n params.require(%i[id units])\n retrieve_and_validate_put.update!(units: params[:units])\n head :no_content\n end", "def update\n respond_to do |format|\n if @base_unit.update(base_unit_params)\n format.html { redirect_to @base_unit, notice: 'Tray type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @base_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @unit_of_measure = UnitOfMeasure.find(params[:id])\n\n respond_to do |format|\n if @unit_of_measure.update_attributes(params[:unit_of_measure])\n format.html { redirect_to @unit_of_measure, notice: t(:unit_of_measure_updated) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @unit_of_measure.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @standard_measurement = StandardMeasurement.find(params[:id])\n\n respond_to do |format|\n if @standard_measurement.update_attributes(params[:standard_measurement])\n format.html { redirect_to @standard_measurement, notice: 'Standard measurement was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @standard_measurement.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @unit_measure.update(unit_measure_params)\n format.html { redirect_to @unit_measure, notice: 'Unit measure was successfully updated.' }\n format.json { render :show, status: :ok, location: @unit_measure }\n else\n format.html { render :edit }\n format.json { render json: @unit_measure.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @unit.update(unit_params)\n format.html { redirect_to @unit, notice: 'Unit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n url = 'https://casa-core.herokuapp.com/api/units/' + params[:id]\n query = {\n 'name' => params[:name]\n }\n response = HTTParty.put(url, :query => query, :headers => { \"Authorization\" => AUTH, \"Host\" => HOST})\n\n if response.code == 200\n redirect_to unit_path(params[:id]), notice: 'Unit was successfully updated.'\n else\n redirect_to unit_path(params[:id]), notice: 'Sheesh! Minor hiccup...run that again!'\n end\n end", "def update\n respond_to do |format|\n if @unit.update(unit_params)\n format.html { redirect_to @unit, notice: 'Unit was successfully updated.' }\n format.json { render :show, status: :ok, location: @unit }\n else\n format.html { render :edit }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @extent_unit = ExtentUnit.find(params[:id])\n\n respond_to do |format|\n if @extent_unit.update_attributes(params[:extent_unit])\n format.html { redirect_to @extent_unit, notice: 'Extent unit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @extent_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @storage_unit.update(storage_unit_params)\n format.html { redirect_to @storage_unit, notice: 'Storage unit was successfully updated.' }\n format.json { render :show, status: :ok, location: @storage_unit }\n else\n format.html { render :edit }\n format.json { render json: @storage_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @jobtype = Jobtype.find(params[:id])\n\n if @jobtype.update_attributes(params[:unit])\n render_json \"success\"\n else\n render_error \"failure\"\n end\n end", "def update\n respond_to do |format|\n if @first_level_unit.update(first_level_unit_params)\n format.html { redirect_to admin_first_level_units_path, notice: 'First level unit was successfully updated.' }\n format.json { render :show, status: :ok, location: @first_level_unit }\n else\n format.html { render :edit }\n format.json { render json: @first_level_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @base_unit = args[:base_unit] if args.key?(:base_unit)\n @base_unit_conversion_factor = args[:base_unit_conversion_factor] if args.key?(:base_unit_conversion_factor)\n @base_unit_description = args[:base_unit_description] if args.key?(:base_unit_description)\n @display_quantity = args[:display_quantity] if args.key?(:display_quantity)\n @tiered_rates = args[:tiered_rates] if args.key?(:tiered_rates)\n @usage_unit = args[:usage_unit] if args.key?(:usage_unit)\n @usage_unit_description = args[:usage_unit_description] if args.key?(:usage_unit_description)\n end", "def update\n @unit = Unit.find(params[:id])\n\n if @unit.update(unit_params)\n render :create, status: :ok\n else\n render json: {errors: @unit.errors}, status: :unprocessable_entity\n end\n end", "def update\n if @standard.update(standard_params)\n render :show, status: :ok, location: @standard\n else\n render json: @standard.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @unit.update(unit_params)\n format.html { redirect_to @unit, notice: 'Unit was successfully update@datasheet.' }\n format.json { render :show, status: :ok, location: @unit }\n else\n format.html { render :edit }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @unit.update(unit_params)\n format.html { redirect_to new_food_path, notice: 'Unit was successfully updated.' }\n format.json { head :no_content }\n else\n flash[:error] = \"Unit can't be an empty string.\"\n format.html { redirect_to new_food_path }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @standard_size.update(standard_size_params)\n format.html { redirect_to @standard_size, notice: 'Standard size was successfully updated.' }\n format.json { render :show, status: :ok, location: @standard_size }\n else\n format.html { render :edit }\n format.json { render json: @standard_size.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @unit_of_measure = UnitOfMeasure.find(params[:id])\n @unit_of_measure.update_attributes(params[:unit_of_measure])\n get_data\n end", "def update\n respond_to do |format|\n if @army_unit.update(army_unit_params)\n format.html { redirect_to @army_unit, notice: 'Army unit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @army_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @unit_name.update(unit_name_params)\n format.html { redirect_to @unit_name, notice: 'Unit name was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @unit_name.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_standard_unit\n @standard_unit = StandardUnit.find(params[:id])\n end", "def update\n respond_to do |format|\n if @currentunit.update(currentunit_params)\n format.html { redirect_to @currentunit, notice: 'Currentunit was successfully updated.' }\n format.json { render :show, status: :ok, location: @currentunit }\n else\n format.html { render :edit }\n format.json { render json: @currentunit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @quotation_unit.update(quotation_unit_params)\n format.html { redirect_to @quotation_unit, notice: 'Quotation unit was successfully updated.' }\n format.json { render :show, status: :ok, location: @quotation_unit }\n else\n format.html { render :edit }\n format.json { render json: @quotation_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @item_unit = ItemUnit.find(params[:id])\n\n respond_to do |format|\n if @item_unit.update_attributes(params[:item_unit])\n format.html { redirect_to @item_unit, notice: 'Item unit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @contract = Contract.find(params[:id])\n @units = Unit.unsold(params[:tower_id])\n respond_to do |format|\n if @contract.update_attributes(params[:contract])\n format.html { redirect_to tower_contract_path(@contract.unit.tower, @contract), notice: 'Contract was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contract.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @unit = Unit.find(params[:id])\n\n respond_to do |format|\n if @unit.update_attributes(params[:unit])\n if params[:commit] == \"Save\"\n format.html { redirect_to @unit, notice: '<div class=\"alert alert-success\">Unit was successfully updated.</div>' }\n else\n @unit.toggle(current_user)\n format.html {\n redirect_to @unit, notice: \"<div class='alert alert-success'>Unit was successfully #{@unit.status_label}</div>\"\n }\n format.json { head :no_content }\n end\n else\n format.html { render action: \"edit\" }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @study_unit = StudyUnit.find(params[:id])\n\n respond_to do |format|\n if @study_unit.update_attributes(params[:study_unit])\n format.html { redirect_to @study_unit, notice: 'Study unit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @study_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @quantity_unit = QuantityUnit.find(params[:id])\n\n respond_to do |format|\n if @quantity_unit.update_attributes(params[:quantity_unit])\n flash[:notice] = 'QuantityUnit was successfully updated.'\n format.html { redirect_to(@quantity_unit) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @quantity_unit.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @common_expense_subunit.update(common_expense_subunit_params)\n format.html { redirect_to @common_expense_subunit, notice: 'Common expense subunit was successfully updated.' }\n format.json { render :show, status: :ok, location: @common_expense_subunit }\n else\n format.html { render :edit }\n format.json { render json: @common_expense_subunit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @quantity = args[:quantity] if args.key?(:quantity)\n @unit = args[:unit] if args.key?(:unit)\n end", "def update!(**args)\n @quantity = args[:quantity] if args.key?(:quantity)\n @unit = args[:unit] if args.key?(:unit)\n end", "def update!(**args)\n @quantity = args[:quantity] if args.key?(:quantity)\n @unit = args[:unit] if args.key?(:unit)\n end", "def update!(**args)\n @quantity = args[:quantity] if args.key?(:quantity)\n @unit = args[:unit] if args.key?(:unit)\n end", "def standard_unit_params\n params.require(:standard_unit).permit(:name)\n end", "def update\n respond_to do |format|\n if @unit.update(unit_params)\n format.html { redirect_to @unit, notice: '修改成功!.' }\n format.json { render :show, status: :ok, location: @unit }\n else\n format.html { render :edit }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @unit_fuel.update(unit_fuel_params)\n format.html { redirect_to @unit_fuel, notice: (t 'unit_fuels.title')+(t 'actions.updated') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @unit_fuel.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @storage_unit = StorageUnit.find(params[:id])\n\n respond_to do |format|\n if @storage_unit.update_attributes(params[:storage_unit])\n flash[:notice] = 'StorageUnit was successfully updated.'\n format.html { redirect_to(@storage_unit) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @storage_unit.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @police_unit.update(police_unit_params)\n format.html { redirect_to @police_unit, notice: 'Police unit was successfully updated.' }\n format.json { render :show, status: :ok, location: @police_unit }\n else\n format.html { render :edit }\n format.json { render json: @police_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @standardkind.update(standardkind_params)\n format.html { redirect_to @standardkind, notice: 'Standardkind was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @standardkind.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @unit_of_measure.modified_by = current_user.id\n respond_to do |format|\n if @unit_of_measure.update(unit_of_measure_params)\n format.html { redirect_to unit_of_measures_path, notice: 'Unit of measure was successfully updated.' }\n format.json { render :show, status: :ok, location: @unit_of_measure }\n else\n format.html { render :edit }\n format.json { render json: @unit_of_measure.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @unit = Unit.find(params[:id])\n \n if params[:unit].andand[:note].present? && (@unit.note.blank? || (@unit.note != params[:unit][:note]))\n @unit.note_updated_by = current_person\n @unit.note_updated_at = Time.now\n end\n\n respond_to do |format|\n if @unit.update_attributes(params[:unit])\n format.html { redirect_to @unit, notice: 'Unit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @workout_unit.update(workout_unit_params)\n format.html { redirect_to @workout_unit, notice: 'Workout unit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @workout_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @org_unit.update(org_unit_params)\n format.html { redirect_to @org_unit, notice: 'Org unit was successfully updated.' }\n format.json { render :show, status: :ok, location: @org_unit }\n else\n format.html { render :edit }\n format.json { render json: @org_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @retail_unit = RetailUnit.find(params[:id])\n\n respond_to do |format|\n if @retail_unit.update_attributes(params[:retail_unit])\n format.html { redirect_to @retail_unit, notice: 'Retail unit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @retail_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @article.update(article_params)\n @article.articles_units.last.update(unit_id: params[:articles_units][:unit_id],\n value: params[:articles_units][:value])\n format.html { redirect_to @article, notice: 'Article was successfully updated.' }\n format.json { render :show, status: :ok, location: @article }\n else\n format.html { render :edit }\n format.json { render json: @article.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @unit = Unit.find(params[:id])\n\n respond_to do |format|\n if @unit.update_attributes(params[:unit])\n # format.html { redirect_to @unit, notice: 'Unit was successfully updated.' }\n format.html { redirect_to units_path, notice: 'Pomyślnie zaktualizowano jednostkę.' }\n format.json { head :no_content }\n else\n # format.html { render action: \"edit\" }\n format.html { redirect_to units_path, :flash => { :error => 'Nie udało się zaktualizować jednostki' } }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @clase_unit.update(clase_unit_params)\n format.html { redirect_to @clase_unit, notice: 'Clase unit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @clase_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @commercial_unit.update(commercial_unit_params)\n format.html { redirect_to @commercial_unit, notice: 'Commercial unit was successfully updated.' }\n format.json { render :show, status: :ok, location: @commercial_unit }\n else\n format.html { render :edit }\n format.json { render json: @commercial_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @electoral_unit = ElectoralUnit.find(params[:id])\n\n respond_to do |format|\n if @electoral_unit.update_attributes(params[:electoral_unit])\n format.html { redirect_to @electoral_unit, notice: 'Electoral unit was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @electoral_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @dataunit.update(dataunit_params)\n format.html { redirect_to @dataunit, notice: 'Dataunit was successfully updated.' }\n format.json { render :show, status: :ok, location: @dataunit }\n else\n format.html { render :edit }\n format.json { render json: @dataunit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @recipe_ingredients_unit.update(recipe_ingredients_unit_params)\n format.html { redirect_to recipe_ingredients_units_path, notice: 'Recipe ingredients unit was successfully updated.' }\n format.json { render :show, status: :ok, location: @recipe_ingredients_unit }\n else\n format.html { render :edit }\n format.json { render json: @recipe_ingredients_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @unit = Unit.find(params[:id])\n @item = Item.find(@unit.item_id)\n respond_to do |format|\n if @unit.update_attributes(params[:unit])\n format.html { redirect_to @item, notice: 'Unit was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @functional_unit = FunctionalUnit.find(params[:id])\n\n respond_to do |format|\n if @functional_unit.update_attributes(params[:functional_unit])\n format.html { redirect_to(@functional_unit, :notice => 'Functional unit was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @functional_unit.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @quantity = Quantity.find(params[:id])\n\n respond_to do |format|\n if @quantity.update_attributes(params[:quantity])\n format.html { redirect_to @quantity, notice: 'Quantity was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @quantity.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @quantity = Quantity.find(params[:id])\n\n respond_to do |format|\n if @quantity.update_attributes(params[:quantity])\n format.html { redirect_to @quantity, notice: 'Quantity was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @quantity.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n respond_to do |format|\n if @account_unit.update_attributes(params[:account_unit])\n format.html { redirect_to @account_unit, notice: 'Account unit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @account_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @non_specific_value = args[:non_specific_value] if args.key?(:non_specific_value)\n @units = args[:units] if args.key?(:units)\n @units_string = args[:units_string] if args.key?(:units_string)\n @value = args[:value] if args.key?(:value)\n @value_string = args[:value_string] if args.key?(:value_string)\n end", "def update\n respond_to do |format|\n if @subset.update(subset_params)\n format.html { redirect_to @subset, notice: 'Subset was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @subset.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @unit = Unit.find(params[:id])\n \n respond_to do |format|\n if @unit.update_attributes(params[:unit])\n flash[:notice] = 'Unit was successfully updated.'\n format.html { redirect_to(admin_army_unit_path(@unit.army,@unit)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @unit.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @machine_id_standard = MachineIdStandard.find(params[:id])\n\n respond_to do |format|\n if @machine_id_standard.update_attributes(params[:machine_id_standard])\n format.html { redirect_to @machine_id_standard, notice: 'Machine id standard was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @machine_id_standard.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @unit.update(unit_params)\n format.html { redirect_to units_url, notice: \"#{t(:unit)} #{t(:was_successfully_updated)}\" }\n else\n flash.now[:danger] = \"#{t(:failed_to_update)} #{t(:unit)}\"\n format.html { render action: 'show' }\n end\n end\n end", "def update\n respond_to do |format|\n if @special_requirement.update(special_requirement_params)\n format.html { redirect_to @special_requirement, notice: 'Special requirement was successfully updated.' }\n format.json { render :show, status: :ok, location: @special_requirement }\n else\n format.html { render :edit }\n format.json { render json: @special_requirement.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @measure.update(measure_params)\n head :no_content\n else\n render json: @measure.errors, status: :unprocessable_entity\n end\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def update\n @standard = Standard.find(params[:id])\n\n respond_to do |format|\n if @standard.update_attributes(params[:standard])\n flash[:notice] = 'Standard was successfully updated.'\n format.html { redirect_to subject_url(@standard.subject, :anchor=>\"standards\") }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @standard.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @total_stock = TotalStock.find(params[:id])\n\n respond_to do |format|\n if @total_stock.update_attributes(params[:total_stock])\n format.html { redirect_to @total_stock, notice: 'Total stock was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @total_stock.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @measure = Measure.find(params[:id])\n\n respond_to do |format|\n if @measure.update_attributes(params[:measure])\n format.html { redirect_to @measure, notice: 'Measure was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @measure.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @german_unit.update(german_unit_params)\n format.html { redirect_to @german_unit, notice: 'German unit was successfully updated.' }\n format.json { render :show, status: :ok, location: @german_unit }\n else\n format.html { render :edit }\n format.json { render json: @german_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @unit_action.update(unit_action_params)\n format.html { redirect_to @unit_action, notice: 'Unit action was successfully updated.' }\n format.json { render :show, status: :ok, location: @unit_action }\n else\n format.html { render :edit }\n format.json { render json: @unit_action.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @display_unit.update(display_unit_params)\n render :show, status: :ok, location: @display_unit\n else\n render json: @display_unit.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @rent_unit.update(rent_unit_params)\n format.html { redirect_to @rent_unit, notice: 'Rent unit was successfully updated.' }\n format.json { render :show, status: :ok, location: @rent_unit }\n else\n format.html { render :edit }\n format.json { render json: @rent_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @commecial_unit.update(commecial_unit_params)\n format.html { redirect_to @commecial_unit, notice: 'Commecial unit was successfully updated.' }\n format.json { render :show, status: :ok, location: @commecial_unit }\n else\n format.html { render :edit }\n format.json { render json: @commecial_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @special_needs_type = SpecialNeedsType.find(params[:id])\n\n respond_to do |format|\n if @special_needs_type.update_attributes(params[:special_needs_type])\n format.html { redirect_to @special_needs_type, :notice => 'Tipo de necessidade especial atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @special_needs_type.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @family_unit = FamilyUnit.find(params[:id])\n\n respond_to do |format|\n if @family_unit.update_attributes(params[:family_unit])\n format.html { redirect_to @family_unit, notice: 'Family unit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @family_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @mystock.update(mystock_params)\n format.html { redirect_to @mystock, notice: 'mystock was successfully updated.' }\n format.json { render :show, status: :ok, location: @mystock }\n else\n format.html { render :edit }\n format.json { render json: @mystock.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_units(id, units, options = {})\n required = required_params(binding.send(:local_variables), binding, ['id'])\n call(:post, path(\"#{id}/actions/content/update/\"), :payload => { :required => required })\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 @project_detail_numerical.user_id = current_user.id\n @project_detail_numerical.units_of_measure_id = UnitsOfMeasure.where(\"description = ?\", detail_params[:units_of_measure_description]).first.id\n respond_to do |format|\n if @project_detail_numerical.update(project_detail_numerical_params)\n format.html { redirect_to @project_detail_numerical, notice: 'Project detail numerical was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @project_detail_numerical.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @handbook_structual_unit = HandbookStructualUnit.find(params[:id])\n\n respond_to do |format|\n if @handbook_structual_unit.update_attributes(params[:handbook_structual_unit])\n format.html { redirect_to @handbook_structual_unit, notice: 'Handbook structual unit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @handbook_structual_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @timeunit = Timeunit.find(params[:id])\n\n respond_to do |format|\n if @timeunit.update_attributes(params[:timeunit])\n format.html { redirect_to(@timeunit, :notice => 'Timeunit was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @timeunit.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @unit = args[:unit] if args.key?(:unit)\n @value = args[:value] if args.key?(:value)\n end", "def update!(**args)\n @unit = args[:unit] if args.key?(:unit)\n @value = args[:value] if args.key?(:value)\n end", "def update!(**args)\n @unit = args[:unit] if args.key?(:unit)\n @value = args[:value] if args.key?(:value)\n end", "def update\n respond_to do |format|\n if @programme_unit.update(programme_unit_params)\n format.html { redirect_to @programme_unit, notice: 'Programme unit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @programme_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_rest\n @item_usage = ItemUsage.find(params[:id])\n\n respond_to do |format|\n if @item_usage.update_attributes(params[:item_usage])\n flash[:notice] = 'ItemUsage was successfully updated.'\n format.html { redirect_to(@item_usage) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item_usage.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @sampleunit = Sampleunit.find(params[:id])\n\n respond_to do |format|\n if @sampleunit.update_attributes(params[:sampleunit])\n format.html { redirect_to(@sampleunit, :notice => 'Sample Unit was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sampleunit.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @sku.update(sku_params)\n format.html { redirect_to @sku, notice: 'Sku was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sku.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @amount = args[:amount] if args.key?(:amount)\n @description = args[:description] if args.key?(:description)\n @expected_units_per_year = args[:expected_units_per_year] if args.key?(:expected_units_per_year)\n @range = args[:range] if args.key?(:range)\n @type = args[:type] if args.key?(:type)\n @unit = args[:unit] if args.key?(:unit)\n @unspecified = args[:unspecified] if args.key?(:unspecified)\n end", "def update!(**args)\n @amount = args[:amount] if args.key?(:amount)\n @description = args[:description] if args.key?(:description)\n @expected_units_per_year = args[:expected_units_per_year] if args.key?(:expected_units_per_year)\n @range = args[:range] if args.key?(:range)\n @type = args[:type] if args.key?(:type)\n @unit = args[:unit] if args.key?(:unit)\n @unspecified = args[:unspecified] if args.key?(:unspecified)\n end", "def update!(**args)\n @micros = args[:micros] if args.key?(:micros)\n @units = args[:units] if args.key?(:units)\n end", "def update!(**args)\n @micros = args[:micros] if args.key?(:micros)\n @units = args[:units] if args.key?(:units)\n end", "def update!(**args)\n @amount = args[:amount] if args.key?(:amount)\n @unit = args[:unit] if args.key?(:unit)\n end", "def update # PATCH\n raise NotImplementedError\n end", "def update\n respond_to do |format|\n if @tests_specification.update(tests_specification_params)\n format.html { redirect_to edit_tests_specification_path(@tests_specification), notice: \"Tests specification was successfully updated.\" }\n format.json { render :show, status: :ok, location: @tests_specification }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @tests_specification.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @breadcrumb = 'update'\n @measure = Measure.find(params[:id])\n @measure.updated_by = current_user.id if !current_user.nil?\n \n respond_to do |format|\n if @measure.update_attributes(params[:measure])\n format.html { redirect_to @measure,\n notice: (crud_notice('updated', @measure) + \"#{undo_link(@measure)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @measure.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @measure.update(measure_params)\n format.html { redirect_to @measure, notice: 'Measure was successfully updated.' }\n format.json { render :show, status: :ok, location: @measure }\n else\n format.html { render :edit }\n format.json { render json: @measure.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @measure.update(measure_params)\n format.html { redirect_to @measure, notice: 'Measure was successfully updated.' }\n format.json { render :show, status: :ok, location: @measure }\n else\n format.html { render :edit }\n format.json { render json: @measure.errors, status: :unprocessable_entity }\n end\n end\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 respond_to do |format|\n if @solidarity.update(solidarity_params)\n format.html { redirect_to @solidarity, notice: 'Solidarity was successfully updated.' }\n format.json { render :show, status: :ok, location: @solidarity }\n else\n format.html { render :edit }\n format.json { render json: @solidarity.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.7222465", "0.6715038", "0.6663638", "0.6583913", "0.6544932", "0.6536766", "0.6483831", "0.6466127", "0.639179", "0.63881433", "0.6372778", "0.63624084", "0.6357908", "0.635727", "0.63526505", "0.6313081", "0.63096", "0.6244281", "0.6214702", "0.6208322", "0.6207229", "0.6183106", "0.61674017", "0.6166519", "0.61329895", "0.6132594", "0.6128148", "0.61254257", "0.6119826", "0.61047053", "0.60978174", "0.60978174", "0.60978174", "0.60978174", "0.60885215", "0.6086049", "0.6070827", "0.6068182", "0.6057393", "0.60476947", "0.6044243", "0.6040009", "0.6031318", "0.6028427", "0.6017689", "0.59961146", "0.5989288", "0.5987295", "0.5968732", "0.59572506", "0.5944516", "0.5906994", "0.5880612", "0.58652055", "0.5864122", "0.5864122", "0.58137935", "0.580794", "0.58039075", "0.5802821", "0.5800706", "0.5800554", "0.57883537", "0.57864887", "0.578254", "0.57810444", "0.57756567", "0.576458", "0.5750978", "0.57477", "0.5744536", "0.5742277", "0.5740494", "0.57346547", "0.5729161", "0.57274675", "0.57148427", "0.5706812", "0.57027525", "0.5698697", "0.56984234", "0.56928414", "0.56928414", "0.56928414", "0.56870806", "0.56742615", "0.56730753", "0.5666264", "0.56591415", "0.56591415", "0.5658195", "0.5658195", "0.56577814", "0.5656848", "0.56460774", "0.564592", "0.5642708", "0.5642708", "0.56374973", "0.5636911" ]
0.7450118
0
DELETE /standard_units/1 DELETE /standard_units/1.json
def destroy @standard_unit.destroy end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @base_unit.destroy\n respond_to do |format|\n format.html { redirect_to base_units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n url = 'https://casa-core.herokuapp.com/api/units/' + params[:id]\n response = HTTParty.delete(url, :headers => { \"Authorization\" => AUTH, \"Host\" => HOST})\n redirect_to units_url, notice: 'Unit was successfully deleted.'\n end", "def destroy\n @unit.destroy\n respond_to do |format|\n format.html { redirect_to units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit = Unit.find(params[:id])\n @unit.destroy\n\n respond_to do |format|\n format.html { redirect_to units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit = Unit.find(params[:id])\n @unit.destroy\n\n respond_to do |format|\n format.html { redirect_to units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit = Unit.find(params[:id])\n @unit.destroy\n\n respond_to do |format|\n format.html { redirect_to units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit = Unit.find(params[:id])\n @unit.destroy\n\n respond_to do |format|\n format.html { redirect_to units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit = Unit.find(params[:id])\n @unit.destroy\n\n respond_to do |format|\n format.html { redirect_to units_url }\n format.json { head :ok }\n end\n end", "def destroy\n @standard_measurement = StandardMeasurement.find(params[:id])\n @standard_measurement.destroy\n\n respond_to do |format|\n format.html { redirect_to standard_measurements_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @first_level_unit.destroy\n respond_to do |format|\n format.html { redirect_to first_level_units_url, notice: 'First level unit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit_measure.destroy\n respond_to do |format|\n format.html { redirect_to unit_measures_url, notice: 'Unit measure was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit_of_measure.destroy\n respond_to do |format|\n format.html { redirect_to unit_of_measures_url, notice: 'Unit of measure was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @extent_unit = ExtentUnit.find(params[:id])\n @extent_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to extent_units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @storage_unit = StorageUnit.find(params[:id])\n @storage_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to(storage_units_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @storage_unit.destroy\n respond_to do |format|\n format.html { redirect_to storage_units_url, notice: 'Storage unit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit = @lab_rack.units.find(params[:id])\n @unit.destroy\n \n redirect_to @lab_rack, :notice => \"Unit has been deleted\"\n end", "def destroy\n if @unit.blank?\n render json: {error: \"Can't delete unit\"}, status: :unprocessable_entity\n else\n @unit.destroy\n render json: {notice: \"Deleted!\"}, :status => 204\n end\n\n end", "def destroy\n @army_unit.destroy\n respond_to do |format|\n format.html { redirect_to army_units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit.destroy\n respond_to do |format|\n format.html { redirect_to units_url, notice: 'Unit was successfully destroye@datasheet.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @item_unit = ItemUnit.find(params[:id])\n @item_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to item_units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @study_unit = StudyUnit.find(params[:id])\n @study_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to study_units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit.destroy\n respond_to do |format|\n format.html { redirect_to units_url, notice: 'Unit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n if @unit.destroy\n head :no_content\n else\n render json: {errors: @unit.errors}, status: :unprocessable_entity\n end\n end", "def destroy\n @unit.destroy\n respond_to do |format|\n format.html { redirect_to units_url, notice: '删除成功!' }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit_name.destroy\n respond_to do |format|\n format.html { redirect_to unit_names_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @clase_unit.destroy\n respond_to do |format|\n format.html { redirect_to clase_units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @retail_unit = RetailUnit.find(params[:id])\n @retail_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to retail_units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @quantity_unit = QuantityUnit.find(params[:id])\n @quantity_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to(quantity_units_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @quotation_unit.destroy\n respond_to do |format|\n format.html { redirect_to quotation_units_url, notice: 'Quotation unit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit.destroy\n respond_to do |format|\n format.html { redirect_to new_food_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @common_expense_subunit.destroy\n respond_to do |format|\n format.html { redirect_to common_expense_subunits_url, notice: 'Common expense subunit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit_of_measure = UnitOfMeasure.find(params[:id])\n @unit_of_measure.destroy\n get_data\n end", "def destroy\n @dataunit.destroy\n respond_to do |format|\n format.html { redirect_to dataunits_url, notice: 'Dataunit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit_fuel.destroy\n respond_to do |format|\n format.html { redirect_to unit_fuels_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @electoral_unit = ElectoralUnit.find(params[:id])\n @electoral_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to electoral_units_url }\n format.json { head :ok }\n end\n end", "def destroy\n @unit.destroy\n respond_to do |format|\n format.html { redirect_to units_url, notice: \"#{t(:unit)} #{t(:was_successfully_deleted)}\" }\n end\n end", "def destroy\n @sampleunit = Sampleunit.find(params[:id])\n @sampleunit.destroy\n\n respond_to do |format|\n format.html { redirect_to(sampleunits_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @currentunit.destroy\n respond_to do |format|\n format.html { redirect_to currentunits_url, notice: 'Currentunit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @functional_unit = FunctionalUnit.find(params[:id])\n @functional_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to(functional_units_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @unit_action.destroy\n respond_to do |format|\n format.html { redirect_to unit_actions_url, notice: 'Unit action was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @log_unit = LogUnit.find(params[:id])\n @log_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to log_units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @measure = Measure.find(params[:id])\n @measure.destroy\n\n respond_to do |format|\n format.html { redirect_to measures_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @account_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to account_units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @aliquotum = Aliquotum.find(params[:id])\n @aliquotum.destroy\n\n respond_to do |format|\n format.html { redirect_to aliquota_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @goldmeasure.destroy\n respond_to do |format|\n format.html { redirect_to goldmeasures_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @commercial_unit.destroy\n respond_to do |format|\n format.html { redirect_to commercial_units_url, notice: 'Commercial unit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @quantity = Quantity.find(params[:id])\n @quantity.destroy\n\n respond_to do |format|\n format.html { redirect_to quantities_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @quantity = Quantity.find(params[:id])\n @quantity.destroy\n\n respond_to do |format|\n format.html { redirect_to quantities_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @commecial_unit.destroy\n respond_to do |format|\n format.html { redirect_to commecial_units_url, notice: 'Commecial unit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @german_unit.destroy\n respond_to do |format|\n format.html { redirect_to german_units_url, notice: 'German unit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @standard_size.destroy\n respond_to do |format|\n format.html { redirect_to standard_sizes_url, notice: 'Standard size was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @timeunit = Timeunit.find(params[:id])\n @timeunit.destroy\n\n respond_to do |format|\n format.html { redirect_to(timeunits_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @cloth_measure = ClothMeasure.find(params[:id])\n @cloth_measure.destroy\n\n respond_to do |format|\n format.html { redirect_to cloth_measures_url }\n format.json { head :ok }\n end\n end", "def destroy\n @rent_unit.destroy\n respond_to do |format|\n format.html { redirect_to rent_units_url, notice: 'Rent unit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy_rest\n @item_usage = ItemUsage.find(params[:id])\n @item_usage.destroy\n\n respond_to do |format|\n format.html { redirect_to(item_usages_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @weather_measure.destroy\n respond_to do |format|\n format.html { redirect_to weather_measures_url, notice: 'Weather measure was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @org_unit.destroy\n respond_to do |format|\n format.html { redirect_to org_units_url, notice: 'Org unit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @measure.destroy\n respond_to do |format|\n format.html { redirect_to measures_url, notice: 'Measure was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @measure.destroy\n respond_to do |format|\n format.html { redirect_to measures_url, notice: 'Measure was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @measure.destroy\n respond_to do |format|\n format.html { redirect_to measures_url, notice: 'Measure was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @admin_sub_metric.destroy\n respond_to do |format|\n format.html { redirect_to admin_sub_metrics_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @standard.destroy\n respond_to do |format|\n format.html { redirect_to standards_url, notice: 'Standard was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @relassignunit.destroy\n respond_to do |format|\n format.html { redirect_to relassignunits_url, notice: 'Relassignunit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @hazmat_unit = HazmatUnit.find(params[:id])\n @hazmat_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to(incident_timesheet_path, :notice => 'Hazmat Unit was successfully deleted.') }\n format.xml { head :ok }\n end\n end", "def destroy\n @unit_action_type.destroy\n respond_to do |format|\n format.html { redirect_to unit_action_types_url, notice: 'Unit action type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @physical_unit = Probe::PhysicalUnit.find(params[:id])\n @physical_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to(physical_units_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @police_unit.destroy\n respond_to do |format|\n format.html { redirect_to police_units_url, notice: 'Police unit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @storage_lun = StorageLun.find(params[:id])\n @storage_lun.destroy\n\n respond_to do |format|\n format.html { redirect_to storage_luns_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @k_measurement.destroy\n respond_to do |format|\n format.html { redirect_to k_measurements_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @storage = @client.storages.find(params[:id])\n @storage.destroy\n\n respond_to do |format|\n format.html { redirect_to client_url(@client) }\n format.json { head :no_content }\n end\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n @basis = Base.find(params[:id])\n @basis.destroy\n\n respond_to do |format|\n format.html { redirect_to bases_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ad_unit = AdUnit.find(params[:id])\n @ad_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to ad_units_url }\n format.json { head :ok }\n end\n end", "def destroy\n @unitmark.destroy\n respond_to do |format|\n format.html { redirect_to unitmarks_url, notice: 'Unitmark was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @uom = Uom.find(params[:id])\r\n @uom.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_back_or_default(uoms_url) }\r\n format.xml { head :ok }\r\n end\r\n end", "def destroy\n @metric_speedtest.destroy\n respond_to do |format|\n format.html { redirect_to metric_speedtests_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @building_id = @unit.building_id\n @unit.destroy\n respond_to do |format|\n format.html { redirect_to building_path(@building_id) }\n format.json { head :no_content }\n end\n end", "def destroy\n @sub1_line_item.destroy\n respond_to do |format|\n format.html { redirect_to sub1_line_items_url, notice: 'Sub1 line item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @test_stall.destroy\n respond_to do |format|\n format.html { redirect_to test_stalls_url, notice: 'Test stall was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @total_stock = TotalStock.find(params[:id])\n @total_stock.destroy\n\n respond_to do |format|\n format.html { redirect_to total_stocks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @body_measurement.destroy\n respond_to do |format|\n format.html { redirect_to body_measurements_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @machine_id_standard = MachineIdStandard.find(params[:id])\n @machine_id_standard.destroy\n\n respond_to do |format|\n format.html { redirect_to machine_id_standards_url }\n format.json { head :ok }\n end\n end", "def destroy\n @unit_category.destroy\n respond_to do |format|\n format.html { redirect_to unit_categories_url, notice: 'Unit category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @recipe_ingredients_unit.destroy\n respond_to do |format|\n format.html { redirect_to recipe_ingredients_units_url, notice: 'Recipe ingredients unit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @unidade_metrica = UnidadeMetrica.find(params[:id])\n @unidade_metrica.destroy\n\n respond_to do |format|\n format.html { redirect_to unidade_metricas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @compound = Compound.find(params[:id])\n @compound.destroy\n\n respond_to do |format|\n format.html { redirect_to compounds_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @quatum.destroy\n respond_to do |format|\n format.html { redirect_to quata_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @teaching_unit.destroy\n respond_to do |format|\n format.html { redirect_to teaching_units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subset.destroy\n respond_to do |format|\n format.html { redirect_to subsets_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @kr_measure.destroy\n respond_to do |format|\n format.html { redirect_to kr_measures_url, notice: 'Kr measure was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @handbook_structual_unit = HandbookStructualUnit.find(params[:id])\n @handbook_structual_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to handbook_structual_units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @programme_unit.destroy\n respond_to do |format|\n format.html { redirect_to programme_units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @sub_cost_center_three.destroy\n respond_to do |format|\n format.html { redirect_to sub_cost_center_threes_url, notice: 'Sub cost center three was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @measure_group = MeasureGroup.find(params[:id])\n @measure_group.destroy\n\n respond_to do |format|\n format.html { redirect_to measure_groups_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @academic_unit.destroy\n respond_to do |format|\n format.html { redirect_to academic_units_url, notice: 'Academic unit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @employing_unit = EmployingUnit.find(params[:id])\n @employing_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to employing_units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @three60.destroy\n respond_to do |format|\n format.html { redirect_to edit_admin_good_url(@good, anchor: \"three60\") }\n format.json { head :no_content }\n end\n end", "def destroy\n @consensu = Consensu.find(params[:id])\n @consensu.destroy\n\n respond_to do |format|\n format.html { redirect_to consensus_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @delinquency_stat.destroy\n respond_to do |format|\n format.html { redirect_to delinquency_stats_url, notice: 'Delinquency stat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @calorie_consumption.destroy\n respond_to do |format|\n format.html { redirect_to calorie_consumptions_url, notice: 'Calorie consumption was successfully destroyed.' }\n format.json { head :no_content }\n end\n end" ]
[ "0.7625142", "0.7387347", "0.7291347", "0.7235781", "0.7235781", "0.7235781", "0.7235781", "0.7210871", "0.720147", "0.71926165", "0.7188656", "0.71701986", "0.71639055", "0.7163536", "0.71441334", "0.71233857", "0.71072197", "0.7098981", "0.70986474", "0.70378184", "0.70218754", "0.7019958", "0.70107174", "0.69945437", "0.6989714", "0.69799745", "0.6947595", "0.69032115", "0.68778884", "0.6868148", "0.68604314", "0.6813779", "0.6795483", "0.6785085", "0.67750114", "0.6729753", "0.6710218", "0.6685336", "0.6670431", "0.6669367", "0.6660569", "0.6656826", "0.6643834", "0.6628565", "0.6628356", "0.66159326", "0.6597415", "0.6597415", "0.6593617", "0.65930295", "0.65859365", "0.6581882", "0.65545154", "0.65421194", "0.65268517", "0.6516758", "0.651635", "0.6508658", "0.6508658", "0.6508658", "0.65068436", "0.6478208", "0.64779645", "0.64767784", "0.64756435", "0.6475196", "0.6472855", "0.6456371", "0.6438475", "0.64328444", "0.6427435", "0.64167917", "0.6414662", "0.6410625", "0.64007604", "0.63996017", "0.6397554", "0.639602", "0.6392571", "0.63889986", "0.6387998", "0.638302", "0.6375919", "0.6372183", "0.6369711", "0.6362112", "0.6361", "0.63571334", "0.6356848", "0.6346648", "0.63440824", "0.633426", "0.6333133", "0.63329494", "0.63321674", "0.6323258", "0.6323219", "0.63215834", "0.6321063", "0.6320766" ]
0.7338672
2
Use callbacks to share common setup or constraints between actions.
def set_standard_unit @standard_unit = StandardUnit.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 set_actions\n actions :all\n end", "def define_action_helpers?; 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 revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def workflow\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def setup\n # override and do something appropriate\n end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def 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 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 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\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def setup(&block)\n define_method(:setup, &block)\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 init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\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 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 setup(easy)\n super\n easy.customrequest = @verb\n end", "def save_action; end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def 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 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", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def duas1(action)\n action.call\n action.call\nend", "def _handle_action_missing(*args); end" ]
[ "0.6164095", "0.6046031", "0.5945298", "0.59179014", "0.58890367", "0.58341795", "0.5776118", "0.5700777", "0.5700777", "0.5656277", "0.56218207", "0.5423995", "0.5411516", "0.5411516", "0.5411516", "0.5395004", "0.53783494", "0.53593004", "0.53412604", "0.534078", "0.5332865", "0.53135896", "0.52999926", "0.5297309", "0.5296569", "0.5261449", "0.5247048", "0.52376497", "0.52376497", "0.52376497", "0.52376497", "0.52376497", "0.52323204", "0.52310973", "0.523081", "0.5225785", "0.5219039", "0.52136266", "0.5208033", "0.520763", "0.5177365", "0.5175224", "0.5173357", "0.5166104", "0.5162502", "0.51573396", "0.5154547", "0.5153531", "0.51502854", "0.51436496", "0.5142863", "0.51330835", "0.5115634", "0.5115634", "0.511527", "0.5109693", "0.51076853", "0.5093146", "0.5090683", "0.50829846", "0.50819314", "0.50670373", "0.5055505", "0.5053398", "0.50504035", "0.50504035", "0.5037765", "0.5027292", "0.5024484", "0.50150335", "0.5014069", "0.50022113", "0.5001542", "0.49981874", "0.49915564", "0.49915564", "0.49880967", "0.4982312", "0.49787375", "0.49786067", "0.49687737", "0.49676532", "0.49602765", "0.49565676", "0.49550772", "0.495342", "0.49522525", "0.49463704", "0.49447197", "0.49362713", "0.49328062", "0.49280638", "0.49272856", "0.4927058", "0.49221697", "0.4919526", "0.49185994", "0.49184805", "0.49170163", "0.49168405", "0.49167764" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def standard_unit_params params.require(:standard_unit).permit(:name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
Receive the name from the user
def initialize(name) @name = name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request_user_name\n puts \"Please enter your name: \"\n name = gets.chomp\n end", "def get_user_name\n\tputs \"Quel sera ton nom pour cette partie ?\"\n\tprint \"> \"\n\tname = gets.chomp\n\treturn name\nend", "def req_name\n\t\tputs \"What is your name?\"\n\t\t@name = gets.chomp\n\tend", "def get_name\n\tputs \"Name:\"\n\tname = gets.chomp\nend", "def get_name\n\t\t# Ask the player for their name\n\t\tputs \"\\nWhat is your name?\"\n\n\t\t# Utilize the player class to store the input name\n\t\tself.player_name = Person.new(gets.strip)\n\tend", "def gets_name\n\t\tputs \"Quel est ton blaze?\"\n\t\tname = gets.chomp\n\tend", "def name\n userName\n end", "def name\n\tputs \"What is your client's full name?\"\n\tname = gets.chomp\nend", "def user_name\r\n\t#ask user for name\r\n\tputs \"What is your Name?\"\r\n\t#get users input and assign it to user_name\r\n\tuser_name = gets.chomp\r\nend", "def get_name\n\tputs \"What is your name?\"\n\tgets\nend", "def determine_username\n\tputs \"What is your name?\"\n\tusername = gets.strip.to_s\nend", "def name_of_person\n\tputs 'What is you name?'\n\ttheir_name = gets\nend", "def username\n name\n end", "def get_name\n puts \"Welcome to the casino!!! What's your name?\"\n name = gets.chomp\nend", "def name\n puts 'Ingresa el nombre del jugador: '\n name_player = gets.chomp\n name_player\n end", "def get_name(user_info)\n return user_info[\"name\"]\n end", "def name\r\n\t\t@usr_name\r\n\tend", "def name\r\n\t\t@usr_name\r\n\tend", "def add_name\n\t\tputs \"What\\'s your name?\"\n\t\t@name = gets.chomp.capitalize \n\tend", "def set_name()\n # @name = Prompt for Name\n print \"[#{@colour}] Enter your name: \"\n @name = gets.strip\n\n end", "def username\n puts 'Please enter your full name and press ENTER:'\n gets.chomp\nend", "def input_name\n\tname = gets.chomp\nend", "def get_name()\n print \"Enter your name: \"\n return gets.chomp\nend", "def get_name()\n print \"Enter your name: \"\n return gets.chomp\nend", "def get_name()\n print \"Please enter your name: \"\n return gets.chomp.downcase\nend", "def user_name_input \n\t\[email protected]_field(id: @username)\n\tend", "def get_username mode=\"new\"\n\t\tputs \"Please enter your username:\"\n\t\tinput = gets.chomp.downcase\n\t\tuntil !input.empty? && input[0,1]!='.' && input != \"menu\"\n\t\t\tputs \"\",\"The username can't be empty, menu, or start with '.'. \",\"Please enter another username:\"\n\t\t\tinput = gets.chomp\n\t\tend\n\t\t@username = input\n\tend", "def get_player_name\n name = STDIN.gets.chomp\n name\n end", "def get_name\n\t\tputs \"What tile would you like to claim? (1-9)\"\n\t\tname = gets.chomp\n\tend", "def get_character_from_user\n puts \" Please enter your name: \"\n gets.chomp.to_str\n puts \"\"\n end", "def name=(user)\n\t\t@name=user\n\tend", "def get_name \n\tputs \"What is your surname?:\"\n\tname = gets.chomp \n\tprint_thanks \n\tif check_name_ok?(name)\n\t\tthen print_new_name(name) end\nend", "def user_name \n sleep 1\n puts \"Please Enter your name:\"\n input = gets.chomp(\" \")\n end", "def get_name\n puts \"Please enter player #{id_number}'s name: \"\n while true\n begin\n @name = gets.chomp\n raise EmptyNameError if @name.empty?\n break\n rescue EmptyNameError\n puts \"You input was blank. Please try again.\"\n end\n end\n\n end", "def get_name()\n puts \"Please enter your name\"\n name = gets.chomp\n return(name)\nend", "def name\n \"#{user_name.titleize}\"\n end", "def readName()\n puts (\"Please enter the first name: \")\n @first = gets.chomp\n puts (\"Please enter the middle name: \")\n @middle = gets.chomp\n puts (\"Please enter the last name: \")\n @last = gets.chomp\n end", "def prompt(message)\n\tprint message\n\tname = gets.chomp\nend", "def user_name\n @message[:user][:name]\n end", "def user_name(name = nil)\n return user_name_from_name(name) if name\n\n user_name_random\n end", "def player_name\n\tgame_sounds\n\t\tputs \"Hey man whats your name?\"\n\t\t@your_name = $stdin.gets.chomp.upcase\n\t\tplay_game\n\tend", "def name\n\t self.username\n end", "def get_player_name(name)\n return prompt(\"Player Name? [Player #{name}]\",\"Player #{name}\")\n end", "def retrieve_name\n return @name\n end", "def byline\n (name != user_name) ? name + \" (\" + user_name + \")\" : name\n end", "def byline\n (name != user_name) ? name + \" (\" + user_name + \")\" : name\n end", "def name\n puts \"What is your name?\"\n name = gets.chomp\nend", "def ask_for_name\n\t\tputs \"What is your name?\"\n\t\tplayer_name = gets.chomp\n\t\t$person = Person.new(player_name)\n\tend", "def ask_name\n begin\n connection.puts \"What's your name? (10 alphanum/spaces only, please.)\"\n # Only grab 10 characters.\n name = connection.gets.chomp[0..10]\n end while !only_chars? name\n name\n end", "def add_user_name(username)\n\t\tuser_name_input.set(username)\n\tend", "def name\n username || email\n end", "def name\n username || email\n end", "def to_param\n\t\tuser_name\n\tend", "def name(entered_name)\n split_name = entered_name.split\n @first_name = split_name[0].capitalize\n @last_name = split_name[1].capitalize\n end", "def user_name\n decode_string_member(:user_name)\n end", "def get_name\n ask(\"give me a name to submit to local arena\") { |q|\n q.validate = /\\w+/\n }\nend", "def display_name \n username\n end", "def get_name\n\t\t@name\n\tend", "def get_recipe_name_from_user\n puts \"\\nEnter a recipe name or ingredients you want to search by:\\n \".colorize(:green).bold\n find_by_name = gets.strip.downcase\n end", "def name\n\t\tn = names\n\t\treturn n[:fullname] if n[:fullname]\n\t\treturn n[:username] if n[:username]\n\t\treturn I18n.translate(\"user.name.unknown\")\n\tend", "def display_name\n username\n end", "def ask_player_name\n puts \"Rentre le pseudo du joueur #{@symbol} : \"\n print '> '\n name = gets.chomp\n name\n end", "def _user_name(kh)\n @connection.comm.sender_name(kh) || 'unknown_user'\nend", "def name\n unless @name\n begin\n @name = get_login\n rescue TiscapError => toki_doki\n @name = ''\n raise toki_doki\n ensure\n @accepting = true\n end\n end\n \n @name\n \n # We can fairly assume that no one will concurrently ask for our name\n # until this method returns for the first time.\n end", "def name\n name = self[:name]\n name.blank? ? login : name\n end", "def name\n params['name']\n end", "def ask_name\r\n puts \"\\e[33mWhat is your name ?\"\r\n print \"\\e[39m> \"\r\n gets.chomp\r\n end", "def user_name\n \"someone\"\n end", "def user_name\n read_attribute('user_name') || \"anonymous\"\n end", "def get_user_name client, event\n # calls users_info on slack\n info = client.users_info(user: event.user_id ) \n info['user']['name']\n end", "def ask_first_name \n puts \"Quel est votre prénom ? \"\n name = gets.chomp\n return name\n end", "def name\n email\n end", "def name\n email\n end", "def name \r\n @my_name \r\n end", "def user\n puts self.name\n end", "def proper_name # method to get the full name of user\n first_name + \" \" + last_name\n end", "def user_name\n name = self.le_user.nil? ? '' : self.le_user.name\n end", "def username\n params[:username].downcase\n end", "def user_name\n name = user.nil? ? '' : user.name\n end", "def username\n \"rocky\"\n end", "def scream\n puts \"MY NAME IS #{self.username}!\"\n end", "def set_name\n\t\tresponse = false\n\t\twhile not response\n\t\t\tputs \"What is your name?\"\n\t\t\tresponse = gets.chomp.downcase.capitalize!\n\t\t\t# entry_ok?(response) # Need to implement is_alpha check \n\t\tend\n\t\tresponse\n\tend", "def readName()\n @first = gets.chomp\n @middle = gets.chomp\n @last = gets.chomp\n end", "def find_user\n puts \"Please enter your name.\"\n name_input = gets.chomp\n system \"clear\"\n actual_user = User.find_by(name: name_input) #look up user name\n if !actual_user #check if name matches user input\n puts \"we could not find that user name. Please try again.\"\n find_user\n else\n @user = actual_user #set the user name to a class variable for later user\n main_menu_options #send user to main menue\n end\n end", "def user_name\n @user_name ||= SlackUtils::SingletonClient.instance.find_user_name(@user_id)\n end", "def process_name\n\t\tlower_case_name = params[:input].downcase\n\t\tif lower_case_name == \"alex\" \n\t\t\t@name = \"Howdy\"\n\t\telsif lower_case_name == \"fitz\"\n\t\t\t@name = \"nice\"\n\t\telse\n\t\t\t@name = \"What are you staring at\"\n\t\tend\n\t\tRails.logger.info \"Lower case name was: \" + lower_case_name\t\t\t\t\n\tend", "def getUserName(userName)\n if(userName != nil)\n user = loadUser(userName)\n return user[\"fname\"]+\" \"+user[\"lname\"]\n end\n return \"User not Found!\"\n end", "def username(name = nil)\n if !name then @username\n else @username = name\n end\n end", "def screen_name\n name || nickname\n end", "def get_user_name client, event\n # calls users_info on slack\n info = client.users_info(user: event.user_id )\n info['user']['name']\n end", "def get_contact_name\n puts \"Please enter the contact first name:\"\n gets.chomp\n end", "def display_name\n entry = JSON.parse(self.entry)\n user = User.find(user_id)\n \"#{user.display_name} #{entry['text']}\"\n end", "def display_user(user)\n user.name\n end", "def ask_user\n\tprint \"User: \".blue\n\tgets.chomp\nend", "def collect_name\n\tputs \"Please enter full name of the student you wish to add / amend.\"\n\tprint \"Alternatively press enter to exit and print results.\\n > \"\n\tname = gets.chomp.split.map(&:capitalize).join(' ').strip\n\tname\nend", "def name(namei)\n return \"hola \" + namei + \" Welcome\"#namei->name input\nend", "def get_name\n return @name\n end", "def to_param\n user_name\n end", "def to_param\n user_name\n end", "def get_name()\n @name\n end", "def get_name()\n @name\n end" ]
[ "0.8131631", "0.7985759", "0.7943557", "0.7711318", "0.7683341", "0.7655077", "0.7645622", "0.7624299", "0.76142347", "0.74671954", "0.7383562", "0.736905", "0.73289657", "0.7297595", "0.72644275", "0.72014517", "0.7199548", "0.7199548", "0.7174797", "0.71539634", "0.7142932", "0.7091708", "0.70606786", "0.70606786", "0.7055432", "0.69955724", "0.69869405", "0.69682664", "0.69615287", "0.69481635", "0.69386065", "0.6933251", "0.693303", "0.69268626", "0.6923619", "0.6909192", "0.6897989", "0.6892653", "0.6890227", "0.687818", "0.68776214", "0.6860999", "0.68478554", "0.68415445", "0.684038", "0.684038", "0.68357617", "0.6834419", "0.6827156", "0.68262833", "0.6825292", "0.6825158", "0.68219066", "0.68208206", "0.681674", "0.6802776", "0.6777121", "0.6776178", "0.6770802", "0.6765207", "0.67558885", "0.6753777", "0.67454356", "0.6734045", "0.6728962", "0.6726536", "0.6724262", "0.6717833", "0.6716636", "0.67161477", "0.67121446", "0.6711955", "0.6711955", "0.6699664", "0.66993564", "0.66862917", "0.6683314", "0.66824955", "0.6679136", "0.6679052", "0.66729516", "0.6666323", "0.66588867", "0.66565996", "0.66432405", "0.6636505", "0.6635383", "0.6632698", "0.6630636", "0.6628945", "0.66235596", "0.6621305", "0.6611556", "0.6610202", "0.6607248", "0.6601369", "0.6589798", "0.65875167", "0.65875167", "0.6579774", "0.6579774" ]
0.0
-1
Gracefully return the name if asked
def to_s "#{self.name}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_name\n (name.empty? || name.nil?) ? '' : name\n end", "def get_name\n return \"#{name}\"\n end", "def get_name\n # The last sentence in a function is always returned so no need to mention return\n @name\n end", "def original_name\r\n return @name\r\n end", "def naming\n name || nickname\n end", "def real_name\n name\nend", "def name() return @name end", "def name() return @name end", "def get_name\n return @name\n end", "def name\n name = \"\"\n end", "def name\n name = \"\"\n end", "def get_name\n\t\treturn @name\n\tend", "def get_name\n\t\treturn @name\n\tend", "def get_name\n\t\treturn @name\n\tend", "def name\n @name ||= names.first\n end", "def return_name\n @name\n end", "def name = (name)", "def get_name()\n @name\n end", "def get_name()\n @name\n end", "def full_name\n '(unknown)'\n end", "def get_name\n\t\t@name\n\tend", "def retrieve_name\n return @name\n end", "def name\n # If you activate lib/String.rb enable the next line\n # spec.full_name.or_else(login_name)\n spec.full_name\n end", "def name\n unless @name\n begin\n @name = get_login\n rescue TiscapError => toki_doki\n @name = ''\n raise toki_doki\n ensure\n @accepting = true\n end\n end\n \n @name\n \n # We can fairly assume that no one will concurrently ask for our name\n # until this method returns for the first time.\n end", "def name\n \"<#{@name}>\" if defined?(@name) && @name\n end", "def name\n @name || super\n end", "def getName; @name; end", "def get_name\r\n self.name\r\n end", "def name_or_none\n name || \"\"\n end", "def name\n @name ||= data.name\n end", "def name\n @name ||= data.name\n end", "def real_name; end", "def get_name\n @name\n end", "def get_name_middleman\n name ? name : 'N/a'\n end", "def name\n ''\n end", "def name\n @name ||= to_s.split(\"#\").last.delete(\">\")\n end", "def indefinite_name\n return \"something\"\n end", "def get_name\n @name\n end", "def get_name\n @name\n end", "def get_name\n @name\n end", "def get_name\n @name\n end", "def name\n fail\n end", "def\n get_name()\n @name\n end", "def name() end", "def display_name\n override_name ||= name\n # default to name if the value of override_name is empty string\n override_name = name if override_name.strip == \"\"\n override_name\n end", "def my_name \n @my_name ||= self.class.name.split(\"::\").last\n end", "def name\n @name || path_name\n end", "def name_str\n if name?\n ' '+name\n else\n ''\n end\n end", "def get_name\n return \"Name: \" + @name\n end", "def name\n @name.empty? ? to_s : @name\n end", "def name\n return @name\n end", "def name\n return @name\n end", "def name\n @name || @id.to_s.capitalize\n end", "def new_name; end", "def full_name\n name\n end", "def given_name\n return @given_name || name\n end", "def name\n nil\n end", "def name\n return @name\n end", "def fullname\n name\n end", "def my_name\n @my_name ||= self.class.name.split(\"::\").last\n end", "def human_from_name; end", "def getname\n return @name.to_sym\n end", "def full_name\n\t\tfullname = childs_names.delete_if(&:blank?).join(' ')\n\t\t( fullname.blank? ) ? '[name not available]' : fullname\n\tend", "def name\n zombie_check\n @name\n end", "def name\n internal_name\n end", "def name(variable=default)\n\t\t ### The last line in here get's returned by default\n\t\tend", "def name\n @name ||= self.to_s.demodulize.underscore\n end", "def name\n if person\n person.name\n else\n \"\"\n end\n end", "def name\n auth[:info][:name] || auth[:info][:display_name] rescue nil\n end", "def name\n @trading_name || @other_trading_name || @main_name || @legal_name || @legal_name2 || 'Name unknown'\n end", "def get_name\n return @m_name\n end", "def get_name\n return @m_name\n end", "def get_name\n return @m_name\n end", "def get_name\n return @m_name\n end", "def name()\n return @name\n end", "def name\n @name ||= new_resource.name[-1] == '.' ? new_resource.name : \"#{new_resource.name}.\"\n end", "def name\n names.first\n end", "def name\n @name || \"Unspecified\"\n end", "def identify_name\n @identify_name ||= begin\n if self.respond_to?(:name)\n self.try(:name)\n elsif self.respond_to?(:title)\n self.try(:title)\n else\n 'NONE'\n end\n end\n end", "def full_name\n name\n end", "def full_name\n \"#{ owner }/#{ name }\" if owner && name\n end", "def name\n return @playing_girl ? @name_girl : @name_boy\n end", "def name\n full_name\n end", "def name\n\t\treturn @name\n\tend", "def name\n\t\tn = names\n\t\treturn n[:fullname] if n[:fullname]\n\t\treturn n[:username] if n[:username]\n\t\treturn I18n.translate(\"user.name.unknown\")\n\tend", "def name\n name = self[:name]\n name.blank? ? login : name\n end", "def name\n @display_name || @name\n end", "def name\n return '_untitled_' if self[:name].blank?\n self[:name]\n end", "def getName()\n return @name\n end", "def name\n nil\n end", "def name\n @name ||= self.class.non_namespaced_name\n end", "def last_name\n super || (name and name.split.last)\n end", "def name \r\n @my_name \r\n end", "def name\n names.first\n end", "def name\n \"Lord Admiral #{@name}\"\n end", "def name\n names[0]\n end", "def realname\r\n return for_context(nil, false) { |c| c.realname }\r\n end", "def name\n @name||=data.name\n end", "def get_name()\n return @me.uname if @me.brother.nil?\n return @me.brother.full_name\n end", "def getName\n return @name\n end", "def getName\n return @name\n end" ]
[ "0.7862403", "0.78622043", "0.7704219", "0.76406735", "0.7586576", "0.7582237", "0.75328445", "0.75328445", "0.7529123", "0.7515023", "0.7515023", "0.75018054", "0.75018054", "0.75018054", "0.74821776", "0.74558806", "0.74340844", "0.74171203", "0.74171203", "0.74081033", "0.74036366", "0.73952353", "0.7389346", "0.7386961", "0.7356327", "0.73553485", "0.73528993", "0.734706", "0.73307425", "0.7322836", "0.7322836", "0.73228055", "0.73111147", "0.73103744", "0.7309943", "0.72779316", "0.72695184", "0.72642857", "0.72642857", "0.72642857", "0.72642857", "0.7259791", "0.7246342", "0.7237813", "0.72366965", "0.722817", "0.7226134", "0.7194517", "0.71713257", "0.715161", "0.71102303", "0.71102303", "0.71096724", "0.71094626", "0.709678", "0.709587", "0.7089477", "0.7084508", "0.70820606", "0.7081899", "0.7080167", "0.70798254", "0.7079631", "0.7073511", "0.7073511", "0.7072519", "0.70689815", "0.70682704", "0.7068089", "0.7064496", "0.70528567", "0.70528567", "0.70528567", "0.70528567", "0.7049265", "0.704765", "0.70439786", "0.7043921", "0.7039199", "0.7035272", "0.7027399", "0.70261717", "0.70256", "0.7022262", "0.7018332", "0.70140016", "0.7011991", "0.7006759", "0.70049006", "0.69994885", "0.69879556", "0.6984784", "0.69808185", "0.69784105", "0.6973317", "0.6968041", "0.6967147", "0.6966723", "0.69637185", "0.6963638", "0.6963638" ]
0.0
-1
GET /registro_videoconferencia GET /registro_videoconferencia.json
def index @registro_videoconferencia = RegistroVideoconferencium.all render json: @registro_videoconferencia end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @videoconferencias = Videoconferencium.all\n render json: @videoconferencias\n end", "def index\n @participante_videoconferencia = ParticipanteVideoconferencium.all\n render json: @participante_videoconferencia\n end", "def create\n @registro_videoconferencium = RegistroVideoconferencium.new(registro_videoconferencium_params)\n\n respond_to do |format|\n if @registro_videoconferencium.save\n format.html { redirect_to @registro_videoconferencium, notice: 'Registro videoconferencium was successfully created.' }\n format.json { render :show, status: :created, location: @registro_videoconferencium }\n else\n format.html { render :new }\n format.json { render json: @registro_videoconferencium.errors, status: :unprocessable_entity }\n end\n end\n end", "def registro_videoconferencium_params\n params.require(:registro_videoconferencium).permit(:estado, :fecha, :hora, :descripcion, :videoconferencia)\n end", "def set_registro_videoconferencium\n @registro_videoconferencium = RegistroVideoconferencium.find(params[:id])\n end", "def new\n @record_video = RecordVideo.new\n @tuantis= Tuanti.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @record_video }\n end\n end", "def new\n \n @video = Video.new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @kuaibovideo = Kuaibovideo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @kuaibovideo }\n end\n end", "def create\n params[:video][:fecha] = DateTime.strptime(params[:video][:fecha], \"%Y-%m-%d %H:%M:%S UTC\")\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n\t\t\t@v_id = Video.maximum(:id)\n params[:parts].each do |part|\n\t\t\t\tpart[:id_video] = @v_id\n @p = Participante.new(participante_params(part))\n if [email protected]\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n format.html { redirect_to @video, notice: 'El video se ha registrado con éxito en el catálogo.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @channel = params[:forminfo]\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @video = Video.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def update\n respond_to do |format|\n if @registro_videoconferencium.update(registro_videoconferencium_params)\n format.html { redirect_to @registro_videoconferencium, notice: 'Registro videoconferencium was successfully updated.' }\n format.json { render :show, status: :ok, location: @registro_videoconferencium }\n else\n format.html { render :edit }\n format.json { render json: @registro_videoconferencium.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def show\n @kuaibovideo = Kuaibovideo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kuaibovideo }\n end\n end", "def create\n @video = Video.new(video_params)\n @video.save!\n render json: @video\n end", "def destroy\n @registro_videoconferencium.destroy\n respond_to do |format|\n format.html { redirect_to registro_videoconferencia_url, notice: 'Registro videoconferencium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def show\n render json: @video\n end", "def show\n render json: @video\n end", "def create\n @video = current_user.videos.new(video_params)\n respond_to do |format|\n if @video.save\n format.html { redirect_to videos_path(), notice: 'Video criado com sucesso.' }\n format.json { render :index, status: :created, location: @video }\n else\n format.html { redirect_to new_video_path(), notice: 'Video não salvo.' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def videoconferencium_params\n params.require(:videoconferencium).permit(:fecha, :hora, :unidad, :estado, :tipo, :nro_causa, :motivo, :solicitante)\n end", "def create\n @video = Video.new(nicovideo_id: params[:nicovideo_id])\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { redirect_to videos_path , alert: 'Video was not successfully created.' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n\tif user_type != 'guest' and user_type != 'bunned' and user_type != 'new_user'\n\t\t@video = Video.new\n\t\t\n\t\t@title = 'Новое видео'\n\t\trespond_to do |format|\n\t\t format.html # new.html.erb\n\t\t format.json { render :json => @video }\n\t\tend\n\telse\n\t\tredirect_to '/404'\n\tend\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Vídeo criado com sucesso' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @c_video = CVideo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @c_video }\n end\n end", "def new\n @channel = params[:forminfo]\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n\n if @video.save\n format.html {\n flash[:notice] = \"Vídeo criado!.\"\n redirect_to(:action => 'show', :id => @video.id, :palestrante_id => @palestrante.id)\n }\n format.json { \n render action: 'show', :palestrante_id => @palestrante.id, status: :created, location: @video\n }\n else\n format.html {\n @palestrantes = Palestrante.ordenados\n @agendas = Agenda.recentes\n render action: 'new'\n }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def video_params\n params[:video]\n end", "def video_params\n params[:video]\n end", "def video_params\n params[:video]\n end", "def create\n @video = Video.new(video_params.merge(:owner => current_user))\n @original = nil\n if (@video.errors[:video_exists])\n @original = Video.where(:external_id => @video.external_id, :type => @video.type).first\n end\n if @video.save\n render :json => @video, :include => ALL_INCLUDES\n else\n render :json => @video.errors, status: :unprocessable_entity\n end\n end", "def create\n @participante_videoconferencium = ParticipanteVideoconferencium.new(participante_videoconferencium_params)\n\n respond_to do |format|\n if @participante_videoconferencium.save\n format.html { redirect_to @participante_videoconferencium, notice: 'Participante videoconferencium was successfully created.' }\n format.json { render :show, status: :created, location: @participante_videoconferencium }\n else\n format.html { render :new }\n format.json { render json: @participante_videoconferencium.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\tif user_type != 'guest' and user_type != 'bunned' and user_type != 'new_user'\n\t\tparams[:video][:user_id] = current_user.id\n\t\t@video = Video.new(params[:video])\n\t\trespond_to do |format|\n\t\t if @video.save\n\t\t\tformat.html { redirect_to @video, :notice => 'Видео успешно добавлено' }\n\t\t\tformat.json { render :json => @video, :status => :created, :location => @video }\n\t\t else\n\t\t\tformat.html { render :action => \"new\" }\n\t\t\tformat.json { render :json => @video.errors, :status => :unprocessable_entity }\n\t\t end\n\t\tend\n\telse\n\t\tredirect_to '/404'\n\tend\n end", "def create\n #@videos = Video.where(:curriculum_id => params[:curriculum_id]))\n @video = Video.new(video_params)\n @video.curriculum_id = params[:curriculum_id]\n @curric = Curriculum.find(params[:curriculum_id])\n respond_to do |format|\n if @video.save\n format.html { redirect_to @curric, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n format.js\n\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n \n end", "def medio_video_params\n params.require(:medio_video).permit(:url, :fecha)\n end", "def create\n # Esta solución no es viable con la versión de Dynamoid 0.7.1\n @video = current_user.videos.create(video_params)\n @video.usuario_id = current_user.id\n respond_to do |format|\n if @video.save\n flash[:success] = \"El video ha sido posteado, pasarán unos segundos para ser publicado\"\n format.html { redirect_to current_user }\n format.json { render action: 'show', status: :created, location: @video }\n else\n puts @video.to_s\n format.html { render action: 'new' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @video = current_user.videos.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "def create\n @congratulations_video = CongratulationsVideo.new(congratulations_video_params)\n @congratulations_video.name = @congratulations_video.name.downcase\n @congratulations_video.slug = Digest::MD5.hexdigest @congratulations_video.name\n respond_to do |format|\n if @congratulations_video.save\n format.html { redirect_to @congratulations_video, notice: 'Congratulations video was successfully created.' }\n format.json { render :show, status: :created, location: @congratulations_video }\n else\n format.html { render :new }\n format.json { render json: @congratulations_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video.as_json }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def video_params\n params.require(:video).permit(:attach, :profesor_id, :observador_id)\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to home_admin_path, notice: '视频创建成功!' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(video_params)\n @video.uuid = params[:videohelpsubmission][:video_uuid]\n @video.token = SecureRandom.hex\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.where(video_params).first\n #@profesor_selected = @video.personas.first.id\n @profesor_selected = params[:profesor_id]\n saved = @video.save\n puts 'entro cuando cargue un video'\n if saved\n pipeline_id = '1439848270326-bs22oc'\n input_key = URI(@video.attach.url).path\n input_key = input_key[1..input_key.length]\n region = 'us-west-1'\n transcoder_client = AWS::ElasticTranscoder::Client.new(region: region)\n Funciones.get_options pipeline_id, input_key\n job = transcoder_client.create_job(options)\n job_id = job[:job][:id]\n @video.transcoder_job_id = job_id\n @video.save\n p job\n end\n respond_to do |format|\n if saved\n generar_evaluaciones(@video.profesor.id, @video.id)\n format.html { redirect_to video_path(@video.id), notice: 'Video fue creado con éxito.' }\n format.json { render :show, status: :created, location: @video }\n else\n #format.html { render :new }\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @video = Video.find(params[:id])\n @question = VideoQuestion.new\n @answer = VideoAnswer.new\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @video = Video.new\n @scene = Scene.find(params[:scene_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def video\n YouTubeApi.find_video(youtube_id)\n end", "def new\n @video = Video.new\n respond_with(@video)\n end", "def process_video(options = {})\n vzaar_video_id = nil\n request_xml = %{\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <vzaar-api>\n <video>\n <guid>#{options[:guid]}</guid>\n <title>#{options[:title]}</title>\n <description>#{options[:description]}</description>\n <profile>#{options[:profile]}</profile>\n }\n if !options[:transcoding].nil?\n request_xml += %{\n <transcoding>#{options[:transcoding]}</transcoding>\n }\n end\n request_xml += %{ \n </video>\n </vzaar-api>\n }\n auth_connection HTTP_POST, '/api/videos', request_xml do |response_body|\n vzaar_video_id = get_video_id_from_response_body(response_body)\n end\n vzaar_video_id\n end", "def show\n @veditor = Veditor.find(params[:vid])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @veditor }\n end\n end", "def index\n @videos = Video.all\n render json: @videos\n end", "def create\n @adm_video = Adm::Video.new(adm_video_params)\n\n respond_to do |format|\n #@adm_video[:codigo]=parse_youtube(params[:adm_video][:codigo])\n\n if @adm_video.save\n # format.html { redirect_to @adm_video, notice: t('videos.create_success') }\n # format.json { render :show, status: :created, location: @adm_video }\n flash[:notice] = t('videos.create_success')\n respond_with(@adm_video)\n else\n # format.html { render :new }\n # format.json { render json: @adm_video.errors, status: :unprocessable_entity }\n\n respond_with(@adm_video)\n\n end\n end\n end", "def new\n @vocacionada = Vocacionada.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vocacionada }\n end\n end", "def video_params\n params.fetch(:video, {})\n end", "def resources\n videos\n end", "def show_video\n\t\t@video = OldFlashFile.find(params[:id]) \n\t\tif @video\n\t\t@[email protected]\n\t\telse\n\t\t@status = {\"status-msg\"=>\"Video not exist\"}\n\t\tend\n\n render :json =>@status.to_json\n\t\tend", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render action: 'show', status: :created, location: @video }\n else\n format.html { render action: 'new' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render action: 'show', status: :created, location: @video }\n else\n format.html { render action: 'new' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def getVideoFromPolylineAS\n\t\t\n\t\tif !params[:poly_id]\n\t\t\trender :text => \"Failed. (Parameters set improperly)\"\n\t\t\treturn false\n\t\tend\n\t\t\n\t\tspeed = Syncronisation.find_by_sql([\"select time, distance from syncronisations where route_id in (select id from routes where polyline_id = ?) order by time\", params[:poly_id]])\n\t\troute = Route.find(:first, :conditions => [ \"polyline_id = ?\", params[:poly_id] ]);\n\t\t\n\t\trender :json => {:video_id => route.video_id, :sync => speed}.to_json\n\tend", "def getVideoFromPolylineAS\n\t\t\n\t\tif !params[:poly_id]\n\t\t\trender :text => \"Failed. (Parameters set improperly)\"\n\t\t\treturn false\n\t\tend\n\t\t\n\t\tspeed = Syncronisation.find_by_sql([\"select time, distance from syncronisations where route_id in (select id from routes where polyline_id = ?) order by time\", params[:poly_id]])\n\t\troute = Route.find(:first, :conditions => [ \"polyline_id = ?\", params[:poly_id] ]);\n\t\t\n\t\trender :json => {:video_id => route.video_id, :sync => speed}.to_json\n\tend", "def videos options={}\n response = client.get(\"/#{id}/videos\", options)\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to root_url, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @congratulations_videos = CongratulationsVideo.all\n end", "def create\n @video = Video.new(params[:video])\n @licenses = License.all\n @galleries = Gallery.all\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @congratulations_video.update(congratulations_video_params)\n format.html { redirect_to @congratulations_video, notice: 'Congratulations video was successfully updated.' }\n format.json { render :show, status: :ok, location: @congratulations_video }\n else\n format.html { render :edit }\n format.json { render json: @congratulations_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n\n @project = Project.user_readable(current_user, params[:project_id])\n\n if @project\n\n @video = @project.videos.new(params[:project_video])\n\n if @video.save\n respond_to do |format|\n format.json { render :json => {:video_id => @video.id, :aws_videos_path => @video.videos_path}, :status => :ok }\n end\n\n else\n respond_to do |format|\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n\n else\n not_authorized\n end\n\n\n\n end", "def congratulations_video_params\n params.require(:congratulations_video).permit(:name, :file, :cover, :slug)\n end", "def create\n @videoconferencium = Videoconferencium.new(videoconferencium_params)\n\n respond_to do |format|\n if @videoconferencium.save\n format.html { redirect_to @videoconferencium, notice: 'Videoconferencium was successfully created.' }\n format.json { render :show, status: :created, location: @videoconferencium }\n else\n format.html { render :new }\n format.json { render json: @videoconferencium.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(params[:video])\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(params[:video])\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(params[:video])\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(params[:video])\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @video = Video.find(params[:id])\n respond_with(@video)\n end", "def create\n @demanda_videomonitoramento = DemandaVideomonitoramento.new(demanda_videomonitoramento_params)\n\n respond_to do |format|\n if @demanda_videomonitoramento.save\n format.html { redirect_to @demanda_videomonitoramento, notice: 'Demanda videomonitoramento was successfully created.' }\n format.json { render action: 'show', status: :created, location: @demanda_videomonitoramento }\n else\n format.html { render action: 'new' }\n format.json { render json: @demanda_videomonitoramento.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n render :json => @video, :include => ALL_INCLUDES\n end", "def show\n @video = Video.find(params[:id])\n\tif @video != nil\n\t\t@title = @video.alter_name\n\t\t@return_to = video_path(@video)\n\t\t@page_params = {:part_id => 5,:page_id => 1,:entity_id => @video.id}\n\t\t@path_array = [\n\t\t\t\t\t\t{:name => 'Видео', :link => videos_path},\n\t\t\t\t\t\t{:name => @video.category_name, :link => videos_path(:c => @video.category_path)},\n\t\t\t\t\t\t{:name => @video.alter_name, :link => '/'}\n\t\t\t\t\t ]\n\t\t@comments = @video.messages.where(:status_id => 1).order('created_at ASC')\n\t\trespond_to do |format|\n\t\t format.html # show.html.erb\n\t\t format.json { render :json => @video }\n\t\tend\n\tend\n end", "def video\n\t\tif params[:category_id]==\"all\"\n\t\t@search=OldFlashFile.all\n\t\t\t\tif [email protected]?\n\t\t\t\t@status= @search.map{|f| {:title =>f.title, :imageUrl=>request.protocol+request.host_with_port+f.preview_image.url(:small), :videoUrl=>(f.video.content_type==\"video/x-flv\") ? \"#{request.protocol+request.host_with_port+f.video.url}\".gsub(\".flv\", \".mp4\") : \"#{request.protocol+request.host_with_port+f.video.url}\" ,:videotype=>f.video.content_type}}\n\t\t\t\telse\n\t\t\t\t@status=nil \n\t\t\t\tend\n\n\t\telse\n\t\targs={:search=>{:filter=>params[:filter],:category_id=>params[:category_id]}}\n\n\t\t@search = ContentSearch.new(args) \n\t\t@results = Kaminari.paginate_array( @search.results )\n\t\t@total = @search.total\n\n\t\t\tif [email protected]?\n\t\t\t@status= @results.map{|f| {:title =>f.title, :imageUrl=>request.protocol+request.host_with_port+f.preview_image.url(:small), :videoUrl=>(f.video.content_type==\"video/x-flv\") ? \"#{request.protocol+request.host_with_port+f.video.url}\".gsub(\".flv\", \".mp4\") : \"#{request.protocol+request.host_with_port+f.video.url}\",:videotype=>f.video.content_type}}\n\n\t\t\telse\n\t\t\t@status=nil \n\t\t\tend\n\t\tend\n\n\t\trender :json =>@status.to_json\n\t\tend", "def video_params\n params.require(:video).permit(:titulo,:fecha,:liga,:tipo,:curso,:thumbnail)\n end", "def create\n @video = @room.videos.new(video_params)\n respond_to do |format|\n if @video.save\n format.html { redirect_to upload_video_path(@video), notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @album = Album.find(params[:album_id])\n @video = @album.videos.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @album, notice: 'Video creado satisfactoriamente.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.7014022", "0.6932151", "0.6614689", "0.6514121", "0.6396124", "0.63498515", "0.62812436", "0.627072", "0.6265119", "0.62557036", "0.6179464", "0.6175161", "0.6164366", "0.6164366", "0.6164366", "0.6164366", "0.6164366", "0.6164366", "0.6164366", "0.6164366", "0.6164366", "0.6164366", "0.61631006", "0.6133653", "0.61161196", "0.60801923", "0.60751384", "0.60669297", "0.60643464", "0.60542023", "0.6052", "0.6049641", "0.6024451", "0.6022031", "0.60202307", "0.6019853", "0.6019853", "0.6019853", "0.6019853", "0.6019853", "0.6019853", "0.6019853", "0.6018327", "0.5999599", "0.5999599", "0.5999599", "0.59746116", "0.5938211", "0.59376854", "0.5915945", "0.5915131", "0.59026796", "0.58975476", "0.5892282", "0.58909786", "0.58759356", "0.5829899", "0.5784088", "0.5773222", "0.57715106", "0.57624626", "0.5756655", "0.57502925", "0.5744225", "0.5736436", "0.57303435", "0.57181287", "0.57132375", "0.5694029", "0.56881464", "0.56800914", "0.56769496", "0.56769496", "0.56769496", "0.56769496", "0.56769496", "0.56735873", "0.56735873", "0.56702185", "0.56702185", "0.5669703", "0.5669269", "0.56687385", "0.56684285", "0.56651837", "0.5665086", "0.5662898", "0.56608814", "0.5646785", "0.5646785", "0.5646785", "0.5646785", "0.5643836", "0.5634207", "0.5622779", "0.56211776", "0.5617991", "0.56165844", "0.56129754", "0.5606479" ]
0.7446193
0
GET /registro_videoconferencia/1 GET /registro_videoconferencia/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @registro_videoconferencia = RegistroVideoconferencium.all\n render json: @registro_videoconferencia\n end", "def index\n @videoconferencias = Videoconferencium.all\n render json: @videoconferencias\n end", "def index\n @participante_videoconferencia = ParticipanteVideoconferencium.all\n render json: @participante_videoconferencia\n end", "def new\n @record_video = RecordVideo.new\n @tuantis= Tuanti.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @record_video }\n end\n end", "def create\n @registro_videoconferencium = RegistroVideoconferencium.new(registro_videoconferencium_params)\n\n respond_to do |format|\n if @registro_videoconferencium.save\n format.html { redirect_to @registro_videoconferencium, notice: 'Registro videoconferencium was successfully created.' }\n format.json { render :show, status: :created, location: @registro_videoconferencium }\n else\n format.html { render :new }\n format.json { render json: @registro_videoconferencium.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @kuaibovideo = Kuaibovideo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @kuaibovideo }\n end\n end", "def new\n \n @video = Video.new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def show\n @kuaibovideo = Kuaibovideo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kuaibovideo }\n end\n end", "def show\n @channel = params[:forminfo]\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "def set_registro_videoconferencium\n @registro_videoconferencium = RegistroVideoconferencium.find(params[:id])\n end", "def create\n params[:video][:fecha] = DateTime.strptime(params[:video][:fecha], \"%Y-%m-%d %H:%M:%S UTC\")\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n\t\t\t@v_id = Video.maximum(:id)\n params[:parts].each do |part|\n\t\t\t\tpart[:id_video] = @v_id\n @p = Participante.new(participante_params(part))\n if [email protected]\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n format.html { redirect_to @video, notice: 'El video se ha registrado con éxito en el catálogo.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @video = Video.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def registro_videoconferencium_params\n params.require(:registro_videoconferencium).permit(:estado, :fecha, :hora, :descripcion, :videoconferencia)\n end", "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "def new\n\tif user_type != 'guest' and user_type != 'bunned' and user_type != 'new_user'\n\t\t@video = Video.new\n\t\t\n\t\t@title = 'Новое видео'\n\t\trespond_to do |format|\n\t\t format.html # new.html.erb\n\t\t format.json { render :json => @video }\n\t\tend\n\telse\n\t\tredirect_to '/404'\n\tend\n end", "def show\n @c_video = CVideo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @c_video }\n end\n end", "def show\n render json: @video\n end", "def show\n render json: @video\n end", "def create\n @video = Video.new(video_params)\n @video.save!\n render json: @video\n end", "def create\n @video = Video.new(nicovideo_id: params[:nicovideo_id])\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { redirect_to videos_path , alert: 'Video was not successfully created.' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n\n if @video.save\n format.html {\n flash[:notice] = \"Vídeo criado!.\"\n redirect_to(:action => 'show', :id => @video.id, :palestrante_id => @palestrante.id)\n }\n format.json { \n render action: 'show', :palestrante_id => @palestrante.id, status: :created, location: @video\n }\n else\n format.html {\n @palestrantes = Palestrante.ordenados\n @agendas = Agenda.recentes\n render action: 'new'\n }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @video = current_user.videos.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @channel = params[:forminfo]\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def create\n @video = current_user.videos.new(video_params)\n respond_to do |format|\n if @video.save\n format.html { redirect_to videos_path(), notice: 'Video criado com sucesso.' }\n format.json { render :index, status: :created, location: @video }\n else\n format.html { redirect_to new_video_path(), notice: 'Video não salvo.' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(video_params.merge(:owner => current_user))\n @original = nil\n if (@video.errors[:video_exists])\n @original = Video.where(:external_id => @video.external_id, :type => @video.type).first\n end\n if @video.save\n render :json => @video, :include => ALL_INCLUDES\n else\n render :json => @video.errors, status: :unprocessable_entity\n end\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Vídeo criado com sucesso' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @registro_videoconferencium.destroy\n respond_to do |format|\n format.html { redirect_to registro_videoconferencia_url, notice: 'Registro videoconferencium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def new\n @vocacionada = Vocacionada.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vocacionada }\n end\n end", "def update\n respond_to do |format|\n if @registro_videoconferencium.update(registro_videoconferencium_params)\n format.html { redirect_to @registro_videoconferencium, notice: 'Registro videoconferencium was successfully updated.' }\n format.json { render :show, status: :ok, location: @registro_videoconferencium }\n else\n format.html { render :edit }\n format.json { render json: @registro_videoconferencium.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @video = Video.new\n @scene = Scene.find(params[:scene_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def create\n # Esta solución no es viable con la versión de Dynamoid 0.7.1\n @video = current_user.videos.create(video_params)\n @video.usuario_id = current_user.id\n respond_to do |format|\n if @video.save\n flash[:success] = \"El video ha sido posteado, pasarán unos segundos para ser publicado\"\n format.html { redirect_to current_user }\n format.json { render action: 'show', status: :created, location: @video }\n else\n puts @video.to_s\n format.html { render action: 'new' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @videos = Video.all\n render json: @videos\n end", "def create\n @congratulations_video = CongratulationsVideo.new(congratulations_video_params)\n @congratulations_video.name = @congratulations_video.name.downcase\n @congratulations_video.slug = Digest::MD5.hexdigest @congratulations_video.name\n respond_to do |format|\n if @congratulations_video.save\n format.html { redirect_to @congratulations_video, notice: 'Congratulations video was successfully created.' }\n format.json { render :show, status: :created, location: @congratulations_video }\n else\n format.html { render :new }\n format.json { render json: @congratulations_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\tif user_type != 'guest' and user_type != 'bunned' and user_type != 'new_user'\n\t\tparams[:video][:user_id] = current_user.id\n\t\t@video = Video.new(params[:video])\n\t\trespond_to do |format|\n\t\t if @video.save\n\t\t\tformat.html { redirect_to @video, :notice => 'Видео успешно добавлено' }\n\t\t\tformat.json { render :json => @video, :status => :created, :location => @video }\n\t\t else\n\t\t\tformat.html { render :action => \"new\" }\n\t\t\tformat.json { render :json => @video.errors, :status => :unprocessable_entity }\n\t\t end\n\t\tend\n\telse\n\t\tredirect_to '/404'\n\tend\n end", "def show\n @video = Video.find(params[:id])\n\tif @video != nil\n\t\t@title = @video.alter_name\n\t\t@return_to = video_path(@video)\n\t\t@page_params = {:part_id => 5,:page_id => 1,:entity_id => @video.id}\n\t\t@path_array = [\n\t\t\t\t\t\t{:name => 'Видео', :link => videos_path},\n\t\t\t\t\t\t{:name => @video.category_name, :link => videos_path(:c => @video.category_path)},\n\t\t\t\t\t\t{:name => @video.alter_name, :link => '/'}\n\t\t\t\t\t ]\n\t\t@comments = @video.messages.where(:status_id => 1).order('created_at ASC')\n\t\trespond_to do |format|\n\t\t format.html # show.html.erb\n\t\t format.json { render :json => @video }\n\t\tend\n\tend\n end", "def show\n @video = Video.find(params[:id])\n @question = VideoQuestion.new\n @answer = VideoAnswer.new\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "def show\n @veditor = Veditor.find(params[:vid])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @veditor }\n end\n end", "def create\n @participante_videoconferencium = ParticipanteVideoconferencium.new(participante_videoconferencium_params)\n\n respond_to do |format|\n if @participante_videoconferencium.save\n format.html { redirect_to @participante_videoconferencium, notice: 'Participante videoconferencium was successfully created.' }\n format.json { render :show, status: :created, location: @participante_videoconferencium }\n else\n format.html { render :new }\n format.json { render json: @participante_videoconferencium.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n #@videos = Video.where(:curriculum_id => params[:curriculum_id]))\n @video = Video.new(video_params)\n @video.curriculum_id = params[:curriculum_id]\n @curric = Curriculum.find(params[:curriculum_id])\n respond_to do |format|\n if @video.save\n format.html { redirect_to @curric, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n format.js\n\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n \n end", "def show\n @registro_bovino = RegistroBovino.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @registro_bovino }\n end\n end", "def videoconferencium_params\n params.require(:videoconferencium).permit(:fecha, :hora, :unidad, :estado, :tipo, :nro_causa, :motivo, :solicitante)\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video.as_json }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n #@videos = Video.all\n Video.delete_database_and_files_on_server\n @video = Video.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end", "def create\n @video = Video.where(video_params).first\n #@profesor_selected = @video.personas.first.id\n @profesor_selected = params[:profesor_id]\n saved = @video.save\n puts 'entro cuando cargue un video'\n if saved\n pipeline_id = '1439848270326-bs22oc'\n input_key = URI(@video.attach.url).path\n input_key = input_key[1..input_key.length]\n region = 'us-west-1'\n transcoder_client = AWS::ElasticTranscoder::Client.new(region: region)\n Funciones.get_options pipeline_id, input_key\n job = transcoder_client.create_job(options)\n job_id = job[:job][:id]\n @video.transcoder_job_id = job_id\n @video.save\n p job\n end\n respond_to do |format|\n if saved\n generar_evaluaciones(@video.profesor.id, @video.id)\n format.html { redirect_to video_path(@video.id), notice: 'Video fue creado con éxito.' }\n format.json { render :show, status: :created, location: @video }\n else\n #format.html { render :new }\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @observacao_vocacionada = ObservacaoVocacionada.new\n\n if params[:vocacionada]\n @observacao_vocacionada.vocacionada_id = params[:vocacionada]\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @observacao_vocacionada }\n end\n end", "def video\n YouTubeApi.find_video(youtube_id)\n end", "def show_video\n\t\t@video = OldFlashFile.find(params[:id]) \n\t\tif @video\n\t\t@[email protected]\n\t\telse\n\t\t@status = {\"status-msg\"=>\"Video not exist\"}\n\t\tend\n\n render :json =>@status.to_json\n\t\tend", "def new\n @video = Video.new\n respond_with(@video)\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to home_admin_path, notice: '视频创建成功!' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @videos = @palestrante.videos.mais_novos\n end", "def index\n @congratulations_videos = CongratulationsVideo.all\n end", "def getVideoFromPolylineAS\n\t\t\n\t\tif !params[:poly_id]\n\t\t\trender :text => \"Failed. (Parameters set improperly)\"\n\t\t\treturn false\n\t\tend\n\t\t\n\t\tspeed = Syncronisation.find_by_sql([\"select time, distance from syncronisations where route_id in (select id from routes where polyline_id = ?) order by time\", params[:poly_id]])\n\t\troute = Route.find(:first, :conditions => [ \"polyline_id = ?\", params[:poly_id] ]);\n\t\t\n\t\trender :json => {:video_id => route.video_id, :sync => speed}.to_json\n\tend", "def getVideoFromPolylineAS\n\t\t\n\t\tif !params[:poly_id]\n\t\t\trender :text => \"Failed. (Parameters set improperly)\"\n\t\t\treturn false\n\t\tend\n\t\t\n\t\tspeed = Syncronisation.find_by_sql([\"select time, distance from syncronisations where route_id in (select id from routes where polyline_id = ?) order by time\", params[:poly_id]])\n\t\troute = Route.find(:first, :conditions => [ \"polyline_id = ?\", params[:poly_id] ]);\n\t\t\n\t\trender :json => {:video_id => route.video_id, :sync => speed}.to_json\n\tend", "def show\n @video = Video.find(params[:id])\n respond_with(@video)\n end", "def new\n @video = Video.new\n @video.duration = 60\n @video.width = 1280\n @video.height = 720\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def show\n @observacao_vocacionada = ObservacaoVocacionada.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @observacao_vocacionada }\n end\n end", "def new\n @registro_bovino = RegistroBovino.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @registro_bovino }\n end\n end", "def create\n @video = Video.new(video_params)\n @video.uuid = params[:videohelpsubmission][:video_uuid]\n @video.token = SecureRandom.hex\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def video_params\n params[:video]\n end", "def video_params\n params[:video]\n end", "def video_params\n params[:video]\n end", "def show\n @video = Video.find(params[:id])\n\n @networks = @video.networks\n\n @impressions = @video.impressions\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "def show\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json {\n\t\t\t\tjson_text = @youtube_video.json\n\n\t\t\t\turl = if request.domain == 'localhost'\n\t\t\t\t\trequest.protocol + request.host_with_port\n\t\t\t\telse\n\t\t\t\t\trequest.protocol + request.host\n\t\t\t\tend\n\n\t\t\t\tjson_text['thumbnail_url'] = @youtube_video.thumbnail.present? ? URI::escape(url + @youtube_video.thumbnail.url(:original), '[]') : ''\n json_text[\"video_full_path\"] = @youtube_video.blended_video.present? && @youtube_video.blended_video.file.present? ? URI::escape(url + @youtube_video.blended_video.file.url(:original), '[]') : \"\"\n\t\t\t\trender :json => json_text.to_json\n\t\t\t}\n\t\tend\n\tend", "def medio_video_params\n params.require(:medio_video).permit(:url, :fecha)\n end", "def index\n @videos = Video.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end", "def index\n @videos = Video.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end", "def index\n @videos = Video.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end", "def index\n @videos = Video.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end", "def index\n @videos = Video.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end", "def new\n @video_game = VideoGame.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video_game }\n end\n end", "def create\n @videoo = Videoo.new(videoo_params)\n\n respond_to do |format|\n if @videoo.save\n format.html { redirect_to @videoo, notice: 'Videoo was successfully created.' }\n format.json { render :show, status: :created, location: @videoo }\n else\n format.html { render :new }\n format.json { render json: @videoo.errors, status: :unprocessable_entity }\n end\n end\n end", "def list\n @videos = Video.all\n\n respond_to do |format|\n format.html # list.html.erb\n format.json { render json: @videos }\n end\n end", "def show\n @record_video = RecordVideo.find(params[:id])\n @hot_contents = RecordVideo.all\n @newest_contents = RecordVideo.all\n @recomand_contents = RecordVideo.all\n @hot_title=\"热门广场舞视频\"\n @newest_title=\"最新广场舞视频\"\n @recomand_title=\"推荐广场舞视频\"\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @record_video }\n end\n end", "def create\n @video = Video.new(params[:video])\n @licenses = License.all\n @galleries = Gallery.all\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @c_video = CVideo.new\n\t@client_choice = Client.find(:all, :order => \"C_LName\").collect do |d| [d.C_LName + \", \" + d.C_FName, d.id] end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @c_video }\n end\n end", "def new\r\n @video = Video.new\r\n\r\n respond_to do |format|\r\n format.html { render :layout => false } # new.html.erb\r\n format.json { render json: @video }\r\n end\r\n end", "def show\n @ventas_seguimiento = Ventas::Seguimiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ventas_seguimiento }\n end\n end", "def video\n\t\tif params[:category_id]==\"all\"\n\t\t@search=OldFlashFile.all\n\t\t\t\tif [email protected]?\n\t\t\t\t@status= @search.map{|f| {:title =>f.title, :imageUrl=>request.protocol+request.host_with_port+f.preview_image.url(:small), :videoUrl=>(f.video.content_type==\"video/x-flv\") ? \"#{request.protocol+request.host_with_port+f.video.url}\".gsub(\".flv\", \".mp4\") : \"#{request.protocol+request.host_with_port+f.video.url}\" ,:videotype=>f.video.content_type}}\n\t\t\t\telse\n\t\t\t\t@status=nil \n\t\t\t\tend\n\n\t\telse\n\t\targs={:search=>{:filter=>params[:filter],:category_id=>params[:category_id]}}\n\n\t\t@search = ContentSearch.new(args) \n\t\t@results = Kaminari.paginate_array( @search.results )\n\t\t@total = @search.total\n\n\t\t\tif [email protected]?\n\t\t\t@status= @results.map{|f| {:title =>f.title, :imageUrl=>request.protocol+request.host_with_port+f.preview_image.url(:small), :videoUrl=>(f.video.content_type==\"video/x-flv\") ? \"#{request.protocol+request.host_with_port+f.video.url}\".gsub(\".flv\", \".mp4\") : \"#{request.protocol+request.host_with_port+f.video.url}\",:videotype=>f.video.content_type}}\n\n\t\t\telse\n\t\t\t@status=nil \n\t\t\tend\n\t\tend\n\n\t\trender :json =>@status.to_json\n\t\tend", "def show\n @video = Video.new\n @competition_videos = Competition.find(params[:id]).videos\n #@competition_videos = Competition.find(params[:id]).videos.order(created_at: :desc).paginate(page: params[:page],per_page:50)\n end", "def resources\n videos\n end", "def new\n @user_video = current_user.user_videos.new\n @weekly_tunes = WeeklyTune.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_video }\n end\n end", "def create\n @demanda_videomonitoramento = DemandaVideomonitoramento.new(demanda_videomonitoramento_params)\n\n respond_to do |format|\n if @demanda_videomonitoramento.save\n format.html { redirect_to @demanda_videomonitoramento, notice: 'Demanda videomonitoramento was successfully created.' }\n format.json { render action: 'show', status: :created, location: @demanda_videomonitoramento }\n else\n format.html { render action: 'new' }\n format.json { render json: @demanda_videomonitoramento.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @adm_video = Adm::Video.new(adm_video_params)\n\n respond_to do |format|\n #@adm_video[:codigo]=parse_youtube(params[:adm_video][:codigo])\n\n if @adm_video.save\n # format.html { redirect_to @adm_video, notice: t('videos.create_success') }\n # format.json { render :show, status: :created, location: @adm_video }\n flash[:notice] = t('videos.create_success')\n respond_with(@adm_video)\n else\n # format.html { render :new }\n # format.json { render json: @adm_video.errors, status: :unprocessable_entity }\n\n respond_with(@adm_video)\n\n end\n end\n end", "def new\n\n @project = Project.user_readable(current_user, params[:project_id])\n\n if @project\n\n @video = @project.videos.new\n @video.set_defaults\n @aws_signature_url = root_url + \"signatures/aws_uploads\"\n\n respond_to do |format|\n format.html\n format.json { render :json => {:video_id => @video.id, :aws_videos_path => @video.videos_path}, :status => :ok }\n end\n\n else\n not_authorized\n end\n\n end" ]
[ "0.7591745", "0.7213528", "0.71278024", "0.65936935", "0.6518876", "0.647241", "0.6432397", "0.6425373", "0.6362164", "0.63570774", "0.63390714", "0.6334977", "0.63314843", "0.63314843", "0.63314843", "0.63314843", "0.63314843", "0.63314843", "0.63314843", "0.63314843", "0.63314843", "0.63314843", "0.6330329", "0.63004446", "0.6287955", "0.6287955", "0.6287955", "0.6287955", "0.6287955", "0.6287955", "0.6287955", "0.6249706", "0.6214359", "0.62133306", "0.61958903", "0.6156464", "0.61293125", "0.6128444", "0.6063033", "0.6049638", "0.6042784", "0.6042524", "0.6040455", "0.6018143", "0.60143334", "0.5993774", "0.597313", "0.5967118", "0.5962907", "0.59459895", "0.59411114", "0.5940666", "0.59237546", "0.5918435", "0.5912928", "0.59101474", "0.5897997", "0.5887435", "0.5879217", "0.5856454", "0.5849618", "0.584905", "0.5847558", "0.5843954", "0.58277845", "0.5819225", "0.58159155", "0.58066785", "0.5803806", "0.5803806", "0.57983136", "0.5796258", "0.5794425", "0.5786614", "0.57796866", "0.5774552", "0.5774552", "0.5774552", "0.5772605", "0.5766733", "0.5761251", "0.57577616", "0.57566345", "0.57566345", "0.57566345", "0.57566345", "0.5748411", "0.5742589", "0.5741398", "0.5737186", "0.5731721", "0.57295495", "0.57287246", "0.57241386", "0.5721449", "0.5711406", "0.5711071", "0.5710492", "0.5709475", "0.5708335", "0.57031566" ]
0.0
-1
POST /registro_videoconferencia POST /registro_videoconferencia.json
def create @registro_videoconferencium = RegistroVideoconferencium.new(registro_videoconferencium_params) respond_to do |format| if @registro_videoconferencium.save format.html { redirect_to @registro_videoconferencium, notice: 'Registro videoconferencium was successfully created.' } format.json { render :show, status: :created, location: @registro_videoconferencium } else format.html { render :new } format.json { render json: @registro_videoconferencium.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def registro_videoconferencium_params\n params.require(:registro_videoconferencium).permit(:estado, :fecha, :hora, :descripcion, :videoconferencia)\n end", "def create\n params[:video][:fecha] = DateTime.strptime(params[:video][:fecha], \"%Y-%m-%d %H:%M:%S UTC\")\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n\t\t\t@v_id = Video.maximum(:id)\n params[:parts].each do |part|\n\t\t\t\tpart[:id_video] = @v_id\n @p = Participante.new(participante_params(part))\n if [email protected]\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n format.html { redirect_to @video, notice: 'El video se ha registrado con éxito en el catálogo.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @participante_videoconferencium = ParticipanteVideoconferencium.new(participante_videoconferencium_params)\n\n respond_to do |format|\n if @participante_videoconferencium.save\n format.html { redirect_to @participante_videoconferencium, notice: 'Participante videoconferencium was successfully created.' }\n format.json { render :show, status: :created, location: @participante_videoconferencium }\n else\n format.html { render :new }\n format.json { render json: @participante_videoconferencium.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.where(video_params).first\n #@profesor_selected = @video.personas.first.id\n @profesor_selected = params[:profesor_id]\n saved = @video.save\n puts 'entro cuando cargue un video'\n if saved\n pipeline_id = '1439848270326-bs22oc'\n input_key = URI(@video.attach.url).path\n input_key = input_key[1..input_key.length]\n region = 'us-west-1'\n transcoder_client = AWS::ElasticTranscoder::Client.new(region: region)\n Funciones.get_options pipeline_id, input_key\n job = transcoder_client.create_job(options)\n job_id = job[:job][:id]\n @video.transcoder_job_id = job_id\n @video.save\n p job\n end\n respond_to do |format|\n if saved\n generar_evaluaciones(@video.profesor.id, @video.id)\n format.html { redirect_to video_path(@video.id), notice: 'Video fue creado con éxito.' }\n format.json { render :show, status: :created, location: @video }\n else\n #format.html { render :new }\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(nicovideo_id: params[:nicovideo_id])\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { redirect_to videos_path , alert: 'Video was not successfully created.' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Vídeo criado com sucesso' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def videoconferencium_params\n params.require(:videoconferencium).permit(:fecha, :hora, :unidad, :estado, :tipo, :nro_causa, :motivo, :solicitante)\n end", "def create\n @video = Video.new(video_params)\n @video.save!\n render json: @video\n end", "def create\n @video = Video.new(video_params)\n @video.uuid = params[:videohelpsubmission][:video_uuid]\n @video.token = SecureRandom.hex\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @congratulations_video = CongratulationsVideo.new(congratulations_video_params)\n @congratulations_video.name = @congratulations_video.name.downcase\n @congratulations_video.slug = Digest::MD5.hexdigest @congratulations_video.name\n respond_to do |format|\n if @congratulations_video.save\n format.html { redirect_to @congratulations_video, notice: 'Congratulations video was successfully created.' }\n format.json { render :show, status: :created, location: @congratulations_video }\n else\n format.html { render :new }\n format.json { render json: @congratulations_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\tif user_type != 'guest' and user_type != 'bunned' and user_type != 'new_user'\n\t\tparams[:video][:user_id] = current_user.id\n\t\t@video = Video.new(params[:video])\n\t\trespond_to do |format|\n\t\t if @video.save\n\t\t\tformat.html { redirect_to @video, :notice => 'Видео успешно добавлено' }\n\t\t\tformat.json { render :json => @video, :status => :created, :location => @video }\n\t\t else\n\t\t\tformat.html { render :action => \"new\" }\n\t\t\tformat.json { render :json => @video.errors, :status => :unprocessable_entity }\n\t\t end\n\t\tend\n\telse\n\t\tredirect_to '/404'\n\tend\n end", "def create\n # Esta solución no es viable con la versión de Dynamoid 0.7.1\n @video = current_user.videos.create(video_params)\n @video.usuario_id = current_user.id\n respond_to do |format|\n if @video.save\n flash[:success] = \"El video ha sido posteado, pasarán unos segundos para ser publicado\"\n format.html { redirect_to current_user }\n format.json { render action: 'show', status: :created, location: @video }\n else\n puts @video.to_s\n format.html { render action: 'new' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n\n if @video.save\n format.html {\n flash[:notice] = \"Vídeo criado!.\"\n redirect_to(:action => 'show', :id => @video.id, :palestrante_id => @palestrante.id)\n }\n format.json { \n render action: 'show', :palestrante_id => @palestrante.id, status: :created, location: @video\n }\n else\n format.html {\n @palestrantes = Palestrante.ordenados\n @agendas = Agenda.recentes\n render action: 'new'\n }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video.as_json }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @videoconferencium = Videoconferencium.new(videoconferencium_params)\n\n respond_to do |format|\n if @videoconferencium.save\n format.html { redirect_to @videoconferencium, notice: 'Videoconferencium was successfully created.' }\n format.json { render :show, status: :created, location: @videoconferencium }\n else\n format.html { render :new }\n format.json { render json: @videoconferencium.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = current_user.videos.new(video_params)\n respond_to do |format|\n if @video.save\n format.html { redirect_to videos_path(), notice: 'Video criado com sucesso.' }\n format.json { render :index, status: :created, location: @video }\n else\n format.html { redirect_to new_video_path(), notice: 'Video não salvo.' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def video_params\n params.require(:video).permit(:attach, :profesor_id, :observador_id)\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to home_admin_path, notice: '视频创建成功!' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n #@videos = Video.where(:curriculum_id => params[:curriculum_id]))\n @video = Video.new(video_params)\n @video.curriculum_id = params[:curriculum_id]\n @curric = Curriculum.find(params[:curriculum_id])\n respond_to do |format|\n if @video.save\n format.html { redirect_to @curric, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n format.js\n\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n \n end", "def create\n \n #@video = params\n params[:video]['price'] = '0.00';\n params[:video]['is_active'] = '1';\n #params[:video]['lesson_upload'] = 'no_image';\n #params[:video]['lesson_upload_file_name'] = 'no_image';\n #params[:video]['lesson_upload_content_type'] = 'no_image';\n #params[:video]['lesson_upload_file_size'] = '0';\n \n \n \n @video = current_user.videos.build(params[:video])\n respond_to do |format|\n if @video.save\n #@video.convert\n VideoMailer.video_confirmation(@video).deliver\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n else\n format.html { render action: \"new\" }\n format.js\n end\n end\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_registro_videoconferencium\n @registro_videoconferencium = RegistroVideoconferencium.find(params[:id])\n end", "def create\n @video = Video.new(params[:video])\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(params[:video])\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(params[:video])\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(params[:video])\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = @room.videos.new(video_params)\n respond_to do |format|\n if @video.save\n format.html { redirect_to upload_video_path(@video), notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @adm_video = Adm::Video.new(adm_video_params)\n\n respond_to do |format|\n #@adm_video[:codigo]=parse_youtube(params[:adm_video][:codigo])\n\n if @adm_video.save\n # format.html { redirect_to @adm_video, notice: t('videos.create_success') }\n # format.json { render :show, status: :created, location: @adm_video }\n flash[:notice] = t('videos.create_success')\n respond_with(@adm_video)\n else\n # format.html { render :new }\n # format.json { render json: @adm_video.errors, status: :unprocessable_entity }\n\n respond_with(@adm_video)\n\n end\n end\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render action: 'show', status: :created, location: @video }\n else\n format.html { render action: 'new' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render action: 'show', status: :created, location: @video }\n else\n format.html { render action: 'new' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to root_url, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def congratulations_video_params\n params.require(:congratulations_video).permit(:name, :file, :cover, :slug)\n end", "def update\n respond_to do |format|\n if @registro_videoconferencium.update(registro_videoconferencium_params)\n format.html { redirect_to @registro_videoconferencium, notice: 'Registro videoconferencium was successfully updated.' }\n format.json { render :show, status: :ok, location: @registro_videoconferencium }\n else\n format.html { render :edit }\n format.json { render json: @registro_videoconferencium.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @demanda_videomonitoramento = DemandaVideomonitoramento.new(demanda_videomonitoramento_params)\n\n respond_to do |format|\n if @demanda_videomonitoramento.save\n format.html { redirect_to @demanda_videomonitoramento, notice: 'Demanda videomonitoramento was successfully created.' }\n format.json { render action: 'show', status: :created, location: @demanda_videomonitoramento }\n else\n format.html { render action: 'new' }\n format.json { render json: @demanda_videomonitoramento.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @medio_video = MedioVideo.new(medio_video_params)\n\n respond_to do |format|\n if @medio_video.save\n format.html { redirect_to @medio_video, notice: 'Medio video was successfully created.' }\n format.json { render :show, status: :created, location: @medio_video }\n else\n format.html { render :new }\n format.json { render json: @medio_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @traditional_route_video = TraditionalRouteVideo.new(traditional_route_video_params)\n\n respond_to do |format|\n if @traditional_route_video.save\n format.html { redirect_to @traditional_route_video, notice: 'Traditional route video was successfully created.' }\n format.json { render :show, status: :created, location: @traditional_route_video }\n else\n format.html { render :new }\n format.json { render json: @traditional_route_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def medio_video_params\n params.require(:medio_video).permit(:url, :fecha)\n end", "def create\n Video.transaction do\n @video = Video.new video_params\n # @video.data = { data: params[:video][:data] }\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end\n # byebug\n\n end", "def create\n @c_video = CVideo.new(params[:c_video])\n\n respond_to do |format|\n if @c_video.save\n format.html { redirect_to @c_video, notice: 'A new video was successfully created.' }\n format.json { render json: @c_video, status: :created, location: @c_video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @c_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @album = Album.find(params[:album_id])\n @video = @album.videos.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @album, notice: 'Video creado satisfactoriamente.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @table_video = TableVideo.new(table_video_params)\n\n respond_to do |format|\n if @table_video.save\n format.html { redirect_to @table_video, notice: 'Table video was successfully created.' }\n format.json { render :show, status: :created, location: @table_video }\n else\n format.html { render :new }\n format.json { render json: @table_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @saved_video = SavedVideo.new(saved_video_params)\n\n respond_to do |format|\n if @saved_video.save\n format.html { redirect_to @saved_video, notice: 'Saved video was successfully created.' }\n format.json { render :show, status: :created, location: @saved_video }\n else\n format.html { render :new }\n format.json { render json: @saved_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def video_params\n params.require(:video).permit(:titulo, :palestrante_id, :agenda_id, :descricao, :source, :youtube, :published, :tags, :podcast_stream_url, :podcast_duration)\n end", "def create\n\n @video = Video.new(video_params)\n file = @video.video.tempfile\n\n video = Panda::Video.create(:file => file)\n # binding.pry\n video.encodings['h264'].reload\n\n until video.encodings['h264'].status == 'success'\n video.encodings['h264'].reload\n end\n\n video.encodings['h264'].encoding_progress\n @video.video = video.encodings['h264'].url\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def participante_videoconferencium_params\n params.require(:participante_videoconferencium).permit(:tipo_participante, :apellido, :nombres, :email)\n end", "def create\n @videoo = Videoo.new(videoo_params)\n\n respond_to do |format|\n if @videoo.save\n format.html { redirect_to @videoo, notice: 'Videoo was successfully created.' }\n format.json { render :show, status: :created, location: @videoo }\n else\n format.html { render :new }\n format.json { render json: @videoo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(video_params)\n respond_to do |format|\n if secure_save(@video)\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def video_params\n params.require(:video).permit(:nombre, :mensaje, :attach, :attach_file_name)\n end", "def video_params\n params.require(:video).permit(:titulo,:fecha,:liga,:tipo,:curso,:thumbnail)\n end", "def create\n @video = Video.new(video_params.merge(:owner => current_user))\n @original = nil\n if (@video.errors[:video_exists])\n @original = Video.where(:external_id => @video.external_id, :type => @video.type).first\n end\n if @video.save\n render :json => @video, :include => ALL_INCLUDES\n else\n render :json => @video.errors, status: :unprocessable_entity\n end\n end", "def create\n @user_video = current_user.user_videos.new(params[:user_video])\n\n respond_to do |format|\n if @user_video.save\n format.html { redirect_to @user_video, notice: 'Video was successfully created.' }\n format.json { render json: @user_video, status: :created, location: @user_video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @empresa = Empresa.find(params[:empresa_id]) \n @producto = @empresa.productos.find(params[:producto_id])\n @item_producto = @producto.item_productos.find(params[:item_producto_id])\n @videos_producto = @item_producto.videos_productos.create(videos_productosparams)\n respond_to do |format|\n if @videos_producto.save\n format.html { redirect_to empresa_producto_item_producto_videos_productos_path(@empresa,@producto,@item_producto,@videos_producto), notice: 'Videos producto was successfully created.' }\n format.json { render :show, status: :created, location: @videos_producto }\n else\n format.html { render :new }\n format.json { render json: @videos_producto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @sales_video = Sales::Video.new(sales_video_params)\n\n respond_to do |format|\n if @sales_video.save\n format.html { redirect_to sales_seller_course_video_path(@seller, @course, @sales_video), notice: \"Video foi criado com sucesso.\" }\n format.json { render :show, status: :created, location: @sales_video }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @sales_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n get_theme\n # @broadcaster_video = Broadcaster::Video.new(broadcaster_video_params)\n\n @broadcaster_video = Broadcaster::Video.new(broadcaster_video_params)\n @broadcaster_video.broadcaster_theme = @theme\n\n\n respond_to do |format|\n if @broadcaster_video.save\n format.html { redirect_to @broadcaster_video, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @broadcaster_video }\n else\n format.html { render :new }\n format.json { render json: @broadcaster_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(params[:video])\n @licenses = License.all\n @galleries = Gallery.all\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @registro_videoconferencia = RegistroVideoconferencium.all\n render json: @registro_videoconferencia\n end", "def create\n @college_video = CollegeVideo.new(college_video_params)\n\n respond_to do |format|\n if @college_video.save\n format.html { redirect_to @college_video, notice: 'College video was successfully created.' }\n format.json { render :show, status: :created, location: @college_video }\n else\n format.html { render :new }\n format.json { render json: @college_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n token = token_from_link params[:video][:token]\n\n gdata = Youtube.new token\n\n @video = Video.new(params[:video]) do |v|\n v.user = current_user\n v.token = token\n v.name = gdata.title if v.name.blank?\n\n v.yt_title = gdata.title\n v.yt_thumb = gdata.thumb\n v.yt_rating = gdata.rating_100\n v.yt_view_count = gdata.view_count\n v.yt_favorite_count = gdata.favorite_count\n v.yt_published = gdata.published\n end\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n @publication = Publication.create(:content => @video.content + @video.name + @video.description + @video.tag_list.join(' '), :published_id => @video.id, :published_type => 'Video')\n format.html { redirect_to videos_path, notice: 'El video fue creada correctamente.' }\n format.json { render action: 'list', status: :created, location: @video }\n else\n format.html { render action: 'new' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(video_params.merge({ project_id: @project.id }))\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to action: 'show', controller: 'videos', project_id: @project.id, id: @video.id, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def jeux_video_params\n params.require(:jeux_video).permit(:title, :body, :commentaire, :nb_joueur, :server, :champion)\n end", "def create\n @video_upload = VideoUpload.new\n @video_upload.save!\n @video_upload.prepare!\n\n render json: @video_upload, status: :created, location: @video_upload\n end", "def create\n @video = Video.new(video_params)\n @video.added_by=current_user.id\n respond_to do |format|\n if @video.save\n @video.add_labels(params[:Label])\n format.html { redirect_to media_videos_path}\n format.json { render :show, status: :created, location: [:media, @video] }\n format.js {}\n else\n format.html { render :new }\n format.json { render json: [:media, @video.errors], status: :unprocessable_entity }\n end\n end\n end", "def process_video(options = {})\n vzaar_video_id = nil\n request_xml = %{\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <vzaar-api>\n <video>\n <guid>#{options[:guid]}</guid>\n <title>#{options[:title]}</title>\n <description>#{options[:description]}</description>\n <profile>#{options[:profile]}</profile>\n }\n if !options[:transcoding].nil?\n request_xml += %{\n <transcoding>#{options[:transcoding]}</transcoding>\n }\n end\n request_xml += %{ \n </video>\n </vzaar-api>\n }\n auth_connection HTTP_POST, '/api/videos', request_xml do |response_body|\n vzaar_video_id = get_video_id_from_response_body(response_body)\n end\n vzaar_video_id\n end", "def create\n @channel = params[:forminfo]\n @video = Video.new(params[:video])\n video_file = params[:video_file]\n img_file = params[:img_file]\n @video.video_type = params[:video_type]\n @video.video_id = Utils.videoid\n\n if video_file != nil\n @video.video_url = \"http://#{Constants::UPLOAD_IP}/files/videos/\"+Utils.upload(video_file, videoid)\n end\n\n if img_file != nil\n @video.video_img =\"http://#{Constants::UPLOAD_IP}/files/images/\"+Utils.upload(img_file, nil)\n end\n @video.cid = @channel\n respond_to do |format|\n if @video.save\n format.html { redirect_to channel_videos_path }\n else\n format.html { render action: \"new\" }\n end\n end\n end", "def create\n\n @video_object = params[:video][:video_file] \n @video = Video.new(video_params)\n @video.competition = @competition \n @video.video_original_filename = @video_object.original_filename.to_s\n @video.video_content_type = @video_object.content_type.to_s\n\n respond_to do |format|\n if @video.save\n upload_file(@video.id, @video_object, \"original-videos\")\n send_msg_to_queue(@video.id.to_s)\n format.html { redirect_to @video.competition, success: 'Hemos recibido tu video y lo estamos procesando para que sea publicado. Tan pronto el video quede publicado en la página del concurso te notificaremos por email. Gracias.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = @user.videos.build(video_params)\n respond_to do |format|\n if @video.save\n format.html { redirect_to user_videos_path(@user), notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: user_videos_path(@user) }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(video_params)\n puts @video\n puts \"**********************************\"\n if @video.save\n flash[:success] = 'Video added!'\n redirect_to '/videos'\n else\n render :new\n end\n end", "def create\n @game_video = GameVideo.new(game_video_params)\n\n respond_to do |format|\n if @game_video.save\n format.html { redirect_to @game_video, notice: 'Game video was successfully created.' }\n format.json { render :show, status: :created, location: @game_video }\n else\n format.html { render :new }\n format.json { render json: @game_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @record_video = RecordVideo.new(params[:record_video])\n\n respond_to do |format|\n if @record_video.save\n format.html { redirect_to @record_video, notice: 'Record video was successfully created.' }\n format.json { render json: @record_video, status: :created, location: @record_video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @record_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @admin_video = Admin::Video.new(admin_video_params)\n authorize! :create, @admin_video\n\n respond_to do |format|\n if @admin_video.save\n format.html { redirect_to @admin_video, notice: 'Video was successfully created.' }\n format.json { render action: 'show', status: :created, location: @admin_video }\n else\n format.html { render action: 'new' }\n format.json { render json: @admin_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n @video = Video.new(params[:video])\n @video.resource_id = @resource.id\n \n @video.video = @video.video.gsub(\"https://\", \"\")\n @video.video = @video.video.gsub(\"http://\", \"\")\n @video.video = @video.video.gsub(\"www.youtube.com/watch?v=\", \"\")\n\n @resource.attachment = @video\n @resource.save\n \n @video.save\n\n respond_to do |format|\n if @video.update_attributes(params[:text]) && @resource.update_attributes(params[:resource])\n format.js\n end\n end \n end", "def create \n # binding.pry\n\n video = Video.new(video_params)\n if video.save\n render json: video, status: :created, location: @video\n else\n render json: {error: \"error This did not save my bro!\"}\n console.log(\"error This did not save my bro!\")\n end\n #render json: videos.to_json(:include => :rapper)\n\n end", "def adm_video_params\n params.require(:adm_video).permit(:titulo, :url_codigo)\n end", "def videos_productosparams\n params.require(:videos_producto).permit(:titulo, :descripcion, :url)\n end", "def video_params\n params.require(:video).permit(:name_autor, :last_name_autor, :email_autor, :comment, :state, :url_converted_video)\n end", "def destroy\n @registro_videoconferencium.destroy\n respond_to do |format|\n format.html { redirect_to registro_videoconferencia_url, notice: 'Registro videoconferencium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def create\n @video = Video.new(video_params)\n @video.board_id = @board.id\n\n urlVideo = VideoInfo.new(@video.source)\n\n\n @video.iFrame_Source = urlVideo.embed_code\n @video.title = urlVideo.title\n @video.date = urlVideo.date\n @video.provider = urlVideo.provider\n @video.description = urlVideo.description\n @video.smaller_thumbnail = urlVideo.thumbnail_small\n @video.larger_thumbnail = urlVideo.thumbnail_large\n\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to board_video_path(@board, @video), notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n cantidad_evaluaciones = Evaluacion.where(video_id: params[:id]).count\n if cantidad_evaluaciones != 0\n render json: [\"El video ya está siendo evaluado!\"], status: :unprocessable_entity and return\n end\n \n delete_key = @video.attach_file_name\n @video.transcoder_job_id = nil\n @video.conversion_status = nil\n @video.identidad_verificada = nil\n @video.save\n saved = @video.update_attributes(video_params)\n puts \"VIDEO PARAMS\"\n puts video_params\n puts \"##############################################################################\"\n @video.errors.inspect\n puts \"##############################################################################\"\n respond_to do |format|\n if saved\n\n Video.initiate_video_conversion @video, !delete_key.blank?\n \n if @video.conversion_status == \"COMPLETED\"\n flash.notice = 'El video fue subido correctamente.'\n end\n if @video.conversion_status == \"ERROR\"\n flash.alert = 'Hubo un error al procesar el video.'\n end\n if current_persona.rol.rol == \"Profesor\"\n\n format.json { render json: { url: profesor_panel_path}, status: :ok }\n end\n if current_persona.rol.rol == \"Camarógrafo\"\n format.json { render json: { url: observador_path}, status: :ok }\n end\n else\n #format.html { render :new }\n @video.intentos = @video.intentos + 1\n @video.save(validate: false)\n #format.html { redirect_to new_video_path(profesor_id: @video.profesor_id), alert: 'Debe seleccionar un archivo' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n #render json: { error: @video.errors.full_messages.join(',')}, :status => 400\n end\n end\n end", "def create\n @video = Video.new(params[:video])\n @scene = Scene.find(params[:video][:scene_id])\n\n @video.scene = @scene\n @video.user = current_user\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if current_user.permission.can_post_video?\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'You can not post videos.' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(params[:video])\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to(@video, :notice => 'Video was successfully created.') }\n format.xml { render :xml => @video, :status => :created, :location => @video }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @video.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @video = Video.new(params[:video])\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to(@video, :notice => 'Video was successfully created.') }\n format.xml { render :xml => @video, :status => :created, :location => @video }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @video.errors, :status => :unprocessable_entity }\n end\n end\n end", "def video_params\n \n params.require(:video).permit(:titulo, :url)\n \n end", "def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to video_show_path(@video.category, @video), notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: video_show_path(@video.category, @video) }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n # This comment part specifies how to perform server side uploading\n # http://cloudinary.com/documentation/rails_video_upload#rails_video_upload_examples\n # http://cloudinary.com/documentation/upload_videos\n # http://cloudinary.com/documentation/video_management\n # http://cloudinary.com/documentation/rails_video_manipulation\n \n # video_public_id = \"video_#{SecureRandom.urlsafe_base64}\"\n # response = Cloudinary::Uploader.upload(params[:video][:target_file], :resource_type => :video, :public_id => video_public_id)\n # Cloudinary::Uploader.upload_large(params[:video][:target_file], :resource_type => :video, :public_id => \"my_folder/my_sub_folder/myvideo1\", :eager => [{:width => 300, :height => 300, :crop => :pad}], :eager_async => true, :eager_notification_url => \"http://c45a1454.ngrok.io/videos/transform_notification\")\n begin\n @active_page = \"videos\"\n if params[:id].blank?\n @video = Video.new(video_params)\n else\n @video = Video.find(params[:id])\n @video.update_attributes(video_params)\n end\n @video.save\n rescue Exception => e\n log_error(e, \"Error occured in Create action of VideosController\")\n flash_error(t('videos.create_page_error'))\n ensure\n redirect_to \"/videos\"\n end\n end", "def create\n @video = Video.new(video_params)\n @video.update(user_id: current_user.id)\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully uploaded.' }\n format.json {\n render json: { files: [@video.to_jq_upload], url: video_path(@video), message: \"Uploaded successfully.\" }, status: :created, location: @video\n }\n else\n format.html { render :new }\n end\n end\n end", "def create\n\n\n @project = Project.user_readable(current_user, params[:project_id])\n\n if @project\n\n @video = @project.videos.new(params[:project_video])\n\n if @video.save\n respond_to do |format|\n format.json { render :json => {:video_id => @video.id, :aws_videos_path => @video.videos_path}, :status => :ok }\n end\n\n else\n respond_to do |format|\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n\n else\n not_authorized\n end\n\n\n\n end", "def video_params\n params.require(:video).permit(:name, :description, :code)\n\n end", "def create\n binding.pry\n\n @movie = Movie.find(params[:movie_id])\n @kuaibovideo = @movie.kuaibovideos.create!(params[:kuaibovideo])\n redirect_to @movie, :notice => \"Comment created!\"\n\n # @kuaibovideo = Kuaibovideo.new(params[:kuaibovideo])\n\n # respond_to do |format|\n # if @kuaibovideo.save\n # format.html { redirect_to @kuaibovideo, notice: 'Kuaibovideo was successfully created.' }\n # format.json { render json: @kuaibovideo, status: :created, location: @kuaibovideo }\n # else\n # format.html { render action: \"new\" }\n # format.json { render json: @kuaibovideo.errors, status: :unprocessable_entity }\n # end\n # end\n end", "def video_params\n params.require(:video).permit()\n end", "def video_params\n params.require(:video).permit()\n end", "def create\n @file = vid_params['file'].tempfile\n type = vid_params['file'].content_type\n client = YouTubeIt::Client.new(:username => ENV['GMAIL'], :password => ENV['GMAIL_PASSWORD'], :dev_key => ENV[\"YOUTUBE_API_KEY\"])\n res = client.video_upload(@file, title: vid_params['title'], description: vid_params['description'], category: 'People', :keywords => ['darity', 'dare', 'charity'])\n @video = Video.new(url: res.player_url, uid: res.player_url.gsub(/&.*/, \"\").gsub(/.*=/, \"\"), description: vid_params[\"description\"], title: vid_params['title'], dare_id: params[:dare_id])\n if @video.save\n redirect_to current_user\n else\n render html: \"Error\"\n end\n end", "def video_params\n params.require(:video).permit :title, :description, :camera_id, :data\n end", "def create\n @video_intitucional = VideoIntitucional.new(video_intitucional_params)\n\n respond_to do |format|\n if @video_intitucional.save\n format.html { redirect_to @video_intitucional, notice: 'Video intitucional was successfully created.' }\n format.json { render :show, status: :created, location: @video_intitucional }\n else\n format.html { render :new }\n format.json { render json: @video_intitucional.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @channel = params[:forminfo]\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end" ]
[ "0.73241967", "0.7229517", "0.7002079", "0.6946003", "0.6913733", "0.69066614", "0.6903843", "0.6891531", "0.6826155", "0.67904294", "0.67337", "0.6706991", "0.6704616", "0.6683732", "0.66809833", "0.66770035", "0.6672941", "0.66521055", "0.66498446", "0.65276885", "0.6525682", "0.6525682", "0.6525682", "0.6525682", "0.6525682", "0.6495162", "0.64892024", "0.64892024", "0.64892024", "0.64892024", "0.6471237", "0.6459169", "0.64581645", "0.64581645", "0.6455306", "0.64342076", "0.64324206", "0.6414461", "0.6399782", "0.6390962", "0.6384536", "0.6383774", "0.6330121", "0.6329682", "0.6325737", "0.632375", "0.63177097", "0.631533", "0.63026655", "0.6302277", "0.6293886", "0.6281119", "0.62797076", "0.62660164", "0.62286633", "0.62241995", "0.6222645", "0.6203711", "0.6192234", "0.61840516", "0.617548", "0.6166251", "0.61629766", "0.6152305", "0.6151089", "0.6145429", "0.61432344", "0.6133726", "0.612395", "0.6119709", "0.611553", "0.6110205", "0.6106455", "0.6100584", "0.60970414", "0.60963273", "0.60850513", "0.6077565", "0.6072629", "0.60632366", "0.60605145", "0.6058196", "0.60516214", "0.60392463", "0.6030847", "0.6025903", "0.6025903", "0.60219365", "0.60216033", "0.6017414", "0.6004596", "0.5993066", "0.59923613", "0.5989269", "0.59880203", "0.59880203", "0.59879655", "0.5970433", "0.5968532", "0.59655774" ]
0.76216257
0
PATCH/PUT /registro_videoconferencia/1 PATCH/PUT /registro_videoconferencia/1.json
def update respond_to do |format| if @registro_videoconferencium.update(registro_videoconferencium_params) format.html { redirect_to @registro_videoconferencium, notice: 'Registro videoconferencium was successfully updated.' } format.json { render :show, status: :ok, location: @registro_videoconferencium } else format.html { render :edit } format.json { render json: @registro_videoconferencium.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @video.update(video_params)\n render json: @video\n end", "def update\n respond_to do |format|\n if @demanda_videomonitoramento.update(demanda_videomonitoramento_params)\n format.html { redirect_to @demanda_videomonitoramento, notice: 'Demanda videomonitoramento was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @demanda_videomonitoramento.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @congratulations_video.update(congratulations_video_params)\n format.html { redirect_to @congratulations_video, notice: 'Congratulations video was successfully updated.' }\n format.json { render :show, status: :ok, location: @congratulations_video }\n else\n format.html { render :edit }\n format.json { render json: @congratulations_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video.competition, notice: 'Video modificado correctamente..' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @videoo.update(videoo_params)\n format.html { redirect_to @videoo, notice: 'Videoo was successfully updated.' }\n format.json { render :show, status: :ok, location: @videoo }\n else\n format.html { render :edit }\n format.json { render json: @videoo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n @llaves = params[:parts].keys\n @vals = params[:parts].values\n i = 0\n\t\t\t\tparams[:parts].each do |part|\n\t\t\t\t\t\n if !Participante.find(@llaves[i].to_i).update(participante_params(ActionController::Parameters.new(@vals[i])))\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n i = i + 1\n end\n\n format.html { redirect_to @video, notice: 'El video se ha actualizado con éxito.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Vídeo atualizada com sucesso' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to videos_path(), notice: 'Video atualizado com sucesso.' }\n format.json { render :index, status: :ok, location: @video }\n else\n format.html { redirect_to edit_video_path(@video), alert: 'Video não atualizado' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @video = Video.find(params[:id])\n\tif @video.user == current_user or user_type == 'admin' or user_type == 'super_admin' \n\t\trespond_to do |format|\n\t\t if @video.update_attributes(params[:video])\n\t\t\tformat.html { redirect_to @video, :notice => 'Видео успешно обновлено' }\n\t\t\tformat.json { head :no_content }\n\t\t else\n\t\t\tformat.html { render :action => \"edit\" }\n\t\t\tformat.json { render :json => @video.errors, :status => :unprocessable_entity }\n\t\t end\n\t\tend\n\telse\n\t\tredirect_to '/404'\n\tend\n end", "def update\n respond_to do |format|\n if @cambio_comision_registro.update(cambio_comision_registro_params)\n format.html { redirect_to @cambio_comision_registro, notice: 'Cambio comision registro was successfully updated.' }\n format.json { render :show, status: :ok, location: @cambio_comision_registro }\n else\n format.html { render :edit }\n format.json { render json: @cambio_comision_registro.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @participante_videoconferencium.update(participante_videoconferencium_params)\n format.html { redirect_to @participante_videoconferencium, notice: 'Participante videoconferencium was successfully updated.' }\n format.json { render :show, status: :ok, location: @participante_videoconferencium }\n else\n format.html { render :edit }\n format.json { render json: @participante_videoconferencium.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { \n flash[:notice] = \"Vídeo atualizado!\"\n redirect_to(:action => 'show', :id => @video.id, :palestrante_id => @palestrante.id)\n }\n format.json { head :no_content }\n else\n format.html { \n @agendas = Agenda.recentes\n @palestrantes = Palestrante.order('nome ASC')\n render action: 'edit' \n }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n cantidad_evaluaciones = Evaluacion.where(video_id: params[:id]).count\n if cantidad_evaluaciones != 0\n render json: [\"El video ya está siendo evaluado!\"], status: :unprocessable_entity and return\n end\n \n delete_key = @video.attach_file_name\n @video.transcoder_job_id = nil\n @video.conversion_status = nil\n @video.identidad_verificada = nil\n @video.save\n saved = @video.update_attributes(video_params)\n puts \"VIDEO PARAMS\"\n puts video_params\n puts \"##############################################################################\"\n @video.errors.inspect\n puts \"##############################################################################\"\n respond_to do |format|\n if saved\n\n Video.initiate_video_conversion @video, !delete_key.blank?\n \n if @video.conversion_status == \"COMPLETED\"\n flash.notice = 'El video fue subido correctamente.'\n end\n if @video.conversion_status == \"ERROR\"\n flash.alert = 'Hubo un error al procesar el video.'\n end\n if current_persona.rol.rol == \"Profesor\"\n\n format.json { render json: { url: profesor_panel_path}, status: :ok }\n end\n if current_persona.rol.rol == \"Camarógrafo\"\n format.json { render json: { url: observador_path}, status: :ok }\n end\n else\n #format.html { render :new }\n @video.intentos = @video.intentos + 1\n @video.save(validate: false)\n #format.html { redirect_to new_video_path(profesor_id: @video.profesor_id), alert: 'Debe seleccionar un archivo' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n #render json: { error: @video.errors.full_messages.join(',')}, :status => 400\n end\n end\n end", "def update\n respond_to do |format|\n if @relatorio_plano_de_voo.update(relatorio_plano_de_voo_params)\n format.html { redirect_to @relatorio_plano_de_voo, notice: 'Relatorio plano de voo was successfully updated.' }\n format.json { render :show, status: :ok, location: @relatorio_plano_de_voo }\n else\n format.html { render :edit }\n format.json { render json: @relatorio_plano_de_voo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json {\n render json: { files: [@video.to_jq_upload], url: video_path(@video), message: \"Uploaded successfully.\" }, status: :created, location: @video\n }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @empresa = Empresa.find(params[:empresa_id]) \n @producto = @empresa.productos.find(params[:producto_id])\n @item_producto = @producto.item_productos.find(params[:item_producto_id])\n @videos_producto = @item_producto.videos_productos.find(params[:id]) \n respond_to do |format|\n if @videos_producto.update(videos_productosparams)\n format.html { redirect_to empresa_producto_item_producto_videos_productos_path(@empresa,@producto,@item_producto,@videos_producto), notice: 'Videos producto was successfully updated.' }\n format.json { render :show, status: :ok, location: @videos_producto }\n else\n format.html { render :edit }\n format.json { render json: @videos_producto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @objeto.update(carpeta_params)\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Carpeta was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end", "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 @kuaibovideo = Kuaibovideo.find(params[:id])\n\n respond_to do |format|\n if @kuaibovideo.update_attributes(params[:kuaibovideo])\n format.html { redirect_to @kuaibovideo, notice: 'Kuaibovideo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kuaibovideo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @video = Video.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @video = Video.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @videoconferencium.update(videoconferencium_params)\n format.html { redirect_to @videoconferencium, notice: 'Videoconferencium was successfully updated.' }\n format.json { render :show, status: :ok, location: @videoconferencium }\n else\n format.html { render :edit }\n format.json { render json: @videoconferencium.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @video = Video.find(params[:id])\n params[:video][:token] = token_from_link params[:video][:token]\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @video = Video.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @video = Video.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @video = Video.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @video = Video.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @video = Video.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @video = Video.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @video = Video.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to home_admin_path, notice: '视频更新成功!' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @reparticao.update(reparticao_params)\n format.html { redirect_to @reparticao, notice: 'Reparticao was successfully updated.' }\n format.json { render :show, status: :ok, location: @reparticao }\n else\n format.html { render :edit }\n format.json { render json: @reparticao.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @traditional_route_video.update(traditional_route_video_params)\n format.html { redirect_to @traditional_route_video, notice: 'Traditional route video was successfully updated.' }\n format.json { render :show, status: :ok, location: @traditional_route_video }\n else\n format.html { render :edit }\n format.json { render json: @traditional_route_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |wants|\n wants.json {\n result = {}\n video = Video.find_by_tag_id(params[:tid])\n if video\n if video.update_attributes(params[:video])\n result[:result] = \"ok\"\n render :json => result.to_json\n return\n else\n result[:result] = video.errors_full_messages\n end\n else\n result[:result] = \"不存在该视频\"\n end\n render :json => result.to_json, :status => 400\n }\n end\n end", "def edit_video(video_id, title, description, method = HTTP_PUT)\n request_xml = %{\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <vzaar-api>\n }\n request_xml += %{<_method>put</_method>} if method != HTTP_PUT\n request_xml += %{\n <video>\n <title>#{title}</title>\n <description>#{description}</description >\n </video>\n </vzaar-api>\n }\n auth_connection HTTP_PUT, \"/api/videos/#{video_id}.xml\", request_xml\n end", "def update\n @video = Video.find(params[:id])\n @video.update_attributes\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { redirect_to videos_path , alert: 'Video was not successfully updated.' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @observacao_vocacionada = ObservacaoVocacionada.find(params[:id])\n\n respond_to do |format|\n if @observacao_vocacionada.update_attributes(params[:observacao_vocacionada])\n format.html { redirect_to @observacao_vocacionada}\n flash[:notice] = \"Registro alterado com sucesso!\"\n else\n format.html { render action: \"edit\" }\n format.json { render json: @observacao_vocacionada.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n # @video = Video.find(params[:id])\n @video = current_user.videos.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.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\r\n @video = Video.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @video.update_attributes(params[:video])\r\n format.html { redirect_to \"/videos?p=\" + @@ADMIN_PASS }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @video.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\r\n respond_to do |format|\r\n if @comite_registro.update(comite_registro_params)\r\n format.html { redirect_to @comite_registro, notice: 'Su petición para registrar su comité tutorial fue actualizada.' }\r\n format.json { render :show, status: :ok, location: @comite_registro }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @comite_registro.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n respond_to do |format|\n if @capitulo.update(capitulo_params)\n format.html { redirect_to @capitulo, notice: 'Capitulo was successfully updated.' }\n format.json { render :show, status: :ok, location: @capitulo }\n else\n format.html { render :edit }\n format.json { render json: @capitulo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update_attributes(params[:text]) && @resource.update_attributes(params[:resource])\n format.js\n end\n end\n end", "def update\n respond_to do |format|\n if @medio_video.update(medio_video_params)\n format.html { redirect_to @medio_video, notice: 'Medio video was successfully updated.' }\n format.json { render :show, status: :ok, location: @medio_video }\n else\n format.html { render :edit }\n format.json { render json: @medio_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @tipo_pregunta = TipoPregunta.find(params[:id])\n\n if @tipo_pregunta.update(params[:tipo_pregunta])\n head :no_content\n else\n render json: @tipo_pregunta.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @registro_servicio.update(registro_servicio_params)\n format.html { redirect_to @registro_servicio, notice: 'Servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @registro_servicio }\n else\n format.html { render :edit }\n format.json { render json: @registro_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @video = Video.find(params[:id])\n @licenses = License.all\n @galleries = Gallery.all\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @saved_video.update(saved_video_params)\n format.html { redirect_to @saved_video, notice: 'Saved video was successfully updated.' }\n format.json { render :show, status: :ok, location: @saved_video }\n else\n format.html { render :edit }\n format.json { render json: @saved_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @regra_negocio.update(regra_negocio_params)\n format.html { redirect_to @regra_negocio, notice: 'Regra negocio was successfully updated.' }\n format.json { render :show, status: :ok, location: @regra_negocio }\n else\n format.html { render :edit }\n format.json { render json: @regra_negocio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @registro_bovino = RegistroBovino.find(params[:id])\n\n respond_to do |format|\n if @registro_bovino.update_attributes(params[:registro_bovino])\n #format.html { redirect_to @registro_bovino, notice: 'Registro bovino 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: @registro_bovino.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @vocacionada = Vocacionada.find(params[:id])\n\n respond_to do |format|\n if @vocacionada.update_attributes(params[:vocacionada])\n format.html { redirect_to vocacionadas_url}\n flash[:notice] = \"Registro alterado com sucesso!\"\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vocacionada.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @objeto.update(imagen_params)\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Imagen 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 @respuesta = Respuesta.find(params[:id])\n\n if @respuesta.update(params[:respuesta])\n head :no_content\n else\n render json: @respuesta.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @voluntario.update(voluntario_params)\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 respond_to do |format|\n if @voluntario.update(voluntario_params)\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 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 @video = Video.find_by_hash_permalink_id(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @user_video = UserVideo.find(params[:id])\n\n respond_to do |format|\n if @user_video.update_attributes(params[:user_video])\n format.html { redirect_to @user_video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @veterinario.update(veterinario_params)\n format.html { redirect_to @veterinario, notice: \"Veterinario was successfully updated.\" }\n format.json { render :show, status: :ok, location: @veterinario }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @veterinario.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video_intitucional.update(video_intitucional_params)\n format.html { redirect_to @video_intitucional, notice: 'Video intitucional was successfully updated.' }\n format.json { render :show, status: :ok, location: @video_intitucional }\n else\n format.html { render :edit }\n format.json { render json: @video_intitucional.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @veterinario.update(veterinario_params)\n format.html { redirect_to @veterinario, notice: 'Veterinario was successfully updated.' }\n format.json { render :show, status: :ok, location: @veterinario }\n else\n format.html { render :edit }\n format.json { render json: @veterinario.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @c_video = CVideo.find(params[:id])\n\n respond_to do |format|\n if @c_video.update_attributes(params[:c_video])\n format.html { redirect_to @c_video, notice: 'The video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @c_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @table_video.update(table_video_params)\n format.html { redirect_to @table_video, notice: 'Table video was successfully updated.' }\n format.json { render :show, status: :ok, location: @table_video }\n else\n format.html { render :edit }\n format.json { render json: @table_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @tipo_venda.update(tipo_venda_params)\n format.html { redirect_to @tipo_venda, notice: 'Tipo venda was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_venda }\n else\n format.html { render :edit }\n format.json { render json: @tipo_venda.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @cambio_director_tesis_registro.update(cambio_director_tesis_registro_params)\n format.html { redirect_to @cambio_director_tesis_registro, notice: 'Su petición para cambiar de director(es) de tesis fue actualizada.' }\n format.json { render :show, status: :ok, location: @cambio_director_tesis_registro }\n else\n format.html { render :edit }\n format.json { render json: @cambio_director_tesis_registro.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize! :update, @admin_video\n\n respond_to do |format|\n if @admin_video.update(admin_video_params)\n format.html { redirect_to @admin_video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def registro_videoconferencium_params\n params.require(:registro_videoconferencium).permit(:estado, :fecha, :hora, :descripcion, :videoconferencia)\n end", "def update\n respond_to do |format|\n if @sales_video.update(sales_video_params)\n format.html { redirect_to sales_seller_course_video_path(@seller, @course, @sales_video), notice: \"Video foi atualizado com sucesso.\" }\n format.json { render :show, status: :ok, location: @sales_video }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @sales_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n puts \"HACE ALGOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO\"\n if !params[:reserva][:tipo_reserva].blank?\n @tipo_reserva = TipoReserva.find(params[:reserva][:tipo_reserva])\n @reserva.tipo_reserva = @tipo_reserva\n end\n\n if !params[:reserva][:habitacion].blank?\n @habitacion = Habitacion.find(params[:reserva][:habitacion])\n @reserva.habitacion = @habitacion\n end\n\n if !params[:reserva][:cliente].blank?\n @cliente = Cliente.find(params[:reserva][:cliente])\n @reserva.cliente = @cliente\n end\n if !params[:reserva][:confirmada].blank?\n @reserva.confirmada = params[:reserva][:confirmada]\n end\n if @reserva.update(reserva_params)\n format.html { redirect_to reservas_url, notice: 'Reserva modificada con exito.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @reserva.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @vrsta_inventara.update(vrsta_inventara_params)\n format.html { redirect_to vrsta_inventaras_url, notice: 'Vrsta inventara je uspješno ažurirana.' }\n format.json { render :show, status: :ok, location: @vrsta_inventara }\n else\n format.html { render :edit }\n format.json { render json: @vrsta_inventara.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n @video = Video.new(params[:video])\n @video.resource_id = @resource.id\n \n @video.video = @video.video.gsub(\"https://\", \"\")\n @video.video = @video.video.gsub(\"http://\", \"\")\n @video.video = @video.video.gsub(\"www.youtube.com/watch?v=\", \"\")\n\n @resource.attachment = @video\n @resource.save\n \n @video.save\n\n respond_to do |format|\n if @video.update_attributes(params[:text]) && @resource.update_attributes(params[:resource])\n format.js\n end\n end \n end", "def update\n @video = Video.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes params[:video]\n format.html { redirect_to catnum_path(@video.catnum), notice: 'updated!' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @jeux_video.update(jeux_video_params)\n @jeux_video.create_activity :update, owner: current_user, read: false\n format.html { redirect_to @jeux_video, notice: 'Jeux video was successfully updated.' }\n format.json { render :show, status: :ok, location: @jeux_video }\n else\n format.html { render :edit }\n format.json { render json: @jeux_video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to board_video_path(@board, @video), notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @reconocimiento = Reconocimiento.find(params[:id])\n\n respond_to do |format|\n if @reconocimiento.update_attributes(params[:reconocimiento])\n format.html { redirect_to @reconocimiento, :notice => 'Reconocimiento was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @reconocimiento.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n\n\n @project = Project.user_readable(current_user, params[:project_id])\n\n if @project\n\n @video = @project.videos.find(params[:id])\n\n if @video.update(params[:project_video])\n respond_to do |format|\n format.json { render :json => {:video_id => @video.id,\n :aws_videos_path => @video.videos_path}, :status => :ok }\n end\n\n else\n respond_to do |format|\n format.json { render json: @video.errors, status: :unprocessable_entity }\n #format.html { render action: \"edit\" }\n end\n end\n\n\n else\n not_authorized\n end\n\n\n\n\n\n end", "def update\n if @video.update({:owner => current_user}.merge(video_params))\n render json: @video, :include => ALL_INCLUDES\n else\n render json: @video.errors, status: :unprocessable_entity\n end\n end", "def set_registro_videoconferencium\n @registro_videoconferencium = RegistroVideoconferencium.find(params[:id])\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 respond_to do |format|\n if @vacina.update(vacina_params)\n format.html { redirect_to @vacina, notice: 'Vacina editada com sucesso.' }\n format.json { render :show, status: :ok, location: @vacina }\n else\n format.html { render :edit }\n format.json { render json: @vacina.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n # authorize @becario\n respond_to do |format|\n if @becario.update(becario_params)\n format.html { redirect_to @becario, notice: 'Becario was successfully updated.' }\n format.json { render :show, status: :ok, location: @becario }\n else\n format.html { render :edit }\n format.json { render json: @becario.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.6657814", "0.6642695", "0.6566486", "0.65051895", "0.64917237", "0.6420386", "0.64182496", "0.64071727", "0.6363297", "0.6329276", "0.6314783", "0.62917626", "0.62592393", "0.6252212", "0.6208935", "0.6208935", "0.6208935", "0.6208935", "0.6208935", "0.62079245", "0.62042856", "0.6202903", "0.62017244", "0.6200968", "0.61883867", "0.61883867", "0.6188047", "0.6184793", "0.6180226", "0.6180226", "0.6180226", "0.6180226", "0.6180226", "0.6180226", "0.6180226", "0.61602527", "0.6142687", "0.61402816", "0.6139509", "0.6139509", "0.6139509", "0.6139509", "0.6139509", "0.6139509", "0.6139509", "0.6139509", "0.6139509", "0.6139509", "0.6139509", "0.6139509", "0.6139509", "0.61382", "0.6135467", "0.61214846", "0.6119809", "0.6094931", "0.60770255", "0.6071109", "0.6063333", "0.6055162", "0.6054844", "0.6053431", "0.60525376", "0.6049333", "0.60466117", "0.603349", "0.6030545", "0.60280967", "0.6020113", "0.60136586", "0.6012135", "0.599252", "0.5990121", "0.5990121", "0.59889716", "0.5970655", "0.5969679", "0.5967612", "0.5962356", "0.5950949", "0.5950547", "0.5945156", "0.5944975", "0.59304905", "0.5930442", "0.5929349", "0.5927936", "0.5927229", "0.59244627", "0.59096414", "0.59057385", "0.59032935", "0.58970284", "0.5893972", "0.58926404", "0.5892216", "0.5890922", "0.5888174", "0.5876018", "0.5875127" ]
0.70241773
0